diff --git a/public/sandbox/config-sandbox.json b/public/sandbox/config-sandbox.json index 66c5f718..0176674c 100644 --- a/public/sandbox/config-sandbox.json +++ b/public/sandbox/config-sandbox.json @@ -25,8 +25,8 @@ "path": "viz-guardrails/DataExplorer.tsx", "parameters": { "dataset": "clean_data", - "start_date": "2023-01-03", - "end_date": "2023-12-31", + "start_date": "2019-01-03", + "end_date": "2024-12-01", "initial_selection": [], "allow_time_slider": true, "allow_guardrail_selector": true, diff --git a/src/public/viz-guardrails/Selector.tsx b/src/public/viz-guardrails/Selector.tsx index ca0bb8d2..92411e89 100644 --- a/src/public/viz-guardrails/Selector.tsx +++ b/src/public/viz-guardrails/Selector.tsx @@ -35,7 +35,7 @@ export function Selector({ // { value: 'super_summ', label: 'Sup. Summ.' }, // { value: 'juxt_data', label: 'Juxt. Data' }, // { value: 'juxt_summ', label: 'Juxt. Summ.' }, - { value: 'random', label: 'Random' }, + { value: 'super_data', label: 'Random' }, ]} /> diff --git a/src/public/viz-guardrails/Sidebar.tsx b/src/public/viz-guardrails/Sidebar.tsx index 8d079c78..918dd89e 100644 --- a/src/public/viz-guardrails/Sidebar.tsx +++ b/src/public/viz-guardrails/Sidebar.tsx @@ -27,17 +27,17 @@ export function Sidebar({ range, guardrail, } : { - parameters: ChartParams, - data: any[], - dataname: string, - items: any[], - selection: any[] | null, - setSelection: (value: Array) => void, - trackSelection: (value: Array) => void, - range: [Date, Date] | null, - guardrail: string + parameters: ChartParams, + data: any[], + dataname: string, + items: any[], + selection: any[] | null, + setSelection: (value: Array) => void, + trackSelection: (value: Array) => void, + range: [Date, Date] | null, + guardrail: string }) { - // ---------------------------- Setup ---------------------------- +// ---------------------------- Setup ---------------------------- const xScale = useMemo(() => { if (range) { @@ -81,8 +81,8 @@ export function Sidebar({ const paths = items?.map((x) => ({ country: x.name as string, - path: lineGenerator(data.filter((val) => (val[parameters.cat_var] === x.name))) as string, - area: areaGenerator(data.filter((val) => (val[parameters.cat_var] === x.name))) as string, + path: lineGenerator(data.filter((val) => val[parameters.cat_var] === x.name)) as string, + area: areaGenerator(data.filter((val) => val[parameters.cat_var] === x.name)) as string, })); return paths; @@ -99,60 +99,70 @@ export function Sidebar({ // ---------------------------- Render ---------------------------- return ( - { setSelection(xs); trackSelection(xs); }} - spacing={0} - offset="sm" - styles={(parameters.allow_selection === false) ? { root: { pointerEvents: 'none' } } : { root: { pointerEvents: 'auto' } }} - > - {items?.map((item) => ( - <> - {item.name === 'Eldoril North' ? : null} - {item.name === 'Eldoril West' ? : null} - {item.name === 'Silvoria North' ? : null} - - - - - - {item.name} - - - - - - x.country === item.name)[0].area} - /> - x.country === item.name)[0].path} - /> - - - - - - ))} - +
+ { + setSelection(xs); + trackSelection(xs); + }} + spacing={0} + offset="sm" + styles={ + parameters.allow_selection === false + ? { root: { pointerEvents: 'none' } } + : { root: { pointerEvents: 'auto' } } + } + > + {items?.map((item) => ( + <> + {item.name === 'Eldoril North' ? : null} + {item.name === 'Eldoril West' ? : null} + {item.name === 'Silvoria North' ? : null} + + + + + {item.name} + + + + + + x.country === item.name)[0]?.area} + /> + x.country === item.name)[0]?.path} + /> + + + + + ))} + +
); }