@cdc/chart 4.24.2 → 4.24.3

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.
Files changed (57) hide show
  1. package/dist/cdcchart.js +47386 -36618
  2. package/examples/chart-regression-1.json +378 -0
  3. package/examples/chart-regression-2.json +2360 -0
  4. package/examples/feature/filters/url-filter.json +1076 -0
  5. package/examples/feature/line/line-chart.json +2 -1
  6. package/examples/feature/regions/index.json +50 -4
  7. package/examples/feature/sankey/sankey-example-data.json +1364 -0
  8. package/examples/feature/sankey/sankey_chart_data.csv +20 -0
  9. package/examples/gallery/bar-chart-vertical/vertical-bar-chart-stacked.json +306 -19
  10. package/examples/sparkline.json +868 -0
  11. package/index.html +128 -123
  12. package/package.json +4 -2
  13. package/src/CdcChart.tsx +40 -22
  14. package/src/_stories/ChartEditor.stories.tsx +14 -3
  15. package/src/_stories/_mock/url_filter.json +1076 -0
  16. package/src/components/AreaChart/components/AreaChart.Stacked.jsx +2 -1
  17. package/src/components/AreaChart/components/AreaChart.jsx +2 -1
  18. package/src/components/BarChart/components/BarChart.Horizontal.tsx +39 -49
  19. package/src/components/BarChart/components/BarChart.StackedHorizontal.tsx +36 -56
  20. package/src/components/BarChart/components/BarChart.StackedVertical.tsx +32 -39
  21. package/src/components/BarChart/components/BarChart.Vertical.tsx +40 -55
  22. package/src/components/BoxPlot/BoxPlot.jsx +2 -1
  23. package/src/components/DeviationBar.jsx +3 -3
  24. package/src/components/EditorPanel/EditorPanel.tsx +167 -15
  25. package/src/components/EditorPanel/components/Panels/Panel.Regions.tsx +1 -1
  26. package/src/components/EditorPanel/components/Panels/Panel.Sankey.tsx +108 -0
  27. package/src/components/EditorPanel/components/Panels/Panel.Series.tsx +48 -4
  28. package/src/components/EditorPanel/components/Panels/Panel.Visual.tsx +41 -0
  29. package/src/components/EditorPanel/components/Panels/index.tsx +9 -7
  30. package/src/components/EditorPanel/components/panels.scss +11 -0
  31. package/src/components/EditorPanel/useEditorPermissions.js +40 -14
  32. package/src/components/Legend/Legend.Component.tsx +23 -15
  33. package/src/components/Legend/Legend.tsx +4 -4
  34. package/src/components/LineChart/LineChartProps.ts +1 -0
  35. package/src/components/LineChart/helpers.ts +2 -2
  36. package/src/components/LineChart/index.tsx +7 -7
  37. package/src/components/LinearChart.jsx +9 -30
  38. package/src/components/PairedBarChart.jsx +6 -10
  39. package/src/components/PieChart/PieChart.tsx +3 -3
  40. package/src/components/Regions/components/Regions.tsx +120 -78
  41. package/src/components/Sankey/index.tsx +434 -0
  42. package/src/components/Sankey/sankey.scss +153 -0
  43. package/src/components/Sankey/types/index.ts +16 -0
  44. package/src/components/ScatterPlot/ScatterPlot.jsx +1 -0
  45. package/src/components/Sparkline/{SparkLine.jsx → components/SparkLine.tsx} +14 -30
  46. package/src/components/Sparkline/index.scss +3 -0
  47. package/src/components/Sparkline/index.tsx +1 -1
  48. package/src/components/ZoomBrush.tsx +2 -1
  49. package/src/data/initial-state.js +46 -2
  50. package/src/helpers/computeMarginBottom.ts +2 -1
  51. package/src/helpers/tests/computeMarginBottom.test.ts +2 -1
  52. package/src/hooks/useBarChart.js +5 -2
  53. package/src/hooks/useScales.ts +15 -18
  54. package/src/hooks/useTooltip.tsx +9 -8
  55. package/src/scss/main.scss +8 -29
  56. package/src/types/ChartConfig.ts +32 -14
  57. package/src/types/ChartContext.ts +7 -0
@@ -22,6 +22,7 @@
22
22
  "label": "X-Axis Example Label",
23
23
  "type": "date",
24
24
  "dateParseFormat": "%m/%d/%Y",
25
+ "sortDates": true,
25
26
  "dateDisplayFormat": "%m/%d/%Y"
26
27
  },
27
28
  "table": {
@@ -121,4 +122,4 @@
121
122
  "type": "Line"
122
123
  }
123
124
  ]
124
- }
125
+ }
@@ -52,6 +52,7 @@
52
52
  "rightAxisTickColor": "#333",
53
53
  "numTicks": "9",
54
54
  "axisPadding": 0,
55
+ "scalePadding": 10,
55
56
  "tickRotation": 0,
56
57
  "anchors": [],
57
58
  "label": "Y-Axis Example Label"
@@ -98,7 +99,7 @@
98
99
  "horizontal": 750
99
100
  },
100
101
  "xAxis": {
101
- "sortDates": true,
102
+ "sortDates": false,
102
103
  "anchors": [],
103
104
  "type": "date",
104
105
  "showTargetLabel": true,
@@ -135,6 +136,7 @@
135
136
  "indexLabel": "Data Group",
136
137
  "download": true,
137
138
  "showVertical": false,
139
+ "dateDisplayFormat": "",
138
140
  "show": true
139
141
  },
140
142
  "orientation": "vertical",
@@ -155,6 +157,7 @@
155
157
  "lineMode": false,
156
158
  "verticalSorted": false,
157
159
  "highlightOnHover": false,
160
+ "seriesHighlight": [],
158
161
  "position": "right",
159
162
  "label": "Type of Data"
160
163
  },
@@ -279,7 +282,8 @@
279
282
  ],
280
283
  "tooltips": {
281
284
  "opacity": 90,
282
- "singleSeries": false
285
+ "singleSeries": false,
286
+ "dateDisplayFormat": ""
283
287
  },
284
288
  "forestPlot": {
285
289
  "startAt": 0,
@@ -332,6 +336,48 @@
332
336
  "area": {
333
337
  "isStacked": false
334
338
  },
339
+ "sankey": {
340
+ "title": {
341
+ "defaultColor": "black"
342
+ },
343
+ "iterations": 1,
344
+ "rxValue": 0.9,
345
+ "overallSize": {
346
+ "width": 900,
347
+ "height": 700
348
+ },
349
+ "margin": {
350
+ "margin_y": 25,
351
+ "margin_x": 0
352
+ },
353
+ "nodeSize": {
354
+ "nodeWidth": 26,
355
+ "nodeHeight": 40
356
+ },
357
+ "nodePadding": 55,
358
+ "nodeFontColor": "black",
359
+ "nodeColor": {
360
+ "default": "#ff8500",
361
+ "inactive": "#808080"
362
+ },
363
+ "linkColor": {
364
+ "default": "#ffc900",
365
+ "inactive": "#D3D3D3"
366
+ },
367
+ "opacity": {
368
+ "nodeOpacityDefault": 1,
369
+ "nodeOpacityInactive": 0.1,
370
+ "LinkOpacityDefault": 1,
371
+ "LinkOpacityInactive": 0.1
372
+ },
373
+ "storyNodeFontColor": "#006778",
374
+ "storyNodeText": [],
375
+ "nodeValueStyle": {
376
+ "textBefore": "(",
377
+ "textAfter": ")"
378
+ },
379
+ "data": []
380
+ },
335
381
  "showChartBrush": false,
336
382
  "height": "375",
337
383
  "data": [
@@ -398,10 +444,10 @@
398
444
  "label": "Region Applied to Timeline",
399
445
  "color": "Black",
400
446
  "background": "Grey",
401
- "fromType": "Previous Days"
447
+ "fromType": "Fixed"
402
448
  }
403
449
  ],
404
- "validated": 4.23,
450
+ "validated": "4.24.3",
405
451
  "formattedData": [
406
452
  {
407
453
  "Date": "1/15/2016",