@semcore/d3-chart 3.60.2-prerelease.0 → 3.61.0-prerelease.0
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 +6 -0
- package/lib/cjs/AnimatedClipPath.js +11 -15
- package/lib/cjs/AnimatedClipPath.js.map +1 -1
- package/lib/cjs/Area.js +71 -48
- package/lib/cjs/Area.js.map +1 -1
- package/lib/cjs/Axis.js +170 -108
- package/lib/cjs/Axis.js.map +1 -1
- package/lib/cjs/Bar.js +29 -34
- package/lib/cjs/Bar.js.map +1 -1
- package/lib/cjs/Bubble.js +211 -137
- package/lib/cjs/Bubble.js.map +1 -1
- package/lib/cjs/CompactHorizontalBar.js +92 -82
- package/lib/cjs/CompactHorizontalBar.js.map +1 -1
- package/lib/cjs/Donut.js +154 -139
- package/lib/cjs/Donut.js.map +1 -1
- package/lib/cjs/Dots.js +55 -38
- package/lib/cjs/Dots.js.map +1 -1
- package/lib/cjs/GroupBar.js +15 -18
- package/lib/cjs/GroupBar.js.map +1 -1
- package/lib/cjs/HorizontalBar.js +29 -34
- package/lib/cjs/HorizontalBar.js.map +1 -1
- package/lib/cjs/Hover.js +52 -45
- package/lib/cjs/Hover.js.map +1 -1
- package/lib/cjs/Line.js +63 -41
- package/lib/cjs/Line.js.map +1 -1
- package/lib/cjs/Pattern.js +16 -12
- package/lib/cjs/Pattern.js.map +1 -1
- package/lib/cjs/Plot.js +29 -36
- package/lib/cjs/Plot.js.map +1 -1
- package/lib/cjs/Radar.js +281 -261
- package/lib/cjs/Radar.js.map +1 -1
- package/lib/cjs/RadialTree.js +169 -154
- package/lib/cjs/RadialTree.js.map +1 -1
- package/lib/cjs/Reference.js +45 -51
- package/lib/cjs/Reference.js.map +1 -1
- package/lib/cjs/ResponsiveContainer.js +20 -25
- package/lib/cjs/ResponsiveContainer.js.map +1 -1
- package/lib/cjs/ScatterPlot.js +71 -61
- package/lib/cjs/ScatterPlot.js.map +1 -1
- package/lib/cjs/StackBar.js +20 -31
- package/lib/cjs/StackBar.js.map +1 -1
- package/lib/cjs/StackedArea.js +12 -16
- package/lib/cjs/StackedArea.js.map +1 -1
- package/lib/cjs/Tooltip.js +73 -73
- package/lib/cjs/Tooltip.js.map +1 -1
- package/lib/cjs/Venn.js +77 -52
- package/lib/cjs/Venn.js.map +1 -1
- package/lib/cjs/a11y/DataAccessibilityTable.js +2 -3
- package/lib/cjs/a11y/DataAccessibilityTable.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yModule.js +43 -86
- package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yView.js +44 -19
- package/lib/cjs/a11y/PlotA11yView.js.map +1 -1
- package/lib/cjs/a11y/bezier.js +1 -2
- package/lib/cjs/a11y/bezier.js.map +1 -1
- package/lib/cjs/a11y/focus.js +5 -6
- package/lib/cjs/a11y/focus.js.map +1 -1
- package/lib/cjs/a11y/hints.js +6 -9
- package/lib/cjs/a11y/hints.js.map +1 -1
- package/lib/cjs/a11y/insights.js +63 -64
- package/lib/cjs/a11y/insights.js.map +1 -1
- package/lib/cjs/a11y/intl.js +1 -2
- package/lib/cjs/a11y/intl.js.map +1 -1
- package/lib/cjs/a11y/locale.js +5 -5
- package/lib/cjs/a11y/locale.js.map +1 -1
- package/lib/cjs/a11y/serialize.js +15 -17
- package/lib/cjs/a11y/serialize.js.map +1 -1
- package/lib/cjs/a11y/summarize.js +1 -2
- package/lib/cjs/a11y/summarize.js.map +1 -1
- package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js +4 -5
- 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 +4 -5
- package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/color.js +2 -3
- package/lib/cjs/color.js.map +1 -1
- package/lib/cjs/component/Chart/AbstractChart.js +157 -83
- 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 +24 -51
- 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 +85 -69
- 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 +31 -27
- 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 +340 -147
- package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.js +11 -15
- 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 +16 -22
- 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 +16 -44
- 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 +22 -48
- 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 +15 -19
- 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 +16 -21
- 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 +16 -19
- 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 +7 -8
- package/lib/cjs/component/Chart/index.js.map +1 -1
- package/lib/cjs/component/ChartLegend/BaseLegend.js +45 -23
- 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 +19 -24
- 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 +108 -83
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js +1 -2
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/legend-item.shadow.css +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +18 -23
- 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 +1 -2
- package/lib/cjs/component/ChartLegend/index.js.map +1 -1
- package/lib/cjs/component/Cigarette/Cigarette.js +16 -20
- package/lib/cjs/component/Cigarette/Cigarette.js.map +1 -1
- package/lib/cjs/component/StackGroupBar/StackGroupBar.js +19 -24
- package/lib/cjs/component/StackGroupBar/StackGroupBar.js.map +1 -1
- package/lib/cjs/component/StackGroupBar/StackGroupBar.type.js.map +1 -1
- package/lib/cjs/component/SvgElement.js +21 -0
- package/lib/cjs/component/SvgElement.js.map +1 -0
- package/lib/cjs/createElement.d.js.map +1 -1
- package/lib/cjs/createElement.js +10 -12
- package/lib/cjs/createElement.js.map +1 -1
- package/lib/cjs/index.js +9 -2
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/abstract-chart.shadow.css +12 -0
- package/lib/cjs/style/area.shadow.css +3 -3
- package/lib/cjs/style/axis.shadow.css +43 -5
- package/lib/cjs/style/bar.shadow.css +6 -6
- package/lib/cjs/style/bubble.shadow.css +12 -4
- package/lib/cjs/style/donut.shadow.css +3 -3
- package/lib/cjs/style/dot.shadow.css +2 -2
- package/lib/cjs/style/hover.shadow.css +4 -4
- package/lib/cjs/style/line.shadow.css +3 -3
- package/lib/cjs/style/plot.shadow.css +8 -6
- package/lib/cjs/style/plotA11yModule.shadow.css +10 -11
- package/lib/cjs/style/plotA11yView.shadow.css +16 -29
- package/lib/cjs/style/radar.shadow.css +8 -8
- package/lib/cjs/style/radial-tree.shadow.css +3 -3
- package/lib/cjs/style/reference.shadow.css +4 -4
- package/lib/cjs/style/scatterplot.shadow.css +2 -2
- package/lib/cjs/style/tooltip.shadow.css +5 -5
- package/lib/cjs/style/venn.shadow.css +3 -3
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +4 -5
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/translations/de.json +1 -0
- package/lib/cjs/translations/es.json +1 -0
- package/lib/cjs/translations/fr.json +1 -0
- package/lib/cjs/translations/it.json +1 -0
- package/lib/cjs/translations/ja.json +1 -0
- package/lib/cjs/translations/ko.json +1 -0
- package/lib/cjs/translations/nl.json +1 -0
- package/lib/cjs/translations/pl.json +1 -0
- package/lib/cjs/translations/pt.json +1 -0
- package/lib/cjs/translations/sv.json +1 -0
- package/lib/cjs/translations/tr.json +2 -1
- package/lib/cjs/translations/vi.json +1 -0
- package/lib/cjs/translations/zh.json +1 -0
- package/lib/cjs/types/Area.d.js.map +1 -1
- package/lib/cjs/types/Axis.d.js.map +1 -1
- package/lib/cjs/types/Bar.d.js.map +1 -1
- package/lib/cjs/types/Bubble.d.js.map +1 -1
- package/lib/cjs/types/ClipPath.d.js.map +1 -1
- package/lib/cjs/types/CompactHorizontalBar.d.js.map +1 -1
- package/lib/cjs/types/Donut.d.js.map +1 -1
- package/lib/cjs/types/GroupBar.d.js.map +1 -1
- package/lib/cjs/types/HorizontalBar.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/Reference.d.js.map +1 -1
- package/lib/cjs/types/ResponsiveContainer.d.js.map +1 -1
- package/lib/cjs/types/ScatterPlot.d.js.map +1 -1
- package/lib/cjs/types/StackBar.d.js.map +1 -1
- package/lib/cjs/types/StackedArea.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/context.d.js.map +1 -1
- package/lib/cjs/types/index.d.js +14 -2
- package/lib/cjs/types/index.d.js.map +1 -1
- package/lib/cjs/utils.js +36 -55
- package/lib/cjs/utils.js.map +1 -1
- package/lib/es6/AnimatedClipPath.js +9 -11
- package/lib/es6/AnimatedClipPath.js.map +1 -1
- package/lib/es6/Area.js +70 -45
- package/lib/es6/Area.js.map +1 -1
- package/lib/es6/Axis.js +168 -104
- package/lib/es6/Axis.js.map +1 -1
- package/lib/es6/Bar.js +27 -29
- package/lib/es6/Bar.js.map +1 -1
- package/lib/es6/Bubble.js +211 -135
- package/lib/es6/Bubble.js.map +1 -1
- package/lib/es6/CompactHorizontalBar.js +89 -77
- package/lib/es6/CompactHorizontalBar.js.map +1 -1
- package/lib/es6/Donut.js +154 -137
- package/lib/es6/Donut.js.map +1 -1
- package/lib/es6/Dots.js +55 -36
- package/lib/es6/Dots.js.map +1 -1
- package/lib/es6/GroupBar.js +13 -15
- package/lib/es6/GroupBar.js.map +1 -1
- package/lib/es6/HorizontalBar.js +27 -29
- package/lib/es6/HorizontalBar.js.map +1 -1
- package/lib/es6/Hover.js +51 -41
- package/lib/es6/Hover.js.map +1 -1
- package/lib/es6/Line.js +61 -37
- package/lib/es6/Line.js.map +1 -1
- package/lib/es6/Pattern.js +7 -3
- package/lib/es6/Pattern.js.map +1 -1
- package/lib/es6/Plot.js +28 -32
- package/lib/es6/Plot.js.map +1 -1
- package/lib/es6/Radar.js +279 -257
- package/lib/es6/Radar.js.map +1 -1
- package/lib/es6/RadialTree.js +168 -151
- package/lib/es6/RadialTree.js.map +1 -1
- package/lib/es6/Reference.js +43 -45
- package/lib/es6/Reference.js.map +1 -1
- package/lib/es6/ResponsiveContainer.js +16 -19
- package/lib/es6/ResponsiveContainer.js.map +1 -1
- package/lib/es6/ScatterPlot.js +71 -59
- package/lib/es6/ScatterPlot.js.map +1 -1
- package/lib/es6/StackBar.js +17 -27
- package/lib/es6/StackBar.js.map +1 -1
- package/lib/es6/StackedArea.js +10 -13
- package/lib/es6/StackedArea.js.map +1 -1
- package/lib/es6/Tooltip.js +68 -65
- package/lib/es6/Tooltip.js.map +1 -1
- package/lib/es6/Venn.js +75 -48
- package/lib/es6/Venn.js.map +1 -1
- package/lib/es6/a11y/DataAccessibilityTable.js.map +1 -1
- package/lib/es6/a11y/PlotA11yModule.js +43 -86
- package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
- package/lib/es6/a11y/PlotA11yView.js +43 -16
- package/lib/es6/a11y/PlotA11yView.js.map +1 -1
- package/lib/es6/a11y/bezier.js.map +1 -1
- package/lib/es6/a11y/focus.js +4 -4
- package/lib/es6/a11y/focus.js.map +1 -1
- package/lib/es6/a11y/hints.js +2 -2
- package/lib/es6/a11y/hints.js.map +1 -1
- package/lib/es6/a11y/insights.js +61 -61
- package/lib/es6/a11y/insights.js.map +1 -1
- package/lib/es6/a11y/intl.js.map +1 -1
- package/lib/es6/a11y/locale.js +3 -2
- package/lib/es6/a11y/locale.js.map +1 -1
- package/lib/es6/a11y/serialize.js +14 -13
- package/lib/es6/a11y/serialize.js.map +1 -1
- package/lib/es6/a11y/summarize.js.map +1 -1
- package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js +2 -2
- 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 +2 -2
- 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 +159 -80
- 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 +23 -48
- 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 +84 -67
- 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 +30 -24
- 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 +341 -144
- package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/es6/component/Chart/CigaretteChart.type.js.map +1 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.js +9 -12
- 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 +14 -18
- 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 +15 -41
- 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 +20 -45
- 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 +13 -16
- 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 +15 -18
- 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 +14 -16
- 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/Chart/index.js +6 -6
- package/lib/es6/component/Chart/index.js.map +1 -1
- package/lib/es6/component/ChartLegend/BaseLegend.js +43 -20
- 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 +17 -19
- 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 +102 -74
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/legend-item.shadow.css +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +15 -17
- 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/ChartLegend/index.js.map +1 -1
- package/lib/es6/component/Cigarette/Cigarette.js +14 -17
- package/lib/es6/component/Cigarette/Cigarette.js.map +1 -1
- package/lib/es6/component/StackGroupBar/StackGroupBar.js +17 -21
- package/lib/es6/component/StackGroupBar/StackGroupBar.js.map +1 -1
- package/lib/es6/component/StackGroupBar/StackGroupBar.type.js.map +1 -1
- package/lib/es6/component/SvgElement.js +14 -0
- package/lib/es6/component/SvgElement.js.map +1 -0
- package/lib/es6/createElement.d.js.map +1 -1
- package/lib/es6/createElement.js +7 -7
- package/lib/es6/createElement.js.map +1 -1
- package/lib/es6/index.js +1 -0
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/abstract-chart.shadow.css +12 -0
- package/lib/es6/style/area.shadow.css +3 -3
- package/lib/es6/style/axis.shadow.css +43 -5
- package/lib/es6/style/bar.shadow.css +6 -6
- package/lib/es6/style/bubble.shadow.css +12 -4
- package/lib/es6/style/donut.shadow.css +3 -3
- package/lib/es6/style/dot.shadow.css +2 -2
- package/lib/es6/style/hover.shadow.css +4 -4
- package/lib/es6/style/line.shadow.css +3 -3
- package/lib/es6/style/plot.shadow.css +8 -6
- package/lib/es6/style/plotA11yModule.shadow.css +10 -11
- package/lib/es6/style/plotA11yView.shadow.css +16 -29
- package/lib/es6/style/radar.shadow.css +8 -8
- package/lib/es6/style/radial-tree.shadow.css +3 -3
- package/lib/es6/style/reference.shadow.css +4 -4
- package/lib/es6/style/scatterplot.shadow.css +2 -2
- package/lib/es6/style/tooltip.shadow.css +5 -5
- package/lib/es6/style/venn.shadow.css +3 -3
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -2
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/translations/de.json +1 -0
- package/lib/es6/translations/es.json +1 -0
- package/lib/es6/translations/fr.json +1 -0
- package/lib/es6/translations/it.json +1 -0
- package/lib/es6/translations/ja.json +1 -0
- package/lib/es6/translations/ko.json +1 -0
- package/lib/es6/translations/nl.json +1 -0
- package/lib/es6/translations/pl.json +1 -0
- package/lib/es6/translations/pt.json +1 -0
- package/lib/es6/translations/sv.json +1 -0
- package/lib/es6/translations/tr.json +2 -1
- package/lib/es6/translations/vi.json +1 -0
- package/lib/es6/translations/zh.json +1 -0
- package/lib/es6/types/Area.d.js.map +1 -1
- package/lib/es6/types/Axis.d.js.map +1 -1
- package/lib/es6/types/Bar.d.js.map +1 -1
- package/lib/es6/types/Bubble.d.js.map +1 -1
- package/lib/es6/types/ClipPath.d.js.map +1 -1
- package/lib/es6/types/CompactHorizontalBar.d.js.map +1 -1
- package/lib/es6/types/Donut.d.js.map +1 -1
- package/lib/es6/types/GroupBar.d.js.map +1 -1
- package/lib/es6/types/HorizontalBar.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/Reference.d.js.map +1 -1
- package/lib/es6/types/ResponsiveContainer.d.js.map +1 -1
- package/lib/es6/types/ScatterPlot.d.js.map +1 -1
- package/lib/es6/types/StackBar.d.js.map +1 -1
- package/lib/es6/types/StackedArea.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/types/context.d.js.map +1 -1
- package/lib/es6/types/index.d.js +2 -0
- package/lib/es6/types/index.d.js.map +1 -1
- package/lib/es6/utils.js +16 -16
- package/lib/es6/utils.js.map +1 -1
- package/lib/esm/AnimatedClipPath.mjs +9 -16
- package/lib/esm/Area.mjs +51 -36
- package/lib/esm/Axis.mjs +143 -86
- package/lib/esm/Bar.mjs +31 -34
- package/lib/esm/Bubble.mjs +154 -106
- package/lib/esm/CompactHorizontalBar.mjs +88 -80
- package/lib/esm/Donut.mjs +87 -75
- package/lib/esm/Dots.mjs +50 -34
- package/lib/esm/GroupBar.mjs +12 -14
- package/lib/esm/HorizontalBar.mjs +31 -34
- package/lib/esm/Hover.mjs +53 -50
- package/lib/esm/Line.mjs +45 -31
- package/lib/esm/Pattern.mjs +4 -2
- package/lib/esm/Plot.mjs +30 -35
- package/lib/esm/Radar.mjs +188 -175
- package/lib/esm/RadialTree.mjs +105 -111
- package/lib/esm/Reference.mjs +37 -40
- package/lib/esm/ResponsiveContainer.mjs +18 -21
- package/lib/esm/ScatterPlot.mjs +49 -40
- package/lib/esm/StackBar.mjs +18 -28
- package/lib/esm/StackedArea.mjs +13 -16
- package/lib/esm/Tooltip.mjs +56 -59
- package/lib/esm/Venn.mjs +67 -47
- package/lib/esm/a11y/DataAccessibilityTable.mjs +2 -2
- package/lib/esm/a11y/PlotA11yModule.mjs +35 -74
- package/lib/esm/a11y/PlotA11yView.mjs +41 -17
- package/lib/esm/a11y/focus.mjs +4 -4
- package/lib/esm/a11y/hints.mjs +2 -2
- package/lib/esm/a11y/insights.mjs +76 -76
- package/lib/esm/a11y/locale.mjs +2 -2
- package/lib/esm/a11y/serialize.mjs +12 -12
- package/lib/esm/a11y/translations/module/__intergalactic-dynamic-locales.mjs +2 -2
- 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 +2 -2
- package/lib/esm/component/Chart/AbstractChart.mjs +141 -65
- package/lib/esm/component/Chart/AreaChart.mjs +27 -51
- package/lib/esm/component/Chart/BarChart.mjs +64 -51
- package/lib/esm/component/Chart/BubbleChart.mjs +30 -25
- package/lib/esm/component/Chart/CigaretteChart.mjs +298 -119
- package/lib/esm/component/Chart/CompactHorizontalBarChart.mjs +13 -15
- package/lib/esm/component/Chart/DonutChart.mjs +16 -19
- package/lib/esm/component/Chart/HistogramChart.mjs +22 -46
- package/lib/esm/component/Chart/LineChart.mjs +23 -46
- package/lib/esm/component/Chart/RadarChart.mjs +16 -18
- package/lib/esm/component/Chart/ScatterPlotChart.mjs +18 -21
- package/lib/esm/component/Chart/VennChart.mjs +16 -19
- package/lib/esm/component/Chart/index.mjs +6 -6
- package/lib/esm/component/ChartLegend/BaseLegend.mjs +45 -22
- package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +19 -22
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +88 -75
- package/lib/esm/component/ChartLegend/LegendItem/legend-item.shadow.css +1 -1
- package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +22 -25
- package/lib/esm/component/ChartLegend/index.mjs +2 -0
- package/lib/esm/component/Cigarette/Cigarette.mjs +16 -19
- package/lib/esm/component/StackGroupBar/StackGroupBar.mjs +18 -22
- package/lib/esm/component/SvgElement.mjs +14 -0
- package/lib/esm/createElement.mjs +8 -10
- package/lib/esm/index.mjs +3 -0
- package/lib/esm/style/abstract-chart.shadow.css +12 -0
- package/lib/esm/style/area.shadow.css +3 -3
- package/lib/esm/style/axis.shadow.css +43 -5
- package/lib/esm/style/bar.shadow.css +6 -6
- package/lib/esm/style/bubble.shadow.css +12 -4
- package/lib/esm/style/donut.shadow.css +3 -3
- package/lib/esm/style/dot.shadow.css +2 -2
- package/lib/esm/style/hover.shadow.css +4 -4
- package/lib/esm/style/line.shadow.css +3 -3
- package/lib/esm/style/plot.shadow.css +8 -6
- package/lib/esm/style/plotA11yModule.shadow.css +10 -11
- package/lib/esm/style/plotA11yView.shadow.css +16 -29
- package/lib/esm/style/radar.shadow.css +8 -8
- package/lib/esm/style/radial-tree.shadow.css +3 -3
- package/lib/esm/style/reference.shadow.css +4 -4
- package/lib/esm/style/scatterplot.shadow.css +2 -2
- package/lib/esm/style/tooltip.shadow.css +5 -5
- package/lib/esm/style/venn.shadow.css +3 -3
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
- package/lib/esm/translations/es.json.mjs +1 -0
- package/lib/esm/translations/fr.json.mjs +1 -0
- package/lib/esm/translations/it.json.mjs +1 -0
- package/lib/esm/translations/ja.json.mjs +1 -0
- package/lib/esm/translations/ko.json.mjs +1 -0
- package/lib/esm/translations/nl.json.mjs +1 -0
- package/lib/esm/translations/pl.json.mjs +1 -0
- package/lib/esm/translations/pt.json.mjs +1 -0
- package/lib/esm/translations/sv.json.mjs +1 -0
- package/lib/esm/translations/tr.json.mjs +2 -1
- package/lib/esm/translations/vi.json.mjs +1 -0
- package/lib/esm/translations/zh.json.mjs +1 -0
- package/lib/esm/utils.mjs +11 -11
- package/lib/types/Area.d.ts +9 -6
- package/lib/types/Axis.d.ts +10 -3
- package/lib/types/Bar.d.ts +7 -6
- package/lib/types/Bubble.d.ts +21 -5
- package/lib/types/ClipPath.d.ts +4 -3
- package/lib/types/CompactHorizontalBar.d.ts +7 -8
- package/lib/types/Donut.d.ts +8 -5
- package/lib/types/GroupBar.d.ts +6 -6
- package/lib/types/HorizontalBar.d.ts +7 -6
- package/lib/types/Hover.d.ts +8 -8
- package/lib/types/Line.d.ts +9 -6
- package/lib/types/Pattern.d.ts +51 -51
- package/lib/types/Plot.d.ts +11 -9
- package/lib/types/Radar.d.ts +10 -7
- package/lib/types/RadialTree.d.ts +10 -54
- package/lib/types/Reference.d.ts +6 -5
- package/lib/types/ResponsiveContainer.d.ts +5 -4
- package/lib/types/ScatterPlot.d.ts +8 -5
- package/lib/types/StackBar.d.ts +7 -6
- package/lib/types/StackedArea.d.ts +6 -5
- package/lib/types/Tooltip.d.ts +12 -12
- package/lib/types/Venn.d.ts +7 -6
- package/lib/types/a11y/DataAccessibilityTable.d.ts +2 -2
- package/lib/types/a11y/PlotA11yModule.d.ts +4 -11
- package/lib/types/a11y/PlotA11yView.d.ts +13 -2
- package/lib/types/a11y/hints.d.ts +5 -5
- package/lib/types/a11y/insights.d.ts +1 -1
- package/lib/types/a11y/intl.d.ts +1 -1
- package/lib/types/a11y/serialize.d.ts +7 -7
- package/lib/types/a11y/summarize.d.ts +2 -2
- package/lib/types/a11y/translations/module/__intergalactic-dynamic-locales.d.ts +14 -14
- package/lib/types/component/Chart/AbstractChart.d.ts +20 -13
- package/lib/types/component/Chart/AbstractChart.type.d.ts +39 -25
- package/lib/types/component/Chart/AreaChart.d.ts +1 -1
- package/lib/types/component/Chart/AreaChart.type.d.ts +17 -7
- package/lib/types/component/Chart/BarChart.d.ts +1 -1
- package/lib/types/component/Chart/BarChart.type.d.ts +14 -9
- package/lib/types/component/Chart/BubbleChart.d.ts +1 -1
- package/lib/types/component/Chart/BubbleChart.type.d.ts +10 -5
- package/lib/types/component/Chart/CigaretteChart.d.ts +1 -1
- package/lib/types/component/Chart/CigaretteChart.type.d.ts +18 -8
- package/lib/types/component/Chart/CompactHorizontalBarChart.d.ts +1 -1
- package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +10 -6
- package/lib/types/component/Chart/DonutChart.d.ts +1 -1
- package/lib/types/component/Chart/DonutChart.type.d.ts +16 -7
- package/lib/types/component/Chart/HistogramChart.d.ts +1 -1
- package/lib/types/component/Chart/HistogramChart.type.d.ts +7 -4
- package/lib/types/component/Chart/LineChart.d.ts +1 -1
- package/lib/types/component/Chart/LineChart.type.d.ts +16 -7
- package/lib/types/component/Chart/RadarChart.d.ts +1 -1
- package/lib/types/component/Chart/RadarChart.type.d.ts +7 -5
- package/lib/types/component/Chart/ScatterPlotChart.d.ts +1 -1
- package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +12 -6
- package/lib/types/component/Chart/VennChart.d.ts +1 -1
- package/lib/types/component/Chart/VennChart.type.d.ts +12 -6
- package/lib/types/component/ChartLegend/BaseLegend.d.ts +8 -6
- package/lib/types/component/ChartLegend/BaseLegend.type.d.ts +4 -5
- package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.type.d.ts +4 -5
- package/lib/types/component/ChartLegend/LegendItem/LegendItem.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts +17 -10
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts +5 -5
- package/lib/types/component/StackGroupBar/StackGroupBar.d.ts +1 -1
- package/lib/types/component/StackGroupBar/StackGroupBar.type.d.ts +3 -4
- package/lib/types/component/SvgElement.d.ts +10 -0
- package/lib/types/index.d.ts +3 -1
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +12 -0
- package/lib/types/utils.d.ts +17 -17
- package/package.json +10 -10
package/lib/es6/Radar.js
CHANGED
|
@@ -1,49 +1,48 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import
|
|
4
|
+
import _callSuper from "@babel/runtime/helpers/callSuper";
|
|
5
5
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
-
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
7
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
7
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
9
8
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
10
|
-
import { sstyled as _sstyled } from "@semcore/
|
|
9
|
+
import { sstyled as _sstyled } from "@semcore/core";
|
|
11
10
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
12
|
-
import React, { cloneElement } from 'react';
|
|
13
11
|
import { Component, sstyled, Root } from '@semcore/core';
|
|
14
|
-
import
|
|
15
|
-
import getOriginChildren from '@semcore/
|
|
16
|
-
import trottle from '@semcore/
|
|
17
|
-
import
|
|
12
|
+
import canUseDOM from '@semcore/core/lib/utils/canUseDOM';
|
|
13
|
+
import getOriginChildren from '@semcore/core/lib/utils/getOriginChildren';
|
|
14
|
+
import trottle from '@semcore/core/lib/utils/rafTrottle';
|
|
15
|
+
import uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';
|
|
18
16
|
import { polygonContains } from 'd3-polygon';
|
|
19
17
|
import { line, lineRadial, curveLinearClosed, arc } from 'd3-shape';
|
|
18
|
+
import React, { cloneElement } from 'react';
|
|
20
19
|
import createElement from './createElement';
|
|
21
|
-
import { eventToPoint, getChartDefaultColorName, measureText } from './utils';
|
|
22
|
-
import Tooltip from './Tooltip';
|
|
23
20
|
import { PatternFill, PatternSymbol, getPatternSymbolSize } from './Pattern';
|
|
24
21
|
/*!__reshadow-styles__:"./style/radar.shadow.css"*/
|
|
25
|
-
var style = (
|
|
22
|
+
var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SAxisLine_49jzl_gg_,.___SAxisTick_49jzl_gg_,.___SAxis_49jzl_gg_{stroke:var(--intergalactic-chart-grid-line, rgb(237, 239, 238));stroke-width:1;fill:transparent}.___SAxisLine_49jzl_gg_,.___SAxisTick_49jzl_gg_{stroke-dasharray:2}.___SAxisLine_49jzl_gg_.__active_49jzl_gg_{stroke:var(--intergalactic-chart-grid-y-accent-hover-line, rgb(214, 216, 215))}.___SAxisLabel_49jzl_gg_{text-anchor:middle;dominant-baseline:central;font-size:12px}.___SAxisLabel_49jzl_gg_.__xDirection_49jzl_gg_{text-anchor:var(--xDirection_49jzl)}.___SAxisLabel_49jzl_gg_.__yDirection_49jzl_gg_{dominant-baseline:var(--yDirection_49jzl)}.___SPolygonDot_49jzl_gg_,.___SPolygon_49jzl_gg_{fill:var(--intergalactic-chart-palette-order-1, rgb(104, 109, 210))}.___SPolygon_49jzl_gg_{opacity:.2}.___SPolygon_49jzl_gg_.__color_49jzl_gg_{fill:var(--color_49jzl)}.___SPolygon_49jzl_gg_.__pattern_49jzl_gg_.__color_49jzl_gg_{fill:var(--pattern_49jzl);stroke:var(--color_49jzl);stroke-width:1px}.___SPolygonDot_49jzl_gg_{stroke-width:2px;stroke:var(--intergalactic-chart-grid-border, #fff);r:6px}.___SPolygonDot_49jzl_gg_.__transparent_49jzl_gg_{opacity:.3}.___SPolygonDot_49jzl_gg_.__color_49jzl_gg_{fill:var(--color_49jzl)}.___SPolygonLine_49jzl_gg_{stroke:var(--intergalactic-chart-palette-order-1, rgb(104, 109, 210));stroke-width:3;fill:transparent}.___SPolygonLine_49jzl_gg_.__transparent_49jzl_gg_{opacity:.3}.___SPolygonLine_49jzl_gg_.__color_49jzl_gg_{stroke:var(--color_49jzl)}.___SPieRect_49jzl_gg_{outline:0;fill:var(--intergalactic-chart-grid-bar-chart-hover, rgba(0, 22, 16, 0.028))}", /*__inner_css_end__*/"49jzl_gg_"),
|
|
26
23
|
/*__reshadow_css_end__*/
|
|
27
24
|
{
|
|
28
|
-
"__SAxis": "
|
|
29
|
-
"__SAxisLine": "
|
|
30
|
-
"__SAxisTick": "
|
|
31
|
-
"_active": "
|
|
32
|
-
"__SAxisLabel": "
|
|
33
|
-
"_xDirection": "
|
|
34
|
-
"--xDirection": "--
|
|
35
|
-
"_yDirection": "
|
|
36
|
-
"--yDirection": "--
|
|
37
|
-
"__SPolygon": "
|
|
38
|
-
"_color": "
|
|
39
|
-
"--color": "--
|
|
40
|
-
"_pattern": "
|
|
41
|
-
"--pattern": "--
|
|
42
|
-
"__SPolygonDot": "
|
|
43
|
-
"_transparent": "
|
|
44
|
-
"__SPolygonLine": "
|
|
45
|
-
"__SPieRect": "
|
|
25
|
+
"__SAxis": "___SAxis_49jzl_gg_",
|
|
26
|
+
"__SAxisLine": "___SAxisLine_49jzl_gg_",
|
|
27
|
+
"__SAxisTick": "___SAxisTick_49jzl_gg_",
|
|
28
|
+
"_active": "__active_49jzl_gg_",
|
|
29
|
+
"__SAxisLabel": "___SAxisLabel_49jzl_gg_",
|
|
30
|
+
"_xDirection": "__xDirection_49jzl_gg_",
|
|
31
|
+
"--xDirection": "--xDirection_49jzl",
|
|
32
|
+
"_yDirection": "__yDirection_49jzl_gg_",
|
|
33
|
+
"--yDirection": "--yDirection_49jzl",
|
|
34
|
+
"__SPolygon": "___SPolygon_49jzl_gg_",
|
|
35
|
+
"_color": "__color_49jzl_gg_",
|
|
36
|
+
"--color": "--color_49jzl",
|
|
37
|
+
"_pattern": "__pattern_49jzl_gg_",
|
|
38
|
+
"--pattern": "--pattern_49jzl",
|
|
39
|
+
"__SPolygonDot": "___SPolygonDot_49jzl_gg_",
|
|
40
|
+
"_transparent": "__transparent_49jzl_gg_",
|
|
41
|
+
"__SPolygonLine": "___SPolygonLine_49jzl_gg_",
|
|
42
|
+
"__SPieRect": "___SPieRect_49jzl_gg_"
|
|
46
43
|
});
|
|
44
|
+
import Tooltip from './Tooltip';
|
|
45
|
+
import { eventToPoint, getChartDefaultColorName, measureText } from './utils';
|
|
47
46
|
var clampAngle = function clampAngle(angle) {
|
|
48
47
|
angle = angle % (2 * Math.PI);
|
|
49
48
|
if (angle < 0) angle += 2 * Math.PI;
|
|
@@ -79,7 +78,7 @@ function computeTextWidth(texts, textSize) {
|
|
|
79
78
|
if (typeof text === 'string') {
|
|
80
79
|
return measureText(text, textSize);
|
|
81
80
|
}
|
|
82
|
-
if (
|
|
81
|
+
if (/*#__PURE__*/React.isValidElement(text)) {
|
|
83
82
|
var _text$props, _text$props2;
|
|
84
83
|
// @ts-ignore
|
|
85
84
|
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);
|
|
@@ -93,19 +92,19 @@ function getTicks(tickSize, radius) {
|
|
|
93
92
|
while (Math.trunc(radius / (tickSize / 2)) > ticks) {
|
|
94
93
|
ticks += 1;
|
|
95
94
|
}
|
|
96
|
-
return _toConsumableArray(Array(ticks).keys()).reduce(function (ticks,
|
|
95
|
+
return _toConsumableArray(Array(ticks).keys()).reduce(function (ticks, _t, i, total) {
|
|
97
96
|
if (i) ticks.push(i / total.length);
|
|
98
97
|
return ticks;
|
|
99
98
|
}, []);
|
|
100
99
|
}
|
|
101
|
-
function pieContains(
|
|
102
|
-
var
|
|
103
|
-
startAngle =
|
|
104
|
-
endAngle =
|
|
105
|
-
radius =
|
|
106
|
-
var
|
|
107
|
-
x =
|
|
108
|
-
y =
|
|
100
|
+
function pieContains(_ref11, _ref12) {
|
|
101
|
+
var _ref13 = _slicedToArray(_ref11, 3),
|
|
102
|
+
startAngle = _ref13[0],
|
|
103
|
+
endAngle = _ref13[1],
|
|
104
|
+
radius = _ref13[2];
|
|
105
|
+
var _ref14 = _slicedToArray(_ref12, 2),
|
|
106
|
+
x = _ref14[0],
|
|
107
|
+
y = _ref14[1];
|
|
109
108
|
var distance = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
|
|
110
109
|
if (distance > radius) return false;
|
|
111
110
|
startAngle = clampAngle(startAngle);
|
|
@@ -140,20 +139,19 @@ export function getLabelOffsetPosition(xDirection, yDirection, width, height) {
|
|
|
140
139
|
}
|
|
141
140
|
var MINIMUM_OFFSET = 5;
|
|
142
141
|
var RadarRoot = /*#__PURE__*/function (_Component) {
|
|
143
|
-
_inherits(RadarRoot, _Component);
|
|
144
|
-
var _super = _createSuper(RadarRoot);
|
|
145
142
|
function RadarRoot() {
|
|
146
143
|
var _this;
|
|
147
144
|
_classCallCheck(this, RadarRoot);
|
|
148
145
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
149
146
|
args[_key] = arguments[_key];
|
|
150
147
|
}
|
|
151
|
-
_this =
|
|
152
|
-
_defineProperty(
|
|
153
|
-
_defineProperty(
|
|
148
|
+
_this = _callSuper(this, RadarRoot, [].concat(args));
|
|
149
|
+
_defineProperty(_this, "computeOffset", 0);
|
|
150
|
+
_defineProperty(_this, "categoriesKey", null);
|
|
154
151
|
return _this;
|
|
155
152
|
}
|
|
156
|
-
|
|
153
|
+
_inherits(RadarRoot, _Component);
|
|
154
|
+
return _createClass(RadarRoot, [{
|
|
157
155
|
key: "id",
|
|
158
156
|
get: function get() {
|
|
159
157
|
var _this$asProps = this.asProps,
|
|
@@ -185,8 +183,8 @@ var RadarRoot = /*#__PURE__*/function (_Component) {
|
|
|
185
183
|
}
|
|
186
184
|
}, {
|
|
187
185
|
key: "getPolygonProps",
|
|
188
|
-
value: function getPolygonProps(
|
|
189
|
-
var dataKey =
|
|
186
|
+
value: function getPolygonProps(_ref15, index) {
|
|
187
|
+
var dataKey = _ref15.dataKey;
|
|
190
188
|
var _this$asProps2 = this.asProps,
|
|
191
189
|
data = _this$asProps2.data,
|
|
192
190
|
scale = _this$asProps2.scale,
|
|
@@ -210,27 +208,111 @@ var RadarRoot = /*#__PURE__*/function (_Component) {
|
|
|
210
208
|
type: this.asProps.type,
|
|
211
209
|
offset: this.offset,
|
|
212
210
|
categories: this.asProps.data[this.categoriesKey],
|
|
213
|
-
angleOffset: this.asProps.angleOffset
|
|
211
|
+
angleOffset: this.asProps.angleOffset,
|
|
212
|
+
getIndex: this.getIndex.bind(this),
|
|
213
|
+
getPolygon: this.getPolygon.bind(this),
|
|
214
|
+
getPie: this.getPie.bind(this)
|
|
214
215
|
};
|
|
215
216
|
}
|
|
217
|
+
}, {
|
|
218
|
+
key: "getIndex",
|
|
219
|
+
value: function getIndex(point) {
|
|
220
|
+
var _this2 = this;
|
|
221
|
+
var _this$asProps3 = this.asProps,
|
|
222
|
+
data = _this$asProps3.data,
|
|
223
|
+
type = _this$asProps3.type;
|
|
224
|
+
var categories = data[this.categoriesKey];
|
|
225
|
+
var index;
|
|
226
|
+
if (type === 'circle') {
|
|
227
|
+
index = categories.findIndex(function (_c, i) {
|
|
228
|
+
return pieContains(_this2.getPie(i), point);
|
|
229
|
+
});
|
|
230
|
+
} else {
|
|
231
|
+
index = categories.findIndex(function (_c, i) {
|
|
232
|
+
return polygonContains(_this2.getPolygon(i), point);
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
return index === -1 ? null : index;
|
|
236
|
+
}
|
|
237
|
+
}, {
|
|
238
|
+
key: "getPolygon",
|
|
239
|
+
value: function getPolygon(index) {
|
|
240
|
+
var _this$asProps4 = this.asProps,
|
|
241
|
+
data = _this$asProps4.data,
|
|
242
|
+
size = _this$asProps4.size,
|
|
243
|
+
angleOffset = _this$asProps4.angleOffset;
|
|
244
|
+
var offset = this.offset;
|
|
245
|
+
var categories = data[this.categoriesKey];
|
|
246
|
+
var total = categories.length;
|
|
247
|
+
var diam = Math.min(size[0], size[1]);
|
|
248
|
+
var radius = diam / 2 - offset;
|
|
249
|
+
var prevIndex = (index - 1 + total) % total;
|
|
250
|
+
var nextIndex = (index + 1 + total) % total;
|
|
251
|
+
var _getRadianPosition = getRadianPosition(prevIndex, radius, total, angleOffset),
|
|
252
|
+
_getRadianPosition2 = _slicedToArray(_getRadianPosition, 2),
|
|
253
|
+
prevX1 = _getRadianPosition2[0],
|
|
254
|
+
prevY1 = _getRadianPosition2[1];
|
|
255
|
+
var _getRadianPosition3 = getRadianPosition(index, radius, total, angleOffset),
|
|
256
|
+
_getRadianPosition4 = _slicedToArray(_getRadianPosition3, 2),
|
|
257
|
+
x = _getRadianPosition4[0],
|
|
258
|
+
y = _getRadianPosition4[1];
|
|
259
|
+
var _getRadianPosition5 = getRadianPosition(nextIndex, radius, total, angleOffset),
|
|
260
|
+
_getRadianPosition6 = _slicedToArray(_getRadianPosition5, 2),
|
|
261
|
+
nextX1 = _getRadianPosition6[0],
|
|
262
|
+
nextY1 = _getRadianPosition6[1];
|
|
263
|
+
return [[0, 0], [(prevX1 + x) / 2, (prevY1 + y) / 2], [x, y], [(nextX1 + x) / 2, (nextY1 + y) / 2]];
|
|
264
|
+
}
|
|
265
|
+
}, {
|
|
266
|
+
key: "getPie",
|
|
267
|
+
value: function getPie(index) {
|
|
268
|
+
var _this$asProps5 = this.asProps,
|
|
269
|
+
data = _this$asProps5.data,
|
|
270
|
+
size = _this$asProps5.size,
|
|
271
|
+
angleOffset = _this$asProps5.angleOffset;
|
|
272
|
+
var categories = data[this.categoriesKey];
|
|
273
|
+
var offset = this.offset;
|
|
274
|
+
var angle = Math.PI * 2 / categories.length;
|
|
275
|
+
var radius = Math.min(size[0], size[1]) / 2 - offset;
|
|
276
|
+
return [index * angle - angle / 2 - angleOffset, (index + 1) * angle - angle / 2 - angleOffset, radius];
|
|
277
|
+
}
|
|
278
|
+
}, {
|
|
279
|
+
key: "handlerOnClick",
|
|
280
|
+
value: function handlerOnClick(e) {
|
|
281
|
+
e.stopPropagation();
|
|
282
|
+
var _this$asProps6 = this.asProps,
|
|
283
|
+
rootRef = _this$asProps6.rootRef,
|
|
284
|
+
size = _this$asProps6.size,
|
|
285
|
+
onClick = _this$asProps6.onClick;
|
|
286
|
+
if (!onClick) return;
|
|
287
|
+
var _eventToPoint = eventToPoint(e, rootRef.current),
|
|
288
|
+
_eventToPoint2 = _slicedToArray(_eventToPoint, 2),
|
|
289
|
+
pointX = _eventToPoint2[0],
|
|
290
|
+
pointY = _eventToPoint2[1];
|
|
291
|
+
var r = Math.min(size[0], size[1]) / 2;
|
|
292
|
+
var centerX = pointX - r;
|
|
293
|
+
var centerY = pointY - r;
|
|
294
|
+
var index = this.getIndex([centerX, centerY]);
|
|
295
|
+
if (index === null) return;
|
|
296
|
+
onClick(index, e);
|
|
297
|
+
}
|
|
216
298
|
}, {
|
|
217
299
|
key: "render",
|
|
218
300
|
value: function render() {
|
|
219
301
|
var _ref2;
|
|
220
302
|
var SRadar = this.Element;
|
|
221
|
-
var _this$
|
|
222
|
-
Children = _this$
|
|
223
|
-
styles = _this$
|
|
224
|
-
size = _this$
|
|
225
|
-
data = _this$
|
|
226
|
-
offset = _this$
|
|
303
|
+
var _this$asProps7 = this.asProps,
|
|
304
|
+
Children = _this$asProps7.Children,
|
|
305
|
+
styles = _this$asProps7.styles,
|
|
306
|
+
size = _this$asProps7.size,
|
|
307
|
+
data = _this$asProps7.data,
|
|
308
|
+
offset = _this$asProps7.offset;
|
|
227
309
|
var _size = _slicedToArray(size, 2),
|
|
228
310
|
width = _size[0],
|
|
229
311
|
height = _size[1];
|
|
230
312
|
this.asProps.dataHintsHandler.establishDataType('indexed-groups');
|
|
231
313
|
var dataKey;
|
|
232
314
|
React.Children.toArray(getOriginChildren(Children)).forEach(function (child) {
|
|
233
|
-
if (
|
|
315
|
+
if (/*#__PURE__*/React.isValidElement(child) && child.type === Radar.Axis) {
|
|
234
316
|
dataKey = child.props.dataKey;
|
|
235
317
|
}
|
|
236
318
|
});
|
|
@@ -246,11 +328,11 @@ var RadarRoot = /*#__PURE__*/function (_Component) {
|
|
|
246
328
|
"id": this.id,
|
|
247
329
|
"render": 'g',
|
|
248
330
|
"childrenPosition": 'inside',
|
|
249
|
-
"transform": "translate(".concat(width / 2, ",").concat(height / 2, ")")
|
|
331
|
+
"transform": "translate(".concat(width / 2, ",").concat(height / 2, ")"),
|
|
332
|
+
"onClickCapture": this.handlerOnClick.bind(this)
|
|
250
333
|
}));
|
|
251
334
|
}
|
|
252
335
|
}]);
|
|
253
|
-
return RadarRoot;
|
|
254
336
|
}(Component);
|
|
255
337
|
_defineProperty(RadarRoot, "displayName", 'Line');
|
|
256
338
|
_defineProperty(RadarRoot, "style", style);
|
|
@@ -260,25 +342,24 @@ _defineProperty(RadarRoot, "defaultProps", {
|
|
|
260
342
|
angleOffset: 0
|
|
261
343
|
});
|
|
262
344
|
var PolygonRoot = /*#__PURE__*/function (_Component2) {
|
|
263
|
-
_inherits(PolygonRoot, _Component2);
|
|
264
|
-
var _super2 = _createSuper(PolygonRoot);
|
|
265
345
|
function PolygonRoot() {
|
|
266
346
|
_classCallCheck(this, PolygonRoot);
|
|
267
|
-
return
|
|
347
|
+
return _callSuper(this, PolygonRoot, arguments);
|
|
268
348
|
}
|
|
269
|
-
|
|
349
|
+
_inherits(PolygonRoot, _Component2);
|
|
350
|
+
return _createClass(PolygonRoot, [{
|
|
270
351
|
key: "getDotsProps",
|
|
271
352
|
value: function getDotsProps() {
|
|
272
|
-
var _this$
|
|
273
|
-
data = _this$
|
|
274
|
-
scale = _this$
|
|
275
|
-
color = _this$
|
|
276
|
-
resolveColor = _this$
|
|
277
|
-
transparent = _this$
|
|
278
|
-
dataKey = _this$
|
|
279
|
-
dataHintsHandler = _this$
|
|
280
|
-
angleOffset = _this$
|
|
281
|
-
patterns = _this$
|
|
353
|
+
var _this$asProps8 = this.asProps,
|
|
354
|
+
data = _this$asProps8.data,
|
|
355
|
+
scale = _this$asProps8.scale,
|
|
356
|
+
color = _this$asProps8.color,
|
|
357
|
+
resolveColor = _this$asProps8.resolveColor,
|
|
358
|
+
transparent = _this$asProps8.transparent,
|
|
359
|
+
dataKey = _this$asProps8.dataKey,
|
|
360
|
+
dataHintsHandler = _this$asProps8.dataHintsHandler,
|
|
361
|
+
angleOffset = _this$asProps8.angleOffset,
|
|
362
|
+
patterns = _this$asProps8.patterns;
|
|
282
363
|
return {
|
|
283
364
|
data: data,
|
|
284
365
|
scale: scale,
|
|
@@ -294,12 +375,12 @@ var PolygonRoot = /*#__PURE__*/function (_Component2) {
|
|
|
294
375
|
}, {
|
|
295
376
|
key: "getLineProps",
|
|
296
377
|
value: function getLineProps() {
|
|
297
|
-
var _this$
|
|
298
|
-
d3 = _this$
|
|
299
|
-
data = _this$
|
|
300
|
-
color = _this$
|
|
301
|
-
resolveColor = _this$
|
|
302
|
-
transparent = _this$
|
|
378
|
+
var _this$asProps9 = this.asProps,
|
|
379
|
+
d3 = _this$asProps9.d3,
|
|
380
|
+
data = _this$asProps9.data,
|
|
381
|
+
color = _this$asProps9.color,
|
|
382
|
+
resolveColor = _this$asProps9.resolveColor,
|
|
383
|
+
transparent = _this$asProps9.transparent;
|
|
303
384
|
return {
|
|
304
385
|
data: data,
|
|
305
386
|
color: color,
|
|
@@ -312,16 +393,16 @@ var PolygonRoot = /*#__PURE__*/function (_Component2) {
|
|
|
312
393
|
key: "render",
|
|
313
394
|
value: function render() {
|
|
314
395
|
var _ref3;
|
|
315
|
-
var _this$
|
|
316
|
-
SPolygon = _this$
|
|
317
|
-
styles = _this$
|
|
318
|
-
d3 = _this$
|
|
319
|
-
data = _this$
|
|
320
|
-
color = _this$
|
|
321
|
-
resolveColor = _this$
|
|
322
|
-
fill = _this$
|
|
323
|
-
uid = _this$
|
|
324
|
-
patterns = _this$
|
|
396
|
+
var _this$asProps0 = this.asProps,
|
|
397
|
+
SPolygon = _this$asProps0.Element,
|
|
398
|
+
styles = _this$asProps0.styles,
|
|
399
|
+
d3 = _this$asProps0.d3,
|
|
400
|
+
data = _this$asProps0.data,
|
|
401
|
+
color = _this$asProps0.color,
|
|
402
|
+
resolveColor = _this$asProps0.resolveColor,
|
|
403
|
+
fill = _this$asProps0.fill,
|
|
404
|
+
uid = _this$asProps0.uid,
|
|
405
|
+
patterns = _this$asProps0.patterns;
|
|
325
406
|
return /*#__PURE__*/React.createElement(React.Fragment, null, (_ref3 = sstyled(styles), /*#__PURE__*/React.createElement(SPolygon, _ref3.cn("SPolygon", {
|
|
326
407
|
"render": 'path',
|
|
327
408
|
"d": d3(data),
|
|
@@ -335,22 +416,21 @@ var PolygonRoot = /*#__PURE__*/function (_Component2) {
|
|
|
335
416
|
})));
|
|
336
417
|
}
|
|
337
418
|
}]);
|
|
338
|
-
return PolygonRoot;
|
|
339
419
|
}(Component);
|
|
340
420
|
_defineProperty(PolygonRoot, "displayName", 'Polygon');
|
|
341
421
|
_defineProperty(PolygonRoot, "style", style);
|
|
342
|
-
_defineProperty(PolygonRoot, "defaultProps", function (
|
|
343
|
-
var scale =
|
|
344
|
-
|
|
345
|
-
curve =
|
|
346
|
-
size =
|
|
347
|
-
offset =
|
|
348
|
-
angleOffset =
|
|
422
|
+
_defineProperty(PolygonRoot, "defaultProps", function (_ref20) {
|
|
423
|
+
var scale = _ref20.scale,
|
|
424
|
+
_ref20$curve = _ref20.curve,
|
|
425
|
+
curve = _ref20$curve === void 0 ? curveLinearClosed : _ref20$curve,
|
|
426
|
+
size = _ref20.size,
|
|
427
|
+
offset = _ref20.offset,
|
|
428
|
+
angleOffset = _ref20.angleOffset;
|
|
349
429
|
scale.range([0, Math.min(size[0], size[1]) / 2 - offset]);
|
|
350
430
|
return {
|
|
351
431
|
d3: lineRadial().curve(curve).radius(function (d) {
|
|
352
432
|
return scale(d || 0);
|
|
353
|
-
}).angle(function (
|
|
433
|
+
}).angle(function (_d, i, data) {
|
|
354
434
|
return i / data.length * 2 * Math.PI - angleOffset;
|
|
355
435
|
})
|
|
356
436
|
};
|
|
@@ -387,10 +467,10 @@ function PolygonDots(props) {
|
|
|
387
467
|
if (value === null || value === undefined) return;
|
|
388
468
|
var radius = scale(value);
|
|
389
469
|
props.dataHintsHandler.describeGroupedValues(categoryKey, "".concat(categoryKey, ".").concat(i));
|
|
390
|
-
var
|
|
391
|
-
|
|
392
|
-
cx =
|
|
393
|
-
cy =
|
|
470
|
+
var _getRadianPosition7 = getRadianPosition(i, radius, data.length, angleOffset),
|
|
471
|
+
_getRadianPosition8 = _slicedToArray(_getRadianPosition7, 2),
|
|
472
|
+
cx = _getRadianPosition8[0],
|
|
473
|
+
cy = _getRadianPosition8[1];
|
|
394
474
|
if (!patterns) {
|
|
395
475
|
var _ref5;
|
|
396
476
|
return _ref5 = sstyled(styles), /*#__PURE__*/React.createElement(SPolygonDot, _ref5.cn("SPolygonDot", {
|
|
@@ -423,47 +503,46 @@ function PolygonDots(props) {
|
|
|
423
503
|
});
|
|
424
504
|
}
|
|
425
505
|
var AxisRoot = /*#__PURE__*/function (_Component3) {
|
|
426
|
-
_inherits(AxisRoot, _Component3);
|
|
427
|
-
var _super3 = _createSuper(AxisRoot);
|
|
428
506
|
function AxisRoot() {
|
|
429
|
-
var
|
|
507
|
+
var _this3;
|
|
430
508
|
_classCallCheck(this, AxisRoot);
|
|
431
509
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
432
510
|
args[_key2] = arguments[_key2];
|
|
433
511
|
}
|
|
434
|
-
|
|
435
|
-
_defineProperty(
|
|
436
|
-
_defineProperty(
|
|
512
|
+
_this3 = _callSuper(this, AxisRoot, [].concat(args));
|
|
513
|
+
_defineProperty(_this3, "unsubscribeTooltipVisible", null);
|
|
514
|
+
_defineProperty(_this3, "state", {
|
|
437
515
|
activeLineIndex: null
|
|
438
516
|
});
|
|
439
|
-
_defineProperty(
|
|
440
|
-
var index =
|
|
441
|
-
|
|
517
|
+
_defineProperty(_this3, "handleTooltipRenderingProps", function (_anchorProps, _ref16) {
|
|
518
|
+
var index = _ref16.index;
|
|
519
|
+
_this3.setState({
|
|
442
520
|
activeLineIndex: index
|
|
443
521
|
});
|
|
444
522
|
});
|
|
445
|
-
return
|
|
523
|
+
return _this3;
|
|
446
524
|
}
|
|
447
|
-
|
|
525
|
+
_inherits(AxisRoot, _Component3);
|
|
526
|
+
return _createClass(AxisRoot, [{
|
|
448
527
|
key: "createLineRadial",
|
|
449
528
|
value: function createLineRadial(radius, total) {
|
|
450
529
|
return lineRadial().curve(curveLinearClosed).radius(function () {
|
|
451
530
|
return radius;
|
|
452
|
-
}).angle(function (
|
|
531
|
+
}).angle(function (_d, i) {
|
|
453
532
|
return i / total * 2 * Math.PI;
|
|
454
533
|
});
|
|
455
534
|
}
|
|
456
535
|
}, {
|
|
457
536
|
key: "getTicksProps",
|
|
458
|
-
value: function getTicksProps(
|
|
459
|
-
var
|
|
460
|
-
tickSize =
|
|
461
|
-
var _this$
|
|
462
|
-
data = _this$
|
|
463
|
-
offset = _this$
|
|
464
|
-
categories = _this$
|
|
465
|
-
size = _this$
|
|
466
|
-
type = _this$
|
|
537
|
+
value: function getTicksProps(_ref17) {
|
|
538
|
+
var _ref17$tickSize = _ref17.tickSize,
|
|
539
|
+
tickSize = _ref17$tickSize === void 0 ? 100 : _ref17$tickSize;
|
|
540
|
+
var _this$asProps1 = this.asProps,
|
|
541
|
+
data = _this$asProps1.data,
|
|
542
|
+
offset = _this$asProps1.offset,
|
|
543
|
+
categories = _this$asProps1.categories,
|
|
544
|
+
size = _this$asProps1.size,
|
|
545
|
+
type = _this$asProps1.type;
|
|
467
546
|
var radius = Math.min(size[0], size[1]) / 2 - offset;
|
|
468
547
|
return {
|
|
469
548
|
type: type,
|
|
@@ -476,14 +555,14 @@ var AxisRoot = /*#__PURE__*/function (_Component3) {
|
|
|
476
555
|
}
|
|
477
556
|
}, {
|
|
478
557
|
key: "getLabelsProps",
|
|
479
|
-
value: function getLabelsProps(
|
|
480
|
-
var
|
|
481
|
-
labelOffset =
|
|
482
|
-
var _this$
|
|
483
|
-
offset = _this$
|
|
484
|
-
categories = _this$
|
|
485
|
-
textSize = _this$
|
|
486
|
-
angleOffset = _this$
|
|
558
|
+
value: function getLabelsProps(_ref18) {
|
|
559
|
+
var _ref18$labelOffset = _ref18.labelOffset,
|
|
560
|
+
labelOffset = _ref18$labelOffset === void 0 ? 10 : _ref18$labelOffset;
|
|
561
|
+
var _this$asProps10 = this.asProps,
|
|
562
|
+
offset = _this$asProps10.offset,
|
|
563
|
+
categories = _this$asProps10.categories,
|
|
564
|
+
textSize = _this$asProps10.textSize,
|
|
565
|
+
angleOffset = _this$asProps10.angleOffset;
|
|
487
566
|
return {
|
|
488
567
|
categories: categories,
|
|
489
568
|
textSize: textSize,
|
|
@@ -501,20 +580,20 @@ var AxisRoot = /*#__PURE__*/function (_Component3) {
|
|
|
501
580
|
key: "componentWillUnmount",
|
|
502
581
|
value: function componentWillUnmount() {
|
|
503
582
|
var _this$unsubscribeTool;
|
|
504
|
-
(_this$unsubscribeTool = this.unsubscribeTooltipVisible) === null || _this$unsubscribeTool === void 0
|
|
583
|
+
(_this$unsubscribeTool = this.unsubscribeTooltipVisible) === null || _this$unsubscribeTool === void 0 || _this$unsubscribeTool.call(this);
|
|
505
584
|
}
|
|
506
585
|
}, {
|
|
507
586
|
key: "render",
|
|
508
587
|
value: function render() {
|
|
509
588
|
var _ref7;
|
|
510
|
-
var _this$
|
|
511
|
-
SAxis = _this$
|
|
512
|
-
styles = _this$
|
|
513
|
-
categories = _this$
|
|
514
|
-
size = _this$
|
|
515
|
-
offset = _this$
|
|
516
|
-
type = _this$
|
|
517
|
-
angleOffset = _this$
|
|
589
|
+
var _this$asProps11 = this.asProps,
|
|
590
|
+
SAxis = _this$asProps11.Element,
|
|
591
|
+
styles = _this$asProps11.styles,
|
|
592
|
+
categories = _this$asProps11.categories,
|
|
593
|
+
size = _this$asProps11.size,
|
|
594
|
+
offset = _this$asProps11.offset,
|
|
595
|
+
type = _this$asProps11.type,
|
|
596
|
+
angleOffset = _this$asProps11.angleOffset;
|
|
518
597
|
var activeLineIndex = this.state.activeLineIndex;
|
|
519
598
|
var radius = Math.min(size[0], size[1]) / 2 - offset;
|
|
520
599
|
var total = categories.length;
|
|
@@ -526,11 +605,11 @@ var AxisRoot = /*#__PURE__*/function (_Component3) {
|
|
|
526
605
|
})) : /*#__PURE__*/React.createElement(SAxis, _ref7.cn("SAxis", {
|
|
527
606
|
"render": 'path',
|
|
528
607
|
"d": this.createLineRadial(radius, total)(categories)
|
|
529
|
-
})), categories.map(function (
|
|
530
|
-
var
|
|
531
|
-
|
|
532
|
-
x =
|
|
533
|
-
y =
|
|
608
|
+
})), categories.map(function (_category, i) {
|
|
609
|
+
var _getRadianPosition9 = getRadianPosition(i, radius, total, angleOffset),
|
|
610
|
+
_getRadianPosition0 = _slicedToArray(_getRadianPosition9, 2),
|
|
611
|
+
x = _getRadianPosition0[0],
|
|
612
|
+
y = _getRadianPosition0[1];
|
|
534
613
|
var _sstyled$cn = sstyled(styles).cn('SAxisLine', {
|
|
535
614
|
active: activeLineIndex === i
|
|
536
615
|
}),
|
|
@@ -546,13 +625,12 @@ var AxisRoot = /*#__PURE__*/function (_Component3) {
|
|
|
546
625
|
}));
|
|
547
626
|
}
|
|
548
627
|
}]);
|
|
549
|
-
return AxisRoot;
|
|
550
628
|
}(Component);
|
|
551
629
|
_defineProperty(AxisRoot, "displayName", 'Polygon');
|
|
552
630
|
_defineProperty(AxisRoot, "style", style);
|
|
553
|
-
_defineProperty(AxisRoot, "defaultProps", function (
|
|
554
|
-
var data =
|
|
555
|
-
dataKey =
|
|
631
|
+
_defineProperty(AxisRoot, "defaultProps", function (_ref21) {
|
|
632
|
+
var data = _ref21.data,
|
|
633
|
+
dataKey = _ref21.dataKey;
|
|
556
634
|
var categories = data[dataKey];
|
|
557
635
|
return {
|
|
558
636
|
categories: categories
|
|
@@ -596,10 +674,10 @@ function AxisLabels(props) {
|
|
|
596
674
|
angleOffset = props.angleOffset;
|
|
597
675
|
var radius = Math.min(size[0], size[1]) / 2 - offset;
|
|
598
676
|
return categories.map(function (category, i) {
|
|
599
|
-
var
|
|
600
|
-
|
|
601
|
-
x =
|
|
602
|
-
y =
|
|
677
|
+
var _getRadianPosition1 = getRadianPosition(i, radius, categories.length, angleOffset),
|
|
678
|
+
_getRadianPosition10 = _slicedToArray(_getRadianPosition1, 2),
|
|
679
|
+
x = _getRadianPosition10[0],
|
|
680
|
+
y = _getRadianPosition10[1];
|
|
603
681
|
var _getLabelPlacement = getLabelPlacement(i, categories.length, angleOffset),
|
|
604
682
|
_getLabelPlacement2 = _slicedToArray(_getLabelPlacement, 2),
|
|
605
683
|
xDirection = _getLabelPlacement2[0],
|
|
@@ -624,13 +702,13 @@ function AxisLabels(props) {
|
|
|
624
702
|
}, lineText);
|
|
625
703
|
}));
|
|
626
704
|
}
|
|
627
|
-
if (
|
|
705
|
+
if (/*#__PURE__*/React.isValidElement(category)) {
|
|
628
706
|
var _category$props;
|
|
629
|
-
var
|
|
630
|
-
|
|
631
|
-
width =
|
|
632
|
-
|
|
633
|
-
height =
|
|
707
|
+
var _ref19 = (_category$props = category === null || category === void 0 ? void 0 : category.props) !== null && _category$props !== void 0 ? _category$props : {},
|
|
708
|
+
_ref19$width = _ref19.width,
|
|
709
|
+
width = _ref19$width === void 0 ? 0 : _ref19$width,
|
|
710
|
+
_ref19$height = _ref19.height,
|
|
711
|
+
height = _ref19$height === void 0 ? 0 : _ref19$height;
|
|
634
712
|
var _getLabelOffsetPositi = getLabelOffsetPosition(xDirection, yDirection, width, height),
|
|
635
713
|
_getLabelOffsetPositi2 = _slicedToArray(_getLabelOffsetPositi, 2),
|
|
636
714
|
xOffset = _getLabelOffsetPositi2[0],
|
|
@@ -644,55 +722,56 @@ function AxisLabels(props) {
|
|
|
644
722
|
});
|
|
645
723
|
}
|
|
646
724
|
var Hover = /*#__PURE__*/function (_Component4) {
|
|
647
|
-
_inherits(Hover, _Component4);
|
|
648
|
-
var _super4 = _createSuper(Hover);
|
|
649
725
|
function Hover() {
|
|
650
|
-
var
|
|
726
|
+
var _this4;
|
|
651
727
|
_classCallCheck(this, Hover);
|
|
652
728
|
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
653
729
|
args[_key3] = arguments[_key3];
|
|
654
730
|
}
|
|
655
|
-
|
|
656
|
-
_defineProperty(
|
|
731
|
+
_this4 = _callSuper(this, Hover, [].concat(args));
|
|
732
|
+
_defineProperty(_this4, "state", {
|
|
657
733
|
index: null
|
|
658
734
|
});
|
|
659
|
-
_defineProperty(
|
|
660
|
-
_defineProperty(
|
|
661
|
-
_defineProperty(
|
|
662
|
-
_defineProperty(
|
|
663
|
-
var
|
|
664
|
-
eventEmitter =
|
|
665
|
-
size =
|
|
666
|
-
rootRef =
|
|
667
|
-
patterns =
|
|
735
|
+
_defineProperty(_this4, "virtualElement", canUseDOM() ? document.createElement('div') : {});
|
|
736
|
+
_defineProperty(_this4, "unsubscribeMouseMoveRoot", null);
|
|
737
|
+
_defineProperty(_this4, "unsubscribeMouseLeaveRoot", null);
|
|
738
|
+
_defineProperty(_this4, "handlerMouseMoveRoot", trottle(function (e) {
|
|
739
|
+
var _this4$asProps = _this4.asProps,
|
|
740
|
+
eventEmitter = _this4$asProps.eventEmitter,
|
|
741
|
+
size = _this4$asProps.size,
|
|
742
|
+
rootRef = _this4$asProps.rootRef,
|
|
743
|
+
patterns = _this4$asProps.patterns,
|
|
744
|
+
getIndex = _this4$asProps.getIndex,
|
|
745
|
+
plotId = _this4$asProps.plotId;
|
|
668
746
|
var point = eventToPoint(e, rootRef.current);
|
|
669
747
|
var diam = Math.min(size[0], size[1]);
|
|
670
748
|
var centerX = point[0] - diam / 2;
|
|
671
749
|
var centerY = point[1] - diam / 2;
|
|
672
750
|
var clientX = e.clientX,
|
|
673
751
|
clientY = e.clientY;
|
|
674
|
-
var index =
|
|
675
|
-
|
|
752
|
+
var index = getIndex([centerX, centerY]);
|
|
753
|
+
_this4.setState({
|
|
676
754
|
index: index
|
|
677
755
|
}, function () {
|
|
678
|
-
eventEmitter.emit(
|
|
679
|
-
eventEmitter.emit(
|
|
756
|
+
eventEmitter.emit("setTooltipPosition_".concat(plotId), clientX, clientY);
|
|
757
|
+
eventEmitter.emit("setTooltipRenderingProps_".concat(plotId), {}, {
|
|
680
758
|
index: index,
|
|
681
759
|
patterns: patterns
|
|
682
760
|
});
|
|
683
|
-
eventEmitter.emit(
|
|
761
|
+
eventEmitter.emit("setTooltipVisible_".concat(plotId), index !== null);
|
|
684
762
|
});
|
|
685
763
|
}));
|
|
686
|
-
_defineProperty(
|
|
687
|
-
|
|
764
|
+
_defineProperty(_this4, "handlerMouseLeaveRoot", trottle(function () {
|
|
765
|
+
_this4.setState({
|
|
688
766
|
index: null
|
|
689
767
|
}, function () {
|
|
690
|
-
|
|
768
|
+
_this4.asProps.eventEmitter.emit("setTooltipVisible_".concat(_this4.asProps.plotId), false);
|
|
691
769
|
});
|
|
692
770
|
}));
|
|
693
|
-
return
|
|
771
|
+
return _this4;
|
|
694
772
|
}
|
|
695
|
-
|
|
773
|
+
_inherits(Hover, _Component4);
|
|
774
|
+
return _createClass(Hover, [{
|
|
696
775
|
key: "generateGetBoundingClientRect",
|
|
697
776
|
value: function generateGetBoundingClientRect() {
|
|
698
777
|
var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
@@ -708,64 +787,6 @@ var Hover = /*#__PURE__*/function (_Component4) {
|
|
|
708
787
|
};
|
|
709
788
|
};
|
|
710
789
|
}
|
|
711
|
-
}, {
|
|
712
|
-
key: "getPolygon",
|
|
713
|
-
value: function getPolygon(index) {
|
|
714
|
-
var _this$asProps10 = this.asProps,
|
|
715
|
-
categories = _this$asProps10.categories,
|
|
716
|
-
size = _this$asProps10.size,
|
|
717
|
-
offset = _this$asProps10.offset,
|
|
718
|
-
angleOffset = _this$asProps10.angleOffset;
|
|
719
|
-
var total = categories.length;
|
|
720
|
-
var diam = Math.min(size[0], size[1]);
|
|
721
|
-
var radius = diam / 2 - offset;
|
|
722
|
-
var prevIndex = (index - 1 + total) % total;
|
|
723
|
-
var nextIndex = (index + 1 + total) % total;
|
|
724
|
-
var _getRadianPosition7 = getRadianPosition(prevIndex, radius, total, angleOffset),
|
|
725
|
-
_getRadianPosition8 = _slicedToArray(_getRadianPosition7, 2),
|
|
726
|
-
prevX1 = _getRadianPosition8[0],
|
|
727
|
-
prevY1 = _getRadianPosition8[1];
|
|
728
|
-
var _getRadianPosition9 = getRadianPosition(index, radius, total, angleOffset),
|
|
729
|
-
_getRadianPosition10 = _slicedToArray(_getRadianPosition9, 2),
|
|
730
|
-
x = _getRadianPosition10[0],
|
|
731
|
-
y = _getRadianPosition10[1];
|
|
732
|
-
var _getRadianPosition11 = getRadianPosition(nextIndex, radius, total, angleOffset),
|
|
733
|
-
_getRadianPosition12 = _slicedToArray(_getRadianPosition11, 2),
|
|
734
|
-
nextX1 = _getRadianPosition12[0],
|
|
735
|
-
nextY1 = _getRadianPosition12[1];
|
|
736
|
-
return [[0, 0], [(prevX1 + x) / 2, (prevY1 + y) / 2], [x, y], [(nextX1 + x) / 2, (nextY1 + y) / 2]];
|
|
737
|
-
}
|
|
738
|
-
}, {
|
|
739
|
-
key: "getPie",
|
|
740
|
-
value: function getPie(index) {
|
|
741
|
-
var _this$asProps11 = this.asProps,
|
|
742
|
-
categories = _this$asProps11.categories,
|
|
743
|
-
size = _this$asProps11.size,
|
|
744
|
-
offset = _this$asProps11.offset,
|
|
745
|
-
angleOffset = _this$asProps11.angleOffset;
|
|
746
|
-
var angle = Math.PI * 2 / categories.length;
|
|
747
|
-
var radius = Math.min(size[0], size[1]) / 2 - offset;
|
|
748
|
-
return [index * angle - angle / 2 - angleOffset, (index + 1) * angle - angle / 2 - angleOffset, radius];
|
|
749
|
-
}
|
|
750
|
-
}, {
|
|
751
|
-
key: "getIndex",
|
|
752
|
-
value: function getIndex(point) {
|
|
753
|
-
var _this4 = this;
|
|
754
|
-
var _this$asProps12 = this.asProps,
|
|
755
|
-
categories = _this$asProps12.categories,
|
|
756
|
-
type = _this$asProps12.type;
|
|
757
|
-
var index;
|
|
758
|
-
if (type === 'circle') {
|
|
759
|
-
index = categories.findIndex(function (c, i) {
|
|
760
|
-
return pieContains(_this4.getPie(i), point);
|
|
761
|
-
});
|
|
762
|
-
} else {
|
|
763
|
-
index = categories.findIndex(function (c, i) {
|
|
764
|
-
return polygonContains(_this4.getPolygon(i), point);
|
|
765
|
-
});
|
|
766
|
-
}
|
|
767
|
-
return index === -1 ? null : index;
|
|
768
|
-
}
|
|
769
790
|
}, {
|
|
770
791
|
key: "componentDidMount",
|
|
771
792
|
value: function componentDidMount() {
|
|
@@ -790,36 +811,37 @@ var Hover = /*#__PURE__*/function (_Component4) {
|
|
|
790
811
|
}, {
|
|
791
812
|
key: "render",
|
|
792
813
|
value: function render() {
|
|
793
|
-
var _this$
|
|
794
|
-
styles = _this$
|
|
795
|
-
type = _this$
|
|
814
|
+
var _this$asProps12 = this.asProps,
|
|
815
|
+
styles = _this$asProps12.styles,
|
|
816
|
+
type = _this$asProps12.type,
|
|
817
|
+
getPie = _this$asProps12.getPie,
|
|
818
|
+
getPolygon = _this$asProps12.getPolygon;
|
|
796
819
|
var index = this.state.index;
|
|
797
820
|
var SPieRect = this.Element;
|
|
798
821
|
if (index !== null) {
|
|
799
822
|
if (type === 'circle') {
|
|
800
|
-
var
|
|
801
|
-
var
|
|
802
|
-
|
|
803
|
-
startAngle =
|
|
804
|
-
endAngle =
|
|
805
|
-
radius =
|
|
823
|
+
var _ref0;
|
|
824
|
+
var _getPie = getPie(index),
|
|
825
|
+
_getPie2 = _slicedToArray(_getPie, 3),
|
|
826
|
+
startAngle = _getPie2[0],
|
|
827
|
+
endAngle = _getPie2[1],
|
|
828
|
+
radius = _getPie2[2];
|
|
806
829
|
var circle = arc().innerRadius(0).outerRadius(radius).startAngle(startAngle).endAngle(endAngle);
|
|
807
|
-
return
|
|
830
|
+
return _ref0 = sstyled(styles), /*#__PURE__*/React.createElement(SPieRect, _ref0.cn("SPieRect", {
|
|
808
831
|
"render": 'path',
|
|
809
832
|
"d": circle()
|
|
810
833
|
}));
|
|
811
834
|
} else {
|
|
812
|
-
var
|
|
813
|
-
return
|
|
835
|
+
var _ref1;
|
|
836
|
+
return _ref1 = sstyled(styles), /*#__PURE__*/React.createElement(SPieRect, _ref1.cn("SPieRect", {
|
|
814
837
|
"render": 'path',
|
|
815
|
-
"d": line()(
|
|
838
|
+
"d": line()(getPolygon(index))
|
|
816
839
|
}));
|
|
817
840
|
}
|
|
818
841
|
}
|
|
819
842
|
return null;
|
|
820
843
|
}
|
|
821
844
|
}]);
|
|
822
|
-
return Hover;
|
|
823
845
|
}(Component);
|
|
824
846
|
var Axis = createElement(AxisRoot, {
|
|
825
847
|
Ticks: AxisTicks,
|
|
@@ -829,15 +851,15 @@ var Polygon = createElement(PolygonRoot, {
|
|
|
829
851
|
Line: PolygonLine,
|
|
830
852
|
Dots: PolygonDots
|
|
831
853
|
});
|
|
832
|
-
|
|
854
|
+
function RadarTooltip(props) {
|
|
833
855
|
var _ref = arguments[0],
|
|
834
|
-
|
|
856
|
+
_ref10;
|
|
835
857
|
var SRadarTooltip = Tooltip;
|
|
836
|
-
return
|
|
858
|
+
return _ref10 = sstyled(props.styles), /*#__PURE__*/React.createElement(SRadarTooltip, _ref10.cn("SRadarTooltip", _objectSpread({}, _assignProps({
|
|
837
859
|
"tag": Radar.Hover,
|
|
838
860
|
"excludeAnchorProps": true
|
|
839
861
|
}, _ref))));
|
|
840
|
-
}
|
|
862
|
+
}
|
|
841
863
|
var Radar = createElement(RadarRoot, {
|
|
842
864
|
Axis: Axis,
|
|
843
865
|
Polygon: Polygon,
|