@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
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
@keyframes valueWidthAnimation {
|
|
2
|
+
0% {
|
|
3
|
+
width: 0;
|
|
4
|
+
}
|
|
5
|
+
100% {
|
|
6
|
+
width: calc(1% * var(--global-target-width));
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
@keyframes bgWidthAnimation {
|
|
10
|
+
0% {
|
|
11
|
+
width: 100%;
|
|
12
|
+
}
|
|
13
|
+
100% {
|
|
14
|
+
width: calc(1% * (100 - var(--global-target-width)));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
SChart {
|
|
19
|
+
display: grid;
|
|
20
|
+
grid-template-columns: 1fr max-content max-content;
|
|
21
|
+
column-gap: var(--intergalactic-spacing-4x, 16px);
|
|
22
|
+
row-gap: var(--intergalactic-spacing-4x, 16px);
|
|
23
|
+
width: 100%;
|
|
24
|
+
padding: var(--intergalactic-spacing-2x, 8px);
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
|
|
27
|
+
&[mode='compact'] {
|
|
28
|
+
grid-template-columns: max-content 1fr max-content max-content;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
SItem {
|
|
33
|
+
display: contents;
|
|
34
|
+
|
|
35
|
+
SContainer {
|
|
36
|
+
all: unset;
|
|
37
|
+
grid-column: 1 / -1;
|
|
38
|
+
display: grid;
|
|
39
|
+
grid-template-columns: subgrid;
|
|
40
|
+
grid-template-rows: auto auto;
|
|
41
|
+
row-gap: var(--intergalactic-spacing-2x, 8px);
|
|
42
|
+
align-items: center;
|
|
43
|
+
position: relative;
|
|
44
|
+
color: var(--intergalactic-text-link-primary, oklch(0.23 0.009 245));
|
|
45
|
+
|
|
46
|
+
&[mode='compact'] {
|
|
47
|
+
grid-template-rows: auto;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&[tabIndex='0']::before {
|
|
51
|
+
content: '';
|
|
52
|
+
opacity: 0;
|
|
53
|
+
position: absolute;
|
|
54
|
+
inset: calc(-1 * var(--intergalactic-spacing-2x, 8px));
|
|
55
|
+
background-color: var(--intergalactic-chart-grid-bar-hover, oklch(0.375 0.09 242.7 / 0.05));
|
|
56
|
+
border-radius: var(--intergalactic-rounded-medium, 6px);
|
|
57
|
+
z-index: -1;
|
|
58
|
+
pointer-events: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&[tabIndex='0']:hover {
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
color: var(--intergalactic-text-link-primary-hover-active, oklch(0.23 0.009 245));
|
|
64
|
+
|
|
65
|
+
&::before {
|
|
66
|
+
opacity: 1;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
SCategory {
|
|
73
|
+
grid-area: 1;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
SPercent {
|
|
77
|
+
grid-column: -2 / -3;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
SValue, SValueLink {
|
|
81
|
+
grid-column: -1 / -2;
|
|
82
|
+
justify-self: end;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
SBar {
|
|
86
|
+
grid-column: 1 / -1;
|
|
87
|
+
height: var(--intergalactic-spacing-3x, 12px);
|
|
88
|
+
overflow: hidden;
|
|
89
|
+
display: flex;
|
|
90
|
+
position: relative;
|
|
91
|
+
|
|
92
|
+
&[mode='compact'] {
|
|
93
|
+
grid-row: 1;
|
|
94
|
+
grid-column: 2;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&[duration] {
|
|
98
|
+
SBarValue, SBarBackground {
|
|
99
|
+
animation-duration: calc(var(--duration) * 1ms);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
SBarValue {
|
|
104
|
+
height: 100%;
|
|
105
|
+
border-radius: 2px;
|
|
106
|
+
animation-name: valueWidthAnimation;
|
|
107
|
+
animation-timing-function: ease-in-out;
|
|
108
|
+
animation-fill-mode: forwards;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
SBarValue[color] {
|
|
112
|
+
background-color: var(--color);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
SBarBackground {
|
|
116
|
+
height: 100%;
|
|
117
|
+
background-color: var(--intergalactic-chart-data-null, oklch(0.9 0.009 234));
|
|
118
|
+
background-image: repeating-linear-gradient(
|
|
119
|
+
154deg,
|
|
120
|
+
transparent 0 3px,
|
|
121
|
+
var(--intergalactic-chart-grid-bar-base-bg, oklch(0.92 0.008 233.5)) 3px 6px
|
|
122
|
+
);
|
|
123
|
+
border-radius: var(--intergalactic-chart-rounded, 2px);
|
|
124
|
+
margin-left: var(--intergalactic-spacing-05x, 2px);
|
|
125
|
+
|
|
126
|
+
animation-name: bgWidthAnimation;
|
|
127
|
+
animation-timing-function: ease-in-out;
|
|
128
|
+
animation-fill-mode: forwards;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { Flex } from "@semcore/base-components";
|
|
3
|
+
import { createComponent } from "@semcore/core";
|
|
4
|
+
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
5
|
+
import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
6
|
+
import { Text } from "@semcore/typography";
|
|
7
|
+
import { scaleLinear } from "d3-scale";
|
|
8
|
+
import React from "react";
|
|
9
|
+
import "../../index.mjs";
|
|
10
|
+
import { AbstractChart } from "./AbstractChart.mjs";
|
|
11
|
+
import { DefaultStrokePattern } from "../../Pattern.mjs";
|
|
12
|
+
import { localizedMessages } from "../../translations/__intergalactic-dynamic-locales.mjs";
|
|
13
|
+
import Donut from "../../Donut.mjs";
|
|
14
|
+
class ScoreDonutChartComponent extends AbstractChart {
|
|
15
|
+
getDefaultDataDefinitions() {
|
|
16
|
+
const {
|
|
17
|
+
data,
|
|
18
|
+
legendProps
|
|
19
|
+
} = this.props;
|
|
20
|
+
const legendData = legendProps?.legendMap?.value;
|
|
21
|
+
const dataDefinition = {
|
|
22
|
+
id: "value",
|
|
23
|
+
label: legendData?.label ?? "value",
|
|
24
|
+
icon: legendData?.icon ?? void 0,
|
|
25
|
+
checked: legendData?.defaultChecked ?? true,
|
|
26
|
+
color: this.resolveColor("value", 0)
|
|
27
|
+
};
|
|
28
|
+
if (legendData?.additionalInfo || legendData?.count) {
|
|
29
|
+
dataDefinition.additionalInfo = legendData.additionalInfo ? {
|
|
30
|
+
label: legendData.additionalInfo
|
|
31
|
+
} : legendData.count ? {
|
|
32
|
+
count: legendData.count
|
|
33
|
+
} : void 0;
|
|
34
|
+
}
|
|
35
|
+
if (legendData && "rows" in legendData && !("columns" in dataDefinition)) {
|
|
36
|
+
dataDefinition.rows = legendData.rows || [];
|
|
37
|
+
} else if (legendData && "columns" in legendData && !("rows" in dataDefinition)) {
|
|
38
|
+
dataDefinition.columns = legendData.columns || [];
|
|
39
|
+
} else if (!("rows" in dataDefinition)) {
|
|
40
|
+
const value = data.value;
|
|
41
|
+
const percent = value.toFixed(2);
|
|
42
|
+
dataDefinition.columns = [/* @__PURE__ */ React.createElement(Text, {
|
|
43
|
+
key: "percent",
|
|
44
|
+
use: "secondary"
|
|
45
|
+
}, percent !== void 0 ? `${percent}%` : ""), /* @__PURE__ */ React.createElement(Text, {
|
|
46
|
+
key: "value",
|
|
47
|
+
use: "primary"
|
|
48
|
+
}, value)];
|
|
49
|
+
}
|
|
50
|
+
return [dataDefinition];
|
|
51
|
+
}
|
|
52
|
+
get xScale() {
|
|
53
|
+
const {
|
|
54
|
+
xScale
|
|
55
|
+
} = this.asProps;
|
|
56
|
+
if (xScale) {
|
|
57
|
+
return xScale;
|
|
58
|
+
}
|
|
59
|
+
return scaleLinear();
|
|
60
|
+
}
|
|
61
|
+
get yScale() {
|
|
62
|
+
const {
|
|
63
|
+
yScale
|
|
64
|
+
} = this.asProps;
|
|
65
|
+
if (yScale) {
|
|
66
|
+
return yScale;
|
|
67
|
+
}
|
|
68
|
+
return scaleLinear();
|
|
69
|
+
}
|
|
70
|
+
defaultLegendProps() {
|
|
71
|
+
return {
|
|
72
|
+
legendType: "Table",
|
|
73
|
+
shape: "Circle"
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
renderChart() {
|
|
77
|
+
const {
|
|
78
|
+
innerRadius,
|
|
79
|
+
halfsize,
|
|
80
|
+
innerLabel,
|
|
81
|
+
onClickPie,
|
|
82
|
+
uid
|
|
83
|
+
} = this.asProps;
|
|
84
|
+
const {
|
|
85
|
+
dataDefinitions
|
|
86
|
+
} = this.state;
|
|
87
|
+
const checkedLegendItems = dataDefinitions.filter((item) => item.checked);
|
|
88
|
+
this.dataHintsHandlers.establishDataType("values-set");
|
|
89
|
+
this.dataHintsHandlers.describeValueEntity("", `${this.data.value}%`);
|
|
90
|
+
return /* @__PURE__ */ React.createElement(Donut, {
|
|
91
|
+
onClick: onClickPie,
|
|
92
|
+
halfsize,
|
|
93
|
+
innerRadius
|
|
94
|
+
}, checkedLegendItems.map((item, index) => {
|
|
95
|
+
return /* @__PURE__ */ React.createElement(Donut.Pie, {
|
|
96
|
+
key: item.id,
|
|
97
|
+
dataKey: item.id,
|
|
98
|
+
name: item.label,
|
|
99
|
+
color: item.color,
|
|
100
|
+
transparent: false,
|
|
101
|
+
dataHintsHandler: {
|
|
102
|
+
establishDataType: () => {
|
|
103
|
+
},
|
|
104
|
+
describeValueEntity: () => {
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}), /* @__PURE__ */ React.createElement(DefaultStrokePattern, {
|
|
109
|
+
id: `${uid}-mask`,
|
|
110
|
+
halfsize
|
|
111
|
+
}), /* @__PURE__ */ React.createElement(Donut.Pie, {
|
|
112
|
+
dataKey: "other",
|
|
113
|
+
color: "chart-data-null",
|
|
114
|
+
mask: `url(#${uid}-mask)`,
|
|
115
|
+
uid,
|
|
116
|
+
patterns: false,
|
|
117
|
+
transparent: false,
|
|
118
|
+
dataHintsHandler: {
|
|
119
|
+
establishDataType: () => {
|
|
120
|
+
},
|
|
121
|
+
describeValueEntity: () => {
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}), innerLabel && /* @__PURE__ */ React.createElement(Donut.Label, {
|
|
125
|
+
innerFlexHeight: this.plotHeight
|
|
126
|
+
}, /* @__PURE__ */ React.createElement(Text, {
|
|
127
|
+
size: 500,
|
|
128
|
+
semibold: true,
|
|
129
|
+
style: {
|
|
130
|
+
fontVariantNumeric: "lining-nums tabular-nums"
|
|
131
|
+
}
|
|
132
|
+
}, innerLabel[0]), /* @__PURE__ */ React.createElement(Text, {
|
|
133
|
+
size: 200,
|
|
134
|
+
use: "secondary"
|
|
135
|
+
}, innerLabel[1])));
|
|
136
|
+
}
|
|
137
|
+
renderTooltip() {
|
|
138
|
+
const {
|
|
139
|
+
data
|
|
140
|
+
} = this.asProps;
|
|
141
|
+
const {
|
|
142
|
+
dataDefinitions
|
|
143
|
+
} = this.state;
|
|
144
|
+
return /* @__PURE__ */ React.createElement(Donut.Tooltip, null, ({
|
|
145
|
+
dataKey
|
|
146
|
+
}) => {
|
|
147
|
+
const title = dataDefinitions.find((item) => item.id === dataKey);
|
|
148
|
+
if (!title) {
|
|
149
|
+
return {
|
|
150
|
+
visible: false
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
return {
|
|
154
|
+
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Donut.Tooltip.Title, null, this.tooltipTitleFormatter(title?.label || dataKey)), /* @__PURE__ */ React.createElement(Flex, {
|
|
155
|
+
justifyContent: "space-between"
|
|
156
|
+
}, /* @__PURE__ */ React.createElement(Text, {
|
|
157
|
+
bold: true
|
|
158
|
+
}, this.tooltipValueFormatter(data.value))))
|
|
159
|
+
};
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
get data() {
|
|
163
|
+
return {
|
|
164
|
+
value: this.asProps.data.value,
|
|
165
|
+
other: 100 - this.asProps.data.value
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
getLegendAriaLabel() {
|
|
169
|
+
return this.asProps.getI18nText("legendForChart", {
|
|
170
|
+
chartType: "ScoreDonut"
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
_defineProperty(ScoreDonutChartComponent, "displayName", "Chart.ScoreDonut");
|
|
175
|
+
_defineProperty(ScoreDonutChartComponent, "defaultProps", {
|
|
176
|
+
direction: "row-reverse",
|
|
177
|
+
alignItems: "flex-start",
|
|
178
|
+
marginX: 0,
|
|
179
|
+
marginY: 0,
|
|
180
|
+
locale: "en"
|
|
181
|
+
});
|
|
182
|
+
_defineProperty(ScoreDonutChartComponent, "enhance", [i18nEnhance(localizedMessages), uniqueIDEnhancement()]);
|
|
183
|
+
const ScoreDonutChart = createComponent(ScoreDonutChartComponent);
|
|
184
|
+
export {
|
|
185
|
+
ScoreDonutChart
|
|
186
|
+
};
|
|
@@ -9,6 +9,8 @@ import { HistogramChart } from "./HistogramChart.mjs";
|
|
|
9
9
|
import { LineChart } from "./LineChart.mjs";
|
|
10
10
|
import { RadarChart } from "./RadarChart.mjs";
|
|
11
11
|
import { ScatterPlotChart } from "./ScatterPlotChart.mjs";
|
|
12
|
+
import { ScoreBarChart } from "./ScoreBar/ScoreBarChart.mjs";
|
|
13
|
+
import { ScoreDonutChart } from "./ScoreDonutChart.mjs";
|
|
12
14
|
import { VennChart } from "./VennChart.mjs";
|
|
13
15
|
const index = {
|
|
14
16
|
Line: LineChart,
|
|
@@ -18,10 +20,15 @@ const index = {
|
|
|
18
20
|
Area: AreaChart,
|
|
19
21
|
Bubble: BubbleChart,
|
|
20
22
|
Donut: DonutChart,
|
|
23
|
+
ScoreDonut: ScoreDonutChart,
|
|
21
24
|
Venn: VennChart,
|
|
22
25
|
Radar: RadarChart,
|
|
23
26
|
Cigarette: CigaretteChart,
|
|
24
|
-
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated. Use ScoreBar instead.
|
|
29
|
+
*/
|
|
30
|
+
CompactHorizontalBar: CompactHorizontalBarChart,
|
|
31
|
+
ScoreBar: ScoreBarChart
|
|
25
32
|
};
|
|
26
33
|
export {
|
|
27
34
|
BAD,
|
|
@@ -13,17 +13,17 @@ const style = (
|
|
|
13
13
|
/*__reshadow_css_start__*/
|
|
14
14
|
(sstyled.insert(
|
|
15
15
|
/*__inner_css_start__*/
|
|
16
|
-
".
|
|
16
|
+
".___SLegendFlex_pyiji_gg_._direction_row_pyiji_gg_{align-items:flex-start;align-content:flex-start;flex-wrap:wrap;gap:var(--intergalactic-spacing-2x,8px) var(--intergalactic-spacing-4x,16px)}.___SLegendFlex_pyiji_gg_._direction_column_pyiji_gg_{align-items:flex-start;flex-wrap:wrap;gap:var(--intergalactic-spacing-2x,8px)}.___STrend_pyiji_gg_._size_m_pyiji_gg_>span:first-of-type{width:var(--intergalactic-spacing-4x,16px);height:var(--intergalactic-spacing-4x,16px);margin-top:var(--intergalactic-spacing-05x,2px)}.___STrend_pyiji_gg_._size_l_pyiji_gg_>span:first-of-type{width:var(--intergalactic-spacing-5x,20px);height:var(--intergalactic-spacing-5x,20px);margin-top:var(--intergalactic-spacing-05x,2px)}",
|
|
17
17
|
/*__inner_css_end__*/
|
|
18
|
-
"
|
|
18
|
+
"pyiji_gg_"
|
|
19
19
|
), /*__reshadow_css_end__*/
|
|
20
20
|
{
|
|
21
|
-
"__SLegendFlex": "
|
|
22
|
-
"_direction_row": "
|
|
23
|
-
"_direction_column": "
|
|
24
|
-
"__STrend": "
|
|
25
|
-
"_size_m": "
|
|
26
|
-
"_size_l": "
|
|
21
|
+
"__SLegendFlex": "___SLegendFlex_pyiji_gg_",
|
|
22
|
+
"_direction_row": "_direction_row_pyiji_gg_",
|
|
23
|
+
"_direction_column": "_direction_column_pyiji_gg_",
|
|
24
|
+
"__STrend": "___STrend_pyiji_gg_",
|
|
25
|
+
"_size_m": "_size_m_pyiji_gg_",
|
|
26
|
+
"_size_l": "_size_l_pyiji_gg_"
|
|
27
27
|
})
|
|
28
28
|
);
|
|
29
29
|
class LegendFlexRoot extends BaseLegend {
|
|
@@ -14,27 +14,26 @@ const style = (
|
|
|
14
14
|
/*__reshadow_css_start__*/
|
|
15
15
|
(sstyled.insert(
|
|
16
16
|
/*__inner_css_start__*/
|
|
17
|
-
'.
|
|
17
|
+
'.___SLegendItem_jr0os_gg_{min-width:0;align-items:flex-start}@media (hover:hover){.___SLegendItem_jr0os_gg_:hover{cursor:pointer}.___SLegendItem_jr0os_gg_.__disabled_jr0os_gg_:hover{cursor:default}}.___SLegendItem_jr0os_gg_.__transparent_jr0os_gg_{opacity:.3}.___SCheckbox_jr0os_gg_._size_m_jr0os_gg_>span:first-of-type{width:var(--intergalactic-spacing-4x,16px);height:var(--intergalactic-spacing-4x,16px);margin-top:var(--intergalactic-spacing-05x,2px)}.___SCheckbox_jr0os_gg_._size_l_jr0os_gg_>span:first-of-type{width:var(--intergalactic-spacing-5x,20px);height:var(--intergalactic-spacing-5x,20px);margin-top:var(--intergalactic-spacing-05x,2px)}.___SPointShape_jr0os_gg_.__color_jr0os_gg_{background-color:var(--color_jr0os);margin-right:var(--intergalactic-spacing-1-5x,6px);flex-shrink:0}.___SPointShape_jr0os_gg_._shape_Circle_jr0os_gg_._size_l_jr0os_gg_{width:16px;height:16px;border-radius:8px;margin-top:var(--intergalactic-spacing-1x,4px)}.___SPointShape_jr0os_gg_._shape_Circle_jr0os_gg_._size_m_jr0os_gg_{width:12px;height:12px;border-radius:6px;margin-top:var(--intergalactic-spacing-1x,4px)}.___SPointShape_jr0os_gg_._shape_Pattern_jr0os_gg_{background-color:initial;margin-right:var(--intergalactic-spacing-1x,4px);margin-top:1px;margin-bottom:-1px}.___SPointShape_jr0os_gg_._shape_Pattern_jr0os_gg_._size_l_jr0os_gg_{margin-top:4px;margin-bottom:-4px}.___SIcon_jr0os_gg_{line-height:0;margin-right:var(--intergalactic-spacing-1x,4px)}.___SIcon_jr0os_gg_._size_l_jr0os_gg_{margin-top:var(--intergalactic-spacing-1x,4px)}.___SIcon_jr0os_gg_._size_m_jr0os_gg_{margin-top:var(--intergalactic-spacing-05x,2px)}.___SLabel_jr0os_gg_{min-width:0}.___SAdditionalLabel_jr0os_gg_._size_l_jr0os_gg_,.___SCount_jr0os_gg_._size_l_jr0os_gg_,.___SLabel_jr0os_gg_._size_l_jr0os_gg_{font-size:var(--intergalactic-fs-300,16px);line-height:var(--intergalactic-lh-300,1.5)}.___SAdditionalLabel_jr0os_gg_._size_m_jr0os_gg_,.___SCount_jr0os_gg_._size_m_jr0os_gg_,.___SLabel_jr0os_gg_._size_m_jr0os_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286)}.___SAdditionalLabel_jr0os_gg_,.___SCount_jr0os_gg_{margin-left:var(--intergalactic-spacing-1x,4px)}.___SAdditionalLabel_jr0os_gg_{white-space:nowrap;display:flex;align-items:flex-start}.___SAdditionalLabel_jr0os_gg_:before{content:"";display:inline-block;background-color:var(--intergalactic-text-secondary,oklch(.182 .045 244.8/.593));height:4px;width:4px;border-radius:2px;margin-right:var(--intergalactic-spacing-1x,4px)}.___SAdditionalLabel_jr0os_gg_._size_l_jr0os_gg_:before{margin-top:10px}.___SAdditionalLabel_jr0os_gg_._size_m_jr0os_gg_:before{margin-top:8px}',
|
|
18
18
|
/*__inner_css_end__*/
|
|
19
|
-
"
|
|
19
|
+
"jr0os_gg_"
|
|
20
20
|
), /*__reshadow_css_end__*/
|
|
21
21
|
{
|
|
22
|
-
"__SLegendItem": "
|
|
23
|
-
"_disabled": "
|
|
24
|
-
"_transparent": "
|
|
25
|
-
"__SCheckbox": "
|
|
26
|
-
"_size_m": "
|
|
27
|
-
"_size_l": "
|
|
28
|
-
"__SPointShape": "
|
|
29
|
-
"_color": "
|
|
30
|
-
"--color": "--
|
|
31
|
-
"_shape_Circle": "
|
|
32
|
-
"_shape_Pattern": "
|
|
33
|
-
"__SIcon": "
|
|
34
|
-
"__SLabel": "
|
|
35
|
-
"__SAdditionalLabel": "
|
|
36
|
-
"__SCount": "
|
|
37
|
-
"__SPatternSymbol": "___SPatternSymbol_1acwd_gg_"
|
|
22
|
+
"__SLegendItem": "___SLegendItem_jr0os_gg_",
|
|
23
|
+
"_disabled": "__disabled_jr0os_gg_",
|
|
24
|
+
"_transparent": "__transparent_jr0os_gg_",
|
|
25
|
+
"__SCheckbox": "___SCheckbox_jr0os_gg_",
|
|
26
|
+
"_size_m": "_size_m_jr0os_gg_",
|
|
27
|
+
"_size_l": "_size_l_jr0os_gg_",
|
|
28
|
+
"__SPointShape": "___SPointShape_jr0os_gg_",
|
|
29
|
+
"_color": "__color_jr0os_gg_",
|
|
30
|
+
"--color": "--color_jr0os",
|
|
31
|
+
"_shape_Circle": "_shape_Circle_jr0os_gg_",
|
|
32
|
+
"_shape_Pattern": "_shape_Pattern_jr0os_gg_",
|
|
33
|
+
"__SIcon": "___SIcon_jr0os_gg_",
|
|
34
|
+
"__SLabel": "___SLabel_jr0os_gg_",
|
|
35
|
+
"__SAdditionalLabel": "___SAdditionalLabel_jr0os_gg_",
|
|
36
|
+
"__SCount": "___SCount_jr0os_gg_"
|
|
38
37
|
})
|
|
39
38
|
);
|
|
40
39
|
const enhance = [resolveColorEnhance(), uniqueIDEnhancement()];
|
|
@@ -207,10 +206,8 @@ function Shape(props) {
|
|
|
207
206
|
}
|
|
208
207
|
if (shape === "Pattern") {
|
|
209
208
|
var _ref8;
|
|
210
|
-
return _ref8 = sstyled(styles), /* @__PURE__ */ React.createElement(
|
|
211
|
-
|
|
212
|
-
"mt": "1px",
|
|
213
|
-
"mb": "-1px"
|
|
209
|
+
return _ref8 = sstyled(styles), /* @__PURE__ */ React.createElement(SPointShape, _ref8.cn("SPointShape", {
|
|
210
|
+
...assignProps({}, _ref2)
|
|
214
211
|
}), /* @__PURE__ */ React.createElement(SPatternSymbol, _ref8.cn("SPatternSymbol", {
|
|
215
212
|
"color": color,
|
|
216
213
|
"patternKey": patternKey,
|
|
@@ -50,6 +50,13 @@ SPointShape[shape='Circle'][size='m'] {
|
|
|
50
50
|
SPointShape[shape='Pattern'] {
|
|
51
51
|
background-color: transparent;
|
|
52
52
|
margin-right: var(--intergalactic-spacing-1x, 4px);
|
|
53
|
+
margin-top: 1px;
|
|
54
|
+
margin-bottom: -1px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
SPointShape[shape='Pattern'][size='l'] {
|
|
58
|
+
margin-top: 4px;
|
|
59
|
+
margin-bottom: -4px;
|
|
53
60
|
}
|
|
54
61
|
|
|
55
62
|
SIcon {
|
|
@@ -111,7 +118,3 @@ SAdditionalLabel[size='l']::before {
|
|
|
111
118
|
SAdditionalLabel[size='m']::before {
|
|
112
119
|
margin-top: 8px;
|
|
113
120
|
}
|
|
114
|
-
|
|
115
|
-
SPatternSymbol {
|
|
116
|
-
transform: scale(0.8);
|
|
117
|
-
}
|
|
@@ -9,21 +9,21 @@ const style = (
|
|
|
9
9
|
/*__reshadow_css_start__*/
|
|
10
10
|
(sstyled.insert(
|
|
11
11
|
/*__inner_css_start__*/
|
|
12
|
-
'.
|
|
12
|
+
'.___SLegendTable_ad2p8_gg_.__additions-count_ad2p8_gg_{font-feature-settings:"tnum";font-variant-numeric:tabular-nums;display:grid;align-items:center;grid-column-gap:var(--intergalactic-spacing-2x,8px)}.___SLegendTable_ad2p8_gg_.__additions-count_ad2p8_gg_._additions-direction_columns_ad2p8_gg_{grid-template-columns:auto repeat(var(--additions-count_ad2p8),.2fr);height:-moz-fit-content;height:fit-content;grid-row-gap:var(--intergalactic-spacing-2x,8px)}.___SLegendTable_ad2p8_gg_.__additions-count_ad2p8_gg_._additions-direction_columns_ad2p8_gg_>.___SColumnItem_ad2p8_gg_{text-align:right}.___SLegendTable_ad2p8_gg_.__additions-count_ad2p8_gg_._additions-direction_rows_ad2p8_gg_{grid-template-rows:auto repeat(var(--additions-count_ad2p8),.2fr);grid-auto-flow:column;grid-row-gap:var(--intergalactic-spacing-1x,4px);grid-column-gap:var(--intergalactic-spacing-14x,56px);grid-template-columns:repeat(var(--items-count_ad2p8),max-content)}.___SColumnItem_ad2p8_gg_{white-space:nowrap}.___SColumnItem_ad2p8_gg_._size_l_ad2p8_gg_{font-size:var(--intergalactic-fs-300,16px)}.___SColumnItem_ad2p8_gg_._size_m_ad2p8_gg_{font-size:var(--intergalactic-fs-200,14px)}.___SColumnItem_ad2p8_gg_.__transparent_ad2p8_gg_{opacity:.3}',
|
|
13
13
|
/*__inner_css_end__*/
|
|
14
|
-
"
|
|
14
|
+
"ad2p8_gg_"
|
|
15
15
|
), /*__reshadow_css_end__*/
|
|
16
16
|
{
|
|
17
|
-
"__SLegendTable": "
|
|
18
|
-
"_additions-count": "__additions-
|
|
19
|
-
"_additions-direction_columns": "_additions-
|
|
20
|
-
"--additions-count": "--additions-
|
|
21
|
-
"__SColumnItem": "
|
|
22
|
-
"_additions-direction_rows": "_additions-
|
|
23
|
-
"--items-count": "--items-
|
|
24
|
-
"_size_l": "
|
|
25
|
-
"_size_m": "
|
|
26
|
-
"_transparent": "
|
|
17
|
+
"__SLegendTable": "___SLegendTable_ad2p8_gg_",
|
|
18
|
+
"_additions-count": "__additions-count_ad2p8_gg_",
|
|
19
|
+
"_additions-direction_columns": "_additions-direction_columns_ad2p8_gg_",
|
|
20
|
+
"--additions-count": "--additions-count_ad2p8",
|
|
21
|
+
"__SColumnItem": "___SColumnItem_ad2p8_gg_",
|
|
22
|
+
"_additions-direction_rows": "_additions-direction_rows_ad2p8_gg_",
|
|
23
|
+
"--items-count": "--items-count_ad2p8",
|
|
24
|
+
"_size_l": "_size_l_ad2p8_gg_",
|
|
25
|
+
"_size_m": "_size_m_ad2p8_gg_",
|
|
26
|
+
"_transparent": "__transparent_ad2p8_gg_"
|
|
27
27
|
})
|
|
28
28
|
);
|
|
29
29
|
class LegendTableRoot extends BaseLegend {
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { sstyled, Component } from "@semcore/core";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { HoveredTick } from "./HoveredTick.mjs";
|
|
5
|
+
import createElement from "../../createElement.mjs";
|
|
6
|
+
import { scaleOfBandwidth } from "../../utils.mjs";
|
|
7
|
+
/*!__reshadow-styles__:"./hover.shadow.css"*/
|
|
8
|
+
const style = (
|
|
9
|
+
/*__reshadow_css_start__*/
|
|
10
|
+
(sstyled.insert(
|
|
11
|
+
/*__inner_css_start__*/
|
|
12
|
+
".___SHoverLine_2o2ug_gg_,.___SHoverLine_2o2ug_gg_:focus-visible{outline:none;stroke:var(--intergalactic-chart-grid-x-axis,oklch(.88 .011 234.9))}",
|
|
13
|
+
/*__inner_css_end__*/
|
|
14
|
+
"2o2ug_gg_"
|
|
15
|
+
), /*__reshadow_css_end__*/
|
|
16
|
+
{
|
|
17
|
+
"__SHoverLine": "___SHoverLine_2o2ug_gg_"
|
|
18
|
+
})
|
|
19
|
+
);
|
|
20
|
+
const STROKE_WIDTH = 1;
|
|
21
|
+
const NOTCH_WIDTH = 9;
|
|
22
|
+
const NOTCH_DELTA = NOTCH_WIDTH / 2 - STROKE_WIDTH / 4;
|
|
23
|
+
class HoverLineComponent extends Component {
|
|
24
|
+
constructor(...args) {
|
|
25
|
+
super(...args);
|
|
26
|
+
_defineProperty(this, "Element", void 0);
|
|
27
|
+
}
|
|
28
|
+
isEquals(a, b) {
|
|
29
|
+
if (a === b) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
if (a instanceof Date && b instanceof Date) {
|
|
33
|
+
return a.getTime() === b.getTime();
|
|
34
|
+
}
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
getValue(index, key) {
|
|
38
|
+
const {
|
|
39
|
+
data
|
|
40
|
+
} = this.asProps;
|
|
41
|
+
if (typeof key === "string") {
|
|
42
|
+
const value = index !== null ? data[index]?.[key] : void 0;
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
45
|
+
return void 0;
|
|
46
|
+
}
|
|
47
|
+
getInitPoint(scale, value) {
|
|
48
|
+
if (typeof value === "string" || typeof value === "number" || value instanceof Date) {
|
|
49
|
+
const initPoint = value !== void 0 ? scaleOfBandwidth(scale, value) : void 0;
|
|
50
|
+
return initPoint;
|
|
51
|
+
}
|
|
52
|
+
return void 0;
|
|
53
|
+
}
|
|
54
|
+
render() {
|
|
55
|
+
var _ref;
|
|
56
|
+
const SHoverLine = this.Element;
|
|
57
|
+
const {
|
|
58
|
+
meta,
|
|
59
|
+
xIndex,
|
|
60
|
+
yIndex,
|
|
61
|
+
styles,
|
|
62
|
+
x,
|
|
63
|
+
y,
|
|
64
|
+
data,
|
|
65
|
+
scale,
|
|
66
|
+
dataHints,
|
|
67
|
+
hideTickHover,
|
|
68
|
+
formatValue
|
|
69
|
+
} = this.asProps;
|
|
70
|
+
const [xScale, yScale] = scale;
|
|
71
|
+
const [xFormatValue, yFormatValue] = Array.isArray(formatValue) ? formatValue : [formatValue, formatValue];
|
|
72
|
+
const xRange = xScale.range();
|
|
73
|
+
const yRange = yScale.range();
|
|
74
|
+
const xValue = this.getValue(xIndex, x);
|
|
75
|
+
const yValue = this.getValue(yIndex, y);
|
|
76
|
+
const x1 = this.getInitPoint(xScale, xValue);
|
|
77
|
+
const y1 = this.getInitPoint(yScale, yValue);
|
|
78
|
+
const xTicks = xScale.domain?.() ?? [];
|
|
79
|
+
const yTicks = yScale.domain?.() ?? [];
|
|
80
|
+
return _ref = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, xIndex !== null && typeof x1 === "number" ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SHoverLine, _ref.cn("SHoverLine", {
|
|
81
|
+
"render": "g",
|
|
82
|
+
"stroke-width": STROKE_WIDTH,
|
|
83
|
+
"aria-hidden": true
|
|
84
|
+
}), /* @__PURE__ */ React.createElement("line", _ref.cn("line", {
|
|
85
|
+
"x1": x1 - NOTCH_DELTA,
|
|
86
|
+
"x2": x1 + NOTCH_DELTA,
|
|
87
|
+
"y1": yRange[0],
|
|
88
|
+
"y2": yRange[0]
|
|
89
|
+
})), /* @__PURE__ */ React.createElement("line", _ref.cn("line", {
|
|
90
|
+
"x1": x1,
|
|
91
|
+
"y1": yRange[0],
|
|
92
|
+
"x2": x1,
|
|
93
|
+
"y2": yRange[1]
|
|
94
|
+
})), /* @__PURE__ */ React.createElement("line", _ref.cn("line", {
|
|
95
|
+
"x1": x1 - NOTCH_DELTA,
|
|
96
|
+
"x2": x1 + NOTCH_DELTA,
|
|
97
|
+
"y1": yRange[1],
|
|
98
|
+
"y2": yRange[1]
|
|
99
|
+
}))), !hideTickHover && xValue !== void 0 && /* @__PURE__ */ React.createElement(HoveredTick, _ref.cn("HoveredTick", {
|
|
100
|
+
"size": meta.getTicksSize("horizontal"),
|
|
101
|
+
"position": meta.getTicksPosition("horizontal"),
|
|
102
|
+
"tickFormatter": dataHints.titles.getHorizontalAxesTitle ?? xFormatValue,
|
|
103
|
+
"value": xValue,
|
|
104
|
+
"isFirstTick": this.isEquals(xValue, xTicks.at(0)),
|
|
105
|
+
"isLastTick": this.isEquals(xValue, xTicks.at(-1)),
|
|
106
|
+
"x": x1,
|
|
107
|
+
"xRange": xRange,
|
|
108
|
+
"yRange": yRange
|
|
109
|
+
}))) : null, yIndex !== null && typeof y1 === "number" ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SHoverLine, _ref.cn("SHoverLine", {
|
|
110
|
+
"render": "g",
|
|
111
|
+
"stroke-width": STROKE_WIDTH,
|
|
112
|
+
"aria-hidden": true
|
|
113
|
+
}), /* @__PURE__ */ React.createElement("line", _ref.cn("line", {
|
|
114
|
+
"x1": xRange[0],
|
|
115
|
+
"y1": y1 - NOTCH_DELTA,
|
|
116
|
+
"x2": xRange[0],
|
|
117
|
+
"y2": y1 + NOTCH_DELTA
|
|
118
|
+
})), /* @__PURE__ */ React.createElement("line", _ref.cn("line", {
|
|
119
|
+
"x1": xRange[0],
|
|
120
|
+
"y1": y1,
|
|
121
|
+
"x2": xRange[1],
|
|
122
|
+
"y2": y1
|
|
123
|
+
})), /* @__PURE__ */ React.createElement("line", _ref.cn("line", {
|
|
124
|
+
"x1": xRange[1],
|
|
125
|
+
"y1": y1 - NOTCH_DELTA,
|
|
126
|
+
"x2": xRange[1],
|
|
127
|
+
"y2": y1 + NOTCH_DELTA
|
|
128
|
+
}))), !hideTickHover && yValue !== void 0 && /* @__PURE__ */ React.createElement(HoveredTick, _ref.cn("HoveredTick", {
|
|
129
|
+
"size": meta.getTicksSize("vertical"),
|
|
130
|
+
"position": meta.getTicksPosition("vertical"),
|
|
131
|
+
"tickFormatter": dataHints.titles.getVerticalAxesTitle ?? yFormatValue,
|
|
132
|
+
"value": yValue,
|
|
133
|
+
"isFirstTick": this.isEquals(yValue, yTicks.at(0)),
|
|
134
|
+
"isLastTick": this.isEquals(yValue, yTicks.at(-1)),
|
|
135
|
+
"y": y1,
|
|
136
|
+
"xRange": xRange,
|
|
137
|
+
"yRange": yRange
|
|
138
|
+
}))) : null);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
_defineProperty(HoverLineComponent, "displayName", "HoverLine");
|
|
142
|
+
_defineProperty(HoverLineComponent, "style", style);
|
|
143
|
+
const HoverLine = createElement(HoverLineComponent);
|
|
144
|
+
export {
|
|
145
|
+
HoverLine
|
|
146
|
+
};
|