Skip to content

Commit 67edd20

Browse files
Update map rendering and simplify it using D3
1 parent d8403e8 commit 67edd20

36 files changed

Lines changed: 619 additions & 681 deletions

package-lock.json

Lines changed: 131 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@undp/data-viz",
3-
"version": "2.2.3",
3+
"version": "2.3.1",
44
"main": "./dist/index.cjs",
55
"module": "./dist/index.js",
66
"browser": "./dist/index.umd.js",
@@ -436,6 +436,7 @@
436436
"@turf/area": "^7.2.0",
437437
"@turf/bbox": "^7.2.0",
438438
"@turf/center-of-mass": "^7.2.0",
439+
"@turf/rewind": "^7.3.3",
439440
"babel-plugin-react-compiler": "^1.0.0",
440441
"d3-array": "^3.2.4",
441442
"d3-delaunay": "^6.0.4",

readme.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,9 @@ Adding a new chart or graph to the library requires multiple steps:
9999
* Add the missing settings to `GraphSettingsDataType` in `./src/Types.tsx`
100100
* Add the graph configuration settings in `./src/Utils/transformData/graphConfig.ts`
101101
* Add the graph to the list in `./src/Utils/getGraphList.tsx`
102-
* Add the file names in the next step to the `getDataSchema` and `getSettingsSchema` functions in `./src/Schemas/getSchema.tsx`
103102
* Add the graph to the `graphComponent` and `getGraphProps` functions in `./src/Components/Dashboard/GraphEl.tsx`
104103
* Finally add an export in `./src/index.ts`
105104

106-
Adding schema
107-
__Schemas are in different repo: [undp-viz-library-schema](https://github.com/UNDP-Data/undp-viz-library-schemas)
108-
109-
* Add the data schema for the graph and graph settings schema to the `dataSchema` folder.
110-
* Also add the missing properties to the `SettingSchema` in `settingSchema` folder
111-
112105
Adding documentation and stories in storybook:
113106

114107
* Add a new story in `./src/stories/Graph+Map+Chart` folder

src/Components/Dashboard/GraphEl.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,8 @@ function GraphEl(props: Props) {
909909
zoomInteraction: settings?.zoomInteraction,
910910
animate: settings?.animate,
911911
zoomAndCenterByHighlightedIds: settings?.zoomAndCenterByHighlightedIds,
912+
projectionRotate: settings?.projectionRotate,
913+
rewindCoordinatesInMapData: settings?.rewindCoordinatesInMapData,
912914
};
913915
case 'biVariateChoroplethMap':
914916
return {
@@ -969,6 +971,8 @@ function GraphEl(props: Props) {
969971
zoomInteraction: settings?.zoomInteraction,
970972
animate: settings?.animate,
971973
zoomAndCenterByHighlightedIds: settings?.zoomAndCenterByHighlightedIds,
974+
projectionRotate: settings?.projectionRotate,
975+
rewindCoordinatesInMapData: settings?.rewindCoordinatesInMapData,
972976
};
973977
case 'dotDensityMap':
974978
return {
@@ -1022,6 +1026,8 @@ function GraphEl(props: Props) {
10221026
classNames: settings?.classNames,
10231027
zoomInteraction: settings?.zoomInteraction,
10241028
animate: settings?.animate,
1029+
projectionRotate: settings?.projectionRotate,
1030+
rewindCoordinatesInMapData: settings?.rewindCoordinatesInMapData,
10251031
};
10261032
case 'hybridMap':
10271033
return {
@@ -1086,6 +1092,8 @@ function GraphEl(props: Props) {
10861092
dotColor: settings?.dotColor,
10871093
dotBorderColor: settings?.dotBorderColor,
10881094
labelColor: settings?.labelColor,
1095+
projectionRotate: settings?.projectionRotate,
1096+
rewindCoordinatesInMapData: settings?.rewindCoordinatesInMapData,
10891097
};
10901098
case 'donutChart':
10911099
return {

0 commit comments

Comments
 (0)