@semcore/d3-chart 17.3.1-prerelease.9 → 18.0.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 +7 -1
- package/lib/cjs/Area.js +11 -11
- package/lib/cjs/Axis.js +55 -58
- 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/CompactHorizontalBar.js +16 -16
- package/lib/cjs/Donut.js +9 -9
- package/lib/cjs/Dots.js +14 -11
- package/lib/cjs/Dots.js.map +1 -1
- package/lib/cjs/HorizontalBar.js +16 -16
- package/lib/cjs/Hover.js +158 -39
- package/lib/cjs/Hover.js.map +1 -1
- package/lib/cjs/Line.js +9 -9
- package/lib/cjs/Plot.js +6 -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 +12 -12
- package/lib/cjs/ScatterPlot.js +9 -9
- package/lib/cjs/Tooltip.js +20 -11
- package/lib/cjs/Tooltip.js.map +1 -1
- package/lib/cjs/Venn.js +9 -9
- package/lib/cjs/a11y/PlotA11yModule.js +2 -2
- package/lib/cjs/a11y/PlotA11yView.js +2 -2
- package/lib/cjs/component/Chart/AbstractChart.js +139 -50
- package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
- package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/AreaChart.js +12 -10
- 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 +9 -7
- 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 +21 -8
- package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
- package/lib/cjs/component/Chart/BubbleChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.js +33 -30
- package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.js +2 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.js.map +1 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.js +5 -4
- 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 -4
- 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 +9 -7
- package/lib/cjs/component/Chart/LineChart.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/RadarChart.js +3 -2
- package/lib/cjs/component/Chart/RadarChart.js.map +1 -1
- package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.js +19 -7
- package/lib/cjs/component/Chart/ScatterPlotChart.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/VennChart.js +6 -5
- package/lib/cjs/component/Chart/VennChart.js.map +1 -1
- package/lib/cjs/component/Chart/VennChart.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/BaseLegend.js +4 -2
- package/lib/cjs/component/ChartLegend/BaseLegend.js.map +1 -1
- package/lib/cjs/component/ChartLegend/BaseLegend.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/cjs/component/ChartLegend/LegendFlex/legend-flex.shadow.css +2 -2
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +23 -18
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/legend-item.shadow.css +16 -40
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +12 -8
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/legend-table.shadow.css +6 -2
- package/lib/cjs/style/abstract-chart.shadow.css +31 -1
- package/lib/cjs/style/area.shadow.css +6 -5
- package/lib/cjs/style/axis.shadow.css +2 -2
- package/lib/cjs/style/bar.shadow.css +7 -7
- package/lib/cjs/style/bubble.shadow.css +4 -4
- package/lib/cjs/style/donut.shadow.css +3 -3
- package/lib/cjs/style/dot.shadow.css +9 -3
- package/lib/cjs/style/hover.shadow.css +19 -1
- package/lib/cjs/style/line.shadow.css +4 -4
- package/lib/cjs/style/radar.shadow.css +5 -5
- package/lib/cjs/style/radial-tree.shadow.css +3 -3
- package/lib/cjs/style/reference.shadow.css +1 -1
- package/lib/cjs/style/scatterplot.shadow.css +1 -1
- package/lib/cjs/style/tooltip.shadow.css +23 -14
- package/lib/cjs/style/venn.shadow.css +3 -3
- package/lib/cjs/types/Hover.d.js.map +1 -1
- package/lib/cjs/utils/TextMeasurer.js +33 -0
- package/lib/cjs/utils/TextMeasurer.js.map +1 -0
- package/lib/es6/Area.js +11 -11
- package/lib/es6/Axis.js +55 -57
- 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/CompactHorizontalBar.js +16 -16
- package/lib/es6/Donut.js +9 -9
- package/lib/es6/Dots.js +14 -11
- package/lib/es6/Dots.js.map +1 -1
- package/lib/es6/HorizontalBar.js +16 -16
- package/lib/es6/Hover.js +158 -39
- package/lib/es6/Hover.js.map +1 -1
- package/lib/es6/Line.js +9 -9
- package/lib/es6/Plot.js +6 -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 +12 -12
- package/lib/es6/ScatterPlot.js +9 -9
- package/lib/es6/Tooltip.js +20 -11
- package/lib/es6/Tooltip.js.map +1 -1
- package/lib/es6/Venn.js +9 -9
- package/lib/es6/a11y/PlotA11yModule.js +2 -2
- package/lib/es6/a11y/PlotA11yView.js +2 -2
- package/lib/es6/component/Chart/AbstractChart.js +136 -48
- package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
- package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
- package/lib/es6/component/Chart/AreaChart.js +12 -10
- 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 +9 -7
- 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 +22 -9
- package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
- package/lib/es6/component/Chart/BubbleChart.type.js.map +1 -1
- package/lib/es6/component/Chart/CigaretteChart.js +33 -30
- package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/es6/component/Chart/CigaretteChart.type.js.map +1 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.js +2 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.js.map +1 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.js +5 -4
- 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 -4
- 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 +9 -7
- package/lib/es6/component/Chart/LineChart.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.type.js.map +1 -1
- package/lib/es6/component/Chart/RadarChart.js +3 -2
- package/lib/es6/component/Chart/RadarChart.js.map +1 -1
- package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.js +20 -8
- package/lib/es6/component/Chart/ScatterPlotChart.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/es6/component/Chart/VennChart.js +6 -5
- package/lib/es6/component/Chart/VennChart.js.map +1 -1
- package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/BaseLegend.js +4 -2
- package/lib/es6/component/ChartLegend/BaseLegend.js.map +1 -1
- package/lib/es6/component/ChartLegend/BaseLegend.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/es6/component/ChartLegend/LegendFlex/legend-flex.shadow.css +2 -2
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +23 -18
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/legend-item.shadow.css +16 -40
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +12 -8
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/legend-table.shadow.css +6 -2
- package/lib/es6/style/abstract-chart.shadow.css +31 -1
- package/lib/es6/style/area.shadow.css +6 -5
- package/lib/es6/style/axis.shadow.css +2 -2
- package/lib/es6/style/bar.shadow.css +7 -7
- package/lib/es6/style/bubble.shadow.css +4 -4
- package/lib/es6/style/donut.shadow.css +3 -3
- package/lib/es6/style/dot.shadow.css +9 -3
- package/lib/es6/style/hover.shadow.css +19 -1
- package/lib/es6/style/line.shadow.css +4 -4
- package/lib/es6/style/radar.shadow.css +5 -5
- package/lib/es6/style/radial-tree.shadow.css +3 -3
- package/lib/es6/style/reference.shadow.css +1 -1
- package/lib/es6/style/scatterplot.shadow.css +1 -1
- package/lib/es6/style/tooltip.shadow.css +23 -14
- package/lib/es6/style/venn.shadow.css +3 -3
- package/lib/es6/types/Hover.d.js.map +1 -1
- package/lib/es6/utils/TextMeasurer.js +25 -0
- package/lib/es6/utils/TextMeasurer.js.map +1 -0
- package/lib/esm/Area.mjs +12 -12
- package/lib/esm/Axis.mjs +56 -58
- package/lib/esm/Bar.mjs +17 -17
- package/lib/esm/Bubble.mjs +15 -15
- package/lib/esm/CompactHorizontalBar.mjs +17 -17
- package/lib/esm/Donut.mjs +10 -10
- package/lib/esm/Dots.mjs +15 -12
- package/lib/esm/HorizontalBar.mjs +17 -17
- package/lib/esm/Hover.mjs +157 -40
- package/lib/esm/Line.mjs +10 -10
- package/lib/esm/Plot.mjs +7 -5
- package/lib/esm/Radar.mjs +20 -20
- package/lib/esm/RadialTree.mjs +13 -13
- package/lib/esm/Reference.mjs +13 -13
- package/lib/esm/ScatterPlot.mjs +10 -10
- package/lib/esm/Tooltip.mjs +21 -12
- package/lib/esm/Venn.mjs +10 -10
- package/lib/esm/a11y/PlotA11yModule.mjs +3 -3
- package/lib/esm/a11y/PlotA11yView.mjs +3 -3
- package/lib/esm/component/Chart/AbstractChart.mjs +150 -54
- package/lib/esm/component/Chart/AreaChart.mjs +12 -10
- package/lib/esm/component/Chart/BarChart.mjs +9 -7
- package/lib/esm/component/Chart/BubbleChart.mjs +29 -9
- package/lib/esm/component/Chart/CigaretteChart.mjs +33 -30
- package/lib/esm/component/Chart/CompactHorizontalBarChart.mjs +2 -1
- package/lib/esm/component/Chart/DonutChart.mjs +5 -4
- package/lib/esm/component/Chart/HistogramChart.mjs +6 -4
- package/lib/esm/component/Chart/LineChart.mjs +9 -7
- package/lib/esm/component/Chart/RadarChart.mjs +3 -2
- package/lib/esm/component/Chart/ScatterPlotChart.mjs +25 -8
- package/lib/esm/component/Chart/VennChart.mjs +6 -5
- package/lib/esm/component/ChartLegend/BaseLegend.mjs +4 -2
- 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 +24 -19
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.type.mjs +1 -1
- package/lib/esm/component/ChartLegend/LegendItem/legend-item.shadow.css +16 -40
- package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +13 -9
- package/lib/esm/component/ChartLegend/LegendTable/legend-table.shadow.css +6 -2
- package/lib/esm/style/abstract-chart.shadow.css +31 -1
- package/lib/esm/style/area.shadow.css +6 -5
- package/lib/esm/style/axis.shadow.css +2 -2
- package/lib/esm/style/bar.shadow.css +7 -7
- package/lib/esm/style/bubble.shadow.css +4 -4
- package/lib/esm/style/donut.shadow.css +3 -3
- package/lib/esm/style/dot.shadow.css +9 -3
- package/lib/esm/style/hover.shadow.css +19 -1
- package/lib/esm/style/line.shadow.css +4 -4
- package/lib/esm/style/radar.shadow.css +5 -5
- package/lib/esm/style/radial-tree.shadow.css +3 -3
- package/lib/esm/style/reference.shadow.css +1 -1
- package/lib/esm/style/scatterplot.shadow.css +1 -1
- package/lib/esm/style/tooltip.shadow.css +23 -14
- package/lib/esm/style/venn.shadow.css +3 -3
- package/lib/esm/utils/TextMeasurer.mjs +27 -0
- package/lib/types/Hover.d.ts +2 -0
- package/lib/types/component/Chart/AbstractChart.d.ts +11 -6
- package/lib/types/component/Chart/AbstractChart.d.ts.map +1 -1
- package/lib/types/component/Chart/AbstractChart.type.d.ts +20 -2
- 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 +1 -0
- 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 +2 -1
- package/lib/types/component/Chart/BubbleChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/CigaretteChart.type.d.ts +2 -1
- package/lib/types/component/Chart/CigaretteChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/CompactHorizontalBarChart.d.ts.map +1 -1
- package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +2 -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 +2 -1
- 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.d.ts.map +1 -1
- package/lib/types/component/Chart/RadarChart.type.d.ts +2 -1
- package/lib/types/component/Chart/RadarChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/ScatterPlotChart.d.ts.map +1 -1
- package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +2 -1
- package/lib/types/component/Chart/ScatterPlotChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/VennChart.d.ts.map +1 -1
- package/lib/types/component/Chart/VennChart.type.d.ts +2 -1
- package/lib/types/component/Chart/VennChart.type.d.ts.map +1 -1
- package/lib/types/component/ChartLegend/BaseLegend.d.ts +5 -1
- package/lib/types/component/ChartLegend/BaseLegend.d.ts.map +1 -1
- package/lib/types/component/ChartLegend/BaseLegend.type.d.ts +1 -1
- package/lib/types/component/ChartLegend/LegendItem/LegendItem.d.ts.map +1 -1
- package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts +3 -1
- package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts.map +1 -1
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.d.ts.map +1 -1
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts +2 -0
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts.map +1 -1
- package/lib/types/utils/TextMeasurer.d.ts +5 -0
- package/lib/types/utils/TextMeasurer.d.ts.map +1 -0
- package/package.json +15 -15
package/lib/esm/Venn.mjs
CHANGED
|
@@ -16,19 +16,19 @@ const style = (
|
|
|
16
16
|
/*__reshadow_css_start__*/
|
|
17
17
|
(sstyled.insert(
|
|
18
18
|
/*__inner_css_start__*/
|
|
19
|
-
".
|
|
19
|
+
".___SCircle_1gi52_gg_{fill:var(--intergalactic-chart-palette-order-2,oklch(.58 .168 278.2));stroke:var(--intergalactic-chart-grid-border,#fff);stroke-width:2px;fill-opacity:.5;transition-property:cx,cy;transition-duration:var(--duration_1gi52);transition-timing-function:ease-in-out}@media (hover:hover){.___SCircle_1gi52_gg_:hover{fill-opacity:.7}}.___SCircle_1gi52_gg_.__color_1gi52_gg_{fill:var(--color_1gi52)}.___SCircle_1gi52_gg_.__pattern_1gi52_gg_.__color_1gi52_gg_{fill:var(--pattern_1gi52);fill-opacity:.7;stroke:var(--color_1gi52);stroke-width:1px}@media (hover:hover){.___SCircle_1gi52_gg_.__pattern_1gi52_gg_.__color_1gi52_gg_:hover{fill-opacity:.85}}.___SCircle_1gi52_gg_.__transparent_1gi52_gg_{opacity:.3}.___SIntersection_1gi52_gg_{stroke:var(--intergalactic-chart-grid-border,#fff);stroke-width:2px;fill-opacity:0}@media (hover:hover){.___SIntersection_1gi52_gg_:hover{fill-opacity:.1}}.___SIntersection_1gi52_gg_.__transparent_1gi52_gg_{opacity:.3}",
|
|
20
20
|
/*__inner_css_end__*/
|
|
21
|
-
"
|
|
21
|
+
"1gi52_gg_"
|
|
22
22
|
), /*__reshadow_css_end__*/
|
|
23
23
|
{
|
|
24
|
-
"__SCircle": "
|
|
25
|
-
"_color": "
|
|
26
|
-
"--color": "--
|
|
27
|
-
"_transparent": "
|
|
28
|
-
"__SIntersection": "
|
|
29
|
-
"--duration": "--
|
|
30
|
-
"_pattern": "
|
|
31
|
-
"--pattern": "--
|
|
24
|
+
"__SCircle": "___SCircle_1gi52_gg_",
|
|
25
|
+
"_color": "__color_1gi52_gg_",
|
|
26
|
+
"--color": "--color_1gi52",
|
|
27
|
+
"_transparent": "__transparent_1gi52_gg_",
|
|
28
|
+
"__SIntersection": "___SIntersection_1gi52_gg_",
|
|
29
|
+
"--duration": "--duration_1gi52",
|
|
30
|
+
"_pattern": "__pattern_1gi52_gg_",
|
|
31
|
+
"--pattern": "--pattern_1gi52"
|
|
32
32
|
})
|
|
33
33
|
);
|
|
34
34
|
class VennRoot extends Component {
|
|
@@ -10,12 +10,12 @@ const styles = (
|
|
|
10
10
|
/*__reshadow_css_start__*/
|
|
11
11
|
(sstyled.insert(
|
|
12
12
|
/*__inner_css_start__*/
|
|
13
|
-
".
|
|
13
|
+
".___SPlotA11yModule_5qb0j_gg_{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}",
|
|
14
14
|
/*__inner_css_end__*/
|
|
15
|
-
"
|
|
15
|
+
"5qb0j_gg_"
|
|
16
16
|
), /*__reshadow_css_end__*/
|
|
17
17
|
{
|
|
18
|
-
"__SPlotA11yModule": "
|
|
18
|
+
"__SPlotA11yModule": "___SPlotA11yModule_5qb0j_gg_"
|
|
19
19
|
})
|
|
20
20
|
);
|
|
21
21
|
function PlotA11yModule(props) {
|
|
@@ -13,12 +13,12 @@ const styles = (
|
|
|
13
13
|
/*__reshadow_css_start__*/
|
|
14
14
|
(sstyled.insert(
|
|
15
15
|
/*__inner_css_start__*/
|
|
16
|
-
".
|
|
16
|
+
".___SPlotA11yView_25i2q_gg_{position:relative;display:block;background-color:var(--intergalactic-bg-primary-neutral,oklch(1 0 0));color:var(--intergalactic-text-primary,oklch(.1 .03 137/.899));border:3px solid var(--intergalactic-border-primary,#000c0829);font-size:var(--intergalactic-fs-50,10px);z-index:var(--intergalactic-z-index-overlay,500);padding:2px;width:200px;height:200px;max-width:80%;max-height:80%;overflow:auto}@media (color-gamut:p3){.___SPlotA11yView_25i2q_gg_{border:3px solid var(--intergalactic-border-primary,oklch(.137 .026 175.7/.161))}}.___SPlotA11yView_25i2q_gg_ a{cursor:pointer;-webkit-text-decoration:underline;text-decoration:underline;margin-bottom:var(--intergalactic-spacing-2x,8px);display:block}.___SPlotA11yView_25i2q_gg_ :is(table,td,th){border:1px solid var(--intergalactic-border-primary,#000c0829)}@media (color-gamut:p3){.___SPlotA11yView_25i2q_gg_ :is(table,td,th){border:1px solid var(--intergalactic-border-primary,oklch(.137 .026 175.7/.161))}}",
|
|
17
17
|
/*__inner_css_end__*/
|
|
18
|
-
"
|
|
18
|
+
"25i2q_gg_"
|
|
19
19
|
), /*__reshadow_css_end__*/
|
|
20
20
|
{
|
|
21
|
-
"__SPlotA11yView": "
|
|
21
|
+
"__SPlotA11yView": "___SPlotA11yView_25i2q_gg_"
|
|
22
22
|
})
|
|
23
23
|
);
|
|
24
24
|
function PlotA11yView({
|
|
@@ -7,6 +7,9 @@ import { callAllEventHandlers } from "@semcore/core/lib/utils/assignProps";
|
|
|
7
7
|
import canUseDOM from "@semcore/core/lib/utils/canUseDOM";
|
|
8
8
|
import cssToIntDefault from "@semcore/core/lib/utils/cssToIntDefault";
|
|
9
9
|
import trottle from "@semcore/core/lib/utils/rafTrottle";
|
|
10
|
+
import Divider from "@semcore/divider";
|
|
11
|
+
import DiffDown from "@semcore/icon/DiffDown/m";
|
|
12
|
+
import DiffUp from "@semcore/icon/DiffUp/m";
|
|
10
13
|
import { Text } from "@semcore/typography";
|
|
11
14
|
import React, { Fragment } from "react";
|
|
12
15
|
import "../../index.mjs";
|
|
@@ -22,15 +25,21 @@ const style = (
|
|
|
22
25
|
/*__reshadow_css_start__*/
|
|
23
26
|
(sstyled.insert(
|
|
24
27
|
/*__inner_css_start__*/
|
|
25
|
-
".
|
|
28
|
+
".___SChart_1vcn7_gg_{width:100%;height:100%;min-width:0;min-height:0}.___STooltipChildrenWrapper_1vcn7_gg_{display:grid;grid-gap:var(--intergalactic-spacing-content-gap-large,8px);gap:var(--intergalactic-spacing-content-gap-large,8px);align-items:center}.___STooltipChildrenWrapper_1vcn7_gg_._columnsCount_2_1vcn7_gg_{grid-template-columns:auto minmax(28px,max-content)}.___STooltipChildrenWrapper_1vcn7_gg_._columnsCount_2_1vcn7_gg_ .___STooltipDivider_1vcn7_gg_{grid-column:span 2}.___STooltipChildrenWrapper_1vcn7_gg_._columnsCount_3_1vcn7_gg_{grid-template-columns:auto minmax(28px,max-content) minmax(28px,max-content)}.___STooltipChildrenWrapper_1vcn7_gg_._columnsCount_3_1vcn7_gg_ .___STooltipDivider_1vcn7_gg_{grid-column:span 3}.___STooltipDeltaWrapper_1vcn7_gg_{gap:var(--intergalactic-spacing-content-gap-xsmall,2px);justify-content:flex-end}.___STooltipDeltaWrapper_1vcn7_gg_._trend_upward_1vcn7_gg_{color:var(--intergalactic-chart-data-success,oklch(.82 .19 143))}.___STooltipDeltaWrapper_1vcn7_gg_._trend_downward_1vcn7_gg_{color:var(--intergalactic-chart-data-critical,#ff7d7d)}@media (color-gamut:p3){.___STooltipDeltaWrapper_1vcn7_gg_._trend_downward_1vcn7_gg_{color:var(--intergalactic-chart-data-critical,oklch(.74 .19 22))}}.___STooltipDeltaWrapper_1vcn7_gg_._trend_stable_1vcn7_gg_{color:var(--intergalactic-text-secondary-invert,oklch(.997 .004 165.9/.684))}.___STooltipDeltaWrapper_1vcn7_gg_ .___STooltipDeltaIcon_1vcn7_gg_{align-self:center}",
|
|
26
29
|
/*__inner_css_end__*/
|
|
27
|
-
"
|
|
30
|
+
"1vcn7_gg_"
|
|
28
31
|
), /*__reshadow_css_end__*/
|
|
29
32
|
{
|
|
30
|
-
"__SChart": "
|
|
31
|
-
"__STooltipChildrenWrapper": "
|
|
32
|
-
"_columnsCount_2": "
|
|
33
|
-
"
|
|
33
|
+
"__SChart": "___SChart_1vcn7_gg_",
|
|
34
|
+
"__STooltipChildrenWrapper": "___STooltipChildrenWrapper_1vcn7_gg_",
|
|
35
|
+
"_columnsCount_2": "_columnsCount_2_1vcn7_gg_",
|
|
36
|
+
"__STooltipDivider": "___STooltipDivider_1vcn7_gg_",
|
|
37
|
+
"_columnsCount_3": "_columnsCount_3_1vcn7_gg_",
|
|
38
|
+
"__STooltipDeltaWrapper": "___STooltipDeltaWrapper_1vcn7_gg_",
|
|
39
|
+
"_trend_upward": "_trend_upward_1vcn7_gg_",
|
|
40
|
+
"_trend_downward": "_trend_downward_1vcn7_gg_",
|
|
41
|
+
"_trend_stable": "_trend_stable_1vcn7_gg_",
|
|
42
|
+
"__STooltipDeltaIcon": "___STooltipDeltaIcon_1vcn7_gg_"
|
|
34
43
|
})
|
|
35
44
|
);
|
|
36
45
|
const NOT_A_VALUE = "n/a";
|
|
@@ -46,7 +55,7 @@ class AbstractChart extends Component {
|
|
|
46
55
|
if (canUseDOM() && (!props.plotWidth || !props.plotHeight)) {
|
|
47
56
|
this.observer = new ResizeObserver(this.handleResize);
|
|
48
57
|
}
|
|
49
|
-
this.
|
|
58
|
+
this.setHighlightedItem = this.setHighlightedItem.bind(this);
|
|
50
59
|
this.handleChangeVisible = this.handleChangeVisible.bind(this);
|
|
51
60
|
this.handleMouseEnter = this.handleMouseEnter.bind(this);
|
|
52
61
|
this.handleMouseLeave = this.handleMouseLeave.bind(this);
|
|
@@ -55,7 +64,7 @@ class AbstractChart extends Component {
|
|
|
55
64
|
this.handleWithTrendChange = this.handleWithTrendChange.bind(this);
|
|
56
65
|
this.state = {
|
|
57
66
|
dataDefinitions: this.getDefaultDataDefinitions(),
|
|
58
|
-
|
|
67
|
+
highlightedItem: -1,
|
|
59
68
|
withTrend: false,
|
|
60
69
|
plotWidth: 0,
|
|
61
70
|
plotHeight: 0
|
|
@@ -268,9 +277,9 @@ class AbstractChart extends Component {
|
|
|
268
277
|
const valueScale = 100 / 10 ** count;
|
|
269
278
|
return valueScale;
|
|
270
279
|
}
|
|
271
|
-
|
|
280
|
+
setHighlightedItem(index) {
|
|
272
281
|
this.setState({
|
|
273
|
-
|
|
282
|
+
highlightedItem: index
|
|
274
283
|
});
|
|
275
284
|
}
|
|
276
285
|
handleChangeVisible(id, isVisible) {
|
|
@@ -292,21 +301,18 @@ class AbstractChart extends Component {
|
|
|
292
301
|
});
|
|
293
302
|
}
|
|
294
303
|
handleMouseEnter(id) {
|
|
295
|
-
this.
|
|
304
|
+
this.setHighlightedItem(this.state.dataDefinitions.findIndex((line) => line.id === id));
|
|
296
305
|
}
|
|
297
306
|
handleMouseLeave() {
|
|
298
|
-
this.
|
|
307
|
+
this.setHighlightedItem(-1);
|
|
299
308
|
}
|
|
300
309
|
resolveColor(id, index) {
|
|
301
310
|
return this.props.colorMap?.[id] ?? `chart-palette-order-${index + 1}`;
|
|
302
311
|
}
|
|
303
|
-
|
|
312
|
+
defaultTooltipFormatter(value) {
|
|
304
313
|
const {
|
|
305
|
-
|
|
314
|
+
locale
|
|
306
315
|
} = this.asProps;
|
|
307
|
-
if (tooltipValueFormatter) {
|
|
308
|
-
return tooltipValueFormatter(value);
|
|
309
|
-
}
|
|
310
316
|
if (value === void 0 || value === interpolateValue) {
|
|
311
317
|
return NOT_A_VALUE;
|
|
312
318
|
}
|
|
@@ -314,10 +320,36 @@ class AbstractChart extends Component {
|
|
|
314
320
|
return "0";
|
|
315
321
|
}
|
|
316
322
|
if (value instanceof Date) {
|
|
317
|
-
return
|
|
323
|
+
return new Intl.DateTimeFormat(locale, {
|
|
324
|
+
weekday: "long",
|
|
325
|
+
month: "long",
|
|
326
|
+
day: "numeric",
|
|
327
|
+
year: "numeric"
|
|
328
|
+
}).format(value);
|
|
329
|
+
}
|
|
330
|
+
if (typeof value === "number" && !Number.isNaN(value)) {
|
|
331
|
+
return new Intl.NumberFormat(locale, {
|
|
332
|
+
minimumFractionDigits: Number.isInteger(value) ? 0 : 1,
|
|
333
|
+
maximumFractionDigits: Number.isInteger(value) ? 0 : 1,
|
|
334
|
+
roundingMode: "halfExpand"
|
|
335
|
+
}).format(value);
|
|
318
336
|
}
|
|
319
337
|
return value.toString();
|
|
320
338
|
}
|
|
339
|
+
tooltipValueFormatter(value) {
|
|
340
|
+
const {
|
|
341
|
+
tooltipValueFormatter
|
|
342
|
+
} = this.asProps;
|
|
343
|
+
if (tooltipValueFormatter) return tooltipValueFormatter(value);
|
|
344
|
+
return this.defaultTooltipFormatter(value);
|
|
345
|
+
}
|
|
346
|
+
tooltipTitleFormatter(value) {
|
|
347
|
+
const {
|
|
348
|
+
tooltipTitleFormatter
|
|
349
|
+
} = this.asProps;
|
|
350
|
+
if (tooltipTitleFormatter) return tooltipTitleFormatter(value);
|
|
351
|
+
return this.defaultTooltipFormatter(value);
|
|
352
|
+
}
|
|
321
353
|
defaultLegendProps() {
|
|
322
354
|
return {
|
|
323
355
|
legendType: "Flex"
|
|
@@ -338,13 +370,15 @@ class AbstractChart extends Component {
|
|
|
338
370
|
}
|
|
339
371
|
const {
|
|
340
372
|
dataDefinitions,
|
|
341
|
-
withTrend
|
|
373
|
+
withTrend,
|
|
374
|
+
highlightedItem
|
|
342
375
|
} = this.state;
|
|
343
376
|
const lProps = {
|
|
344
377
|
...this.defaultLegendProps(),
|
|
345
378
|
...legendProps
|
|
346
379
|
};
|
|
347
380
|
const commonLegendProps = {
|
|
381
|
+
highlightedItem,
|
|
348
382
|
"dataHints": this.dataHints,
|
|
349
383
|
"items": dataDefinitions,
|
|
350
384
|
"size": lProps.size,
|
|
@@ -421,59 +455,119 @@ class AbstractChart extends Component {
|
|
|
421
455
|
ticks: xTicks
|
|
422
456
|
}) : /* @__PURE__ */ React.createElement(XAxis.Grid, null))));
|
|
423
457
|
}
|
|
458
|
+
getPercentDelta(key, index, data) {
|
|
459
|
+
const {
|
|
460
|
+
getPercentDelta: customGetPercenDelta
|
|
461
|
+
} = this.asProps;
|
|
462
|
+
if (customGetPercenDelta) {
|
|
463
|
+
const customDelta = customGetPercenDelta(key, index, data);
|
|
464
|
+
if (customDelta === null) return null;
|
|
465
|
+
return customDelta;
|
|
466
|
+
}
|
|
467
|
+
if (index === 0) return null;
|
|
468
|
+
if (!Array.isArray(data)) return null;
|
|
469
|
+
const prev = data[index - 1][key];
|
|
470
|
+
const curr = data[index][key];
|
|
471
|
+
if (typeof prev !== "number" || typeof curr !== "number") return null;
|
|
472
|
+
if (prev === 0) return curr === 0 ? 0 : null;
|
|
473
|
+
return (curr - prev) / Math.abs(prev) * 100;
|
|
474
|
+
}
|
|
424
475
|
getTooltipChildren(options) {
|
|
425
|
-
var
|
|
476
|
+
var _ref2;
|
|
426
477
|
const STooltipChildrenWrapper = Box;
|
|
427
478
|
const {
|
|
428
479
|
Tooltip,
|
|
429
|
-
dataItem
|
|
480
|
+
dataItem,
|
|
481
|
+
index
|
|
430
482
|
} = options;
|
|
431
483
|
const {
|
|
432
484
|
styles,
|
|
433
|
-
groupKey
|
|
485
|
+
groupKey,
|
|
486
|
+
showDeltaPercentInTooltip,
|
|
487
|
+
data
|
|
434
488
|
} = this.asProps;
|
|
435
489
|
const {
|
|
436
490
|
dataDefinitions
|
|
437
491
|
} = this.state;
|
|
438
|
-
const title = dataItem[groupKey]
|
|
439
|
-
|
|
492
|
+
const title = this.tooltipTitleFormatter(dataItem[groupKey]);
|
|
493
|
+
const percentDeltas = showDeltaPercentInTooltip ? dataDefinitions.map(({
|
|
494
|
+
id
|
|
495
|
+
}) => this.getPercentDelta(id, index, data)) : [];
|
|
496
|
+
const hasPercentDeltas = percentDeltas.length > 0 && percentDeltas.some((value) => value !== null);
|
|
497
|
+
const columnsCount = hasPercentDeltas ? 3 : 2;
|
|
498
|
+
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(Flex, _ref2.cn("Flex", {
|
|
440
499
|
"direction": "column"
|
|
441
|
-
}), title && /* @__PURE__ */ React.createElement(Tooltip.Title, null, title), /* @__PURE__ */ React.createElement(
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
"
|
|
445
|
-
},
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
500
|
+
}), title && /* @__PURE__ */ React.createElement(Tooltip.Title, null, title), /* @__PURE__ */ React.createElement(
|
|
501
|
+
STooltipChildrenWrapper,
|
|
502
|
+
_ref2.cn("STooltipChildrenWrapper", {
|
|
503
|
+
"columnsCount": columnsCount
|
|
504
|
+
}),
|
|
505
|
+
dataDefinitions.map((item, idx) => {
|
|
506
|
+
const delta = percentDeltas[idx] ?? null;
|
|
507
|
+
return item.checked && /* @__PURE__ */ React.createElement(Fragment, {
|
|
508
|
+
key: item.id
|
|
509
|
+
}, /* @__PURE__ */ React.createElement(Tooltip.Dot, {
|
|
510
|
+
mr: 2,
|
|
511
|
+
color: item.color
|
|
512
|
+
}, item.label), /* @__PURE__ */ React.createElement(Text, {
|
|
513
|
+
textAlign: "end",
|
|
514
|
+
bold: true
|
|
515
|
+
}, this.tooltipValueFormatter(dataItem[item.id])), hasPercentDeltas && this.renderTooltipPercentDelta(delta));
|
|
516
|
+
}),
|
|
517
|
+
this.renderTooltipTotalLine(dataItem)
|
|
518
|
+
));
|
|
519
|
+
}
|
|
520
|
+
getTooltipPercentDeltaTrend(delta) {
|
|
521
|
+
if (delta === null) return "unknown";
|
|
522
|
+
if (delta > 0) return "upward";
|
|
523
|
+
if (delta < 0) return "downward";
|
|
524
|
+
return "stable";
|
|
525
|
+
}
|
|
526
|
+
renderTooltipPercentDelta(delta) {
|
|
527
|
+
var _ref3;
|
|
528
|
+
const {
|
|
529
|
+
styles
|
|
530
|
+
} = this.asProps;
|
|
531
|
+
const trend = this.getTooltipPercentDeltaTrend(delta);
|
|
532
|
+
const STooltipDeltaWrapper = Flex;
|
|
533
|
+
const STooltipDeltaIcon = trend === "upward" ? DiffUp : DiffDown;
|
|
534
|
+
const displayedDelta = delta !== null ? this.defaultTooltipFormatter(Math.abs(delta)) : null;
|
|
535
|
+
return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(
|
|
536
|
+
STooltipDeltaWrapper,
|
|
537
|
+
_ref3.cn("STooltipDeltaWrapper", {
|
|
538
|
+
"trend": trend
|
|
539
|
+
}),
|
|
540
|
+
(trend === "upward" || trend === "downward") && /* @__PURE__ */ React.createElement(STooltipDeltaIcon, _ref3.cn("STooltipDeltaIcon", {
|
|
541
|
+
"width": 8.5,
|
|
542
|
+
"height": 8.5
|
|
543
|
+
})),
|
|
544
|
+
trend !== "unknown" && displayedDelta && /* @__PURE__ */ React.createElement(Text, _ref3.cn("Text", {
|
|
545
|
+
"size": 100
|
|
546
|
+
}), displayedDelta, "%")
|
|
547
|
+
);
|
|
457
548
|
}
|
|
458
549
|
renderTooltipTotalLine(dataItem) {
|
|
550
|
+
var _ref4;
|
|
459
551
|
const {
|
|
460
|
-
showTotalInTooltip
|
|
552
|
+
showTotalInTooltip,
|
|
553
|
+
styles
|
|
461
554
|
} = this.asProps;
|
|
462
555
|
if (!showTotalInTooltip) {
|
|
463
556
|
return null;
|
|
464
557
|
}
|
|
558
|
+
const STooltipDivider = Divider;
|
|
465
559
|
const total = this.totalValue(dataItem);
|
|
466
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
textAlign: "end",
|
|
472
|
-
bold: true
|
|
473
|
-
}, Number.isNaN(total) ? NOT_A_VALUE : total));
|
|
560
|
+
return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(STooltipDivider, _ref4.cn("STooltipDivider", {
|
|
561
|
+
"theme": "invert"
|
|
562
|
+
})), /* @__PURE__ */ React.createElement(Box, _ref4.cn("Box", {
|
|
563
|
+
"mr": 2
|
|
564
|
+
}), "Total"), /* @__PURE__ */ React.createElement(Text, _ref4.cn("Text", {
|
|
565
|
+
"textAlign": "end",
|
|
566
|
+
"bold": true
|
|
567
|
+
}), Number.isNaN(total) ? NOT_A_VALUE : this.tooltipValueFormatter(total)));
|
|
474
568
|
}
|
|
475
569
|
render() {
|
|
476
|
-
var
|
|
570
|
+
var _ref = this.asProps, _ref5;
|
|
477
571
|
const SChart = Flex;
|
|
478
572
|
const {
|
|
479
573
|
styles,
|
|
@@ -482,7 +576,8 @@ class AbstractChart extends Component {
|
|
|
482
576
|
a11yAltTextConfig,
|
|
483
577
|
duration,
|
|
484
578
|
eventEmitter,
|
|
485
|
-
showTooltip
|
|
579
|
+
showTooltip,
|
|
580
|
+
locale
|
|
486
581
|
} = this.asProps;
|
|
487
582
|
const {
|
|
488
583
|
plotWidth,
|
|
@@ -491,14 +586,14 @@ class AbstractChart extends Component {
|
|
|
491
586
|
const {
|
|
492
587
|
extractedAriaProps
|
|
493
588
|
} = extractAriaProps(this.asProps);
|
|
494
|
-
return
|
|
589
|
+
return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SChart, _ref5.cn("SChart", {
|
|
495
590
|
...assignProps({
|
|
496
591
|
"gap": 5,
|
|
497
592
|
"__excludeProps": ["data", "eventEmitter"],
|
|
498
593
|
"role": "group",
|
|
499
594
|
"ref": this.chartRef
|
|
500
|
-
},
|
|
501
|
-
}), this.renderLegend(), /* @__PURE__ */ React.createElement(Plot,
|
|
595
|
+
}, _ref)
|
|
596
|
+
}), this.renderLegend(), /* @__PURE__ */ React.createElement(Plot, _ref5.cn("Plot", {
|
|
502
597
|
"data": data,
|
|
503
598
|
"scale": [this.xScale, this.yScale],
|
|
504
599
|
"width": plotWidth,
|
|
@@ -508,6 +603,7 @@ class AbstractChart extends Component {
|
|
|
508
603
|
"patterns": patterns,
|
|
509
604
|
"duration": duration,
|
|
510
605
|
"eventEmitter": eventEmitter,
|
|
606
|
+
"locale": locale,
|
|
511
607
|
...extractedAriaProps
|
|
512
608
|
}), this.renderAxis(), !showTooltip ? null : this.renderTooltip(), this.renderChart()));
|
|
513
609
|
}
|
|
@@ -35,7 +35,7 @@ class AreaChartComponent extends AbstractChart {
|
|
|
35
35
|
get yScale() {
|
|
36
36
|
const {
|
|
37
37
|
yScale,
|
|
38
|
-
marginX =
|
|
38
|
+
marginX = 32,
|
|
39
39
|
stacked
|
|
40
40
|
} = this.asProps;
|
|
41
41
|
const {
|
|
@@ -59,7 +59,7 @@ class AreaChartComponent extends AbstractChart {
|
|
|
59
59
|
} = this.asProps;
|
|
60
60
|
const {
|
|
61
61
|
dataDefinitions,
|
|
62
|
-
|
|
62
|
+
highlightedItem
|
|
63
63
|
} = this.state;
|
|
64
64
|
if (stacked) {
|
|
65
65
|
return /* @__PURE__ */ React.createElement(StackedArea, {
|
|
@@ -70,11 +70,11 @@ class AreaChartComponent extends AbstractChart {
|
|
|
70
70
|
y: item.id,
|
|
71
71
|
key: item.id,
|
|
72
72
|
color: item.color,
|
|
73
|
-
transparent:
|
|
73
|
+
transparent: highlightedItem !== -1 && highlightedItem !== index,
|
|
74
74
|
curve,
|
|
75
75
|
onClick: onClickArea
|
|
76
|
-
},
|
|
77
|
-
display:
|
|
76
|
+
}, /* @__PURE__ */ React.createElement(StackedArea.Area.Dots, {
|
|
77
|
+
display: showDots
|
|
78
78
|
}));
|
|
79
79
|
}));
|
|
80
80
|
}
|
|
@@ -84,11 +84,11 @@ class AreaChartComponent extends AbstractChart {
|
|
|
84
84
|
y: item.id,
|
|
85
85
|
key: item.id,
|
|
86
86
|
color: item.color,
|
|
87
|
-
transparent:
|
|
87
|
+
transparent: highlightedItem !== -1 && highlightedItem !== index,
|
|
88
88
|
curve,
|
|
89
89
|
onClick: onClickArea
|
|
90
|
-
},
|
|
91
|
-
display:
|
|
90
|
+
}, /* @__PURE__ */ React.createElement(Area.Dots, {
|
|
91
|
+
display: showDots
|
|
92
92
|
}));
|
|
93
93
|
});
|
|
94
94
|
}
|
|
@@ -107,7 +107,8 @@ class AreaChartComponent extends AbstractChart {
|
|
|
107
107
|
return {
|
|
108
108
|
children: this.getTooltipChildren({
|
|
109
109
|
Tooltip: HoverLine.Tooltip,
|
|
110
|
-
dataItem
|
|
110
|
+
dataItem,
|
|
111
|
+
index: xIndex
|
|
111
112
|
})
|
|
112
113
|
};
|
|
113
114
|
});
|
|
@@ -124,7 +125,8 @@ _defineProperty(AreaChartComponent, "defaultProps", {
|
|
|
124
125
|
direction: "column",
|
|
125
126
|
showXAxis: true,
|
|
126
127
|
showYAxis: true,
|
|
127
|
-
showTooltip: true
|
|
128
|
+
showTooltip: true,
|
|
129
|
+
locale: "en"
|
|
128
130
|
});
|
|
129
131
|
const AreaChart = createComponent(AreaChartComponent);
|
|
130
132
|
export {
|
|
@@ -89,7 +89,7 @@ class BarChartComponent extends AbstractChart {
|
|
|
89
89
|
} = this.asProps;
|
|
90
90
|
const {
|
|
91
91
|
dataDefinitions,
|
|
92
|
-
|
|
92
|
+
highlightedItem
|
|
93
93
|
} = this.state;
|
|
94
94
|
if (dataDefinitions.length === 1) {
|
|
95
95
|
const item = dataDefinitions[0];
|
|
@@ -110,7 +110,7 @@ class BarChartComponent extends AbstractChart {
|
|
|
110
110
|
const BarComponent = invertAxis ? GroupBar.HorizontalBar : GroupBar.Bar;
|
|
111
111
|
const commonBarComponentProps = {
|
|
112
112
|
color: item.color,
|
|
113
|
-
transparent:
|
|
113
|
+
transparent: highlightedItem !== -1 && highlightedItem !== index,
|
|
114
114
|
onClick: this.handleClickBar
|
|
115
115
|
};
|
|
116
116
|
if (invertAxis) {
|
|
@@ -131,7 +131,7 @@ class BarChartComponent extends AbstractChart {
|
|
|
131
131
|
const BarComponent = invertAxis ? StackBar.HorizontalBar : StackBar.Bar;
|
|
132
132
|
const commonBarComponentProps = {
|
|
133
133
|
color: item.color,
|
|
134
|
-
transparent:
|
|
134
|
+
transparent: highlightedItem !== -1 && highlightedItem !== index,
|
|
135
135
|
onClick: this.handleClickBar
|
|
136
136
|
};
|
|
137
137
|
if (invertAxis) {
|
|
@@ -167,7 +167,8 @@ class BarChartComponent extends AbstractChart {
|
|
|
167
167
|
return {
|
|
168
168
|
children: this.getTooltipChildren({
|
|
169
169
|
Tooltip: HoverRect.Tooltip,
|
|
170
|
-
dataItem
|
|
170
|
+
dataItem,
|
|
171
|
+
index
|
|
171
172
|
})
|
|
172
173
|
};
|
|
173
174
|
});
|
|
@@ -224,7 +225,7 @@ class BarChartComponent extends AbstractChart {
|
|
|
224
225
|
get categoryScale() {
|
|
225
226
|
const {
|
|
226
227
|
marginY = 40,
|
|
227
|
-
marginX =
|
|
228
|
+
marginX = 32,
|
|
228
229
|
invertAxis,
|
|
229
230
|
data,
|
|
230
231
|
groupKey
|
|
@@ -245,7 +246,7 @@ class BarChartComponent extends AbstractChart {
|
|
|
245
246
|
get valueScale() {
|
|
246
247
|
const {
|
|
247
248
|
marginY = 40,
|
|
248
|
-
marginX =
|
|
249
|
+
marginX = 32,
|
|
249
250
|
invertAxis,
|
|
250
251
|
type
|
|
251
252
|
} = this.asProps;
|
|
@@ -263,7 +264,8 @@ _defineProperty(BarChartComponent, "defaultProps", {
|
|
|
263
264
|
direction: "column",
|
|
264
265
|
showXAxis: true,
|
|
265
266
|
showYAxis: true,
|
|
266
|
-
showTooltip: true
|
|
267
|
+
showTooltip: true,
|
|
268
|
+
locale: "en"
|
|
267
269
|
});
|
|
268
270
|
const BarChart = createComponent(BarChartComponent);
|
|
269
271
|
export {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import {
|
|
2
|
+
import { Box, Flex } from "@semcore/base-components";
|
|
3
|
+
import { sstyled, createComponent } from "@semcore/core";
|
|
3
4
|
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
4
5
|
import { Text } from "@semcore/typography";
|
|
5
6
|
import { scaleLinear } from "d3-scale";
|
|
@@ -110,14 +111,32 @@ class BubbleChartComponent extends AbstractChart {
|
|
|
110
111
|
index,
|
|
111
112
|
data
|
|
112
113
|
}) => {
|
|
114
|
+
var _ref;
|
|
115
|
+
const {
|
|
116
|
+
styles
|
|
117
|
+
} = this.asProps;
|
|
118
|
+
const STooltipChildrenWrapper = Box;
|
|
113
119
|
return {
|
|
114
|
-
children:
|
|
115
|
-
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
children: (_ref = sstyled(styles), /* @__PURE__ */ React.createElement(Flex, _ref.cn("Flex", {
|
|
121
|
+
"direction": "column"
|
|
122
|
+
}), /* @__PURE__ */ React.createElement(Bubble.Tooltip.Title, null, "Data"), /* @__PURE__ */ React.createElement(
|
|
123
|
+
STooltipChildrenWrapper,
|
|
124
|
+
_ref.cn("STooltipChildrenWrapper", {
|
|
125
|
+
"columnsCount": 2
|
|
126
|
+
}),
|
|
127
|
+
/* @__PURE__ */ React.createElement(Text, _ref.cn("Text", {}), "X axis"),
|
|
128
|
+
/* @__PURE__ */ React.createElement(Text, _ref.cn("Text", {
|
|
129
|
+
"textAlign": "end"
|
|
130
|
+
}), data[index].x),
|
|
131
|
+
/* @__PURE__ */ React.createElement(Text, _ref.cn("Text", {}), "Y axis"),
|
|
132
|
+
/* @__PURE__ */ React.createElement(Text, _ref.cn("Text", {
|
|
133
|
+
"textAlign": "end"
|
|
134
|
+
}), data[index].y),
|
|
135
|
+
/* @__PURE__ */ React.createElement(Text, _ref.cn("Text", {}), "Value"),
|
|
136
|
+
/* @__PURE__ */ React.createElement(Text, _ref.cn("Text", {
|
|
137
|
+
"textAlign": "end"
|
|
138
|
+
}), data[index].value)
|
|
139
|
+
)))
|
|
121
140
|
};
|
|
122
141
|
});
|
|
123
142
|
}
|
|
@@ -133,7 +152,8 @@ _defineProperty(BubbleChartComponent, "defaultProps", {
|
|
|
133
152
|
direction: "column",
|
|
134
153
|
showXAxis: true,
|
|
135
154
|
showYAxis: true,
|
|
136
|
-
showTooltip: true
|
|
155
|
+
showTooltip: true,
|
|
156
|
+
locale: "en"
|
|
137
157
|
});
|
|
138
158
|
const BubbleChart = createComponent(BubbleChartComponent);
|
|
139
159
|
export {
|