@semcore/d3-chart 18.1.0 → 18.2.0-prerelease.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/lib/cjs/Area.js +12 -12
- package/lib/cjs/Axis.js +15 -15
- package/lib/cjs/Bar.js +206 -21
- package/lib/cjs/Bar.js.map +1 -1
- package/lib/cjs/Bubble.js +85 -38
- package/lib/cjs/Bubble.js.map +1 -1
- package/lib/cjs/CompactHorizontalBar.js +16 -16
- package/lib/cjs/Donut.js +65 -152
- package/lib/cjs/Donut.js.map +1 -1
- package/lib/cjs/Dots.js +13 -13
- package/lib/cjs/Dots.js.map +1 -1
- package/lib/cjs/HorizontalBar.js +32 -25
- package/lib/cjs/HorizontalBar.js.map +1 -1
- package/lib/cjs/Hover.js +64 -153
- package/lib/cjs/Hover.js.map +1 -1
- package/lib/cjs/Line.js +9 -9
- package/lib/cjs/Pattern.js +267 -273
- package/lib/cjs/Pattern.js.map +1 -1
- package/lib/cjs/Plot.js +4 -4
- package/lib/cjs/Plot.js.map +1 -1
- package/lib/cjs/Radar.js +19 -19
- package/lib/cjs/RadialTree.js +12 -12
- package/lib/cjs/Reference.js +31 -29
- package/lib/cjs/Reference.js.map +1 -1
- package/lib/cjs/ScatterPlot.js +9 -9
- package/lib/cjs/StackBar.js +7 -2
- package/lib/cjs/StackBar.js.map +1 -1
- package/lib/cjs/Tooltip.js +14 -13
- package/lib/cjs/Tooltip.js.map +1 -1
- package/lib/cjs/Venn.js +9 -9
- package/lib/cjs/a11y/DataAccessibilityTable.js +1 -1
- package/lib/cjs/a11y/DataAccessibilityTable.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yModule.js +2 -2
- package/lib/cjs/a11y/PlotA11yView.js +2 -2
- package/lib/cjs/component/Chart/AbstractChart.js +28 -21
- 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/BarChart.js +51 -0
- 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 +104 -20
- package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.js +27 -3
- 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/LineChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/ScoreBar/ScoreBarChart.js +165 -0
- package/lib/cjs/component/Chart/ScoreBar/ScoreBarChart.js.map +1 -0
- package/lib/cjs/component/Chart/ScoreBar/ScoreBarChart.type.js +2 -0
- package/lib/cjs/component/Chart/ScoreBar/ScoreBarChart.type.js.map +1 -0
- package/lib/cjs/component/Chart/ScoreBar/ScoreBarItem.js +147 -0
- package/lib/cjs/component/Chart/ScoreBar/ScoreBarItem.js.map +1 -0
- package/lib/cjs/component/Chart/ScoreBar/ScoreBarItem.type.js +2 -0
- package/lib/cjs/component/Chart/ScoreBar/ScoreBarItem.type.js.map +1 -0
- package/lib/cjs/component/Chart/ScoreBar/scoreBarChart.shadow.css +130 -0
- package/lib/cjs/component/Chart/ScoreDonutChart.js +196 -0
- package/lib/cjs/component/Chart/ScoreDonutChart.js.map +1 -0
- package/lib/cjs/component/Chart/ScoreDonutChart.type.js +2 -0
- package/lib/cjs/component/Chart/ScoreDonutChart.type.js.map +1 -0
- package/lib/cjs/component/Chart/index.js +8 -1
- package/lib/cjs/component/Chart/index.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +7 -7
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +18 -21
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/legend-item.shadow.css +7 -4
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +11 -11
- package/lib/cjs/component/Hover/HoverLine.js +144 -0
- package/lib/cjs/component/Hover/HoverLine.js.map +1 -0
- package/lib/cjs/component/Hover/HoverLine.type.js +2 -0
- package/lib/cjs/component/Hover/HoverLine.type.js.map +1 -0
- package/lib/cjs/component/Hover/HoveredTick.js +77 -0
- package/lib/cjs/component/Hover/HoveredTick.js.map +1 -0
- package/lib/cjs/component/Hover/hover.shadow.css +4 -0
- package/lib/cjs/component/Hover/hoveredTick.shadow.css +34 -0
- package/lib/cjs/style/area.shadow.css +5 -4
- package/lib/cjs/style/bar.shadow.css +1 -1
- package/lib/cjs/style/bubble.shadow.css +29 -24
- package/lib/cjs/style/donut.shadow.css +7 -9
- package/lib/cjs/style/dot.shadow.css +1 -1
- package/lib/cjs/style/hover.shadow.css +0 -40
- package/lib/cjs/style/line.shadow.css +1 -1
- package/lib/cjs/style/radar.shadow.css +2 -2
- package/lib/cjs/style/radial-tree.shadow.css +4 -4
- package/lib/cjs/style/scatterplot.shadow.css +2 -2
- package/lib/cjs/style/venn.shadow.css +3 -3
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +2 -0
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/types/Bar.d.js.map +1 -1
- package/lib/cjs/types/Bubble.d.js.map +1 -1
- package/lib/cjs/types/Donut.d.js.map +1 -1
- package/lib/cjs/types/HorizontalBar.d.js.map +1 -1
- package/lib/cjs/types/Plot.d.js.map +1 -1
- package/lib/cjs/types/index.d.js +24 -0
- package/lib/cjs/types/index.d.js.map +1 -1
- package/lib/cjs/utils.js +78 -30
- package/lib/cjs/utils.js.map +1 -1
- package/lib/es6/Area.js +12 -12
- package/lib/es6/Axis.js +15 -15
- package/lib/es6/Bar.js +207 -22
- package/lib/es6/Bar.js.map +1 -1
- package/lib/es6/Bubble.js +86 -39
- package/lib/es6/Bubble.js.map +1 -1
- package/lib/es6/CompactHorizontalBar.js +16 -16
- package/lib/es6/Donut.js +65 -152
- package/lib/es6/Donut.js.map +1 -1
- package/lib/es6/Dots.js +13 -13
- package/lib/es6/Dots.js.map +1 -1
- package/lib/es6/HorizontalBar.js +32 -25
- package/lib/es6/HorizontalBar.js.map +1 -1
- package/lib/es6/Hover.js +64 -153
- package/lib/es6/Hover.js.map +1 -1
- package/lib/es6/Line.js +9 -9
- package/lib/es6/Pattern.js +266 -272
- package/lib/es6/Pattern.js.map +1 -1
- package/lib/es6/Plot.js +4 -4
- package/lib/es6/Plot.js.map +1 -1
- package/lib/es6/Radar.js +19 -19
- package/lib/es6/RadialTree.js +12 -12
- package/lib/es6/Reference.js +31 -29
- package/lib/es6/Reference.js.map +1 -1
- package/lib/es6/ScatterPlot.js +9 -9
- package/lib/es6/StackBar.js +7 -2
- package/lib/es6/StackBar.js.map +1 -1
- package/lib/es6/Tooltip.js +14 -13
- package/lib/es6/Tooltip.js.map +1 -1
- package/lib/es6/Venn.js +9 -9
- package/lib/es6/a11y/DataAccessibilityTable.js +1 -1
- package/lib/es6/a11y/DataAccessibilityTable.js.map +1 -1
- package/lib/es6/a11y/PlotA11yModule.js +2 -2
- package/lib/es6/a11y/PlotA11yView.js +2 -2
- package/lib/es6/component/Chart/AbstractChart.js +29 -22
- 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/BarChart.js +51 -1
- 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 +105 -21
- package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.js +27 -3
- 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/LineChart.type.js.map +1 -1
- package/lib/es6/component/Chart/ScoreBar/ScoreBarChart.js +161 -0
- package/lib/es6/component/Chart/ScoreBar/ScoreBarChart.js.map +1 -0
- package/lib/es6/component/Chart/ScoreBar/ScoreBarChart.type.js +2 -0
- package/lib/es6/component/Chart/ScoreBar/ScoreBarChart.type.js.map +1 -0
- package/lib/es6/component/Chart/ScoreBar/ScoreBarItem.js +141 -0
- package/lib/es6/component/Chart/ScoreBar/ScoreBarItem.js.map +1 -0
- package/lib/es6/component/Chart/ScoreBar/ScoreBarItem.type.js +2 -0
- package/lib/es6/component/Chart/ScoreBar/ScoreBarItem.type.js.map +1 -0
- package/lib/es6/component/Chart/ScoreBar/scoreBarChart.shadow.css +130 -0
- package/lib/es6/component/Chart/ScoreDonutChart.js +189 -0
- package/lib/es6/component/Chart/ScoreDonutChart.js.map +1 -0
- package/lib/es6/component/Chart/ScoreDonutChart.type.js +2 -0
- package/lib/es6/component/Chart/ScoreDonutChart.type.js.map +1 -0
- package/lib/es6/component/Chart/index.js +8 -1
- package/lib/es6/component/Chart/index.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +7 -7
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +24 -26
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/legend-item.shadow.css +7 -4
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +11 -11
- package/lib/es6/component/Hover/HoverLine.js +138 -0
- package/lib/es6/component/Hover/HoverLine.js.map +1 -0
- package/lib/es6/component/Hover/HoverLine.type.js +2 -0
- package/lib/es6/component/Hover/HoverLine.type.js.map +1 -0
- package/lib/es6/component/Hover/HoveredTick.js +71 -0
- package/lib/es6/component/Hover/HoveredTick.js.map +1 -0
- package/lib/es6/component/Hover/hover.shadow.css +4 -0
- package/lib/es6/component/Hover/hoveredTick.shadow.css +34 -0
- package/lib/es6/style/area.shadow.css +5 -4
- package/lib/es6/style/bar.shadow.css +1 -1
- package/lib/es6/style/bubble.shadow.css +29 -24
- package/lib/es6/style/donut.shadow.css +7 -9
- package/lib/es6/style/dot.shadow.css +1 -1
- package/lib/es6/style/hover.shadow.css +0 -40
- package/lib/es6/style/line.shadow.css +1 -1
- package/lib/es6/style/radar.shadow.css +2 -2
- package/lib/es6/style/radial-tree.shadow.css +4 -4
- package/lib/es6/style/scatterplot.shadow.css +2 -2
- package/lib/es6/style/venn.shadow.css +3 -3
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -0
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/types/Bar.d.js.map +1 -1
- package/lib/es6/types/Bubble.d.js.map +1 -1
- package/lib/es6/types/Donut.d.js.map +1 -1
- package/lib/es6/types/HorizontalBar.d.js.map +1 -1
- package/lib/es6/types/Plot.d.js.map +1 -1
- package/lib/es6/types/index.d.js +2 -0
- package/lib/es6/types/index.d.js.map +1 -1
- package/lib/es6/utils.js +71 -28
- package/lib/es6/utils.js.map +1 -1
- package/lib/esm/Area.mjs +13 -13
- package/lib/esm/Axis.mjs +16 -16
- package/lib/esm/Bar.mjs +205 -22
- package/lib/esm/Bubble.mjs +87 -40
- package/lib/esm/CompactHorizontalBar.mjs +17 -17
- package/lib/esm/Donut.mjs +66 -151
- package/lib/esm/Dots.mjs +14 -14
- package/lib/esm/HorizontalBar.mjs +33 -26
- package/lib/esm/Hover.mjs +65 -154
- package/lib/esm/Line.mjs +10 -10
- package/lib/esm/Pattern.mjs +268 -273
- package/lib/esm/Plot.mjs +5 -5
- package/lib/esm/Radar.mjs +20 -20
- package/lib/esm/RadialTree.mjs +13 -13
- package/lib/esm/Reference.mjs +33 -30
- package/lib/esm/ScatterPlot.mjs +10 -10
- package/lib/esm/StackBar.mjs +7 -2
- package/lib/esm/Tooltip.mjs +15 -14
- package/lib/esm/Venn.mjs +10 -10
- package/lib/esm/a11y/DataAccessibilityTable.mjs +1 -1
- package/lib/esm/a11y/PlotA11yModule.mjs +3 -3
- package/lib/esm/a11y/PlotA11yView.mjs +3 -3
- package/lib/esm/component/Chart/AbstractChart.mjs +30 -23
- package/lib/esm/component/Chart/BarChart.mjs +49 -0
- package/lib/esm/component/Chart/BubbleChart.mjs +104 -20
- package/lib/esm/component/Chart/DonutChart.mjs +27 -3
- package/lib/esm/component/Chart/ScoreBar/ScoreBarChart.mjs +160 -0
- package/lib/esm/component/Chart/ScoreBar/ScoreBarItem.mjs +149 -0
- package/lib/esm/component/Chart/ScoreBar/scoreBarChart.shadow.css +130 -0
- package/lib/esm/component/Chart/ScoreDonutChart.mjs +186 -0
- package/lib/esm/component/Chart/index.mjs +8 -1
- package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +8 -8
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +19 -22
- package/lib/esm/component/ChartLegend/LegendItem/legend-item.shadow.css +7 -4
- package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +12 -12
- package/lib/esm/component/Hover/HoverLine.mjs +146 -0
- package/lib/esm/component/Hover/HoveredTick.mjs +79 -0
- package/lib/esm/component/Hover/hover.shadow.css +4 -0
- package/lib/esm/component/Hover/hoveredTick.shadow.css +34 -0
- package/lib/esm/style/area.shadow.css +5 -4
- package/lib/esm/style/bar.shadow.css +1 -1
- package/lib/esm/style/bubble.shadow.css +29 -24
- package/lib/esm/style/donut.shadow.css +7 -9
- package/lib/esm/style/dot.shadow.css +1 -1
- package/lib/esm/style/hover.shadow.css +0 -40
- package/lib/esm/style/line.shadow.css +1 -1
- package/lib/esm/style/radar.shadow.css +2 -2
- package/lib/esm/style/radial-tree.shadow.css +4 -4
- package/lib/esm/style/scatterplot.shadow.css +2 -2
- package/lib/esm/style/venn.shadow.css +3 -3
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -0
- package/lib/esm/translations/de.json.mjs +12 -0
- package/lib/esm/utils.mjs +75 -28
- package/lib/types/Bar.d.ts +3 -0
- package/lib/types/Bubble.d.ts +4 -1
- package/lib/types/Donut.d.ts +0 -4
- package/lib/types/HorizontalBar.d.ts +3 -0
- package/lib/types/Pattern.d.ts +10 -8
- package/lib/types/Pattern.d.ts.map +1 -1
- package/lib/types/Plot.d.ts +6 -1
- package/lib/types/component/Chart/AbstractChart.d.ts +15 -1
- package/lib/types/component/Chart/AbstractChart.d.ts.map +1 -1
- package/lib/types/component/Chart/AbstractChart.type.d.ts +28 -0
- package/lib/types/component/Chart/AbstractChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/BarChart.d.ts.map +1 -1
- package/lib/types/component/Chart/BarChart.type.d.ts +9 -1
- package/lib/types/component/Chart/BarChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/BubbleChart.d.ts.map +1 -1
- package/lib/types/component/Chart/DonutChart.d.ts.map +1 -1
- package/lib/types/component/Chart/DonutChart.type.d.ts +5 -2
- package/lib/types/component/Chart/DonutChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/LineChart.type.d.ts +2 -30
- package/lib/types/component/Chart/LineChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/ScoreBar/ScoreBarChart.d.ts +8 -0
- package/lib/types/component/Chart/ScoreBar/ScoreBarChart.d.ts.map +1 -0
- package/lib/types/component/Chart/ScoreBar/ScoreBarChart.type.d.ts +80 -0
- package/lib/types/component/Chart/ScoreBar/ScoreBarChart.type.d.ts.map +1 -0
- package/lib/types/component/Chart/ScoreBar/ScoreBarItem.d.ts +3 -0
- package/lib/types/component/Chart/ScoreBar/ScoreBarItem.d.ts.map +1 -0
- package/lib/types/component/Chart/ScoreBar/ScoreBarItem.type.d.ts +20 -0
- package/lib/types/component/Chart/ScoreBar/ScoreBarItem.type.d.ts.map +1 -0
- package/lib/types/component/Chart/ScoreDonutChart.d.ts +8 -0
- package/lib/types/component/Chart/ScoreDonutChart.d.ts.map +1 -0
- package/lib/types/component/Chart/ScoreDonutChart.type.d.ts +40 -0
- package/lib/types/component/Chart/ScoreDonutChart.type.d.ts.map +1 -0
- package/lib/types/component/Chart/index.d.ts +5 -0
- package/lib/types/component/Chart/index.d.ts.map +1 -1
- package/lib/types/component/Hover/HoverLine.d.ts +2 -0
- package/lib/types/component/Hover/HoverLine.d.ts.map +1 -0
- package/lib/types/component/Hover/HoverLine.type.d.ts +17 -0
- package/lib/types/component/Hover/HoverLine.type.d.ts.map +1 -0
- package/lib/types/component/Hover/HoveredTick.d.ts +21 -0
- package/lib/types/component/Hover/HoveredTick.d.ts.map +1 -0
- package/lib/types/index.d.ts +2 -0
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +5 -0
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts.map +1 -1
- package/lib/types/utils.d.ts +11 -2
- package/lib/types/utils.d.ts.map +1 -1
- package/package.json +9 -10
package/lib/esm/Donut.mjs
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { sstyled, Component, assignProps } from "@semcore/core";
|
|
3
|
+
import { Flex } from "@semcore/base-components";
|
|
3
4
|
import { callAllEventHandlers } from "@semcore/core/lib/utils/assignProps";
|
|
4
|
-
import canUseDOM from "@semcore/core/lib/utils/canUseDOM";
|
|
5
5
|
import getOriginChildren from "@semcore/core/lib/utils/getOriginChildren";
|
|
6
6
|
import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
7
|
-
import { easeCubicOut } from "d3-ease";
|
|
8
7
|
import { interpolate } from "d3-interpolate";
|
|
9
8
|
import { arc, pie } from "d3-shape";
|
|
10
9
|
import { transition } from "d3-transition";
|
|
@@ -18,19 +17,19 @@ const style = (
|
|
|
18
17
|
/*__reshadow_css_start__*/
|
|
19
18
|
(sstyled.insert(
|
|
20
19
|
/*__inner_css_start__*/
|
|
21
|
-
".
|
|
20
|
+
".___SPie_yp9ze_gg_{stroke:var(--intergalactic-chart-grid-border,#fff);fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));transition:opacity calc(var(--intergalactic-duration-extra-fast, 100)*1ms) ease-out}.___SPie_yp9ze_gg_.__color_yp9ze_gg_{fill:var(--color_yp9ze)}.___SPie_yp9ze_gg_.__pattern_yp9ze_gg_.__color_yp9ze_gg_{fill:var(--pattern_yp9ze);stroke:var(--color_yp9ze);stroke-width:1px}.___SPie_yp9ze_gg_.__transparent_yp9ze_gg_{opacity:var(--intergalactic-chart-transparent-opacity,.3)}.___SLabel_yp9ze_gg_{word-wrap:anywhere;pointer-events:none}.___SEmptyData_yp9ze_gg_{fill:var(--intergalactic-chart-data-null,oklch(.9 .009 234))}.___SEmptyData_yp9ze_gg_.__color_yp9ze_gg_{fill:var(--color_yp9ze)}",
|
|
22
21
|
/*__inner_css_end__*/
|
|
23
|
-
"
|
|
22
|
+
"yp9ze_gg_"
|
|
24
23
|
), /*__reshadow_css_end__*/
|
|
25
24
|
{
|
|
26
|
-
"__SPie": "
|
|
27
|
-
"_color": "
|
|
28
|
-
"--color": "--
|
|
29
|
-
"_pattern": "
|
|
30
|
-
"--pattern": "--
|
|
31
|
-
"_transparent": "
|
|
32
|
-
"
|
|
33
|
-
"
|
|
25
|
+
"__SPie": "___SPie_yp9ze_gg_",
|
|
26
|
+
"_color": "__color_yp9ze_gg_",
|
|
27
|
+
"--color": "--color_yp9ze",
|
|
28
|
+
"_pattern": "__pattern_yp9ze_gg_",
|
|
29
|
+
"--pattern": "--pattern_yp9ze",
|
|
30
|
+
"_transparent": "__transparent_yp9ze_gg_",
|
|
31
|
+
"__SLabel": "___SLabel_yp9ze_gg_",
|
|
32
|
+
"__SEmptyData": "___SEmptyData_yp9ze_gg_"
|
|
34
33
|
})
|
|
35
34
|
);
|
|
36
35
|
const DEFAULT_INSTANCE = /* @__PURE__ */ Symbol("DEFAULT_INSTANCE");
|
|
@@ -40,9 +39,7 @@ function transitionAnglePie({
|
|
|
40
39
|
duration,
|
|
41
40
|
halfsize,
|
|
42
41
|
d3Arc,
|
|
43
|
-
|
|
44
|
-
arcs,
|
|
45
|
-
activeIndexPie
|
|
42
|
+
arcs
|
|
46
43
|
}) {
|
|
47
44
|
return transition().selection().selectAll(selector).interrupt().transition().duration(duration).attrTween("d", function(_, ind) {
|
|
48
45
|
if (!arcs[ind]) return () => "";
|
|
@@ -61,45 +58,25 @@ function transitionAnglePie({
|
|
|
61
58
|
d.startAngle = iStartAngle(t);
|
|
62
59
|
d.endAngle = iEndAngle(t);
|
|
63
60
|
self.arc = d;
|
|
64
|
-
return
|
|
61
|
+
return d3Arc(self.arc);
|
|
65
62
|
};
|
|
66
63
|
});
|
|
67
64
|
}
|
|
68
|
-
|
|
69
|
-
data,
|
|
70
|
-
selector,
|
|
71
|
-
element,
|
|
72
|
-
duration,
|
|
73
|
-
innerRadius,
|
|
74
|
-
outerRadiusStartEnd,
|
|
75
|
-
paddingAngle
|
|
76
|
-
}) {
|
|
77
|
-
return transition().selection().select(selector).interrupt().transition().duration(duration).ease(easeCubicOut).attrTween("d", function() {
|
|
78
|
-
const [start, end] = outerRadiusStartEnd;
|
|
79
|
-
const iOuterRadius = interpolate(start, end);
|
|
80
|
-
return function(t) {
|
|
81
|
-
const outerRadiusPX = iOuterRadius(t);
|
|
82
|
-
element.dataset["currentRadius"] = outerRadiusPX;
|
|
83
|
-
const d3ArcOut = arc().innerRadius(innerRadius).outerRadius(outerRadiusPX).padAngle(paddingAngle);
|
|
84
|
-
return d3ArcOut(data);
|
|
85
|
-
};
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
const increaseFactor = 4;
|
|
89
|
-
const donutThickness = 16;
|
|
65
|
+
const donutThickness = 12;
|
|
90
66
|
function getOuterRadius({
|
|
91
67
|
size,
|
|
92
68
|
halfsize
|
|
93
69
|
}) {
|
|
94
70
|
const [width, height] = size;
|
|
95
71
|
const minORmax = halfsize ? Math.max : Math.min;
|
|
96
|
-
return minORmax(width
|
|
72
|
+
return minORmax(width, height) / 2;
|
|
97
73
|
}
|
|
98
74
|
class DonutRoot extends Component {
|
|
99
75
|
constructor(...args) {
|
|
100
76
|
super(...args);
|
|
101
|
-
_defineProperty(this, "
|
|
102
|
-
|
|
77
|
+
_defineProperty(this, "state", {
|
|
78
|
+
active: null
|
|
79
|
+
});
|
|
103
80
|
_defineProperty(this, "canAnimatedHover", false);
|
|
104
81
|
_defineProperty(this, "bindHandlerTooltip", (visible, props, tooltipProps) => ({
|
|
105
82
|
clientX,
|
|
@@ -113,32 +90,6 @@ class DonutRoot extends Component {
|
|
|
113
90
|
eventEmitter.emit(`setTooltipRenderingProps_${plotId}`, props, tooltipProps);
|
|
114
91
|
eventEmitter.emit(`setTooltipVisible_${plotId}`, visible);
|
|
115
92
|
});
|
|
116
|
-
_defineProperty(this, "animationActivePie", ({
|
|
117
|
-
data,
|
|
118
|
-
active,
|
|
119
|
-
selector,
|
|
120
|
-
element
|
|
121
|
-
}) => {
|
|
122
|
-
const {
|
|
123
|
-
duration,
|
|
124
|
-
d3Arc,
|
|
125
|
-
paddingAngle
|
|
126
|
-
} = this.asProps;
|
|
127
|
-
const outerRadius = d3Arc.outerRadius()();
|
|
128
|
-
const innerRadius = d3Arc.innerRadius()();
|
|
129
|
-
const outerRadiusStartEnd = active ? [+element.dataset["currentRadius"] || outerRadius, outerRadius + increaseFactor] : [+element.dataset["currentRadius"] || outerRadius, outerRadius];
|
|
130
|
-
if (this.canAnimatedHover && duration > 0) {
|
|
131
|
-
transitionRadiusPie({
|
|
132
|
-
data,
|
|
133
|
-
selector: `#${this.id} ${selector}`,
|
|
134
|
-
element,
|
|
135
|
-
duration: TRANSITION_RADIUS_DURATION,
|
|
136
|
-
innerRadius,
|
|
137
|
-
outerRadiusStartEnd,
|
|
138
|
-
paddingAngle
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
93
|
_defineProperty(this, "animationTimeout", null);
|
|
143
94
|
_defineProperty(this, "animationUpdatePie", () => {
|
|
144
95
|
clearTimeout(this.animationTimeout);
|
|
@@ -146,8 +97,7 @@ class DonutRoot extends Component {
|
|
|
146
97
|
const {
|
|
147
98
|
duration,
|
|
148
99
|
d3Arc,
|
|
149
|
-
halfsize
|
|
150
|
-
d3ArcOut
|
|
100
|
+
halfsize
|
|
151
101
|
} = this.asProps;
|
|
152
102
|
this.canAnimatedHover = false;
|
|
153
103
|
if (duration > 0) {
|
|
@@ -156,9 +106,7 @@ class DonutRoot extends Component {
|
|
|
156
106
|
duration,
|
|
157
107
|
arcs: this.arcs,
|
|
158
108
|
halfsize,
|
|
159
|
-
d3Arc
|
|
160
|
-
d3ArcOut,
|
|
161
|
-
activeIndexPie: this.activeIndexPie
|
|
109
|
+
d3Arc
|
|
162
110
|
}).on("end", () => {
|
|
163
111
|
this.canAnimatedHover = true;
|
|
164
112
|
});
|
|
@@ -175,16 +123,6 @@ class DonutRoot extends Component {
|
|
|
175
123
|
} = this.asProps;
|
|
176
124
|
return id || uid;
|
|
177
125
|
}
|
|
178
|
-
generateGetBoundingClientRect(x = 0, y = 0) {
|
|
179
|
-
return () => ({
|
|
180
|
-
width: 0,
|
|
181
|
-
height: 0,
|
|
182
|
-
top: y,
|
|
183
|
-
right: x,
|
|
184
|
-
bottom: y,
|
|
185
|
-
left: x
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
126
|
getArcs() {
|
|
189
127
|
const {
|
|
190
128
|
Children,
|
|
@@ -224,63 +162,47 @@ class DonutRoot extends Component {
|
|
|
224
162
|
getPieProps(props, index) {
|
|
225
163
|
const {
|
|
226
164
|
d3Arc,
|
|
227
|
-
d3ArcOut,
|
|
228
165
|
innerRadius,
|
|
229
166
|
outerRadius,
|
|
230
167
|
halfsize,
|
|
231
168
|
resolveColor,
|
|
232
|
-
uid,
|
|
233
169
|
patterns
|
|
234
170
|
} = this.asProps;
|
|
235
171
|
const {
|
|
236
|
-
|
|
172
|
+
transparent
|
|
237
173
|
} = props;
|
|
238
174
|
const data = this.arcs.find((arc2) => arc2.data[0] === props.dataKey);
|
|
239
|
-
if (active) {
|
|
240
|
-
this.activeIndexPie = index;
|
|
241
|
-
}
|
|
242
175
|
const tooltipProps = {
|
|
243
176
|
dataKey: props.dataKey,
|
|
244
177
|
name: props.name,
|
|
245
178
|
resolveColor,
|
|
246
179
|
color: props.color || getChartDefaultColorName(index),
|
|
247
|
-
active: props.active,
|
|
248
180
|
transparent: props.transparent,
|
|
249
181
|
patterns
|
|
250
182
|
};
|
|
183
|
+
const pieId = `${this.id}-${index}`;
|
|
251
184
|
return {
|
|
252
185
|
data,
|
|
253
186
|
d3Arc,
|
|
254
|
-
d3ArcOut,
|
|
255
187
|
innerRadius,
|
|
256
188
|
outerRadius,
|
|
257
|
-
uid:
|
|
189
|
+
uid: pieId,
|
|
258
190
|
patterns,
|
|
259
191
|
halfsize,
|
|
260
192
|
color: props.color || getChartDefaultColorName(index),
|
|
261
193
|
resolveColor,
|
|
262
|
-
|
|
194
|
+
transparent: transparent ?? (this.state.active !== null && this.state.active !== pieId),
|
|
263
195
|
onMouseMove: this.bindHandlerTooltip(true, props, tooltipProps),
|
|
264
196
|
onMouseLeave: this.bindHandlerTooltip(false, props, tooltipProps),
|
|
265
197
|
onMouseOver: (e) => {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
data,
|
|
270
|
-
selector: `[d="${e.target.getAttribute("d")}"]`,
|
|
271
|
-
element: e.target
|
|
272
|
-
});
|
|
273
|
-
}
|
|
198
|
+
this.setState({
|
|
199
|
+
active: pieId
|
|
200
|
+
});
|
|
274
201
|
},
|
|
275
202
|
onMouseOut: (e) => {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
data,
|
|
280
|
-
selector: `[d="${e.target.getAttribute("d")}"]`,
|
|
281
|
-
element: e.target
|
|
282
|
-
});
|
|
283
|
-
}
|
|
203
|
+
this.setState({
|
|
204
|
+
active: null
|
|
205
|
+
});
|
|
284
206
|
},
|
|
285
207
|
onClickPieRoot: this.handlerOnClick(props.dataKey)
|
|
286
208
|
};
|
|
@@ -293,6 +215,16 @@ class DonutRoot extends Component {
|
|
|
293
215
|
d3Arc
|
|
294
216
|
};
|
|
295
217
|
}
|
|
218
|
+
getLabelProps() {
|
|
219
|
+
const {
|
|
220
|
+
halfsize,
|
|
221
|
+
size
|
|
222
|
+
} = this.asProps;
|
|
223
|
+
return {
|
|
224
|
+
halfsize,
|
|
225
|
+
innerFlexHeight: size.height
|
|
226
|
+
};
|
|
227
|
+
}
|
|
296
228
|
componentDidUpdate(prevProps) {
|
|
297
229
|
const {
|
|
298
230
|
data
|
|
@@ -305,6 +237,7 @@ class DonutRoot extends Component {
|
|
|
305
237
|
this.animationUpdatePie();
|
|
306
238
|
}
|
|
307
239
|
render() {
|
|
240
|
+
this.activeIndexPie = void 0;
|
|
308
241
|
const {
|
|
309
242
|
halfsize,
|
|
310
243
|
size
|
|
@@ -328,7 +261,7 @@ _defineProperty(DonutRoot, "style", style);
|
|
|
328
261
|
_defineProperty(DonutRoot, "enhance", [uniqueIDEnhancement()]);
|
|
329
262
|
_defineProperty(DonutRoot, "defaultProps", ({
|
|
330
263
|
innerRadius: innerRadiusProp,
|
|
331
|
-
paddingAngle
|
|
264
|
+
paddingAngle,
|
|
332
265
|
outerRadius,
|
|
333
266
|
halfsize = false,
|
|
334
267
|
$rootProps: {
|
|
@@ -340,8 +273,8 @@ _defineProperty(DonutRoot, "defaultProps", ({
|
|
|
340
273
|
halfsize
|
|
341
274
|
});
|
|
342
275
|
const innerRadius = innerRadiusProp ?? Math.max(radius - donutThickness, 0);
|
|
343
|
-
const
|
|
344
|
-
const
|
|
276
|
+
const padAngle = paddingAngle ?? 2 / radius;
|
|
277
|
+
const d3Arc = arc().outerRadius(radius).innerRadius(innerRadius).padAngle(padAngle).cornerRadius(2);
|
|
345
278
|
let d3Pie = pie().sort(null).value(([, value]) => value);
|
|
346
279
|
d3Pie[DEFAULT_INSTANCE] = true;
|
|
347
280
|
if (halfsize) {
|
|
@@ -350,8 +283,7 @@ _defineProperty(DonutRoot, "defaultProps", ({
|
|
|
350
283
|
return {
|
|
351
284
|
d3Pie,
|
|
352
285
|
d3Arc,
|
|
353
|
-
|
|
354
|
-
duration: 500,
|
|
286
|
+
duration: TRANSITION_RADIUS_DURATION,
|
|
355
287
|
paddingAngle,
|
|
356
288
|
innerRadius
|
|
357
289
|
};
|
|
@@ -362,46 +294,18 @@ function Pie({
|
|
|
362
294
|
d3Arc,
|
|
363
295
|
data,
|
|
364
296
|
color,
|
|
365
|
-
$animationActivePie,
|
|
366
|
-
active,
|
|
367
|
-
d3ArcOut,
|
|
368
297
|
name,
|
|
369
298
|
dataKey,
|
|
370
299
|
dataHintsHandler,
|
|
371
300
|
transparent,
|
|
372
|
-
innerRadius,
|
|
373
|
-
outerRadius,
|
|
374
301
|
resolveColor,
|
|
375
|
-
halfsize,
|
|
376
302
|
uid,
|
|
377
303
|
patterns,
|
|
378
304
|
onClick,
|
|
379
|
-
onClickPieRoot
|
|
380
|
-
...other
|
|
305
|
+
onClickPieRoot
|
|
381
306
|
}) {
|
|
382
307
|
var _ref2;
|
|
383
|
-
const [isMount, setIsMount] = React.useState(false);
|
|
384
308
|
const pieRef = React.useRef(null);
|
|
385
|
-
React.useEffect(() => {
|
|
386
|
-
if (!pieRef.current) return;
|
|
387
|
-
pieRef.current.dataset["currentRadius"] = (active ? d3ArcOut : d3Arc).outerRadius()();
|
|
388
|
-
if (!isMount) {
|
|
389
|
-
setIsMount(true);
|
|
390
|
-
return;
|
|
391
|
-
}
|
|
392
|
-
if (active !== void 0 && active !== null) {
|
|
393
|
-
$animationActivePie({
|
|
394
|
-
active,
|
|
395
|
-
data,
|
|
396
|
-
selector: `[name="${other.name}"]`,
|
|
397
|
-
element: pieRef.current
|
|
398
|
-
});
|
|
399
|
-
}
|
|
400
|
-
}, [active, Boolean(data)]);
|
|
401
|
-
React.useEffect(() => {
|
|
402
|
-
if (!pieRef.current) return;
|
|
403
|
-
pieRef.current.dataset["currentRadius"] = (active ? d3ArcOut : d3Arc).outerRadius()();
|
|
404
|
-
}, [active, innerRadius, outerRadius, halfsize, Boolean(data)]);
|
|
405
309
|
if (!data) return null;
|
|
406
310
|
dataHintsHandler.establishDataType("values-set");
|
|
407
311
|
dataHintsHandler.describeValueEntity(dataKey, name);
|
|
@@ -410,7 +314,7 @@ function Pie({
|
|
|
410
314
|
"ref": pieRef,
|
|
411
315
|
"color": resolveColor(color),
|
|
412
316
|
"pattern": patterns ? `url(#${uid}-pattern)` : void 0,
|
|
413
|
-
"d":
|
|
317
|
+
"d": d3Arc(data),
|
|
414
318
|
"transparent": transparent,
|
|
415
319
|
"use:onClick": callAllEventHandlers(onClickPieRoot, onClick)
|
|
416
320
|
}))), patterns && /* @__PURE__ */ React.createElement(PatternFill, _ref2.cn("PatternFill", {
|
|
@@ -425,7 +329,8 @@ function EmptyData({
|
|
|
425
329
|
styles,
|
|
426
330
|
d3Arc,
|
|
427
331
|
color,
|
|
428
|
-
resolveColor
|
|
332
|
+
resolveColor,
|
|
333
|
+
emptyData
|
|
429
334
|
}) {
|
|
430
335
|
var _ref3;
|
|
431
336
|
return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SEmptyData, _ref3.cn("SEmptyData", {
|
|
@@ -444,17 +349,27 @@ function Label({
|
|
|
444
349
|
children,
|
|
445
350
|
label,
|
|
446
351
|
dataHintsHandler,
|
|
447
|
-
|
|
448
|
-
|
|
352
|
+
halfsize,
|
|
353
|
+
x,
|
|
354
|
+
y,
|
|
355
|
+
innerFlexHeight
|
|
449
356
|
}) {
|
|
450
357
|
var _ref4;
|
|
451
358
|
dataHintsHandler.setTitle("vertical", label || children);
|
|
452
359
|
return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(SLabel, _ref4.cn("SLabel", {
|
|
453
|
-
"render": "
|
|
454
|
-
"x": x,
|
|
455
|
-
"y": y,
|
|
456
|
-
"aria-hidden": true
|
|
457
|
-
|
|
360
|
+
"render": "foreignObject",
|
|
361
|
+
"x": x ?? "-50%",
|
|
362
|
+
"y": y ?? (halfsize ? "-100%" : "-50%"),
|
|
363
|
+
"aria-hidden": true,
|
|
364
|
+
"width": "100%",
|
|
365
|
+
"height": "100%"
|
|
366
|
+
}), /* @__PURE__ */ React.createElement(Flex, _ref4.cn("Flex", {
|
|
367
|
+
"alignItems": "center",
|
|
368
|
+
"textAlign": "center",
|
|
369
|
+
"justifyContent": halfsize ? "flex-end" : "center",
|
|
370
|
+
"h": `${innerFlexHeight}px`,
|
|
371
|
+
"direction": "column"
|
|
372
|
+
}), /* @__PURE__ */ React.createElement(Children, _ref4.cn("Children", {}))));
|
|
458
373
|
}
|
|
459
374
|
function DonutTooltip(props) {
|
|
460
375
|
var _ref = arguments[0], _ref5;
|
package/lib/esm/Dots.mjs
CHANGED
|
@@ -12,22 +12,22 @@ const style = (
|
|
|
12
12
|
/*__reshadow_css_start__*/
|
|
13
13
|
(sstyled.insert(
|
|
14
14
|
/*__inner_css_start__*/
|
|
15
|
-
".
|
|
15
|
+
".___SDots_1ehkw_gg_ .___SDot_1ehkw_gg_{transition-duration:var(--duration_1ehkw)}.___SDot_1ehkw_gg_{stroke-width:1px;stroke:var(--intergalactic-chart-grid-border,#fff);fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));transition-property:cx,cy,x,y,filter;transition-timing-function:ease-in-out}.___SDot_1ehkw_gg_.__active_1ehkw_gg_{filter:drop-shadow(0 0 1px rgba(0,12,8,.161)) drop-shadow(0 1px 1px rgba(0,12,8,.161))}@media (color-gamut:p3){.___SDot_1ehkw_gg_.__active_1ehkw_gg_{filter:drop-shadow(0 0 1px oklch(.137 .026 175.7/.161)) drop-shadow(0 1px 1px oklch(.137 .026 175.7/.161))}}.___SDot_1ehkw_gg_.__hide_1ehkw_gg_{display:none}.___SDot_1ehkw_gg_.__color_1ehkw_gg_{fill:var(--color_1ehkw)}.___SDotHighlight_1ehkw_gg_.__color_1ehkw_gg_{opacity:.4;fill:var(--color_1ehkw)}.___SDotHighlight_1ehkw_gg_.__transparent_1ehkw_gg_{opacity:.12}.___SDotBorder_1ehkw_gg_{fill:none;stroke-width:1px;stroke:var(--intergalactic-chart-grid-dot-outer-border,#191d211a);stroke-dasharray:2}.___SDotBorder_1ehkw_gg_.__transparent_1ehkw_gg_{opacity:.03}.___SDot_1ehkw_gg_.__transparent_1ehkw_gg_{opacity:var(--intergalactic-chart-transparent-opacity,.3)}.___SDotBackdrop_1ehkw_gg_{stroke-width:1px;stroke:var(--intergalactic-chart-grid-border,#fff);fill:var(--intergalactic-chart-grid-border,#fff);transition-property:cx,cy;transition-duration:var(--duration_1ehkw);transition-timing-function:ease-in-out}.___SDotBackdrop_1ehkw_gg_.__hide_1ehkw_gg_{display:none}",
|
|
16
16
|
/*__inner_css_end__*/
|
|
17
|
-
"
|
|
17
|
+
"1ehkw_gg_"
|
|
18
18
|
), /*__reshadow_css_end__*/
|
|
19
19
|
{
|
|
20
|
-
"__SDot": "
|
|
21
|
-
"_active": "
|
|
22
|
-
"_hide": "
|
|
23
|
-
"_color": "
|
|
24
|
-
"--color": "--
|
|
25
|
-
"_transparent": "
|
|
26
|
-
"__SDots": "
|
|
27
|
-
"--duration": "--
|
|
28
|
-
"__SDotHighlight": "
|
|
29
|
-
"__SDotBorder": "
|
|
30
|
-
"__SDotBackdrop": "
|
|
20
|
+
"__SDot": "___SDot_1ehkw_gg_",
|
|
21
|
+
"_active": "__active_1ehkw_gg_",
|
|
22
|
+
"_hide": "__hide_1ehkw_gg_",
|
|
23
|
+
"_color": "__color_1ehkw_gg_",
|
|
24
|
+
"--color": "--color_1ehkw",
|
|
25
|
+
"_transparent": "__transparent_1ehkw_gg_",
|
|
26
|
+
"__SDots": "___SDots_1ehkw_gg_",
|
|
27
|
+
"--duration": "--duration_1ehkw",
|
|
28
|
+
"__SDotHighlight": "___SDotHighlight_1ehkw_gg_",
|
|
29
|
+
"__SDotBorder": "___SDotBorder_1ehkw_gg_",
|
|
30
|
+
"__SDotBackdrop": "___SDotBackdrop_1ehkw_gg_"
|
|
31
31
|
})
|
|
32
32
|
);
|
|
33
33
|
const BASE_RADIUS = 3.5;
|
|
@@ -60,7 +60,7 @@ function Dots(props) {
|
|
|
60
60
|
const bisect = bisector((d) => d[x]).center;
|
|
61
61
|
const [activeIndex, setActiveIndex] = React.useState(null);
|
|
62
62
|
const patternKey = color || getChartDefaultColorName(0);
|
|
63
|
-
const svgPatternId = `template_${patternKey}`;
|
|
63
|
+
const svgPatternId = `template_${uid}_${patternKey}`;
|
|
64
64
|
const data = React.useMemo(() => props.data.filter((item) => item[y] !== interpolateValue), [props.data]);
|
|
65
65
|
const handlerMouseMoveRoot = React.useCallback(trottle((e) => {
|
|
66
66
|
const [xScale] = scale;
|
|
@@ -11,26 +11,26 @@ const style = (
|
|
|
11
11
|
/*__reshadow_css_start__*/
|
|
12
12
|
(sstyled.insert(
|
|
13
13
|
/*__inner_css_start__*/
|
|
14
|
-
".
|
|
14
|
+
".___SBar_18a3g_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));transition-property:height,width,y;transition-duration:var(--duration_18a3g);transition-timing-function:ease-in-out}.___SBar_18a3g_gg_.__color_18a3g_gg_{fill:var(--color_18a3g)}.___SBar_18a3g_gg_.__pattern_18a3g_gg_.__color_18a3g_gg_{fill:var(--pattern_18a3g);stroke:var(--color_18a3g);stroke-width:1px}.___SBar_18a3g_gg_.__hide_18a3g_gg_{display:none}.___SBar_18a3g_gg_.__transparent_18a3g_gg_{opacity:var(--intergalactic-chart-transparent-opacity,.3)}.___SBar_18a3g_gg_.__onClick_18a3g_gg_{cursor:pointer}.___SBackground_18a3g_gg_{fill:var(--intergalactic-chart-grid-bar-base-bg,oklch(.92 .008 233.5));opacity:.4}.___SBackground_18a3g_gg_.__onClick_18a3g_gg_{cursor:pointer}.___SBarAnnotation_18a3g_gg_{display:flex;justify-content:space-between}.___SBarLabel_18a3g_gg_{color:var(--intergalactic-text-primary,oklch(.23 .009 245));margin-right:auto}.___SBarLabel_18a3g_gg_,.___SBarPercent_18a3g_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286)}.___SBarPercent_18a3g_gg_{color:var(--intergalactic-text-secondary,oklch(.182 .045 244.8/.593));margin-right:var(--intergalactic-spacing-2x,8px)}.___SBarValue_18a3g_gg_{min-width:52px;display:flex;justify-content:flex-end;color:var(--intergalactic-text-primary,oklch(.23 .009 245));font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286);text-align:right}.___SCompactHorizontalBarHoverRect_18a3g_gg_{fill:var(--intergalactic-chart-grid-bar-hover,oklch(.375 .09 242.7/.05))}",
|
|
15
15
|
/*__inner_css_end__*/
|
|
16
|
-
"
|
|
16
|
+
"18a3g_gg_"
|
|
17
17
|
), /*__reshadow_css_end__*/
|
|
18
18
|
{
|
|
19
|
-
"__SBar": "
|
|
20
|
-
"--duration": "--
|
|
21
|
-
"_color": "
|
|
22
|
-
"--color": "--
|
|
23
|
-
"_pattern": "
|
|
24
|
-
"--pattern": "--
|
|
25
|
-
"_hide": "
|
|
26
|
-
"_transparent": "
|
|
27
|
-
"_onClick": "
|
|
28
|
-
"__SBackground": "
|
|
29
|
-
"__SBarAnnotation": "
|
|
30
|
-
"__SBarLabel": "
|
|
31
|
-
"__SBarPercent": "
|
|
32
|
-
"__SBarValue": "
|
|
33
|
-
"__SCompactHorizontalBarHoverRect": "
|
|
19
|
+
"__SBar": "___SBar_18a3g_gg_",
|
|
20
|
+
"--duration": "--duration_18a3g",
|
|
21
|
+
"_color": "__color_18a3g_gg_",
|
|
22
|
+
"--color": "--color_18a3g",
|
|
23
|
+
"_pattern": "__pattern_18a3g_gg_",
|
|
24
|
+
"--pattern": "--pattern_18a3g",
|
|
25
|
+
"_hide": "__hide_18a3g_gg_",
|
|
26
|
+
"_transparent": "__transparent_18a3g_gg_",
|
|
27
|
+
"_onClick": "__onClick_18a3g_gg_",
|
|
28
|
+
"__SBackground": "___SBackground_18a3g_gg_",
|
|
29
|
+
"__SBarAnnotation": "___SBarAnnotation_18a3g_gg_",
|
|
30
|
+
"__SBarLabel": "___SBarLabel_18a3g_gg_",
|
|
31
|
+
"__SBarPercent": "___SBarPercent_18a3g_gg_",
|
|
32
|
+
"__SBarValue": "___SBarValue_18a3g_gg_",
|
|
33
|
+
"__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_18a3g_gg_"
|
|
34
34
|
})
|
|
35
35
|
);
|
|
36
36
|
const MIN_WIDTH = 2;
|
|
@@ -79,20 +79,23 @@ class HorizontalBarRoot extends Component {
|
|
|
79
79
|
} = this.asProps;
|
|
80
80
|
const offset = typeof offsetProps === "function" ? offsetProps(i) : offsetProps;
|
|
81
81
|
const [xScale, yScale] = scale;
|
|
82
|
-
const
|
|
82
|
+
const isFirstInStack = d[x0] === void 0 || d[x0] === 0;
|
|
83
|
+
const absWidth = Math.abs(xScale(d[x]) - (isFirstInStack ? 0 : 2) - Math.max(xScale(xScale.domain()[0]), xScale(d[x0] ?? 0)));
|
|
83
84
|
const bandHeight = heightProps || scaleToBand(yScale).bandwidth();
|
|
84
85
|
const height = Math.min(bandHeight, maxBarSize);
|
|
85
86
|
const width = Number(d[x] - (d[x0] ?? 0)) === 0 ? 0 : Math.max(absWidth, wMin);
|
|
87
|
+
if (width === 0) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
86
90
|
const barY = yScale(d[y]) + bandHeight / 2 - height / 2 + offset[1];
|
|
87
|
-
const barX = xScale(Math.min(d[x0] ?? 0, width <= wMin && d[x] < 0 ? 0 : d[x])) + offset[0] - calcPartBarX(d[x], wMin, width);
|
|
91
|
+
const barX = xScale(Math.min(d[x0] ?? 0, width <= wMin && d[x] < 0 ? 0 : d[x])) + (isFirstInStack ? 0 : 2) + offset[0] - calcPartBarX(d[x], wMin, width);
|
|
88
92
|
const handleClick = (event) => onClick?.(d, event, i, x);
|
|
89
93
|
const dSvg = getHorizontalRect({
|
|
90
94
|
x: barX,
|
|
91
95
|
y: barY,
|
|
92
96
|
width,
|
|
93
97
|
height,
|
|
94
|
-
radius: Array.isArray(r) ? r[i] : r
|
|
95
|
-
position: d[x] > 0 || Object.is(d[x], 0) ? "right" : "left"
|
|
98
|
+
radius: Array.isArray(r) ? r[i] : r
|
|
96
99
|
});
|
|
97
100
|
if (groupKey) {
|
|
98
101
|
this.asProps.dataHintsHandler.describeGroupedValues(groupKey, x);
|
|
@@ -153,7 +156,7 @@ _defineProperty(HorizontalBarRoot, "style", style);
|
|
|
153
156
|
_defineProperty(HorizontalBarRoot, "defaultProps", {
|
|
154
157
|
offset: [0, 0],
|
|
155
158
|
duration: 500,
|
|
156
|
-
r:
|
|
159
|
+
r: 2,
|
|
157
160
|
wMin: MIN_WIDTH
|
|
158
161
|
});
|
|
159
162
|
function Background(props) {
|
|
@@ -181,13 +184,17 @@ function getHorizontalRect({
|
|
|
181
184
|
y,
|
|
182
185
|
width,
|
|
183
186
|
height,
|
|
184
|
-
radius
|
|
185
|
-
position
|
|
187
|
+
radius
|
|
186
188
|
}) {
|
|
187
189
|
if (width < radius) radius = width;
|
|
188
190
|
if (radius) {
|
|
189
|
-
if (
|
|
190
|
-
|
|
191
|
+
if (Array.isArray(radius)) {
|
|
192
|
+
const leftR = radius[0];
|
|
193
|
+
const rightR = radius[1];
|
|
194
|
+
return roundedPath(x, y, width, height, Math.max(leftR, rightR), leftR > 0, rightR > 0, leftR > 0, rightR > 0);
|
|
195
|
+
} else {
|
|
196
|
+
return roundedPath(x, y, width, height, radius, true, true, true, true);
|
|
197
|
+
}
|
|
191
198
|
}
|
|
192
199
|
return roundedPath(x, y, width, height, radius);
|
|
193
200
|
}
|