@semcore/d3-chart 18.0.0-prerelease.0 → 18.0.0-prerelease.2
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 -1
- package/lib/cjs/Area.js +123 -23
- package/lib/cjs/Area.js.map +1 -1
- package/lib/cjs/Axis.js +109 -97
- package/lib/cjs/Axis.js.map +1 -1
- package/lib/cjs/Bar.js +16 -16
- package/lib/cjs/Bubble.js +14 -14
- package/lib/cjs/ChartMetaData.js +44 -0
- package/lib/cjs/ChartMetaData.js.map +1 -0
- package/lib/cjs/CompactHorizontalBar.js +16 -16
- package/lib/cjs/Donut.js +18 -19
- package/lib/cjs/Donut.js.map +1 -1
- package/lib/cjs/Dots.js +67 -13
- package/lib/cjs/Dots.js.map +1 -1
- package/lib/cjs/HorizontalBar.js +16 -16
- package/lib/cjs/Hover.js +66 -52
- package/lib/cjs/Hover.js.map +1 -1
- package/lib/cjs/Line.js +82 -17
- package/lib/cjs/Line.js.map +1 -1
- package/lib/cjs/Pattern.js +113 -2
- package/lib/cjs/Pattern.js.map +1 -1
- package/lib/cjs/Plot.js +5 -2
- 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 +55 -18
- package/lib/cjs/Reference.js.map +1 -1
- package/lib/cjs/ScatterPlot.js +9 -9
- package/lib/cjs/Tooltip.js +16 -14
- package/lib/cjs/Tooltip.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yView.js +2 -2
- package/lib/cjs/component/Chart/AbstractChart.js +21 -18
- package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
- package/lib/cjs/component/Chart/AbstractChart.type.js +19 -0
- package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/AreaChart.js +21 -7
- 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 +6 -3
- 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 +4 -0
- 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.type.js.map +1 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.js +0 -1
- 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 +6 -3
- 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 +16 -6
- 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.type.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/VennChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/index.js +43 -0
- package/lib/cjs/component/Chart/index.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/cjs/component/ChartLegend/LegendFlex/legend-flex.shadow.css +2 -2
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +16 -16
- package/lib/cjs/component/ChartLegend/LegendItem/legend-item.shadow.css +11 -11
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +7 -7
- package/lib/cjs/component/ChartLegend/LegendTable/legend-table.shadow.css +2 -2
- package/lib/cjs/index.js +55 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/abstract-chart.shadow.css +13 -3
- package/lib/cjs/style/area.shadow.css +8 -5
- package/lib/cjs/style/axis.shadow.css +51 -60
- package/lib/cjs/style/bar.shadow.css +6 -6
- package/lib/cjs/style/bubble.shadow.css +3 -3
- package/lib/cjs/style/donut.shadow.css +2 -2
- package/lib/cjs/style/dot.shadow.css +37 -2
- package/lib/cjs/style/hover.shadow.css +30 -13
- package/lib/cjs/style/line.shadow.css +3 -3
- package/lib/cjs/style/pattern.shadow.css +10 -0
- package/lib/cjs/style/plotA11yView.shadow.css +3 -3
- package/lib/cjs/style/radar.shadow.css +7 -7
- package/lib/cjs/style/radial-tree.shadow.css +2 -2
- package/lib/cjs/style/reference.shadow.css +4 -4
- package/lib/cjs/style/scatterplot.shadow.css +1 -1
- package/lib/cjs/style/tooltip.shadow.css +12 -12
- package/lib/cjs/types/Axis.d.js.map +1 -1
- package/lib/cjs/types/Donut.d.js.map +1 -1
- package/lib/cjs/types/Hover.d.js.map +1 -1
- package/lib/cjs/utils.js +21 -1
- package/lib/cjs/utils.js.map +1 -1
- package/lib/es6/Area.js +125 -25
- package/lib/es6/Area.js.map +1 -1
- package/lib/es6/Axis.js +109 -97
- package/lib/es6/Axis.js.map +1 -1
- package/lib/es6/Bar.js +16 -16
- package/lib/es6/Bubble.js +14 -14
- package/lib/es6/ChartMetaData.js +36 -0
- package/lib/es6/ChartMetaData.js.map +1 -0
- package/lib/es6/CompactHorizontalBar.js +16 -16
- package/lib/es6/Donut.js +18 -19
- package/lib/es6/Donut.js.map +1 -1
- package/lib/es6/Dots.js +68 -14
- package/lib/es6/Dots.js.map +1 -1
- package/lib/es6/HorizontalBar.js +16 -16
- package/lib/es6/Hover.js +66 -52
- package/lib/es6/Hover.js.map +1 -1
- package/lib/es6/Line.js +84 -19
- package/lib/es6/Line.js.map +1 -1
- package/lib/es6/Pattern.js +108 -2
- package/lib/es6/Pattern.js.map +1 -1
- package/lib/es6/Plot.js +5 -2
- 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 +55 -18
- package/lib/es6/Reference.js.map +1 -1
- package/lib/es6/ScatterPlot.js +9 -9
- package/lib/es6/Tooltip.js +16 -14
- package/lib/es6/Tooltip.js.map +1 -1
- package/lib/es6/a11y/PlotA11yView.js +2 -2
- package/lib/es6/component/Chart/AbstractChart.js +21 -18
- package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
- package/lib/es6/component/Chart/AbstractChart.type.js +14 -1
- package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
- package/lib/es6/component/Chart/AreaChart.js +21 -7
- 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 +6 -3
- 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 +4 -0
- 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.type.js.map +1 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.js +0 -1
- 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 +6 -3
- 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 +14 -4
- 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.type.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
- package/lib/es6/component/Chart/index.js +2 -0
- package/lib/es6/component/Chart/index.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/es6/component/ChartLegend/LegendFlex/legend-flex.shadow.css +2 -2
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +16 -16
- package/lib/es6/component/ChartLegend/LegendItem/legend-item.shadow.css +11 -11
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +7 -7
- package/lib/es6/component/ChartLegend/LegendTable/legend-table.shadow.css +2 -2
- package/lib/es6/index.js +1 -0
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/abstract-chart.shadow.css +13 -3
- package/lib/es6/style/area.shadow.css +8 -5
- package/lib/es6/style/axis.shadow.css +51 -60
- package/lib/es6/style/bar.shadow.css +6 -6
- package/lib/es6/style/bubble.shadow.css +3 -3
- package/lib/es6/style/donut.shadow.css +2 -2
- package/lib/es6/style/dot.shadow.css +37 -2
- package/lib/es6/style/hover.shadow.css +30 -13
- package/lib/es6/style/line.shadow.css +3 -3
- package/lib/es6/style/pattern.shadow.css +10 -0
- package/lib/es6/style/plotA11yView.shadow.css +3 -3
- package/lib/es6/style/radar.shadow.css +7 -7
- package/lib/es6/style/radial-tree.shadow.css +2 -2
- package/lib/es6/style/reference.shadow.css +4 -4
- package/lib/es6/style/scatterplot.shadow.css +1 -1
- package/lib/es6/style/tooltip.shadow.css +12 -12
- package/lib/es6/types/Axis.d.js.map +1 -1
- package/lib/es6/types/Donut.d.js.map +1 -1
- package/lib/es6/types/Hover.d.js.map +1 -1
- package/lib/es6/utils.js +18 -0
- package/lib/es6/utils.js.map +1 -1
- package/lib/esm/Area.mjs +127 -26
- package/lib/esm/Axis.mjs +110 -98
- package/lib/esm/Bar.mjs +17 -17
- package/lib/esm/Bubble.mjs +15 -15
- package/lib/esm/ChartMetaData.mjs +38 -0
- package/lib/esm/CompactHorizontalBar.mjs +17 -17
- package/lib/esm/Donut.mjs +19 -20
- package/lib/esm/Dots.mjs +66 -15
- package/lib/esm/HorizontalBar.mjs +17 -17
- package/lib/esm/Hover.mjs +67 -53
- package/lib/esm/Line.mjs +86 -20
- package/lib/esm/Pattern.mjs +119 -0
- package/lib/esm/Plot.mjs +6 -3
- package/lib/esm/Radar.mjs +20 -20
- package/lib/esm/RadialTree.mjs +13 -13
- package/lib/esm/Reference.mjs +56 -19
- package/lib/esm/ScatterPlot.mjs +10 -10
- package/lib/esm/Tooltip.mjs +17 -15
- package/lib/esm/a11y/PlotA11yView.mjs +3 -3
- package/lib/esm/component/Chart/AbstractChart.mjs +22 -19
- package/lib/esm/component/Chart/AbstractChart.type.mjs +16 -0
- package/lib/esm/component/Chart/AreaChart.mjs +21 -7
- package/lib/esm/component/Chart/BarChart.mjs +6 -3
- package/lib/esm/component/Chart/BubbleChart.mjs +4 -0
- package/lib/esm/component/Chart/DonutChart.mjs +0 -1
- package/lib/esm/component/Chart/HistogramChart.mjs +6 -3
- package/lib/esm/component/Chart/LineChart.mjs +14 -4
- package/lib/esm/component/Chart/index.mjs +8 -0
- package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +5 -5
- package/lib/esm/component/ChartLegend/LegendFlex/legend-flex.shadow.css +2 -2
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +17 -17
- package/lib/esm/component/ChartLegend/LegendItem/legend-item.shadow.css +11 -11
- package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +8 -8
- package/lib/esm/component/ChartLegend/LegendTable/legend-table.shadow.css +2 -2
- package/lib/esm/index.mjs +8 -0
- package/lib/esm/style/abstract-chart.shadow.css +13 -3
- package/lib/esm/style/area.shadow.css +8 -5
- package/lib/esm/style/axis.shadow.css +51 -60
- package/lib/esm/style/bar.shadow.css +6 -6
- package/lib/esm/style/bubble.shadow.css +3 -3
- package/lib/esm/style/donut.shadow.css +2 -2
- package/lib/esm/style/dot.shadow.css +37 -2
- package/lib/esm/style/hover.shadow.css +30 -13
- package/lib/esm/style/line.shadow.css +3 -3
- package/lib/esm/style/pattern.shadow.css +10 -0
- package/lib/esm/style/plotA11yView.shadow.css +3 -3
- package/lib/esm/style/radar.shadow.css +7 -7
- package/lib/esm/style/radial-tree.shadow.css +2 -2
- package/lib/esm/style/reference.shadow.css +4 -4
- package/lib/esm/style/scatterplot.shadow.css +1 -1
- package/lib/esm/style/tooltip.shadow.css +12 -12
- package/lib/esm/utils.mjs +20 -0
- package/lib/types/Axis.d.ts +3 -2
- package/lib/types/ChartMetaData.d.ts +17 -0
- package/lib/types/ChartMetaData.d.ts.map +1 -0
- package/lib/types/Donut.d.ts +1 -1
- package/lib/types/Hover.d.ts +2 -0
- package/lib/types/Pattern.d.ts +18 -0
- package/lib/types/Pattern.d.ts.map +1 -1
- package/lib/types/component/Chart/AbstractChart.d.ts.map +1 -1
- package/lib/types/component/Chart/AbstractChart.type.d.ts +22 -4
- package/lib/types/component/Chart/AbstractChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/AreaChart.d.ts.map +1 -1
- package/lib/types/component/Chart/AreaChart.type.d.ts +8 -4
- package/lib/types/component/Chart/AreaChart.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 +1 -0
- 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/BubbleChart.type.d.ts +1 -1
- package/lib/types/component/Chart/BubbleChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/CigaretteChart.type.d.ts +1 -1
- package/lib/types/component/Chart/CigaretteChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/CompactHorizontalBarChart.type.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 +1 -2
- package/lib/types/component/Chart/DonutChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/HistogramChart.d.ts.map +1 -1
- package/lib/types/component/Chart/HistogramChart.type.d.ts +1 -0
- package/lib/types/component/Chart/HistogramChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/LineChart.d.ts.map +1 -1
- package/lib/types/component/Chart/LineChart.type.d.ts +1 -0
- package/lib/types/component/Chart/LineChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/RadarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/RadarChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +1 -1
- package/lib/types/component/Chart/ScatterPlotChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/VennChart.type.d.ts +1 -1
- package/lib/types/component/Chart/VennChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/index.d.ts +2 -0
- package/lib/types/component/Chart/index.d.ts.map +1 -1
- package/lib/types/utils.d.ts +4 -1
- package/lib/types/utils.d.ts.map +1 -1
- package/package.json +15 -15
- package/lib/esm/utils/TextMeasurer.mjs +0 -27
package/lib/esm/Axis.mjs
CHANGED
|
@@ -1,37 +1,40 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import { sstyled, Component } from "@semcore/core";
|
|
4
|
+
import { getFocusableIn } from "@semcore/core/lib/utils/focus-lock/getFocusableIn";
|
|
5
|
+
import propsForElement from "@semcore/core/lib/utils/propsForElement";
|
|
6
|
+
import useEnhancedEffect from "@semcore/core/lib/utils/use/useEnhancedEffect";
|
|
4
7
|
import React from "react";
|
|
5
8
|
import createElement from "./createElement.mjs";
|
|
6
9
|
import { scaleOfBandwidth } from "./utils.mjs";
|
|
7
|
-
import { TextMeasurer } from "./utils/TextMeasurer.mjs";
|
|
8
10
|
/*!__reshadow-styles__:"./style/axis.shadow.css"*/
|
|
9
11
|
const style = (
|
|
10
12
|
/*__reshadow_css_start__*/
|
|
11
13
|
(sstyled.insert(
|
|
12
14
|
/*__inner_css_start__*/
|
|
13
|
-
|
|
15
|
+
'.___SAxis_ae62s_gg_{stroke:var(--intergalactic-chart-grid-x-axis,oklch(.88 .011 234.9))}.___SAxis_ae62s_gg_.__hide_ae62s_gg_{display:none}.___STick_ae62s_gg_{display:block;font-size:var(--intergalactic-fs-100,12px);font-feature-settings:"tnum";font-variant-numeric:tabular-nums;line-height:var(--intergalactic-lh-100,1.3334);color:var(--intergalactic-chart-grid-text-label,#00132466);overflow:visible}.___STick_ae62s_gg_ [data-tick-content]{height:100%}.___STick_ae62s_gg_._position_bottom_ae62s_gg_{text-align:center}.___STick_ae62s_gg_._position_left_ae62s_gg_{text-align:right;dominant-baseline:central}.___STick_ae62s_gg_._position_left_ae62s_gg_ [data-tick-content]{align-content:center}.___STick_ae62s_gg_._position_top_ae62s_gg_{text-align:center}.___STick_ae62s_gg_._position_top_ae62s_gg_ [data-tick-content]{align-content:end}.___STick_ae62s_gg_._position_right_ae62s_gg_{dominant-baseline:central}.___STick_ae62s_gg_._position_right_ae62s_gg_ [data-tick-content]{align-content:center}.___STick_ae62s_gg_.__hide_ae62s_gg_{display:none}.___STick_ae62s_gg_.__primaryText_ae62s_gg_{color:var(--intergalactic-text-primary,oklch(.23 .009 245))}.___SGrid_ae62s_gg_{fill:#0000;stroke:var(--intergalactic-chart-grid-line,oklch(.7 .021 242));stroke-dasharray:0 6;stroke-linecap:round}.___STitle_ae62s_gg_{font-size:var(--intergalactic-fs-100,12px);fill:var(--intergalactic-chart-grid-text-label,#00132466);transform-origin:var(--transform-origin_ae62s)}.___STitle_ae62s_gg_._position_top_ae62s_gg_{text-anchor:middle}.___STitle_ae62s_gg_._position_bottom_ae62s_gg_{text-anchor:middle;dominant-baseline:hanging}.___STitle_ae62s_gg_._position_left_ae62s_gg_,.___STitle_ae62s_gg_._position_right_ae62s_gg_{transform:rotate(-90deg);dominant-baseline:middle;text-anchor:middle}.___STitle_ae62s_gg_._position_left_ae62s_gg_.__verticalWritingMode_ae62s_gg_,.___STitle_ae62s_gg_._position_right_ae62s_gg_.__verticalWritingMode_ae62s_gg_{writing-mode:vertical-rl;transform:none}.___STick_ae62s_gg_._position_custom_0_ae62s_gg_{transform:translateY(12px);text-anchor:middle;dominant-baseline:hanging}.___STick_ae62s_gg_._position_custom_0_ae62s_gg_ tspan{dominant-baseline:hanging}.___STick_ae62s_gg_._position_custom_1_ae62s_gg_{transform:translateX(-16px);text-anchor:end;dominant-baseline:middle}.___STick_ae62s_gg_._position_custom_1_ae62s_gg_ tspan{dominant-baseline:middle}',
|
|
14
16
|
/*__inner_css_end__*/
|
|
15
|
-
"
|
|
17
|
+
"ae62s_gg_"
|
|
16
18
|
), /*__reshadow_css_end__*/
|
|
17
19
|
{
|
|
18
|
-
"__SAxis": "
|
|
19
|
-
"_hide": "
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"_position_custom_1": "_position_custom_1_17qfg_gg_"
|
|
20
|
+
"__SAxis": "___SAxis_ae62s_gg_",
|
|
21
|
+
"_hide": "__hide_ae62s_gg_",
|
|
22
|
+
"__SGrid": "___SGrid_ae62s_gg_",
|
|
23
|
+
"__STitle": "___STitle_ae62s_gg_",
|
|
24
|
+
"--transform-origin": "--transform-origin_ae62s",
|
|
25
|
+
"_position_top": "_position_top_ae62s_gg_",
|
|
26
|
+
"_position_bottom": "_position_bottom_ae62s_gg_",
|
|
27
|
+
"_position_right": "_position_right_ae62s_gg_",
|
|
28
|
+
"_position_left": "_position_left_ae62s_gg_",
|
|
29
|
+
"_verticalWritingMode": "__verticalWritingMode_ae62s_gg_",
|
|
30
|
+
"__STick": "___STick_ae62s_gg_",
|
|
31
|
+
"_primaryText": "__primaryText_ae62s_gg_",
|
|
32
|
+
"_position_custom_0": "_position_custom_0_ae62s_gg_",
|
|
33
|
+
"_position_custom_1": "_position_custom_1_ae62s_gg_"
|
|
33
34
|
})
|
|
34
35
|
);
|
|
36
|
+
const TICK_MARGIN_X = 16;
|
|
37
|
+
const TICK_MARGIN_Y = 8;
|
|
35
38
|
const CUSTOM_0 = /* @__PURE__ */ Symbol("custom_0");
|
|
36
39
|
const CUSTOM_1 = /* @__PURE__ */ Symbol("custom_1");
|
|
37
40
|
const MAP_INDEX_SCALE_SYMBOL = {
|
|
@@ -105,32 +108,46 @@ const MAP_POSITION_AXIS = {
|
|
|
105
108
|
}
|
|
106
109
|
};
|
|
107
110
|
const MAP_POSITION_TICK = {
|
|
108
|
-
top: ([xScale, yScale], value
|
|
111
|
+
top: ([xScale, yScale], value, _, {
|
|
112
|
+
width,
|
|
113
|
+
height
|
|
114
|
+
}) => {
|
|
109
115
|
const yRange = yScale.range();
|
|
116
|
+
const [translateX, translateY] = [-width / 2, -height - TICK_MARGIN_Y];
|
|
110
117
|
return {
|
|
111
|
-
x: scaleOfBandwidth(xScale, value),
|
|
112
|
-
y: yRange[1]
|
|
118
|
+
x: scaleOfBandwidth(xScale, value) + translateX,
|
|
119
|
+
y: yRange[1] + translateY
|
|
113
120
|
};
|
|
114
121
|
},
|
|
115
|
-
bottom: ([xScale, yScale], value
|
|
122
|
+
bottom: ([xScale, yScale], value, _, {
|
|
123
|
+
width
|
|
124
|
+
}) => {
|
|
116
125
|
const yRange = yScale.range();
|
|
126
|
+
const [translateX, translateY] = [-width / 2, TICK_MARGIN_Y];
|
|
117
127
|
return {
|
|
118
|
-
x: scaleOfBandwidth(xScale, value),
|
|
119
|
-
y: yRange[0]
|
|
128
|
+
x: scaleOfBandwidth(xScale, value) + translateX,
|
|
129
|
+
y: yRange[0] + translateY
|
|
120
130
|
};
|
|
121
131
|
},
|
|
122
|
-
right: ([xScale, yScale], value
|
|
132
|
+
right: ([xScale, yScale], value, _, {
|
|
133
|
+
height
|
|
134
|
+
}) => {
|
|
123
135
|
const xRange = xScale.range();
|
|
136
|
+
const [translateX, translateY] = [TICK_MARGIN_X, -height / 2];
|
|
124
137
|
return {
|
|
125
|
-
x: xRange[1],
|
|
126
|
-
y: scaleOfBandwidth(yScale, value)
|
|
138
|
+
x: xRange[1] + translateX,
|
|
139
|
+
y: scaleOfBandwidth(yScale, value) + translateY
|
|
127
140
|
};
|
|
128
141
|
},
|
|
129
|
-
left: ([xScale, yScale], value
|
|
142
|
+
left: ([xScale, yScale], value, _, {
|
|
143
|
+
width,
|
|
144
|
+
height
|
|
145
|
+
}) => {
|
|
130
146
|
const xRange = xScale.range();
|
|
147
|
+
const [translateX, translateY] = [-width - TICK_MARGIN_X, -height / 2];
|
|
131
148
|
return {
|
|
132
|
-
x: xRange[0],
|
|
133
|
-
y: scaleOfBandwidth(yScale, value)
|
|
149
|
+
x: xRange[0] + translateX,
|
|
150
|
+
y: scaleOfBandwidth(yScale, value) + translateY
|
|
134
151
|
};
|
|
135
152
|
},
|
|
136
153
|
[CUSTOM_0]: ([xScale, yScale], value, pos) => {
|
|
@@ -199,49 +216,35 @@ const MAP_POSITION_TITlE = {
|
|
|
199
216
|
};
|
|
200
217
|
}
|
|
201
218
|
};
|
|
202
|
-
function renderValue(value) {
|
|
219
|
+
function renderValue(value, locale = "en") {
|
|
203
220
|
if (value instanceof Date) {
|
|
204
|
-
return
|
|
221
|
+
return new Intl.DateTimeFormat(locale, {
|
|
222
|
+
day: "numeric",
|
|
223
|
+
month: "short"
|
|
224
|
+
}).format(value);
|
|
205
225
|
}
|
|
206
226
|
return value;
|
|
207
227
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
const {
|
|
229
|
-
width: currentLineWidth
|
|
230
|
-
} = measurer2.measure(currentLine);
|
|
231
|
-
if (currentLineWidth > maxWidth) {
|
|
232
|
-
lines.push(currentLine);
|
|
233
|
-
currentLine = "";
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
if (currentLine) {
|
|
238
|
-
lines.push(currentLine);
|
|
239
|
-
}
|
|
240
|
-
return lines;
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
const measurer = new TextMeasurer();
|
|
228
|
+
const TickForeignObject = /* @__PURE__ */ React.forwardRef(function({
|
|
229
|
+
children,
|
|
230
|
+
isRenderProp,
|
|
231
|
+
"aria-hidden": ariaHidden,
|
|
232
|
+
...props
|
|
233
|
+
}, ref) {
|
|
234
|
+
const contentRef = React.useRef(null);
|
|
235
|
+
const [interactive, setInteractive] = React.useState(false);
|
|
236
|
+
useEnhancedEffect(() => {
|
|
237
|
+
if (!isRenderProp || !contentRef.current) return;
|
|
238
|
+
setInteractive(getFocusableIn(contentRef.current).length > 0);
|
|
239
|
+
}, []);
|
|
240
|
+
return /* @__PURE__ */ React.createElement("foreignObject", _extends({
|
|
241
|
+
ref,
|
|
242
|
+
"aria-hidden": interactive ? void 0 : true
|
|
243
|
+
}, propsForElement(props, "foreignObject")), /* @__PURE__ */ React.createElement("div", {
|
|
244
|
+
ref: contentRef,
|
|
245
|
+
"data-tick-content": true
|
|
246
|
+
}, children));
|
|
247
|
+
});
|
|
245
248
|
class AxisRoot extends Component {
|
|
246
249
|
get ticks() {
|
|
247
250
|
const {
|
|
@@ -270,8 +273,7 @@ class AxisRoot extends Component {
|
|
|
270
273
|
return {
|
|
271
274
|
ticks: this.ticks,
|
|
272
275
|
indexScale,
|
|
273
|
-
position
|
|
274
|
-
splitTextByWidth: splitTextByWidth(measurer)
|
|
276
|
+
position
|
|
275
277
|
};
|
|
276
278
|
}
|
|
277
279
|
getGridProps() {
|
|
@@ -316,17 +318,24 @@ function Ticks(props) {
|
|
|
316
318
|
dataHintsHandler,
|
|
317
319
|
children,
|
|
318
320
|
childrenPosition = "inside",
|
|
319
|
-
|
|
320
|
-
|
|
321
|
+
locale,
|
|
322
|
+
primaryText,
|
|
323
|
+
size,
|
|
324
|
+
meta
|
|
321
325
|
} = props;
|
|
322
|
-
const
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
326
|
+
const isRenderProp = typeof children === "function";
|
|
327
|
+
const isXScale = indexScale === 0;
|
|
328
|
+
const axis = isXScale ? "horizontal" : "vertical";
|
|
329
|
+
const [_, plotHeight] = size;
|
|
330
|
+
const currentScale = scale[indexScale];
|
|
331
|
+
const secondaryScale = scale[isXScale ? 1 : 0];
|
|
332
|
+
const [startPointCurrentScale, endPointCurrentScale] = currentScale.range();
|
|
333
|
+
const [startPointSecondaryScale, endPointSecondaryScale] = secondaryScale.range();
|
|
334
|
+
const tickStepSize = currentScale?.step?.() ?? Math.abs(startPointCurrentScale - endPointCurrentScale) / ticks.length;
|
|
335
|
+
const [tickWidth, tickHeight] = isXScale ? [tickStepSize, Math.max(Math.abs(plotHeight - startPointSecondaryScale), endPointSecondaryScale)] : [startPointSecondaryScale, tickStepSize];
|
|
327
336
|
const pos = MAP_POSITION_TICK[position] ?? MAP_POSITION_TICK[MAP_INDEX_SCALE_SYMBOL[indexScale]];
|
|
328
337
|
const positionClass = MAP_POSITION_TICK[position] ? position : `custom_${indexScale}`;
|
|
329
|
-
if (
|
|
338
|
+
if (isRenderProp) {
|
|
330
339
|
const labelGetter = (value) => {
|
|
331
340
|
const result = children({
|
|
332
341
|
value
|
|
@@ -339,30 +348,33 @@ function Ticks(props) {
|
|
|
339
348
|
dataHintsHandler.addKeyLabelGetter("horizontal", labelGetter);
|
|
340
349
|
}
|
|
341
350
|
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}
|
|
351
|
+
meta.setTicksSize(axis, {
|
|
352
|
+
width: tickWidth,
|
|
353
|
+
height: tickHeight
|
|
354
|
+
});
|
|
355
|
+
meta.setTicksVisibility(axis, !hide);
|
|
356
|
+
meta.setTicksPosition(axis, position);
|
|
357
|
+
return ticks.map((value, i) => {
|
|
346
358
|
var _ref2;
|
|
347
|
-
const displayValue =
|
|
359
|
+
const displayValue = isRenderProp ? void 0 : renderValue(value, locale);
|
|
348
360
|
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(STick, _ref2.cn("STick", {
|
|
349
|
-
"aria-hidden": true,
|
|
350
361
|
"key": i,
|
|
351
|
-
"render": "text",
|
|
352
|
-
"childrenPosition": childrenPosition,
|
|
353
|
-
"__excludeProps": ["data", "scale", "format", "value"],
|
|
354
|
-
"value": value,
|
|
355
362
|
"index": i,
|
|
363
|
+
"render": TickForeignObject,
|
|
364
|
+
"childrenPosition": childrenPosition,
|
|
365
|
+
"width": tickWidth,
|
|
366
|
+
"height": tickHeight,
|
|
356
367
|
"position": positionClass,
|
|
357
368
|
"hide": hide,
|
|
358
|
-
"
|
|
359
|
-
"
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
369
|
+
"primaryText": primaryText,
|
|
370
|
+
"value": value,
|
|
371
|
+
"isRenderProp": isRenderProp,
|
|
372
|
+
"__excludeProps": ["data", "scale", "format", "value"],
|
|
373
|
+
...pos(scale, value, position, {
|
|
374
|
+
width: tickWidth,
|
|
375
|
+
height: tickHeight
|
|
376
|
+
})
|
|
377
|
+
}), displayValue);
|
|
366
378
|
});
|
|
367
379
|
}
|
|
368
380
|
function Grid(props) {
|
package/lib/esm/Bar.mjs
CHANGED
|
@@ -12,26 +12,26 @@ const style = (
|
|
|
12
12
|
/*__reshadow_css_start__*/
|
|
13
13
|
(sstyled.insert(
|
|
14
14
|
/*__inner_css_start__*/
|
|
15
|
-
".
|
|
15
|
+
".___SBar_avucd_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));transition-property:height,width,y;transition-duration:var(--duration_avucd);transition-timing-function:ease-in-out}.___SBar_avucd_gg_.__color_avucd_gg_{fill:var(--color_avucd)}.___SBar_avucd_gg_.__pattern_avucd_gg_.__color_avucd_gg_{fill:var(--pattern_avucd);stroke:var(--color_avucd);stroke-width:1px}.___SBar_avucd_gg_.__hide_avucd_gg_{display:none}.___SBar_avucd_gg_.__transparent_avucd_gg_{opacity:.3}.___SBar_avucd_gg_.__onClick_avucd_gg_{cursor:pointer}.___SBackground_avucd_gg_{fill:var(--intergalactic-chart-grid-bar-base-bg,oklch(.92 .008 233.5));opacity:.4}.___SBackground_avucd_gg_.__onClick_avucd_gg_{cursor:pointer}.___SBarAnnotation_avucd_gg_{display:flex;justify-content:space-between}.___SBarLabel_avucd_gg_{color:var(--intergalactic-text-primary,oklch(.23 .009 245));margin-right:auto}.___SBarLabel_avucd_gg_,.___SBarPercent_avucd_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286)}.___SBarPercent_avucd_gg_{color:var(--intergalactic-text-secondary,oklch(.182 .045 244.8/.593));margin-right:var(--intergalactic-spacing-2x,8px)}.___SBarValue_avucd_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_avucd_gg_{fill:var(--intergalactic-chart-grid-bar-hover,oklch(.375 .09 242.7/.05))}",
|
|
16
16
|
/*__inner_css_end__*/
|
|
17
|
-
"
|
|
17
|
+
"avucd_gg_"
|
|
18
18
|
), /*__reshadow_css_end__*/
|
|
19
19
|
{
|
|
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": "
|
|
20
|
+
"__SBar": "___SBar_avucd_gg_",
|
|
21
|
+
"--duration": "--duration_avucd",
|
|
22
|
+
"_color": "__color_avucd_gg_",
|
|
23
|
+
"--color": "--color_avucd",
|
|
24
|
+
"_pattern": "__pattern_avucd_gg_",
|
|
25
|
+
"--pattern": "--pattern_avucd",
|
|
26
|
+
"_hide": "__hide_avucd_gg_",
|
|
27
|
+
"_transparent": "__transparent_avucd_gg_",
|
|
28
|
+
"_onClick": "__onClick_avucd_gg_",
|
|
29
|
+
"__SBackground": "___SBackground_avucd_gg_",
|
|
30
|
+
"__SBarAnnotation": "___SBarAnnotation_avucd_gg_",
|
|
31
|
+
"__SBarLabel": "___SBarLabel_avucd_gg_",
|
|
32
|
+
"__SBarPercent": "___SBarPercent_avucd_gg_",
|
|
33
|
+
"__SBarValue": "___SBarValue_avucd_gg_",
|
|
34
|
+
"__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_avucd_gg_"
|
|
35
35
|
})
|
|
36
36
|
);
|
|
37
37
|
const MIN_HEIGHT = 2;
|
package/lib/esm/Bubble.mjs
CHANGED
|
@@ -15,24 +15,24 @@ const style = (
|
|
|
15
15
|
/*__reshadow_css_start__*/
|
|
16
16
|
(sstyled.insert(
|
|
17
17
|
/*__inner_css_start__*/
|
|
18
|
-
".
|
|
18
|
+
".___SBubble_1tr0w_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));stroke:var(--intergalactic-chart-grid-border,#fff);stroke-width:2px;transition-property:cx,cy;transition-duration:var(--duration_1tr0w);transition-timing-function:ease-in-out;opacity:.5}@media (hover:hover){.___SBubble_1tr0w_gg_:hover{opacity:.8}}g._visible_false_1tr0w_gg_{display:none}.___SBubble_1tr0w_gg_.__clickable_1tr0w_gg_{cursor:pointer}.___SBubble_1tr0w_gg_.__color_1tr0w_gg_{fill:var(--color_1tr0w)}.___SBubble_1tr0w_gg_.__pattern_1tr0w_gg_.__color_1tr0w_gg_{fill:var(--pattern_1tr0w);stroke:var(--color_1tr0w);stroke-width:1px}.___SBubble_1tr0w_gg_.__transparent_1tr0w_gg_{opacity:.3}.___SCenter_1tr0w_gg_{text-anchor:middle;font-size:calc(var(--intergalactic-fs-100, 12px) - 1px);stroke:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245))}.___SCenter_1tr0w_gg_.__color_1tr0w_gg_{stroke:var(--color_1tr0w)}.___SCenter_1tr0w_gg_.__transparent_1tr0w_gg_{opacity:.3}.___SLabel_1tr0w_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245))}.___SLabel_1tr0w_gg_._position_right_1tr0w_gg_{text-anchor:end}.___SLabel_1tr0w_gg_._position_left_1tr0w_gg_{text-anchor:start}.___SLabel_1tr0w_gg_.__color_1tr0w_gg_{fill:var(--color_1tr0w)}.___SLabel_1tr0w_gg_.__transparent_1tr0w_gg_{opacity:.3}",
|
|
19
19
|
/*__inner_css_end__*/
|
|
20
|
-
"
|
|
20
|
+
"1tr0w_gg_"
|
|
21
21
|
), /*__reshadow_css_end__*/
|
|
22
22
|
{
|
|
23
|
-
"_visible_false": "
|
|
24
|
-
"__SBubble": "
|
|
25
|
-
"_clickable": "
|
|
26
|
-
"_color": "
|
|
27
|
-
"--color": "--
|
|
28
|
-
"_pattern": "
|
|
29
|
-
"--pattern": "--
|
|
30
|
-
"_transparent": "
|
|
31
|
-
"__SCenter": "
|
|
32
|
-
"__SLabel": "
|
|
33
|
-
"_position_right": "
|
|
34
|
-
"_position_left": "
|
|
35
|
-
"--duration": "--
|
|
23
|
+
"_visible_false": "_visible_false_1tr0w_gg_",
|
|
24
|
+
"__SBubble": "___SBubble_1tr0w_gg_",
|
|
25
|
+
"_clickable": "__clickable_1tr0w_gg_",
|
|
26
|
+
"_color": "__color_1tr0w_gg_",
|
|
27
|
+
"--color": "--color_1tr0w",
|
|
28
|
+
"_pattern": "__pattern_1tr0w_gg_",
|
|
29
|
+
"--pattern": "--pattern_1tr0w",
|
|
30
|
+
"_transparent": "__transparent_1tr0w_gg_",
|
|
31
|
+
"__SCenter": "___SCenter_1tr0w_gg_",
|
|
32
|
+
"__SLabel": "___SLabel_1tr0w_gg_",
|
|
33
|
+
"_position_right": "_position_right_1tr0w_gg_",
|
|
34
|
+
"_position_left": "_position_left_1tr0w_gg_",
|
|
35
|
+
"--duration": "--duration_1tr0w"
|
|
36
36
|
})
|
|
37
37
|
);
|
|
38
38
|
class BubbleRoot extends Component {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
class ChartMetaData {
|
|
3
|
+
constructor() {
|
|
4
|
+
_defineProperty(this, "ticks", {
|
|
5
|
+
horizontal: {
|
|
6
|
+
size: null,
|
|
7
|
+
isVisible: null,
|
|
8
|
+
position: null
|
|
9
|
+
},
|
|
10
|
+
vertical: {
|
|
11
|
+
size: null,
|
|
12
|
+
isVisible: null,
|
|
13
|
+
position: null
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
getTicksSize(axis) {
|
|
18
|
+
return this.ticks[axis].size;
|
|
19
|
+
}
|
|
20
|
+
setTicksSize(axis, payload) {
|
|
21
|
+
this.ticks[axis].size = payload;
|
|
22
|
+
}
|
|
23
|
+
getTicksVisibility(axis) {
|
|
24
|
+
return this.ticks[axis].isVisible;
|
|
25
|
+
}
|
|
26
|
+
setTicksVisibility(axis, isVisible) {
|
|
27
|
+
this.ticks[axis].isVisible = isVisible;
|
|
28
|
+
}
|
|
29
|
+
getTicksPosition(axis) {
|
|
30
|
+
return this.ticks[axis].position;
|
|
31
|
+
}
|
|
32
|
+
setTicksPosition(axis, position) {
|
|
33
|
+
this.ticks[axis].position = position;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
ChartMetaData
|
|
38
|
+
};
|
|
@@ -16,26 +16,26 @@ const style = (
|
|
|
16
16
|
/*__reshadow_css_start__*/
|
|
17
17
|
(sstyled.insert(
|
|
18
18
|
/*__inner_css_start__*/
|
|
19
|
-
".
|
|
19
|
+
".___SBar_avucd_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));transition-property:height,width,y;transition-duration:var(--duration_avucd);transition-timing-function:ease-in-out}.___SBar_avucd_gg_.__color_avucd_gg_{fill:var(--color_avucd)}.___SBar_avucd_gg_.__pattern_avucd_gg_.__color_avucd_gg_{fill:var(--pattern_avucd);stroke:var(--color_avucd);stroke-width:1px}.___SBar_avucd_gg_.__hide_avucd_gg_{display:none}.___SBar_avucd_gg_.__transparent_avucd_gg_{opacity:.3}.___SBar_avucd_gg_.__onClick_avucd_gg_{cursor:pointer}.___SBackground_avucd_gg_{fill:var(--intergalactic-chart-grid-bar-base-bg,oklch(.92 .008 233.5));opacity:.4}.___SBackground_avucd_gg_.__onClick_avucd_gg_{cursor:pointer}.___SBarAnnotation_avucd_gg_{display:flex;justify-content:space-between}.___SBarLabel_avucd_gg_{color:var(--intergalactic-text-primary,oklch(.23 .009 245));margin-right:auto}.___SBarLabel_avucd_gg_,.___SBarPercent_avucd_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286)}.___SBarPercent_avucd_gg_{color:var(--intergalactic-text-secondary,oklch(.182 .045 244.8/.593));margin-right:var(--intergalactic-spacing-2x,8px)}.___SBarValue_avucd_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_avucd_gg_{fill:var(--intergalactic-chart-grid-bar-hover,oklch(.375 .09 242.7/.05))}",
|
|
20
20
|
/*__inner_css_end__*/
|
|
21
|
-
"
|
|
21
|
+
"avucd_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_avucd_gg_",
|
|
25
|
+
"--duration": "--duration_avucd",
|
|
26
|
+
"_color": "__color_avucd_gg_",
|
|
27
|
+
"--color": "--color_avucd",
|
|
28
|
+
"_pattern": "__pattern_avucd_gg_",
|
|
29
|
+
"--pattern": "--pattern_avucd",
|
|
30
|
+
"_hide": "__hide_avucd_gg_",
|
|
31
|
+
"_transparent": "__transparent_avucd_gg_",
|
|
32
|
+
"_onClick": "__onClick_avucd_gg_",
|
|
33
|
+
"__SBackground": "___SBackground_avucd_gg_",
|
|
34
|
+
"__SBarAnnotation": "___SBarAnnotation_avucd_gg_",
|
|
35
|
+
"__SBarLabel": "___SBarLabel_avucd_gg_",
|
|
36
|
+
"__SBarPercent": "___SBarPercent_avucd_gg_",
|
|
37
|
+
"__SBarValue": "___SBarValue_avucd_gg_",
|
|
38
|
+
"__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_avucd_gg_"
|
|
39
39
|
})
|
|
40
40
|
);
|
|
41
41
|
const MIN_WIDTH = 4;
|
package/lib/esm/Donut.mjs
CHANGED
|
@@ -17,19 +17,19 @@ const style = (
|
|
|
17
17
|
/*__reshadow_css_start__*/
|
|
18
18
|
(sstyled.insert(
|
|
19
19
|
/*__inner_css_start__*/
|
|
20
|
-
".
|
|
20
|
+
".___SPie_1s8f1_gg_{stroke:var(--intergalactic-chart-grid-border,#fff);fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245))}.___SPie_1s8f1_gg_.__color_1s8f1_gg_{fill:var(--color_1s8f1)}.___SPie_1s8f1_gg_.__pattern_1s8f1_gg_.__color_1s8f1_gg_{fill:var(--pattern_1s8f1);stroke:var(--color_1s8f1);stroke-width:1px}.___SPie_1s8f1_gg_.__transparent_1s8f1_gg_{opacity:.3}.___SEmptyData_1s8f1_gg_{fill:var(--intergalactic-chart-palette-order-null,oklch(.9 .009 234))}.___SEmptyData_1s8f1_gg_.__color_1s8f1_gg_{fill:var(--color_1s8f1)}.___SLabel_1s8f1_gg_{text-anchor:middle;vertical-anchor:middle;font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286)}",
|
|
21
21
|
/*__inner_css_end__*/
|
|
22
|
-
"
|
|
22
|
+
"1s8f1_gg_"
|
|
23
23
|
), /*__reshadow_css_end__*/
|
|
24
24
|
{
|
|
25
|
-
"__SPie": "
|
|
26
|
-
"_color": "
|
|
27
|
-
"--color": "--
|
|
28
|
-
"_pattern": "
|
|
29
|
-
"--pattern": "--
|
|
30
|
-
"_transparent": "
|
|
31
|
-
"__SEmptyData": "
|
|
32
|
-
"__SLabel": "
|
|
25
|
+
"__SPie": "___SPie_1s8f1_gg_",
|
|
26
|
+
"_color": "__color_1s8f1_gg_",
|
|
27
|
+
"--color": "--color_1s8f1",
|
|
28
|
+
"_pattern": "__pattern_1s8f1_gg_",
|
|
29
|
+
"--pattern": "--pattern_1s8f1",
|
|
30
|
+
"_transparent": "__transparent_1s8f1_gg_",
|
|
31
|
+
"__SEmptyData": "___SEmptyData_1s8f1_gg_",
|
|
32
|
+
"__SLabel": "___SLabel_1s8f1_gg_"
|
|
33
33
|
})
|
|
34
34
|
);
|
|
35
35
|
const DEFAULT_INSTANCE = /* @__PURE__ */ Symbol("DEFAULT_INSTANCE");
|
|
@@ -83,7 +83,8 @@ function transitionRadiusPie({
|
|
|
83
83
|
};
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
const increaseFactor =
|
|
86
|
+
const increaseFactor = 4;
|
|
87
|
+
const donutThickness = 16;
|
|
87
88
|
function getOuterRadius({
|
|
88
89
|
size,
|
|
89
90
|
halfsize
|
|
@@ -118,11 +119,11 @@ class DonutRoot extends Component {
|
|
|
118
119
|
}) => {
|
|
119
120
|
const {
|
|
120
121
|
duration,
|
|
121
|
-
innerRadius,
|
|
122
122
|
d3Arc,
|
|
123
123
|
paddingAngle
|
|
124
124
|
} = this.asProps;
|
|
125
125
|
const outerRadius = d3Arc.outerRadius()();
|
|
126
|
+
const innerRadius = d3Arc.innerRadius()();
|
|
126
127
|
const outerRadiusStartEnd = active ? [+element.dataset["currentRadius"] || outerRadius, outerRadius + increaseFactor] : [+element.dataset["currentRadius"] || outerRadius, outerRadius];
|
|
127
128
|
if (this.canAnimatedHover && duration > 0) {
|
|
128
129
|
transitionRadiusPie({
|
|
@@ -324,7 +325,7 @@ _defineProperty(DonutRoot, "displayName", "Donut");
|
|
|
324
325
|
_defineProperty(DonutRoot, "style", style);
|
|
325
326
|
_defineProperty(DonutRoot, "enhance", [uniqueIDEnhancement()]);
|
|
326
327
|
_defineProperty(DonutRoot, "defaultProps", ({
|
|
327
|
-
innerRadius
|
|
328
|
+
innerRadius: innerRadiusProp,
|
|
328
329
|
paddingAngle = 0,
|
|
329
330
|
outerRadius,
|
|
330
331
|
halfsize = false,
|
|
@@ -332,15 +333,13 @@ _defineProperty(DonutRoot, "defaultProps", ({
|
|
|
332
333
|
size
|
|
333
334
|
}
|
|
334
335
|
}) => {
|
|
335
|
-
const
|
|
336
|
-
size,
|
|
337
|
-
halfsize,
|
|
338
|
-
outerRadius
|
|
339
|
-
})).innerRadius(innerRadius).padAngle(paddingAngle);
|
|
340
|
-
const d3ArcOut = arc().outerRadius((outerRadius || getOuterRadius({
|
|
336
|
+
const radius = outerRadius || getOuterRadius({
|
|
341
337
|
size,
|
|
342
338
|
halfsize
|
|
343
|
-
})
|
|
339
|
+
});
|
|
340
|
+
const innerRadius = innerRadiusProp ?? Math.max(radius - donutThickness, 0);
|
|
341
|
+
const d3Arc = arc().outerRadius(radius).innerRadius(innerRadius).padAngle(paddingAngle);
|
|
342
|
+
const d3ArcOut = arc().outerRadius(radius + increaseFactor).innerRadius(innerRadius).padAngle(paddingAngle);
|
|
344
343
|
let d3Pie = pie().sort(null).value(([, value]) => value);
|
|
345
344
|
d3Pie[DEFAULT_INSTANCE] = true;
|
|
346
345
|
if (halfsize) {
|