@semcore/d3-chart 16.5.0 → 17.0.0-prerelease.8
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/CHANGELOG.md +10 -0
- package/lib/cjs/AnimatedClipPath.js +28 -41
- package/lib/cjs/AnimatedClipPath.js.map +1 -1
- package/lib/cjs/Area.js +187 -223
- package/lib/cjs/Area.js.map +1 -1
- package/lib/cjs/Axis.js +248 -327
- package/lib/cjs/Axis.js.map +1 -1
- package/lib/cjs/Bar.js +162 -185
- package/lib/cjs/Bar.js.map +1 -1
- package/lib/cjs/Bubble.js +219 -248
- package/lib/cjs/Bubble.js.map +1 -1
- package/lib/cjs/CompactHorizontalBar.js +448 -482
- package/lib/cjs/CompactHorizontalBar.js.map +1 -1
- package/lib/cjs/Donut.js +349 -396
- package/lib/cjs/Donut.js.map +1 -1
- package/lib/cjs/Dots.js +67 -86
- package/lib/cjs/Dots.js.map +1 -1
- package/lib/cjs/GroupBar.js +78 -93
- package/lib/cjs/GroupBar.js.map +1 -1
- package/lib/cjs/HorizontalBar.js +149 -167
- package/lib/cjs/HorizontalBar.js.map +1 -1
- package/lib/cjs/Hover.js +178 -207
- package/lib/cjs/Hover.js.map +1 -1
- package/lib/cjs/Line.js +182 -222
- package/lib/cjs/Line.js.map +1 -1
- package/lib/cjs/Pattern.js +124 -126
- package/lib/cjs/Pattern.js.map +1 -1
- package/lib/cjs/Plot.js +100 -126
- package/lib/cjs/Plot.js.map +1 -1
- package/lib/cjs/Radar.js +576 -681
- package/lib/cjs/Radar.js.map +1 -1
- package/lib/cjs/RadialTree.js +518 -571
- package/lib/cjs/RadialTree.js.map +1 -1
- package/lib/cjs/Reference.js +147 -178
- package/lib/cjs/Reference.js.map +1 -1
- package/lib/cjs/ResponsiveContainer.js +64 -82
- package/lib/cjs/ResponsiveContainer.js.map +1 -1
- package/lib/cjs/ScatterPlot.js +169 -199
- package/lib/cjs/ScatterPlot.js.map +1 -1
- package/lib/cjs/StackBar.js +135 -177
- package/lib/cjs/StackBar.js.map +1 -1
- package/lib/cjs/StackedArea.js +60 -73
- package/lib/cjs/StackedArea.js.map +1 -1
- package/lib/cjs/Tooltip.js +193 -208
- package/lib/cjs/Tooltip.js.map +1 -1
- package/lib/cjs/Venn.js +182 -217
- package/lib/cjs/Venn.js.map +1 -1
- package/lib/cjs/a11y/DataAccessibilityTable.js +45 -83
- package/lib/cjs/a11y/DataAccessibilityTable.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yModule.js +37 -97
- package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yView.js +97 -91
- package/lib/cjs/a11y/PlotA11yView.js.map +1 -1
- package/lib/cjs/a11y/bezier.js +17 -23
- package/lib/cjs/a11y/bezier.js.map +1 -1
- package/lib/cjs/a11y/focus.js +16 -16
- package/lib/cjs/a11y/focus.js.map +1 -1
- package/lib/cjs/a11y/hints.js +72 -75
- package/lib/cjs/a11y/hints.js.map +1 -1
- package/lib/cjs/a11y/insights.js +354 -525
- package/lib/cjs/a11y/insights.js.map +1 -1
- package/lib/cjs/a11y/intl.js +5 -5
- package/lib/cjs/a11y/intl.js.map +1 -1
- package/lib/cjs/a11y/locale.js +12 -19
- package/lib/cjs/a11y/locale.js.map +1 -1
- package/lib/cjs/a11y/serialize.js +164 -203
- package/lib/cjs/a11y/serialize.js.map +1 -1
- package/lib/cjs/a11y/summarize.js +7 -6
- package/lib/cjs/a11y/summarize.js.map +1 -1
- package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js +16 -16
- package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/a11y/translations/module/de.json +2 -2
- package/lib/cjs/a11y/translations/module/en.json +2 -2
- package/lib/cjs/a11y/translations/module/es.json +2 -2
- package/lib/cjs/a11y/translations/module/fr.json +2 -2
- package/lib/cjs/a11y/translations/module/it.json +2 -2
- package/lib/cjs/a11y/translations/module/ja.json +2 -2
- package/lib/cjs/a11y/translations/module/ko.json +2 -2
- package/lib/cjs/a11y/translations/module/nl.json +2 -2
- package/lib/cjs/a11y/translations/module/pl.json +2 -2
- package/lib/cjs/a11y/translations/module/pt.json +2 -2
- package/lib/cjs/a11y/translations/module/sv.json +2 -2
- package/lib/cjs/a11y/translations/module/tr.json +2 -2
- package/lib/cjs/a11y/translations/module/vi.json +2 -2
- package/lib/cjs/a11y/translations/module/zh.json +2 -2
- package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js +16 -16
- package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/color.js +1 -1
- package/lib/cjs/color.js.map +1 -1
- package/lib/cjs/component/Chart/AbstractChart.js +421 -466
- package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
- package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/AreaChart.js +97 -115
- package/lib/cjs/component/Chart/AreaChart.js.map +1 -1
- package/lib/cjs/component/Chart/AreaChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/BarChart.js +229 -216
- package/lib/cjs/component/Chart/BarChart.js.map +1 -1
- package/lib/cjs/component/Chart/BarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/BubbleChart.js +114 -136
- package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
- package/lib/cjs/component/Chart/BubbleChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.js +280 -305
- package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.js +76 -108
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.js.map +1 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.js +80 -95
- package/lib/cjs/component/Chart/DonutChart.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/HistogramChart.js +126 -148
- package/lib/cjs/component/Chart/HistogramChart.js.map +1 -1
- package/lib/cjs/component/Chart/HistogramChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.js +95 -113
- package/lib/cjs/component/Chart/LineChart.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/RadarChart.js +84 -110
- package/lib/cjs/component/Chart/RadarChart.js.map +1 -1
- package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.js +119 -143
- package/lib/cjs/component/Chart/ScatterPlotChart.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/VennChart.js +103 -122
- package/lib/cjs/component/Chart/VennChart.js.map +1 -1
- package/lib/cjs/component/Chart/VennChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/index.js +2 -2
- package/lib/cjs/component/Chart/index.js.map +1 -1
- package/lib/cjs/component/ChartLegend/BaseLegend.js +72 -105
- package/lib/cjs/component/ChartLegend/BaseLegend.js.map +1 -1
- package/lib/cjs/component/ChartLegend/BaseLegend.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +58 -70
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +208 -221
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +63 -73
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/index.js +4 -4
- package/lib/cjs/component/ChartLegend/index.js.map +1 -1
- package/lib/cjs/component/Cigarette/Cigarette.js +115 -129
- package/lib/cjs/component/Cigarette/Cigarette.js.map +1 -1
- package/lib/cjs/component/StackGroupBar/StackGroupBar.js +107 -137
- package/lib/cjs/component/StackGroupBar/StackGroupBar.js.map +1 -1
- package/lib/cjs/component/SvgElement.js +7 -7
- package/lib/cjs/component/SvgElement.js.map +1 -1
- package/lib/cjs/createElement.js +66 -65
- package/lib/cjs/createElement.js.map +1 -1
- package/lib/cjs/index.js +62 -62
- package/lib/cjs/style/axis.shadow.css +3 -0
- package/lib/cjs/style/plot.shadow.css +1 -3
- package/lib/cjs/style/plotA11yModule.shadow.css +10 -11
- package/lib/cjs/style/plotA11yView.shadow.css +13 -26
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +15 -15
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/types/Axis.d.js.map +1 -1
- package/lib/cjs/types/CompactHorizontalBar.d.js.map +1 -1
- package/lib/cjs/types/Hover.d.js.map +1 -1
- package/lib/cjs/types/Line.d.js.map +1 -1
- package/lib/cjs/types/Plot.d.js.map +1 -1
- package/lib/cjs/types/Radar.d.js.map +1 -1
- package/lib/cjs/types/ResponsiveContainer.d.js.map +1 -1
- package/lib/cjs/types/Tooltip.d.js.map +1 -1
- package/lib/cjs/types/Venn.d.js.map +1 -1
- package/lib/cjs/types/index.d.js +80 -80
- package/lib/cjs/types/index.d.js.map +1 -1
- package/lib/cjs/utils.js +122 -145
- package/lib/cjs/utils.js.map +1 -1
- package/lib/es6/AnimatedClipPath.js +24 -37
- package/lib/es6/AnimatedClipPath.js.map +1 -1
- package/lib/es6/Area.js +179 -215
- package/lib/es6/Area.js.map +1 -1
- package/lib/es6/Axis.js +242 -321
- package/lib/es6/Axis.js.map +1 -1
- package/lib/es6/Bar.js +154 -177
- package/lib/es6/Bar.js.map +1 -1
- package/lib/es6/Bubble.js +206 -235
- package/lib/es6/Bubble.js.map +1 -1
- package/lib/es6/CompactHorizontalBar.js +433 -467
- package/lib/es6/CompactHorizontalBar.js.map +1 -1
- package/lib/es6/Donut.js +337 -384
- package/lib/es6/Donut.js.map +1 -1
- package/lib/es6/Dots.js +60 -79
- package/lib/es6/Dots.js.map +1 -1
- package/lib/es6/GroupBar.js +74 -89
- package/lib/es6/GroupBar.js.map +1 -1
- package/lib/es6/HorizontalBar.js +141 -159
- package/lib/es6/HorizontalBar.js.map +1 -1
- package/lib/es6/Hover.js +174 -203
- package/lib/es6/Hover.js.map +1 -1
- package/lib/es6/Line.js +173 -213
- package/lib/es6/Line.js.map +1 -1
- package/lib/es6/Pattern.js +68 -74
- package/lib/es6/Pattern.js.map +1 -1
- package/lib/es6/Plot.js +95 -121
- package/lib/es6/Plot.js.map +1 -1
- package/lib/es6/Radar.js +554 -659
- package/lib/es6/Radar.js.map +1 -1
- package/lib/es6/RadialTree.js +500 -553
- package/lib/es6/RadialTree.js.map +1 -1
- package/lib/es6/Reference.js +140 -171
- package/lib/es6/Reference.js.map +1 -1
- package/lib/es6/ResponsiveContainer.js +58 -76
- package/lib/es6/ResponsiveContainer.js.map +1 -1
- package/lib/es6/ScatterPlot.js +161 -191
- package/lib/es6/ScatterPlot.js.map +1 -1
- package/lib/es6/StackBar.js +130 -172
- package/lib/es6/StackBar.js.map +1 -1
- package/lib/es6/StackedArea.js +56 -69
- package/lib/es6/StackedArea.js.map +1 -1
- package/lib/es6/Tooltip.js +183 -198
- package/lib/es6/Tooltip.js.map +1 -1
- package/lib/es6/Venn.js +169 -204
- package/lib/es6/Venn.js.map +1 -1
- package/lib/es6/a11y/DataAccessibilityTable.js +41 -80
- package/lib/es6/a11y/DataAccessibilityTable.js.map +1 -1
- package/lib/es6/a11y/PlotA11yModule.js +35 -95
- package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
- package/lib/es6/a11y/PlotA11yView.js +89 -84
- package/lib/es6/a11y/PlotA11yView.js.map +1 -1
- package/lib/es6/a11y/bezier.js +16 -23
- package/lib/es6/a11y/bezier.js.map +1 -1
- package/lib/es6/a11y/focus.js +15 -16
- package/lib/es6/a11y/focus.js.map +1 -1
- package/lib/es6/a11y/hints.js +67 -73
- package/lib/es6/a11y/hints.js.map +1 -1
- package/lib/es6/a11y/insights.js +353 -524
- package/lib/es6/a11y/insights.js.map +1 -1
- package/lib/es6/a11y/intl.js +4 -5
- package/lib/es6/a11y/intl.js.map +1 -1
- package/lib/es6/a11y/locale.js +11 -18
- package/lib/es6/a11y/locale.js.map +1 -1
- package/lib/es6/a11y/serialize.js +162 -203
- package/lib/es6/a11y/serialize.js.map +1 -1
- package/lib/es6/a11y/summarize.js +6 -6
- package/lib/es6/a11y/summarize.js.map +1 -1
- package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js +15 -15
- package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/a11y/translations/module/de.json +2 -2
- package/lib/es6/a11y/translations/module/en.json +2 -2
- package/lib/es6/a11y/translations/module/es.json +2 -2
- package/lib/es6/a11y/translations/module/fr.json +2 -2
- package/lib/es6/a11y/translations/module/it.json +2 -2
- package/lib/es6/a11y/translations/module/ja.json +2 -2
- package/lib/es6/a11y/translations/module/ko.json +2 -2
- package/lib/es6/a11y/translations/module/nl.json +2 -2
- package/lib/es6/a11y/translations/module/pl.json +2 -2
- package/lib/es6/a11y/translations/module/pt.json +2 -2
- package/lib/es6/a11y/translations/module/sv.json +2 -2
- package/lib/es6/a11y/translations/module/tr.json +2 -2
- package/lib/es6/a11y/translations/module/vi.json +2 -2
- package/lib/es6/a11y/translations/module/zh.json +2 -2
- package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js +15 -15
- package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/color.js +1 -1
- package/lib/es6/color.js.map +1 -1
- package/lib/es6/component/Chart/AbstractChart.js +416 -462
- package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
- package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
- package/lib/es6/component/Chart/AreaChart.js +92 -111
- package/lib/es6/component/Chart/AreaChart.js.map +1 -1
- package/lib/es6/component/Chart/AreaChart.type.js.map +1 -1
- package/lib/es6/component/Chart/BarChart.js +225 -213
- package/lib/es6/component/Chart/BarChart.js.map +1 -1
- package/lib/es6/component/Chart/BarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/BubbleChart.js +109 -132
- package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
- package/lib/es6/component/Chart/BubbleChart.type.js.map +1 -1
- package/lib/es6/component/Chart/CigaretteChart.js +276 -301
- package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.js +70 -103
- package/lib/es6/component/Chart/CompactHorizontalBarChart.js.map +1 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.js +74 -90
- package/lib/es6/component/Chart/DonutChart.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.type.js.map +1 -1
- package/lib/es6/component/Chart/HistogramChart.js +121 -144
- package/lib/es6/component/Chart/HistogramChart.js.map +1 -1
- package/lib/es6/component/Chart/HistogramChart.type.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.js +90 -109
- package/lib/es6/component/Chart/LineChart.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.type.js.map +1 -1
- package/lib/es6/component/Chart/RadarChart.js +80 -107
- package/lib/es6/component/Chart/RadarChart.js.map +1 -1
- package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.js +113 -138
- package/lib/es6/component/Chart/ScatterPlotChart.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/es6/component/Chart/VennChart.js +97 -117
- package/lib/es6/component/Chart/VennChart.js.map +1 -1
- package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/BaseLegend.js +70 -104
- package/lib/es6/component/ChartLegend/BaseLegend.js.map +1 -1
- package/lib/es6/component/ChartLegend/BaseLegend.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +53 -65
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +198 -211
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +58 -68
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
- package/lib/es6/component/Cigarette/Cigarette.js +108 -122
- package/lib/es6/component/Cigarette/Cigarette.js.map +1 -1
- package/lib/es6/component/StackGroupBar/StackGroupBar.js +100 -130
- package/lib/es6/component/StackGroupBar/StackGroupBar.js.map +1 -1
- package/lib/es6/component/SvgElement.js +4 -5
- package/lib/es6/component/SvgElement.js.map +1 -1
- package/lib/es6/createElement.js +55 -54
- package/lib/es6/createElement.js.map +1 -1
- package/lib/es6/style/axis.shadow.css +3 -0
- package/lib/es6/style/plot.shadow.css +1 -3
- package/lib/es6/style/plotA11yModule.shadow.css +10 -11
- package/lib/es6/style/plotA11yView.shadow.css +13 -26
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +14 -14
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/types/Axis.d.js.map +1 -1
- package/lib/es6/types/CompactHorizontalBar.d.js.map +1 -1
- package/lib/es6/types/Hover.d.js.map +1 -1
- package/lib/es6/types/Line.d.js.map +1 -1
- package/lib/es6/types/Plot.d.js.map +1 -1
- package/lib/es6/types/Radar.d.js.map +1 -1
- package/lib/es6/types/ResponsiveContainer.d.js.map +1 -1
- package/lib/es6/types/Tooltip.d.js.map +1 -1
- package/lib/es6/types/Venn.d.js.map +1 -1
- package/lib/es6/utils.js +105 -144
- package/lib/es6/utils.js.map +1 -1
- package/lib/esm/AnimatedClipPath.mjs +24 -36
- package/lib/esm/Area.mjs +178 -149
- package/lib/esm/Axis.mjs +241 -242
- package/lib/esm/Bar.mjs +155 -137
- package/lib/esm/Bubble.mjs +205 -171
- package/lib/esm/CompactHorizontalBar.mjs +428 -383
- package/lib/esm/Donut.mjs +315 -266
- package/lib/esm/Dots.mjs +60 -49
- package/lib/esm/GroupBar.mjs +71 -75
- package/lib/esm/HorizontalBar.mjs +142 -120
- package/lib/esm/Hover.mjs +173 -163
- package/lib/esm/Line.mjs +174 -145
- package/lib/esm/Pattern.mjs +67 -63
- package/lib/esm/Plot.mjs +98 -95
- package/lib/esm/Radar.mjs +550 -498
- package/lib/esm/RadialTree.mjs +512 -416
- package/lib/esm/Reference.mjs +137 -122
- package/lib/esm/ResponsiveContainer.mjs +58 -69
- package/lib/esm/ScatterPlot.mjs +163 -162
- package/lib/esm/StackBar.mjs +126 -147
- package/lib/esm/StackedArea.mjs +53 -61
- package/lib/esm/Tooltip.mjs +185 -175
- package/lib/esm/Venn.mjs +170 -170
- package/lib/esm/a11y/DataAccessibilityTable.mjs +46 -73
- package/lib/esm/a11y/PlotA11yModule.mjs +37 -80
- package/lib/esm/a11y/PlotA11yView.mjs +99 -74
- package/lib/esm/a11y/bezier.mjs +16 -23
- package/lib/esm/a11y/focus.mjs +15 -16
- package/lib/esm/a11y/hints.mjs +65 -71
- package/lib/esm/a11y/insights.mjs +347 -495
- package/lib/esm/a11y/intl.mjs +4 -5
- package/lib/esm/a11y/locale.mjs +12 -14
- package/lib/esm/a11y/serialize.mjs +139 -152
- package/lib/esm/a11y/summarize.mjs +3 -3
- package/lib/esm/a11y/translations/module/__intergalactic-dynamic-locales.mjs +1 -1
- package/lib/esm/a11y/translations/module/de.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/en.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/es.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/fr.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/it.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/ja.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/ko.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/nl.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/pl.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/pt.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/sv.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/tr.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/vi.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/zh.json.mjs +2 -4
- package/lib/esm/a11y/translations/view/__intergalactic-dynamic-locales.mjs +1 -1
- package/lib/esm/color.mjs +1 -1
- package/lib/esm/component/Chart/AbstractChart.mjs +422 -415
- package/lib/esm/component/Chart/AreaChart.mjs +92 -91
- package/lib/esm/component/Chart/BarChart.mjs +225 -177
- package/lib/esm/component/Chart/BubbleChart.mjs +110 -118
- package/lib/esm/component/Chart/CigaretteChart.mjs +277 -268
- package/lib/esm/component/Chart/CompactHorizontalBarChart.mjs +70 -87
- package/lib/esm/component/Chart/DonutChart.mjs +74 -84
- package/lib/esm/component/Chart/HistogramChart.mjs +121 -117
- package/lib/esm/component/Chart/LineChart.mjs +90 -89
- package/lib/esm/component/Chart/RadarChart.mjs +81 -97
- package/lib/esm/component/Chart/ScatterPlotChart.mjs +113 -111
- package/lib/esm/component/Chart/VennChart.mjs +98 -111
- package/lib/esm/component/ChartLegend/BaseLegend.mjs +75 -97
- package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +54 -55
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +194 -165
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.type.mjs +1 -1
- package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +60 -58
- package/lib/esm/component/Cigarette/Cigarette.mjs +109 -99
- package/lib/esm/component/StackGroupBar/StackGroupBar.mjs +97 -111
- package/lib/esm/component/SvgElement.mjs +4 -4
- package/lib/esm/createElement.mjs +54 -37
- package/lib/esm/style/axis.shadow.css +3 -0
- package/lib/esm/style/plot.shadow.css +1 -3
- package/lib/esm/style/plotA11yModule.shadow.css +10 -11
- package/lib/esm/style/plotA11yView.shadow.css +13 -26
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +1 -1
- package/lib/esm/utils.mjs +103 -138
- package/lib/types/Axis.d.ts +4 -0
- package/lib/types/CompactHorizontalBar.d.ts +1 -1
- package/lib/types/Hover.d.ts +1 -1
- package/lib/types/Line.d.ts +1 -1
- package/lib/types/Plot.d.ts +1 -1
- package/lib/types/Radar.d.ts +1 -1
- package/lib/types/ResponsiveContainer.d.ts +1 -1
- package/lib/types/Tooltip.d.ts +1 -3
- package/lib/types/Venn.d.ts +1 -1
- package/lib/types/a11y/PlotA11yModule.d.ts +4 -11
- package/lib/types/a11y/PlotA11yView.d.ts +12 -1
- package/lib/types/a11y/translations/module/__intergalactic-dynamic-locales.d.ts +14 -14
- package/lib/types/component/Chart/AbstractChart.d.ts +1 -1
- package/lib/types/component/Chart/AbstractChart.type.d.ts +1 -1
- package/lib/types/component/Chart/AreaChart.type.d.ts +1 -1
- package/lib/types/component/Chart/BarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/BubbleChart.type.d.ts +1 -1
- package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/DonutChart.type.d.ts +1 -1
- package/lib/types/component/Chart/HistogramChart.type.d.ts +1 -1
- package/lib/types/component/Chart/LineChart.type.d.ts +1 -1
- package/lib/types/component/Chart/RadarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +1 -1
- package/lib/types/component/Chart/VennChart.type.d.ts +1 -1
- package/lib/types/component/ChartLegend/BaseLegend.d.ts +1 -1
- package/lib/types/component/ChartLegend/BaseLegend.type.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.type.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts +1 -1
- package/lib/types/utils.d.ts +10 -10
- package/package.json +11 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineChart.js","names":["createComponent","i18nEnhance","scaleLinear","scaleTime","React","Line","minMax","HoverLine","AbstractChart","localizedMessages","LineChartComponent","
|
|
1
|
+
{"version":3,"file":"LineChart.js","names":["createComponent","i18nEnhance","scaleLinear","scaleTime","React","Line","minMax","HoverLine","AbstractChart","localizedMessages","LineChartComponent","xScale","marginY","plotWidth","data","groupKey","asProps","testItem","range","plotPadding","domain","Date","Number","isNaN","getMilliseconds","yScale","marginX","plotHeight","flatValues","max","Math","min","renderChart","curve","showDots","area","areaCurve","onClickLine","dataDefinitions","highlightedLine","state","map","item","index","checked","createElement","x","toString","y","id","key","color","transparent","onClick","Dots","display","Area","y0","y1","renderTooltip","Tooltip","wMin","xIndex","dataItem","children","getTooltipChildren","getLegendAriaLabel","getI18nText","chartType","_defineProperty","LineChart"],"sources":["../../../../src/component/Chart/LineChart.tsx"],"sourcesContent":["import { createComponent } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { type ScaleLinear, scaleLinear, scaleTime } from 'd3-scale';\nimport React from 'react';\n\nimport type { LineChartData, LineChartProps, LineChartType } from './LineChart.type';\n// @ts-ignore\nimport { Line, minMax, HoverLine } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\n\nclass LineChartComponent extends AbstractChart<\n LineChartData,\n LineChartProps,\n typeof LineChartComponent.enhance\n> {\n static displayName = 'Chart.Line';\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n protected get xScale() {\n const { xScale, marginY = 30, plotWidth, data, groupKey } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\n const testItem = data[0][groupKey];\n const range = [marginY, plotWidth - this.plotPadding];\n const domain = minMax(data, groupKey);\n\n if (testItem instanceof Date && !Number.isNaN(testItem.getMilliseconds())) {\n return scaleTime(domain, range);\n }\n\n return scaleLinear(domain, range);\n }\n\n protected get yScale(): ScaleLinear<any, any> {\n const { yScale, marginX = 30, plotHeight } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n const flatValues = super.flatValues;\n\n const max = Math.max(...flatValues);\n const min = Math.min(...flatValues);\n\n return scaleLinear()\n .range([plotHeight - marginX, this.plotPadding])\n .domain([min, max]);\n }\n\n protected renderChart() {\n const { groupKey, curve, showDots, area, areaCurve, onClickLine } = this.asProps;\n const { dataDefinitions, highlightedLine } = this.state;\n\n return dataDefinitions.map((item, index) => {\n return (\n item.checked && (\n <Line\n x={groupKey.toString()}\n y={item.id}\n key={item.id}\n color={item.color}\n transparent={highlightedLine !== -1 && highlightedLine !== index}\n curve={curve}\n onClick={onClickLine}\n >\n {showDots && <Line.Dots display />}\n {area?.[item.id] && (\n <Line.Area area={area[item.id]} y0='y0' y1='y1' curve={areaCurve} />\n )}\n </Line>\n )\n );\n });\n }\n\n protected renderTooltip() {\n const { data, groupKey } = this.asProps;\n\n return (\n <HoverLine.Tooltip x={groupKey} wMin={100}>\n {({ xIndex }: any) => {\n const dataItem = data[xIndex];\n\n return {\n children: this.getTooltipChildren({\n Tooltip: HoverLine.Tooltip,\n dataItem,\n }),\n };\n }}\n </HoverLine.Tooltip>\n );\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Line' });\n }\n}\n\nexport const LineChart: LineChartType = createComponent(LineChartComponent);\n"],"mappings":";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AE,EAAC,IAAI;QAACzB,KAAK,EAAEG;MAAU,CAAE,CAEjE,CACP;IAEL,CAAC,CAAC;EACJ;EAEUuB,aAAaA,CAAA,EAAG;IACxB,MAAM;MAAE7C,IAAI;MAAEC;IAAS,CAAC,GAAG,IAAI,CAACC,OAAO;IAEvC,oBACEZ,KAAA,CAAAyC,aAAA,CAACtC,SAAS,CAACqD,OAAO;MAACd,CAAC,EAAE/B,QAAS;MAAC8C,IAAI,EAAE;IAAI,GACvC,CAAC;MAAEC;IAAY,CAAC,KAAK;MACpB,MAAMC,QAAQ,GAAGjD,IAAI,CAACgD,MAAM,CAAC;MAE7B,OAAO;QACLE,QAAQ,EAAE,IAAI,CAACC,kBAAkB,CAAC;UAChCL,OAAO,EAAErD,SAAS,CAACqD,OAAO;UAC1BG;QACF,CAAC;MACH,CAAC;IACH,CACiB,CAAC;EAExB;EAEUG,kBAAkBA,CAAA,EAAW;IACrC,OAAO,IAAI,CAAClD,OAAO,CAACmD,WAAW,CAAC,gBAAgB,EAAE;MAAEC,SAAS,EAAE;IAAO,CAAC,CAAC;EAC1E;AACF;AAACC,eAAA,CA5FK3D,kBAAkB,iBAKD,YAAY;AAAA2D,eAAA,CAL7B3D,kBAAkB,aAOL,CAACT,WAAW,CAACQ,iBAAiB,CAAC,CAAC;AAuFnD,OAAO,MAAM6D,SAAwB,GAAGtE,eAAe,CAACU,kBAAkB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineChart.type.js","names":[],"sources":["../../../../src/component/Chart/LineChart.type.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"LineChart.type.js","names":[],"sources":["../../../../src/component/Chart/LineChart.type.ts"],"sourcesContent":["import type { Flex } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport type { ScaleLinear, ScaleTime } from 'd3-scale';\nimport type { CurveFactory } from 'd3-shape';\n\nimport type { BaseChartProps } from './AbstractChart.type';\nimport type { interpolateValue } from '../../utils';\nimport type { LegendItemKey } from '../ChartLegend/LegendItem/LegendItem.type';\n\ntype AreaItem = {\n x: number;\n y0: number;\n y1: number;\n};\n\nexport type LineChartData = Array<Record<string, string | number | typeof interpolateValue | Date>>;\n\nexport type LineChartProps = BaseChartProps<LineChartData> & {\n /** Field name that groups the data points */\n groupKey: string;\n /** Optional area data for rendering filled areas under lines */\n area?: Record<LegendItemKey, AreaItem[]>;\n /** Custom x-axis scale */\n xScale?: ScaleLinear<any, any> | ScaleTime<any, any>;\n /** Custom y-axis scale */\n yScale?: ScaleLinear<any, any>;\n /** Controls whether to display dots on the line chart */\n showDots?: boolean;\n /** D3 curve factory for line interpolation */\n curve?: CurveFactory;\n /** Curve factory specifically for area rendering */\n areaCurve?: CurveFactory;\n /** Callback triggered when a user clicks on a line */\n onClickLine?: (index: number, event: React.SyntheticEvent) => void;\n};\n\nexport type LineChartType = Intergalactic.Component<typeof Flex, LineChartProps>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import _callSuper from "@babel/runtime/helpers/callSuper";
|
|
5
|
-
import _superPropGet from "@babel/runtime/helpers/superPropGet";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
2
|
import { createComponent } from '@semcore/core';
|
|
9
3
|
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
@@ -13,109 +7,88 @@ import { AbstractChart } from './AbstractChart';
|
|
|
13
7
|
// @ts-ignore
|
|
14
8
|
import { Radar } from '../..';
|
|
15
9
|
import { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
class RadarChartComponent extends AbstractChart {
|
|
11
|
+
renderChart() {
|
|
12
|
+
const {
|
|
13
|
+
groupKey,
|
|
14
|
+
showDots,
|
|
15
|
+
circle,
|
|
16
|
+
onClickRadar
|
|
17
|
+
} = this.asProps;
|
|
18
|
+
const {
|
|
19
|
+
dataDefinitions
|
|
20
|
+
} = this.state;
|
|
21
|
+
return /*#__PURE__*/React.createElement(Radar, {
|
|
22
|
+
onClick: onClickRadar,
|
|
23
|
+
scale: this.xScale,
|
|
24
|
+
type: circle ? 'circle' : undefined
|
|
25
|
+
}, /*#__PURE__*/React.createElement(Radar.Axis, {
|
|
26
|
+
dataKey: groupKey
|
|
27
|
+
}, /*#__PURE__*/React.createElement(Radar.Axis.Ticks, null), /*#__PURE__*/React.createElement(Radar.Axis.Labels, null)), this.renderRadarTooltip(), dataDefinitions.map(item => {
|
|
28
|
+
return item.checked && /*#__PURE__*/React.createElement(Radar.Polygon, {
|
|
29
|
+
dataKey: item.id,
|
|
30
|
+
key: item.id,
|
|
31
|
+
color: item.color
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Radar.Polygon.Line, null), showDots && /*#__PURE__*/React.createElement(Radar.Polygon.Dots, null));
|
|
33
|
+
}));
|
|
20
34
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return /*#__PURE__*/React.createElement(Radar, {
|
|
32
|
-
onClick: onClickRadar,
|
|
33
|
-
scale: this.xScale,
|
|
34
|
-
type: circle ? 'circle' : undefined
|
|
35
|
-
}, /*#__PURE__*/React.createElement(Radar.Axis, {
|
|
36
|
-
dataKey: groupKey
|
|
37
|
-
}, /*#__PURE__*/React.createElement(Radar.Axis.Ticks, null), /*#__PURE__*/React.createElement(Radar.Axis.Labels, null)), this.renderRadarTooltip(), dataDefinitions.map(function (item) {
|
|
38
|
-
return item.checked && /*#__PURE__*/React.createElement(Radar.Polygon, {
|
|
39
|
-
dataKey: item.id,
|
|
40
|
-
key: item.id,
|
|
41
|
-
color: item.color
|
|
42
|
-
}, /*#__PURE__*/React.createElement(Radar.Polygon.Line, null), showDots && /*#__PURE__*/React.createElement(Radar.Polygon.Dots, null));
|
|
43
|
-
}));
|
|
44
|
-
}
|
|
45
|
-
}, {
|
|
46
|
-
key: "renderRadarTooltip",
|
|
47
|
-
value: function renderRadarTooltip() {
|
|
48
|
-
var _this = this;
|
|
49
|
-
var _this$asProps2 = this.asProps,
|
|
50
|
-
data = _this$asProps2.data,
|
|
51
|
-
groupKey = _this$asProps2.groupKey,
|
|
52
|
-
showTooltip = _this$asProps2.showTooltip;
|
|
53
|
-
var dataDefinitions = this.state.dataDefinitions;
|
|
54
|
-
if (!showTooltip) {
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
57
|
-
return /*#__PURE__*/React.createElement(Radar.Tooltip, {
|
|
58
|
-
wMin: 100
|
|
59
|
-
}, function (_ref) {
|
|
60
|
-
var _data$groupKey;
|
|
61
|
-
var index = _ref.index;
|
|
62
|
-
return {
|
|
63
|
-
children: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Radar.Tooltip.Title, null, (_data$groupKey = data[groupKey]) === null || _data$groupKey === void 0 ? void 0 : _data$groupKey[index]), dataDefinitions.map(function (item) {
|
|
64
|
-
var _data$item$id;
|
|
65
|
-
var value = (_data$item$id = data[item.id]) === null || _data$item$id === void 0 ? void 0 : _data$item$id[index];
|
|
66
|
-
return item.checked && /*#__PURE__*/React.createElement(Radar.Tooltip.Dot, {
|
|
67
|
-
color: item.color,
|
|
68
|
-
key: item.id
|
|
69
|
-
}, _this.tooltipValueFormatter(value));
|
|
70
|
-
}))
|
|
71
|
-
};
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// By default, tooltip will render in Plot component.
|
|
76
|
-
// In RadarChart, we need to render it in Radar component, so we use renderRadarTooltip method
|
|
77
|
-
}, {
|
|
78
|
-
key: "renderTooltip",
|
|
79
|
-
value: function renderTooltip() {
|
|
35
|
+
renderRadarTooltip() {
|
|
36
|
+
const {
|
|
37
|
+
data,
|
|
38
|
+
groupKey,
|
|
39
|
+
showTooltip
|
|
40
|
+
} = this.asProps;
|
|
41
|
+
const {
|
|
42
|
+
dataDefinitions
|
|
43
|
+
} = this.state;
|
|
44
|
+
if (!showTooltip) {
|
|
80
45
|
return null;
|
|
81
46
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
47
|
+
return /*#__PURE__*/React.createElement(Radar.Tooltip, {
|
|
48
|
+
wMin: 100
|
|
49
|
+
}, ({
|
|
50
|
+
index
|
|
51
|
+
}) => {
|
|
52
|
+
return {
|
|
53
|
+
children: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Radar.Tooltip.Title, null, data[groupKey]?.[index]), dataDefinitions.map(item => {
|
|
54
|
+
const value = data[item.id]?.[index];
|
|
55
|
+
return item.checked && /*#__PURE__*/React.createElement(Radar.Tooltip.Dot, {
|
|
56
|
+
color: item.color,
|
|
57
|
+
key: item.id
|
|
58
|
+
}, this.tooltipValueFormatter(value));
|
|
59
|
+
}))
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// By default, tooltip will render in Plot component.
|
|
65
|
+
// In RadarChart, we need to render it in Radar component, so we use renderRadarTooltip method
|
|
66
|
+
renderTooltip() {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
get dataKeys() {
|
|
70
|
+
const {
|
|
71
|
+
data,
|
|
72
|
+
groupKey
|
|
73
|
+
} = this.props;
|
|
74
|
+
const legendKeys = Object.keys(data).filter(key => key !== groupKey);
|
|
75
|
+
return legendKeys;
|
|
76
|
+
}
|
|
77
|
+
get xScale() {
|
|
78
|
+
return this.asProps.scale ?? scaleLinear().domain(this.domain);
|
|
79
|
+
}
|
|
80
|
+
get yScale() {
|
|
81
|
+
return this.asProps.scale ?? scaleLinear().domain(this.domain);
|
|
82
|
+
}
|
|
83
|
+
getLegendAriaLabel() {
|
|
84
|
+
return this.asProps.getI18nText('legendForChart', {
|
|
85
|
+
chartType: 'Radar'
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
get domain() {
|
|
89
|
+
return [Math.min(...super.flatValues), Math.max(...super.flatValues)];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
119
92
|
_defineProperty(RadarChartComponent, "enhance", [i18nEnhance(localizedMessages)]);
|
|
120
|
-
export
|
|
93
|
+
export const RadarChart = createComponent(RadarChartComponent);
|
|
121
94
|
//# sourceMappingURL=RadarChart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadarChart.js","names":["createComponent","i18nEnhance","scaleLinear","React","AbstractChart","Radar","localizedMessages","RadarChartComponent","
|
|
1
|
+
{"version":3,"file":"RadarChart.js","names":["createComponent","i18nEnhance","scaleLinear","React","AbstractChart","Radar","localizedMessages","RadarChartComponent","renderChart","groupKey","showDots","circle","onClickRadar","asProps","dataDefinitions","state","createElement","onClick","scale","xScale","type","undefined","Axis","dataKey","Ticks","Labels","renderRadarTooltip","map","item","checked","Polygon","id","key","color","Line","Dots","data","showTooltip","Tooltip","wMin","index","children","Fragment","Title","value","Dot","tooltipValueFormatter","renderTooltip","dataKeys","props","legendKeys","Object","keys","filter","domain","yScale","getLegendAriaLabel","getI18nText","chartType","Math","min","flatValues","max","_defineProperty","RadarChart"],"sources":["../../../../src/component/Chart/RadarChart.tsx"],"sourcesContent":["import { createComponent } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { scaleLinear, type ScaleLinear } from 'd3-scale';\nimport React from 'react';\n\nimport { AbstractChart } from './AbstractChart';\nimport type { RadarChartData, RadarChartProps, RadarChartType } from './RadarChart.type';\n// @ts-ignore\nimport { Radar } from '../..';\nimport { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';\n\nclass RadarChartComponent extends AbstractChart<\n RadarChartData,\n RadarChartProps,\n typeof RadarChartComponent.enhance\n> {\n static enhance = [i18nEnhance(localizedMessages)] as const;\n\n protected renderChart(): React.ReactNode {\n const { groupKey, showDots, circle, onClickRadar } = this.asProps;\n const { dataDefinitions } = this.state;\n\n return (\n <Radar onClick={onClickRadar} scale={this.xScale} type={circle ? 'circle' : undefined}>\n <Radar.Axis dataKey={groupKey}>\n <Radar.Axis.Ticks />\n <Radar.Axis.Labels />\n </Radar.Axis>\n {this.renderRadarTooltip()}\n {dataDefinitions.map((item) => {\n return (\n item.checked && (\n <Radar.Polygon dataKey={item.id} key={item.id} color={item.color}>\n <Radar.Polygon.Line />\n {showDots && <Radar.Polygon.Dots />}\n </Radar.Polygon>\n )\n );\n })}\n </Radar>\n );\n }\n\n protected renderRadarTooltip(): React.ReactNode {\n const { data, groupKey, showTooltip } = this.asProps;\n const { dataDefinitions } = this.state;\n\n if (!showTooltip) {\n return null;\n }\n\n return (\n <Radar.Tooltip wMin={100}>\n {({ index }: any) => {\n return {\n children: (\n <>\n <Radar.Tooltip.Title>{data[groupKey]?.[index]}</Radar.Tooltip.Title>\n\n {dataDefinitions.map((item) => {\n const value = data[item.id]?.[index];\n\n return (\n item.checked && (\n <Radar.Tooltip.Dot color={item.color} key={item.id}>\n {this.tooltipValueFormatter(value)}\n </Radar.Tooltip.Dot>\n )\n );\n })}\n </>\n ),\n };\n }}\n </Radar.Tooltip>\n );\n }\n\n // By default, tooltip will render in Plot component.\n // In RadarChart, we need to render it in Radar component, so we use renderRadarTooltip method\n protected renderTooltip(): React.ReactNode {\n return null;\n }\n\n protected get dataKeys(): string[] {\n const { data, groupKey } = this.props;\n\n const legendKeys: string[] = Object.keys(data).filter((key) => key !== groupKey);\n\n return legendKeys;\n }\n\n protected get xScale(): ScaleLinear<any, any> {\n return this.asProps.scale ?? scaleLinear().domain(this.domain);\n }\n\n protected get yScale(): ScaleLinear<any, any> {\n return this.asProps.scale ?? scaleLinear().domain(this.domain);\n }\n\n protected getLegendAriaLabel(): string {\n return this.asProps.getI18nText('legendForChart', { chartType: 'Radar' });\n }\n\n private get domain(): [number, number] {\n return [Math.min(...super.flatValues), Math.max(...super.flatValues)];\n }\n}\n\nexport const RadarChart: RadarChartType = createComponent(RadarChartComponent);\n"],"mappings":";AAAA,SAASA,eAAe,QAAQ,eAAe;AAC/C,OAAOC,WAAW,MAAM,8CAA8C;AACtE,SAASC,WAAW,QAA0B,UAAU;AACxD,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,aAAa,QAAQ,iBAAiB;AAE/C;AACA,SAASC,KAAK,QAAQ,OAAO;AAC7B,SAASC,iBAAiB,QAAQ,oDAAoD;AAEtF,MAAMC,mBAAmB,SAASH,aAAa,CAI7C;EAGUI,WAAWA,CAAA,EAAoB;IACvC,MAAM;MAAEC,QAAQ;MAAEC,QAAQ;MAAEC,MAAM;MAAEC;IAAa,CAAC,GAAG,IAAI,CAACC,OAAO;IACjE,MAAM;MAAEC;IAAgB,CAAC,GAAG,IAAI,CAACC,KAAK;IAEtC,oBACEZ,KAAA,CAAAa,aAAA,CAACX,KAAK;MAACY,OAAO,EAAEL,YAAa;MAACM,KAAK,EAAE,IAAI,CAACC,MAAO;MAACC,IAAI,EAAET,MAAM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;IAAQ,CAAC,CAAC;EAC3E;EAEA,IAAYJ,MAAMA,CAAA,EAAqB;IACrC,OAAO,CAACK,IAAI,CAACC,GAAG,CAAC,GAAG,KAAK,CAACC,UAAU,CAAC,EAAEF,IAAI,CAACG,GAAG,CAAC,GAAG,KAAK,CAACD,UAAU,CAAC,CAAC;EACvE;AACF;AAACE,eAAA,CAhGKxD,mBAAmB,aAKN,CAACN,WAAW,CAACK,iBAAiB,CAAC,CAAC;AA6FnD,OAAO,MAAM0D,UAA0B,GAAGhE,eAAe,CAACO,mBAAmB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadarChart.type.js","names":[],"sources":["../../../../src/component/Chart/RadarChart.type.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"RadarChart.type.js","names":[],"sources":["../../../../src/component/Chart/RadarChart.type.ts"],"sourcesContent":["import type { Flex } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport type { ScaleLinear } from 'd3-scale';\n\nimport type { BaseChartProps } from './AbstractChart.type';\n\nexport type RadarChartData = Record<string, string[] | number[]>;\n\nexport type RadarChartProps = Intergalactic.InternalTypings.EfficientOmit<\n BaseChartProps<RadarChartData>,\n 'showTotalInTooltip' | 'showPercentValueInTooltip'\n> & {\n groupKey: string;\n scale?: ScaleLinear<any, any>;\n xScale?: never;\n yScale?: never;\n showDots?: boolean;\n circle?: boolean;\n /** Callback triggered when a user clicks on a chart at a position corresponding to a category */\n onClickRadar?: (index: number, e: React.SyntheticEvent) => void;\n};\n\nexport type RadarChartType = Intergalactic.Component<typeof Flex, RadarChartProps>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _callSuper from "@babel/runtime/helpers/callSuper";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
2
|
import { createComponent } from '@semcore/core';
|
|
9
3
|
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
@@ -15,144 +9,125 @@ import React from 'react';
|
|
|
15
9
|
import { minMax, ScatterPlot, getScatterPlotRadius } from '../..';
|
|
16
10
|
import { AbstractChart } from './AbstractChart';
|
|
17
11
|
import { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
class ScatterPlotChartComponent extends AbstractChart {
|
|
13
|
+
get dataKeys() {
|
|
14
|
+
const {
|
|
15
|
+
data,
|
|
16
|
+
groupKey,
|
|
17
|
+
valueKey
|
|
18
|
+
} = this.props;
|
|
19
|
+
return Object.keys(data[0]).filter(key => key !== groupKey && key !== valueKey);
|
|
22
20
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
}, {
|
|
36
|
-
key: "xScale",
|
|
37
|
-
get: function get() {
|
|
38
|
-
var _this$asProps = this.asProps,
|
|
39
|
-
xScale = _this$asProps.xScale,
|
|
40
|
-
_this$asProps$marginY = _this$asProps.marginY,
|
|
41
|
-
marginY = _this$asProps$marginY === void 0 ? 30 : _this$asProps$marginY,
|
|
42
|
-
plotWidth = _this$asProps.plotWidth,
|
|
43
|
-
data = _this$asProps.data,
|
|
44
|
-
groupKey = _this$asProps.groupKey,
|
|
45
|
-
valueKey = _this$asProps.valueKey;
|
|
46
|
-
if (xScale) {
|
|
47
|
-
return xScale;
|
|
48
|
-
}
|
|
49
|
-
var radius = getScatterPlotRadius(valueKey) / this.getValueScale(_toConsumableArray(this.flatValues));
|
|
50
|
-
var testItem = data[0][groupKey];
|
|
51
|
-
var range = [marginY, plotWidth - this.plotPadding];
|
|
52
|
-
var domain = minMax(data, groupKey);
|
|
53
|
-
if (testItem instanceof Date && !Number.isNaN(testItem.getMilliseconds())) {
|
|
54
|
-
return scaleTime([domain[0] - radius, domain[1] + radius], range);
|
|
55
|
-
}
|
|
56
|
-
return scaleLinear([domain[0] - radius, domain[1] + radius], range);
|
|
21
|
+
get xScale() {
|
|
22
|
+
const {
|
|
23
|
+
xScale,
|
|
24
|
+
marginY = 30,
|
|
25
|
+
plotWidth,
|
|
26
|
+
data,
|
|
27
|
+
groupKey,
|
|
28
|
+
valueKey
|
|
29
|
+
} = this.asProps;
|
|
30
|
+
if (xScale) {
|
|
31
|
+
return xScale;
|
|
57
32
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
marginX = _this$asProps2$margin === void 0 ? 30 : _this$asProps2$margin,
|
|
65
|
-
plotHeight = _this$asProps2.plotHeight,
|
|
66
|
-
valueKey = _this$asProps2.valueKey;
|
|
67
|
-
if (yScale) {
|
|
68
|
-
return yScale;
|
|
69
|
-
}
|
|
70
|
-
var flatValues = this.flatValues;
|
|
71
|
-
var radius = getScatterPlotRadius(valueKey) / this.getValueScale(_toConsumableArray(flatValues));
|
|
72
|
-
var max = Math.max.apply(Math, _toConsumableArray(flatValues)) + radius;
|
|
73
|
-
var min = Math.min.apply(Math, _toConsumableArray(flatValues)) - radius;
|
|
74
|
-
return scaleLinear().range([plotHeight - marginX, this.plotPadding]).domain([min, max]);
|
|
33
|
+
const radius = getScatterPlotRadius(valueKey) / this.getValueScale([...this.flatValues]);
|
|
34
|
+
const testItem = data[0][groupKey];
|
|
35
|
+
const range = [marginY, plotWidth - this.plotPadding];
|
|
36
|
+
const domain = minMax(data, groupKey);
|
|
37
|
+
if (testItem instanceof Date && !Number.isNaN(testItem.getMilliseconds())) {
|
|
38
|
+
return scaleTime([domain[0] - radius, domain[1] + radius], range);
|
|
75
39
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
value = _ref2[1];
|
|
88
|
-
if (key !== groupKey && key !== valueKey && typeof value === 'number') {
|
|
89
|
-
result.add(value);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
return result;
|
|
93
|
-
}, new Set());
|
|
94
|
-
return flatValues;
|
|
40
|
+
return scaleLinear([domain[0] - radius, domain[1] + radius], range);
|
|
41
|
+
}
|
|
42
|
+
get yScale() {
|
|
43
|
+
const {
|
|
44
|
+
yScale,
|
|
45
|
+
marginX = 30,
|
|
46
|
+
plotHeight,
|
|
47
|
+
valueKey
|
|
48
|
+
} = this.asProps;
|
|
49
|
+
if (yScale) {
|
|
50
|
+
return yScale;
|
|
95
51
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
value
|
|
112
|
-
}
|
|
52
|
+
const flatValues = this.flatValues;
|
|
53
|
+
const radius = getScatterPlotRadius(valueKey) / this.getValueScale([...flatValues]);
|
|
54
|
+
const max = Math.max(...flatValues) + radius;
|
|
55
|
+
const min = Math.min(...flatValues) - radius;
|
|
56
|
+
return scaleLinear().range([plotHeight - marginX, this.plotPadding]).domain([min, max]);
|
|
57
|
+
}
|
|
58
|
+
get flatValues() {
|
|
59
|
+
const {
|
|
60
|
+
data,
|
|
61
|
+
groupKey,
|
|
62
|
+
valueKey
|
|
63
|
+
} = this.asProps;
|
|
64
|
+
const flatValues = data.reduce((result, item) => {
|
|
65
|
+
Object.entries(item).forEach(([key, value]) => {
|
|
66
|
+
if (key !== groupKey && key !== valueKey && typeof value === 'number') {
|
|
67
|
+
result.add(value);
|
|
68
|
+
}
|
|
113
69
|
});
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return {
|
|
136
|
-
children: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ScatterPlot.Tooltip.Dot, {
|
|
137
|
-
color: item.color
|
|
138
|
-
}, "Data"), /*#__PURE__*/React.createElement(Text, {
|
|
139
|
-
tag: "div"
|
|
140
|
-
}, "X axis", _this.tooltipValueFormatter(data[index][x])), /*#__PURE__*/React.createElement(Text, {
|
|
141
|
-
tag: "div"
|
|
142
|
-
}, "Y axis", _this.tooltipValueFormatter(data[index][y])))
|
|
143
|
-
};
|
|
144
|
-
});
|
|
70
|
+
return result;
|
|
71
|
+
}, new Set());
|
|
72
|
+
return flatValues;
|
|
73
|
+
}
|
|
74
|
+
renderChart() {
|
|
75
|
+
const {
|
|
76
|
+
groupKey,
|
|
77
|
+
valueKey,
|
|
78
|
+
onClickScatterItem
|
|
79
|
+
} = this.asProps;
|
|
80
|
+
const {
|
|
81
|
+
dataDefinitions
|
|
82
|
+
} = this.state;
|
|
83
|
+
return dataDefinitions.map(item => {
|
|
84
|
+
return item.checked && /*#__PURE__*/React.createElement(ScatterPlot, {
|
|
85
|
+
onClick: onClickScatterItem,
|
|
86
|
+
x: groupKey,
|
|
87
|
+
y: item.id,
|
|
88
|
+
key: item.id,
|
|
89
|
+
color: item.color,
|
|
90
|
+
value: valueKey
|
|
145
91
|
});
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
renderTooltip() {
|
|
95
|
+
const {
|
|
96
|
+
data,
|
|
97
|
+
groupKey
|
|
98
|
+
} = this.asProps;
|
|
99
|
+
const {
|
|
100
|
+
dataDefinitions
|
|
101
|
+
} = this.state;
|
|
102
|
+
return dataDefinitions.filter(item => item.checked).map(item => {
|
|
103
|
+
return /*#__PURE__*/React.createElement(ScatterPlot.Tooltip, {
|
|
104
|
+
key: item.id,
|
|
105
|
+
x: groupKey,
|
|
106
|
+
y: item.id,
|
|
107
|
+
wMin: 100
|
|
108
|
+
}, ({
|
|
109
|
+
index,
|
|
110
|
+
x,
|
|
111
|
+
y
|
|
112
|
+
}) => {
|
|
113
|
+
return {
|
|
114
|
+
children: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ScatterPlot.Tooltip.Dot, {
|
|
115
|
+
color: item.color
|
|
116
|
+
}, "Data"), /*#__PURE__*/React.createElement(Text, {
|
|
117
|
+
tag: "div"
|
|
118
|
+
}, "X axis", this.tooltipValueFormatter(data[index][x])), /*#__PURE__*/React.createElement(Text, {
|
|
119
|
+
tag: "div"
|
|
120
|
+
}, "Y axis", this.tooltipValueFormatter(data[index][y])))
|
|
121
|
+
};
|
|
152
122
|
});
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
getLegendAriaLabel() {
|
|
126
|
+
return this.asProps.getI18nText('legendForChart', {
|
|
127
|
+
chartType: 'ScatterPlot'
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
156
131
|
_defineProperty(ScatterPlotChartComponent, "displayName", 'Chart.ScatterPlot');
|
|
157
132
|
_defineProperty(ScatterPlotChartComponent, "defaultProps", {
|
|
158
133
|
direction: 'column',
|
|
@@ -162,5 +137,5 @@ _defineProperty(ScatterPlotChartComponent, "defaultProps", {
|
|
|
162
137
|
showLegend: false
|
|
163
138
|
});
|
|
164
139
|
_defineProperty(ScatterPlotChartComponent, "enhance", [i18nEnhance(localizedMessages)]);
|
|
165
|
-
export
|
|
140
|
+
export const ScatterPlotChart = createComponent(ScatterPlotChartComponent);
|
|
166
141
|
//# sourceMappingURL=ScatterPlotChart.js.map
|