@semcore/d3-chart 16.5.0 → 17.0.0-prerelease.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/lib/cjs/AnimatedClipPath.js +28 -41
- package/lib/cjs/AnimatedClipPath.js.map +1 -1
- package/lib/cjs/Area.js +187 -223
- package/lib/cjs/Area.js.map +1 -1
- package/lib/cjs/Axis.js +248 -327
- package/lib/cjs/Axis.js.map +1 -1
- package/lib/cjs/Bar.js +162 -185
- package/lib/cjs/Bar.js.map +1 -1
- package/lib/cjs/Bubble.js +219 -248
- package/lib/cjs/Bubble.js.map +1 -1
- package/lib/cjs/CompactHorizontalBar.js +448 -482
- package/lib/cjs/CompactHorizontalBar.js.map +1 -1
- package/lib/cjs/Donut.js +349 -396
- package/lib/cjs/Donut.js.map +1 -1
- package/lib/cjs/Dots.js +67 -86
- package/lib/cjs/Dots.js.map +1 -1
- package/lib/cjs/GroupBar.js +78 -93
- package/lib/cjs/GroupBar.js.map +1 -1
- package/lib/cjs/HorizontalBar.js +149 -167
- package/lib/cjs/HorizontalBar.js.map +1 -1
- package/lib/cjs/Hover.js +178 -207
- package/lib/cjs/Hover.js.map +1 -1
- package/lib/cjs/Line.js +182 -222
- package/lib/cjs/Line.js.map +1 -1
- package/lib/cjs/Pattern.js +124 -126
- package/lib/cjs/Pattern.js.map +1 -1
- package/lib/cjs/Plot.js +100 -126
- package/lib/cjs/Plot.js.map +1 -1
- package/lib/cjs/Radar.js +576 -681
- package/lib/cjs/Radar.js.map +1 -1
- package/lib/cjs/RadialTree.js +518 -571
- package/lib/cjs/RadialTree.js.map +1 -1
- package/lib/cjs/Reference.js +147 -178
- package/lib/cjs/Reference.js.map +1 -1
- package/lib/cjs/ResponsiveContainer.js +64 -82
- package/lib/cjs/ResponsiveContainer.js.map +1 -1
- package/lib/cjs/ScatterPlot.js +169 -199
- package/lib/cjs/ScatterPlot.js.map +1 -1
- package/lib/cjs/StackBar.js +135 -177
- package/lib/cjs/StackBar.js.map +1 -1
- package/lib/cjs/StackedArea.js +60 -73
- package/lib/cjs/StackedArea.js.map +1 -1
- package/lib/cjs/Tooltip.js +193 -208
- package/lib/cjs/Tooltip.js.map +1 -1
- package/lib/cjs/Venn.js +182 -217
- package/lib/cjs/Venn.js.map +1 -1
- package/lib/cjs/a11y/DataAccessibilityTable.js +45 -83
- package/lib/cjs/a11y/DataAccessibilityTable.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yModule.js +37 -97
- package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yView.js +97 -91
- package/lib/cjs/a11y/PlotA11yView.js.map +1 -1
- package/lib/cjs/a11y/bezier.js +17 -23
- package/lib/cjs/a11y/bezier.js.map +1 -1
- package/lib/cjs/a11y/focus.js +16 -16
- package/lib/cjs/a11y/focus.js.map +1 -1
- package/lib/cjs/a11y/hints.js +72 -75
- package/lib/cjs/a11y/hints.js.map +1 -1
- package/lib/cjs/a11y/insights.js +354 -525
- package/lib/cjs/a11y/insights.js.map +1 -1
- package/lib/cjs/a11y/intl.js +5 -5
- package/lib/cjs/a11y/intl.js.map +1 -1
- package/lib/cjs/a11y/locale.js +12 -19
- package/lib/cjs/a11y/locale.js.map +1 -1
- package/lib/cjs/a11y/serialize.js +164 -203
- package/lib/cjs/a11y/serialize.js.map +1 -1
- package/lib/cjs/a11y/summarize.js +7 -6
- package/lib/cjs/a11y/summarize.js.map +1 -1
- package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js +16 -16
- package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/a11y/translations/module/de.json +2 -2
- package/lib/cjs/a11y/translations/module/en.json +2 -2
- package/lib/cjs/a11y/translations/module/es.json +2 -2
- package/lib/cjs/a11y/translations/module/fr.json +2 -2
- package/lib/cjs/a11y/translations/module/it.json +2 -2
- package/lib/cjs/a11y/translations/module/ja.json +2 -2
- package/lib/cjs/a11y/translations/module/ko.json +2 -2
- package/lib/cjs/a11y/translations/module/nl.json +2 -2
- package/lib/cjs/a11y/translations/module/pl.json +2 -2
- package/lib/cjs/a11y/translations/module/pt.json +2 -2
- package/lib/cjs/a11y/translations/module/sv.json +2 -2
- package/lib/cjs/a11y/translations/module/tr.json +2 -2
- package/lib/cjs/a11y/translations/module/vi.json +2 -2
- package/lib/cjs/a11y/translations/module/zh.json +2 -2
- package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js +16 -16
- package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/color.js +1 -1
- package/lib/cjs/color.js.map +1 -1
- package/lib/cjs/component/Chart/AbstractChart.js +421 -466
- package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
- package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/AreaChart.js +97 -115
- package/lib/cjs/component/Chart/AreaChart.js.map +1 -1
- package/lib/cjs/component/Chart/AreaChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/BarChart.js +229 -216
- package/lib/cjs/component/Chart/BarChart.js.map +1 -1
- package/lib/cjs/component/Chart/BarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/BubbleChart.js +114 -136
- package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
- package/lib/cjs/component/Chart/BubbleChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.js +280 -305
- package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.js +76 -108
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.js.map +1 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.js +80 -95
- package/lib/cjs/component/Chart/DonutChart.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/HistogramChart.js +126 -148
- package/lib/cjs/component/Chart/HistogramChart.js.map +1 -1
- package/lib/cjs/component/Chart/HistogramChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.js +95 -113
- package/lib/cjs/component/Chart/LineChart.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/RadarChart.js +84 -110
- package/lib/cjs/component/Chart/RadarChart.js.map +1 -1
- package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.js +119 -143
- package/lib/cjs/component/Chart/ScatterPlotChart.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/VennChart.js +103 -122
- package/lib/cjs/component/Chart/VennChart.js.map +1 -1
- package/lib/cjs/component/Chart/VennChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/index.js +2 -2
- package/lib/cjs/component/Chart/index.js.map +1 -1
- package/lib/cjs/component/ChartLegend/BaseLegend.js +72 -105
- package/lib/cjs/component/ChartLegend/BaseLegend.js.map +1 -1
- package/lib/cjs/component/ChartLegend/BaseLegend.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +58 -70
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +208 -221
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +63 -73
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/index.js +4 -4
- package/lib/cjs/component/ChartLegend/index.js.map +1 -1
- package/lib/cjs/component/Cigarette/Cigarette.js +115 -129
- package/lib/cjs/component/Cigarette/Cigarette.js.map +1 -1
- package/lib/cjs/component/StackGroupBar/StackGroupBar.js +107 -137
- package/lib/cjs/component/StackGroupBar/StackGroupBar.js.map +1 -1
- package/lib/cjs/component/SvgElement.js +7 -7
- package/lib/cjs/component/SvgElement.js.map +1 -1
- package/lib/cjs/createElement.js +66 -65
- package/lib/cjs/createElement.js.map +1 -1
- package/lib/cjs/index.js +62 -62
- package/lib/cjs/style/axis.shadow.css +3 -0
- package/lib/cjs/style/plot.shadow.css +1 -3
- package/lib/cjs/style/plotA11yModule.shadow.css +10 -11
- package/lib/cjs/style/plotA11yView.shadow.css +13 -26
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +15 -15
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/types/Axis.d.js.map +1 -1
- package/lib/cjs/types/CompactHorizontalBar.d.js.map +1 -1
- package/lib/cjs/types/Hover.d.js.map +1 -1
- package/lib/cjs/types/Line.d.js.map +1 -1
- package/lib/cjs/types/Plot.d.js.map +1 -1
- package/lib/cjs/types/Radar.d.js.map +1 -1
- package/lib/cjs/types/ResponsiveContainer.d.js.map +1 -1
- package/lib/cjs/types/Tooltip.d.js.map +1 -1
- package/lib/cjs/types/Venn.d.js.map +1 -1
- package/lib/cjs/types/index.d.js +80 -80
- package/lib/cjs/types/index.d.js.map +1 -1
- package/lib/cjs/utils.js +122 -145
- package/lib/cjs/utils.js.map +1 -1
- package/lib/es6/AnimatedClipPath.js +24 -37
- package/lib/es6/AnimatedClipPath.js.map +1 -1
- package/lib/es6/Area.js +179 -215
- package/lib/es6/Area.js.map +1 -1
- package/lib/es6/Axis.js +242 -321
- package/lib/es6/Axis.js.map +1 -1
- package/lib/es6/Bar.js +154 -177
- package/lib/es6/Bar.js.map +1 -1
- package/lib/es6/Bubble.js +206 -235
- package/lib/es6/Bubble.js.map +1 -1
- package/lib/es6/CompactHorizontalBar.js +433 -467
- package/lib/es6/CompactHorizontalBar.js.map +1 -1
- package/lib/es6/Donut.js +337 -384
- package/lib/es6/Donut.js.map +1 -1
- package/lib/es6/Dots.js +60 -79
- package/lib/es6/Dots.js.map +1 -1
- package/lib/es6/GroupBar.js +74 -89
- package/lib/es6/GroupBar.js.map +1 -1
- package/lib/es6/HorizontalBar.js +141 -159
- package/lib/es6/HorizontalBar.js.map +1 -1
- package/lib/es6/Hover.js +174 -203
- package/lib/es6/Hover.js.map +1 -1
- package/lib/es6/Line.js +173 -213
- package/lib/es6/Line.js.map +1 -1
- package/lib/es6/Pattern.js +68 -74
- package/lib/es6/Pattern.js.map +1 -1
- package/lib/es6/Plot.js +95 -121
- package/lib/es6/Plot.js.map +1 -1
- package/lib/es6/Radar.js +554 -659
- package/lib/es6/Radar.js.map +1 -1
- package/lib/es6/RadialTree.js +500 -553
- package/lib/es6/RadialTree.js.map +1 -1
- package/lib/es6/Reference.js +140 -171
- package/lib/es6/Reference.js.map +1 -1
- package/lib/es6/ResponsiveContainer.js +58 -76
- package/lib/es6/ResponsiveContainer.js.map +1 -1
- package/lib/es6/ScatterPlot.js +161 -191
- package/lib/es6/ScatterPlot.js.map +1 -1
- package/lib/es6/StackBar.js +130 -172
- package/lib/es6/StackBar.js.map +1 -1
- package/lib/es6/StackedArea.js +56 -69
- package/lib/es6/StackedArea.js.map +1 -1
- package/lib/es6/Tooltip.js +183 -198
- package/lib/es6/Tooltip.js.map +1 -1
- package/lib/es6/Venn.js +169 -204
- package/lib/es6/Venn.js.map +1 -1
- package/lib/es6/a11y/DataAccessibilityTable.js +41 -80
- package/lib/es6/a11y/DataAccessibilityTable.js.map +1 -1
- package/lib/es6/a11y/PlotA11yModule.js +35 -95
- package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
- package/lib/es6/a11y/PlotA11yView.js +89 -84
- package/lib/es6/a11y/PlotA11yView.js.map +1 -1
- package/lib/es6/a11y/bezier.js +16 -23
- package/lib/es6/a11y/bezier.js.map +1 -1
- package/lib/es6/a11y/focus.js +15 -16
- package/lib/es6/a11y/focus.js.map +1 -1
- package/lib/es6/a11y/hints.js +67 -73
- package/lib/es6/a11y/hints.js.map +1 -1
- package/lib/es6/a11y/insights.js +353 -524
- package/lib/es6/a11y/insights.js.map +1 -1
- package/lib/es6/a11y/intl.js +4 -5
- package/lib/es6/a11y/intl.js.map +1 -1
- package/lib/es6/a11y/locale.js +11 -18
- package/lib/es6/a11y/locale.js.map +1 -1
- package/lib/es6/a11y/serialize.js +162 -203
- package/lib/es6/a11y/serialize.js.map +1 -1
- package/lib/es6/a11y/summarize.js +6 -6
- package/lib/es6/a11y/summarize.js.map +1 -1
- package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js +15 -15
- package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/a11y/translations/module/de.json +2 -2
- package/lib/es6/a11y/translations/module/en.json +2 -2
- package/lib/es6/a11y/translations/module/es.json +2 -2
- package/lib/es6/a11y/translations/module/fr.json +2 -2
- package/lib/es6/a11y/translations/module/it.json +2 -2
- package/lib/es6/a11y/translations/module/ja.json +2 -2
- package/lib/es6/a11y/translations/module/ko.json +2 -2
- package/lib/es6/a11y/translations/module/nl.json +2 -2
- package/lib/es6/a11y/translations/module/pl.json +2 -2
- package/lib/es6/a11y/translations/module/pt.json +2 -2
- package/lib/es6/a11y/translations/module/sv.json +2 -2
- package/lib/es6/a11y/translations/module/tr.json +2 -2
- package/lib/es6/a11y/translations/module/vi.json +2 -2
- package/lib/es6/a11y/translations/module/zh.json +2 -2
- package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js +15 -15
- package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/color.js +1 -1
- package/lib/es6/color.js.map +1 -1
- package/lib/es6/component/Chart/AbstractChart.js +416 -462
- package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
- package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
- package/lib/es6/component/Chart/AreaChart.js +92 -111
- package/lib/es6/component/Chart/AreaChart.js.map +1 -1
- package/lib/es6/component/Chart/AreaChart.type.js.map +1 -1
- package/lib/es6/component/Chart/BarChart.js +225 -213
- package/lib/es6/component/Chart/BarChart.js.map +1 -1
- package/lib/es6/component/Chart/BarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/BubbleChart.js +109 -132
- package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
- package/lib/es6/component/Chart/BubbleChart.type.js.map +1 -1
- package/lib/es6/component/Chart/CigaretteChart.js +276 -301
- package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.js +70 -103
- package/lib/es6/component/Chart/CompactHorizontalBarChart.js.map +1 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.js +74 -90
- package/lib/es6/component/Chart/DonutChart.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.type.js.map +1 -1
- package/lib/es6/component/Chart/HistogramChart.js +121 -144
- package/lib/es6/component/Chart/HistogramChart.js.map +1 -1
- package/lib/es6/component/Chart/HistogramChart.type.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.js +90 -109
- package/lib/es6/component/Chart/LineChart.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.type.js.map +1 -1
- package/lib/es6/component/Chart/RadarChart.js +80 -107
- package/lib/es6/component/Chart/RadarChart.js.map +1 -1
- package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.js +113 -138
- package/lib/es6/component/Chart/ScatterPlotChart.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/es6/component/Chart/VennChart.js +97 -117
- package/lib/es6/component/Chart/VennChart.js.map +1 -1
- package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/BaseLegend.js +70 -104
- package/lib/es6/component/ChartLegend/BaseLegend.js.map +1 -1
- package/lib/es6/component/ChartLegend/BaseLegend.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +53 -65
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +198 -211
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +58 -68
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
- package/lib/es6/component/Cigarette/Cigarette.js +108 -122
- package/lib/es6/component/Cigarette/Cigarette.js.map +1 -1
- package/lib/es6/component/StackGroupBar/StackGroupBar.js +100 -130
- package/lib/es6/component/StackGroupBar/StackGroupBar.js.map +1 -1
- package/lib/es6/component/SvgElement.js +4 -5
- package/lib/es6/component/SvgElement.js.map +1 -1
- package/lib/es6/createElement.js +55 -54
- package/lib/es6/createElement.js.map +1 -1
- package/lib/es6/style/axis.shadow.css +3 -0
- package/lib/es6/style/plot.shadow.css +1 -3
- package/lib/es6/style/plotA11yModule.shadow.css +10 -11
- package/lib/es6/style/plotA11yView.shadow.css +13 -26
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +14 -14
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/types/Axis.d.js.map +1 -1
- package/lib/es6/types/CompactHorizontalBar.d.js.map +1 -1
- package/lib/es6/types/Hover.d.js.map +1 -1
- package/lib/es6/types/Line.d.js.map +1 -1
- package/lib/es6/types/Plot.d.js.map +1 -1
- package/lib/es6/types/Radar.d.js.map +1 -1
- package/lib/es6/types/ResponsiveContainer.d.js.map +1 -1
- package/lib/es6/types/Tooltip.d.js.map +1 -1
- package/lib/es6/types/Venn.d.js.map +1 -1
- package/lib/es6/utils.js +105 -144
- package/lib/es6/utils.js.map +1 -1
- package/lib/esm/AnimatedClipPath.mjs +24 -36
- package/lib/esm/Area.mjs +178 -149
- package/lib/esm/Axis.mjs +241 -242
- package/lib/esm/Bar.mjs +155 -137
- package/lib/esm/Bubble.mjs +205 -171
- package/lib/esm/CompactHorizontalBar.mjs +428 -383
- package/lib/esm/Donut.mjs +315 -266
- package/lib/esm/Dots.mjs +60 -49
- package/lib/esm/GroupBar.mjs +71 -75
- package/lib/esm/HorizontalBar.mjs +142 -120
- package/lib/esm/Hover.mjs +173 -163
- package/lib/esm/Line.mjs +174 -145
- package/lib/esm/Pattern.mjs +67 -63
- package/lib/esm/Plot.mjs +98 -95
- package/lib/esm/Radar.mjs +550 -498
- package/lib/esm/RadialTree.mjs +512 -416
- package/lib/esm/Reference.mjs +137 -122
- package/lib/esm/ResponsiveContainer.mjs +58 -69
- package/lib/esm/ScatterPlot.mjs +163 -162
- package/lib/esm/StackBar.mjs +126 -147
- package/lib/esm/StackedArea.mjs +53 -61
- package/lib/esm/Tooltip.mjs +185 -175
- package/lib/esm/Venn.mjs +170 -170
- package/lib/esm/a11y/DataAccessibilityTable.mjs +46 -73
- package/lib/esm/a11y/PlotA11yModule.mjs +37 -80
- package/lib/esm/a11y/PlotA11yView.mjs +99 -74
- package/lib/esm/a11y/bezier.mjs +16 -23
- package/lib/esm/a11y/focus.mjs +15 -16
- package/lib/esm/a11y/hints.mjs +65 -71
- package/lib/esm/a11y/insights.mjs +347 -495
- package/lib/esm/a11y/intl.mjs +4 -5
- package/lib/esm/a11y/locale.mjs +12 -14
- package/lib/esm/a11y/serialize.mjs +139 -152
- package/lib/esm/a11y/summarize.mjs +3 -3
- package/lib/esm/a11y/translations/module/__intergalactic-dynamic-locales.mjs +1 -1
- package/lib/esm/a11y/translations/module/de.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/en.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/es.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/fr.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/it.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/ja.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/ko.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/nl.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/pl.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/pt.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/sv.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/tr.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/vi.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/zh.json.mjs +2 -4
- package/lib/esm/a11y/translations/view/__intergalactic-dynamic-locales.mjs +1 -1
- package/lib/esm/color.mjs +1 -1
- package/lib/esm/component/Chart/AbstractChart.mjs +422 -415
- package/lib/esm/component/Chart/AreaChart.mjs +92 -91
- package/lib/esm/component/Chart/BarChart.mjs +225 -177
- package/lib/esm/component/Chart/BubbleChart.mjs +110 -118
- package/lib/esm/component/Chart/CigaretteChart.mjs +277 -268
- package/lib/esm/component/Chart/CompactHorizontalBarChart.mjs +70 -87
- package/lib/esm/component/Chart/DonutChart.mjs +74 -84
- package/lib/esm/component/Chart/HistogramChart.mjs +121 -117
- package/lib/esm/component/Chart/LineChart.mjs +90 -89
- package/lib/esm/component/Chart/RadarChart.mjs +81 -97
- package/lib/esm/component/Chart/ScatterPlotChart.mjs +113 -111
- package/lib/esm/component/Chart/VennChart.mjs +98 -111
- package/lib/esm/component/ChartLegend/BaseLegend.mjs +75 -97
- package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +54 -55
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +194 -165
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.type.mjs +1 -1
- package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +60 -58
- package/lib/esm/component/Cigarette/Cigarette.mjs +109 -99
- package/lib/esm/component/StackGroupBar/StackGroupBar.mjs +97 -111
- package/lib/esm/component/SvgElement.mjs +4 -4
- package/lib/esm/createElement.mjs +54 -37
- package/lib/esm/style/axis.shadow.css +3 -0
- package/lib/esm/style/plot.shadow.css +1 -3
- package/lib/esm/style/plotA11yModule.shadow.css +10 -11
- package/lib/esm/style/plotA11yView.shadow.css +13 -26
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +1 -1
- package/lib/esm/utils.mjs +103 -138
- package/lib/types/Axis.d.ts +4 -0
- package/lib/types/CompactHorizontalBar.d.ts +1 -1
- package/lib/types/Hover.d.ts +1 -1
- package/lib/types/Line.d.ts +1 -1
- package/lib/types/Plot.d.ts +1 -1
- package/lib/types/Radar.d.ts +1 -1
- package/lib/types/ResponsiveContainer.d.ts +1 -1
- package/lib/types/Tooltip.d.ts +1 -3
- package/lib/types/Venn.d.ts +1 -1
- package/lib/types/a11y/PlotA11yModule.d.ts +4 -11
- package/lib/types/a11y/PlotA11yView.d.ts +12 -1
- package/lib/types/a11y/translations/module/__intergalactic-dynamic-locales.d.ts +14 -14
- package/lib/types/component/Chart/AbstractChart.d.ts +1 -1
- package/lib/types/component/Chart/AbstractChart.type.d.ts +1 -1
- package/lib/types/component/Chart/AreaChart.type.d.ts +1 -1
- package/lib/types/component/Chart/BarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/BubbleChart.type.d.ts +1 -1
- package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/DonutChart.type.d.ts +1 -1
- package/lib/types/component/Chart/HistogramChart.type.d.ts +1 -1
- package/lib/types/component/Chart/LineChart.type.d.ts +1 -1
- package/lib/types/component/Chart/RadarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +1 -1
- package/lib/types/component/Chart/VennChart.type.d.ts +1 -1
- package/lib/types/component/ChartLegend/BaseLegend.d.ts +1 -1
- package/lib/types/component/ChartLegend/BaseLegend.type.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.type.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts +1 -1
- package/lib/types/utils.d.ts +10 -10
- package/package.json +11 -14
|
@@ -1,126 +1,136 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
6
|
-
import {
|
|
2
|
+
import { Component, sstyled } from "@semcore/core";
|
|
7
3
|
import { callAllEventHandlers } from "@semcore/core/lib/utils/assignProps";
|
|
8
4
|
import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
9
5
|
import React from "react";
|
|
10
6
|
import createElement from "../../createElement.mjs";
|
|
11
7
|
import { PatternFill } from "../../Pattern.mjs";
|
|
12
8
|
import { roundedPath } from "../../utils.mjs";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_this = _callSuper(this, CigaretteBarRoot2, [].concat(args));
|
|
21
|
-
_defineProperty(_this, "refElement", /* @__PURE__ */ React.createRef());
|
|
22
|
-
_defineProperty(_this, "handleMouseMove", function() {
|
|
23
|
-
_this.handlers.hovered(true);
|
|
24
|
-
_this.setCursor("pointer");
|
|
9
|
+
class CigaretteBarRoot extends Component {
|
|
10
|
+
constructor(...args) {
|
|
11
|
+
super(...args);
|
|
12
|
+
_defineProperty(this, "refElement", /* @__PURE__ */ React.createRef());
|
|
13
|
+
_defineProperty(this, "handleMouseMove", () => {
|
|
14
|
+
this.handlers.hovered(true);
|
|
15
|
+
this.setCursor("pointer");
|
|
25
16
|
});
|
|
26
|
-
_defineProperty(
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
_defineProperty(this, "handleMouseLeave", () => {
|
|
18
|
+
this.handlers.hovered(false);
|
|
19
|
+
this.setCursor("auto");
|
|
29
20
|
});
|
|
30
|
-
_defineProperty(
|
|
31
|
-
|
|
21
|
+
_defineProperty(this, "handleClick", (e) => {
|
|
22
|
+
const {
|
|
23
|
+
onClick,
|
|
24
|
+
dataKey
|
|
25
|
+
} = this.asProps;
|
|
32
26
|
if (onClick && e.currentTarget.tagName === "path") {
|
|
33
27
|
e.stopPropagation();
|
|
34
28
|
onClick(dataKey, e);
|
|
35
29
|
return false;
|
|
36
30
|
}
|
|
37
31
|
});
|
|
38
|
-
_defineProperty(
|
|
39
|
-
var
|
|
32
|
+
_defineProperty(this, "setCursor", (value) => {
|
|
33
|
+
var _a;
|
|
34
|
+
const {
|
|
35
|
+
onClick
|
|
36
|
+
} = this.asProps;
|
|
40
37
|
if (onClick) {
|
|
41
|
-
|
|
42
|
-
(_this$refElement$curr = _this.refElement.current) === null || _this$refElement$curr === void 0 || _this$refElement$curr.style.setProperty("cursor", value);
|
|
38
|
+
(_a = this.refElement.current) == null ? void 0 : _a.style.setProperty("cursor", value);
|
|
43
39
|
}
|
|
44
40
|
});
|
|
45
|
-
return _this;
|
|
46
41
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
42
|
+
uncontrolledProps() {
|
|
43
|
+
return {
|
|
44
|
+
hovered: false
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
getRect() {
|
|
48
|
+
const {
|
|
49
|
+
x,
|
|
50
|
+
y,
|
|
51
|
+
width,
|
|
52
|
+
height,
|
|
53
|
+
r: radius,
|
|
54
|
+
direction,
|
|
55
|
+
index,
|
|
56
|
+
hovered
|
|
57
|
+
} = this.asProps;
|
|
58
|
+
let xV = x;
|
|
59
|
+
let yV = y;
|
|
60
|
+
let widthV = width;
|
|
61
|
+
let heightV = height;
|
|
62
|
+
if (hovered && direction === "horizontal") {
|
|
63
|
+
yV = yV - 2;
|
|
64
|
+
heightV = heightV + 4;
|
|
54
65
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (hovered && direction === "horizontal") {
|
|
64
|
-
yV = yV - 2;
|
|
65
|
-
heightV = heightV + 4;
|
|
66
|
-
}
|
|
67
|
-
if (hovered && direction === "vertical") {
|
|
68
|
-
xV = xV - 2;
|
|
69
|
-
widthV = widthV + 4;
|
|
70
|
-
}
|
|
71
|
-
if (radius) {
|
|
72
|
-
if (direction === "horizontal") {
|
|
73
|
-
if (index === 0) {
|
|
74
|
-
return roundedPath(xV, yV, widthV, heightV, radius, true, false, true, false);
|
|
75
|
-
} else {
|
|
76
|
-
return roundedPath(xV, yV, widthV, heightV, radius, false, true, false, true);
|
|
77
|
-
}
|
|
66
|
+
if (hovered && direction === "vertical") {
|
|
67
|
+
xV = xV - 2;
|
|
68
|
+
widthV = widthV + 4;
|
|
69
|
+
}
|
|
70
|
+
if (radius) {
|
|
71
|
+
if (direction === "horizontal") {
|
|
72
|
+
if (index === 0) {
|
|
73
|
+
return roundedPath(xV, yV, widthV, heightV, radius, true, false, true, false);
|
|
78
74
|
} else {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
return roundedPath(xV, yV, widthV, heightV, radius, false, true, false, true);
|
|
76
|
+
}
|
|
77
|
+
} else {
|
|
78
|
+
if (index === 0) {
|
|
79
|
+
return roundedPath(xV, yV, widthV, heightV, radius, true, true, false, false);
|
|
80
|
+
} else {
|
|
81
|
+
return roundedPath(xV, yV, widthV, heightV, radius, false, false, true, true);
|
|
84
82
|
}
|
|
85
83
|
}
|
|
86
|
-
return roundedPath(xV, yV, widthV, heightV, radius);
|
|
87
|
-
}
|
|
88
|
-
}, {
|
|
89
|
-
key: "render",
|
|
90
|
-
value: function render() {
|
|
91
|
-
var _ref;
|
|
92
|
-
var SBar = this.Element;
|
|
93
|
-
var _this$asProps3 = this.asProps, styles = _this$asProps3.styles, color = _this$asProps3.color, data = _this$asProps3.data, dataKey = _this$asProps3.dataKey, index = _this$asProps3.index, hide = _this$asProps3.hide, uid = _this$asProps3.uid, duration = _this$asProps3.duration, onMouseMove = _this$asProps3.onMouseMove, onMouseLeave = _this$asProps3.onMouseLeave, transparent = _this$asProps3.transparent, resolveColor = _this$asProps3.resolveColor, patterns = _this$asProps3.patterns;
|
|
94
|
-
var dSvg = this.getRect();
|
|
95
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, {
|
|
96
|
-
key: "horizontal-bar-".concat(index)
|
|
97
|
-
}, (_ref = sstyled(styles), /* @__PURE__ */ React.createElement(SBar, _ref.cn("SBar", {
|
|
98
|
-
"ref": this.refElement,
|
|
99
|
-
"aria-hidden": true,
|
|
100
|
-
"render": "path",
|
|
101
|
-
"clipPath": "url(#".concat(uid, ")"),
|
|
102
|
-
"__excludeProps": ["data", "scale", "value", "offset"],
|
|
103
|
-
"childrenPosition": "above",
|
|
104
|
-
"value": data[dataKey],
|
|
105
|
-
"index": index,
|
|
106
|
-
"hide": hide,
|
|
107
|
-
"fill": resolveColor(color),
|
|
108
|
-
"pattern": patterns ? "url(#".concat(uid, "-").concat(index, "-pattern)") : void 0,
|
|
109
|
-
"transparent": transparent,
|
|
110
|
-
"d": dSvg,
|
|
111
|
-
"use:duration": "".concat(duration, "ms"),
|
|
112
|
-
"onMouseMove": callAllEventHandlers(onMouseMove, this.handleMouseMove),
|
|
113
|
-
"onMouseLeave": callAllEventHandlers(onMouseLeave, this.handleMouseLeave),
|
|
114
|
-
"use:onClick": this.handleClick
|
|
115
|
-
}))), patterns && /* @__PURE__ */ React.createElement(PatternFill, _ref.cn("PatternFill", {
|
|
116
|
-
"id": "".concat(uid, "-").concat(index, "-pattern"),
|
|
117
|
-
"patternKey": color,
|
|
118
|
-
"color": resolveColor(color),
|
|
119
|
-
"patterns": patterns
|
|
120
|
-
})));
|
|
121
84
|
}
|
|
122
|
-
|
|
123
|
-
}
|
|
85
|
+
return roundedPath(xV, yV, widthV, heightV, radius);
|
|
86
|
+
}
|
|
87
|
+
render() {
|
|
88
|
+
var _ref;
|
|
89
|
+
const SBar = this.Element;
|
|
90
|
+
const {
|
|
91
|
+
styles,
|
|
92
|
+
color,
|
|
93
|
+
data,
|
|
94
|
+
dataKey,
|
|
95
|
+
index,
|
|
96
|
+
hide,
|
|
97
|
+
uid,
|
|
98
|
+
duration,
|
|
99
|
+
onMouseMove,
|
|
100
|
+
onMouseLeave,
|
|
101
|
+
transparent,
|
|
102
|
+
resolveColor,
|
|
103
|
+
patterns
|
|
104
|
+
} = this.asProps;
|
|
105
|
+
const dSvg = this.getRect();
|
|
106
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, {
|
|
107
|
+
key: `horizontal-bar-${index}`
|
|
108
|
+
}, (_ref = sstyled(styles), /* @__PURE__ */ React.createElement(SBar, _ref.cn("SBar", {
|
|
109
|
+
"ref": this.refElement,
|
|
110
|
+
"aria-hidden": true,
|
|
111
|
+
"render": "path",
|
|
112
|
+
"clipPath": `url(#${uid})`,
|
|
113
|
+
"__excludeProps": ["data", "scale", "value", "offset"],
|
|
114
|
+
"childrenPosition": "above",
|
|
115
|
+
"value": data[dataKey],
|
|
116
|
+
"index": index,
|
|
117
|
+
"hide": hide,
|
|
118
|
+
"fill": resolveColor(color),
|
|
119
|
+
"pattern": patterns ? `url(#${uid}-${index}-pattern)` : void 0,
|
|
120
|
+
"transparent": transparent,
|
|
121
|
+
"d": dSvg,
|
|
122
|
+
"use:duration": `${duration}ms`,
|
|
123
|
+
"onMouseMove": callAllEventHandlers(onMouseMove, this.handleMouseMove),
|
|
124
|
+
"onMouseLeave": callAllEventHandlers(onMouseLeave, this.handleMouseLeave),
|
|
125
|
+
"use:onClick": this.handleClick
|
|
126
|
+
}))), patterns && /* @__PURE__ */ React.createElement(PatternFill, _ref.cn("PatternFill", {
|
|
127
|
+
"id": `${uid}-${index}-pattern`,
|
|
128
|
+
"patternKey": color,
|
|
129
|
+
"color": resolveColor(color),
|
|
130
|
+
"patterns": patterns
|
|
131
|
+
})));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
124
134
|
_defineProperty(CigaretteBarRoot, "displayName", "Cigarette.BarItem");
|
|
125
135
|
_defineProperty(CigaretteBarRoot, "enhance", [uniqueIDEnhancement()]);
|
|
126
136
|
_defineProperty(CigaretteBarRoot, "style", {});
|
|
@@ -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 { scaleBand } from "d3-scale";
|
|
@@ -12,124 +6,116 @@ import React from "react";
|
|
|
12
6
|
import Bar, { MIN_HEIGHT } from "../../Bar.mjs";
|
|
13
7
|
import createElement from "../../createElement.mjs";
|
|
14
8
|
import { scaleToBand, getChartDefaultColorName } from "../../utils.mjs";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_defineProperty(
|
|
22
|
-
_defineProperty(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
React.Children.toArray(children).forEach(
|
|
9
|
+
const XY0 = Symbol("XY0");
|
|
10
|
+
class StackGroupBarRoot extends Component {
|
|
11
|
+
constructor(props) {
|
|
12
|
+
super(props);
|
|
13
|
+
_defineProperty(this, "groupDomain", /* @__PURE__ */ new Set());
|
|
14
|
+
_defineProperty(this, "scaleGroup", scaleBand());
|
|
15
|
+
_defineProperty(this, "stacks", {});
|
|
16
|
+
_defineProperty(this, "offsetBars", []);
|
|
17
|
+
const {
|
|
18
|
+
children
|
|
19
|
+
} = props;
|
|
20
|
+
const groups = {};
|
|
21
|
+
React.Children.toArray(children).forEach((child) => {
|
|
28
22
|
if (/* @__PURE__ */ React.isValidElement(child) && child.type === StackGroupBar.Bar && !child.props.hide) {
|
|
29
|
-
|
|
23
|
+
this.groupDomain.add(child.props.group);
|
|
30
24
|
if (!groups[child.props.group]) {
|
|
31
25
|
groups[child.props.group] = [];
|
|
32
26
|
}
|
|
33
27
|
groups[child.props.group].push(child.props.y);
|
|
34
28
|
}
|
|
35
29
|
});
|
|
36
|
-
Object.entries(groups).forEach(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
_this.stacks[group].keys(stackKeys);
|
|
30
|
+
Object.entries(groups).forEach(([group, stackKeys]) => {
|
|
31
|
+
this.stacks[group] = stack();
|
|
32
|
+
this.stacks[group].keys(stackKeys);
|
|
40
33
|
});
|
|
41
|
-
return _this;
|
|
42
34
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
render: "g",
|
|
123
|
-
childrenPosition: "inside"
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
}]);
|
|
127
|
-
})(Component);
|
|
35
|
+
componentDidMount() {
|
|
36
|
+
const {
|
|
37
|
+
scale
|
|
38
|
+
} = this.asProps;
|
|
39
|
+
this.scaleGroup = scaleBand().range([0, scaleToBand(scale[0]).bandwidth()]).domain(this.groupDomain).paddingInner(0.1).paddingOuter(0.1);
|
|
40
|
+
this.forceUpdate();
|
|
41
|
+
}
|
|
42
|
+
getSeries(group) {
|
|
43
|
+
var _a, _b;
|
|
44
|
+
const {
|
|
45
|
+
data
|
|
46
|
+
} = this.asProps;
|
|
47
|
+
return (_b = (_a = this.stacks)[group]) == null ? void 0 : _b.call(_a, data);
|
|
48
|
+
}
|
|
49
|
+
getBarProps({
|
|
50
|
+
y,
|
|
51
|
+
group,
|
|
52
|
+
hMin = MIN_HEIGHT
|
|
53
|
+
}, index) {
|
|
54
|
+
const {
|
|
55
|
+
x,
|
|
56
|
+
r,
|
|
57
|
+
scale,
|
|
58
|
+
maxBarSize = Number.POSITIVE_INFINITY,
|
|
59
|
+
patterns
|
|
60
|
+
} = this.asProps;
|
|
61
|
+
const [, yScale] = scale;
|
|
62
|
+
const allGroupSeries = this.getSeries(group);
|
|
63
|
+
const seriesIndex = allGroupSeries.findIndex((s) => s.key === y);
|
|
64
|
+
const series = allGroupSeries[seriesIndex] || [];
|
|
65
|
+
const rBar = series.map((_s, i) => allGroupSeries.slice(seriesIndex + 1).some((bar) => bar[i][0] !== bar[i][1]) ? 0 : r);
|
|
66
|
+
this.offsetBars[seriesIndex] = this.offsetBars[seriesIndex] ?? [];
|
|
67
|
+
const data = series.map((s) => ({
|
|
68
|
+
...s.data,
|
|
69
|
+
[y]: s[1],
|
|
70
|
+
[XY0]: s[0]
|
|
71
|
+
}));
|
|
72
|
+
const bandWidth = this.scaleGroup.bandwidth() ?? 0;
|
|
73
|
+
const width = Math.min(bandWidth, maxBarSize);
|
|
74
|
+
const calcOffset = (i) => {
|
|
75
|
+
const offsetX = (this.scaleGroup(group) ?? 0) + bandWidth / 2 - width / 2;
|
|
76
|
+
const offsetY = this.offsetBars.reduce((offset, offsetBar) => offset - (offsetBar[i] ?? 0), 0);
|
|
77
|
+
const d = data[i];
|
|
78
|
+
const absHeight = Math.abs(yScale(d[y]) - Math.min(yScale(yScale.domain()[0]), yScale(d[XY0] ?? 0)));
|
|
79
|
+
const isEmptyValue = Number(d[y] - (d[XY0] ?? 0)) === 0;
|
|
80
|
+
if (isEmptyValue || absHeight >= hMin) {
|
|
81
|
+
this.offsetBars[seriesIndex][i] = 0;
|
|
82
|
+
} else {
|
|
83
|
+
const offsetValue = hMin - absHeight;
|
|
84
|
+
this.offsetBars[seriesIndex][i] = d[y] > 0 ? offsetValue : -offsetValue;
|
|
85
|
+
}
|
|
86
|
+
return [offsetX, offsetY];
|
|
87
|
+
};
|
|
88
|
+
const barProps = {
|
|
89
|
+
offset: calcOffset,
|
|
90
|
+
width,
|
|
91
|
+
color: getChartDefaultColorName(index),
|
|
92
|
+
x,
|
|
93
|
+
groupKey: x,
|
|
94
|
+
patterns,
|
|
95
|
+
data,
|
|
96
|
+
hMin,
|
|
97
|
+
y0: XY0,
|
|
98
|
+
r: rBar,
|
|
99
|
+
maxBarSize
|
|
100
|
+
};
|
|
101
|
+
return barProps;
|
|
102
|
+
}
|
|
103
|
+
render() {
|
|
104
|
+
const Element = this.Element;
|
|
105
|
+
this.asProps.dataHintsHandler.establishDataType("grouped-values");
|
|
106
|
+
this.offsetBars = [];
|
|
107
|
+
return /* @__PURE__ */ React.createElement(Element, {
|
|
108
|
+
"aria-hidden": true,
|
|
109
|
+
render: "g",
|
|
110
|
+
childrenPosition: "inside"
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
128
114
|
_defineProperty(StackGroupBarRoot, "displayName", "StackGroupBar");
|
|
129
115
|
_defineProperty(StackGroupBarRoot, "defaultProps", {
|
|
130
116
|
r: 2
|
|
131
117
|
});
|
|
132
|
-
|
|
118
|
+
const StackGroupBar = createElement(StackGroupBarRoot, {
|
|
133
119
|
Bar
|
|
134
120
|
});
|
|
135
121
|
export {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
1
|
import propsForElement from "@semcore/core/lib/utils/propsForElement";
|
|
3
2
|
import React from "react";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const SvgElement = ({
|
|
4
|
+
tag: Tag,
|
|
5
|
+
...props
|
|
6
|
+
}) => {
|
|
7
7
|
return (
|
|
8
8
|
// @ts-ignore
|
|
9
9
|
/* @__PURE__ */ React.createElement(Tag, propsForElement(props, Tag))
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
2
|
import { createComponent, createBaseComponent, CONTEXT_COMPONENT } from "@semcore/core";
|
|
5
3
|
import assignProps from "@semcore/core/lib/utils/assignProps";
|
|
6
4
|
import getOriginChildren from "@semcore/core/lib/utils/getOriginChildren";
|
|
@@ -9,31 +7,41 @@ import { useForkRef } from "@semcore/core/lib/utils/ref";
|
|
|
9
7
|
import hoistNonReactStatics from "hoist-non-react-statics";
|
|
10
8
|
import React from "react";
|
|
11
9
|
import Plot from "./Plot.mjs";
|
|
12
|
-
|
|
13
|
-
var EXCLUDE_PROPS = ["data", "scale"];
|
|
10
|
+
const EXCLUDE_PROPS = ["data", "scale"];
|
|
14
11
|
function createElementRender() {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
const Element = /* @__PURE__ */ React.forwardRef(function({
|
|
13
|
+
render,
|
|
14
|
+
childrenPosition = "below",
|
|
15
|
+
x: xS,
|
|
16
|
+
y: yS,
|
|
17
|
+
...source
|
|
18
|
+
}, ref) {
|
|
19
|
+
const {
|
|
20
|
+
forwardRef = null,
|
|
21
|
+
children: _children,
|
|
22
|
+
Children,
|
|
23
|
+
x = xS,
|
|
24
|
+
y = yS,
|
|
25
|
+
...props
|
|
26
|
+
} = Element.props;
|
|
27
|
+
let children = getOriginChildren(Children);
|
|
28
|
+
let mergedProps = assignProps({
|
|
22
29
|
x: xS,
|
|
23
|
-
y: yS
|
|
24
|
-
|
|
30
|
+
y: yS,
|
|
31
|
+
...props,
|
|
25
32
|
ref: useForkRef(forwardRef, ref)
|
|
26
|
-
}
|
|
33
|
+
}, {
|
|
27
34
|
x,
|
|
28
|
-
y
|
|
29
|
-
|
|
35
|
+
y,
|
|
36
|
+
...source
|
|
37
|
+
});
|
|
30
38
|
if (typeof children === "function") {
|
|
31
|
-
|
|
39
|
+
const _child = mergedProps.children;
|
|
32
40
|
mergedProps = assignProps(children(mergedProps), mergedProps);
|
|
33
41
|
children = mergedProps.children;
|
|
34
42
|
mergedProps.children = _child;
|
|
35
43
|
}
|
|
36
|
-
|
|
44
|
+
const Tag = typeof render === "string" ? mergedProps.tag || render : render;
|
|
37
45
|
if (childrenPosition === "inside") {
|
|
38
46
|
mergedProps.children = children === void 0 ? mergedProps.children : children;
|
|
39
47
|
}
|
|
@@ -44,9 +52,10 @@ function createElementRender() {
|
|
|
44
52
|
key: "child-above"
|
|
45
53
|
}, childrenPosition === "above" ? children : null), /* @__PURE__ */ React.createElement(Tag, _extends({
|
|
46
54
|
"aria-hidden": true
|
|
47
|
-
}, propsForElement(
|
|
48
|
-
__excludeProps: EXCLUDE_PROPS
|
|
49
|
-
|
|
55
|
+
}, propsForElement({
|
|
56
|
+
__excludeProps: EXCLUDE_PROPS,
|
|
57
|
+
...mergedProps
|
|
58
|
+
}, Tag), {
|
|
50
59
|
key: "element"
|
|
51
60
|
})), /* @__PURE__ */ React.createElement(React.Fragment, {
|
|
52
61
|
key: "child-below"
|
|
@@ -57,44 +66,52 @@ function createElementRender() {
|
|
|
57
66
|
}
|
|
58
67
|
function elementEnhancement() {
|
|
59
68
|
return {
|
|
60
|
-
init: function
|
|
69
|
+
init: function() {
|
|
61
70
|
this.Element = createElementRender();
|
|
62
71
|
},
|
|
63
|
-
asProps: function
|
|
64
|
-
|
|
72
|
+
asProps: function({
|
|
73
|
+
$rootProps,
|
|
74
|
+
...props
|
|
75
|
+
}, _WrapperComponent, isFunction) {
|
|
65
76
|
if (isFunction) {
|
|
66
|
-
return
|
|
77
|
+
return {
|
|
78
|
+
...$rootProps,
|
|
79
|
+
...props,
|
|
67
80
|
Element: this.Element
|
|
68
|
-
}
|
|
81
|
+
};
|
|
69
82
|
}
|
|
70
|
-
return
|
|
83
|
+
return {
|
|
84
|
+
...$rootProps,
|
|
85
|
+
...props
|
|
86
|
+
};
|
|
71
87
|
},
|
|
72
|
-
render: function
|
|
88
|
+
render: function(render, props) {
|
|
73
89
|
this.Element.props = props;
|
|
74
|
-
return
|
|
90
|
+
return render;
|
|
75
91
|
}
|
|
76
92
|
};
|
|
77
93
|
}
|
|
78
94
|
function WrapComponent(Element) {
|
|
79
95
|
function ElementWithContext(props, ref) {
|
|
80
|
-
|
|
96
|
+
const {
|
|
97
|
+
$rootProps
|
|
98
|
+
} = React.useContext(Plot[CONTEXT_COMPONENT]);
|
|
81
99
|
return /* @__PURE__ */ React.createElement(Element, _extends({
|
|
82
100
|
ref,
|
|
83
101
|
$rootProps
|
|
84
102
|
}, props));
|
|
85
103
|
}
|
|
86
104
|
ElementWithContext.displayName = Element.displayName;
|
|
87
|
-
|
|
105
|
+
const WrapperComponent = createBaseComponent(ElementWithContext);
|
|
88
106
|
WrapperComponent.displayName = Element.displayName;
|
|
89
107
|
return hoistNonReactStatics(WrapperComponent, Element);
|
|
90
108
|
}
|
|
91
|
-
function createElement(ElementRoot) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
var Element = createComponent(ElementRoot, child, _objectSpread(_objectSpread({}, options), {}, {
|
|
109
|
+
function createElement(ElementRoot, child = {}, options = {}) {
|
|
110
|
+
const Element = createComponent(ElementRoot, child, {
|
|
111
|
+
...options,
|
|
95
112
|
enhancements: [elementEnhancement]
|
|
96
|
-
})
|
|
97
|
-
Object.keys(child).forEach(
|
|
113
|
+
});
|
|
114
|
+
Object.keys(child).forEach((n) => {
|
|
98
115
|
Element[n] = WrapComponent(Element[n]);
|
|
99
116
|
});
|
|
100
117
|
return WrapComponent(Element);
|