@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/Bar.mjs
CHANGED
|
@@ -4,34 +4,36 @@ import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
|
4
4
|
import { transition } from "d3-transition";
|
|
5
5
|
import React from "react";
|
|
6
6
|
import AnimatedClipPath from "./AnimatedClipPath.mjs";
|
|
7
|
+
import "./component/Chart/index.mjs";
|
|
7
8
|
import createElement from "./createElement.mjs";
|
|
8
9
|
import { PatternFill } from "./Pattern.mjs";
|
|
9
10
|
import { scaleToBand, roundedPath } from "./utils.mjs";
|
|
11
|
+
import { DATA_TYPE, POTENTIAL, FORECAST, HIGHLIGHT_DOT, INSIGHTFUL, BAD, GOOD } from "./component/Chart/AbstractChart.type.mjs";
|
|
10
12
|
/*!__reshadow-styles__:"./style/bar.shadow.css"*/
|
|
11
13
|
const style = (
|
|
12
14
|
/*__reshadow_css_start__*/
|
|
13
15
|
(sstyled.insert(
|
|
14
16
|
/*__inner_css_start__*/
|
|
15
|
-
".
|
|
17
|
+
".___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))}",
|
|
16
18
|
/*__inner_css_end__*/
|
|
17
|
-
"
|
|
19
|
+
"18a3g_gg_"
|
|
18
20
|
), /*__reshadow_css_end__*/
|
|
19
21
|
{
|
|
20
|
-
"__SBar": "
|
|
21
|
-
"--duration": "--
|
|
22
|
-
"_color": "
|
|
23
|
-
"--color": "--
|
|
24
|
-
"_pattern": "
|
|
25
|
-
"--pattern": "--
|
|
26
|
-
"_hide": "
|
|
27
|
-
"_transparent": "
|
|
28
|
-
"_onClick": "
|
|
29
|
-
"__SBackground": "
|
|
30
|
-
"__SBarAnnotation": "
|
|
31
|
-
"__SBarLabel": "
|
|
32
|
-
"__SBarPercent": "
|
|
33
|
-
"__SBarValue": "
|
|
34
|
-
"__SCompactHorizontalBarHoverRect": "
|
|
22
|
+
"__SBar": "___SBar_18a3g_gg_",
|
|
23
|
+
"--duration": "--duration_18a3g",
|
|
24
|
+
"_color": "__color_18a3g_gg_",
|
|
25
|
+
"--color": "--color_18a3g",
|
|
26
|
+
"_pattern": "__pattern_18a3g_gg_",
|
|
27
|
+
"--pattern": "--pattern_18a3g",
|
|
28
|
+
"_hide": "__hide_18a3g_gg_",
|
|
29
|
+
"_transparent": "__transparent_18a3g_gg_",
|
|
30
|
+
"_onClick": "__onClick_18a3g_gg_",
|
|
31
|
+
"__SBackground": "___SBackground_18a3g_gg_",
|
|
32
|
+
"__SBarAnnotation": "___SBarAnnotation_18a3g_gg_",
|
|
33
|
+
"__SBarLabel": "___SBarLabel_18a3g_gg_",
|
|
34
|
+
"__SBarPercent": "___SBarPercent_18a3g_gg_",
|
|
35
|
+
"__SBarValue": "___SBarValue_18a3g_gg_",
|
|
36
|
+
"__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_18a3g_gg_"
|
|
35
37
|
})
|
|
36
38
|
);
|
|
37
39
|
const MIN_HEIGHT = 2;
|
|
@@ -96,10 +98,14 @@ class BarRoot extends Component {
|
|
|
96
98
|
} = this.asProps;
|
|
97
99
|
const offset = typeof offsetProps === "function" ? offsetProps(i) : offsetProps;
|
|
98
100
|
const [xScale, yScale] = scale;
|
|
99
|
-
const
|
|
101
|
+
const isFirstInStack = d[y0] === void 0 || d[y0] === 0;
|
|
102
|
+
const absHeight = Math.abs(yScale(d[y]) - Math.min(yScale(yScale.domain()[0]), yScale(d[y0] ?? 0) - (isFirstInStack ? 0 : 2)));
|
|
100
103
|
const height = Number(d[y] - (d[y0] ?? 0)) === 0 ? 0 : Math.max(absHeight, hMin);
|
|
101
104
|
const bandWidth = widthProps || scaleToBand(xScale).bandwidth();
|
|
102
105
|
const width = Math.min(bandWidth, maxBarSize);
|
|
106
|
+
if (height === 0) {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
103
109
|
const barX = xScale(d[x]) + bandWidth / 2 - width / 2 + offset[0];
|
|
104
110
|
const barY = yScale(Math.max(d[y0] ?? 0, height <= hMin && d[y] > 0 ? 0 : d[y])) + offset[1] - calcPartBarY(d[y], hMin, height);
|
|
105
111
|
const handleClick = (event) => onClick?.(d, event, i, y);
|
|
@@ -117,9 +123,24 @@ class BarRoot extends Component {
|
|
|
117
123
|
dataHintsHandler.describeValueEntity(`${i}.${y}`, groupKey ?? d[x]);
|
|
118
124
|
dataHintsHandler.specifyDataRowFields(x, y);
|
|
119
125
|
}
|
|
126
|
+
let mask = void 0;
|
|
127
|
+
let resolvedColor = resolveColor(color);
|
|
128
|
+
if (d[DATA_TYPE] === POTENTIAL) {
|
|
129
|
+
resolvedColor = `url(#${this.potentialGradientId})`;
|
|
130
|
+
mask = `url(#${this.potentialPatternId})`;
|
|
131
|
+
}
|
|
132
|
+
if (d[DATA_TYPE] === FORECAST) {
|
|
133
|
+
mask = `url(#${this.forecastPatternId})`;
|
|
134
|
+
}
|
|
120
135
|
return /* @__PURE__ */ React.createElement(React.Fragment, {
|
|
121
136
|
key: `bar-${i}`
|
|
122
|
-
}, (_ref = sstyled(styles), /* @__PURE__ */ React.createElement(
|
|
137
|
+
}, (_ref = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, Boolean(d[HIGHLIGHT_DOT]) && this.renderHighlight({
|
|
138
|
+
barX,
|
|
139
|
+
barY,
|
|
140
|
+
width,
|
|
141
|
+
height,
|
|
142
|
+
highlight: d[HIGHLIGHT_DOT]
|
|
143
|
+
}), /* @__PURE__ */ React.createElement(SBar, _ref.cn("SBar", {
|
|
123
144
|
"aria-hidden": true,
|
|
124
145
|
"render": "path",
|
|
125
146
|
"clipPath": `url(#${uid})`,
|
|
@@ -129,7 +150,8 @@ class BarRoot extends Component {
|
|
|
129
150
|
"index": i,
|
|
130
151
|
"hide": hide,
|
|
131
152
|
"pattern": patterns ? `url(#${uid}-${i}-pattern)` : void 0,
|
|
132
|
-
"color":
|
|
153
|
+
"color": resolvedColor,
|
|
154
|
+
"mask": mask,
|
|
133
155
|
"x": barX,
|
|
134
156
|
"y": barY,
|
|
135
157
|
"width": width,
|
|
@@ -138,13 +160,174 @@ class BarRoot extends Component {
|
|
|
138
160
|
"onClickCapture": handleClick,
|
|
139
161
|
"use:duration": `${duration}ms`,
|
|
140
162
|
"transparent": transparent
|
|
141
|
-
}))), patterns && /* @__PURE__ */ React.createElement(PatternFill, _ref.cn("PatternFill", {
|
|
163
|
+
})))), patterns && /* @__PURE__ */ React.createElement(PatternFill, _ref.cn("PatternFill", {
|
|
142
164
|
"id": `${uid}-${i}-pattern`,
|
|
143
165
|
"patternKey": color,
|
|
144
166
|
"color": resolveColor(color),
|
|
145
167
|
"patterns": patterns
|
|
146
168
|
})));
|
|
147
169
|
}
|
|
170
|
+
resolveHighlightColor(highlight) {
|
|
171
|
+
const {
|
|
172
|
+
resolveColor,
|
|
173
|
+
uid
|
|
174
|
+
} = this.asProps;
|
|
175
|
+
switch (highlight) {
|
|
176
|
+
case GOOD: {
|
|
177
|
+
return resolveColor("--intergalactic-chart-data-success");
|
|
178
|
+
}
|
|
179
|
+
case BAD: {
|
|
180
|
+
return resolveColor("--intergalactic-chart-data-critical");
|
|
181
|
+
}
|
|
182
|
+
case INSIGHTFUL: {
|
|
183
|
+
return `url(#${this.potentialGradientId})`;
|
|
184
|
+
}
|
|
185
|
+
default:
|
|
186
|
+
return "";
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
renderHighlight({
|
|
190
|
+
highlight,
|
|
191
|
+
barX,
|
|
192
|
+
barY,
|
|
193
|
+
width,
|
|
194
|
+
height
|
|
195
|
+
}) {
|
|
196
|
+
const overflowTop = 4;
|
|
197
|
+
const newHeight = Math.min(Math.max(height * 0.2, 20), height + overflowTop);
|
|
198
|
+
const dSvg = getRect({
|
|
199
|
+
x: barX - 3,
|
|
200
|
+
y: barY - overflowTop,
|
|
201
|
+
width: width + 6,
|
|
202
|
+
height: newHeight,
|
|
203
|
+
radius: 4,
|
|
204
|
+
position: "top"
|
|
205
|
+
});
|
|
206
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("path", {
|
|
207
|
+
d: dSvg,
|
|
208
|
+
fill: this.resolveHighlightColor(highlight),
|
|
209
|
+
mask: `url(#${this.fadeMaskId})`
|
|
210
|
+
}));
|
|
211
|
+
}
|
|
212
|
+
get strokePatternId() {
|
|
213
|
+
const {
|
|
214
|
+
uid
|
|
215
|
+
} = this.asProps;
|
|
216
|
+
return `${uid}-stroke-pattern`;
|
|
217
|
+
}
|
|
218
|
+
get forecastPatternId() {
|
|
219
|
+
const {
|
|
220
|
+
uid
|
|
221
|
+
} = this.asProps;
|
|
222
|
+
return `${uid}-forecast-mask`;
|
|
223
|
+
}
|
|
224
|
+
renderForecastPattern() {
|
|
225
|
+
return /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("mask", {
|
|
226
|
+
id: this.forecastPatternId
|
|
227
|
+
}, /* @__PURE__ */ React.createElement("rect", {
|
|
228
|
+
width: "100%",
|
|
229
|
+
height: "100%",
|
|
230
|
+
fill: `url(#${this.strokePatternId})`
|
|
231
|
+
})));
|
|
232
|
+
}
|
|
233
|
+
get potentialPatternId() {
|
|
234
|
+
const {
|
|
235
|
+
uid
|
|
236
|
+
} = this.asProps;
|
|
237
|
+
return `${uid}-potential-mask`;
|
|
238
|
+
}
|
|
239
|
+
get potentialGradientId() {
|
|
240
|
+
const {
|
|
241
|
+
uid
|
|
242
|
+
} = this.asProps;
|
|
243
|
+
return `${uid}-potential-gradient`;
|
|
244
|
+
}
|
|
245
|
+
get fadeMaskId() {
|
|
246
|
+
const {
|
|
247
|
+
uid
|
|
248
|
+
} = this.asProps;
|
|
249
|
+
return `${uid}-fade-mask`;
|
|
250
|
+
}
|
|
251
|
+
renderPotentialPattern() {
|
|
252
|
+
const {
|
|
253
|
+
resolveColor
|
|
254
|
+
} = this.asProps;
|
|
255
|
+
return /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("linearGradient", {
|
|
256
|
+
id: this.potentialGradientId,
|
|
257
|
+
x1: "0%",
|
|
258
|
+
y1: "0%",
|
|
259
|
+
x2: "0%",
|
|
260
|
+
y2: "100%"
|
|
261
|
+
}, /* @__PURE__ */ React.createElement("stop", {
|
|
262
|
+
offset: "0%",
|
|
263
|
+
stopColor: resolveColor("green-200")
|
|
264
|
+
}), /* @__PURE__ */ React.createElement("stop", {
|
|
265
|
+
offset: "60%",
|
|
266
|
+
stopColor: resolveColor("violet-400")
|
|
267
|
+
}), /* @__PURE__ */ React.createElement("stop", {
|
|
268
|
+
offset: "100%",
|
|
269
|
+
stopColor: resolveColor("gray-800")
|
|
270
|
+
})), /* @__PURE__ */ React.createElement("mask", {
|
|
271
|
+
id: this.potentialPatternId
|
|
272
|
+
}, /* @__PURE__ */ React.createElement("rect", {
|
|
273
|
+
width: "100%",
|
|
274
|
+
height: "100%",
|
|
275
|
+
fill: `url(#${this.strokePatternId})`
|
|
276
|
+
})));
|
|
277
|
+
}
|
|
278
|
+
renderCommonPattern() {
|
|
279
|
+
const {
|
|
280
|
+
resolveColor
|
|
281
|
+
} = this.asProps;
|
|
282
|
+
return /* @__PURE__ */ React.createElement("pattern", {
|
|
283
|
+
id: `${this.strokePatternId}`,
|
|
284
|
+
width: "4",
|
|
285
|
+
height: "4",
|
|
286
|
+
patternUnits: "userSpaceOnUse",
|
|
287
|
+
patternTransform: "rotate(40)"
|
|
288
|
+
}, /* @__PURE__ */ React.createElement("rect", {
|
|
289
|
+
width: "4",
|
|
290
|
+
height: "4",
|
|
291
|
+
fill: "#fff"
|
|
292
|
+
}), /* @__PURE__ */ React.createElement("line", {
|
|
293
|
+
x1: "3",
|
|
294
|
+
y1: "0",
|
|
295
|
+
x2: "3",
|
|
296
|
+
y2: "4",
|
|
297
|
+
stroke: resolveColor("chart-grid-bar-base-bg"),
|
|
298
|
+
strokeWidth: "2"
|
|
299
|
+
}));
|
|
300
|
+
}
|
|
301
|
+
renderFadeMask() {
|
|
302
|
+
return /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("linearGradient", {
|
|
303
|
+
id: `${this.fadeMaskId}_alphaGrad`,
|
|
304
|
+
x1: "0",
|
|
305
|
+
y1: "0",
|
|
306
|
+
x2: "0",
|
|
307
|
+
y2: "1"
|
|
308
|
+
}, /* @__PURE__ */ React.createElement("stop", {
|
|
309
|
+
offset: "0%",
|
|
310
|
+
stopColor: "#fff",
|
|
311
|
+
stopOpacity: "0.4"
|
|
312
|
+
}), /* @__PURE__ */ React.createElement("stop", {
|
|
313
|
+
offset: "100%",
|
|
314
|
+
stopColor: "#000"
|
|
315
|
+
})), /* @__PURE__ */ React.createElement("mask", {
|
|
316
|
+
id: this.fadeMaskId,
|
|
317
|
+
maskUnits: "objectBoundingBox",
|
|
318
|
+
maskContentUnits: "objectBoundingBox",
|
|
319
|
+
x: "0",
|
|
320
|
+
y: "0",
|
|
321
|
+
width: "1",
|
|
322
|
+
height: "1"
|
|
323
|
+
}, /* @__PURE__ */ React.createElement("rect", {
|
|
324
|
+
x: "0",
|
|
325
|
+
y: "0",
|
|
326
|
+
width: "1",
|
|
327
|
+
height: "1",
|
|
328
|
+
fill: `url(#${this.fadeMaskId}_alphaGrad)`
|
|
329
|
+
})));
|
|
330
|
+
}
|
|
148
331
|
render() {
|
|
149
332
|
const {
|
|
150
333
|
data,
|
|
@@ -152,7 +335,7 @@ class BarRoot extends Component {
|
|
|
152
335
|
size,
|
|
153
336
|
duration
|
|
154
337
|
} = this.asProps;
|
|
155
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, data.map(this.renderBar.bind(this)), duration && /* @__PURE__ */ React.createElement(AnimatedClipPath, {
|
|
338
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, this.renderFadeMask(), this.renderCommonPattern(), this.renderForecastPattern(), this.renderPotentialPattern(), data.map(this.renderBar.bind(this)), duration && /* @__PURE__ */ React.createElement(AnimatedClipPath, {
|
|
156
339
|
duration,
|
|
157
340
|
key: `${uid}-animation`,
|
|
158
341
|
attributeName: "y",
|
package/lib/esm/Bubble.mjs
CHANGED
|
@@ -5,39 +5,47 @@ import findComponent from "@semcore/core/lib/utils/findComponent";
|
|
|
5
5
|
import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
6
6
|
import { transition } from "d3-transition";
|
|
7
7
|
import React from "react";
|
|
8
|
+
import { HoverLine } from "./component/Hover/HoverLine.mjs";
|
|
8
9
|
import { SvgElement } from "./component/SvgElement.mjs";
|
|
9
10
|
import createElement from "./createElement.mjs";
|
|
10
11
|
import { PatternFill } from "./Pattern.mjs";
|
|
11
12
|
import Tooltip from "./Tooltip.mjs";
|
|
12
|
-
import { getBubbleChartValueScale, measureText } from "./utils.mjs";
|
|
13
|
+
import { getBubbleChartValueScale, formatValue, measureText } from "./utils.mjs";
|
|
13
14
|
/*!__reshadow-styles__:"./style/bubble.shadow.css"*/
|
|
14
15
|
const style = (
|
|
15
16
|
/*__reshadow_css_start__*/
|
|
16
17
|
(sstyled.insert(
|
|
17
18
|
/*__inner_css_start__*/
|
|
18
|
-
".
|
|
19
|
+
".___SBubble_c4ypj_gg_{stroke:var(--intergalactic-chart-grid-border,#fff);stroke-width:2px;transition-property:cx,cy;transition-duration:var(--duration_c4ypj);transition-timing-function:ease-in-out;fill-opacity:.1}.___SBubble_c4ypj_gg_.__withPatterns_c4ypj_gg_{fill-opacity:.5}.___SGroup_c4ypj_gg_._visible_false_c4ypj_gg_{display:none}.___SGroup_c4ypj_gg_.__hovered_c4ypj_gg_>.___SBubble_c4ypj_gg_{fill-opacity:.3}@media (hover:hover){.___SGroup_c4ypj_gg_:hover>.___SBubble_c4ypj_gg_{fill-opacity:.3}}.___SGroup_c4ypj_gg_.__hovered_c4ypj_gg_>.___SBubble_c4ypj_gg_.__withPatterns_c4ypj_gg_{fill-opacity:1}@media (hover:hover){.___SGroup_c4ypj_gg_:hover>.___SBubble_c4ypj_gg_.__withPatterns_c4ypj_gg_{fill-opacity:1}}.___SGroup_c4ypj_gg_.__hovered_c4ypj_gg_>.___SCenterHover_c4ypj_gg_{opacity:1;filter:var(--intergalactic-box-shadow-chart-elevated,drop-shadow(0 0 2px rgba(25,29,33,.165)) drop-shadow(0 1px 2px rgba(25,29,33,.165)))}@media (hover:hover){.___SGroup_c4ypj_gg_:hover>.___SCenterHover_c4ypj_gg_{opacity:1;filter:var(--intergalactic-box-shadow-chart-elevated,drop-shadow(0 0 2px rgba(25,29,33,.165)) drop-shadow(0 1px 2px rgba(25,29,33,.165)))}}.___SBubble_c4ypj_gg_.__clickable_c4ypj_gg_{cursor:pointer}.___SBubble_c4ypj_gg_.__color_c4ypj_gg_{stroke:var(--color_c4ypj)}.___SBubble_c4ypj_gg_.__pattern_c4ypj_gg_{fill:var(--pattern_c4ypj)}.___SCenter_c4ypj_gg_.__color_c4ypj_gg_{stroke:var(--color_c4ypj);stroke-width:1px}.___SCenterHover_c4ypj_gg_{opacity:0;stroke:var(--intergalactic-chart-grid-border,#fff);stroke-width:3px}.___SLabel_c4ypj_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245))}.___SLabel_c4ypj_gg_._position_right_c4ypj_gg_{text-anchor:end}.___SLabel_c4ypj_gg_._position_left_c4ypj_gg_{text-anchor:start}.___SLabel_c4ypj_gg_.__color_c4ypj_gg_{fill:var(--color_c4ypj)}.___SBubble_c4ypj_gg_.__transparent_c4ypj_gg_,.___SCenter_c4ypj_gg_.__transparent_c4ypj_gg_,.___SLabel_c4ypj_gg_.__transparent_c4ypj_gg_{opacity:var(--intergalactic-chart-transparent-opacity,.3)}",
|
|
19
20
|
/*__inner_css_end__*/
|
|
20
|
-
"
|
|
21
|
+
"c4ypj_gg_"
|
|
21
22
|
), /*__reshadow_css_end__*/
|
|
22
23
|
{
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"__SCenter": "
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
24
|
+
"__SGroup": "___SGroup_c4ypj_gg_",
|
|
25
|
+
"_visible_false": "_visible_false_c4ypj_gg_",
|
|
26
|
+
"__SBubble": "___SBubble_c4ypj_gg_",
|
|
27
|
+
"_clickable": "__clickable_c4ypj_gg_",
|
|
28
|
+
"_color": "__color_c4ypj_gg_",
|
|
29
|
+
"--color": "--color_c4ypj",
|
|
30
|
+
"_pattern": "__pattern_c4ypj_gg_",
|
|
31
|
+
"--pattern": "--pattern_c4ypj",
|
|
32
|
+
"__SCenter": "___SCenter_c4ypj_gg_",
|
|
33
|
+
"__SCenterHover": "___SCenterHover_c4ypj_gg_",
|
|
34
|
+
"__SLabel": "___SLabel_c4ypj_gg_",
|
|
35
|
+
"_position_right": "_position_right_c4ypj_gg_",
|
|
36
|
+
"_position_left": "_position_left_c4ypj_gg_",
|
|
37
|
+
"_transparent": "__transparent_c4ypj_gg_",
|
|
38
|
+
"--duration": "--duration_c4ypj",
|
|
39
|
+
"_withPatterns": "__withPatterns_c4ypj_gg_",
|
|
40
|
+
"_hovered": "__hovered_c4ypj_gg_"
|
|
36
41
|
})
|
|
37
42
|
);
|
|
38
43
|
class BubbleRoot extends Component {
|
|
39
44
|
constructor(...args) {
|
|
40
45
|
super(...args);
|
|
46
|
+
_defineProperty(this, "state", {
|
|
47
|
+
hoveredIndex: null
|
|
48
|
+
});
|
|
41
49
|
_defineProperty(this, "bindHandlerTooltip", (visible, props, tooltipProps) => ({
|
|
42
50
|
clientX,
|
|
43
51
|
clientY
|
|
@@ -46,6 +54,9 @@ class BubbleRoot extends Component {
|
|
|
46
54
|
eventEmitter,
|
|
47
55
|
plotId
|
|
48
56
|
} = this.asProps;
|
|
57
|
+
this.setState({
|
|
58
|
+
hoveredIndex: visible ? props.index : null
|
|
59
|
+
});
|
|
49
60
|
eventEmitter.emit(`setTooltipPosition_${plotId}`, clientX, clientY);
|
|
50
61
|
eventEmitter.emit(`setTooltipRenderingProps_${plotId}`, props, tooltipProps);
|
|
51
62
|
eventEmitter.emit(`setTooltipVisible_${plotId}`, visible);
|
|
@@ -156,9 +167,15 @@ class BubbleRoot extends Component {
|
|
|
156
167
|
x,
|
|
157
168
|
y,
|
|
158
169
|
value,
|
|
159
|
-
Children
|
|
170
|
+
Children,
|
|
171
|
+
xFormatValue,
|
|
172
|
+
yFormatValue,
|
|
173
|
+
locale
|
|
160
174
|
} = this.asProps;
|
|
161
175
|
const [xScale, yScale] = scale;
|
|
176
|
+
const {
|
|
177
|
+
hoveredIndex
|
|
178
|
+
} = this.state;
|
|
162
179
|
const xSize = Math.abs(xScale.range()[0] - xScale.range()[1]);
|
|
163
180
|
const ySize = Math.abs(yScale.range()[0] - yScale.range()[1]);
|
|
164
181
|
const xMargin = Math.min(xScale.range()[0], xScale.range()[1]);
|
|
@@ -166,7 +183,13 @@ class BubbleRoot extends Component {
|
|
|
166
183
|
this.asProps.dataHintsHandler.specifyDataRowFields(x, y, value);
|
|
167
184
|
this.asProps.dataHintsHandler.establishDataType("points-cloud");
|
|
168
185
|
const isAdvancedMode = Boolean(findComponent(Children, [Bubble.Circle.displayName]));
|
|
169
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null,
|
|
186
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, hoveredIndex !== null && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(HoverLine, {
|
|
187
|
+
xIndex: hoveredIndex,
|
|
188
|
+
yIndex: hoveredIndex,
|
|
189
|
+
formatValue: [xFormatValue ?? formatValue.bind(null, locale), yFormatValue ?? formatValue.bind(null, locale)],
|
|
190
|
+
x,
|
|
191
|
+
y
|
|
192
|
+
})), isAdvancedMode ? /* @__PURE__ */ React.createElement(Children, null) : data.map((_, idx) => /* @__PURE__ */ React.createElement(Bubble.Circle, {
|
|
170
193
|
key: idx,
|
|
171
194
|
index: idx
|
|
172
195
|
})), /* @__PURE__ */ React.createElement("clipPath", {
|
|
@@ -222,22 +245,29 @@ function BubbleCircle(props) {
|
|
|
222
245
|
visible = true,
|
|
223
246
|
clickable,
|
|
224
247
|
onClick,
|
|
225
|
-
onClickCircleRoot
|
|
248
|
+
onClickCircleRoot,
|
|
249
|
+
hovered
|
|
226
250
|
} = props;
|
|
227
251
|
const circleData = data[index];
|
|
228
252
|
if (!circleData) return null;
|
|
229
253
|
const [xScale, yScale] = scale;
|
|
254
|
+
const SGroup = SvgElement;
|
|
230
255
|
const SBubble = Element;
|
|
231
|
-
const
|
|
256
|
+
const SGradient = SvgElement;
|
|
257
|
+
const SCenter = "path";
|
|
258
|
+
const SCenterHover = "path";
|
|
232
259
|
const SLabel = "text";
|
|
233
260
|
const z = getBubbleChartValueScale(data, value);
|
|
234
261
|
const margin = Math.min(xScale.range()[0], xScale.range()[1]);
|
|
235
262
|
const labelPosition = size[0] - 2 * margin - (xScale(circleData[x]) + offset[0] + z(circleData[value])) < measureText(circleData[label]) ? "right" : "left";
|
|
236
263
|
const labelDistance = {
|
|
237
|
-
right: xScale(circleData[x]) + offset[0] - z(circleData[value]),
|
|
238
|
-
left: xScale(circleData[x]) + offset[0] + z(circleData[value])
|
|
264
|
+
right: xScale(circleData[x]) + offset[0] - z(circleData[value]) - 4,
|
|
265
|
+
left: xScale(circleData[x]) + offset[0] + z(circleData[value]) + 4
|
|
239
266
|
}[labelPosition];
|
|
240
|
-
|
|
267
|
+
const colorValue = resolveColor(circleData[color] ?? color);
|
|
268
|
+
const cx = xScale(circleData[x]) + offset[0];
|
|
269
|
+
const cy = yScale(circleData[y]) + offset[1];
|
|
270
|
+
return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SGroup, _ref3.cn("SGroup", {
|
|
241
271
|
"tag": "g",
|
|
242
272
|
"key": `circle(#${index})`,
|
|
243
273
|
"onClickCapture": callAllEventHandlers(onClickCircleRoot(index), onClick),
|
|
@@ -251,30 +281,47 @@ function BubbleCircle(props) {
|
|
|
251
281
|
index,
|
|
252
282
|
patterns
|
|
253
283
|
}),
|
|
254
|
-
"visible": `${visible}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
"
|
|
258
|
-
"
|
|
259
|
-
"
|
|
260
|
-
"
|
|
261
|
-
"
|
|
262
|
-
|
|
263
|
-
|
|
284
|
+
"visible": `${visible}`,
|
|
285
|
+
"hovered": hovered
|
|
286
|
+
}), /* @__PURE__ */ React.createElement("defs", _ref3.cn("defs", {}), /* @__PURE__ */ React.createElement(SGradient, _ref3.cn("SGradient", {
|
|
287
|
+
"tag": "radialGradient",
|
|
288
|
+
"id": `${uid}_${index}_radial-gradient`,
|
|
289
|
+
"cx": "50%",
|
|
290
|
+
"cy": "50%",
|
|
291
|
+
"r": "50%"
|
|
292
|
+
}), /* @__PURE__ */ React.createElement("stop", _ref3.cn("stop", {
|
|
293
|
+
"offset": "0%",
|
|
294
|
+
"stopColor": "#fff"
|
|
295
|
+
})), /* @__PURE__ */ React.createElement("stop", _ref3.cn("stop", {
|
|
296
|
+
"offset": "100%",
|
|
297
|
+
"stopColor": colorValue
|
|
298
|
+
})))), /* @__PURE__ */ React.createElement(SBubble, _ref3.cn("SBubble", {
|
|
264
299
|
"aria-hidden": true,
|
|
265
300
|
"id": `${uid}${uid}`,
|
|
266
301
|
"index": index,
|
|
267
302
|
"render": "circle",
|
|
268
303
|
"clipPath": `url(#${uid})`,
|
|
269
|
-
"cx":
|
|
270
|
-
"cy":
|
|
271
|
-
"color":
|
|
272
|
-
"pattern": patterns ? `url(#${uid}-${index}-pattern)` :
|
|
304
|
+
"cx": cx,
|
|
305
|
+
"cy": cy,
|
|
306
|
+
"color": colorValue,
|
|
307
|
+
"pattern": patterns ? `url(#${uid}-${index}-pattern)` : `url(#${uid}_${index}_radial-gradient)`,
|
|
308
|
+
"withPatterns": Boolean(patterns),
|
|
273
309
|
"r": z(circleData[value]),
|
|
274
310
|
"use:duration": `${duration}ms`,
|
|
275
|
-
"
|
|
276
|
-
"
|
|
277
|
-
})),
|
|
311
|
+
"clickable": clickable || Boolean(onClick),
|
|
312
|
+
"transparent": transparent
|
|
313
|
+
})), markedCross && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SCenterHover, _ref3.cn("SCenterHover", {
|
|
314
|
+
"aria-hidden": true,
|
|
315
|
+
"d": `M ${cx - 3.5} ${cy} H ${cx + 3.5} M ${cx} ${cy - 3.5} V ${cy + 3.5}`,
|
|
316
|
+
"clipPath": `url(#${uid})`,
|
|
317
|
+
"transparent": transparent
|
|
318
|
+
})), /* @__PURE__ */ React.createElement(SCenter, _ref3.cn("SCenter", {
|
|
319
|
+
"aria-hidden": true,
|
|
320
|
+
"d": `M ${cx - 2.5} ${cy} H ${cx + 2.5} M ${cx} ${cy - 2.5} V ${cy + 2.5}`,
|
|
321
|
+
"clipPath": `url(#${uid})`,
|
|
322
|
+
"color": colorValue,
|
|
323
|
+
"transparent": transparent
|
|
324
|
+
}))), patterns && /* @__PURE__ */ React.createElement(PatternFill, _ref3.cn("PatternFill", {
|
|
278
325
|
"id": `${uid}-${index}-pattern`,
|
|
279
326
|
"patternKey": circleData[color],
|
|
280
327
|
"color": resolveColor(circleData[color]),
|
|
@@ -16,26 +16,26 @@ const style = (
|
|
|
16
16
|
/*__reshadow_css_start__*/
|
|
17
17
|
(sstyled.insert(
|
|
18
18
|
/*__inner_css_start__*/
|
|
19
|
-
".
|
|
19
|
+
".___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))}",
|
|
20
20
|
/*__inner_css_end__*/
|
|
21
|
-
"
|
|
21
|
+
"18a3g_gg_"
|
|
22
22
|
), /*__reshadow_css_end__*/
|
|
23
23
|
{
|
|
24
|
-
"__SBar": "
|
|
25
|
-
"--duration": "--
|
|
26
|
-
"_color": "
|
|
27
|
-
"--color": "--
|
|
28
|
-
"_pattern": "
|
|
29
|
-
"--pattern": "--
|
|
30
|
-
"_hide": "
|
|
31
|
-
"_transparent": "
|
|
32
|
-
"_onClick": "
|
|
33
|
-
"__SBackground": "
|
|
34
|
-
"__SBarAnnotation": "
|
|
35
|
-
"__SBarLabel": "
|
|
36
|
-
"__SBarPercent": "
|
|
37
|
-
"__SBarValue": "
|
|
38
|
-
"__SCompactHorizontalBarHoverRect": "
|
|
24
|
+
"__SBar": "___SBar_18a3g_gg_",
|
|
25
|
+
"--duration": "--duration_18a3g",
|
|
26
|
+
"_color": "__color_18a3g_gg_",
|
|
27
|
+
"--color": "--color_18a3g",
|
|
28
|
+
"_pattern": "__pattern_18a3g_gg_",
|
|
29
|
+
"--pattern": "--pattern_18a3g",
|
|
30
|
+
"_hide": "__hide_18a3g_gg_",
|
|
31
|
+
"_transparent": "__transparent_18a3g_gg_",
|
|
32
|
+
"_onClick": "__onClick_18a3g_gg_",
|
|
33
|
+
"__SBackground": "___SBackground_18a3g_gg_",
|
|
34
|
+
"__SBarAnnotation": "___SBarAnnotation_18a3g_gg_",
|
|
35
|
+
"__SBarLabel": "___SBarLabel_18a3g_gg_",
|
|
36
|
+
"__SBarPercent": "___SBarPercent_18a3g_gg_",
|
|
37
|
+
"__SBarValue": "___SBarValue_18a3g_gg_",
|
|
38
|
+
"__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_18a3g_gg_"
|
|
39
39
|
})
|
|
40
40
|
);
|
|
41
41
|
const MIN_WIDTH = 4;
|