Skip to content

Commit

Permalink
Merge pull request #795 from CodeForAfrica/hurumap/charts-to-packages
Browse files Browse the repository at this point in the history
Barchart Scope to hurumap core
  • Loading branch information
koechkevin authored Jul 31, 2024
2 parents 64d5ecb + f921b8e commit 5032e98
Show file tree
Hide file tree
Showing 12 changed files with 618 additions and 387 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import BarChartScope from "./BarChartScope";
import { Scope } from "@hurumap/core";

import DonutChartScope from "./DonutChartScope";
import LineChartScope from "./LineChartScope";
import MultiLineChartScope from "./MultiLineChartScope";
Expand All @@ -7,6 +8,11 @@ import TreemapChartScope from "./TreemapChartScope";
import VerticalBarChartScope from "./VerticalBarChartScope";
import VerticalStackedChartScope from "./VerticalStackedChartScope";

import { hurumapArgs } from "@/climatemappedafrica/config";
import theme from "@/climatemappedafrica/theme";

const { BarChartScope } = Scope;

export default function configureScope(
indicator,
secondaryIndicator = null,
Expand Down Expand Up @@ -87,16 +93,21 @@ export default function configureScope(
isCompare,
);
} else {
vegaSpec = BarChartScope(
indicator?.data,
indicator?.metadata,
configuration,
secondaryIndicator?.data ?? null,
showParent ? indicator?.parentData : [{}],
showParent ? secondaryIndicator?.parentData : [{}],
const barChartArgs = {
primaryData: indicator?.data,
metadata: indicator?.metadata,
config: configuration,
secondaryData: secondaryIndicator?.data ?? null,
primaryParentData: showParent ? indicator?.parentData : [{}],
secondaryParentData: showParent
? secondaryIndicator?.parentData
: [{}],
profileNames,
isCompare,
);
theme,
args: hurumapArgs,
};
vegaSpec = BarChartScope(barChartArgs);
}
break;
}
Expand Down
349 changes: 0 additions & 349 deletions apps/pesayetu/src/components/HURUmap/Chart/BarChartScope.js

This file was deleted.

Loading

0 comments on commit 5032e98

Please sign in to comment.