@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/Radar.mjs
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
8
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
9
2
|
import { sstyled, assignProps, Component } from "@semcore/core";
|
|
10
3
|
import canUseDOM from "@semcore/core/lib/utils/canUseDOM";
|
|
11
4
|
import getOriginChildren from "@semcore/core/lib/utils/getOriginChildren";
|
|
@@ -15,60 +8,60 @@ import { polygonContains } from "d3-polygon";
|
|
|
15
8
|
import { arc, line, lineRadial, curveLinearClosed } from "d3-shape";
|
|
16
9
|
import React, { cloneElement } from "react";
|
|
17
10
|
import createElement from "./createElement.mjs";
|
|
18
|
-
import {
|
|
11
|
+
import { getPatternSymbolSize, PatternSymbol, PatternFill } from "./Pattern.mjs";
|
|
19
12
|
import Tooltip from "./Tooltip.mjs";
|
|
20
|
-
import {
|
|
13
|
+
import { eventToPoint, getChartDefaultColorName, measureText } from "./utils.mjs";
|
|
21
14
|
/*!__reshadow-styles__:"./style/radar.shadow.css"*/
|
|
22
|
-
|
|
15
|
+
const style = (
|
|
23
16
|
/*__reshadow_css_start__*/
|
|
24
17
|
(sstyled.insert(
|
|
25
18
|
/*__inner_css_start__*/
|
|
26
|
-
".
|
|
19
|
+
".___SAxisLine_9qq2r_gg_,.___SAxisTick_9qq2r_gg_,.___SAxis_9qq2r_gg_{stroke:var(--intergalactic-chart-grid-line, #e0e1e9);stroke-width:1;fill:transparent}.___SAxisLine_9qq2r_gg_,.___SAxisTick_9qq2r_gg_{stroke-dasharray:2}.___SAxisLine_9qq2r_gg_.__active_9qq2r_gg_{stroke:var(--intergalactic-chart-grid-y-accent-hover-line, #a9abb6)}.___SAxisLabel_9qq2r_gg_{text-anchor:middle;dominant-baseline:central;font-size:12px}.___SAxisLabel_9qq2r_gg_.__xDirection_9qq2r_gg_{text-anchor:var(--xDirection_9qq2r)}.___SAxisLabel_9qq2r_gg_.__yDirection_9qq2r_gg_{dominant-baseline:var(--yDirection_9qq2r)}.___SPolygonDot_9qq2r_gg_,.___SPolygon_9qq2r_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff)}.___SPolygon_9qq2r_gg_{opacity:.2}.___SPolygon_9qq2r_gg_.__color_9qq2r_gg_{fill:var(--color_9qq2r)}.___SPolygon_9qq2r_gg_.__pattern_9qq2r_gg_.__color_9qq2r_gg_{fill:var(--pattern_9qq2r);stroke:var(--color_9qq2r);stroke-width:1px}.___SPolygonDot_9qq2r_gg_{stroke-width:2px;stroke:var(--intergalactic-chart-grid-border, #ffffff);r:6px}.___SPolygonDot_9qq2r_gg_.__transparent_9qq2r_gg_{opacity:.3}.___SPolygonDot_9qq2r_gg_.__color_9qq2r_gg_{fill:var(--color_9qq2r)}.___SPolygonLine_9qq2r_gg_{stroke:var(--intergalactic-chart-palette-order-1, #2bb3ff);stroke-width:3;fill:transparent}.___SPolygonLine_9qq2r_gg_.__transparent_9qq2r_gg_{opacity:.3}.___SPolygonLine_9qq2r_gg_.__color_9qq2r_gg_{stroke:var(--color_9qq2r)}.___SPieRect_9qq2r_gg_{outline:0;fill:var(--intergalactic-chart-grid-bar-chart-hover, rgba(196, 199, 207, 0.3))}",
|
|
27
20
|
/*__inner_css_end__*/
|
|
28
|
-
"
|
|
21
|
+
"9qq2r_gg_"
|
|
29
22
|
), /*__reshadow_css_end__*/
|
|
30
23
|
{
|
|
31
|
-
"__SAxis": "
|
|
32
|
-
"__SAxisLine": "
|
|
33
|
-
"__SAxisTick": "
|
|
34
|
-
"_active": "
|
|
35
|
-
"__SAxisLabel": "
|
|
36
|
-
"_xDirection": "
|
|
37
|
-
"--xDirection": "--
|
|
38
|
-
"_yDirection": "
|
|
39
|
-
"--yDirection": "--
|
|
40
|
-
"__SPolygon": "
|
|
41
|
-
"_color": "
|
|
42
|
-
"--color": "--
|
|
43
|
-
"_pattern": "
|
|
44
|
-
"--pattern": "--
|
|
45
|
-
"__SPolygonDot": "
|
|
46
|
-
"_transparent": "
|
|
47
|
-
"__SPolygonLine": "
|
|
48
|
-
"__SPieRect": "
|
|
24
|
+
"__SAxis": "___SAxis_9qq2r_gg_",
|
|
25
|
+
"__SAxisLine": "___SAxisLine_9qq2r_gg_",
|
|
26
|
+
"__SAxisTick": "___SAxisTick_9qq2r_gg_",
|
|
27
|
+
"_active": "__active_9qq2r_gg_",
|
|
28
|
+
"__SAxisLabel": "___SAxisLabel_9qq2r_gg_",
|
|
29
|
+
"_xDirection": "__xDirection_9qq2r_gg_",
|
|
30
|
+
"--xDirection": "--xDirection_9qq2r",
|
|
31
|
+
"_yDirection": "__yDirection_9qq2r_gg_",
|
|
32
|
+
"--yDirection": "--yDirection_9qq2r",
|
|
33
|
+
"__SPolygon": "___SPolygon_9qq2r_gg_",
|
|
34
|
+
"_color": "__color_9qq2r_gg_",
|
|
35
|
+
"--color": "--color_9qq2r",
|
|
36
|
+
"_pattern": "__pattern_9qq2r_gg_",
|
|
37
|
+
"--pattern": "--pattern_9qq2r",
|
|
38
|
+
"__SPolygonDot": "___SPolygonDot_9qq2r_gg_",
|
|
39
|
+
"_transparent": "__transparent_9qq2r_gg_",
|
|
40
|
+
"__SPolygonLine": "___SPolygonLine_9qq2r_gg_",
|
|
41
|
+
"__SPieRect": "___SPieRect_9qq2r_gg_"
|
|
49
42
|
})
|
|
50
43
|
);
|
|
51
|
-
|
|
44
|
+
const clampAngle = (angle) => {
|
|
52
45
|
angle = angle % (2 * Math.PI);
|
|
53
46
|
if (angle < 0) angle += 2 * Math.PI;
|
|
54
47
|
return angle;
|
|
55
48
|
};
|
|
56
49
|
function getBoxAxesValue(i, range, axes, total, angleOffset) {
|
|
57
|
-
|
|
58
|
-
|
|
50
|
+
const func = axes === "y" ? Math.sin : Math.cos;
|
|
51
|
+
const angle = clampAngle((total - i) * 2 * Math.PI / total + angleOffset);
|
|
59
52
|
return range * (1 - func(angle)) - range;
|
|
60
53
|
}
|
|
61
54
|
function getRadianPosition(i, range, total, angleOffset) {
|
|
62
55
|
return [getBoxAxesValue(i, range, "y", total, angleOffset), getBoxAxesValue(i, range, "x", total, angleOffset)];
|
|
63
56
|
}
|
|
64
|
-
|
|
65
|
-
|
|
57
|
+
const getLabelXPlacement = (i, total, angleOffset) => {
|
|
58
|
+
const angle = clampAngle(i / total * (Math.PI * 2) - angleOffset);
|
|
66
59
|
if (angle >= Math.PI + Math.PI * (8 / 9) || angle <= Math.PI * (1 / 9)) return "middle";
|
|
67
60
|
if (angle >= Math.PI * (8 / 9) && angle <= Math.PI + Math.PI * (1 / 9)) return "middle";
|
|
68
61
|
return angle < Math.PI ? "start" : "end";
|
|
69
62
|
};
|
|
70
|
-
|
|
71
|
-
|
|
63
|
+
const getLabelYPlacement = (i, total, angleOffset) => {
|
|
64
|
+
const angle = clampAngle(i / total * (Math.PI * 2) - angleOffset);
|
|
72
65
|
if (angle >= Math.PI + Math.PI * (8 / 9) || angle <= Math.PI * (1 / 9)) return "alphabetic";
|
|
73
66
|
if (angle >= Math.PI * (8 / 9) && angle <= Math.PI + Math.PI * (1 / 9)) return "mathematical";
|
|
74
67
|
return "middle";
|
|
@@ -76,51 +69,47 @@ var getLabelYPlacement = function getLabelYPlacement2(i, total, angleOffset) {
|
|
|
76
69
|
function getLabelPlacement(i, total, angleOffset) {
|
|
77
70
|
return [getLabelXPlacement(i, total, angleOffset), getLabelYPlacement(i, total, angleOffset)];
|
|
78
71
|
}
|
|
79
|
-
function computeTextWidth(texts, textSize) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
var widths = texts.map(function(text) {
|
|
72
|
+
function computeTextWidth(texts, textSize, defaultWidth = 50, defaultHeight = 20) {
|
|
73
|
+
const widths = texts.map((text) => {
|
|
74
|
+
var _a, _b;
|
|
83
75
|
if (typeof text === "string") {
|
|
84
76
|
return measureText(text, textSize);
|
|
85
77
|
}
|
|
86
78
|
if (/* @__PURE__ */ React.isValidElement(text)) {
|
|
87
|
-
|
|
88
|
-
return Math.max(((_text$props = text.props) === null || _text$props === void 0 ? void 0 : _text$props.width) || defaultWidth, ((_text$props2 = text.props) === null || _text$props2 === void 0 ? void 0 : _text$props2.height) || defaultHeight);
|
|
79
|
+
return Math.max(((_a = text.props) == null ? void 0 : _a.width) || defaultWidth, ((_b = text.props) == null ? void 0 : _b.height) || defaultHeight);
|
|
89
80
|
}
|
|
90
81
|
return defaultWidth;
|
|
91
82
|
});
|
|
92
|
-
return Math.max
|
|
83
|
+
return Math.max(...widths);
|
|
93
84
|
}
|
|
94
85
|
function getTicks(tickSize, radius) {
|
|
95
|
-
|
|
86
|
+
let ticks = 0;
|
|
96
87
|
while (Math.trunc(radius / (tickSize / 2)) > ticks) {
|
|
97
88
|
ticks += 1;
|
|
98
89
|
}
|
|
99
|
-
return
|
|
90
|
+
return [...Array(ticks).keys()].reduce((ticks2, _t, i, total) => {
|
|
100
91
|
if (i) ticks2.push(i / total.length);
|
|
101
92
|
return ticks2;
|
|
102
93
|
}, []);
|
|
103
94
|
}
|
|
104
|
-
function pieContains(
|
|
105
|
-
|
|
106
|
-
var _ref14 = _slicedToArray(_ref12, 2), x = _ref14[0], y = _ref14[1];
|
|
107
|
-
var distance = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
|
|
95
|
+
function pieContains([startAngle, endAngle, radius], [x, y]) {
|
|
96
|
+
const distance = Math.sqrt(x ** 2 + y ** 2);
|
|
108
97
|
if (distance > radius) return false;
|
|
109
98
|
startAngle = clampAngle(startAngle);
|
|
110
99
|
endAngle = clampAngle(endAngle);
|
|
111
100
|
startAngle = startAngle < endAngle ? startAngle : startAngle - 2 * Math.PI;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
101
|
+
const angle = clampAngle(Math.atan2(y, x) + Math.PI / 2);
|
|
102
|
+
const prevAngle = angle - Math.PI * 2;
|
|
103
|
+
const nextAngle = angle + Math.PI * 2;
|
|
115
104
|
if (angle > startAngle && angle < endAngle) return true;
|
|
116
105
|
if (prevAngle > startAngle && prevAngle < endAngle) return true;
|
|
117
106
|
if (nextAngle > startAngle && nextAngle < endAngle) return true;
|
|
118
107
|
return false;
|
|
119
108
|
}
|
|
120
109
|
function getLabelOffsetPosition(xDirection, yDirection, width, height) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
switch (
|
|
110
|
+
let xOffset = 0;
|
|
111
|
+
let yOffset = 0;
|
|
112
|
+
switch (`${xDirection}-${yDirection}`) {
|
|
124
113
|
case "middle-alphabetic":
|
|
125
114
|
yOffset = height / 2;
|
|
126
115
|
break;
|
|
@@ -136,165 +125,165 @@ function getLabelOffsetPosition(xDirection, yDirection, width, height) {
|
|
|
136
125
|
}
|
|
137
126
|
return [xOffset + width / 2, yOffset + height / 2];
|
|
138
127
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
args[_key] = arguments[_key];
|
|
146
|
-
}
|
|
147
|
-
_this = _callSuper(this, RadarRoot2, [].concat(args));
|
|
148
|
-
_defineProperty(_this, "computeOffset", 0);
|
|
149
|
-
_defineProperty(_this, "categoriesKey", null);
|
|
150
|
-
return _this;
|
|
128
|
+
const MINIMUM_OFFSET = 5;
|
|
129
|
+
class RadarRoot extends Component {
|
|
130
|
+
constructor(...args) {
|
|
131
|
+
super(...args);
|
|
132
|
+
_defineProperty(this, "computeOffset", 0);
|
|
133
|
+
_defineProperty(this, "categoriesKey", null);
|
|
151
134
|
}
|
|
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
|
-
|
|
181
|
-
}, {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
135
|
+
get id() {
|
|
136
|
+
const {
|
|
137
|
+
id,
|
|
138
|
+
uid
|
|
139
|
+
} = this.asProps;
|
|
140
|
+
return id || uid;
|
|
141
|
+
}
|
|
142
|
+
get offset() {
|
|
143
|
+
const {
|
|
144
|
+
offset
|
|
145
|
+
} = this.asProps;
|
|
146
|
+
return offset ?? this.computeOffset;
|
|
147
|
+
}
|
|
148
|
+
get textSize() {
|
|
149
|
+
const {
|
|
150
|
+
textSize
|
|
151
|
+
} = this.asProps;
|
|
152
|
+
return textSize ?? 12;
|
|
153
|
+
}
|
|
154
|
+
getAxisProps() {
|
|
155
|
+
return {
|
|
156
|
+
offset: this.offset,
|
|
157
|
+
textSize: this.textSize,
|
|
158
|
+
type: this.asProps.type,
|
|
159
|
+
angleOffset: this.asProps.angleOffset
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
getPolygonProps({
|
|
163
|
+
dataKey
|
|
164
|
+
}, index) {
|
|
165
|
+
const {
|
|
166
|
+
data,
|
|
167
|
+
scale,
|
|
168
|
+
angleOffset,
|
|
169
|
+
uid,
|
|
170
|
+
patterns
|
|
171
|
+
} = this.asProps;
|
|
172
|
+
return {
|
|
173
|
+
offset: this.offset,
|
|
174
|
+
data: data[dataKey] || [],
|
|
175
|
+
scale,
|
|
176
|
+
angleOffset,
|
|
177
|
+
color: getChartDefaultColorName(index),
|
|
178
|
+
uid: `${uid}-${index}`,
|
|
179
|
+
patterns
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
getHoverProps() {
|
|
183
|
+
return {
|
|
184
|
+
type: this.asProps.type,
|
|
185
|
+
offset: this.offset,
|
|
186
|
+
categories: this.asProps.data[this.categoriesKey],
|
|
187
|
+
angleOffset: this.asProps.angleOffset,
|
|
188
|
+
getIndex: this.getIndex.bind(this),
|
|
189
|
+
getPolygon: this.getPolygon.bind(this),
|
|
190
|
+
getPie: this.getPie.bind(this)
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
getIndex(point) {
|
|
194
|
+
const {
|
|
195
|
+
data,
|
|
196
|
+
type
|
|
197
|
+
} = this.asProps;
|
|
198
|
+
const categories = data[this.categoriesKey];
|
|
199
|
+
let index;
|
|
200
|
+
if (type === "circle") {
|
|
201
|
+
index = categories.findIndex((_c, i) => pieContains(this.getPie(i), point));
|
|
202
|
+
} else {
|
|
203
|
+
index = categories.findIndex((_c, i) => polygonContains(this.getPolygon(i), point));
|
|
204
|
+
}
|
|
205
|
+
return index === -1 ? null : index;
|
|
206
|
+
}
|
|
207
|
+
getPolygon(index) {
|
|
208
|
+
const {
|
|
209
|
+
data,
|
|
210
|
+
size,
|
|
211
|
+
angleOffset
|
|
212
|
+
} = this.asProps;
|
|
213
|
+
const offset = this.offset;
|
|
214
|
+
const categories = data[this.categoriesKey];
|
|
215
|
+
const total = categories.length;
|
|
216
|
+
const diam = Math.min(size[0], size[1]);
|
|
217
|
+
const radius = diam / 2 - offset;
|
|
218
|
+
const prevIndex = (index - 1 + total) % total;
|
|
219
|
+
const nextIndex = (index + 1 + total) % total;
|
|
220
|
+
const [prevX1, prevY1] = getRadianPosition(prevIndex, radius, total, angleOffset);
|
|
221
|
+
const [x, y] = getRadianPosition(index, radius, total, angleOffset);
|
|
222
|
+
const [nextX1, nextY1] = getRadianPosition(nextIndex, radius, total, angleOffset);
|
|
223
|
+
return [[0, 0], [(prevX1 + x) / 2, (prevY1 + y) / 2], [x, y], [(nextX1 + x) / 2, (nextY1 + y) / 2]];
|
|
224
|
+
}
|
|
225
|
+
getPie(index) {
|
|
226
|
+
const {
|
|
227
|
+
data,
|
|
228
|
+
size,
|
|
229
|
+
angleOffset
|
|
230
|
+
} = this.asProps;
|
|
231
|
+
const categories = data[this.categoriesKey];
|
|
232
|
+
const offset = this.offset;
|
|
233
|
+
const angle = Math.PI * 2 / categories.length;
|
|
234
|
+
const radius = Math.min(size[0], size[1]) / 2 - offset;
|
|
235
|
+
return [index * angle - angle / 2 - angleOffset, (index + 1) * angle - angle / 2 - angleOffset, radius];
|
|
236
|
+
}
|
|
237
|
+
handlerOnClick(e) {
|
|
238
|
+
e.stopPropagation();
|
|
239
|
+
const {
|
|
240
|
+
rootRef,
|
|
241
|
+
size,
|
|
242
|
+
onClick
|
|
243
|
+
} = this.asProps;
|
|
244
|
+
if (!onClick) return;
|
|
245
|
+
const [pointX, pointY] = eventToPoint(e, rootRef.current);
|
|
246
|
+
const r = Math.min(size[0], size[1]) / 2;
|
|
247
|
+
const centerX = pointX - r;
|
|
248
|
+
const centerY = pointY - r;
|
|
249
|
+
const index = this.getIndex([centerX, centerY]);
|
|
250
|
+
if (index === null) return;
|
|
251
|
+
onClick(index, e);
|
|
252
|
+
}
|
|
253
|
+
render() {
|
|
254
|
+
var _ref2;
|
|
255
|
+
const SRadar = this.Element;
|
|
256
|
+
const {
|
|
257
|
+
Children,
|
|
258
|
+
styles,
|
|
259
|
+
size,
|
|
260
|
+
data,
|
|
261
|
+
offset
|
|
262
|
+
} = this.asProps;
|
|
263
|
+
const [width, height] = size;
|
|
264
|
+
this.asProps.dataHintsHandler.establishDataType("indexed-groups");
|
|
265
|
+
let dataKey;
|
|
266
|
+
React.Children.toArray(getOriginChildren(Children)).forEach((child) => {
|
|
267
|
+
if (/* @__PURE__ */ React.isValidElement(child) && child.type === Radar.Axis) {
|
|
268
|
+
dataKey = child.props.dataKey;
|
|
224
269
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
value: function getPolygon(index) {
|
|
230
|
-
var _this$asProps4 = this.asProps, data = _this$asProps4.data, size = _this$asProps4.size, angleOffset = _this$asProps4.angleOffset;
|
|
231
|
-
var offset = this.offset;
|
|
232
|
-
var categories = data[this.categoriesKey];
|
|
233
|
-
var total = categories.length;
|
|
234
|
-
var diam = Math.min(size[0], size[1]);
|
|
235
|
-
var radius = diam / 2 - offset;
|
|
236
|
-
var prevIndex = (index - 1 + total) % total;
|
|
237
|
-
var nextIndex = (index + 1 + total) % total;
|
|
238
|
-
var _getRadianPosition = getRadianPosition(prevIndex, radius, total, angleOffset), _getRadianPosition2 = _slicedToArray(_getRadianPosition, 2), prevX1 = _getRadianPosition2[0], prevY1 = _getRadianPosition2[1];
|
|
239
|
-
var _getRadianPosition3 = getRadianPosition(index, radius, total, angleOffset), _getRadianPosition4 = _slicedToArray(_getRadianPosition3, 2), x = _getRadianPosition4[0], y = _getRadianPosition4[1];
|
|
240
|
-
var _getRadianPosition5 = getRadianPosition(nextIndex, radius, total, angleOffset), _getRadianPosition6 = _slicedToArray(_getRadianPosition5, 2), nextX1 = _getRadianPosition6[0], nextY1 = _getRadianPosition6[1];
|
|
241
|
-
return [[0, 0], [(prevX1 + x) / 2, (prevY1 + y) / 2], [x, y], [(nextX1 + x) / 2, (nextY1 + y) / 2]];
|
|
242
|
-
}
|
|
243
|
-
}, {
|
|
244
|
-
key: "getPie",
|
|
245
|
-
value: function getPie(index) {
|
|
246
|
-
var _this$asProps5 = this.asProps, data = _this$asProps5.data, size = _this$asProps5.size, angleOffset = _this$asProps5.angleOffset;
|
|
247
|
-
var categories = data[this.categoriesKey];
|
|
248
|
-
var offset = this.offset;
|
|
249
|
-
var angle = Math.PI * 2 / categories.length;
|
|
250
|
-
var radius = Math.min(size[0], size[1]) / 2 - offset;
|
|
251
|
-
return [index * angle - angle / 2 - angleOffset, (index + 1) * angle - angle / 2 - angleOffset, radius];
|
|
252
|
-
}
|
|
253
|
-
}, {
|
|
254
|
-
key: "handlerOnClick",
|
|
255
|
-
value: function handlerOnClick(e) {
|
|
256
|
-
e.stopPropagation();
|
|
257
|
-
var _this$asProps6 = this.asProps, rootRef = _this$asProps6.rootRef, size = _this$asProps6.size, onClick = _this$asProps6.onClick;
|
|
258
|
-
if (!onClick) return;
|
|
259
|
-
var _eventToPoint = eventToPoint(e, rootRef.current), _eventToPoint2 = _slicedToArray(_eventToPoint, 2), pointX = _eventToPoint2[0], pointY = _eventToPoint2[1];
|
|
260
|
-
var r = Math.min(size[0], size[1]) / 2;
|
|
261
|
-
var centerX = pointX - r;
|
|
262
|
-
var centerY = pointY - r;
|
|
263
|
-
var index = this.getIndex([centerX, centerY]);
|
|
264
|
-
if (index === null) return;
|
|
265
|
-
onClick(index, e);
|
|
266
|
-
}
|
|
267
|
-
}, {
|
|
268
|
-
key: "render",
|
|
269
|
-
value: function render() {
|
|
270
|
-
var _ref2;
|
|
271
|
-
var SRadar = this.Element;
|
|
272
|
-
var _this$asProps7 = this.asProps, Children = _this$asProps7.Children, styles = _this$asProps7.styles, size = _this$asProps7.size, data = _this$asProps7.data, offset = _this$asProps7.offset;
|
|
273
|
-
var _size = _slicedToArray(size, 2), width = _size[0], height = _size[1];
|
|
274
|
-
this.asProps.dataHintsHandler.establishDataType("indexed-groups");
|
|
275
|
-
var dataKey;
|
|
276
|
-
React.Children.toArray(getOriginChildren(Children)).forEach(function(child) {
|
|
277
|
-
if (/* @__PURE__ */ React.isValidElement(child) && child.type === Radar.Axis) {
|
|
278
|
-
dataKey = child.props.dataKey;
|
|
279
|
-
}
|
|
280
|
-
});
|
|
281
|
-
if (dataKey) {
|
|
282
|
-
if (offset === void 0) {
|
|
283
|
-
this.computeOffset = computeTextWidth(data[dataKey], this.textSize) + MINIMUM_OFFSET;
|
|
284
|
-
}
|
|
285
|
-
this.categoriesKey = dataKey;
|
|
270
|
+
});
|
|
271
|
+
if (dataKey) {
|
|
272
|
+
if (offset === void 0) {
|
|
273
|
+
this.computeOffset = computeTextWidth(data[dataKey], this.textSize) + MINIMUM_OFFSET;
|
|
286
274
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
})
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
}
|
|
275
|
+
this.categoriesKey = dataKey;
|
|
276
|
+
}
|
|
277
|
+
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(SRadar, _ref2.cn("SRadar", {
|
|
278
|
+
"aria-hidden": true,
|
|
279
|
+
"id": this.id,
|
|
280
|
+
"render": "g",
|
|
281
|
+
"childrenPosition": "inside",
|
|
282
|
+
"transform": `translate(${width / 2},${height / 2})`,
|
|
283
|
+
"onClickCapture": this.handlerOnClick.bind(this)
|
|
284
|
+
}));
|
|
285
|
+
}
|
|
286
|
+
}
|
|
298
287
|
_defineProperty(RadarRoot, "displayName", "Line");
|
|
299
288
|
_defineProperty(RadarRoot, "style", style);
|
|
300
289
|
_defineProperty(RadarRoot, "enhance", [uniqueIDEnhancement()]);
|
|
@@ -302,75 +291,102 @@ _defineProperty(RadarRoot, "defaultProps", {
|
|
|
302
291
|
type: "polygon",
|
|
303
292
|
angleOffset: 0
|
|
304
293
|
});
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
294
|
+
class PolygonRoot extends Component {
|
|
295
|
+
getDotsProps() {
|
|
296
|
+
const {
|
|
297
|
+
data,
|
|
298
|
+
scale,
|
|
299
|
+
color,
|
|
300
|
+
resolveColor,
|
|
301
|
+
transparent,
|
|
302
|
+
dataKey,
|
|
303
|
+
dataHintsHandler,
|
|
304
|
+
angleOffset,
|
|
305
|
+
patterns
|
|
306
|
+
} = this.asProps;
|
|
307
|
+
return {
|
|
308
|
+
data,
|
|
309
|
+
scale,
|
|
310
|
+
color,
|
|
311
|
+
resolveColor,
|
|
312
|
+
transparent,
|
|
313
|
+
categoryKey: dataKey,
|
|
314
|
+
dataHintsHandler,
|
|
315
|
+
angleOffset,
|
|
316
|
+
patterns
|
|
317
|
+
};
|
|
309
318
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
"color": resolveColor(fill || color),
|
|
353
|
-
"patterns": patterns
|
|
354
|
-
})));
|
|
355
|
-
}
|
|
356
|
-
}]);
|
|
357
|
-
})(Component);
|
|
319
|
+
getLineProps() {
|
|
320
|
+
const {
|
|
321
|
+
d3,
|
|
322
|
+
data,
|
|
323
|
+
color,
|
|
324
|
+
resolveColor,
|
|
325
|
+
transparent
|
|
326
|
+
} = this.asProps;
|
|
327
|
+
return {
|
|
328
|
+
data,
|
|
329
|
+
color,
|
|
330
|
+
resolveColor,
|
|
331
|
+
transparent,
|
|
332
|
+
d3
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
render() {
|
|
336
|
+
var _ref3;
|
|
337
|
+
const {
|
|
338
|
+
Element: SPolygon,
|
|
339
|
+
styles,
|
|
340
|
+
d3,
|
|
341
|
+
data,
|
|
342
|
+
color,
|
|
343
|
+
resolveColor,
|
|
344
|
+
fill,
|
|
345
|
+
uid,
|
|
346
|
+
patterns
|
|
347
|
+
} = this.asProps;
|
|
348
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, (_ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SPolygon, _ref3.cn("SPolygon", {
|
|
349
|
+
"render": "path",
|
|
350
|
+
"d": d3(data),
|
|
351
|
+
"color": resolveColor(fill || color),
|
|
352
|
+
"pattern": patterns ? `url(#${uid}-pattern)` : void 0
|
|
353
|
+
}))), patterns && /* @__PURE__ */ React.createElement(PatternFill, _ref3.cn("PatternFill", {
|
|
354
|
+
"id": `${uid}-pattern`,
|
|
355
|
+
"patternKey": color,
|
|
356
|
+
"color": resolveColor(fill || color),
|
|
357
|
+
"patterns": patterns
|
|
358
|
+
})));
|
|
359
|
+
}
|
|
360
|
+
}
|
|
358
361
|
_defineProperty(PolygonRoot, "displayName", "Polygon");
|
|
359
362
|
_defineProperty(PolygonRoot, "style", style);
|
|
360
|
-
_defineProperty(PolygonRoot, "defaultProps",
|
|
361
|
-
|
|
363
|
+
_defineProperty(PolygonRoot, "defaultProps", ({
|
|
364
|
+
scale,
|
|
365
|
+
curve = curveLinearClosed,
|
|
366
|
+
size,
|
|
367
|
+
offset,
|
|
368
|
+
angleOffset
|
|
369
|
+
}) => {
|
|
362
370
|
scale.range([0, Math.min(size[0], size[1]) / 2 - offset]);
|
|
363
371
|
return {
|
|
364
|
-
d3: lineRadial().curve(curve).radius(
|
|
372
|
+
d3: lineRadial().curve(curve).radius((d) => {
|
|
365
373
|
return scale(d || 0);
|
|
366
|
-
}).angle(
|
|
374
|
+
}).angle((_d, i, data) => {
|
|
367
375
|
return i / data.length * 2 * Math.PI - angleOffset;
|
|
368
376
|
})
|
|
369
377
|
};
|
|
370
378
|
});
|
|
371
379
|
function PolygonLine(props) {
|
|
372
380
|
var _ref4;
|
|
373
|
-
|
|
381
|
+
const {
|
|
382
|
+
Element: SPolygonLine,
|
|
383
|
+
styles,
|
|
384
|
+
d3,
|
|
385
|
+
color,
|
|
386
|
+
resolveColor,
|
|
387
|
+
data,
|
|
388
|
+
transparent
|
|
389
|
+
} = props;
|
|
374
390
|
return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(SPolygonLine, _ref4.cn("SPolygonLine", {
|
|
375
391
|
"render": "path",
|
|
376
392
|
"d": d3(data),
|
|
@@ -379,13 +395,24 @@ function PolygonLine(props) {
|
|
|
379
395
|
}));
|
|
380
396
|
}
|
|
381
397
|
function PolygonDots(props) {
|
|
382
|
-
|
|
383
|
-
|
|
398
|
+
const {
|
|
399
|
+
Element: SPolygonDot,
|
|
400
|
+
styles,
|
|
401
|
+
color,
|
|
402
|
+
resolveColor,
|
|
403
|
+
data,
|
|
404
|
+
scale,
|
|
405
|
+
transparent,
|
|
406
|
+
categoryKey,
|
|
407
|
+
angleOffset,
|
|
408
|
+
patterns
|
|
409
|
+
} = props;
|
|
410
|
+
return data.map((value, i) => {
|
|
384
411
|
var _ref6;
|
|
385
412
|
if (value === null || value === void 0) return;
|
|
386
|
-
|
|
387
|
-
props.dataHintsHandler.describeGroupedValues(categoryKey,
|
|
388
|
-
|
|
413
|
+
const radius = scale(value);
|
|
414
|
+
props.dataHintsHandler.describeGroupedValues(categoryKey, `${categoryKey}.${i}`);
|
|
415
|
+
const [cx, cy] = getRadianPosition(i, radius, data.length, angleOffset);
|
|
389
416
|
if (!patterns) {
|
|
390
417
|
var _ref5;
|
|
391
418
|
return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SPolygonDot, _ref5.cn("SPolygonDot", {
|
|
@@ -393,146 +420,163 @@ function PolygonDots(props) {
|
|
|
393
420
|
"color": resolveColor(color),
|
|
394
421
|
"transparent": transparent,
|
|
395
422
|
"patternKey": color,
|
|
396
|
-
"key":
|
|
423
|
+
"key": `${i}`,
|
|
397
424
|
"cx": cx,
|
|
398
425
|
"cy": cy
|
|
399
426
|
}));
|
|
400
427
|
}
|
|
401
|
-
|
|
402
|
-
|
|
428
|
+
const patternKey = color || getChartDefaultColorName(0);
|
|
429
|
+
const [width, height] = getPatternSymbolSize({
|
|
403
430
|
patternKey,
|
|
404
431
|
patterns
|
|
405
|
-
})
|
|
432
|
+
});
|
|
406
433
|
return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(SPolygonDot, _ref6.cn("SPolygonDot", {
|
|
407
434
|
"render": PatternSymbol,
|
|
408
435
|
"color": resolveColor(color),
|
|
409
436
|
"transparent": transparent,
|
|
410
437
|
"patternKey": color,
|
|
411
|
-
"key":
|
|
438
|
+
"key": `${i}`,
|
|
412
439
|
"x": cx - width / 2,
|
|
413
440
|
"y": cy - height / 2
|
|
414
441
|
}));
|
|
415
442
|
});
|
|
416
443
|
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
args[_key2] = arguments[_key2];
|
|
423
|
-
}
|
|
424
|
-
_this3 = _callSuper(this, AxisRoot2, [].concat(args));
|
|
425
|
-
_defineProperty(_this3, "unsubscribeTooltipVisible", null);
|
|
426
|
-
_defineProperty(_this3, "state", {
|
|
444
|
+
class AxisRoot extends Component {
|
|
445
|
+
constructor(...args) {
|
|
446
|
+
super(...args);
|
|
447
|
+
_defineProperty(this, "unsubscribeTooltipVisible", null);
|
|
448
|
+
_defineProperty(this, "state", {
|
|
427
449
|
activeLineIndex: null
|
|
428
450
|
});
|
|
429
|
-
_defineProperty(
|
|
430
|
-
|
|
431
|
-
|
|
451
|
+
_defineProperty(this, "handleTooltipRenderingProps", (_anchorProps, {
|
|
452
|
+
index
|
|
453
|
+
}) => {
|
|
454
|
+
this.setState({
|
|
432
455
|
activeLineIndex: index
|
|
433
456
|
});
|
|
434
457
|
});
|
|
435
|
-
return _this3;
|
|
436
458
|
}
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
return
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
459
|
+
createLineRadial(radius, total) {
|
|
460
|
+
return lineRadial().curve(curveLinearClosed).radius(() => {
|
|
461
|
+
return radius;
|
|
462
|
+
}).angle((_d, i) => {
|
|
463
|
+
return i / total * 2 * Math.PI;
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
getTicksProps({
|
|
467
|
+
tickSize = 100
|
|
468
|
+
}) {
|
|
469
|
+
const {
|
|
470
|
+
data,
|
|
471
|
+
offset,
|
|
472
|
+
categories,
|
|
473
|
+
size,
|
|
474
|
+
type
|
|
475
|
+
} = this.asProps;
|
|
476
|
+
const radius = Math.min(size[0], size[1]) / 2 - offset;
|
|
477
|
+
return {
|
|
478
|
+
type,
|
|
479
|
+
data,
|
|
480
|
+
categories,
|
|
481
|
+
ticks: getTicks(tickSize, radius),
|
|
482
|
+
offset,
|
|
483
|
+
d3: this.createLineRadial(radius, categories.length)
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
getLabelsProps({
|
|
487
|
+
labelOffset = 10
|
|
488
|
+
}) {
|
|
489
|
+
const {
|
|
490
|
+
offset,
|
|
491
|
+
categories,
|
|
492
|
+
textSize,
|
|
493
|
+
angleOffset
|
|
494
|
+
} = this.asProps;
|
|
495
|
+
return {
|
|
496
|
+
categories,
|
|
497
|
+
textSize,
|
|
498
|
+
offset: offset - labelOffset,
|
|
499
|
+
angleOffset
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
componentDidMount() {
|
|
503
|
+
const {
|
|
504
|
+
eventEmitter
|
|
505
|
+
} = this.asProps;
|
|
506
|
+
this.unsubscribeTooltipVisible = eventEmitter.subscribe("setTooltipRenderingProps", this.handleTooltipRenderingProps);
|
|
507
|
+
}
|
|
508
|
+
componentWillUnmount() {
|
|
509
|
+
var _a;
|
|
510
|
+
(_a = this.unsubscribeTooltipVisible) == null ? void 0 : _a.call(this);
|
|
511
|
+
}
|
|
512
|
+
render() {
|
|
513
|
+
var _ref7;
|
|
514
|
+
const {
|
|
515
|
+
Element: SAxis,
|
|
516
|
+
styles,
|
|
517
|
+
categories,
|
|
518
|
+
size,
|
|
519
|
+
offset,
|
|
520
|
+
type,
|
|
521
|
+
angleOffset
|
|
522
|
+
} = this.asProps;
|
|
523
|
+
const {
|
|
524
|
+
activeLineIndex
|
|
525
|
+
} = this.state;
|
|
526
|
+
const radius = Math.min(size[0], size[1]) / 2 - offset;
|
|
527
|
+
const total = categories.length;
|
|
528
|
+
return _ref7 = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, type === "circle" ? /* @__PURE__ */ React.createElement(SAxis, _ref7.cn("SAxis", {
|
|
529
|
+
"render": "circle",
|
|
530
|
+
"cx": 0,
|
|
531
|
+
"cy": 0,
|
|
532
|
+
"r": radius
|
|
533
|
+
})) : /* @__PURE__ */ React.createElement(SAxis, _ref7.cn("SAxis", {
|
|
534
|
+
"render": "path",
|
|
535
|
+
"d": this.createLineRadial(radius, total)(categories)
|
|
536
|
+
})), categories.map((_category, i) => {
|
|
537
|
+
const [x, y] = getRadianPosition(i, radius, total, angleOffset);
|
|
538
|
+
const {
|
|
539
|
+
className
|
|
540
|
+
} = sstyled(styles).cn("SAxisLine", {
|
|
541
|
+
active: activeLineIndex === i
|
|
445
542
|
});
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
ticks: getTicks(tickSize, radius),
|
|
458
|
-
offset,
|
|
459
|
-
d3: this.createLineRadial(radius, categories.length)
|
|
460
|
-
};
|
|
461
|
-
}
|
|
462
|
-
}, {
|
|
463
|
-
key: "getLabelsProps",
|
|
464
|
-
value: function getLabelsProps(_ref18) {
|
|
465
|
-
var _ref18$labelOffset = _ref18.labelOffset, labelOffset = _ref18$labelOffset === void 0 ? 10 : _ref18$labelOffset;
|
|
466
|
-
var _this$asProps10 = this.asProps, offset = _this$asProps10.offset, categories = _this$asProps10.categories, textSize = _this$asProps10.textSize, angleOffset = _this$asProps10.angleOffset;
|
|
467
|
-
return {
|
|
468
|
-
categories,
|
|
469
|
-
textSize,
|
|
470
|
-
offset: offset - labelOffset,
|
|
471
|
-
angleOffset
|
|
472
|
-
};
|
|
473
|
-
}
|
|
474
|
-
}, {
|
|
475
|
-
key: "componentDidMount",
|
|
476
|
-
value: function componentDidMount() {
|
|
477
|
-
var eventEmitter = this.asProps.eventEmitter;
|
|
478
|
-
this.unsubscribeTooltipVisible = eventEmitter.subscribe("setTooltipRenderingProps", this.handleTooltipRenderingProps);
|
|
479
|
-
}
|
|
480
|
-
}, {
|
|
481
|
-
key: "componentWillUnmount",
|
|
482
|
-
value: function componentWillUnmount() {
|
|
483
|
-
var _this$unsubscribeTool;
|
|
484
|
-
(_this$unsubscribeTool = this.unsubscribeTooltipVisible) === null || _this$unsubscribeTool === void 0 || _this$unsubscribeTool.call(this);
|
|
485
|
-
}
|
|
486
|
-
}, {
|
|
487
|
-
key: "render",
|
|
488
|
-
value: function render() {
|
|
489
|
-
var _ref7;
|
|
490
|
-
var _this$asProps11 = this.asProps, SAxis = _this$asProps11.Element, styles = _this$asProps11.styles, categories = _this$asProps11.categories, size = _this$asProps11.size, offset = _this$asProps11.offset, type = _this$asProps11.type, angleOffset = _this$asProps11.angleOffset;
|
|
491
|
-
var activeLineIndex = this.state.activeLineIndex;
|
|
492
|
-
var radius = Math.min(size[0], size[1]) / 2 - offset;
|
|
493
|
-
var total = categories.length;
|
|
494
|
-
return _ref7 = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, type === "circle" ? /* @__PURE__ */ React.createElement(SAxis, _ref7.cn("SAxis", {
|
|
495
|
-
"render": "circle",
|
|
496
|
-
"cx": 0,
|
|
497
|
-
"cy": 0,
|
|
498
|
-
"r": radius
|
|
499
|
-
})) : /* @__PURE__ */ React.createElement(SAxis, _ref7.cn("SAxis", {
|
|
500
|
-
"render": "path",
|
|
501
|
-
"d": this.createLineRadial(radius, total)(categories)
|
|
502
|
-
})), categories.map(function(_category, i) {
|
|
503
|
-
var _getRadianPosition9 = getRadianPosition(i, radius, total, angleOffset), _getRadianPosition0 = _slicedToArray(_getRadianPosition9, 2), x = _getRadianPosition0[0], y = _getRadianPosition0[1];
|
|
504
|
-
var _sstyled$cn = sstyled(styles).cn("SAxisLine", {
|
|
505
|
-
active: activeLineIndex === i
|
|
506
|
-
}), className = _sstyled$cn.className;
|
|
507
|
-
return /* @__PURE__ */ React.createElement("line", {
|
|
508
|
-
key: i,
|
|
509
|
-
x1: 0,
|
|
510
|
-
y1: 0,
|
|
511
|
-
x2: x,
|
|
512
|
-
y2: y,
|
|
513
|
-
className
|
|
514
|
-
});
|
|
515
|
-
}));
|
|
516
|
-
}
|
|
517
|
-
}]);
|
|
518
|
-
})(Component);
|
|
543
|
+
return /* @__PURE__ */ React.createElement("line", {
|
|
544
|
+
key: i,
|
|
545
|
+
x1: 0,
|
|
546
|
+
y1: 0,
|
|
547
|
+
x2: x,
|
|
548
|
+
y2: y,
|
|
549
|
+
className
|
|
550
|
+
});
|
|
551
|
+
}));
|
|
552
|
+
}
|
|
553
|
+
}
|
|
519
554
|
_defineProperty(AxisRoot, "displayName", "Polygon");
|
|
520
555
|
_defineProperty(AxisRoot, "style", style);
|
|
521
|
-
_defineProperty(AxisRoot, "defaultProps",
|
|
522
|
-
|
|
523
|
-
|
|
556
|
+
_defineProperty(AxisRoot, "defaultProps", ({
|
|
557
|
+
data,
|
|
558
|
+
dataKey
|
|
559
|
+
}) => {
|
|
560
|
+
const categories = data[dataKey];
|
|
524
561
|
return {
|
|
525
562
|
categories
|
|
526
563
|
};
|
|
527
564
|
});
|
|
528
565
|
function AxisTicks(props) {
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
566
|
+
const {
|
|
567
|
+
Element: SAxisTick,
|
|
568
|
+
styles,
|
|
569
|
+
size,
|
|
570
|
+
ticks,
|
|
571
|
+
d3,
|
|
572
|
+
categories,
|
|
573
|
+
offset,
|
|
574
|
+
type
|
|
575
|
+
} = props;
|
|
576
|
+
const radius = Math.min(size[0], size[1]) / 2 - offset;
|
|
577
|
+
return ticks.map((tick, i) => {
|
|
532
578
|
var _ref8;
|
|
533
|
-
d3.radius(
|
|
534
|
-
return radius * tick;
|
|
535
|
-
});
|
|
579
|
+
d3.radius(() => radius * tick);
|
|
536
580
|
return _ref8 = sstyled(styles), type === "circle" ? /* @__PURE__ */ React.createElement(SAxisTick, _ref8.cn("SAxisTick", {
|
|
537
581
|
"key": i,
|
|
538
582
|
"render": "circle",
|
|
@@ -547,15 +591,23 @@ function AxisTicks(props) {
|
|
|
547
591
|
});
|
|
548
592
|
}
|
|
549
593
|
function AxisLabels(props) {
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
594
|
+
const {
|
|
595
|
+
Element: SAxisLabel,
|
|
596
|
+
styles,
|
|
597
|
+
textSize,
|
|
598
|
+
size,
|
|
599
|
+
offset,
|
|
600
|
+
categories,
|
|
601
|
+
angleOffset
|
|
602
|
+
} = props;
|
|
603
|
+
const radius = Math.min(size[0], size[1]) / 2 - offset;
|
|
604
|
+
return categories.map((category, i) => {
|
|
605
|
+
const [x, y] = getRadianPosition(i, radius, categories.length, angleOffset);
|
|
606
|
+
const [xDirection, yDirection] = getLabelPlacement(i, categories.length, angleOffset);
|
|
555
607
|
if (typeof category === "string") {
|
|
556
608
|
var _ref9;
|
|
557
609
|
props.dataHintsHandler.labelKey("value", i, category);
|
|
558
|
-
|
|
610
|
+
const lines = category.split("\n");
|
|
559
611
|
return _ref9 = sstyled(styles), /* @__PURE__ */ React.createElement(SAxisLabel, _ref9.cn("SAxisLabel", {
|
|
560
612
|
"key": i,
|
|
561
613
|
"render": "text",
|
|
@@ -564,18 +616,18 @@ function AxisLabels(props) {
|
|
|
564
616
|
"y": y,
|
|
565
617
|
"xDirection": xDirection,
|
|
566
618
|
"yDirection": yDirection
|
|
567
|
-
}), lines.map(
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
}, lineText);
|
|
573
|
-
}));
|
|
619
|
+
}), lines.map((lineText, lineIndex) => /* @__PURE__ */ React.createElement("tspan", {
|
|
620
|
+
x,
|
|
621
|
+
y: y + (lineIndex - (lines.length - 1) / 2) * textSize,
|
|
622
|
+
key: `#${lineIndex}-${lineText}`
|
|
623
|
+
}, lineText)));
|
|
574
624
|
}
|
|
575
625
|
if (/* @__PURE__ */ React.isValidElement(category)) {
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
626
|
+
const {
|
|
627
|
+
width = 0,
|
|
628
|
+
height = 0
|
|
629
|
+
} = (category == null ? void 0 : category.props) ?? {};
|
|
630
|
+
const [xOffset, yOffset] = getLabelOffsetPosition(xDirection, yDirection, width, height);
|
|
579
631
|
return /* @__PURE__ */ cloneElement(category, {
|
|
580
632
|
key: i,
|
|
581
633
|
x: x - xOffset,
|
|
@@ -584,130 +636,130 @@ function AxisLabels(props) {
|
|
|
584
636
|
}
|
|
585
637
|
});
|
|
586
638
|
}
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
592
|
-
args[_key3] = arguments[_key3];
|
|
593
|
-
}
|
|
594
|
-
_this4 = _callSuper(this, Hover2, [].concat(args));
|
|
595
|
-
_defineProperty(_this4, "state", {
|
|
639
|
+
class Hover extends Component {
|
|
640
|
+
constructor(...args) {
|
|
641
|
+
super(...args);
|
|
642
|
+
_defineProperty(this, "state", {
|
|
596
643
|
index: null
|
|
597
644
|
});
|
|
598
|
-
_defineProperty(
|
|
599
|
-
_defineProperty(
|
|
600
|
-
_defineProperty(
|
|
601
|
-
_defineProperty(
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
645
|
+
_defineProperty(this, "virtualElement", canUseDOM() ? document.createElement("div") : {});
|
|
646
|
+
_defineProperty(this, "unsubscribeMouseMoveRoot", null);
|
|
647
|
+
_defineProperty(this, "unsubscribeMouseLeaveRoot", null);
|
|
648
|
+
_defineProperty(this, "handlerMouseMoveRoot", trottle((e) => {
|
|
649
|
+
const {
|
|
650
|
+
eventEmitter,
|
|
651
|
+
size,
|
|
652
|
+
rootRef,
|
|
653
|
+
patterns,
|
|
654
|
+
getIndex,
|
|
655
|
+
plotId
|
|
656
|
+
} = this.asProps;
|
|
657
|
+
const point = eventToPoint(e, rootRef.current);
|
|
658
|
+
const diam = Math.min(size[0], size[1]);
|
|
659
|
+
const centerX = point[0] - diam / 2;
|
|
660
|
+
const centerY = point[1] - diam / 2;
|
|
661
|
+
const {
|
|
662
|
+
clientX,
|
|
663
|
+
clientY
|
|
664
|
+
} = e;
|
|
665
|
+
const index = getIndex([centerX, centerY]);
|
|
666
|
+
this.setState({
|
|
610
667
|
index
|
|
611
|
-
},
|
|
612
|
-
eventEmitter.emit(
|
|
613
|
-
eventEmitter.emit(
|
|
668
|
+
}, () => {
|
|
669
|
+
eventEmitter.emit(`setTooltipPosition_${plotId}`, clientX, clientY);
|
|
670
|
+
eventEmitter.emit(`setTooltipRenderingProps_${plotId}`, {}, {
|
|
614
671
|
index,
|
|
615
672
|
patterns
|
|
616
673
|
});
|
|
617
|
-
eventEmitter.emit(
|
|
674
|
+
eventEmitter.emit(`setTooltipVisible_${plotId}`, index !== null);
|
|
618
675
|
});
|
|
619
676
|
}));
|
|
620
|
-
_defineProperty(
|
|
621
|
-
|
|
677
|
+
_defineProperty(this, "handlerMouseLeaveRoot", trottle(() => {
|
|
678
|
+
this.setState({
|
|
622
679
|
index: null
|
|
623
|
-
},
|
|
624
|
-
|
|
680
|
+
}, () => {
|
|
681
|
+
this.asProps.eventEmitter.emit(`setTooltipVisible_${this.asProps.plotId}`, false);
|
|
625
682
|
});
|
|
626
683
|
}));
|
|
627
|
-
return _this4;
|
|
628
684
|
}
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
this.unsubscribeMouseMoveRoot
|
|
652
|
-
e.persist();
|
|
653
|
-
_this5.handlerMouseMoveRoot(e);
|
|
654
|
-
});
|
|
655
|
-
this.unsubscribeMouseLeaveRoot = eventEmitter.subscribe("onMouseLeaveRoot", this.handlerMouseLeaveRoot);
|
|
685
|
+
generateGetBoundingClientRect(x = 0, y = 0) {
|
|
686
|
+
return () => ({
|
|
687
|
+
width: 0,
|
|
688
|
+
height: 0,
|
|
689
|
+
top: y,
|
|
690
|
+
right: x,
|
|
691
|
+
bottom: y,
|
|
692
|
+
left: x
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
componentDidMount() {
|
|
696
|
+
const {
|
|
697
|
+
eventEmitter
|
|
698
|
+
} = this.asProps;
|
|
699
|
+
this.unsubscribeMouseMoveRoot = eventEmitter.subscribe("onMouseMoveRoot", (e) => {
|
|
700
|
+
e.persist();
|
|
701
|
+
this.handlerMouseMoveRoot(e);
|
|
702
|
+
});
|
|
703
|
+
this.unsubscribeMouseLeaveRoot = eventEmitter.subscribe("onMouseLeaveRoot", this.handlerMouseLeaveRoot);
|
|
704
|
+
}
|
|
705
|
+
componentWillUnmount() {
|
|
706
|
+
if (this.unsubscribeMouseMoveRoot) {
|
|
707
|
+
this.unsubscribeMouseMoveRoot();
|
|
656
708
|
}
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
value: function componentWillUnmount() {
|
|
660
|
-
if (this.unsubscribeMouseMoveRoot) {
|
|
661
|
-
this.unsubscribeMouseMoveRoot();
|
|
662
|
-
}
|
|
663
|
-
if (this.unsubscribeMouseLeaveRoot) {
|
|
664
|
-
this.unsubscribeMouseLeaveRoot();
|
|
665
|
-
}
|
|
709
|
+
if (this.unsubscribeMouseLeaveRoot) {
|
|
710
|
+
this.unsubscribeMouseLeaveRoot();
|
|
666
711
|
}
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
712
|
+
}
|
|
713
|
+
render() {
|
|
714
|
+
const {
|
|
715
|
+
styles,
|
|
716
|
+
type,
|
|
717
|
+
getPie,
|
|
718
|
+
getPolygon
|
|
719
|
+
} = this.asProps;
|
|
720
|
+
const {
|
|
721
|
+
index
|
|
722
|
+
} = this.state;
|
|
723
|
+
const SPieRect = this.Element;
|
|
724
|
+
if (index !== null) {
|
|
725
|
+
if (type === "circle") {
|
|
726
|
+
var _ref0;
|
|
727
|
+
const [startAngle, endAngle, radius] = getPie(index);
|
|
728
|
+
const circle = arc().innerRadius(0).outerRadius(radius).startAngle(startAngle).endAngle(endAngle);
|
|
729
|
+
return _ref0 = sstyled(styles), /* @__PURE__ */ React.createElement(SPieRect, _ref0.cn("SPieRect", {
|
|
730
|
+
"render": "path",
|
|
731
|
+
"d": circle()
|
|
732
|
+
}));
|
|
733
|
+
} else {
|
|
734
|
+
var _ref1;
|
|
735
|
+
return _ref1 = sstyled(styles), /* @__PURE__ */ React.createElement(SPieRect, _ref1.cn("SPieRect", {
|
|
736
|
+
"render": "path",
|
|
737
|
+
"d": line()(getPolygon(index))
|
|
738
|
+
}));
|
|
689
739
|
}
|
|
690
|
-
return null;
|
|
691
740
|
}
|
|
692
|
-
|
|
693
|
-
}
|
|
694
|
-
|
|
741
|
+
return null;
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
const Axis = createElement(AxisRoot, {
|
|
695
745
|
Ticks: AxisTicks,
|
|
696
746
|
Labels: AxisLabels
|
|
697
747
|
});
|
|
698
|
-
|
|
748
|
+
const Polygon = createElement(PolygonRoot, {
|
|
699
749
|
Line: PolygonLine,
|
|
700
750
|
Dots: PolygonDots
|
|
701
751
|
});
|
|
702
752
|
function RadarTooltip(props) {
|
|
703
753
|
var _ref = arguments[0], _ref10;
|
|
704
|
-
|
|
705
|
-
return _ref10 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SRadarTooltip, _ref10.cn("SRadarTooltip",
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
754
|
+
const SRadarTooltip = Tooltip;
|
|
755
|
+
return _ref10 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SRadarTooltip, _ref10.cn("SRadarTooltip", {
|
|
756
|
+
...assignProps({
|
|
757
|
+
"tag": Radar.Hover,
|
|
758
|
+
"excludeAnchorProps": true
|
|
759
|
+
}, _ref)
|
|
760
|
+
}));
|
|
709
761
|
}
|
|
710
|
-
|
|
762
|
+
const Radar = createElement(RadarRoot, {
|
|
711
763
|
Axis,
|
|
712
764
|
Polygon,
|
|
713
765
|
Hover,
|