@semcore/d3-chart 16.5.0 → 17.0.0-prerelease.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/lib/cjs/AnimatedClipPath.js +28 -41
- package/lib/cjs/AnimatedClipPath.js.map +1 -1
- package/lib/cjs/Area.js +187 -223
- package/lib/cjs/Area.js.map +1 -1
- package/lib/cjs/Axis.js +248 -327
- package/lib/cjs/Axis.js.map +1 -1
- package/lib/cjs/Bar.js +162 -185
- package/lib/cjs/Bar.js.map +1 -1
- package/lib/cjs/Bubble.js +219 -248
- package/lib/cjs/Bubble.js.map +1 -1
- package/lib/cjs/CompactHorizontalBar.js +448 -482
- package/lib/cjs/CompactHorizontalBar.js.map +1 -1
- package/lib/cjs/Donut.js +349 -396
- package/lib/cjs/Donut.js.map +1 -1
- package/lib/cjs/Dots.js +67 -86
- package/lib/cjs/Dots.js.map +1 -1
- package/lib/cjs/GroupBar.js +78 -93
- package/lib/cjs/GroupBar.js.map +1 -1
- package/lib/cjs/HorizontalBar.js +149 -167
- package/lib/cjs/HorizontalBar.js.map +1 -1
- package/lib/cjs/Hover.js +178 -207
- package/lib/cjs/Hover.js.map +1 -1
- package/lib/cjs/Line.js +182 -222
- package/lib/cjs/Line.js.map +1 -1
- package/lib/cjs/Pattern.js +124 -126
- package/lib/cjs/Pattern.js.map +1 -1
- package/lib/cjs/Plot.js +100 -126
- package/lib/cjs/Plot.js.map +1 -1
- package/lib/cjs/Radar.js +576 -681
- package/lib/cjs/Radar.js.map +1 -1
- package/lib/cjs/RadialTree.js +518 -571
- package/lib/cjs/RadialTree.js.map +1 -1
- package/lib/cjs/Reference.js +147 -178
- package/lib/cjs/Reference.js.map +1 -1
- package/lib/cjs/ResponsiveContainer.js +64 -82
- package/lib/cjs/ResponsiveContainer.js.map +1 -1
- package/lib/cjs/ScatterPlot.js +169 -199
- package/lib/cjs/ScatterPlot.js.map +1 -1
- package/lib/cjs/StackBar.js +135 -177
- package/lib/cjs/StackBar.js.map +1 -1
- package/lib/cjs/StackedArea.js +60 -73
- package/lib/cjs/StackedArea.js.map +1 -1
- package/lib/cjs/Tooltip.js +193 -208
- package/lib/cjs/Tooltip.js.map +1 -1
- package/lib/cjs/Venn.js +182 -217
- package/lib/cjs/Venn.js.map +1 -1
- package/lib/cjs/a11y/DataAccessibilityTable.js +45 -83
- package/lib/cjs/a11y/DataAccessibilityTable.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yModule.js +37 -97
- package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yView.js +97 -91
- package/lib/cjs/a11y/PlotA11yView.js.map +1 -1
- package/lib/cjs/a11y/bezier.js +17 -23
- package/lib/cjs/a11y/bezier.js.map +1 -1
- package/lib/cjs/a11y/focus.js +16 -16
- package/lib/cjs/a11y/focus.js.map +1 -1
- package/lib/cjs/a11y/hints.js +72 -75
- package/lib/cjs/a11y/hints.js.map +1 -1
- package/lib/cjs/a11y/insights.js +354 -525
- package/lib/cjs/a11y/insights.js.map +1 -1
- package/lib/cjs/a11y/intl.js +5 -5
- package/lib/cjs/a11y/intl.js.map +1 -1
- package/lib/cjs/a11y/locale.js +12 -19
- package/lib/cjs/a11y/locale.js.map +1 -1
- package/lib/cjs/a11y/serialize.js +164 -203
- package/lib/cjs/a11y/serialize.js.map +1 -1
- package/lib/cjs/a11y/summarize.js +7 -6
- package/lib/cjs/a11y/summarize.js.map +1 -1
- package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js +16 -16
- package/lib/cjs/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/a11y/translations/module/de.json +2 -2
- package/lib/cjs/a11y/translations/module/en.json +2 -2
- package/lib/cjs/a11y/translations/module/es.json +2 -2
- package/lib/cjs/a11y/translations/module/fr.json +2 -2
- package/lib/cjs/a11y/translations/module/it.json +2 -2
- package/lib/cjs/a11y/translations/module/ja.json +2 -2
- package/lib/cjs/a11y/translations/module/ko.json +2 -2
- package/lib/cjs/a11y/translations/module/nl.json +2 -2
- package/lib/cjs/a11y/translations/module/pl.json +2 -2
- package/lib/cjs/a11y/translations/module/pt.json +2 -2
- package/lib/cjs/a11y/translations/module/sv.json +2 -2
- package/lib/cjs/a11y/translations/module/tr.json +2 -2
- package/lib/cjs/a11y/translations/module/vi.json +2 -2
- package/lib/cjs/a11y/translations/module/zh.json +2 -2
- package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js +16 -16
- package/lib/cjs/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/color.js +1 -1
- package/lib/cjs/color.js.map +1 -1
- package/lib/cjs/component/Chart/AbstractChart.js +421 -466
- package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
- package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/AreaChart.js +97 -115
- package/lib/cjs/component/Chart/AreaChart.js.map +1 -1
- package/lib/cjs/component/Chart/AreaChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/BarChart.js +229 -216
- package/lib/cjs/component/Chart/BarChart.js.map +1 -1
- package/lib/cjs/component/Chart/BarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/BubbleChart.js +114 -136
- package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
- package/lib/cjs/component/Chart/BubbleChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.js +280 -305
- package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.js +76 -108
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.js.map +1 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.js +80 -95
- package/lib/cjs/component/Chart/DonutChart.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/HistogramChart.js +126 -148
- package/lib/cjs/component/Chart/HistogramChart.js.map +1 -1
- package/lib/cjs/component/Chart/HistogramChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.js +95 -113
- package/lib/cjs/component/Chart/LineChart.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/RadarChart.js +84 -110
- package/lib/cjs/component/Chart/RadarChart.js.map +1 -1
- package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.js +119 -143
- package/lib/cjs/component/Chart/ScatterPlotChart.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/VennChart.js +103 -122
- package/lib/cjs/component/Chart/VennChart.js.map +1 -1
- package/lib/cjs/component/Chart/VennChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/index.js +2 -2
- package/lib/cjs/component/Chart/index.js.map +1 -1
- package/lib/cjs/component/ChartLegend/BaseLegend.js +72 -105
- package/lib/cjs/component/ChartLegend/BaseLegend.js.map +1 -1
- package/lib/cjs/component/ChartLegend/BaseLegend.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +58 -70
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +208 -221
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +63 -73
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/index.js +4 -4
- package/lib/cjs/component/ChartLegend/index.js.map +1 -1
- package/lib/cjs/component/Cigarette/Cigarette.js +115 -129
- package/lib/cjs/component/Cigarette/Cigarette.js.map +1 -1
- package/lib/cjs/component/StackGroupBar/StackGroupBar.js +107 -137
- package/lib/cjs/component/StackGroupBar/StackGroupBar.js.map +1 -1
- package/lib/cjs/component/SvgElement.js +7 -7
- package/lib/cjs/component/SvgElement.js.map +1 -1
- package/lib/cjs/createElement.js +66 -65
- package/lib/cjs/createElement.js.map +1 -1
- package/lib/cjs/index.js +62 -62
- package/lib/cjs/style/axis.shadow.css +3 -0
- package/lib/cjs/style/plot.shadow.css +1 -3
- package/lib/cjs/style/plotA11yModule.shadow.css +10 -11
- package/lib/cjs/style/plotA11yView.shadow.css +13 -26
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +15 -15
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/types/Axis.d.js.map +1 -1
- package/lib/cjs/types/CompactHorizontalBar.d.js.map +1 -1
- package/lib/cjs/types/Hover.d.js.map +1 -1
- package/lib/cjs/types/Line.d.js.map +1 -1
- package/lib/cjs/types/Plot.d.js.map +1 -1
- package/lib/cjs/types/Radar.d.js.map +1 -1
- package/lib/cjs/types/ResponsiveContainer.d.js.map +1 -1
- package/lib/cjs/types/Tooltip.d.js.map +1 -1
- package/lib/cjs/types/Venn.d.js.map +1 -1
- package/lib/cjs/types/index.d.js +80 -80
- package/lib/cjs/types/index.d.js.map +1 -1
- package/lib/cjs/utils.js +122 -145
- package/lib/cjs/utils.js.map +1 -1
- package/lib/es6/AnimatedClipPath.js +24 -37
- package/lib/es6/AnimatedClipPath.js.map +1 -1
- package/lib/es6/Area.js +179 -215
- package/lib/es6/Area.js.map +1 -1
- package/lib/es6/Axis.js +242 -321
- package/lib/es6/Axis.js.map +1 -1
- package/lib/es6/Bar.js +154 -177
- package/lib/es6/Bar.js.map +1 -1
- package/lib/es6/Bubble.js +206 -235
- package/lib/es6/Bubble.js.map +1 -1
- package/lib/es6/CompactHorizontalBar.js +433 -467
- package/lib/es6/CompactHorizontalBar.js.map +1 -1
- package/lib/es6/Donut.js +337 -384
- package/lib/es6/Donut.js.map +1 -1
- package/lib/es6/Dots.js +60 -79
- package/lib/es6/Dots.js.map +1 -1
- package/lib/es6/GroupBar.js +74 -89
- package/lib/es6/GroupBar.js.map +1 -1
- package/lib/es6/HorizontalBar.js +141 -159
- package/lib/es6/HorizontalBar.js.map +1 -1
- package/lib/es6/Hover.js +174 -203
- package/lib/es6/Hover.js.map +1 -1
- package/lib/es6/Line.js +173 -213
- package/lib/es6/Line.js.map +1 -1
- package/lib/es6/Pattern.js +68 -74
- package/lib/es6/Pattern.js.map +1 -1
- package/lib/es6/Plot.js +95 -121
- package/lib/es6/Plot.js.map +1 -1
- package/lib/es6/Radar.js +554 -659
- package/lib/es6/Radar.js.map +1 -1
- package/lib/es6/RadialTree.js +500 -553
- package/lib/es6/RadialTree.js.map +1 -1
- package/lib/es6/Reference.js +140 -171
- package/lib/es6/Reference.js.map +1 -1
- package/lib/es6/ResponsiveContainer.js +58 -76
- package/lib/es6/ResponsiveContainer.js.map +1 -1
- package/lib/es6/ScatterPlot.js +161 -191
- package/lib/es6/ScatterPlot.js.map +1 -1
- package/lib/es6/StackBar.js +130 -172
- package/lib/es6/StackBar.js.map +1 -1
- package/lib/es6/StackedArea.js +56 -69
- package/lib/es6/StackedArea.js.map +1 -1
- package/lib/es6/Tooltip.js +183 -198
- package/lib/es6/Tooltip.js.map +1 -1
- package/lib/es6/Venn.js +169 -204
- package/lib/es6/Venn.js.map +1 -1
- package/lib/es6/a11y/DataAccessibilityTable.js +41 -80
- package/lib/es6/a11y/DataAccessibilityTable.js.map +1 -1
- package/lib/es6/a11y/PlotA11yModule.js +35 -95
- package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
- package/lib/es6/a11y/PlotA11yView.js +89 -84
- package/lib/es6/a11y/PlotA11yView.js.map +1 -1
- package/lib/es6/a11y/bezier.js +16 -23
- package/lib/es6/a11y/bezier.js.map +1 -1
- package/lib/es6/a11y/focus.js +15 -16
- package/lib/es6/a11y/focus.js.map +1 -1
- package/lib/es6/a11y/hints.js +67 -73
- package/lib/es6/a11y/hints.js.map +1 -1
- package/lib/es6/a11y/insights.js +353 -524
- package/lib/es6/a11y/insights.js.map +1 -1
- package/lib/es6/a11y/intl.js +4 -5
- package/lib/es6/a11y/intl.js.map +1 -1
- package/lib/es6/a11y/locale.js +11 -18
- package/lib/es6/a11y/locale.js.map +1 -1
- package/lib/es6/a11y/serialize.js +162 -203
- package/lib/es6/a11y/serialize.js.map +1 -1
- package/lib/es6/a11y/summarize.js +6 -6
- package/lib/es6/a11y/summarize.js.map +1 -1
- package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js +15 -15
- package/lib/es6/a11y/translations/module/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/a11y/translations/module/de.json +2 -2
- package/lib/es6/a11y/translations/module/en.json +2 -2
- package/lib/es6/a11y/translations/module/es.json +2 -2
- package/lib/es6/a11y/translations/module/fr.json +2 -2
- package/lib/es6/a11y/translations/module/it.json +2 -2
- package/lib/es6/a11y/translations/module/ja.json +2 -2
- package/lib/es6/a11y/translations/module/ko.json +2 -2
- package/lib/es6/a11y/translations/module/nl.json +2 -2
- package/lib/es6/a11y/translations/module/pl.json +2 -2
- package/lib/es6/a11y/translations/module/pt.json +2 -2
- package/lib/es6/a11y/translations/module/sv.json +2 -2
- package/lib/es6/a11y/translations/module/tr.json +2 -2
- package/lib/es6/a11y/translations/module/vi.json +2 -2
- package/lib/es6/a11y/translations/module/zh.json +2 -2
- package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js +15 -15
- package/lib/es6/a11y/translations/view/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/color.js +1 -1
- package/lib/es6/color.js.map +1 -1
- package/lib/es6/component/Chart/AbstractChart.js +416 -462
- package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
- package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
- package/lib/es6/component/Chart/AreaChart.js +92 -111
- package/lib/es6/component/Chart/AreaChart.js.map +1 -1
- package/lib/es6/component/Chart/AreaChart.type.js.map +1 -1
- package/lib/es6/component/Chart/BarChart.js +225 -213
- package/lib/es6/component/Chart/BarChart.js.map +1 -1
- package/lib/es6/component/Chart/BarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/BubbleChart.js +109 -132
- package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
- package/lib/es6/component/Chart/BubbleChart.type.js.map +1 -1
- package/lib/es6/component/Chart/CigaretteChart.js +276 -301
- package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.js +70 -103
- package/lib/es6/component/Chart/CompactHorizontalBarChart.js.map +1 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.js +74 -90
- package/lib/es6/component/Chart/DonutChart.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.type.js.map +1 -1
- package/lib/es6/component/Chart/HistogramChart.js +121 -144
- package/lib/es6/component/Chart/HistogramChart.js.map +1 -1
- package/lib/es6/component/Chart/HistogramChart.type.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.js +90 -109
- package/lib/es6/component/Chart/LineChart.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.type.js.map +1 -1
- package/lib/es6/component/Chart/RadarChart.js +80 -107
- package/lib/es6/component/Chart/RadarChart.js.map +1 -1
- package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.js +113 -138
- package/lib/es6/component/Chart/ScatterPlotChart.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/es6/component/Chart/VennChart.js +97 -117
- package/lib/es6/component/Chart/VennChart.js.map +1 -1
- package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/BaseLegend.js +70 -104
- package/lib/es6/component/ChartLegend/BaseLegend.js.map +1 -1
- package/lib/es6/component/ChartLegend/BaseLegend.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +53 -65
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +198 -211
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +58 -68
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
- package/lib/es6/component/Cigarette/Cigarette.js +108 -122
- package/lib/es6/component/Cigarette/Cigarette.js.map +1 -1
- package/lib/es6/component/StackGroupBar/StackGroupBar.js +100 -130
- package/lib/es6/component/StackGroupBar/StackGroupBar.js.map +1 -1
- package/lib/es6/component/SvgElement.js +4 -5
- package/lib/es6/component/SvgElement.js.map +1 -1
- package/lib/es6/createElement.js +55 -54
- package/lib/es6/createElement.js.map +1 -1
- package/lib/es6/style/axis.shadow.css +3 -0
- package/lib/es6/style/plot.shadow.css +1 -3
- package/lib/es6/style/plotA11yModule.shadow.css +10 -11
- package/lib/es6/style/plotA11yView.shadow.css +13 -26
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +14 -14
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/types/Axis.d.js.map +1 -1
- package/lib/es6/types/CompactHorizontalBar.d.js.map +1 -1
- package/lib/es6/types/Hover.d.js.map +1 -1
- package/lib/es6/types/Line.d.js.map +1 -1
- package/lib/es6/types/Plot.d.js.map +1 -1
- package/lib/es6/types/Radar.d.js.map +1 -1
- package/lib/es6/types/ResponsiveContainer.d.js.map +1 -1
- package/lib/es6/types/Tooltip.d.js.map +1 -1
- package/lib/es6/types/Venn.d.js.map +1 -1
- package/lib/es6/utils.js +105 -144
- package/lib/es6/utils.js.map +1 -1
- package/lib/esm/AnimatedClipPath.mjs +24 -36
- package/lib/esm/Area.mjs +178 -149
- package/lib/esm/Axis.mjs +241 -242
- package/lib/esm/Bar.mjs +155 -137
- package/lib/esm/Bubble.mjs +205 -171
- package/lib/esm/CompactHorizontalBar.mjs +428 -383
- package/lib/esm/Donut.mjs +315 -266
- package/lib/esm/Dots.mjs +60 -49
- package/lib/esm/GroupBar.mjs +71 -75
- package/lib/esm/HorizontalBar.mjs +142 -120
- package/lib/esm/Hover.mjs +173 -163
- package/lib/esm/Line.mjs +174 -145
- package/lib/esm/Pattern.mjs +67 -63
- package/lib/esm/Plot.mjs +98 -95
- package/lib/esm/Radar.mjs +550 -498
- package/lib/esm/RadialTree.mjs +512 -416
- package/lib/esm/Reference.mjs +137 -122
- package/lib/esm/ResponsiveContainer.mjs +58 -69
- package/lib/esm/ScatterPlot.mjs +163 -162
- package/lib/esm/StackBar.mjs +126 -147
- package/lib/esm/StackedArea.mjs +53 -61
- package/lib/esm/Tooltip.mjs +185 -175
- package/lib/esm/Venn.mjs +170 -170
- package/lib/esm/a11y/DataAccessibilityTable.mjs +46 -73
- package/lib/esm/a11y/PlotA11yModule.mjs +37 -80
- package/lib/esm/a11y/PlotA11yView.mjs +99 -74
- package/lib/esm/a11y/bezier.mjs +16 -23
- package/lib/esm/a11y/focus.mjs +15 -16
- package/lib/esm/a11y/hints.mjs +65 -71
- package/lib/esm/a11y/insights.mjs +347 -495
- package/lib/esm/a11y/intl.mjs +4 -5
- package/lib/esm/a11y/locale.mjs +12 -14
- package/lib/esm/a11y/serialize.mjs +139 -152
- package/lib/esm/a11y/summarize.mjs +3 -3
- package/lib/esm/a11y/translations/module/__intergalactic-dynamic-locales.mjs +1 -1
- package/lib/esm/a11y/translations/module/de.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/en.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/es.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/fr.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/it.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/ja.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/ko.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/nl.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/pl.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/pt.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/sv.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/tr.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/vi.json.mjs +2 -4
- package/lib/esm/a11y/translations/module/zh.json.mjs +2 -4
- package/lib/esm/a11y/translations/view/__intergalactic-dynamic-locales.mjs +1 -1
- package/lib/esm/color.mjs +1 -1
- package/lib/esm/component/Chart/AbstractChart.mjs +422 -415
- package/lib/esm/component/Chart/AreaChart.mjs +92 -91
- package/lib/esm/component/Chart/BarChart.mjs +225 -177
- package/lib/esm/component/Chart/BubbleChart.mjs +110 -118
- package/lib/esm/component/Chart/CigaretteChart.mjs +277 -268
- package/lib/esm/component/Chart/CompactHorizontalBarChart.mjs +70 -87
- package/lib/esm/component/Chart/DonutChart.mjs +74 -84
- package/lib/esm/component/Chart/HistogramChart.mjs +121 -117
- package/lib/esm/component/Chart/LineChart.mjs +90 -89
- package/lib/esm/component/Chart/RadarChart.mjs +81 -97
- package/lib/esm/component/Chart/ScatterPlotChart.mjs +113 -111
- package/lib/esm/component/Chart/VennChart.mjs +98 -111
- package/lib/esm/component/ChartLegend/BaseLegend.mjs +75 -97
- package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +54 -55
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +194 -165
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.type.mjs +1 -1
- package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +60 -58
- package/lib/esm/component/Cigarette/Cigarette.mjs +109 -99
- package/lib/esm/component/StackGroupBar/StackGroupBar.mjs +97 -111
- package/lib/esm/component/SvgElement.mjs +4 -4
- package/lib/esm/createElement.mjs +54 -37
- package/lib/esm/style/axis.shadow.css +3 -0
- package/lib/esm/style/plot.shadow.css +1 -3
- package/lib/esm/style/plotA11yModule.shadow.css +10 -11
- package/lib/esm/style/plotA11yView.shadow.css +13 -26
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +1 -1
- package/lib/esm/utils.mjs +103 -138
- package/lib/types/Axis.d.ts +4 -0
- package/lib/types/CompactHorizontalBar.d.ts +1 -1
- package/lib/types/Hover.d.ts +1 -1
- package/lib/types/Line.d.ts +1 -1
- package/lib/types/Plot.d.ts +1 -1
- package/lib/types/Radar.d.ts +1 -1
- package/lib/types/ResponsiveContainer.d.ts +1 -1
- package/lib/types/Tooltip.d.ts +1 -3
- package/lib/types/Venn.d.ts +1 -1
- package/lib/types/a11y/PlotA11yModule.d.ts +4 -11
- package/lib/types/a11y/PlotA11yView.d.ts +12 -1
- package/lib/types/a11y/translations/module/__intergalactic-dynamic-locales.d.ts +14 -14
- package/lib/types/component/Chart/AbstractChart.d.ts +1 -1
- package/lib/types/component/Chart/AbstractChart.type.d.ts +1 -1
- package/lib/types/component/Chart/AreaChart.type.d.ts +1 -1
- package/lib/types/component/Chart/BarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/BubbleChart.type.d.ts +1 -1
- package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/DonutChart.type.d.ts +1 -1
- package/lib/types/component/Chart/HistogramChart.type.d.ts +1 -1
- package/lib/types/component/Chart/LineChart.type.d.ts +1 -1
- package/lib/types/component/Chart/RadarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +1 -1
- package/lib/types/component/Chart/VennChart.type.d.ts +1 -1
- package/lib/types/component/ChartLegend/BaseLegend.d.ts +1 -1
- package/lib/types/component/ChartLegend/BaseLegend.type.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendFlex/LegendFlex.type.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts +1 -1
- package/lib/types/utils.d.ts +10 -10
- package/package.json +11 -14
package/lib/cjs/GroupBar.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports
|
|
8
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
7
|
+
exports.default = void 0;
|
|
12
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
9
|
var _core = require("@semcore/core");
|
|
14
10
|
var _getOriginChildren = _interopRequireDefault(require("@semcore/core/lib/utils/getOriginChildren"));
|
|
@@ -18,93 +14,82 @@ var _Bar = _interopRequireDefault(require("./Bar"));
|
|
|
18
14
|
var _createElement = _interopRequireDefault(require("./createElement"));
|
|
19
15
|
var _HorizontalBar = _interopRequireDefault(require("./HorizontalBar"));
|
|
20
16
|
var _utils = require("./utils");
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
class GroupBarRoot extends _core.Component {
|
|
18
|
+
getScaleGroup() {
|
|
19
|
+
const {
|
|
20
|
+
Children,
|
|
21
|
+
scale,
|
|
22
|
+
scaleGroup,
|
|
23
|
+
x
|
|
24
|
+
} = this.asProps;
|
|
25
|
+
// TODO: love that hack (by lsroman) ❤�
|
|
26
|
+
const xyScale = x ? scale[0] : scale[1];
|
|
27
|
+
if (scaleGroup) return scaleGroup;
|
|
28
|
+
const domain = _react.default.Children.toArray((0, _getOriginChildren.default)(Children)).reduce((acc, child) => {
|
|
29
|
+
if (/*#__PURE__*/_react.default.isValidElement(child) && child.type === GroupBar.Bar && !child.props.hide) {
|
|
30
|
+
acc.push(child.props.y);
|
|
31
|
+
}
|
|
32
|
+
if (/*#__PURE__*/_react.default.isValidElement(child) && child.type === GroupBar.HorizontalBar && !child.props.hide) {
|
|
33
|
+
acc.push(child.props.x);
|
|
34
|
+
}
|
|
35
|
+
return acc;
|
|
36
|
+
}, []);
|
|
37
|
+
return (0, _d3Scale.scaleBand)().range([0, (0, _utils.scaleToBand)(xyScale).bandwidth()]).domain(domain).paddingInner(0.1).paddingOuter(0.1);
|
|
25
38
|
}
|
|
26
|
-
(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
var offsetY = this.scaleGroup(x) + bandWidth / 2 - height / 2;
|
|
81
|
-
return {
|
|
82
|
-
offset: [0, offsetY],
|
|
83
|
-
height: height,
|
|
84
|
-
color: (0, _utils.getChartDefaultColorName)(index),
|
|
85
|
-
y: y,
|
|
86
|
-
groupKey: y
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
}, {
|
|
90
|
-
key: "render",
|
|
91
|
-
value: function render() {
|
|
92
|
-
var Element = this.Element;
|
|
93
|
-
this.scaleGroup = this.getScaleGroup();
|
|
94
|
-
this.asProps.dataHintsHandler.establishDataType('grouped-values');
|
|
95
|
-
return /*#__PURE__*/_react["default"].createElement(Element, {
|
|
96
|
-
"aria-hidden": true,
|
|
97
|
-
render: "g",
|
|
98
|
-
childrenPosition: "inside",
|
|
99
|
-
scaleGroup: this.scaleGroup
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
}]);
|
|
103
|
-
}(_core.Component);
|
|
104
|
-
(0, _defineProperty2["default"])(GroupBarRoot, "displayName", 'GroupBar');
|
|
105
|
-
var GroupBar = (0, _createElement["default"])(GroupBarRoot, {
|
|
106
|
-
Bar: _Bar["default"],
|
|
107
|
-
HorizontalBar: _HorizontalBar["default"]
|
|
39
|
+
getBarProps({
|
|
40
|
+
y
|
|
41
|
+
}, index) {
|
|
42
|
+
const {
|
|
43
|
+
x,
|
|
44
|
+
maxBarSize = Number.POSITIVE_INFINITY,
|
|
45
|
+
patterns
|
|
46
|
+
} = this.asProps;
|
|
47
|
+
const bandWidth = this.scaleGroup.bandwidth();
|
|
48
|
+
const width = Math.min(bandWidth, maxBarSize);
|
|
49
|
+
const offsetX = this.scaleGroup(y) + bandWidth / 2 - width / 2;
|
|
50
|
+
return {
|
|
51
|
+
offset: [offsetX, 0],
|
|
52
|
+
width,
|
|
53
|
+
color: (0, _utils.getChartDefaultColorName)(index),
|
|
54
|
+
x,
|
|
55
|
+
groupKey: x,
|
|
56
|
+
patterns
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
getHorizontalBarProps({
|
|
60
|
+
x
|
|
61
|
+
}, index) {
|
|
62
|
+
const {
|
|
63
|
+
y,
|
|
64
|
+
maxBarSize = Number.POSITIVE_INFINITY
|
|
65
|
+
} = this.asProps;
|
|
66
|
+
const bandWidth = this.scaleGroup.bandwidth();
|
|
67
|
+
const height = Math.min(bandWidth, maxBarSize);
|
|
68
|
+
const offsetY = this.scaleGroup(x) + bandWidth / 2 - height / 2;
|
|
69
|
+
return {
|
|
70
|
+
offset: [0, offsetY],
|
|
71
|
+
height,
|
|
72
|
+
color: (0, _utils.getChartDefaultColorName)(index),
|
|
73
|
+
y,
|
|
74
|
+
groupKey: y
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
render() {
|
|
78
|
+
const Element = this.Element;
|
|
79
|
+
this.scaleGroup = this.getScaleGroup();
|
|
80
|
+
this.asProps.dataHintsHandler.establishDataType('grouped-values');
|
|
81
|
+
return /*#__PURE__*/_react.default.createElement(Element, {
|
|
82
|
+
"aria-hidden": true,
|
|
83
|
+
render: "g",
|
|
84
|
+
childrenPosition: "inside",
|
|
85
|
+
scaleGroup: this.scaleGroup
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
(0, _defineProperty2.default)(GroupBarRoot, "displayName", 'GroupBar');
|
|
90
|
+
const GroupBar = (0, _createElement.default)(GroupBarRoot, {
|
|
91
|
+
Bar: _Bar.default,
|
|
92
|
+
HorizontalBar: _HorizontalBar.default
|
|
108
93
|
});
|
|
109
|
-
var _default = exports
|
|
94
|
+
var _default = exports.default = GroupBar;
|
|
110
95
|
//# sourceMappingURL=GroupBar.js.map
|
package/lib/cjs/GroupBar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupBar.js","names":["_core","require","_getOriginChildren","_interopRequireDefault","_d3Scale","_react","_Bar","_createElement","_HorizontalBar","_utils","GroupBarRoot","
|
|
1
|
+
{"version":3,"file":"GroupBar.js","names":["_core","require","_getOriginChildren","_interopRequireDefault","_d3Scale","_react","_Bar","_createElement","_HorizontalBar","_utils","GroupBarRoot","Component","getScaleGroup","Children","scale","scaleGroup","x","asProps","xyScale","domain","React","toArray","getOriginChildren","reduce","acc","child","isValidElement","type","GroupBar","Bar","props","hide","push","y","HorizontalBar","scaleBand","range","scaleToBand","bandwidth","paddingInner","paddingOuter","getBarProps","index","maxBarSize","Number","POSITIVE_INFINITY","patterns","bandWidth","width","Math","min","offsetX","offset","color","getChartDefaultColorName","groupKey","getHorizontalBarProps","height","offsetY","render","Element","dataHintsHandler","establishDataType","default","createElement","childrenPosition","_defineProperty2","_default","exports"],"sources":["../../src/GroupBar.jsx"],"sourcesContent":["import { Component } from '@semcore/core';\nimport getOriginChildren from '@semcore/core/lib/utils/getOriginChildren';\nimport { scaleBand } from 'd3-scale';\nimport React from 'react';\n\nimport Bar from './Bar';\nimport createElement from './createElement';\nimport HorizontalBar from './HorizontalBar';\nimport { getChartDefaultColorName, scaleToBand } from './utils';\n\nclass GroupBarRoot extends Component {\n static displayName = 'GroupBar';\n\n getScaleGroup() {\n const { Children, scale, scaleGroup, x } = this.asProps;\n // TODO: love that hack (by lsroman) ❤�\n const xyScale = x ? scale[0] : scale[1];\n\n if (scaleGroup) return scaleGroup;\n\n const domain = React.Children.toArray(getOriginChildren(Children)).reduce((acc, child) => {\n if (React.isValidElement(child) && child.type === GroupBar.Bar && !child.props.hide) {\n acc.push(child.props.y);\n }\n if (\n React.isValidElement(child) &&\n child.type === GroupBar.HorizontalBar &&\n !child.props.hide\n ) {\n acc.push(child.props.x);\n }\n return acc;\n }, []);\n\n return scaleBand()\n .range([0, scaleToBand(xyScale).bandwidth()])\n .domain(domain)\n .paddingInner(0.1)\n .paddingOuter(0.1);\n }\n\n getBarProps({ y }, index) {\n const { x, maxBarSize = Number.POSITIVE_INFINITY, patterns } = this.asProps;\n\n const bandWidth = this.scaleGroup.bandwidth();\n const width = Math.min(bandWidth, maxBarSize);\n const offsetX = this.scaleGroup(y) + bandWidth / 2 - width / 2;\n\n return {\n offset: [offsetX, 0],\n width,\n color: getChartDefaultColorName(index),\n x,\n groupKey: x,\n patterns,\n };\n }\n\n getHorizontalBarProps({ x }, index) {\n const { y, maxBarSize = Number.POSITIVE_INFINITY } = this.asProps;\n\n const bandWidth = this.scaleGroup.bandwidth();\n const height = Math.min(bandWidth, maxBarSize);\n const offsetY = this.scaleGroup(x) + bandWidth / 2 - height / 2;\n\n return {\n offset: [0, offsetY],\n height,\n color: getChartDefaultColorName(index),\n y,\n groupKey: y,\n };\n }\n\n render() {\n const Element = this.Element;\n this.scaleGroup = this.getScaleGroup();\n\n this.asProps.dataHintsHandler.establishDataType('grouped-values');\n\n return (\n <Element aria-hidden render='g' childrenPosition='inside' scaleGroup={this.scaleGroup} />\n );\n }\n}\n\nconst GroupBar = createElement(GroupBarRoot, {\n Bar,\n HorizontalBar,\n});\n\nexport default GroupBar;\n"],"mappings":"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","ignoreList":[]}
|
package/lib/cjs/HorizontalBar.js
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports
|
|
8
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
7
|
+
exports.default = exports.MIN_WIDTH = void 0;
|
|
13
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
9
|
var _core = require("@semcore/core");
|
|
15
10
|
var _uniqueID = _interopRequireDefault(require("@semcore/core/lib/utils/uniqueID"));
|
|
@@ -19,27 +14,27 @@ var _createElement = _interopRequireDefault(require("./createElement"));
|
|
|
19
14
|
var _Pattern = require("./Pattern");
|
|
20
15
|
var _utils = require("./utils");
|
|
21
16
|
/*!__reshadow-styles__:"./style/bar.shadow.css"*/
|
|
22
|
-
|
|
17
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SBar_1j50a_gg_{fill:var(--intergalactic-chart-palette-order-1, #2bb3ff);transition-property:height,width,y;transition-duration:var(--duration_1j50a);transition-timing-function:ease-in-out}.___SBar_1j50a_gg_.__color_1j50a_gg_{fill:var(--color_1j50a)}.___SBar_1j50a_gg_.__pattern_1j50a_gg_.__color_1j50a_gg_{fill:var(--pattern_1j50a);stroke:var(--color_1j50a);stroke-width:1px}.___SBar_1j50a_gg_.__hide_1j50a_gg_{display:none}.___SBar_1j50a_gg_.__transparent_1j50a_gg_{opacity:.3}.___SBackground_1j50a_gg_.__onClick_1j50a_gg_,.___SBar_1j50a_gg_.__onClick_1j50a_gg_{cursor:pointer}.___SBackground_1j50a_gg_{fill:var(--intergalactic-chart-grid-bar-chart-base-bg, #e0e1e9)}.___SBarAnnotation_1j50a_gg_{display:flex;justify-content:space-between}.___SBarLabel_1j50a_gg_{color:var(--intergalactic-text-primary, #191b23);margin-right:auto}.___SBarLabel_1j50a_gg_,.___SBarPercent_1j50a_gg_,.___SBarValue_1j50a_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SBarPercent_1j50a_gg_{color:var(--intergalactic-text-secondary, #6c6e79);margin-right:var(--intergalactic-spacing-2x, 8px)}.___SBarValue_1j50a_gg_{min-width:52px;display:flex;justify-content:flex-end;color:var(--intergalactic-text-primary, #191b23);text-align:right}.___SCompactHorizontalBarHoverRect_1j50a_gg_{fill:var(--intergalactic-chart-grid-bar-chart-hover, rgba(196, 199, 207, 0.3))}", /*__inner_css_end__*/"1j50a_gg_"),
|
|
23
18
|
/*__reshadow_css_end__*/
|
|
24
19
|
{
|
|
25
|
-
"__SBar": "
|
|
26
|
-
"--duration": "--
|
|
27
|
-
"_color": "
|
|
28
|
-
"--color": "--
|
|
29
|
-
"_pattern": "
|
|
30
|
-
"--pattern": "--
|
|
31
|
-
"_hide": "
|
|
32
|
-
"_transparent": "
|
|
33
|
-
"_onClick": "
|
|
34
|
-
"__SBackground": "
|
|
35
|
-
"__SBarAnnotation": "
|
|
36
|
-
"__SBarLabel": "
|
|
37
|
-
"__SBarPercent": "
|
|
38
|
-
"__SBarValue": "
|
|
39
|
-
"__SCompactHorizontalBarHoverRect": "
|
|
20
|
+
"__SBar": "___SBar_1j50a_gg_",
|
|
21
|
+
"--duration": "--duration_1j50a",
|
|
22
|
+
"_color": "__color_1j50a_gg_",
|
|
23
|
+
"--color": "--color_1j50a",
|
|
24
|
+
"_pattern": "__pattern_1j50a_gg_",
|
|
25
|
+
"--pattern": "--pattern_1j50a",
|
|
26
|
+
"_hide": "__hide_1j50a_gg_",
|
|
27
|
+
"_transparent": "__transparent_1j50a_gg_",
|
|
28
|
+
"_onClick": "__onClick_1j50a_gg_",
|
|
29
|
+
"__SBackground": "___SBackground_1j50a_gg_",
|
|
30
|
+
"__SBarAnnotation": "___SBarAnnotation_1j50a_gg_",
|
|
31
|
+
"__SBarLabel": "___SBarLabel_1j50a_gg_",
|
|
32
|
+
"__SBarPercent": "___SBarPercent_1j50a_gg_",
|
|
33
|
+
"__SBarValue": "___SBarValue_1j50a_gg_",
|
|
34
|
+
"__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_1j50a_gg_"
|
|
40
35
|
});
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
const MIN_WIDTH = exports.MIN_WIDTH = 2;
|
|
37
|
+
const calcPartBarX = (x, minWidth, width) => {
|
|
43
38
|
// need for the correct rendering of negative values
|
|
44
39
|
if (x <= 0) {
|
|
45
40
|
return width <= minWidth ? minWidth : 0;
|
|
@@ -47,147 +42,133 @@ var calcPartBarX = function calcPartBarX(x, minWidth, width) {
|
|
|
47
42
|
// need for the correct rendering of the minimum positive values
|
|
48
43
|
return Object.is(x, 0) ? minWidth : 0;
|
|
49
44
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
class HorizontalBarRoot extends _core.Component {
|
|
46
|
+
getBackgroundProps(_props, index) {
|
|
47
|
+
const {
|
|
48
|
+
data,
|
|
49
|
+
y
|
|
50
|
+
} = this.asProps;
|
|
51
|
+
return {
|
|
52
|
+
value: data[index][y],
|
|
53
|
+
index
|
|
54
|
+
};
|
|
54
55
|
}
|
|
55
|
-
(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
56
|
+
renderBar(d, i) {
|
|
57
|
+
var _ref;
|
|
58
|
+
const SBar = this.Element;
|
|
59
|
+
const {
|
|
60
|
+
styles,
|
|
61
|
+
color,
|
|
62
|
+
x,
|
|
63
|
+
x0,
|
|
64
|
+
y,
|
|
65
|
+
scale,
|
|
66
|
+
hide,
|
|
67
|
+
offset: offsetProps,
|
|
68
|
+
uid,
|
|
69
|
+
duration,
|
|
70
|
+
r,
|
|
71
|
+
wMin,
|
|
72
|
+
height: heightProps,
|
|
73
|
+
onMouseMove,
|
|
74
|
+
onMouseLeave,
|
|
75
|
+
groupKey,
|
|
76
|
+
transparent,
|
|
77
|
+
maxBarSize = Number.POSITIVE_INFINITY,
|
|
78
|
+
resolveColor,
|
|
79
|
+
patterns,
|
|
80
|
+
onClick
|
|
81
|
+
} = this.asProps;
|
|
82
|
+
const offset = typeof offsetProps === 'function' ? offsetProps(i) : offsetProps;
|
|
83
|
+
const [xScale, yScale] = scale;
|
|
84
|
+
const absWidth = Math.abs(xScale(d[x]) - Math.max(xScale(xScale.domain()[0]), xScale(d[x0] ?? 0)));
|
|
85
|
+
const bandHeight = heightProps || (0, _utils.scaleToBand)(yScale).bandwidth();
|
|
86
|
+
const height = Math.min(bandHeight, maxBarSize);
|
|
87
|
+
const width = Number(d[x] - (d[x0] ?? 0)) === 0 ? 0 : Math.max(absWidth, wMin);
|
|
88
|
+
const barY = yScale(d[y]) + bandHeight / 2 - height / 2 + offset[1];
|
|
89
|
+
const barX = xScale(Math.min(d[x0] ?? 0, width <= wMin && d[x] < 0 ? 0 : d[x])) + offset[0] - calcPartBarX(d[x], wMin, width);
|
|
90
|
+
const handleClick = event => onClick?.(d, event, i, x);
|
|
91
|
+
const dSvg = getHorizontalRect({
|
|
92
|
+
x: barX,
|
|
93
|
+
y: barY,
|
|
94
|
+
width,
|
|
95
|
+
height,
|
|
96
|
+
radius: Array.isArray(r) ? r[i] : r,
|
|
97
|
+
position: d[x] > 0 || Object.is(d[x], 0) ? 'right' : 'left'
|
|
98
|
+
});
|
|
99
|
+
if (groupKey) {
|
|
100
|
+
this.asProps.dataHintsHandler.describeGroupedValues(groupKey, x);
|
|
101
|
+
} else {
|
|
102
|
+
this.asProps.dataHintsHandler.describeValueEntity(`${i}.${x}`, groupKey ?? d[y]);
|
|
66
103
|
}
|
|
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
|
-
this.asProps.dataHintsHandler.describeValueEntity("".concat(i, ".").concat(x), groupKey !== null && groupKey !== void 0 ? groupKey : d[y]);
|
|
120
|
-
}
|
|
121
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, {
|
|
122
|
-
key: "horizontal-bar-".concat(i)
|
|
123
|
-
}, (_ref = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SBar, _ref.cn("SBar", {
|
|
124
|
-
"aria-hidden": true,
|
|
125
|
-
"render": 'path',
|
|
126
|
-
"clipPath": "url(#".concat(uid, ")"),
|
|
127
|
-
"__excludeProps": ['data', 'scale', 'value', 'onClick', 'offset'],
|
|
128
|
-
"childrenPosition": 'above',
|
|
129
|
-
"value": d,
|
|
130
|
-
"index": i,
|
|
131
|
-
"hide": hide,
|
|
132
|
-
"color": resolveColor(color),
|
|
133
|
-
"pattern": patterns ? "url(#".concat(uid, "-").concat(i, "-pattern)") : undefined,
|
|
134
|
-
"transparent": transparent,
|
|
135
|
-
"x": barX,
|
|
136
|
-
"y": barY,
|
|
137
|
-
"width": width,
|
|
138
|
-
"height": height,
|
|
139
|
-
"d": dSvg,
|
|
140
|
-
"onClickCapture": handleClick,
|
|
141
|
-
"use:duration": "".concat(duration, "ms"),
|
|
142
|
-
"onMouseMove": onMouseMove,
|
|
143
|
-
"onMouseLeave": onMouseLeave
|
|
144
|
-
}))), patterns && /*#__PURE__*/_react["default"].createElement(_Pattern.PatternFill, _ref.cn("PatternFill", {
|
|
145
|
-
"id": "".concat(uid, "-").concat(i, "-pattern"),
|
|
146
|
-
"patternKey": color,
|
|
147
|
-
"color": resolveColor(color),
|
|
148
|
-
"patterns": patterns
|
|
149
|
-
})));
|
|
150
|
-
}
|
|
151
|
-
}, {
|
|
152
|
-
key: "render",
|
|
153
|
-
value: function render() {
|
|
154
|
-
var _this$asProps3 = this.asProps,
|
|
155
|
-
data = _this$asProps3.data,
|
|
156
|
-
uid = _this$asProps3.uid,
|
|
157
|
-
size = _this$asProps3.size,
|
|
158
|
-
duration = _this$asProps3.duration;
|
|
159
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, data.map(this.renderBar.bind(this)), duration && /*#__PURE__*/_react["default"].createElement(_AnimatedClipPath["default"], {
|
|
160
|
-
"aria-hidden": true,
|
|
161
|
-
duration: duration,
|
|
162
|
-
id: uid,
|
|
163
|
-
x: "0",
|
|
164
|
-
y: "0",
|
|
165
|
-
width: 0,
|
|
166
|
-
height: size[1]
|
|
167
|
-
}));
|
|
168
|
-
}
|
|
169
|
-
}]);
|
|
170
|
-
}(_core.Component);
|
|
171
|
-
(0, _defineProperty2["default"])(HorizontalBarRoot, "displayName", 'HorizontalBar');
|
|
172
|
-
(0, _defineProperty2["default"])(HorizontalBarRoot, "enhance", [(0, _uniqueID["default"])()]);
|
|
173
|
-
(0, _defineProperty2["default"])(HorizontalBarRoot, "style", style);
|
|
174
|
-
(0, _defineProperty2["default"])(HorizontalBarRoot, "defaultProps", {
|
|
104
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
105
|
+
key: `horizontal-bar-${i}`
|
|
106
|
+
}, (_ref = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(SBar, _ref.cn("SBar", {
|
|
107
|
+
"aria-hidden": true,
|
|
108
|
+
"render": 'path',
|
|
109
|
+
"clipPath": `url(#${uid})`,
|
|
110
|
+
"__excludeProps": ['data', 'scale', 'value', 'onClick', 'offset'],
|
|
111
|
+
"childrenPosition": 'above',
|
|
112
|
+
"value": d,
|
|
113
|
+
"index": i,
|
|
114
|
+
"hide": hide,
|
|
115
|
+
"color": resolveColor(color),
|
|
116
|
+
"pattern": patterns ? `url(#${uid}-${i}-pattern)` : undefined,
|
|
117
|
+
"transparent": transparent,
|
|
118
|
+
"x": barX,
|
|
119
|
+
"y": barY,
|
|
120
|
+
"width": width,
|
|
121
|
+
"height": height,
|
|
122
|
+
"d": dSvg,
|
|
123
|
+
"onClickCapture": handleClick,
|
|
124
|
+
"use:duration": `${duration}ms`,
|
|
125
|
+
"onMouseMove": onMouseMove,
|
|
126
|
+
"onMouseLeave": onMouseLeave
|
|
127
|
+
}))), patterns && /*#__PURE__*/_react.default.createElement(_Pattern.PatternFill, _ref.cn("PatternFill", {
|
|
128
|
+
"id": `${uid}-${i}-pattern`,
|
|
129
|
+
"patternKey": color,
|
|
130
|
+
"color": resolveColor(color),
|
|
131
|
+
"patterns": patterns
|
|
132
|
+
})));
|
|
133
|
+
}
|
|
134
|
+
render() {
|
|
135
|
+
const {
|
|
136
|
+
data,
|
|
137
|
+
uid,
|
|
138
|
+
size,
|
|
139
|
+
duration
|
|
140
|
+
} = this.asProps;
|
|
141
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, data.map(this.renderBar.bind(this)), duration && /*#__PURE__*/_react.default.createElement(_AnimatedClipPath.default, {
|
|
142
|
+
"aria-hidden": true,
|
|
143
|
+
duration: duration,
|
|
144
|
+
id: uid,
|
|
145
|
+
x: "0",
|
|
146
|
+
y: "0",
|
|
147
|
+
width: 0,
|
|
148
|
+
height: size[1]
|
|
149
|
+
}));
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
(0, _defineProperty2.default)(HorizontalBarRoot, "displayName", 'HorizontalBar');
|
|
153
|
+
(0, _defineProperty2.default)(HorizontalBarRoot, "enhance", [(0, _uniqueID.default)()]);
|
|
154
|
+
(0, _defineProperty2.default)(HorizontalBarRoot, "style", style);
|
|
155
|
+
(0, _defineProperty2.default)(HorizontalBarRoot, "defaultProps", {
|
|
175
156
|
offset: [0, 0],
|
|
176
157
|
duration: 500,
|
|
177
|
-
r:
|
|
158
|
+
r: 0,
|
|
178
159
|
wMin: MIN_WIDTH
|
|
179
160
|
});
|
|
180
161
|
function Background(props) {
|
|
181
162
|
var _ref2;
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
return _ref2 = (0, _core.sstyled)(styles), /*#__PURE__*/_react
|
|
163
|
+
const {
|
|
164
|
+
Element: SBackground,
|
|
165
|
+
styles,
|
|
166
|
+
scale,
|
|
167
|
+
value
|
|
168
|
+
} = props;
|
|
169
|
+
const [xScale, yScale] = scale;
|
|
170
|
+
const xRange = xScale.range();
|
|
171
|
+
return _ref2 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(SBackground, _ref2.cn("SBackground", {
|
|
191
172
|
"aria-hidden": true,
|
|
192
173
|
"render": 'rect',
|
|
193
174
|
"childrenPosition": 'above',
|
|
@@ -197,13 +178,14 @@ function Background(props) {
|
|
|
197
178
|
"y": yScale(value)
|
|
198
179
|
}));
|
|
199
180
|
}
|
|
200
|
-
function getHorizontalRect(
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
181
|
+
function getHorizontalRect({
|
|
182
|
+
x,
|
|
183
|
+
y,
|
|
184
|
+
width,
|
|
185
|
+
height,
|
|
186
|
+
radius,
|
|
187
|
+
position
|
|
188
|
+
}) {
|
|
207
189
|
if (width < radius) radius = width;
|
|
208
190
|
if (radius) {
|
|
209
191
|
if (position === 'right') return (0, _utils.roundedPath)(x, y, width, height, radius, false, true, false, true);
|
|
@@ -211,7 +193,7 @@ function getHorizontalRect(_ref3) {
|
|
|
211
193
|
}
|
|
212
194
|
return (0, _utils.roundedPath)(x, y, width, height, radius);
|
|
213
195
|
}
|
|
214
|
-
var _default = exports
|
|
215
|
-
Background
|
|
196
|
+
var _default = exports.default = (0, _createElement.default)(HorizontalBarRoot, {
|
|
197
|
+
Background
|
|
216
198
|
});
|
|
217
199
|
//# sourceMappingURL=HorizontalBar.js.map
|