@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
package/lib/esm/Donut.mjs
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
|
-
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
9
2
|
import { sstyled, assignProps, Component } from "@semcore/core";
|
|
10
3
|
import { callAllEventHandlers } from "@semcore/core/lib/utils/assignProps";
|
|
11
4
|
import canUseDOM from "@semcore/core/lib/utils/canUseDOM";
|
|
@@ -19,45 +12,49 @@ import createElement from "./createElement.mjs";
|
|
|
19
12
|
import { PatternFill } from "./Pattern.mjs";
|
|
20
13
|
import Tooltip from "./Tooltip.mjs";
|
|
21
14
|
import { getChartDefaultColorName } from "./utils.mjs";
|
|
22
|
-
var _excluded = ["Element", "styles", "d3Arc", "data", "color", "$animationActivePie", "active", "d3ArcOut", "name", "dataKey", "dataHintsHandler", "transparent", "innerRadius", "outerRadius", "resolveColor", "halfsize", "uid", "patterns", "onClick", "onClickPieRoot"];
|
|
23
15
|
/*!__reshadow-styles__:"./style/donut.shadow.css"*/
|
|
24
|
-
|
|
16
|
+
const style = (
|
|
25
17
|
/*__reshadow_css_start__*/
|
|
26
18
|
(sstyled.insert(
|
|
27
19
|
/*__inner_css_start__*/
|
|
28
|
-
".
|
|
20
|
+
".___SPie_1s4vb_gg_{stroke:var(--intergalactic-chart-grid-border, #ffffff);fill:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SPie_1s4vb_gg_.__color_1s4vb_gg_{fill:var(--color_1s4vb)}.___SPie_1s4vb_gg_.__pattern_1s4vb_gg_.__color_1s4vb_gg_{fill:var(--pattern_1s4vb);stroke:var(--color_1s4vb);stroke-width:1px}.___SPie_1s4vb_gg_.__transparent_1s4vb_gg_{opacity:.3}.___SEmptyData_1s4vb_gg_{fill:var(--intergalactic-chart-palette-order-null, #e0e1e9)}.___SEmptyData_1s4vb_gg_.__color_1s4vb_gg_{fill:var(--color_1s4vb)}.___SLabel_1s4vb_gg_{text-anchor:middle;vertical-anchor:middle;font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}",
|
|
29
21
|
/*__inner_css_end__*/
|
|
30
|
-
"
|
|
22
|
+
"1s4vb_gg_"
|
|
31
23
|
), /*__reshadow_css_end__*/
|
|
32
24
|
{
|
|
33
|
-
"__SPie": "
|
|
34
|
-
"_color": "
|
|
35
|
-
"--color": "--
|
|
36
|
-
"_pattern": "
|
|
37
|
-
"--pattern": "--
|
|
38
|
-
"_transparent": "
|
|
39
|
-
"__SEmptyData": "
|
|
40
|
-
"__SLabel": "
|
|
25
|
+
"__SPie": "___SPie_1s4vb_gg_",
|
|
26
|
+
"_color": "__color_1s4vb_gg_",
|
|
27
|
+
"--color": "--color_1s4vb",
|
|
28
|
+
"_pattern": "__pattern_1s4vb_gg_",
|
|
29
|
+
"--pattern": "--pattern_1s4vb",
|
|
30
|
+
"_transparent": "__transparent_1s4vb_gg_",
|
|
31
|
+
"__SEmptyData": "___SEmptyData_1s4vb_gg_",
|
|
32
|
+
"__SLabel": "___SLabel_1s4vb_gg_"
|
|
41
33
|
})
|
|
42
34
|
);
|
|
43
|
-
|
|
44
|
-
function transitionAnglePie(
|
|
45
|
-
|
|
35
|
+
const DEFAULT_INSTANCE = Symbol("DEFAULT_INSTANCE");
|
|
36
|
+
function transitionAnglePie({
|
|
37
|
+
selector,
|
|
38
|
+
duration,
|
|
39
|
+
halfsize,
|
|
40
|
+
d3Arc,
|
|
41
|
+
d3ArcOut,
|
|
42
|
+
arcs,
|
|
43
|
+
activeIndexPie
|
|
44
|
+
}) {
|
|
46
45
|
return transition().selection().selectAll(selector).interrupt().transition().duration(duration).attrTween("d", function(_, ind) {
|
|
47
|
-
if (!arcs[ind]) return
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
var prevStartAngle = initAngle;
|
|
54
|
-
var prevEndAngle = initAngle;
|
|
46
|
+
if (!arcs[ind]) return () => "";
|
|
47
|
+
const d = Object.assign({}, arcs[ind]);
|
|
48
|
+
const self = this;
|
|
49
|
+
const initAngle = halfsize ? -Math.PI / 2 : 0;
|
|
50
|
+
let prevStartAngle = initAngle;
|
|
51
|
+
let prevEndAngle = initAngle;
|
|
55
52
|
if (self.arc) {
|
|
56
53
|
prevStartAngle = self.arc.startAngle;
|
|
57
54
|
prevEndAngle = self.arc.endAngle;
|
|
58
55
|
}
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
const iStartAngle = interpolate(prevStartAngle, d.startAngle);
|
|
57
|
+
const iEndAngle = interpolate(prevEndAngle, d.endAngle);
|
|
61
58
|
return function(t) {
|
|
62
59
|
d.startAngle = iStartAngle(t);
|
|
63
60
|
d.endAngle = iEndAngle(t);
|
|
@@ -66,55 +63,71 @@ function transitionAnglePie(_ref6) {
|
|
|
66
63
|
};
|
|
67
64
|
});
|
|
68
65
|
}
|
|
69
|
-
function transitionRadiusPie(
|
|
70
|
-
|
|
66
|
+
function transitionRadiusPie({
|
|
67
|
+
data,
|
|
68
|
+
selector,
|
|
69
|
+
element,
|
|
70
|
+
duration,
|
|
71
|
+
innerRadius,
|
|
72
|
+
outerRadiusStartEnd,
|
|
73
|
+
paddingAngle
|
|
74
|
+
}) {
|
|
71
75
|
return transition().selection().select(selector).interrupt().transition().duration(duration).attrTween("d", function() {
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
const [start, end] = outerRadiusStartEnd;
|
|
77
|
+
const iOuterRadius = interpolate(start, end);
|
|
74
78
|
return function(t) {
|
|
75
|
-
|
|
79
|
+
const outerRadiusPX = iOuterRadius(t);
|
|
76
80
|
element.dataset["currentRadius"] = outerRadiusPX;
|
|
77
|
-
|
|
81
|
+
const d3ArcOut = arc().innerRadius(innerRadius).outerRadius(outerRadiusPX).padAngle(paddingAngle);
|
|
78
82
|
return d3ArcOut(data);
|
|
79
83
|
};
|
|
80
84
|
});
|
|
81
85
|
}
|
|
82
|
-
|
|
83
|
-
function getOuterRadius(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
const increaseFactor = 8;
|
|
87
|
+
function getOuterRadius({
|
|
88
|
+
size,
|
|
89
|
+
halfsize
|
|
90
|
+
}) {
|
|
91
|
+
const [width, height] = size;
|
|
92
|
+
const minORmax = halfsize ? Math.max : Math.min;
|
|
87
93
|
return minORmax(width - increaseFactor * 2, height - increaseFactor * 2) / 2;
|
|
88
94
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
eventEmitter.emit("setTooltipVisible_".concat(plotId), visible);
|
|
107
|
-
};
|
|
95
|
+
class DonutRoot extends Component {
|
|
96
|
+
constructor(...args) {
|
|
97
|
+
super(...args);
|
|
98
|
+
_defineProperty(this, "virtualElement", canUseDOM() ? document.createElement("div") : {});
|
|
99
|
+
_defineProperty(this, "activeIndexPie", void 0);
|
|
100
|
+
_defineProperty(this, "canAnimatedHover", false);
|
|
101
|
+
_defineProperty(this, "bindHandlerTooltip", (visible, props, tooltipProps) => ({
|
|
102
|
+
clientX,
|
|
103
|
+
clientY
|
|
104
|
+
}) => {
|
|
105
|
+
const {
|
|
106
|
+
eventEmitter,
|
|
107
|
+
plotId
|
|
108
|
+
} = this.asProps;
|
|
109
|
+
eventEmitter.emit(`setTooltipPosition_${plotId}`, clientX, clientY);
|
|
110
|
+
eventEmitter.emit(`setTooltipRenderingProps_${plotId}`, props, tooltipProps);
|
|
111
|
+
eventEmitter.emit(`setTooltipVisible_${plotId}`, visible);
|
|
108
112
|
});
|
|
109
|
-
_defineProperty(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
_defineProperty(this, "animationActivePie", ({
|
|
114
|
+
data,
|
|
115
|
+
active,
|
|
116
|
+
selector,
|
|
117
|
+
element
|
|
118
|
+
}) => {
|
|
119
|
+
const {
|
|
120
|
+
duration,
|
|
121
|
+
innerRadius,
|
|
122
|
+
d3Arc,
|
|
123
|
+
paddingAngle
|
|
124
|
+
} = this.asProps;
|
|
125
|
+
const outerRadius = d3Arc.outerRadius()();
|
|
126
|
+
const outerRadiusStartEnd = active ? [+element.dataset["currentRadius"] || outerRadius, outerRadius + increaseFactor] : [+element.dataset["currentRadius"] || outerRadius, outerRadius];
|
|
127
|
+
if (this.canAnimatedHover && duration > 0) {
|
|
115
128
|
transitionRadiusPie({
|
|
116
129
|
data,
|
|
117
|
-
selector:
|
|
130
|
+
selector: `#${this.id} ${selector}`,
|
|
118
131
|
element,
|
|
119
132
|
duration: duration === 0 ? 0 : 300,
|
|
120
133
|
innerRadius,
|
|
@@ -123,211 +136,211 @@ var DonutRoot = /* @__PURE__ */ (function(_Component) {
|
|
|
123
136
|
});
|
|
124
137
|
}
|
|
125
138
|
});
|
|
126
|
-
_defineProperty(
|
|
127
|
-
_defineProperty(
|
|
128
|
-
clearTimeout(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
139
|
+
_defineProperty(this, "animationTimeout", null);
|
|
140
|
+
_defineProperty(this, "animationUpdatePie", () => {
|
|
141
|
+
clearTimeout(this.animationTimeout);
|
|
142
|
+
this.animationTimeout = setTimeout(() => {
|
|
143
|
+
const {
|
|
144
|
+
duration,
|
|
145
|
+
d3Arc,
|
|
146
|
+
halfsize,
|
|
147
|
+
d3ArcOut
|
|
148
|
+
} = this.asProps;
|
|
149
|
+
this.canAnimatedHover = false;
|
|
132
150
|
if (duration > 0) {
|
|
133
151
|
transitionAnglePie({
|
|
134
|
-
selector:
|
|
152
|
+
selector: `#${this.id} [data-ui-name="Donut.Pie"]`,
|
|
135
153
|
duration,
|
|
136
|
-
arcs:
|
|
154
|
+
arcs: this.arcs,
|
|
137
155
|
halfsize,
|
|
138
156
|
d3Arc,
|
|
139
157
|
d3ArcOut,
|
|
140
|
-
activeIndexPie:
|
|
141
|
-
}).on("end",
|
|
142
|
-
|
|
158
|
+
activeIndexPie: this.activeIndexPie
|
|
159
|
+
}).on("end", () => {
|
|
160
|
+
this.canAnimatedHover = true;
|
|
143
161
|
});
|
|
144
162
|
} else {
|
|
145
|
-
|
|
163
|
+
this.canAnimatedHover = true;
|
|
146
164
|
}
|
|
147
165
|
}, 0);
|
|
148
166
|
});
|
|
149
|
-
return _this;
|
|
150
167
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
var keys = React.Children.toArray(getOriginChildren(Children)).reduce(function(acc, child) {
|
|
181
|
-
if (/* @__PURE__ */ React.isValidElement(child) && child.type === Donut.Pie) {
|
|
182
|
-
acc.push(child.props.dataKey);
|
|
183
|
-
}
|
|
184
|
-
return acc;
|
|
185
|
-
}, []);
|
|
186
|
-
pieData = Object.entries(data).filter(function(_ref1) {
|
|
187
|
-
var _ref10 = _slicedToArray(_ref1, 2), key = _ref10[0], value = _ref10[1];
|
|
188
|
-
return keys.includes(key) && value > 0;
|
|
189
|
-
}).sort(function(_ref11, _ref12) {
|
|
190
|
-
var _ref13 = _slicedToArray(_ref11, 1), a = _ref13[0];
|
|
191
|
-
var _ref14 = _slicedToArray(_ref12, 1), b = _ref14[0];
|
|
192
|
-
return keys.indexOf(a) > keys.indexOf(b) ? 1 : -1;
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
var minValue = pieData.reduce(function(acc, cur) {
|
|
196
|
-
if (cur[1]) acc += cur[1];
|
|
168
|
+
get id() {
|
|
169
|
+
const {
|
|
170
|
+
uid,
|
|
171
|
+
id
|
|
172
|
+
} = this.asProps;
|
|
173
|
+
return id || uid;
|
|
174
|
+
}
|
|
175
|
+
generateGetBoundingClientRect(x = 0, y = 0) {
|
|
176
|
+
return () => ({
|
|
177
|
+
width: 0,
|
|
178
|
+
height: 0,
|
|
179
|
+
top: y,
|
|
180
|
+
right: x,
|
|
181
|
+
bottom: y,
|
|
182
|
+
left: x
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
getArcs() {
|
|
186
|
+
const {
|
|
187
|
+
Children,
|
|
188
|
+
data,
|
|
189
|
+
d3Pie
|
|
190
|
+
} = this.asProps;
|
|
191
|
+
let pieData = Object.entries(data);
|
|
192
|
+
if (d3Pie[DEFAULT_INSTANCE]) {
|
|
193
|
+
const keys = React.Children.toArray(getOriginChildren(Children)).reduce((acc, child) => {
|
|
194
|
+
if (/* @__PURE__ */ React.isValidElement(child) && child.type === Donut.Pie) {
|
|
195
|
+
acc.push(child.props.dataKey);
|
|
196
|
+
}
|
|
197
197
|
return acc;
|
|
198
|
-
},
|
|
199
|
-
pieData =
|
|
200
|
-
if (d[1] && d[1] < minValue) d[1] = minValue;
|
|
201
|
-
return d;
|
|
202
|
-
});
|
|
203
|
-
return d3Pie(pieData);
|
|
204
|
-
}
|
|
205
|
-
}, {
|
|
206
|
-
key: "handlerOnClick",
|
|
207
|
-
value: function handlerOnClick(key) {
|
|
208
|
-
var _this2 = this;
|
|
209
|
-
return function(e) {
|
|
210
|
-
e.stopPropagation();
|
|
211
|
-
var onClick = _this2.asProps.onClick;
|
|
212
|
-
if (!onClick) return;
|
|
213
|
-
onClick(key, e);
|
|
214
|
-
};
|
|
198
|
+
}, []);
|
|
199
|
+
pieData = Object.entries(data).filter(([key, value]) => keys.includes(key) && value > 0).sort(([a], [b]) => keys.indexOf(a) > keys.indexOf(b) ? 1 : -1);
|
|
215
200
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
_this3.animationActivePie({
|
|
254
|
-
active: true,
|
|
255
|
-
data,
|
|
256
|
-
selector: '[d="'.concat(e.target.getAttribute("d"), '"]'),
|
|
257
|
-
element: e.target
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
},
|
|
261
|
-
onMouseOut: function onMouseOut(e) {
|
|
262
|
-
if (!active) {
|
|
263
|
-
_this3.animationActivePie({
|
|
264
|
-
active: false,
|
|
265
|
-
data,
|
|
266
|
-
selector: '[d="'.concat(e.target.getAttribute("d"), '"]'),
|
|
267
|
-
element: e.target
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
},
|
|
271
|
-
onClickPieRoot: this.handlerOnClick(props.dataKey)
|
|
272
|
-
};
|
|
273
|
-
}
|
|
274
|
-
}, {
|
|
275
|
-
key: "getEmptyDataProps",
|
|
276
|
-
value: function getEmptyDataProps() {
|
|
277
|
-
var d3Arc = this.asProps.d3Arc;
|
|
278
|
-
return {
|
|
279
|
-
d3Arc
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
}, {
|
|
283
|
-
key: "componentDidUpdate",
|
|
284
|
-
value: function componentDidUpdate(prevProps) {
|
|
285
|
-
var data = this.asProps.data;
|
|
286
|
-
if (prevProps.$rootProps.data !== data) {
|
|
287
|
-
this.animationUpdatePie();
|
|
288
|
-
}
|
|
201
|
+
const minValue = pieData.reduce((acc, cur) => {
|
|
202
|
+
if (cur[1]) acc += cur[1];
|
|
203
|
+
return acc;
|
|
204
|
+
}, 0) / 100;
|
|
205
|
+
pieData = pieData.map((d) => {
|
|
206
|
+
if (d[1] && d[1] < minValue) d[1] = minValue;
|
|
207
|
+
return d;
|
|
208
|
+
});
|
|
209
|
+
return d3Pie(pieData);
|
|
210
|
+
}
|
|
211
|
+
handlerOnClick(key) {
|
|
212
|
+
return (e) => {
|
|
213
|
+
e.stopPropagation();
|
|
214
|
+
const {
|
|
215
|
+
onClick
|
|
216
|
+
} = this.asProps;
|
|
217
|
+
if (!onClick) return;
|
|
218
|
+
onClick(key, e);
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
getPieProps(props, index) {
|
|
222
|
+
const {
|
|
223
|
+
d3Arc,
|
|
224
|
+
d3ArcOut,
|
|
225
|
+
innerRadius,
|
|
226
|
+
outerRadius,
|
|
227
|
+
halfsize,
|
|
228
|
+
resolveColor,
|
|
229
|
+
uid,
|
|
230
|
+
patterns
|
|
231
|
+
} = this.asProps;
|
|
232
|
+
const {
|
|
233
|
+
active
|
|
234
|
+
} = props;
|
|
235
|
+
const data = this.arcs.find((arc2) => arc2.data[0] === props.dataKey);
|
|
236
|
+
if (active) {
|
|
237
|
+
this.activeIndexPie = index;
|
|
289
238
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
239
|
+
const tooltipProps = {
|
|
240
|
+
dataKey: props.dataKey,
|
|
241
|
+
name: props.name,
|
|
242
|
+
resolveColor,
|
|
243
|
+
color: props.color || getChartDefaultColorName(index),
|
|
244
|
+
active: props.active,
|
|
245
|
+
transparent: props.transparent,
|
|
246
|
+
patterns
|
|
247
|
+
};
|
|
248
|
+
return {
|
|
249
|
+
data,
|
|
250
|
+
d3Arc,
|
|
251
|
+
d3ArcOut,
|
|
252
|
+
innerRadius,
|
|
253
|
+
outerRadius,
|
|
254
|
+
uid: `${uid}-${index}`,
|
|
255
|
+
patterns,
|
|
256
|
+
halfsize,
|
|
257
|
+
color: props.color || getChartDefaultColorName(index),
|
|
258
|
+
resolveColor,
|
|
259
|
+
$animationActivePie: this.animationActivePie,
|
|
260
|
+
onMouseMove: this.bindHandlerTooltip(true, props, tooltipProps),
|
|
261
|
+
onMouseLeave: this.bindHandlerTooltip(false, props, tooltipProps),
|
|
262
|
+
onMouseOver: (e) => {
|
|
263
|
+
if (!active) {
|
|
264
|
+
this.animationActivePie({
|
|
265
|
+
active: true,
|
|
266
|
+
data,
|
|
267
|
+
selector: `[d="${e.target.getAttribute("d")}"]`,
|
|
268
|
+
element: e.target
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
onMouseOut: (e) => {
|
|
273
|
+
if (!active) {
|
|
274
|
+
this.animationActivePie({
|
|
275
|
+
active: false,
|
|
276
|
+
data,
|
|
277
|
+
selector: `[d="${e.target.getAttribute("d")}"]`,
|
|
278
|
+
element: e.target
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
onClickPieRoot: this.handlerOnClick(props.dataKey)
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
getEmptyDataProps() {
|
|
286
|
+
const {
|
|
287
|
+
d3Arc
|
|
288
|
+
} = this.asProps;
|
|
289
|
+
return {
|
|
290
|
+
d3Arc
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
componentDidUpdate(prevProps) {
|
|
294
|
+
const {
|
|
295
|
+
data
|
|
296
|
+
} = this.asProps;
|
|
297
|
+
if (prevProps.$rootProps.data !== data) {
|
|
293
298
|
this.animationUpdatePie();
|
|
294
299
|
}
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
300
|
+
}
|
|
301
|
+
componentDidMount() {
|
|
302
|
+
this.animationUpdatePie();
|
|
303
|
+
}
|
|
304
|
+
render() {
|
|
305
|
+
const {
|
|
306
|
+
halfsize,
|
|
307
|
+
size
|
|
308
|
+
} = this.asProps;
|
|
309
|
+
this.asProps.dataHintsHandler.establishDataType("values-set");
|
|
310
|
+
const [width, height] = size;
|
|
311
|
+
const Element = this.Element;
|
|
312
|
+
const k = halfsize ? 1 : 2;
|
|
313
|
+
this.arcs = this.getArcs();
|
|
314
|
+
return /* @__PURE__ */ React.createElement(Element, {
|
|
315
|
+
"aria-hidden": true,
|
|
316
|
+
id: this.id,
|
|
317
|
+
render: "g",
|
|
318
|
+
childrenPosition: "inside",
|
|
319
|
+
transform: `translate(${width / 2},${height / k})`
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
}
|
|
314
323
|
_defineProperty(DonutRoot, "displayName", "Donut");
|
|
315
324
|
_defineProperty(DonutRoot, "style", style);
|
|
316
325
|
_defineProperty(DonutRoot, "enhance", [uniqueIDEnhancement()]);
|
|
317
|
-
_defineProperty(DonutRoot, "defaultProps",
|
|
318
|
-
|
|
319
|
-
|
|
326
|
+
_defineProperty(DonutRoot, "defaultProps", ({
|
|
327
|
+
innerRadius = 0,
|
|
328
|
+
paddingAngle = 0,
|
|
329
|
+
outerRadius,
|
|
330
|
+
halfsize = false,
|
|
331
|
+
$rootProps: {
|
|
332
|
+
size
|
|
333
|
+
}
|
|
334
|
+
}) => {
|
|
335
|
+
const d3Arc = arc().outerRadius(outerRadius || getOuterRadius({
|
|
320
336
|
size,
|
|
321
337
|
halfsize
|
|
322
338
|
})).innerRadius(innerRadius).padAngle(paddingAngle);
|
|
323
|
-
|
|
339
|
+
const d3ArcOut = arc().outerRadius((outerRadius || getOuterRadius({
|
|
324
340
|
size,
|
|
325
341
|
halfsize
|
|
326
342
|
})) + increaseFactor).innerRadius(innerRadius).padAngle(paddingAngle);
|
|
327
|
-
|
|
328
|
-
var _ref20 = _slicedToArray(_ref19, 2), value = _ref20[1];
|
|
329
|
-
return value;
|
|
330
|
-
});
|
|
343
|
+
let d3Pie = pie().sort(null).value(([, value]) => value);
|
|
331
344
|
d3Pie[DEFAULT_INSTANCE] = true;
|
|
332
345
|
if (halfsize) {
|
|
333
346
|
d3Pie = d3Pie.startAngle(-Math.PI / 2).endAngle(Math.PI / 2);
|
|
@@ -341,12 +354,33 @@ _defineProperty(DonutRoot, "defaultProps", function(_ref18) {
|
|
|
341
354
|
innerRadius
|
|
342
355
|
};
|
|
343
356
|
});
|
|
344
|
-
function Pie(
|
|
357
|
+
function Pie({
|
|
358
|
+
Element: SPie,
|
|
359
|
+
styles,
|
|
360
|
+
d3Arc,
|
|
361
|
+
data,
|
|
362
|
+
color,
|
|
363
|
+
$animationActivePie,
|
|
364
|
+
active,
|
|
365
|
+
d3ArcOut,
|
|
366
|
+
name,
|
|
367
|
+
dataKey,
|
|
368
|
+
dataHintsHandler,
|
|
369
|
+
transparent,
|
|
370
|
+
innerRadius,
|
|
371
|
+
outerRadius,
|
|
372
|
+
resolveColor,
|
|
373
|
+
halfsize,
|
|
374
|
+
uid,
|
|
375
|
+
patterns,
|
|
376
|
+
onClick,
|
|
377
|
+
onClickPieRoot,
|
|
378
|
+
...other
|
|
379
|
+
}) {
|
|
345
380
|
var _ref2;
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
React.useEffect(function() {
|
|
381
|
+
const [isMount, setIsMount] = React.useState(false);
|
|
382
|
+
const pieRef = React.useRef(null);
|
|
383
|
+
React.useEffect(() => {
|
|
350
384
|
if (!pieRef.current) return;
|
|
351
385
|
pieRef.current.dataset["currentRadius"] = (active ? d3ArcOut : d3Arc).outerRadius()();
|
|
352
386
|
if (!isMount) {
|
|
@@ -357,12 +391,12 @@ function Pie(_ref15) {
|
|
|
357
391
|
$animationActivePie({
|
|
358
392
|
active,
|
|
359
393
|
data,
|
|
360
|
-
selector:
|
|
394
|
+
selector: `[name="${other.name}"]`,
|
|
361
395
|
element: pieRef.current
|
|
362
396
|
});
|
|
363
397
|
}
|
|
364
398
|
}, [active, Boolean(data)]);
|
|
365
|
-
React.useEffect(
|
|
399
|
+
React.useEffect(() => {
|
|
366
400
|
if (!pieRef.current) return;
|
|
367
401
|
pieRef.current.dataset["currentRadius"] = (active ? d3ArcOut : d3Arc).outerRadius()();
|
|
368
402
|
}, [active, innerRadius, outerRadius, halfsize, Boolean(data)]);
|
|
@@ -373,20 +407,25 @@ function Pie(_ref15) {
|
|
|
373
407
|
"render": "path",
|
|
374
408
|
"ref": pieRef,
|
|
375
409
|
"color": resolveColor(color),
|
|
376
|
-
"pattern": patterns ?
|
|
410
|
+
"pattern": patterns ? `url(#${uid}-pattern)` : void 0,
|
|
377
411
|
"d": active ? d3ArcOut(data) : d3Arc(data),
|
|
378
412
|
"transparent": transparent,
|
|
379
413
|
"use:onClick": callAllEventHandlers(onClickPieRoot, onClick)
|
|
380
414
|
}))), patterns && /* @__PURE__ */ React.createElement(PatternFill, _ref2.cn("PatternFill", {
|
|
381
|
-
"id":
|
|
415
|
+
"id": `${uid}-pattern`,
|
|
382
416
|
"patternKey": color,
|
|
383
417
|
"color": resolveColor(color),
|
|
384
418
|
"patterns": patterns
|
|
385
419
|
})));
|
|
386
420
|
}
|
|
387
|
-
function EmptyData(
|
|
421
|
+
function EmptyData({
|
|
422
|
+
Element: SEmptyData,
|
|
423
|
+
styles,
|
|
424
|
+
d3Arc,
|
|
425
|
+
color,
|
|
426
|
+
resolveColor
|
|
427
|
+
}) {
|
|
388
428
|
var _ref3;
|
|
389
|
-
var SEmptyData = _ref16.Element, styles = _ref16.styles, d3Arc = _ref16.d3Arc, color = _ref16.color, resolveColor = _ref16.resolveColor;
|
|
390
429
|
return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SEmptyData, _ref3.cn("SEmptyData", {
|
|
391
430
|
"render": "path",
|
|
392
431
|
"color": resolveColor(color),
|
|
@@ -396,9 +435,17 @@ function EmptyData(_ref16) {
|
|
|
396
435
|
})
|
|
397
436
|
}));
|
|
398
437
|
}
|
|
399
|
-
function Label(
|
|
438
|
+
function Label({
|
|
439
|
+
Element: SLabel,
|
|
440
|
+
styles,
|
|
441
|
+
Children,
|
|
442
|
+
children,
|
|
443
|
+
label,
|
|
444
|
+
dataHintsHandler,
|
|
445
|
+
x = 0,
|
|
446
|
+
y = 0
|
|
447
|
+
}) {
|
|
400
448
|
var _ref4;
|
|
401
|
-
var SLabel = _ref17.Element, styles = _ref17.styles, Children = _ref17.Children, children = _ref17.children, label = _ref17.label, dataHintsHandler = _ref17.dataHintsHandler, _ref17$x = _ref17.x, x = _ref17$x === void 0 ? 0 : _ref17$x, _ref17$y = _ref17.y, y = _ref17$y === void 0 ? 0 : _ref17$y;
|
|
402
449
|
dataHintsHandler.setTitle("vertical", label || children);
|
|
403
450
|
return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(SLabel, _ref4.cn("SLabel", {
|
|
404
451
|
"render": "text",
|
|
@@ -409,12 +456,14 @@ function Label(_ref17) {
|
|
|
409
456
|
}
|
|
410
457
|
function DonutTooltip(props) {
|
|
411
458
|
var _ref = arguments[0], _ref5;
|
|
412
|
-
|
|
413
|
-
return _ref5 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SDonutTooltip, _ref5.cn("SDonutTooltip",
|
|
414
|
-
|
|
415
|
-
|
|
459
|
+
const SDonutTooltip = Tooltip;
|
|
460
|
+
return _ref5 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SDonutTooltip, _ref5.cn("SDonutTooltip", {
|
|
461
|
+
...assignProps({
|
|
462
|
+
"excludeAnchorProps": true
|
|
463
|
+
}, _ref)
|
|
464
|
+
}));
|
|
416
465
|
}
|
|
417
|
-
|
|
466
|
+
const Donut = createElement(DonutRoot, {
|
|
418
467
|
Pie,
|
|
419
468
|
Label,
|
|
420
469
|
EmptyData,
|