@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/es6/RadialTree.js
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
5
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
6
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
7
|
-
import _callSuper from "@babel/runtime/helpers/callSuper";
|
|
8
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
9
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
2
|
import { sstyled as _sstyled } from "@semcore/core";
|
|
11
|
-
var _excluded = ["data"];
|
|
12
3
|
import { Component, sstyled } from '@semcore/core';
|
|
13
4
|
import assignProps from '@semcore/core/lib/utils/assignProps';
|
|
14
5
|
import canUseDOM from '@semcore/core/lib/utils/canUseDOM';
|
|
@@ -19,257 +10,199 @@ import React from 'react';
|
|
|
19
10
|
import createElement from './createElement';
|
|
20
11
|
import { PatternSymbol, getPatternSymbolSize } from './Pattern';
|
|
21
12
|
/*!__reshadow-styles__:"./style/radial-tree.shadow.css"*/
|
|
22
|
-
|
|
13
|
+
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SRadian_56jyw_gg_{cursor:pointer;fill:var(--intergalactic-text-large-info, #008ff8)}.___SLine_56jyw_gg_{stroke:var(--intergalactic-text-large-info, #008ff8)}.___SLine_56jyw_gg_.__stroke_56jyw_gg_{stroke:var(--stroke_56jyw)}.___SLine_56jyw_gg_.__transparent_56jyw_gg_{opacity:.3}.___SCap_56jyw_gg_{transition:r .1s}.___SCap_56jyw_gg_.__pattern_56jyw_gg_{stroke:var(--intergalactic-chart-grid-border, #ffffff);stroke-width:1px}.___SCap_56jyw_gg_.__transparent_56jyw_gg_,.___SIcon_56jyw_gg_.__transparent_56jyw_gg_,.___SLabel_56jyw_gg_.__transparent_56jyw_gg_{opacity:.3}.___SLabel_56jyw_gg_{fill:var(--color_56jyw)}@media (hover:hover){.___SRadian_56jyw_gg_:hover .___SLabel_56jyw_gg_{cursor:pointer;filter:brightness(.6)}}@media (prefers-reduced-motion){.___SLineCap_56jyw_gg_{transition:none}}", /*__inner_css_end__*/"56jyw_gg_"),
|
|
23
14
|
/*__reshadow_css_end__*/
|
|
24
15
|
{
|
|
25
|
-
"__SRadian": "
|
|
26
|
-
"__SLine": "
|
|
27
|
-
"_stroke": "
|
|
28
|
-
"--stroke": "--
|
|
29
|
-
"_transparent": "
|
|
30
|
-
"__SCap": "
|
|
31
|
-
"_pattern": "
|
|
32
|
-
"__SIcon": "
|
|
33
|
-
"__SLabel": "
|
|
34
|
-
"--color": "--
|
|
35
|
-
"__SLineCap": "
|
|
16
|
+
"__SRadian": "___SRadian_56jyw_gg_",
|
|
17
|
+
"__SLine": "___SLine_56jyw_gg_",
|
|
18
|
+
"_stroke": "__stroke_56jyw_gg_",
|
|
19
|
+
"--stroke": "--stroke_56jyw",
|
|
20
|
+
"_transparent": "__transparent_56jyw_gg_",
|
|
21
|
+
"__SCap": "___SCap_56jyw_gg_",
|
|
22
|
+
"_pattern": "__pattern_56jyw_gg_",
|
|
23
|
+
"__SIcon": "___SIcon_56jyw_gg_",
|
|
24
|
+
"__SLabel": "___SLabel_56jyw_gg_",
|
|
25
|
+
"--color": "--color_56jyw",
|
|
26
|
+
"__SLineCap": "___SLineCap_56jyw_gg_"
|
|
36
27
|
});
|
|
37
28
|
import { getChartDefaultColorName, measureText } from './utils';
|
|
38
|
-
|
|
29
|
+
const baseAngle = -Math.PI / 2; // The top vertical line
|
|
39
30
|
|
|
40
31
|
/** @deprecated */
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
_this.handleRadianClick = _this.handleRadianClick.bind(_this);
|
|
48
|
-
return _this;
|
|
32
|
+
|
|
33
|
+
class RadialTreeBase extends Component {
|
|
34
|
+
constructor(props) {
|
|
35
|
+
super(props);
|
|
36
|
+
_defineProperty(this, "Element", void 0);
|
|
37
|
+
this.handleRadianClick = this.handleRadianClick.bind(this);
|
|
49
38
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
var _this$asProps = this.asProps,
|
|
63
|
-
duration = _this$asProps.duration,
|
|
64
|
-
uid = _this$asProps.uid;
|
|
65
|
-
if (!canUseDOM()) return;
|
|
66
|
-
var preferReduceMotion = (_window$matchMedia = window.matchMedia('(prefers-reduced-motion: reduce)')) === null || _window$matchMedia === void 0 ? void 0 : _window$matchMedia.matches;
|
|
39
|
+
uncontrolledProps() {
|
|
40
|
+
return {
|
|
41
|
+
activeKey: null
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
runAppearAnimation() {
|
|
45
|
+
const {
|
|
46
|
+
duration,
|
|
47
|
+
uid
|
|
48
|
+
} = this.asProps;
|
|
49
|
+
if (!canUseDOM()) return;
|
|
50
|
+
const preferReduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)')?.matches;
|
|
67
51
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
};
|
|
94
|
-
});
|
|
95
|
-
circlesAnimation.attr('opacity', 0).attr('cx', function (_, index) {
|
|
96
|
-
var _attrs$index$from;
|
|
97
|
-
return (_attrs$index$from = attrs[index].from) === null || _attrs$index$from === void 0 ? void 0 : _attrs$index$from.cx;
|
|
98
|
-
}).attr('cy', function (_, index) {
|
|
99
|
-
var _attrs$index$from2;
|
|
100
|
-
return (_attrs$index$from2 = attrs[index].from) === null || _attrs$index$from2 === void 0 ? void 0 : _attrs$index$from2.cy;
|
|
101
|
-
}).transition().duration(duration).attr('opacity', 1)
|
|
102
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
103
|
-
.attr('cx', function (_, index) {
|
|
104
|
-
var _attrs$index$to;
|
|
105
|
-
return (_attrs$index$to = attrs[index].to) === null || _attrs$index$to === void 0 ? void 0 : _attrs$index$to.cx;
|
|
106
|
-
})
|
|
107
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
108
|
-
.attr('cy', function (_, index) {
|
|
109
|
-
var _attrs$index$to2;
|
|
110
|
-
return (_attrs$index$to2 = attrs[index].to) === null || _attrs$index$to2 === void 0 ? void 0 : _attrs$index$to2.cy;
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
if (iconsNodes.length > 0) {
|
|
114
|
-
var _attrs = iconsNodes.map(function (node) {
|
|
115
|
-
var _node$width, _node$height, _lineNode$x2, _lineNode$y2;
|
|
116
|
-
var width = (_node$width = node.width) === null || _node$width === void 0 || (_node$width = _node$width.baseVal) === null || _node$width === void 0 ? void 0 : _node$width.value;
|
|
117
|
-
var height = (_node$height = node.height) === null || _node$height === void 0 || (_node$height = _node$height.baseVal) === null || _node$height === void 0 ? void 0 : _node$height.value;
|
|
118
|
-
var radianIndex = Number.parseInt(node.dataset.radianIndex, 10);
|
|
119
|
-
var lineNode = linesNodes[radianIndex];
|
|
120
|
-
return {
|
|
121
|
-
from: {
|
|
122
|
-
x: ((_lineNode$x2 = lineNode.x1) === null || _lineNode$x2 === void 0 || (_lineNode$x2 = _lineNode$x2.baseVal) === null || _lineNode$x2 === void 0 ? void 0 : _lineNode$x2.value) - width / 2,
|
|
123
|
-
y: ((_lineNode$y2 = lineNode.y1) === null || _lineNode$y2 === void 0 || (_lineNode$y2 = _lineNode$y2.baseVal) === null || _lineNode$y2 === void 0 ? void 0 : _lineNode$y2.value) - height / 2
|
|
124
|
-
},
|
|
125
|
-
to: {
|
|
126
|
-
x: node.dataset['x'],
|
|
127
|
-
y: node.dataset['y']
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
});
|
|
131
|
-
iconsAnimation.attr('opacity', 0)
|
|
132
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
133
|
-
.attr('x', function (_, index) {
|
|
134
|
-
var _attrs$index$from3;
|
|
135
|
-
return (_attrs$index$from3 = _attrs[index].from) === null || _attrs$index$from3 === void 0 ? void 0 : _attrs$index$from3.x;
|
|
136
|
-
})
|
|
137
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
138
|
-
.attr('y', function (_, index) {
|
|
139
|
-
var _attrs$index$from4;
|
|
140
|
-
return (_attrs$index$from4 = _attrs[index].from) === null || _attrs$index$from4 === void 0 ? void 0 : _attrs$index$from4.y;
|
|
141
|
-
}).transition().duration(duration).attr('opacity', 1)
|
|
142
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
143
|
-
.attr('x', function (_, index) {
|
|
144
|
-
var _attrs$index$to3;
|
|
145
|
-
return (_attrs$index$to3 = _attrs[index].to) === null || _attrs$index$to3 === void 0 ? void 0 : _attrs$index$to3.x;
|
|
146
|
-
})
|
|
147
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
148
|
-
.attr('y', function (_, index) {
|
|
149
|
-
var _attrs$index$to4;
|
|
150
|
-
return (_attrs$index$to4 = _attrs[index].to) === null || _attrs$index$to4 === void 0 ? void 0 : _attrs$index$to4.y;
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
if (linesNodes.length > 0) {
|
|
154
|
-
var _attrs2 = linesNodes.map(function (node) {
|
|
155
|
-
var _node$x, _node$y;
|
|
156
|
-
return {
|
|
157
|
-
from: {
|
|
158
|
-
x2: (_node$x = node.x1) === null || _node$x === void 0 || (_node$x = _node$x.baseVal) === null || _node$x === void 0 ? void 0 : _node$x.value,
|
|
159
|
-
y2: (_node$y = node.y1) === null || _node$y === void 0 || (_node$y = _node$y.baseVal) === null || _node$y === void 0 ? void 0 : _node$y.value
|
|
160
|
-
},
|
|
161
|
-
to: {
|
|
162
|
-
x2: node.dataset['x2'],
|
|
163
|
-
y2: node.dataset['y2']
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
});
|
|
167
|
-
linesAnimation.attr('opacity', 0)
|
|
168
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
169
|
-
.attr('x2', function (_, index) {
|
|
170
|
-
var _attrs2$index$from;
|
|
171
|
-
return (_attrs2$index$from = _attrs2[index].from) === null || _attrs2$index$from === void 0 ? void 0 : _attrs2$index$from.x2;
|
|
172
|
-
})
|
|
173
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
174
|
-
.attr('y2', function (_, index) {
|
|
175
|
-
var _attrs2$index$from2;
|
|
176
|
-
return (_attrs2$index$from2 = _attrs2[index].from) === null || _attrs2$index$from2 === void 0 ? void 0 : _attrs2$index$from2.y2;
|
|
177
|
-
}).transition().duration(duration).attr('opacity', 1)
|
|
178
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
179
|
-
.attr('x2', function (_, index) {
|
|
180
|
-
var _attrs2$index$to;
|
|
181
|
-
return (_attrs2$index$to = _attrs2[index].to) === null || _attrs2$index$to === void 0 ? void 0 : _attrs2$index$to.x2;
|
|
182
|
-
})
|
|
183
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
184
|
-
.attr('y2', function (_, index) {
|
|
185
|
-
var _attrs2$index$to2;
|
|
186
|
-
return (_attrs2$index$to2 = _attrs2[index].to) === null || _attrs2$index$to2 === void 0 ? void 0 : _attrs2$index$to2.y2;
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
if (labelsNodes.length > 0) {
|
|
190
|
-
labelsAnimation.attr('opacity', 0);
|
|
191
|
-
labelsAnimation.transition().duration(duration).attr('opacity', 1);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}, {
|
|
195
|
-
key: "componentDidUpdate",
|
|
196
|
-
value: function componentDidUpdate(prevProps) {
|
|
197
|
-
if (prevProps.$rootProps.data !== this.asProps.data) {
|
|
198
|
-
this.runAppearAnimation();
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}, {
|
|
202
|
-
key: "componentDidMount",
|
|
203
|
-
value: function componentDidMount() {
|
|
204
|
-
this.runAppearAnimation();
|
|
205
|
-
}
|
|
206
|
-
}, {
|
|
207
|
-
key: "handleRadianClick",
|
|
208
|
-
value: function handleRadianClick(key) {
|
|
209
|
-
var _this2 = this;
|
|
210
|
-
return function (event) {
|
|
211
|
-
var newKey = key !== _this2.asProps.activeKey ? key : null;
|
|
212
|
-
_this2.handlers.activeKey(newKey, event);
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
}, {
|
|
216
|
-
key: "computeTextWidth",
|
|
217
|
-
value: function computeTextWidth() {
|
|
218
|
-
var _this$asProps2 = this.asProps,
|
|
219
|
-
data = _this$asProps2.data,
|
|
220
|
-
textSize = _this$asProps2.textSize;
|
|
221
|
-
var widths = data.map(function (_ref0) {
|
|
222
|
-
var label = _ref0.label;
|
|
223
|
-
return measureText(label, textSize);
|
|
52
|
+
/** using `!(>)` instead of `<=` to get true on Number.NaN and non numbers stuff */
|
|
53
|
+
if (!(duration > 0)) return;
|
|
54
|
+
if (preferReduceMotion) return;
|
|
55
|
+
const circlesAnimation = transition().selection().selectAll(`[data-radial-animation=${uid}-cap-circle]`).interrupt();
|
|
56
|
+
const iconsAnimation = transition().selection().selectAll(`[data-radial-animation=${uid}-cap-icon]`).interrupt();
|
|
57
|
+
const linesAnimation = transition().selection().selectAll(`[data-radial-animation=${uid}-line]`).interrupt();
|
|
58
|
+
const labelsAnimation = transition().selection().selectAll(`[data-radial-animation=${uid}-label]`).interrupt();
|
|
59
|
+
const circlesNodes = circlesAnimation.nodes();
|
|
60
|
+
const iconsNodes = iconsAnimation.nodes();
|
|
61
|
+
const linesNodes = linesAnimation.nodes();
|
|
62
|
+
const labelsNodes = linesAnimation.nodes();
|
|
63
|
+
if (circlesNodes.length > 0) {
|
|
64
|
+
const attrs = circlesNodes.map(node => {
|
|
65
|
+
const radianIndex = Number.parseInt(node.dataset.radianIndex, 10);
|
|
66
|
+
const lineNode = linesNodes[radianIndex];
|
|
67
|
+
return {
|
|
68
|
+
from: {
|
|
69
|
+
cx: lineNode.x1?.baseVal?.value,
|
|
70
|
+
cy: lineNode.y1?.baseVal?.value
|
|
71
|
+
},
|
|
72
|
+
to: {
|
|
73
|
+
cx: node.dataset['cx'],
|
|
74
|
+
cy: node.dataset['cy']
|
|
75
|
+
}
|
|
76
|
+
};
|
|
224
77
|
});
|
|
225
|
-
|
|
78
|
+
circlesAnimation.attr('opacity', 0).attr('cx', (_, index) => attrs[index].from?.cx).attr('cy', (_, index) => attrs[index].from?.cy).transition().duration(duration).attr('opacity', 1)
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
80
|
+
.attr('cx', (_, index) => attrs[index].to?.cx)
|
|
81
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
82
|
+
.attr('cy', (_, index) => attrs[index].to?.cy);
|
|
226
83
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
84
|
+
if (iconsNodes.length > 0) {
|
|
85
|
+
const attrs = iconsNodes.map(node => {
|
|
86
|
+
const width = node.width?.baseVal?.value;
|
|
87
|
+
const height = node.height?.baseVal?.value;
|
|
88
|
+
const radianIndex = Number.parseInt(node.dataset.radianIndex, 10);
|
|
89
|
+
const lineNode = linesNodes[radianIndex];
|
|
90
|
+
return {
|
|
91
|
+
from: {
|
|
92
|
+
x: lineNode.x1?.baseVal?.value - width / 2,
|
|
93
|
+
y: lineNode.y1?.baseVal?.value - height / 2
|
|
94
|
+
},
|
|
95
|
+
to: {
|
|
96
|
+
x: node.dataset['x'],
|
|
97
|
+
y: node.dataset['y']
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
iconsAnimation.attr('opacity', 0)
|
|
102
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
103
|
+
.attr('x', (_, index) => attrs[index].from?.x)
|
|
104
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
105
|
+
.attr('y', (_, index) => attrs[index].from?.y).transition().duration(duration).attr('opacity', 1)
|
|
106
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
107
|
+
.attr('x', (_, index) => attrs[index].to?.x)
|
|
108
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
109
|
+
.attr('y', (_, index) => attrs[index].to?.y);
|
|
245
110
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
111
|
+
if (linesNodes.length > 0) {
|
|
112
|
+
const attrs = linesNodes.map(node => {
|
|
113
|
+
return {
|
|
114
|
+
from: {
|
|
115
|
+
x2: node.x1?.baseVal?.value,
|
|
116
|
+
y2: node.y1?.baseVal?.value
|
|
117
|
+
},
|
|
118
|
+
to: {
|
|
119
|
+
x2: node.dataset['x2'],
|
|
120
|
+
y2: node.dataset['y2']
|
|
121
|
+
}
|
|
122
|
+
};
|
|
258
123
|
});
|
|
124
|
+
linesAnimation.attr('opacity', 0)
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
126
|
+
.attr('x2', (_, index) => attrs[index].from?.x2)
|
|
127
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
128
|
+
.attr('y2', (_, index) => attrs[index].from?.y2).transition().duration(duration).attr('opacity', 1)
|
|
129
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
130
|
+
.attr('x2', (_, index) => attrs[index].to?.x2)
|
|
131
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
|
132
|
+
.attr('y2', (_, index) => attrs[index].to?.y2);
|
|
259
133
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
var _ref;
|
|
264
|
-
var SRadialTree = this.Element;
|
|
265
|
-
var Children = this.asProps.Children;
|
|
266
|
-
this.asProps.dataHintsHandler.establishDataType('values-set');
|
|
267
|
-
return _ref = sstyled(this.asProps.styles), /*#__PURE__*/React.createElement(SRadialTree, _ref.cn("SRadialTree", {
|
|
268
|
-
"render": 'g'
|
|
269
|
-
}), /*#__PURE__*/React.createElement(Children, _ref.cn("Children", {})));
|
|
134
|
+
if (labelsNodes.length > 0) {
|
|
135
|
+
labelsAnimation.attr('opacity', 0);
|
|
136
|
+
labelsAnimation.transition().duration(duration).attr('opacity', 1);
|
|
270
137
|
}
|
|
271
|
-
}
|
|
272
|
-
|
|
138
|
+
}
|
|
139
|
+
componentDidUpdate(prevProps) {
|
|
140
|
+
if (prevProps.$rootProps.data !== this.asProps.data) {
|
|
141
|
+
this.runAppearAnimation();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
componentDidMount() {
|
|
145
|
+
this.runAppearAnimation();
|
|
146
|
+
}
|
|
147
|
+
handleRadianClick(key) {
|
|
148
|
+
return event => {
|
|
149
|
+
const newKey = key !== this.asProps.activeKey ? key : null;
|
|
150
|
+
this.handlers.activeKey(newKey, event);
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
computeTextWidth() {
|
|
154
|
+
const {
|
|
155
|
+
data,
|
|
156
|
+
textSize
|
|
157
|
+
} = this.asProps;
|
|
158
|
+
const widths = data.map(({
|
|
159
|
+
label
|
|
160
|
+
}) => measureText(label, textSize));
|
|
161
|
+
return Math.max(...widths);
|
|
162
|
+
}
|
|
163
|
+
getTitleProps() {
|
|
164
|
+
const {
|
|
165
|
+
uid,
|
|
166
|
+
size,
|
|
167
|
+
textSize
|
|
168
|
+
} = this.asProps;
|
|
169
|
+
const [width, height] = size;
|
|
170
|
+
const center = [width / 2, height / 2];
|
|
171
|
+
const [x, y] = center;
|
|
172
|
+
return {
|
|
173
|
+
x,
|
|
174
|
+
y,
|
|
175
|
+
textSize: textSize * 1.5,
|
|
176
|
+
['data-radial-animation']: `${uid}-label`
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
getRadianProps() {
|
|
180
|
+
const {
|
|
181
|
+
data,
|
|
182
|
+
...restRootProps
|
|
183
|
+
} = this.asProps;
|
|
184
|
+
const textWidth = this.computeTextWidth();
|
|
185
|
+
return {
|
|
186
|
+
...restRootProps,
|
|
187
|
+
radiansCount: data.length,
|
|
188
|
+
data,
|
|
189
|
+
textWidth,
|
|
190
|
+
onRadianClick: this.handleRadianClick
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
render() {
|
|
194
|
+
var _ref;
|
|
195
|
+
const SRadialTree = this.Element;
|
|
196
|
+
const {
|
|
197
|
+
Children
|
|
198
|
+
} = this.asProps;
|
|
199
|
+
this.asProps.dataHintsHandler.establishDataType('values-set');
|
|
200
|
+
return _ref = sstyled(this.asProps.styles), /*#__PURE__*/React.createElement(SRadialTree, _ref.cn("SRadialTree", {
|
|
201
|
+
"render": 'g'
|
|
202
|
+
}), /*#__PURE__*/React.createElement(Children, _ref.cn("Children", {})));
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
273
206
|
/** @deprecated */
|
|
274
207
|
_defineProperty(RadialTreeBase, "displayName", 'RadialTree');
|
|
275
208
|
_defineProperty(RadialTreeBase, "style", style);
|
|
@@ -285,227 +218,242 @@ _defineProperty(RadialTreeBase, "defaultProps", {
|
|
|
285
218
|
textSize: 14,
|
|
286
219
|
defaultActiveKey: null
|
|
287
220
|
});
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
_defineProperty(_this3, "Element", void 0);
|
|
294
|
-
_this3.renderRadian = _this3.renderRadian.bind(_this3);
|
|
295
|
-
return _this3;
|
|
221
|
+
class RadialTreeRadian extends Component {
|
|
222
|
+
constructor(props) {
|
|
223
|
+
super(props);
|
|
224
|
+
_defineProperty(this, "Element", void 0);
|
|
225
|
+
this.renderRadian = this.renderRadian.bind(this);
|
|
296
226
|
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
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
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
227
|
+
getInteractiveAreaProps({
|
|
228
|
+
$rootProps
|
|
229
|
+
}, index) {
|
|
230
|
+
const data = $rootProps.data?.[index];
|
|
231
|
+
const {
|
|
232
|
+
xStart,
|
|
233
|
+
yStart,
|
|
234
|
+
xLabelCenter,
|
|
235
|
+
yLabelCenter,
|
|
236
|
+
capSize
|
|
237
|
+
} = this.computeRadianPosition(data, index);
|
|
238
|
+
return {
|
|
239
|
+
x1: xStart,
|
|
240
|
+
y1: yStart,
|
|
241
|
+
x2: xLabelCenter,
|
|
242
|
+
y2: yLabelCenter,
|
|
243
|
+
strokeWidth: capSize * 3
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
getLineProps({
|
|
247
|
+
$rootProps
|
|
248
|
+
}, index) {
|
|
249
|
+
const data = $rootProps.data?.[index];
|
|
250
|
+
const {
|
|
251
|
+
xStart,
|
|
252
|
+
yStart,
|
|
253
|
+
xEnd,
|
|
254
|
+
yEnd
|
|
255
|
+
} = this.computeRadianPosition(data, index);
|
|
256
|
+
const {
|
|
257
|
+
uid,
|
|
258
|
+
transparent,
|
|
259
|
+
resolveColor
|
|
260
|
+
} = this.asProps;
|
|
261
|
+
const color = data.color ?? this.asProps.color;
|
|
262
|
+
return {
|
|
263
|
+
x1: xStart,
|
|
264
|
+
y1: yStart,
|
|
265
|
+
x2: xEnd,
|
|
266
|
+
y2: yEnd,
|
|
267
|
+
stroke: color,
|
|
268
|
+
resolveColor,
|
|
269
|
+
transparent,
|
|
270
|
+
['data-x1']: xStart,
|
|
271
|
+
['data-y1']: yStart,
|
|
272
|
+
['data-x2']: xEnd,
|
|
273
|
+
['data-y2']: yEnd,
|
|
274
|
+
['data-radial-animation']: `${uid}-line`,
|
|
275
|
+
['data-radian-index']: index
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
getCapProps({
|
|
279
|
+
$rootProps
|
|
280
|
+
}, index) {
|
|
281
|
+
const data = $rootProps.data?.[index];
|
|
282
|
+
const {
|
|
283
|
+
xEnd,
|
|
284
|
+
yEnd,
|
|
285
|
+
capSize
|
|
286
|
+
} = this.computeRadianPosition(data, index);
|
|
287
|
+
const {
|
|
288
|
+
uid,
|
|
289
|
+
transparent,
|
|
290
|
+
resolveColor,
|
|
291
|
+
patterns
|
|
292
|
+
} = this.asProps;
|
|
293
|
+
const color = data.color ?? this.asProps.color;
|
|
294
|
+
return {
|
|
295
|
+
x: xEnd,
|
|
296
|
+
y: yEnd,
|
|
297
|
+
['data-cx']: xEnd,
|
|
298
|
+
['data-cy']: yEnd,
|
|
299
|
+
radius: capSize,
|
|
300
|
+
color,
|
|
301
|
+
resolveColor,
|
|
302
|
+
transparent,
|
|
303
|
+
patterns,
|
|
304
|
+
uid: `${uid}-cap-${index}`,
|
|
305
|
+
['data-radial-animation']: `${uid}-cap-circle`,
|
|
306
|
+
['data-radian-index']: index
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
getIconProps({
|
|
310
|
+
$rootProps
|
|
311
|
+
}, index) {
|
|
312
|
+
const data = $rootProps.data?.[index];
|
|
313
|
+
const {
|
|
314
|
+
xEnd,
|
|
315
|
+
yEnd,
|
|
316
|
+
isActive
|
|
317
|
+
} = this.computeRadianPosition(data, index);
|
|
318
|
+
const {
|
|
319
|
+
uid,
|
|
320
|
+
resolveColor
|
|
321
|
+
} = this.asProps;
|
|
322
|
+
const iconColor = data.iconColor ?? this.asProps.iconColor;
|
|
323
|
+
const iconSize = data.iconSize ?? this.asProps.iconSize;
|
|
324
|
+
const icon = data.icon ?? this.asProps.icon;
|
|
325
|
+
const x = xEnd - iconSize / 2;
|
|
326
|
+
const y = yEnd - iconSize / 2;
|
|
327
|
+
return {
|
|
328
|
+
x,
|
|
329
|
+
y,
|
|
330
|
+
['data-x']: x,
|
|
331
|
+
['data-y']: y,
|
|
332
|
+
iconSize,
|
|
333
|
+
color: iconColor ?? '#fff',
|
|
334
|
+
resolveColor,
|
|
335
|
+
['data-radial-animation']: `${uid}-cap-icon`,
|
|
336
|
+
['data-radian-index']: index,
|
|
337
|
+
icon,
|
|
338
|
+
tag: icon,
|
|
339
|
+
isActive
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
getLabelProps({
|
|
343
|
+
$rootProps
|
|
344
|
+
}, index) {
|
|
345
|
+
const data = $rootProps.data?.[index];
|
|
346
|
+
const {
|
|
347
|
+
xLabelCenter,
|
|
348
|
+
yLabelCenter,
|
|
349
|
+
labelAngle,
|
|
350
|
+
isHorizontal
|
|
351
|
+
} = this.computeRadianPosition(data, index);
|
|
352
|
+
const {
|
|
353
|
+
uid,
|
|
354
|
+
textSize,
|
|
355
|
+
transparent,
|
|
356
|
+
resolveColor
|
|
357
|
+
} = this.asProps;
|
|
358
|
+
const {
|
|
359
|
+
label
|
|
360
|
+
} = data;
|
|
361
|
+
const color = data.color ?? this.asProps.color;
|
|
362
|
+
return {
|
|
363
|
+
x: xLabelCenter,
|
|
364
|
+
y: yLabelCenter,
|
|
365
|
+
angle: labelAngle,
|
|
366
|
+
['data-radial-animation']: `${uid}-label`,
|
|
367
|
+
['data-radian-index']: index,
|
|
368
|
+
label,
|
|
369
|
+
color,
|
|
370
|
+
resolveColor,
|
|
371
|
+
isHorizontal,
|
|
372
|
+
textSize,
|
|
373
|
+
transparent
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
getRadianKey(data, index) {
|
|
377
|
+
return data.key ?? `radian-${index}`;
|
|
378
|
+
}
|
|
379
|
+
computeRadianPosition(data, index) {
|
|
380
|
+
const {
|
|
381
|
+
centralMargin,
|
|
382
|
+
labelMargin,
|
|
383
|
+
angleOffset,
|
|
384
|
+
activeKey,
|
|
385
|
+
size,
|
|
386
|
+
radiansCount,
|
|
387
|
+
textWidth
|
|
388
|
+
} = this.asProps;
|
|
389
|
+
const [width, height] = size;
|
|
390
|
+
const key = this.getRadianKey(data, index);
|
|
391
|
+
const isActive = activeKey === key;
|
|
392
|
+
const baseCapSize = data.capSize ?? this.asProps.capSize;
|
|
393
|
+
const capSize = baseCapSize * (isActive ? 1 : 0.5);
|
|
394
|
+
const minDemSize = Math.min(width, height) / 2;
|
|
395
|
+
const length = Math.max(minDemSize - textWidth - baseCapSize - centralMargin - labelMargin * 2, 10);
|
|
396
|
+
const angle = baseAngle + angleOffset + index / radiansCount * (Math.PI * 2);
|
|
397
|
+
const isHorizontal = angle - baseAngle > 1 / 6 * Math.PI && angle - baseAngle < 5 / 6 * Math.PI || angle - baseAngle > 7 / 6 * Math.PI && angle - baseAngle < 11 / 6 * Math.PI;
|
|
398
|
+
const topAngle = -Math.PI / 2;
|
|
399
|
+
const labelAngle = (angle - topAngle) % Math.PI + topAngle;
|
|
400
|
+
const center = [width / 2, height / 2];
|
|
401
|
+
const [xCenter, yCenter] = center;
|
|
402
|
+
const start = [xCenter + Math.cos(angle) * centralMargin, yCenter + Math.sin(angle) * centralMargin];
|
|
403
|
+
const end = [xCenter + Math.cos(angle) * (centralMargin + length), yCenter + Math.sin(angle) * (centralMargin + length)];
|
|
404
|
+
const [xStart, yStart] = start;
|
|
405
|
+
const [xEnd, yEnd] = end;
|
|
406
|
+
const labelCenter = [xCenter + Math.cos(angle) * (centralMargin + length + baseCapSize + textWidth / 2 + labelMargin), yCenter + Math.sin(angle) * (centralMargin + length + baseCapSize + textWidth / 2 + labelMargin)];
|
|
407
|
+
const [xLabelCenter, yLabelCenter] = labelCenter;
|
|
408
|
+
return {
|
|
409
|
+
xStart,
|
|
410
|
+
yStart,
|
|
411
|
+
xEnd,
|
|
412
|
+
yEnd,
|
|
413
|
+
xLabelCenter,
|
|
414
|
+
yLabelCenter,
|
|
415
|
+
labelAngle,
|
|
416
|
+
isHorizontal,
|
|
417
|
+
capSize,
|
|
418
|
+
isActive
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
renderRadian(data, index) {
|
|
422
|
+
var _ref2;
|
|
423
|
+
const {
|
|
424
|
+
styles,
|
|
425
|
+
Children,
|
|
426
|
+
onRadianClick
|
|
427
|
+
} = this.asProps;
|
|
428
|
+
const key = this.getRadianKey(data, index);
|
|
429
|
+
const SRadian = 'g';
|
|
430
|
+
let children = getOriginChildren(Children);
|
|
431
|
+
if (typeof children === 'function') {
|
|
432
|
+
const _child = this.asProps.children;
|
|
433
|
+
const mergedProps = assignProps(children(this.asProps), this.asProps);
|
|
434
|
+
children = mergedProps.children;
|
|
435
|
+
mergedProps.children = _child;
|
|
468
436
|
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
437
|
+
this.asProps.dataHintsHandler.describeValueEntity(`${index}.${data.label}`, data.label);
|
|
438
|
+
|
|
439
|
+
// hidden from publicly typed export
|
|
440
|
+
const InteractiveArea = RadialTree.Radian.InteractiveArea;
|
|
441
|
+
return _ref2 = sstyled(styles), /*#__PURE__*/React.createElement(SRadian, _ref2.cn("SRadian", {
|
|
442
|
+
"aria-hidden": true,
|
|
443
|
+
"key": key,
|
|
444
|
+
"onClick": onRadianClick(key)
|
|
445
|
+
}), /*#__PURE__*/React.createElement(InteractiveArea, _ref2.cn("InteractiveArea", {})), children);
|
|
446
|
+
}
|
|
447
|
+
render() {
|
|
448
|
+
var _ref3;
|
|
449
|
+
const {
|
|
450
|
+
data
|
|
451
|
+
} = this.asProps;
|
|
452
|
+
const SRadianList = 'g';
|
|
453
|
+
return _ref3 = sstyled(this.asProps.styles), /*#__PURE__*/React.createElement(SRadianList, _ref3.cn("SRadianList", {}), data.map((data, index) => this.renderRadian(data, index)));
|
|
454
|
+
}
|
|
455
|
+
}
|
|
487
456
|
|
|
488
|
-
// hidden from publicly typed export
|
|
489
|
-
var InteractiveArea = RadialTree.Radian.InteractiveArea;
|
|
490
|
-
return _ref2 = sstyled(styles), /*#__PURE__*/React.createElement(SRadian, _ref2.cn("SRadian", {
|
|
491
|
-
"aria-hidden": true,
|
|
492
|
-
"key": key,
|
|
493
|
-
"onClick": onRadianClick(key)
|
|
494
|
-
}), /*#__PURE__*/React.createElement(InteractiveArea, _ref2.cn("InteractiveArea", {})), children);
|
|
495
|
-
}
|
|
496
|
-
}, {
|
|
497
|
-
key: "render",
|
|
498
|
-
value: function render() {
|
|
499
|
-
var _ref3,
|
|
500
|
-
_this4 = this;
|
|
501
|
-
var data = this.asProps.data;
|
|
502
|
-
var SRadianList = 'g';
|
|
503
|
-
return _ref3 = sstyled(this.asProps.styles), /*#__PURE__*/React.createElement(SRadianList, _ref3.cn("SRadianList", {}), data.map(function (data, index) {
|
|
504
|
-
return _this4.renderRadian(data, index);
|
|
505
|
-
}));
|
|
506
|
-
}
|
|
507
|
-
}]);
|
|
508
|
-
}(Component);
|
|
509
457
|
/** @deprecated */
|
|
510
458
|
_defineProperty(RadialTreeRadian, "displayName", 'RadialTreeRadian');
|
|
511
459
|
_defineProperty(RadialTreeRadian, "style", style);
|
|
@@ -517,10 +465,11 @@ _defineProperty(RadialTreeRadian, "defaultProps", {
|
|
|
517
465
|
iconSize: 16,
|
|
518
466
|
textSize: 14
|
|
519
467
|
});
|
|
520
|
-
function InteractiveArea(
|
|
468
|
+
function InteractiveArea({
|
|
469
|
+
Element: SInteractiveArea,
|
|
470
|
+
styles
|
|
471
|
+
}) {
|
|
521
472
|
var _ref4;
|
|
522
|
-
var SInteractiveArea = _ref20.Element,
|
|
523
|
-
styles = _ref20.styles;
|
|
524
473
|
return _ref4 = sstyled(styles), /*#__PURE__*/React.createElement(SInteractiveArea, _ref4.cn("SInteractiveArea", {
|
|
525
474
|
"stroke": 'transparent',
|
|
526
475
|
"render": 'line'
|
|
@@ -529,13 +478,14 @@ function InteractiveArea(_ref20) {
|
|
|
529
478
|
|
|
530
479
|
/** @deprecated */
|
|
531
480
|
|
|
532
|
-
function Line(
|
|
481
|
+
function Line({
|
|
482
|
+
Element: SLine,
|
|
483
|
+
styles,
|
|
484
|
+
stroke,
|
|
485
|
+
resolveColor,
|
|
486
|
+
transparent
|
|
487
|
+
}) {
|
|
533
488
|
var _ref5;
|
|
534
|
-
var SLine = _ref21.Element,
|
|
535
|
-
styles = _ref21.styles,
|
|
536
|
-
stroke = _ref21.stroke,
|
|
537
|
-
resolveColor = _ref21.resolveColor,
|
|
538
|
-
transparent = _ref21.transparent;
|
|
539
489
|
return _ref5 = sstyled(styles), /*#__PURE__*/React.createElement(SLine, _ref5.cn("SLine", {
|
|
540
490
|
"render": 'line',
|
|
541
491
|
"stroke": resolveColor(stroke),
|
|
@@ -545,19 +495,18 @@ function Line(_ref21) {
|
|
|
545
495
|
|
|
546
496
|
/** @deprecated */
|
|
547
497
|
|
|
548
|
-
function Cap(
|
|
498
|
+
function Cap({
|
|
499
|
+
Element: SCap,
|
|
500
|
+
styles,
|
|
501
|
+
x = 0,
|
|
502
|
+
y = 0,
|
|
503
|
+
radius,
|
|
504
|
+
color,
|
|
505
|
+
resolveColor,
|
|
506
|
+
transparent,
|
|
507
|
+
patterns
|
|
508
|
+
}) {
|
|
549
509
|
var _ref7;
|
|
550
|
-
var SCap = _ref22.Element,
|
|
551
|
-
styles = _ref22.styles,
|
|
552
|
-
_ref22$x = _ref22.x,
|
|
553
|
-
x = _ref22$x === void 0 ? 0 : _ref22$x,
|
|
554
|
-
_ref22$y = _ref22.y,
|
|
555
|
-
y = _ref22$y === void 0 ? 0 : _ref22$y,
|
|
556
|
-
radius = _ref22.radius,
|
|
557
|
-
color = _ref22.color,
|
|
558
|
-
resolveColor = _ref22.resolveColor,
|
|
559
|
-
transparent = _ref22.transparent,
|
|
560
|
-
patterns = _ref22.patterns;
|
|
561
510
|
if (!patterns) {
|
|
562
511
|
var _ref6;
|
|
563
512
|
return _ref6 = sstyled(styles), /*#__PURE__*/React.createElement(SCap, _ref6.cn("SCap", {
|
|
@@ -569,14 +518,11 @@ function Cap(_ref22) {
|
|
|
569
518
|
"transparent": transparent
|
|
570
519
|
}));
|
|
571
520
|
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
_getPatternSymbolSize2 = _slicedToArray(_getPatternSymbolSize, 2),
|
|
578
|
-
width = _getPatternSymbolSize2[0],
|
|
579
|
-
height = _getPatternSymbolSize2[1];
|
|
521
|
+
const patternKey = color || getChartDefaultColorName(0);
|
|
522
|
+
const [width, height] = getPatternSymbolSize({
|
|
523
|
+
patternKey,
|
|
524
|
+
patterns
|
|
525
|
+
});
|
|
580
526
|
return _ref7 = sstyled(styles), /*#__PURE__*/React.createElement(SCap, _ref7.cn("SCap", {
|
|
581
527
|
"render": PatternSymbol,
|
|
582
528
|
"patternKey": color,
|
|
@@ -590,19 +536,20 @@ function Cap(_ref22) {
|
|
|
590
536
|
|
|
591
537
|
/** @deprecated */
|
|
592
538
|
|
|
593
|
-
function Icon(
|
|
539
|
+
function Icon({
|
|
540
|
+
Element: SIcon,
|
|
541
|
+
styles,
|
|
542
|
+
isActive,
|
|
543
|
+
tag,
|
|
544
|
+
x,
|
|
545
|
+
y,
|
|
546
|
+
iconSize,
|
|
547
|
+
transparent
|
|
548
|
+
}) {
|
|
594
549
|
var _ref8;
|
|
595
|
-
var SIcon = _ref23.Element,
|
|
596
|
-
styles = _ref23.styles,
|
|
597
|
-
isActive = _ref23.isActive,
|
|
598
|
-
tag = _ref23.tag,
|
|
599
|
-
x = _ref23.x,
|
|
600
|
-
y = _ref23.y,
|
|
601
|
-
iconSize = _ref23.iconSize,
|
|
602
|
-
transparent = _ref23.transparent;
|
|
603
550
|
if (!(isActive && tag)) return null;
|
|
604
|
-
|
|
605
|
-
|
|
551
|
+
const width = iconSize;
|
|
552
|
+
const height = iconSize;
|
|
606
553
|
return _ref8 = sstyled(styles), /*#__PURE__*/React.createElement(SIcon, _ref8.cn("SIcon", {
|
|
607
554
|
"x": x,
|
|
608
555
|
"y": y,
|
|
@@ -615,30 +562,31 @@ function Icon(_ref23) {
|
|
|
615
562
|
|
|
616
563
|
/** @deprecated */
|
|
617
564
|
|
|
618
|
-
function Label(
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
565
|
+
function Label({
|
|
566
|
+
Element: SLabel,
|
|
567
|
+
Children,
|
|
568
|
+
styles,
|
|
569
|
+
label,
|
|
570
|
+
color,
|
|
571
|
+
resolveColor,
|
|
572
|
+
isHorizontal,
|
|
573
|
+
x,
|
|
574
|
+
y,
|
|
575
|
+
textSize,
|
|
576
|
+
angle,
|
|
577
|
+
transparent
|
|
578
|
+
}) {
|
|
579
|
+
const lines = String(label).split('\n');
|
|
580
|
+
const linesCount = lines.length;
|
|
581
|
+
const SLabelLine = 'tspan';
|
|
582
|
+
const angleDegs = (angle / Math.PI * 180).toFixed(2);
|
|
583
|
+
const transformOrigin = [x.toFixed(2), y.toFixed(2)];
|
|
584
|
+
const transform = `rotate(${[angleDegs, ...transformOrigin].join(', ')})`;
|
|
585
|
+
const sstyles = sstyled(styles);
|
|
586
|
+
const sLabelStyles = sstyles.cn('SLabel', {
|
|
639
587
|
'color': resolveColor(color),
|
|
640
588
|
'text-cursor': isHorizontal ? 'text' : 'vertical-text',
|
|
641
|
-
transparent
|
|
589
|
+
transparent
|
|
642
590
|
});
|
|
643
591
|
return /*#__PURE__*/React.createElement(SLabel, {
|
|
644
592
|
"aria-hidden": true,
|
|
@@ -650,36 +598,35 @@ function Label(_ref24) {
|
|
|
650
598
|
x: x.toFixed(2),
|
|
651
599
|
y: y.toFixed(2),
|
|
652
600
|
transform: transform
|
|
653
|
-
}, lines.map(
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
}, lineText);
|
|
659
|
-
}), /*#__PURE__*/React.createElement(Children, null));
|
|
601
|
+
}, lines.map((lineText, lineIndex) => /*#__PURE__*/React.createElement(SLabelLine, {
|
|
602
|
+
x: x,
|
|
603
|
+
y: y + (lineIndex - (linesCount - 1) / 2) * textSize,
|
|
604
|
+
key: `#${lineIndex}-${lineText}`
|
|
605
|
+
}, lineText)), /*#__PURE__*/React.createElement(Children, null));
|
|
660
606
|
}
|
|
661
|
-
|
|
662
|
-
InteractiveArea
|
|
663
|
-
Line
|
|
664
|
-
Cap
|
|
665
|
-
Icon
|
|
666
|
-
Label
|
|
607
|
+
const Radian = createElement(RadialTreeRadian, {
|
|
608
|
+
InteractiveArea,
|
|
609
|
+
Line,
|
|
610
|
+
Cap,
|
|
611
|
+
Icon,
|
|
612
|
+
Label
|
|
667
613
|
});
|
|
668
614
|
|
|
669
615
|
/** @deprecated */
|
|
670
616
|
|
|
671
|
-
function Title(
|
|
617
|
+
function Title({
|
|
618
|
+
Element: STitle,
|
|
619
|
+
Children,
|
|
620
|
+
children,
|
|
621
|
+
styles,
|
|
622
|
+
textSize,
|
|
623
|
+
color,
|
|
624
|
+
resolveColor,
|
|
625
|
+
x,
|
|
626
|
+
y,
|
|
627
|
+
dataHintsHandler
|
|
628
|
+
}) {
|
|
672
629
|
var _ref9;
|
|
673
|
-
var STitle = _ref25.Element,
|
|
674
|
-
Children = _ref25.Children,
|
|
675
|
-
children = _ref25.children,
|
|
676
|
-
styles = _ref25.styles,
|
|
677
|
-
textSize = _ref25.textSize,
|
|
678
|
-
color = _ref25.color,
|
|
679
|
-
resolveColor = _ref25.resolveColor,
|
|
680
|
-
x = _ref25.x,
|
|
681
|
-
y = _ref25.y,
|
|
682
|
-
dataHintsHandler = _ref25.dataHintsHandler;
|
|
683
630
|
if (typeof children === 'string') {
|
|
684
631
|
dataHintsHandler.setTitle('vertical', children);
|
|
685
632
|
}
|
|
@@ -694,9 +641,9 @@ function Title(_ref25) {
|
|
|
694
641
|
"y": y
|
|
695
642
|
}), /*#__PURE__*/React.createElement(Children, _ref9.cn("Children", {})));
|
|
696
643
|
}
|
|
697
|
-
|
|
698
|
-
Title
|
|
699
|
-
Radian
|
|
644
|
+
const RadialTree = createElement(RadialTreeBase, {
|
|
645
|
+
Title,
|
|
646
|
+
Radian
|
|
700
647
|
});
|
|
701
648
|
export default RadialTree;
|
|
702
649
|
//# sourceMappingURL=RadialTree.js.map
|