@semcore/d3-chart 16.5.0 → 17.0.0-prerelease.9
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 +9 -12
package/lib/esm/ScatterPlot.mjs
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
|
-
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
2
|
import { sstyled, assignProps, Component } from "@semcore/core";
|
|
9
3
|
import canUseDOM from "@semcore/core/lib/utils/canUseDOM";
|
|
@@ -15,171 +9,176 @@ import { PatternFill } from "./Pattern.mjs";
|
|
|
15
9
|
import Tooltip from "./Tooltip.mjs";
|
|
16
10
|
import { getScatterPlotRadius } from "./utils.mjs";
|
|
17
11
|
/*!__reshadow-styles__:"./style/scatterplot.shadow.css"*/
|
|
18
|
-
|
|
12
|
+
const style = (
|
|
19
13
|
/*__reshadow_css_start__*/
|
|
20
14
|
(sstyled.insert(
|
|
21
15
|
/*__inner_css_start__*/
|
|
22
|
-
".
|
|
16
|
+
".___SScatterPlot_8h4j7_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:cx,cy;transition-duration:var(--duration_8h4j7);transition-timing-function:ease-in-out;opacity:.5}@media (hover:hover){.___SScatterPlot_8h4j7_gg_:hover{opacity:.8}}.___SScatterPlot_8h4j7_gg_.__color_8h4j7_gg_{fill:var(--color_8h4j7)}.___SScatterPlot_8h4j7_gg_.__pattern_8h4j7_gg_.__color_8h4j7_gg_{fill:var(--pattern_8h4j7);stroke:var(--color_8h4j7);stroke-width:1px}.___SScatterPlot_8h4j7_gg_.__transparent_8h4j7_gg_{opacity:.3}.___SValue_8h4j7_gg_{text-anchor:middle;font-size:var(--intergalactic-fs-50, 10px);stroke:var(--intergalactic-chart-palette-order-9, #008ff8)}.___SValue_8h4j7_gg_.__color_8h4j7_gg_{stroke:var(--color_8h4j7)}.___SValue_8h4j7_gg_.__transparent_8h4j7_gg_{opacity:.3}",
|
|
23
17
|
/*__inner_css_end__*/
|
|
24
|
-
"
|
|
18
|
+
"8h4j7_gg_"
|
|
25
19
|
), /*__reshadow_css_end__*/
|
|
26
20
|
{
|
|
27
|
-
"__SScatterPlot": "
|
|
28
|
-
"_color": "
|
|
29
|
-
"--color": "--
|
|
30
|
-
"_pattern": "
|
|
31
|
-
"--pattern": "--
|
|
32
|
-
"_transparent": "
|
|
33
|
-
"__SValue": "
|
|
34
|
-
"--duration": "--
|
|
21
|
+
"__SScatterPlot": "___SScatterPlot_8h4j7_gg_",
|
|
22
|
+
"_color": "__color_8h4j7_gg_",
|
|
23
|
+
"--color": "--color_8h4j7",
|
|
24
|
+
"_pattern": "__pattern_8h4j7_gg_",
|
|
25
|
+
"--pattern": "--pattern_8h4j7",
|
|
26
|
+
"_transparent": "__transparent_8h4j7_gg_",
|
|
27
|
+
"__SValue": "___SValue_8h4j7_gg_",
|
|
28
|
+
"--duration": "--duration_8h4j7"
|
|
35
29
|
})
|
|
36
30
|
);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
eventEmitter.emit("setTooltipVisible_".concat(plotId), visible);
|
|
53
|
-
};
|
|
31
|
+
class ScatterPlotRoot extends Component {
|
|
32
|
+
constructor(...args) {
|
|
33
|
+
super(...args);
|
|
34
|
+
_defineProperty(this, "virtualElement", canUseDOM() ? document.createElement("div") : {});
|
|
35
|
+
_defineProperty(this, "bindHandlerTooltip", (visible, props, tooltipProps) => ({
|
|
36
|
+
clientX,
|
|
37
|
+
clientY
|
|
38
|
+
}) => {
|
|
39
|
+
const {
|
|
40
|
+
eventEmitter,
|
|
41
|
+
plotId
|
|
42
|
+
} = this.asProps;
|
|
43
|
+
eventEmitter.emit(`setTooltipPosition_${plotId}`, clientX, clientY);
|
|
44
|
+
eventEmitter.emit(`setTooltipRenderingProps_${plotId}`, props, tooltipProps);
|
|
45
|
+
eventEmitter.emit(`setTooltipVisible_${plotId}`, visible);
|
|
54
46
|
});
|
|
55
|
-
return _this;
|
|
56
47
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
var selectRect = transition().selection().selectAll("[id^=".concat(uid, "]")).attr("r", 0);
|
|
80
|
-
var selectRectNode = selectRect.node();
|
|
81
|
-
if (duration > 0 && selectRectNode) {
|
|
82
|
-
selectRect.transition().duration(duration).attr("r", radius);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}, {
|
|
86
|
-
key: "componentDidUpdate",
|
|
87
|
-
value: function componentDidUpdate(prevProps) {
|
|
88
|
-
if (prevProps.data !== this.props.data) {
|
|
89
|
-
this.animationCircle();
|
|
90
|
-
}
|
|
48
|
+
generateGetBoundingClientRect(x = 0, y = 0) {
|
|
49
|
+
return () => ({
|
|
50
|
+
width: 0,
|
|
51
|
+
height: 0,
|
|
52
|
+
top: y,
|
|
53
|
+
right: x,
|
|
54
|
+
bottom: y,
|
|
55
|
+
left: x
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
animationCircle() {
|
|
59
|
+
const {
|
|
60
|
+
duration,
|
|
61
|
+
uid,
|
|
62
|
+
r,
|
|
63
|
+
value
|
|
64
|
+
} = this.asProps;
|
|
65
|
+
const radius = r ? r : getScatterPlotRadius(value);
|
|
66
|
+
const selectRect = transition().selection().selectAll(`[id^=${uid}]`).attr("r", 0);
|
|
67
|
+
const selectRectNode = selectRect.node();
|
|
68
|
+
if (duration > 0 && selectRectNode) {
|
|
69
|
+
selectRect.transition().duration(duration).attr("r", radius);
|
|
91
70
|
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
71
|
+
}
|
|
72
|
+
componentDidUpdate(prevProps) {
|
|
73
|
+
if (prevProps.data !== this.props.data) {
|
|
95
74
|
this.animationCircle();
|
|
96
75
|
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
onClick
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
"aria-hidden": true,
|
|
135
|
-
"id": "".concat(uid).concat(i),
|
|
136
|
-
"index": i,
|
|
137
|
-
"render": "circle",
|
|
138
|
-
"clipPath": "url(#".concat(uid, ")"),
|
|
139
|
-
"cx": xScale(d[x]) + offset[0],
|
|
140
|
-
"cy": yScale(d[y]) + offset[1],
|
|
141
|
-
"color": resolveColor(color),
|
|
142
|
-
"pattern": patterns ? "url(#".concat(uid, "-").concat(i, "-pattern)") : void 0,
|
|
143
|
-
"r": r,
|
|
144
|
-
"use:duration": "".concat(duration, "ms"),
|
|
145
|
-
"transparent": transparent
|
|
146
|
-
})), patterns && /* @__PURE__ */ React.createElement(PatternFill, _ref2.cn("PatternFill", {
|
|
147
|
-
"id": "".concat(uid, "-").concat(i, "-pattern"),
|
|
148
|
-
"patternKey": color,
|
|
149
|
-
"color": resolveColor(color),
|
|
150
|
-
"patterns": patterns
|
|
151
|
-
})), d[value] !== void 0 && /* @__PURE__ */ React.createElement(SValue, _ref2.cn("SValue", {
|
|
152
|
-
"aria-hidden": true,
|
|
153
|
-
"x": xScale(d[x]) + offset[0],
|
|
154
|
-
"y": yScale(d[y]) + offset[1],
|
|
155
|
-
"dy": ".3em",
|
|
156
|
-
"clipPath": "url(#".concat(uid, ")"),
|
|
157
|
-
"color": resolveColor(valueColor),
|
|
158
|
-
"transparent": transparent
|
|
159
|
-
}), d[value]));
|
|
160
|
-
}
|
|
161
|
-
}, {
|
|
162
|
-
key: "render",
|
|
163
|
-
value: function render() {
|
|
164
|
-
var _this$asProps4 = this.asProps, data = _this$asProps4.data, uid = _this$asProps4.uid, scale = _this$asProps4.scale, x = _this$asProps4.x, y = _this$asProps4.y, value = _this$asProps4.value;
|
|
165
|
-
var _scale2 = _slicedToArray(scale, 2), xScale = _scale2[0], yScale = _scale2[1];
|
|
166
|
-
var xSize = Math.abs(xScale.range()[0] - xScale.range()[1]);
|
|
167
|
-
var ySize = Math.abs(yScale.range()[0] - yScale.range()[1]);
|
|
168
|
-
var xMargin = Math.min(xScale.range()[0], xScale.range()[1]);
|
|
169
|
-
var yMargin = Math.min(yScale.range()[0], yScale.range()[1]);
|
|
170
|
-
this.asProps.dataHintsHandler.specifyDataRowFields(x, y, value);
|
|
171
|
-
this.asProps.dataHintsHandler.establishDataType("points-cloud");
|
|
172
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, data.map(this.renderCircle.bind(this)), /* @__PURE__ */ React.createElement("clipPath", {
|
|
173
|
-
id: uid
|
|
174
|
-
}, /* @__PURE__ */ React.createElement("rect", {
|
|
175
|
-
x: xMargin,
|
|
176
|
-
y: yMargin,
|
|
177
|
-
width: "".concat(xSize, "px"),
|
|
178
|
-
height: "".concat(ySize, "px")
|
|
179
|
-
})));
|
|
76
|
+
}
|
|
77
|
+
componentDidMount() {
|
|
78
|
+
this.animationCircle();
|
|
79
|
+
}
|
|
80
|
+
handlerOnClick(index) {
|
|
81
|
+
return (e) => {
|
|
82
|
+
e.stopPropagation();
|
|
83
|
+
const {
|
|
84
|
+
onClick
|
|
85
|
+
} = this.asProps;
|
|
86
|
+
if (!onClick) return;
|
|
87
|
+
onClick(index, e);
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
renderCircle(d, i) {
|
|
91
|
+
var _ref2;
|
|
92
|
+
const {
|
|
93
|
+
color,
|
|
94
|
+
scale,
|
|
95
|
+
x,
|
|
96
|
+
y,
|
|
97
|
+
r,
|
|
98
|
+
offset,
|
|
99
|
+
styles,
|
|
100
|
+
uid,
|
|
101
|
+
duration,
|
|
102
|
+
value,
|
|
103
|
+
valueColor,
|
|
104
|
+
transparent,
|
|
105
|
+
resolveColor,
|
|
106
|
+
patterns
|
|
107
|
+
} = this.asProps;
|
|
108
|
+
const [xScale, yScale] = scale;
|
|
109
|
+
const SScatterPlot = this.Element;
|
|
110
|
+
const SValue = "text";
|
|
111
|
+
if (Number.isNaN(d[x]) || Number.isNaN(d[y])) {
|
|
112
|
+
return null;
|
|
180
113
|
}
|
|
181
|
-
|
|
182
|
-
|
|
114
|
+
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement("g", _ref2.cn("g", {
|
|
115
|
+
"aria-hidden": true,
|
|
116
|
+
"key": `circle(#${i})`,
|
|
117
|
+
"onMouseMove": this.bindHandlerTooltip(true, this.props, {
|
|
118
|
+
xIndex: i,
|
|
119
|
+
index: i,
|
|
120
|
+
patterns
|
|
121
|
+
}),
|
|
122
|
+
"onMouseLeave": this.bindHandlerTooltip(false, this.props, {
|
|
123
|
+
xIndex: i,
|
|
124
|
+
index: i,
|
|
125
|
+
patterns
|
|
126
|
+
}),
|
|
127
|
+
"onClickCapture": this.handlerOnClick(i)
|
|
128
|
+
}), /* @__PURE__ */ React.createElement(SScatterPlot, _ref2.cn("SScatterPlot", {
|
|
129
|
+
"aria-hidden": true,
|
|
130
|
+
"id": `${uid}${i}`,
|
|
131
|
+
"index": i,
|
|
132
|
+
"render": "circle",
|
|
133
|
+
"clipPath": `url(#${uid})`,
|
|
134
|
+
"cx": xScale(d[x]) + offset[0],
|
|
135
|
+
"cy": yScale(d[y]) + offset[1],
|
|
136
|
+
"color": resolveColor(color),
|
|
137
|
+
"pattern": patterns ? `url(#${uid}-${i}-pattern)` : void 0,
|
|
138
|
+
"r": r,
|
|
139
|
+
"use:duration": `${duration}ms`,
|
|
140
|
+
"transparent": transparent
|
|
141
|
+
})), patterns && /* @__PURE__ */ React.createElement(PatternFill, _ref2.cn("PatternFill", {
|
|
142
|
+
"id": `${uid}-${i}-pattern`,
|
|
143
|
+
"patternKey": color,
|
|
144
|
+
"color": resolveColor(color),
|
|
145
|
+
"patterns": patterns
|
|
146
|
+
})), d[value] !== void 0 && /* @__PURE__ */ React.createElement(SValue, _ref2.cn("SValue", {
|
|
147
|
+
"aria-hidden": true,
|
|
148
|
+
"x": xScale(d[x]) + offset[0],
|
|
149
|
+
"y": yScale(d[y]) + offset[1],
|
|
150
|
+
"dy": ".3em",
|
|
151
|
+
"clipPath": `url(#${uid})`,
|
|
152
|
+
"color": resolveColor(valueColor),
|
|
153
|
+
"transparent": transparent
|
|
154
|
+
}), d[value]));
|
|
155
|
+
}
|
|
156
|
+
render() {
|
|
157
|
+
const {
|
|
158
|
+
data,
|
|
159
|
+
uid,
|
|
160
|
+
scale,
|
|
161
|
+
x,
|
|
162
|
+
y,
|
|
163
|
+
value
|
|
164
|
+
} = this.asProps;
|
|
165
|
+
const [xScale, yScale] = scale;
|
|
166
|
+
const xSize = Math.abs(xScale.range()[0] - xScale.range()[1]);
|
|
167
|
+
const ySize = Math.abs(yScale.range()[0] - yScale.range()[1]);
|
|
168
|
+
const xMargin = Math.min(xScale.range()[0], xScale.range()[1]);
|
|
169
|
+
const yMargin = Math.min(yScale.range()[0], yScale.range()[1]);
|
|
170
|
+
this.asProps.dataHintsHandler.specifyDataRowFields(x, y, value);
|
|
171
|
+
this.asProps.dataHintsHandler.establishDataType("points-cloud");
|
|
172
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, data.map(this.renderCircle.bind(this)), /* @__PURE__ */ React.createElement("clipPath", {
|
|
173
|
+
id: uid
|
|
174
|
+
}, /* @__PURE__ */ React.createElement("rect", {
|
|
175
|
+
x: xMargin,
|
|
176
|
+
y: yMargin,
|
|
177
|
+
width: `${xSize}px`,
|
|
178
|
+
height: `${ySize}px`
|
|
179
|
+
})));
|
|
180
|
+
}
|
|
181
|
+
}
|
|
183
182
|
_defineProperty(ScatterPlotRoot, "displayName", "ScatterPlot");
|
|
184
183
|
_defineProperty(ScatterPlotRoot, "style", style);
|
|
185
184
|
_defineProperty(ScatterPlotRoot, "enhance", [uniqueIDEnhancement()]);
|
|
@@ -189,12 +188,14 @@ _defineProperty(ScatterPlotRoot, "defaultProps", {
|
|
|
189
188
|
});
|
|
190
189
|
function ScatterPlotTooltip(props) {
|
|
191
190
|
var _ref = arguments[0], _ref3;
|
|
192
|
-
|
|
193
|
-
return _ref3 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SScatterPlotTooltip, _ref3.cn("SScatterPlotTooltip",
|
|
194
|
-
|
|
195
|
-
|
|
191
|
+
const SScatterPlotTooltip = Tooltip;
|
|
192
|
+
return _ref3 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SScatterPlotTooltip, _ref3.cn("SScatterPlotTooltip", {
|
|
193
|
+
...assignProps({
|
|
194
|
+
"excludeAnchorProps": true
|
|
195
|
+
}, _ref)
|
|
196
|
+
}));
|
|
196
197
|
}
|
|
197
|
-
|
|
198
|
+
const ScatterPlot = createElement(ScatterPlotRoot, {
|
|
198
199
|
Tooltip: [ScatterPlotTooltip, Tooltip._______childrenComponents]
|
|
199
200
|
});
|
|
200
201
|
export {
|
package/lib/esm/StackBar.mjs
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
|
-
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
2
|
import { Component } from "@semcore/core";
|
|
9
3
|
import getOriginChildren from "@semcore/core/lib/utils/getOriginChildren";
|
|
@@ -13,157 +7,142 @@ import Bar, { MIN_HEIGHT } from "./Bar.mjs";
|
|
|
13
7
|
import createElement from "./createElement.mjs";
|
|
14
8
|
import HorizontalBar, { MIN_WIDTH } from "./HorizontalBar.mjs";
|
|
15
9
|
import { getChartDefaultColorName } from "./utils.mjs";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
23
|
-
args[_key] = arguments[_key];
|
|
24
|
-
}
|
|
25
|
-
_this = _callSuper(this, StackBarRoot2, [].concat(args));
|
|
26
|
-
_defineProperty(_this, "offsetBars", []);
|
|
27
|
-
return _this;
|
|
10
|
+
const DEFAULT_INSTANCE = Symbol("DEFAULT_INSTANCE");
|
|
11
|
+
const XY0 = Symbol("XY0");
|
|
12
|
+
class StackBarRoot extends Component {
|
|
13
|
+
constructor(...args) {
|
|
14
|
+
super(...args);
|
|
15
|
+
_defineProperty(this, "offsetBars", []);
|
|
28
16
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (/* @__PURE__ */ React.isValidElement(child) && child.type === StackBar.HorizontalBar && !child.props.hide) {
|
|
40
|
-
acc.push(child.props.x);
|
|
41
|
-
}
|
|
42
|
-
return acc;
|
|
43
|
-
}, []);
|
|
44
|
-
stack2.keys(keys);
|
|
45
|
-
}
|
|
46
|
-
return stack2(data);
|
|
47
|
-
}
|
|
48
|
-
}, {
|
|
49
|
-
key: "getBarProps",
|
|
50
|
-
value: function getBarProps(_ref, index) {
|
|
51
|
-
var _this2 = this, _this$offsetBars$seri;
|
|
52
|
-
var y = _ref.y, _ref$hMin = _ref.hMin, hMin = _ref$hMin === void 0 ? MIN_HEIGHT : _ref$hMin;
|
|
53
|
-
var _this$asProps2 = this.asProps, x = _this$asProps2.x, r = _this$asProps2.r, scale = _this$asProps2.scale, maxBarSize = _this$asProps2.maxBarSize, patterns = _this$asProps2.patterns;
|
|
54
|
-
var _scale = _slicedToArray(scale, 2), yScale = _scale[1];
|
|
55
|
-
var seriesIndex = this.series.findIndex(function(s) {
|
|
56
|
-
return s.key === y;
|
|
57
|
-
});
|
|
58
|
-
var series = this.series[seriesIndex] || [];
|
|
59
|
-
var rBar = series.map(function(_s, i) {
|
|
60
|
-
return _this2.series.slice(seriesIndex + 1).some(function(bar) {
|
|
61
|
-
return bar[i][0] !== bar[i][1];
|
|
62
|
-
}) ? 0 : r;
|
|
63
|
-
});
|
|
64
|
-
this.offsetBars[seriesIndex] = (_this$offsetBars$seri = this.offsetBars[seriesIndex]) !== null && _this$offsetBars$seri !== void 0 ? _this$offsetBars$seri : [];
|
|
65
|
-
var data = series.map(function(s) {
|
|
66
|
-
return _objectSpread(_objectSpread({}, s.data), {}, _defineProperty(_defineProperty({}, y, s[1]), XY0, s[0]));
|
|
67
|
-
});
|
|
68
|
-
var calcOffset = function calcOffset2(i) {
|
|
69
|
-
var _d$XY, _d$XY2;
|
|
70
|
-
var offset = _this2.offsetBars.reduce(function(offset2, offsetBar) {
|
|
71
|
-
var _offsetBar$i;
|
|
72
|
-
return offset2 - ((_offsetBar$i = offsetBar[i]) !== null && _offsetBar$i !== void 0 ? _offsetBar$i : 0);
|
|
73
|
-
}, 0);
|
|
74
|
-
var d = data[i];
|
|
75
|
-
var absHeight = Math.abs(yScale(d[y]) - Math.min(yScale(yScale.domain()[0]), yScale((_d$XY = d[XY0]) !== null && _d$XY !== void 0 ? _d$XY : 0)));
|
|
76
|
-
var isEmptyValue = Number(d[y] - ((_d$XY2 = d[XY0]) !== null && _d$XY2 !== void 0 ? _d$XY2 : 0)) === 0;
|
|
77
|
-
if (isEmptyValue || absHeight >= hMin) {
|
|
78
|
-
_this2.offsetBars[seriesIndex][i] = 0;
|
|
79
|
-
} else {
|
|
80
|
-
var offsetValue = hMin - absHeight;
|
|
81
|
-
_this2.offsetBars[seriesIndex][i] = d[y] > 0 ? offsetValue : -offsetValue;
|
|
17
|
+
getSeries() {
|
|
18
|
+
const {
|
|
19
|
+
Children,
|
|
20
|
+
data,
|
|
21
|
+
stack: stack2
|
|
22
|
+
} = this.asProps;
|
|
23
|
+
if (stack2[DEFAULT_INSTANCE]) {
|
|
24
|
+
const keys = React.Children.toArray(getOriginChildren(Children)).reduce((acc, child) => {
|
|
25
|
+
if (/* @__PURE__ */ React.isValidElement(child) && child.type === StackBar.Bar && !child.props.hide) {
|
|
26
|
+
acc.push(child.props.y);
|
|
82
27
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
x,
|
|
90
|
-
r: rBar,
|
|
91
|
-
groupKey: x,
|
|
92
|
-
offset: calcOffset,
|
|
93
|
-
maxBarSize,
|
|
94
|
-
color: getChartDefaultColorName(index),
|
|
95
|
-
patterns
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
}, {
|
|
99
|
-
key: "getHorizontalBarProps",
|
|
100
|
-
value: function getHorizontalBarProps(_ref2, index) {
|
|
101
|
-
var _this3 = this, _this$offsetBars$seri2;
|
|
102
|
-
var x = _ref2.x, _ref2$wMin = _ref2.wMin, wMin = _ref2$wMin === void 0 ? MIN_WIDTH : _ref2$wMin;
|
|
103
|
-
var _this$asProps3 = this.asProps, y = _this$asProps3.y, r = _this$asProps3.r, scale = _this$asProps3.scale, maxBarSize = _this$asProps3.maxBarSize, patterns = _this$asProps3.patterns;
|
|
104
|
-
var _scale2 = _slicedToArray(scale, 1), xScale = _scale2[0];
|
|
105
|
-
var seriesIndex = this.series.findIndex(function(s) {
|
|
106
|
-
return s.key === x;
|
|
107
|
-
});
|
|
108
|
-
var series = this.series[seriesIndex];
|
|
109
|
-
var rBar = series.map(function(_s, i) {
|
|
110
|
-
return _this3.series.slice(seriesIndex + 1).some(function(bar) {
|
|
111
|
-
return bar[i][0] !== bar[i][1];
|
|
112
|
-
}) ? 0 : r;
|
|
113
|
-
});
|
|
114
|
-
this.offsetBars[seriesIndex] = (_this$offsetBars$seri2 = this.offsetBars[seriesIndex]) !== null && _this$offsetBars$seri2 !== void 0 ? _this$offsetBars$seri2 : [];
|
|
115
|
-
var data = series.map(function(s) {
|
|
116
|
-
return _objectSpread(_objectSpread({}, s.data), {}, _defineProperty(_defineProperty({}, x, s[1]), XY0, s[0]));
|
|
117
|
-
});
|
|
118
|
-
var calcOffset = function calcOffset2(i) {
|
|
119
|
-
var _d$XY3, _d$XY4;
|
|
120
|
-
var offset = _this3.offsetBars.reduce(function(offset2, offsetBar) {
|
|
121
|
-
var _offsetBar$i2;
|
|
122
|
-
return offset2 - ((_offsetBar$i2 = offsetBar[i]) !== null && _offsetBar$i2 !== void 0 ? _offsetBar$i2 : 0);
|
|
123
|
-
}, 0);
|
|
124
|
-
var d = data[i];
|
|
125
|
-
var absWidth = Math.abs(xScale(d[x]) - Math.max(xScale(xScale.domain()[0]), xScale((_d$XY3 = d[XY0]) !== null && _d$XY3 !== void 0 ? _d$XY3 : 0)));
|
|
126
|
-
_this3.offsetBars[seriesIndex][i] = Number(d[x] - ((_d$XY4 = d[XY0]) !== null && _d$XY4 !== void 0 ? _d$XY4 : 0)) === 0 ? 0 : absWidth >= wMin ? 0 : d[x] > 0 ? -wMin : wMin;
|
|
127
|
-
return [offset, 0];
|
|
128
|
-
};
|
|
129
|
-
return {
|
|
130
|
-
data,
|
|
131
|
-
wMin,
|
|
132
|
-
x0: XY0,
|
|
133
|
-
y,
|
|
134
|
-
r: rBar,
|
|
135
|
-
groupKey: y,
|
|
136
|
-
offset: calcOffset,
|
|
137
|
-
maxBarSize,
|
|
138
|
-
color: getChartDefaultColorName(index),
|
|
139
|
-
patterns
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
}, {
|
|
143
|
-
key: "render",
|
|
144
|
-
value: function render() {
|
|
145
|
-
var Element = this.Element;
|
|
146
|
-
this.series = this.getSeries();
|
|
147
|
-
this.asProps.dataHintsHandler.establishDataType("grouped-values");
|
|
148
|
-
this.offsetBars = [];
|
|
149
|
-
return /* @__PURE__ */ React.createElement(Element, {
|
|
150
|
-
"aria-hidden": true,
|
|
151
|
-
render: "g",
|
|
152
|
-
series: this.series
|
|
153
|
-
});
|
|
28
|
+
if (/* @__PURE__ */ React.isValidElement(child) && child.type === StackBar.HorizontalBar && !child.props.hide) {
|
|
29
|
+
acc.push(child.props.x);
|
|
30
|
+
}
|
|
31
|
+
return acc;
|
|
32
|
+
}, []);
|
|
33
|
+
stack2.keys(keys);
|
|
154
34
|
}
|
|
155
|
-
|
|
156
|
-
}
|
|
35
|
+
return stack2(data);
|
|
36
|
+
}
|
|
37
|
+
getBarProps({
|
|
38
|
+
y,
|
|
39
|
+
hMin = MIN_HEIGHT
|
|
40
|
+
}, index) {
|
|
41
|
+
const {
|
|
42
|
+
x,
|
|
43
|
+
r,
|
|
44
|
+
scale,
|
|
45
|
+
maxBarSize,
|
|
46
|
+
patterns
|
|
47
|
+
} = this.asProps;
|
|
48
|
+
const [, yScale] = scale;
|
|
49
|
+
const seriesIndex = this.series.findIndex((s) => s.key === y);
|
|
50
|
+
const series = this.series[seriesIndex] || [];
|
|
51
|
+
const rBar = series.map((_s, i) => this.series.slice(seriesIndex + 1).some((bar) => bar[i][0] !== bar[i][1]) ? 0 : r);
|
|
52
|
+
this.offsetBars[seriesIndex] = this.offsetBars[seriesIndex] ?? [];
|
|
53
|
+
const data = series.map((s) => ({
|
|
54
|
+
...s.data,
|
|
55
|
+
[y]: s[1],
|
|
56
|
+
[XY0]: s[0]
|
|
57
|
+
}));
|
|
58
|
+
const calcOffset = (i) => {
|
|
59
|
+
const offset = this.offsetBars.reduce((offset2, offsetBar) => offset2 - (offsetBar[i] ?? 0), 0);
|
|
60
|
+
const d = data[i];
|
|
61
|
+
const absHeight = Math.abs(yScale(d[y]) - Math.min(yScale(yScale.domain()[0]), yScale(d[XY0] ?? 0)));
|
|
62
|
+
const isEmptyValue = Number(d[y] - (d[XY0] ?? 0)) === 0;
|
|
63
|
+
if (isEmptyValue || absHeight >= hMin) {
|
|
64
|
+
this.offsetBars[seriesIndex][i] = 0;
|
|
65
|
+
} else {
|
|
66
|
+
const offsetValue = hMin - absHeight;
|
|
67
|
+
this.offsetBars[seriesIndex][i] = d[y] > 0 ? offsetValue : -offsetValue;
|
|
68
|
+
}
|
|
69
|
+
return [0, offset];
|
|
70
|
+
};
|
|
71
|
+
return {
|
|
72
|
+
data,
|
|
73
|
+
hMin,
|
|
74
|
+
y0: XY0,
|
|
75
|
+
x,
|
|
76
|
+
r: rBar,
|
|
77
|
+
groupKey: x,
|
|
78
|
+
offset: calcOffset,
|
|
79
|
+
maxBarSize,
|
|
80
|
+
color: getChartDefaultColorName(index),
|
|
81
|
+
patterns
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
getHorizontalBarProps({
|
|
85
|
+
x,
|
|
86
|
+
wMin = MIN_WIDTH
|
|
87
|
+
}, index) {
|
|
88
|
+
const {
|
|
89
|
+
y,
|
|
90
|
+
r,
|
|
91
|
+
scale,
|
|
92
|
+
maxBarSize,
|
|
93
|
+
patterns
|
|
94
|
+
} = this.asProps;
|
|
95
|
+
const [xScale] = scale;
|
|
96
|
+
const seriesIndex = this.series.findIndex((s) => s.key === x);
|
|
97
|
+
const series = this.series[seriesIndex];
|
|
98
|
+
this.offsetBars[seriesIndex] = this.offsetBars[seriesIndex] ?? [];
|
|
99
|
+
const data = series.map((s) => ({
|
|
100
|
+
...s.data,
|
|
101
|
+
[x]: s[1],
|
|
102
|
+
[XY0]: s[0]
|
|
103
|
+
}));
|
|
104
|
+
const calcOffset = (i) => {
|
|
105
|
+
const offset = this.offsetBars.reduce((offset2, offsetBar) => offset2 - (offsetBar[i] ?? 0), 0);
|
|
106
|
+
const d = data[i];
|
|
107
|
+
const absWidth = Math.abs(xScale(d[x]) - Math.max(xScale(xScale.domain()[0]), xScale(d[XY0] ?? 0)));
|
|
108
|
+
this.offsetBars[seriesIndex][i] = Number(d[x] - (d[XY0] ?? 0)) === 0 ? 0 : absWidth >= wMin ? 0 : d[x] > 0 ? -wMin : wMin;
|
|
109
|
+
return [offset, 0];
|
|
110
|
+
};
|
|
111
|
+
return {
|
|
112
|
+
data,
|
|
113
|
+
wMin,
|
|
114
|
+
x0: XY0,
|
|
115
|
+
y,
|
|
116
|
+
r: 0,
|
|
117
|
+
groupKey: y,
|
|
118
|
+
offset: calcOffset,
|
|
119
|
+
maxBarSize,
|
|
120
|
+
color: getChartDefaultColorName(index),
|
|
121
|
+
patterns
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
render() {
|
|
125
|
+
const Element = this.Element;
|
|
126
|
+
this.series = this.getSeries();
|
|
127
|
+
this.asProps.dataHintsHandler.establishDataType("grouped-values");
|
|
128
|
+
this.offsetBars = [];
|
|
129
|
+
return /* @__PURE__ */ React.createElement(Element, {
|
|
130
|
+
"aria-hidden": true,
|
|
131
|
+
render: "g",
|
|
132
|
+
series: this.series
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
157
136
|
_defineProperty(StackBarRoot, "displayName", "StackBar");
|
|
158
|
-
_defineProperty(StackBarRoot, "defaultProps",
|
|
159
|
-
|
|
137
|
+
_defineProperty(StackBarRoot, "defaultProps", () => {
|
|
138
|
+
const stack$1 = stack();
|
|
160
139
|
stack$1[DEFAULT_INSTANCE] = true;
|
|
161
140
|
return {
|
|
162
141
|
stack: stack$1,
|
|
163
142
|
r: 2
|
|
164
143
|
};
|
|
165
144
|
});
|
|
166
|
-
|
|
145
|
+
const StackBar = createElement(StackBarRoot, {
|
|
167
146
|
Bar,
|
|
168
147
|
HorizontalBar
|
|
169
148
|
});
|