@undp/data-viz 0.0.57 → 0.0.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@undp/data-viz",
3
- "version": "0.0.57",
3
+ "version": "0.0.59",
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.js",
6
6
  "browser": "./dist/index.umd.js",
package/readme.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # UNDP data viz library ![npm](https://img.shields.io/npm/v/@undp/data-viz)
2
2
 
3
- ## Getting Started
3
+ ### Getting Started
4
4
 
5
5
  UNDP data viz library is dedicated to providing a good development experience for data visualization specialists. Before starting, it is recommended to learn React first, and correctly install and configure Node.js v18 or above.
6
6
 
@@ -79,4 +79,26 @@ The dependencies that are pre-installed wit the library:
79
79
  * file-saver - For downloading files
80
80
  * react-csv - For generating a csv file
81
81
  * xlsx - For generating a xlsx file (Peer dependency)
82
- * React (of course!) (Peer dependency)
82
+ * React (of course!) (Peer dependency)
83
+
84
+ ### How to add a new chart or graph
85
+
86
+ Adding a new chart or graph to the library requires multiple steps:
87
+ * Add the code for the graph to `./src/Components/Elements/Graphs/` folder
88
+ * Once the code is done add the id of the graph to either `GraphTypeForGriddedGraph` or `GeoHubGraphType` in `./src/Types.tsx` depending if you want it to be available in `GriddedGraphDashboard` or not
89
+ * Add the missing settings to `GraphSettingsDataType` in `./src/Types.tsx`
90
+ * Add the graph configuration settings in `./src/Utils/transformData/graphConfig.json`
91
+ * Add the graph to the list in `./src/Utils/transformData/getGraphList.json`
92
+ * Add the data schema for the graph and graph settings schema to the `./src/Schemas/schemaList.tsx`
93
+ * Also add the missing properties to the `SettingSchema` in `./src/Schemas/schemaList.tsx`
94
+ * Add the data schema and settings schema to the `getDataSchema` and `getSettingsSchema` functions in `./src/Schemas/getSchema.tsx`
95
+ * Add the graph to the `graphComponent` and `getGraphProps` functions in `./src/Components/Dashboard/GraphEl.tsx`
96
+ * Finally add an export in `./src/index.tsx`
97
+
98
+ Adding documentation and stories in storybook:
99
+ * Add a new story in `./src/stories/Graph+Map+Chart` folder
100
+ * Add a graph name and id to `GraphNames` in `./src/stories/assets/constants.ts`
101
+ * Add a config file for the graph in `./src/stories/assets/config` folder
102
+ * Add the graph in `./src/stories/assets/graphSettingsSelect.ts`
103
+ * Add the graph in `./src/stories/assets/graphDataConfigSelect.ts`
104
+