@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,264 +1,261 @@
|
|
|
1
|
-
import "@babel/runtime/helpers/esm/readOnlyError";
|
|
2
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
5
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
6
|
-
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
7
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
8
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
2
|
import { sstyled, assignProps, Component } from "@semcore/core";
|
|
3
|
+
import { Box } from "@semcore/base-components";
|
|
10
4
|
import { callAllEventHandlers } from "@semcore/core/lib/utils/assignProps";
|
|
11
5
|
import canUseDOM from "@semcore/core/lib/utils/canUseDOM";
|
|
12
6
|
import trottle from "@semcore/core/lib/utils/rafTrottle";
|
|
13
7
|
import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
14
|
-
import { Box } from "@semcore/flex-box";
|
|
15
8
|
import React from "react";
|
|
16
9
|
import AnimatedClipPath from "./AnimatedClipPath.mjs";
|
|
17
10
|
import createElement from "./createElement.mjs";
|
|
18
11
|
import { PatternFill } from "./Pattern.mjs";
|
|
19
12
|
import Tooltip from "./Tooltip.mjs";
|
|
20
|
-
import {
|
|
13
|
+
import { eventToPoint, roundedPath, scaleToBand } from "./utils.mjs";
|
|
21
14
|
/*!__reshadow-styles__:"./style/bar.shadow.css"*/
|
|
22
|
-
|
|
15
|
+
const style = (
|
|
23
16
|
/*__reshadow_css_start__*/
|
|
24
17
|
(sstyled.insert(
|
|
25
18
|
/*__inner_css_start__*/
|
|
26
|
-
".
|
|
19
|
+
".___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))}",
|
|
27
20
|
/*__inner_css_end__*/
|
|
28
|
-
"
|
|
21
|
+
"1j50a_gg_"
|
|
29
22
|
), /*__reshadow_css_end__*/
|
|
30
23
|
{
|
|
31
|
-
"__SBar": "
|
|
32
|
-
"--duration": "--
|
|
33
|
-
"_color": "
|
|
34
|
-
"--color": "--
|
|
35
|
-
"_pattern": "
|
|
36
|
-
"--pattern": "--
|
|
37
|
-
"_hide": "
|
|
38
|
-
"_transparent": "
|
|
39
|
-
"_onClick": "
|
|
40
|
-
"__SBackground": "
|
|
41
|
-
"__SBarAnnotation": "
|
|
42
|
-
"__SBarLabel": "
|
|
43
|
-
"__SBarPercent": "
|
|
44
|
-
"__SBarValue": "
|
|
45
|
-
"__SCompactHorizontalBarHoverRect": "
|
|
24
|
+
"__SBar": "___SBar_1j50a_gg_",
|
|
25
|
+
"--duration": "--duration_1j50a",
|
|
26
|
+
"_color": "__color_1j50a_gg_",
|
|
27
|
+
"--color": "--color_1j50a",
|
|
28
|
+
"_pattern": "__pattern_1j50a_gg_",
|
|
29
|
+
"--pattern": "--pattern_1j50a",
|
|
30
|
+
"_hide": "__hide_1j50a_gg_",
|
|
31
|
+
"_transparent": "__transparent_1j50a_gg_",
|
|
32
|
+
"_onClick": "__onClick_1j50a_gg_",
|
|
33
|
+
"__SBackground": "___SBackground_1j50a_gg_",
|
|
34
|
+
"__SBarAnnotation": "___SBarAnnotation_1j50a_gg_",
|
|
35
|
+
"__SBarLabel": "___SBarLabel_1j50a_gg_",
|
|
36
|
+
"__SBarPercent": "___SBarPercent_1j50a_gg_",
|
|
37
|
+
"__SBarValue": "___SBarValue_1j50a_gg_",
|
|
38
|
+
"__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_1j50a_gg_"
|
|
46
39
|
})
|
|
47
40
|
);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
56
|
-
args[_key] = arguments[_key];
|
|
57
|
-
}
|
|
58
|
-
_this = _callSuper(this, CompactHorizontalBarRoot2, [].concat(args));
|
|
59
|
-
_defineProperty(_this, "state", {
|
|
41
|
+
const MIN_WIDTH = 4;
|
|
42
|
+
const barHeight = 20;
|
|
43
|
+
const hoverOffset = 6;
|
|
44
|
+
class CompactHorizontalBarRoot extends Component {
|
|
45
|
+
constructor(...args) {
|
|
46
|
+
super(...args);
|
|
47
|
+
_defineProperty(this, "state", {
|
|
60
48
|
indexToHover: null
|
|
61
49
|
});
|
|
62
|
-
_defineProperty(
|
|
63
|
-
_defineProperty(
|
|
64
|
-
_defineProperty(
|
|
65
|
-
_defineProperty(
|
|
66
|
-
return _this;
|
|
50
|
+
_defineProperty(this, "percentFormatter", null);
|
|
51
|
+
_defineProperty(this, "percentFormatterLocale", null);
|
|
52
|
+
_defineProperty(this, "valueFormatter", null);
|
|
53
|
+
_defineProperty(this, "valueFormatterLocale", null);
|
|
67
54
|
}
|
|
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
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
key: "getValueFormatter",
|
|
146
|
-
value: function getValueFormatter() {
|
|
147
|
-
if (!this.valueFormatter || this.valueFormatterLocale !== this.asProps.locale) {
|
|
148
|
-
this.valueFormatter = new Intl.NumberFormat(this.asProps.locale);
|
|
149
|
-
this.valueFormatterLocale = this.asProps.locale;
|
|
150
|
-
}
|
|
151
|
-
return this.valueFormatter;
|
|
152
|
-
}
|
|
153
|
-
}, {
|
|
154
|
-
key: "getPercentProps",
|
|
155
|
-
value: function getPercentProps(_props, index) {
|
|
156
|
-
var _this$asProps5 = this.asProps, data = _this$asProps5.data, x = _this$asProps5.x, scale = _this$asProps5.scale;
|
|
157
|
-
var value = data[index][x];
|
|
158
|
-
var domain = scale[0].domain();
|
|
159
|
-
var percent = value / domain[1];
|
|
160
|
-
var formatter = this.getPercentFormatter();
|
|
161
|
-
var formatted = formatter.format(percent);
|
|
162
|
-
return {
|
|
163
|
-
children: formatted,
|
|
164
|
-
formatted,
|
|
165
|
-
percent
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
}, {
|
|
169
|
-
key: "getValueProps",
|
|
170
|
-
value: function getValueProps(_props, index) {
|
|
171
|
-
var _this$asProps6 = this.asProps, data = _this$asProps6.data, x = _this$asProps6.x;
|
|
172
|
-
var value = data[index][x];
|
|
173
|
-
var formatter = this.getValueFormatter();
|
|
174
|
-
var formatted = formatter.format(value);
|
|
175
|
-
return {
|
|
176
|
-
children: formatted,
|
|
177
|
-
formatted,
|
|
178
|
-
value
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
}, {
|
|
182
|
-
key: "getHoverProps",
|
|
183
|
-
value: function getHoverProps(_props, index) {
|
|
184
|
-
var _this2 = this;
|
|
185
|
-
var data = this.asProps.data;
|
|
186
|
-
return {
|
|
187
|
-
data,
|
|
188
|
-
getBarData: function getBarData(index2) {
|
|
189
|
-
return _this2.computeBarData(data[index2], index2);
|
|
190
|
-
},
|
|
191
|
-
render: index === 0,
|
|
192
|
-
updateIndexToHover: function updateIndexToHover(index2) {
|
|
193
|
-
return _this2.setState({
|
|
194
|
-
indexToHover: index2
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
}, {
|
|
200
|
-
key: "getTooltipProps",
|
|
201
|
-
value: function getTooltipProps(_props, index) {
|
|
202
|
-
return {
|
|
203
|
-
render: index === 0,
|
|
204
|
-
index: this.state.indexToHover
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
}, {
|
|
208
|
-
key: "computeBarData",
|
|
209
|
-
value: function computeBarData(d) {
|
|
210
|
-
var _this$asProps7 = this.asProps, x = _this$asProps7.x, y = _this$asProps7.y, scale = _this$asProps7.scale, offsetProps = _this$asProps7.offset, wMin = _this$asProps7.wMin, heightProps = _this$asProps7.height, _this$asProps7$maxBar = _this$asProps7.maxBarSize, maxBarSize = _this$asProps7$maxBar === void 0 ? Number.POSITIVE_INFINITY : _this$asProps7$maxBar, size = _this$asProps7.size;
|
|
211
|
-
var offset = typeof offsetProps === "function" ? offsetProps(i) : offsetProps;
|
|
212
|
-
var _scale = _slicedToArray(scale, 2), xScale = _scale[0], yScale = _scale[1];
|
|
213
|
-
var absWidth = xScale(d[x]);
|
|
214
|
-
var bandHeight = heightProps || scaleToBand(yScale).bandwidth();
|
|
215
|
-
var height = Math.min(bandHeight, maxBarSize);
|
|
216
|
-
var width = absWidth === 0 ? 0 : Math.max(absWidth, wMin);
|
|
217
|
-
var barY = yScale(d[y]) + bandHeight / 2 - height / 2 + offset[1];
|
|
218
|
-
return {
|
|
219
|
-
x: 0,
|
|
220
|
-
y: barY,
|
|
221
|
-
width,
|
|
222
|
-
fullWidth: size[0],
|
|
223
|
-
height
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
}, {
|
|
227
|
-
key: "renderBar",
|
|
228
|
-
value: function renderBar(d, i2) {
|
|
229
|
-
var _ref5;
|
|
230
|
-
var SCompactHorizontalBarGroup = this.Element;
|
|
231
|
-
var _this$asProps8 = this.asProps, styles = _this$asProps8.styles, groupKey = _this$asProps8.groupKey;
|
|
232
|
-
var _this$computeBarData = this.computeBarData(d, i2), x = _this$computeBarData.x, y = _this$computeBarData.y;
|
|
233
|
-
this.asProps.dataHintsHandler.describeValueEntity("".concat(i2, ".").concat(x), groupKey !== null && groupKey !== void 0 ? groupKey : d[y]);
|
|
234
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, {
|
|
235
|
-
key: "horizontal-bar-".concat(i2)
|
|
236
|
-
}, (_ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SCompactHorizontalBarGroup, _ref5.cn("SCompactHorizontalBarGroup", {
|
|
237
|
-
"render": "g"
|
|
238
|
-
}))));
|
|
239
|
-
}
|
|
240
|
-
}, {
|
|
241
|
-
key: "renderBars",
|
|
242
|
-
value: function renderBars() {
|
|
243
|
-
var data = this.asProps.data;
|
|
244
|
-
return data.map(this.renderBar.bind(this));
|
|
55
|
+
getBarProps(_props, index) {
|
|
56
|
+
return {
|
|
57
|
+
index
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
getBarBackgroundProps(_props, index) {
|
|
61
|
+
const {
|
|
62
|
+
data,
|
|
63
|
+
scale
|
|
64
|
+
} = this.asProps;
|
|
65
|
+
const bar = this.computeBarData(data[index], index);
|
|
66
|
+
return {
|
|
67
|
+
scale,
|
|
68
|
+
index,
|
|
69
|
+
x: bar.x,
|
|
70
|
+
y: bar.y + bar.height - barHeight - hoverOffset,
|
|
71
|
+
height: barHeight,
|
|
72
|
+
width: bar.fullWidth
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
getBarFillProps(_props, index) {
|
|
76
|
+
const {
|
|
77
|
+
data,
|
|
78
|
+
uid,
|
|
79
|
+
patterns,
|
|
80
|
+
color,
|
|
81
|
+
transparent,
|
|
82
|
+
hide,
|
|
83
|
+
scale
|
|
84
|
+
} = this.asProps;
|
|
85
|
+
const bar = this.computeBarData(data[index], index);
|
|
86
|
+
return {
|
|
87
|
+
x: bar.x,
|
|
88
|
+
y: bar.y + bar.height - barHeight - hoverOffset,
|
|
89
|
+
height: barHeight,
|
|
90
|
+
width: bar.width,
|
|
91
|
+
i: index,
|
|
92
|
+
uid,
|
|
93
|
+
resolveColor: this.asProps.resolveColor,
|
|
94
|
+
patterns,
|
|
95
|
+
color,
|
|
96
|
+
transparent,
|
|
97
|
+
hide,
|
|
98
|
+
scale,
|
|
99
|
+
index
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
getAnnotationProps(_props, index) {
|
|
103
|
+
const {
|
|
104
|
+
data,
|
|
105
|
+
size
|
|
106
|
+
} = this.asProps;
|
|
107
|
+
const bar = this.computeBarData(data[index], index);
|
|
108
|
+
return {
|
|
109
|
+
y: bar.y,
|
|
110
|
+
height: barHeight * 2,
|
|
111
|
+
width: size[0],
|
|
112
|
+
index
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
getLabelProps(_props, index) {
|
|
116
|
+
const {
|
|
117
|
+
data,
|
|
118
|
+
y
|
|
119
|
+
} = this.asProps;
|
|
120
|
+
const label = data[index][y];
|
|
121
|
+
return {
|
|
122
|
+
children: label,
|
|
123
|
+
index
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
getPercentFormatter() {
|
|
127
|
+
if (!this.percentFormatter || this.percentFormatterLocale !== this.asProps.locale) {
|
|
128
|
+
this.percentFormatter = new Intl.NumberFormat(this.asProps.locale, {
|
|
129
|
+
style: "percent"
|
|
130
|
+
});
|
|
131
|
+
this.percentFormatterLocale = this.asProps.locale;
|
|
245
132
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
duration,
|
|
253
|
-
id: uid,
|
|
254
|
-
x: "0",
|
|
255
|
-
y: "0",
|
|
256
|
-
width: 0,
|
|
257
|
-
height: size[1]
|
|
258
|
-
}));
|
|
133
|
+
return this.percentFormatter;
|
|
134
|
+
}
|
|
135
|
+
getValueFormatter() {
|
|
136
|
+
if (!this.valueFormatter || this.valueFormatterLocale !== this.asProps.locale) {
|
|
137
|
+
this.valueFormatter = new Intl.NumberFormat(this.asProps.locale);
|
|
138
|
+
this.valueFormatterLocale = this.asProps.locale;
|
|
259
139
|
}
|
|
260
|
-
|
|
261
|
-
}
|
|
140
|
+
return this.valueFormatter;
|
|
141
|
+
}
|
|
142
|
+
getPercentProps(_props, index) {
|
|
143
|
+
const {
|
|
144
|
+
data,
|
|
145
|
+
x,
|
|
146
|
+
scale
|
|
147
|
+
} = this.asProps;
|
|
148
|
+
const value = data[index][x];
|
|
149
|
+
const domain = scale[0].domain();
|
|
150
|
+
const percent = value / domain[1];
|
|
151
|
+
const formatter = this.getPercentFormatter();
|
|
152
|
+
const formatted = formatter.format(percent);
|
|
153
|
+
return {
|
|
154
|
+
children: formatted,
|
|
155
|
+
formatted,
|
|
156
|
+
percent
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
getValueProps(_props, index) {
|
|
160
|
+
const {
|
|
161
|
+
data,
|
|
162
|
+
x
|
|
163
|
+
} = this.asProps;
|
|
164
|
+
const value = data[index][x];
|
|
165
|
+
const formatter = this.getValueFormatter();
|
|
166
|
+
const formatted = formatter.format(value);
|
|
167
|
+
return {
|
|
168
|
+
children: formatted,
|
|
169
|
+
formatted,
|
|
170
|
+
value
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
getHoverProps(_props, index) {
|
|
174
|
+
const {
|
|
175
|
+
data
|
|
176
|
+
} = this.asProps;
|
|
177
|
+
return {
|
|
178
|
+
data,
|
|
179
|
+
getBarData: (index2) => this.computeBarData(data[index2], index2),
|
|
180
|
+
render: index === 0,
|
|
181
|
+
updateIndexToHover: (index2) => this.setState({
|
|
182
|
+
indexToHover: index2
|
|
183
|
+
})
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
getTooltipProps(_props, index) {
|
|
187
|
+
return {
|
|
188
|
+
render: index === 0,
|
|
189
|
+
index: this.state.indexToHover
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
computeBarData(d) {
|
|
193
|
+
const {
|
|
194
|
+
x,
|
|
195
|
+
y,
|
|
196
|
+
scale,
|
|
197
|
+
offset: offsetProps,
|
|
198
|
+
wMin,
|
|
199
|
+
height: heightProps,
|
|
200
|
+
maxBarSize = Number.POSITIVE_INFINITY,
|
|
201
|
+
size
|
|
202
|
+
} = this.asProps;
|
|
203
|
+
const offset = typeof offsetProps === "function" ? offsetProps(i) : offsetProps;
|
|
204
|
+
const [xScale, yScale] = scale;
|
|
205
|
+
const absWidth = xScale(d[x]);
|
|
206
|
+
const bandHeight = heightProps || scaleToBand(yScale).bandwidth();
|
|
207
|
+
const height = Math.min(bandHeight, maxBarSize);
|
|
208
|
+
const width = absWidth === 0 ? 0 : Math.max(absWidth, wMin);
|
|
209
|
+
const barY = yScale(d[y]) + bandHeight / 2 - height / 2 + offset[1];
|
|
210
|
+
return {
|
|
211
|
+
x: 0,
|
|
212
|
+
y: barY,
|
|
213
|
+
width,
|
|
214
|
+
fullWidth: size[0],
|
|
215
|
+
height
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
renderBar(d, i2) {
|
|
219
|
+
var _ref5;
|
|
220
|
+
const SCompactHorizontalBarGroup = this.Element;
|
|
221
|
+
const {
|
|
222
|
+
styles,
|
|
223
|
+
groupKey
|
|
224
|
+
} = this.asProps;
|
|
225
|
+
const {
|
|
226
|
+
x,
|
|
227
|
+
y
|
|
228
|
+
} = this.computeBarData(d, i2);
|
|
229
|
+
this.asProps.dataHintsHandler.describeValueEntity(`${i2}.${x}`, groupKey ?? d[y]);
|
|
230
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, {
|
|
231
|
+
key: `horizontal-bar-${i2}`
|
|
232
|
+
}, (_ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SCompactHorizontalBarGroup, _ref5.cn("SCompactHorizontalBarGroup", {
|
|
233
|
+
"render": "g"
|
|
234
|
+
}))));
|
|
235
|
+
}
|
|
236
|
+
renderBars() {
|
|
237
|
+
const {
|
|
238
|
+
data
|
|
239
|
+
} = this.asProps;
|
|
240
|
+
return data.map(this.renderBar.bind(this));
|
|
241
|
+
}
|
|
242
|
+
render() {
|
|
243
|
+
const {
|
|
244
|
+
uid,
|
|
245
|
+
size,
|
|
246
|
+
duration
|
|
247
|
+
} = this.asProps;
|
|
248
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, this.renderBars(), duration && /* @__PURE__ */ React.createElement(AnimatedClipPath, {
|
|
249
|
+
"aria-hidden": true,
|
|
250
|
+
duration,
|
|
251
|
+
id: uid,
|
|
252
|
+
x: "0",
|
|
253
|
+
y: "0",
|
|
254
|
+
width: 0,
|
|
255
|
+
height: size[1]
|
|
256
|
+
}));
|
|
257
|
+
}
|
|
258
|
+
}
|
|
262
259
|
_defineProperty(CompactHorizontalBarRoot, "displayName", "CompactHorizontalBar");
|
|
263
260
|
_defineProperty(CompactHorizontalBarRoot, "enhance", [uniqueIDEnhancement()]);
|
|
264
261
|
_defineProperty(CompactHorizontalBarRoot, "style", style);
|
|
@@ -271,8 +268,14 @@ _defineProperty(CompactHorizontalBarRoot, "defaultProps", {
|
|
|
271
268
|
});
|
|
272
269
|
function Annotation(props) {
|
|
273
270
|
var _ref6;
|
|
274
|
-
|
|
275
|
-
|
|
271
|
+
const {
|
|
272
|
+
Children,
|
|
273
|
+
y,
|
|
274
|
+
height,
|
|
275
|
+
width,
|
|
276
|
+
styles
|
|
277
|
+
} = props;
|
|
278
|
+
const SBarAnnotation = "div";
|
|
276
279
|
return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement("foreignObject", _ref6.cn("foreignObject", {
|
|
277
280
|
"x": "0",
|
|
278
281
|
"y": y - barHeight,
|
|
@@ -281,82 +284,115 @@ function Annotation(props) {
|
|
|
281
284
|
"overflow": "visible"
|
|
282
285
|
}), /* @__PURE__ */ React.createElement(SBarAnnotation, _ref6.cn("SBarAnnotation", {}), /* @__PURE__ */ React.createElement(Children, _ref6.cn("Children", {}))));
|
|
283
286
|
}
|
|
284
|
-
|
|
287
|
+
const excludeProps = ["data", "scale", "value", "offset"];
|
|
285
288
|
function Label(props) {
|
|
286
289
|
var _ref = arguments[0], _ref7;
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
}
|
|
290
|
+
const SBarLabel = Box;
|
|
291
|
+
const {
|
|
292
|
+
styles,
|
|
293
|
+
Children
|
|
294
|
+
} = props;
|
|
295
|
+
return _ref7 = sstyled(styles), /* @__PURE__ */ React.createElement(SBarLabel, _ref7.cn("SBarLabel", {
|
|
296
|
+
...assignProps({
|
|
297
|
+
"__excludeProps": excludeProps
|
|
298
|
+
}, _ref)
|
|
299
|
+
}), /* @__PURE__ */ React.createElement(Children, _ref7.cn("Children", {})));
|
|
292
300
|
}
|
|
293
301
|
function Percent(props) {
|
|
294
302
|
var _ref2 = arguments[0], _ref8;
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
}
|
|
303
|
+
const SBarPercent = Box;
|
|
304
|
+
const {
|
|
305
|
+
styles,
|
|
306
|
+
Children
|
|
307
|
+
} = props;
|
|
308
|
+
return _ref8 = sstyled(styles), /* @__PURE__ */ React.createElement(SBarPercent, _ref8.cn("SBarPercent", {
|
|
309
|
+
...assignProps({
|
|
310
|
+
"__excludeProps": excludeProps
|
|
311
|
+
}, _ref2)
|
|
312
|
+
}), /* @__PURE__ */ React.createElement(Children, _ref8.cn("Children", {})));
|
|
300
313
|
}
|
|
301
314
|
function Value(props) {
|
|
302
315
|
var _ref3 = arguments[0], _ref9;
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
316
|
+
const SBarValue = Box;
|
|
317
|
+
const {
|
|
318
|
+
styles,
|
|
319
|
+
Children
|
|
320
|
+
} = props;
|
|
321
|
+
return _ref9 = sstyled(styles), /* @__PURE__ */ React.createElement(SBarValue, _ref9.cn("SBarValue", {
|
|
322
|
+
...assignProps({
|
|
323
|
+
"__excludeProps": excludeProps
|
|
324
|
+
}, _ref3)
|
|
325
|
+
}), /* @__PURE__ */ React.createElement(Children, _ref9.cn("Children", {})));
|
|
308
326
|
}
|
|
309
|
-
|
|
327
|
+
const BarContext = /* @__PURE__ */ React.createContext({});
|
|
310
328
|
function Bar(props) {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
329
|
+
const {
|
|
330
|
+
Children,
|
|
331
|
+
index,
|
|
332
|
+
onClick,
|
|
333
|
+
transparent,
|
|
334
|
+
hide
|
|
335
|
+
} = props;
|
|
336
|
+
const onClickHandler = React.useCallback((event) => {
|
|
337
|
+
onClick == null ? void 0 : onClick(index, event);
|
|
314
338
|
}, [onClick, index]);
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
};
|
|
321
|
-
}, [onClickHandler, transparent, hide]);
|
|
339
|
+
const contextValue = React.useMemo(() => ({
|
|
340
|
+
onClick: onClickHandler,
|
|
341
|
+
transparent,
|
|
342
|
+
hide
|
|
343
|
+
}), [onClickHandler, transparent, hide]);
|
|
322
344
|
return /* @__PURE__ */ React.createElement(BarContext.Provider, {
|
|
323
345
|
value: contextValue
|
|
324
346
|
}, /* @__PURE__ */ React.createElement(Children, null));
|
|
325
347
|
}
|
|
326
348
|
function BarFill(props) {
|
|
327
349
|
var _ref0;
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
350
|
+
const {
|
|
351
|
+
Element: SBar,
|
|
352
|
+
styles,
|
|
353
|
+
color,
|
|
354
|
+
x,
|
|
355
|
+
y,
|
|
356
|
+
width,
|
|
357
|
+
height,
|
|
358
|
+
uid,
|
|
359
|
+
duration,
|
|
360
|
+
resolveColor,
|
|
361
|
+
patterns,
|
|
362
|
+
i: i2,
|
|
363
|
+
scale
|
|
364
|
+
} = props;
|
|
365
|
+
const [xScale] = scale;
|
|
366
|
+
const xRange = xScale.range();
|
|
367
|
+
const backgroundWidth = xRange[1] - xRange[0];
|
|
368
|
+
const radius = 0;
|
|
369
|
+
const pathD = React.useMemo(() => {
|
|
334
370
|
if (backgroundWidth - radius > width) {
|
|
335
371
|
return roundedPath(x, y, width, height, radius);
|
|
336
372
|
}
|
|
337
373
|
return roundedPath(x, y, width, height, radius, false, true, false, true);
|
|
338
374
|
}, [x, y, height, width, radius]);
|
|
339
|
-
|
|
375
|
+
const barProps = React.useContext(BarContext);
|
|
340
376
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, (_ref0 = sstyled(styles), /* @__PURE__ */ React.createElement(SBar, _ref0.cn("SBar", {
|
|
341
377
|
"aria-hidden": true,
|
|
342
378
|
"render": "path",
|
|
343
379
|
"d": pathD,
|
|
344
|
-
"clipPath":
|
|
380
|
+
"clipPath": `url(#${uid})`,
|
|
345
381
|
"__excludeProps": ["data", "scale", "value", "offset"],
|
|
346
382
|
"childrenPosition": "above",
|
|
347
383
|
"index": i2,
|
|
348
384
|
"color": resolveColor(color),
|
|
349
|
-
"pattern": patterns ?
|
|
385
|
+
"pattern": patterns ? `url(#${uid}-${i2}-pattern)` : void 0,
|
|
350
386
|
"x": x,
|
|
351
387
|
"y": y,
|
|
352
388
|
"width": width,
|
|
353
389
|
"height": height,
|
|
354
|
-
"use:duration":
|
|
390
|
+
"use:duration": `${duration}ms`,
|
|
355
391
|
"onClick": callAllEventHandlers(props.onClick, barProps.onClick),
|
|
356
392
|
"transparent": barProps.transparent || props.transparent,
|
|
357
393
|
"hide": barProps.hide || props.hide
|
|
358
394
|
}))), patterns && /* @__PURE__ */ React.createElement(PatternFill, _ref0.cn("PatternFill", {
|
|
359
|
-
"id":
|
|
395
|
+
"id": `${uid}-${i2}-pattern`,
|
|
360
396
|
"patternKey": color,
|
|
361
397
|
"color": resolveColor(color),
|
|
362
398
|
"patterns": patterns
|
|
@@ -364,15 +400,22 @@ function BarFill(props) {
|
|
|
364
400
|
}
|
|
365
401
|
function BarBackground(props) {
|
|
366
402
|
var _ref1;
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
403
|
+
const {
|
|
404
|
+
Element: SBackground,
|
|
405
|
+
styles,
|
|
406
|
+
scale,
|
|
407
|
+
y,
|
|
408
|
+
x,
|
|
409
|
+
height
|
|
410
|
+
} = props;
|
|
411
|
+
const [xScale] = scale;
|
|
412
|
+
const xRange = xScale.range();
|
|
413
|
+
const width = xRange[1] - xRange[0];
|
|
414
|
+
const radius = 0;
|
|
415
|
+
const pathD = React.useMemo(() => {
|
|
373
416
|
return roundedPath(x, y, width, height, radius, false, true, false, true);
|
|
374
417
|
}, [x, y, height, width, radius]);
|
|
375
|
-
|
|
418
|
+
const barProps = React.useContext(BarContext);
|
|
376
419
|
return _ref1 = sstyled(styles), /* @__PURE__ */ React.createElement(SBackground, _ref1.cn("SBackground", {
|
|
377
420
|
"aria-hidden": true,
|
|
378
421
|
"render": "path",
|
|
@@ -386,128 +429,130 @@ function BarBackground(props) {
|
|
|
386
429
|
"onClick": callAllEventHandlers(props.onClick, barProps.onClick)
|
|
387
430
|
}));
|
|
388
431
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
394
|
-
args[_key2] = arguments[_key2];
|
|
395
|
-
}
|
|
396
|
-
_this3 = _callSuper(this, Hover2, [].concat(args));
|
|
397
|
-
_defineProperty(_this3, "state", {
|
|
432
|
+
class Hover extends Component {
|
|
433
|
+
constructor(...args) {
|
|
434
|
+
super(...args);
|
|
435
|
+
_defineProperty(this, "state", {
|
|
398
436
|
index: null
|
|
399
437
|
});
|
|
400
|
-
_defineProperty(
|
|
401
|
-
_defineProperty(
|
|
402
|
-
_defineProperty(
|
|
403
|
-
_defineProperty(
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
438
|
+
_defineProperty(this, "virtualElement", canUseDOM() ? document.createElement("div") : {});
|
|
439
|
+
_defineProperty(this, "unsubscribeMouseMoveRoot", null);
|
|
440
|
+
_defineProperty(this, "unsubscribeMouseLeaveRoot", null);
|
|
441
|
+
_defineProperty(this, "handlerMouseMoveRoot", trottle((e) => {
|
|
442
|
+
const {
|
|
443
|
+
eventEmitter,
|
|
444
|
+
rootRef,
|
|
445
|
+
patterns,
|
|
446
|
+
updateIndexToHover,
|
|
447
|
+
plotId
|
|
448
|
+
} = this.asProps;
|
|
449
|
+
const point = eventToPoint(e, rootRef.current);
|
|
450
|
+
const {
|
|
451
|
+
clientX,
|
|
452
|
+
clientY
|
|
453
|
+
} = e;
|
|
454
|
+
const index = this.getIndex(point);
|
|
455
|
+
this.setState({
|
|
409
456
|
index
|
|
410
|
-
},
|
|
411
|
-
eventEmitter.emit(
|
|
412
|
-
eventEmitter.emit(
|
|
457
|
+
}, () => {
|
|
458
|
+
eventEmitter.emit(`setTooltipPosition_${plotId}`, clientX, clientY);
|
|
459
|
+
eventEmitter.emit(`setTooltipRenderingProps_${plotId}`, {}, {
|
|
413
460
|
index,
|
|
414
461
|
patterns
|
|
415
462
|
});
|
|
416
|
-
eventEmitter.emit(
|
|
463
|
+
eventEmitter.emit(`setTooltipVisible_${plotId}`, index !== null);
|
|
417
464
|
updateIndexToHover(index);
|
|
418
465
|
});
|
|
419
466
|
}));
|
|
420
|
-
_defineProperty(
|
|
421
|
-
|
|
422
|
-
|
|
467
|
+
_defineProperty(this, "handlerMouseLeaveRoot", trottle(() => {
|
|
468
|
+
const {
|
|
469
|
+
updateIndexToHover,
|
|
470
|
+
plotId
|
|
471
|
+
} = this.asProps;
|
|
472
|
+
this.setState({
|
|
423
473
|
index: null
|
|
424
|
-
},
|
|
425
|
-
|
|
474
|
+
}, () => {
|
|
475
|
+
this.asProps.eventEmitter.emit(`setTooltipVisible_${plotId}`, false);
|
|
426
476
|
updateIndexToHover(null);
|
|
427
477
|
});
|
|
428
478
|
}));
|
|
429
|
-
return _this3;
|
|
430
479
|
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
value: function getIndex(point) {
|
|
451
|
-
var _this$asProps0 = this.asProps, data = _this$asProps0.data, getBarData = _this$asProps0.getBarData;
|
|
452
|
-
for (var _i = 0; _i < data.length; _i++) {
|
|
453
|
-
var bar = getBarData(_i);
|
|
454
|
-
if (point[0] >= bar.x && point[0] <= bar.x + bar.fullWidth && point[1] >= bar.y && point[1] <= bar.y + bar.height) {
|
|
455
|
-
return _i;
|
|
456
|
-
}
|
|
480
|
+
generateGetBoundingClientRect(x = 0, y = 0) {
|
|
481
|
+
return () => ({
|
|
482
|
+
width: 0,
|
|
483
|
+
height: 0,
|
|
484
|
+
top: y,
|
|
485
|
+
right: x,
|
|
486
|
+
bottom: y,
|
|
487
|
+
left: x
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
getIndex(point) {
|
|
491
|
+
const {
|
|
492
|
+
data,
|
|
493
|
+
getBarData
|
|
494
|
+
} = this.asProps;
|
|
495
|
+
for (let i2 = 0; i2 < data.length; i2++) {
|
|
496
|
+
const bar = getBarData(i2);
|
|
497
|
+
if (point[0] >= bar.x && point[0] <= bar.x + bar.fullWidth && point[1] >= bar.y && point[1] <= bar.y + bar.height) {
|
|
498
|
+
return i2;
|
|
457
499
|
}
|
|
458
|
-
return null;
|
|
459
|
-
}
|
|
460
|
-
}, {
|
|
461
|
-
key: "componentDidMount",
|
|
462
|
-
value: function componentDidMount() {
|
|
463
|
-
var _this4 = this;
|
|
464
|
-
var eventEmitter = this.asProps.eventEmitter;
|
|
465
|
-
this.unsubscribeMouseMoveRoot = eventEmitter.subscribe("onMouseMoveRoot", function(e) {
|
|
466
|
-
e.persist();
|
|
467
|
-
_this4.handlerMouseMoveRoot(e);
|
|
468
|
-
});
|
|
469
|
-
this.unsubscribeMouseLeaveRoot = eventEmitter.subscribe("onMouseLeaveRoot", this.handlerMouseLeaveRoot);
|
|
470
500
|
}
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
501
|
+
return null;
|
|
502
|
+
}
|
|
503
|
+
componentDidMount() {
|
|
504
|
+
const {
|
|
505
|
+
eventEmitter
|
|
506
|
+
} = this.asProps;
|
|
507
|
+
this.unsubscribeMouseMoveRoot = eventEmitter.subscribe("onMouseMoveRoot", (e) => {
|
|
508
|
+
e.persist();
|
|
509
|
+
this.handlerMouseMoveRoot(e);
|
|
510
|
+
});
|
|
511
|
+
this.unsubscribeMouseLeaveRoot = eventEmitter.subscribe("onMouseLeaveRoot", this.handlerMouseLeaveRoot);
|
|
512
|
+
}
|
|
513
|
+
componentWillUnmount() {
|
|
514
|
+
if (this.unsubscribeMouseMoveRoot) {
|
|
515
|
+
this.unsubscribeMouseMoveRoot();
|
|
480
516
|
}
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
value: function render() {
|
|
484
|
-
var _ref10;
|
|
485
|
-
var _this$asProps1 = this.asProps, styles = _this$asProps1.styles, getBarData = _this$asProps1.getBarData, render2 = _this$asProps1.render;
|
|
486
|
-
if (!render2) return null;
|
|
487
|
-
var index = this.state.index;
|
|
488
|
-
var SCompactHorizontalBarHoverRect = this.Element;
|
|
489
|
-
if (index === null) return null;
|
|
490
|
-
var bar = getBarData(index);
|
|
491
|
-
return _ref10 = sstyled(styles), /* @__PURE__ */ React.createElement(SCompactHorizontalBarHoverRect, _ref10.cn("SCompactHorizontalBarHoverRect", {
|
|
492
|
-
"render": "rect",
|
|
493
|
-
"x": bar.x,
|
|
494
|
-
"y": bar.y + bar.height - barHeight - hoverOffset * 2,
|
|
495
|
-
"width": bar.fullWidth,
|
|
496
|
-
"height": barHeight + hoverOffset * 2
|
|
497
|
-
}));
|
|
517
|
+
if (this.unsubscribeMouseLeaveRoot) {
|
|
518
|
+
this.unsubscribeMouseLeaveRoot();
|
|
498
519
|
}
|
|
499
|
-
}
|
|
500
|
-
|
|
520
|
+
}
|
|
521
|
+
render() {
|
|
522
|
+
var _ref10;
|
|
523
|
+
const {
|
|
524
|
+
styles,
|
|
525
|
+
getBarData,
|
|
526
|
+
render
|
|
527
|
+
} = this.asProps;
|
|
528
|
+
if (!render) return null;
|
|
529
|
+
const {
|
|
530
|
+
index
|
|
531
|
+
} = this.state;
|
|
532
|
+
const SCompactHorizontalBarHoverRect = this.Element;
|
|
533
|
+
if (index === null) return null;
|
|
534
|
+
const bar = getBarData(index);
|
|
535
|
+
return _ref10 = sstyled(styles), /* @__PURE__ */ React.createElement(SCompactHorizontalBarHoverRect, _ref10.cn("SCompactHorizontalBarHoverRect", {
|
|
536
|
+
"render": "rect",
|
|
537
|
+
"x": bar.x,
|
|
538
|
+
"y": bar.y + bar.height - barHeight - hoverOffset * 2,
|
|
539
|
+
"width": bar.fullWidth,
|
|
540
|
+
"height": barHeight + hoverOffset * 2
|
|
541
|
+
}));
|
|
542
|
+
}
|
|
543
|
+
}
|
|
501
544
|
function CompactHorizontalBarTooltip(props) {
|
|
502
545
|
var _ref4 = arguments[0], _ref11;
|
|
503
546
|
if (!props.render) return null;
|
|
504
|
-
|
|
505
|
-
return _ref11 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SCompactHorizontalBarRadarTooltip, _ref11.cn("SCompactHorizontalBarRadarTooltip",
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
547
|
+
const SCompactHorizontalBarRadarTooltip = Tooltip;
|
|
548
|
+
return _ref11 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SCompactHorizontalBarRadarTooltip, _ref11.cn("SCompactHorizontalBarRadarTooltip", {
|
|
549
|
+
...assignProps({
|
|
550
|
+
"tag": CompactHorizontalBar.Hover,
|
|
551
|
+
"excludeAnchorProps": true
|
|
552
|
+
}, _ref4)
|
|
553
|
+
}));
|
|
509
554
|
}
|
|
510
|
-
|
|
555
|
+
const CompactHorizontalBar = createElement(CompactHorizontalBarRoot, {
|
|
511
556
|
Annotation,
|
|
512
557
|
Label,
|
|
513
558
|
Percent,
|