Skip to content

Commit

Permalink
Build: (4972992) Cleanup and changed 'geoview' to 'geochart' property
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-NRCan committed Sep 27, 2023
1 parent 12bdf0b commit cc2ab63
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
position: 'top',
}
},
geoview: {
geochart: {
chart: "line",
xSlider: {
display: false,
Expand Down Expand Up @@ -306,7 +306,7 @@
suggestedMax: 500,
}
},
geoview: {
geochart: {
chart: "line",
xSlider: {
display: true,
Expand Down Expand Up @@ -377,5 +377,5 @@
importOptionsParsed(OPTIONS_1);

cgpv.init(function () {
console.log('api is ready!!!!!');
console.log('api is ready');
});</script></body></html>
34 changes: 17 additions & 17 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5350,6 +5350,9 @@ const Box = createBox({
});
false ? 0 : void 0;
/* harmony default export */ const Box_Box = (Box);
;// CONCATENATED MODULE: ./src/chart/chart-types.ts
var EVENT_CHART_CHANGED = "chart/changed";
var EVENT_CHART_PARSE = "chart/parse";
;// CONCATENATED MODULE: ./src/chart/chart-parser.tsx
var COLOR_PALETTE = ['purple', 'hotpink', 'pink', 'lavender', 'red'];
function formatTypeFeaturePropsDataset(featProps, optionsParams) {
Expand Down Expand Up @@ -5431,7 +5434,7 @@ data, optionsParams) {
// Cast to OptionsGeoView
var theOptionsGeoView = theOptions;
// The basic geoview options
theOptionsGeoView.geoview = {
theOptionsGeoView.geochart = {
chart: optionsParams.chart
};
// Return the complete options
Expand Down Expand Up @@ -20564,6 +20567,7 @@ var update = injectStylesIntoStyleTag_default()(chart_module/* default */.Z, opt




/**
* Create a customized Chart UI
*
Expand Down Expand Up @@ -20594,7 +20598,7 @@ function chart_Chart(props) {
setOptions = _useState4[1];
var Slider = ui.elements.Slider;
useEffect(function () {
// Function to handle 'chart/changed'
// Function to handle EVENT_CHART_CHANGED
var funcHandlerChartChanged = function funcHandlerChartChanged(e) {
// Cast
var p = e.detail;
Expand All @@ -20609,10 +20613,7 @@ function chart_Chart(props) {
setOptions(p.options);
}
};
// TODO: Use something else than 'window'?
// Wire handler
w.addEventListener('chart/changed', funcHandlerChartChanged);
// Function to handle 'chart/parse'
// Function to handle EVENT_CHART_PARSE
var funcHandlerChartParse = function funcHandlerChartParse(e) {
// Cast
var p = e.detail;
Expand All @@ -20624,18 +20625,19 @@ function chart_Chart(props) {
};
// TODO: Use something else than 'window'?
// Wire handler
w.addEventListener('chart/parse', funcHandlerChartParse);
w.addEventListener(EVENT_CHART_CHANGED, funcHandlerChartChanged);
// TODO: Use something else than 'window'?
// Wire handler
w.addEventListener(EVENT_CHART_PARSE, funcHandlerChartParse);
return function () {
// Unwire handler on unmount
w.removeEventListener('chart/changed', funcHandlerChartChanged);
w.removeEventListener('chart/parse', funcHandlerChartParse);
w.removeEventListener(EVENT_CHART_CHANGED, funcHandlerChartChanged);
w.removeEventListener(EVENT_CHART_PARSE, funcHandlerChartParse);
};
});
// eslint-disable-next-line no-console
console.log('Load', data, options);
function renderChart() {
// Depending on the type of chart
switch (options.geoview.chart) {
switch (options.geochart.chart) {
case 'bar':
// Vertical Bars Chart
return (0,jsx_runtime.jsx)("div", {
Expand Down Expand Up @@ -20670,7 +20672,7 @@ function chart_Chart(props) {
}
function renderXSlider() {
if (options) {
var xSlider = options.geoview.xSlider;
var xSlider = options.geochart.xSlider;
if (xSlider !== null && xSlider !== void 0 && xSlider.display) {
return (0,jsx_runtime.jsx)(Box_Box, {
sx: {
Expand Down Expand Up @@ -20704,7 +20706,7 @@ function chart_Chart(props) {
}
function renderYSlider() {
if (options) {
var ySlider = options.geoview.ySlider;
var ySlider = options.geochart.ySlider;
if (ySlider !== null && ySlider !== void 0 && ySlider.display) {
return (0,jsx_runtime.jsx)(Box_Box, {
sx: {
Expand Down Expand Up @@ -20779,7 +20781,7 @@ var App = function App() {
}]
},
options: {
geoview: {
geochart: {
chart: 'line'
}
}
Expand All @@ -20790,8 +20792,6 @@ var App = function App() {
;// CONCATENATED MODULE: ./src/index.tsx


// import React from 'react';
// import { createRoot } from 'react-dom/client';
// Fetch the cgpv module
var w = window;
var cgpv = w['cgpv'];
Expand Down

0 comments on commit cc2ab63

Please sign in to comment.