Skip to content

Commit

Permalink
Merge pull request #822 from CodeForAfrica/ft/multiline-chart
Browse files Browse the repository at this point in the history
HURUMap MultiLineChart
  • Loading branch information
kelvinkipruto authored Aug 6, 2024
2 parents 2ca5fd9 + 95b271c commit 610cde4
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 716 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Scope } from "@hurumap/core";

import MultiLineChartScope from "./MultiLineChartScope";
import StackedChartScope from "./StackedChartScope";
import VerticalStackedChartScope from "./VerticalStackedChartScope";

Expand All @@ -9,8 +8,9 @@ import theme from "@/climatemappedafrica/theme";

const {
BarChartScope,
LineChartScope,
DonutChartScope,
LineChartScope,
MultiLineChartScope,
TreemapChartScope,
VerticalBarChartScope,
} = Scope;
Expand All @@ -34,24 +34,6 @@ export default function configureScope(
let vegaSpec;
const chartType = configuration?.chart_type?.toLowerCase();

/**
* @deprecated Use scopeOptions for implementing new charts
* This will be completely removed once all charts scopes
* are moved to Hurumap package
*/
// eslint-disable-next-line no-underscore-dangle
const _scopeOptions = [
indicator?.data,
indicator?.metadata,
configuration,
secondaryIndicator?.data ?? null,
showParent ? indicator?.parentData : [{}],
showParent ? secondaryIndicator?.parentData : [{}],
profileNames,
isCompare,
isMobile,
];

const scopeOptions = {
primaryData: indicator?.data,
metadata: indicator?.metadata,
Expand All @@ -69,7 +51,7 @@ export default function configureScope(
switch (chartType) {
case "line":
if (configuration?.stacked_field) {
vegaSpec = MultiLineChartScope(..._scopeOptions);
vegaSpec = MultiLineChartScope(scopeOptions);
} else {
vegaSpec = LineChartScope(scopeOptions);
}
Expand Down
Loading

0 comments on commit 610cde4

Please sign in to comment.