@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/Pattern.mjs
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import { sstyled } from "@semcore/core";
|
|
2
3
|
import propsForElement from "@semcore/core/lib/utils/propsForElement";
|
|
3
4
|
import React from "react";
|
|
5
|
+
/*!__reshadow-styles__:"./style/pattern.shadow.css"*/
|
|
6
|
+
const style = (
|
|
7
|
+
/*__reshadow_css_start__*/
|
|
8
|
+
(sstyled.insert(
|
|
9
|
+
/*__inner_css_start__*/
|
|
10
|
+
".___SLinearGradient_1yi6g_gg_ .___SStopFrom_1yi6g_gg_{stop-color:var(--violet-300_1yi6g,#c08eff)}@media (color-gamut:p3){.___SLinearGradient_1yi6g_gg_ .___SStopFrom_1yi6g_gg_{stop-color:var(--violet-300_1yi6g,oklch(.74 .17 303))}}.___SLinearGradient_1yi6g_gg_ .___SStopTo_1yi6g_gg_{stop-color:var(--green-100_1yi6g,oklch(.9 .11 175))}",
|
|
11
|
+
/*__inner_css_end__*/
|
|
12
|
+
"1yi6g_gg_"
|
|
13
|
+
), /*__reshadow_css_end__*/
|
|
14
|
+
{
|
|
15
|
+
"__SLinearGradient": "___SLinearGradient_1yi6g_gg_",
|
|
16
|
+
"__SStopFrom": "___SStopFrom_1yi6g_gg_",
|
|
17
|
+
"--violet-300": "--violet-300_1yi6g",
|
|
18
|
+
"__SStopTo": "___SStopTo_1yi6g_gg_",
|
|
19
|
+
"--green-100": "--green-100_1yi6g"
|
|
20
|
+
})
|
|
21
|
+
);
|
|
4
22
|
const defaultDasharrays = ["4 4", "8 8", "2 4", "4 8", "8 2", "8 4", "12 4", "2 2"];
|
|
5
23
|
const defaultPatterns = {
|
|
6
24
|
starSmall: {
|
|
@@ -456,6 +474,102 @@ const resolvePattern = (patternKey, patternsConfig = true) => {
|
|
|
456
474
|
patternIndex = patternIndex % patterns.length;
|
|
457
475
|
return patterns[patternIndex];
|
|
458
476
|
};
|
|
477
|
+
const DefaultStrokePattern = (props) => {
|
|
478
|
+
return /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("pattern", {
|
|
479
|
+
id: props.id,
|
|
480
|
+
width: "10",
|
|
481
|
+
height: "8",
|
|
482
|
+
patternUnits: "userSpaceOnUse",
|
|
483
|
+
patternTransform: "rotate(-117)"
|
|
484
|
+
}, /* @__PURE__ */ React.createElement("rect", {
|
|
485
|
+
width: "10",
|
|
486
|
+
height: "8",
|
|
487
|
+
fill: "transparent"
|
|
488
|
+
}), /* @__PURE__ */ React.createElement("line", {
|
|
489
|
+
x1: "0",
|
|
490
|
+
y1: "0",
|
|
491
|
+
x2: "0",
|
|
492
|
+
y2: "8",
|
|
493
|
+
stroke: "#fff",
|
|
494
|
+
strokeWidth: "8"
|
|
495
|
+
})));
|
|
496
|
+
};
|
|
497
|
+
const LightStrokePattern = (props) => {
|
|
498
|
+
return /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("pattern", {
|
|
499
|
+
id: props.id,
|
|
500
|
+
width: "4",
|
|
501
|
+
height: "4",
|
|
502
|
+
patternUnits: "userSpaceOnUse",
|
|
503
|
+
patternTransform: "rotate(40)"
|
|
504
|
+
}, /* @__PURE__ */ React.createElement("line", {
|
|
505
|
+
x1: "3",
|
|
506
|
+
y1: "0",
|
|
507
|
+
x2: "3",
|
|
508
|
+
y2: "4",
|
|
509
|
+
stroke: "white",
|
|
510
|
+
strokeWidth: "2"
|
|
511
|
+
})));
|
|
512
|
+
};
|
|
513
|
+
const StrokeMask = (props) => {
|
|
514
|
+
return /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement(LightStrokePattern, {
|
|
515
|
+
id: `${props.id}-stroke`
|
|
516
|
+
}), /* @__PURE__ */ React.createElement("mask", {
|
|
517
|
+
id: props.id
|
|
518
|
+
}, /* @__PURE__ */ React.createElement("rect", {
|
|
519
|
+
width: "100%",
|
|
520
|
+
height: "100%",
|
|
521
|
+
fill: props.color
|
|
522
|
+
}), /* @__PURE__ */ React.createElement("rect", {
|
|
523
|
+
width: "100%",
|
|
524
|
+
height: "100%",
|
|
525
|
+
fill: `url(#${props.id}-stroke)`
|
|
526
|
+
})));
|
|
527
|
+
};
|
|
528
|
+
const ForecastGradient = (props) => {
|
|
529
|
+
return /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("linearGradient", {
|
|
530
|
+
id: props.id,
|
|
531
|
+
x1: "0%",
|
|
532
|
+
y1: "0%",
|
|
533
|
+
x2: "0%",
|
|
534
|
+
y2: "100%"
|
|
535
|
+
}, /* @__PURE__ */ React.createElement("stop", {
|
|
536
|
+
offset: "0%",
|
|
537
|
+
stopColor: props.color,
|
|
538
|
+
stopOpacity: "0.4"
|
|
539
|
+
}), /* @__PURE__ */ React.createElement("stop", {
|
|
540
|
+
offset: "100%",
|
|
541
|
+
stopColor: "#fff",
|
|
542
|
+
stopOpacity: "0.1"
|
|
543
|
+
})));
|
|
544
|
+
};
|
|
545
|
+
const PotentialGradient = (props) => {
|
|
546
|
+
var _ref;
|
|
547
|
+
const SLinearGradient = "linearGradient";
|
|
548
|
+
const SStopFrom = "stop";
|
|
549
|
+
const SStopTo = "stop";
|
|
550
|
+
const isLine = props.type === "line";
|
|
551
|
+
const isArea = props.type === "area";
|
|
552
|
+
let gradientTransform = "rotate(-90 0.5 0.5)";
|
|
553
|
+
if (isLine) {
|
|
554
|
+
gradientTransform = "";
|
|
555
|
+
} else if (isArea) {
|
|
556
|
+
gradientTransform = "rotate(-30 0.5 0.5)";
|
|
557
|
+
}
|
|
558
|
+
return _ref = sstyled(style), /* @__PURE__ */ React.createElement("defs", _ref.cn("defs", {}), /* @__PURE__ */ React.createElement(SLinearGradient, _ref.cn("SLinearGradient", {
|
|
559
|
+
"id": props.id,
|
|
560
|
+
"x1": "0%",
|
|
561
|
+
"y1": "0%",
|
|
562
|
+
"x2": isLine ? "100%" : "0",
|
|
563
|
+
"y2": isLine ? "0" : "100%",
|
|
564
|
+
"gradientTransform": gradientTransform
|
|
565
|
+
}), /* @__PURE__ */ React.createElement(SStopFrom, _ref.cn("SStopFrom", {
|
|
566
|
+
"offset": "0%",
|
|
567
|
+
"stopOpacity": 1
|
|
568
|
+
})), /* @__PURE__ */ React.createElement(SStopTo, _ref.cn("SStopTo", {
|
|
569
|
+
"offset": "100%",
|
|
570
|
+
"stopOpacity": isArea ? 0 : 1
|
|
571
|
+
}))));
|
|
572
|
+
};
|
|
459
573
|
const PatternFill = ({
|
|
460
574
|
id,
|
|
461
575
|
color,
|
|
@@ -518,8 +632,13 @@ const resolvePatternDasharray = (patternKey, patterns) => {
|
|
|
518
632
|
return pattern?.dasharray;
|
|
519
633
|
};
|
|
520
634
|
export {
|
|
635
|
+
DefaultStrokePattern,
|
|
636
|
+
ForecastGradient,
|
|
637
|
+
LightStrokePattern,
|
|
521
638
|
PatternFill,
|
|
522
639
|
PatternSymbol,
|
|
640
|
+
PotentialGradient,
|
|
641
|
+
StrokeMask,
|
|
523
642
|
getPatternSymbolSize,
|
|
524
643
|
resolvePatternDasharray
|
|
525
644
|
};
|
package/lib/esm/Plot.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import { sstyled, Component, assignProps
|
|
2
|
+
import { createComponent, sstyled, Component, assignProps } from "@semcore/core";
|
|
3
3
|
import { Box } from "@semcore/base-components";
|
|
4
4
|
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
5
5
|
import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
|
|
@@ -7,6 +7,7 @@ import EventEmitter from "@semcore/core/lib/utils/eventEmitter";
|
|
|
7
7
|
import React from "react";
|
|
8
8
|
import { makeDataHintsContainer, makeDataHintsHandlers } from "./a11y/hints.mjs";
|
|
9
9
|
import { PlotA11yModule } from "./a11y/PlotA11yModule.mjs";
|
|
10
|
+
import { ChartMetaData } from "./ChartMetaData.mjs";
|
|
10
11
|
import { localizedMessages } from "./translations/__intergalactic-dynamic-locales.mjs";
|
|
11
12
|
import { uniqueId, eventToPoint } from "./utils.mjs";
|
|
12
13
|
/*!__reshadow-styles__:"./style/plot.shadow.css"*/
|
|
@@ -14,7 +15,7 @@ const style = (
|
|
|
14
15
|
/*__reshadow_css_start__*/
|
|
15
16
|
(sstyled.insert(
|
|
16
17
|
/*__inner_css_start__*/
|
|
17
|
-
".___SPlot_1f5de_gg_{overflow:hidden}.___SPlot_1f5de_gg_:focus{outline:none}.___SPlot_1f5de_gg_:active{outline:0;-webkit-text-decoration:none;text-decoration:none}foreignObject[data-aria-only]{pointer-events:none}.___SPlot_1f5de_gg_:has(foreignObject[data-aria-only]:focus-within){outline-color:var(--intergalactic-keyboard-focus-outline
|
|
18
|
+
".___SPlot_1f5de_gg_{overflow:hidden}.___SPlot_1f5de_gg_:focus{outline:none}.___SPlot_1f5de_gg_:active{outline:0;-webkit-text-decoration:none;text-decoration:none}foreignObject[data-aria-only]{pointer-events:none}.___SPlot_1f5de_gg_:has(foreignObject[data-aria-only]:focus-within){outline-color:var(--intergalactic-keyboard-focus-outline,oklch(.23 .009 245));outline-style:solid;outline-width:2px;outline-offset:2px;transition-duration:calc(var(--intergalactic-duration-extra-fast, 100)*1ms);transition-timing-function:ease-in-out;transition-property:outline-color,outline-width,outline-offset;border-radius:var(--intergalactic-surface-rounded,8px)}",
|
|
18
19
|
/*__inner_css_end__*/
|
|
19
20
|
"1f5de_gg_"
|
|
20
21
|
), /*__reshadow_css_end__*/
|
|
@@ -52,6 +53,7 @@ class PlotRoot extends Component {
|
|
|
52
53
|
this.eventEmitter.emit("onMouseLeaveChart", e);
|
|
53
54
|
});
|
|
54
55
|
this.eventEmitter = props.eventEmitter || new EventEmitter();
|
|
56
|
+
this.meta = new ChartMetaData();
|
|
55
57
|
}
|
|
56
58
|
setContext() {
|
|
57
59
|
const {
|
|
@@ -81,7 +83,8 @@ class PlotRoot extends Component {
|
|
|
81
83
|
resolveColor,
|
|
82
84
|
patterns,
|
|
83
85
|
duration,
|
|
84
|
-
plotId: this.plotId
|
|
86
|
+
plotId: this.plotId,
|
|
87
|
+
meta: this.meta
|
|
85
88
|
}
|
|
86
89
|
};
|
|
87
90
|
}
|
package/lib/esm/Radar.mjs
CHANGED
|
@@ -16,29 +16,29 @@ const style = (
|
|
|
16
16
|
/*__reshadow_css_start__*/
|
|
17
17
|
(sstyled.insert(
|
|
18
18
|
/*__inner_css_start__*/
|
|
19
|
-
".
|
|
19
|
+
".___SAxisLine_1i4jk_gg_,.___SAxisTick_1i4jk_gg_,.___SAxis_1i4jk_gg_{stroke:var(--intergalactic-chart-grid-line,oklch(.7 .021 242));stroke-width:1;fill:#0000}.___SAxisLine_1i4jk_gg_,.___SAxisTick_1i4jk_gg_{stroke-dasharray:2}.___SAxisLine_1i4jk_gg_.__active_1i4jk_gg_{stroke:var(--intergalactic-chart-grid-y-accent-hover-line,oklch(.88 .011 234.9))}.___SAxisLabel_1i4jk_gg_{text-anchor:middle;dominant-baseline:central;font-size:12px}.___SAxisLabel_1i4jk_gg_.__xDirection_1i4jk_gg_{text-anchor:var(--xDirection_1i4jk)}.___SAxisLabel_1i4jk_gg_.__yDirection_1i4jk_gg_{dominant-baseline:var(--yDirection_1i4jk)}.___SPolygon_1i4jk_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));opacity:.2}.___SPolygon_1i4jk_gg_.__color_1i4jk_gg_{fill:var(--color_1i4jk)}.___SPolygon_1i4jk_gg_.__pattern_1i4jk_gg_.__color_1i4jk_gg_{fill:var(--pattern_1i4jk);stroke:var(--color_1i4jk);stroke-width:1px}.___SPolygonDot_1i4jk_gg_{stroke-width:2px;stroke:var(--intergalactic-chart-grid-border,#fff);r:6px;fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245))}.___SPolygonDot_1i4jk_gg_.__transparent_1i4jk_gg_{opacity:.3}.___SPolygonDot_1i4jk_gg_.__color_1i4jk_gg_{fill:var(--color_1i4jk)}.___SPolygonLine_1i4jk_gg_{stroke:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));stroke-width:3;fill:#0000}.___SPolygonLine_1i4jk_gg_.__transparent_1i4jk_gg_{opacity:.3}.___SPolygonLine_1i4jk_gg_.__color_1i4jk_gg_{stroke:var(--color_1i4jk)}.___SPieRect_1i4jk_gg_{outline:none;fill:var(--intergalactic-chart-grid-bar-hover,oklch(.375 .09 242.7/.05))}",
|
|
20
20
|
/*__inner_css_end__*/
|
|
21
|
-
"
|
|
21
|
+
"1i4jk_gg_"
|
|
22
22
|
), /*__reshadow_css_end__*/
|
|
23
23
|
{
|
|
24
|
-
"__SAxis": "
|
|
25
|
-
"__SAxisLine": "
|
|
26
|
-
"__SAxisTick": "
|
|
27
|
-
"_active": "
|
|
28
|
-
"__SAxisLabel": "
|
|
29
|
-
"_xDirection": "
|
|
30
|
-
"--xDirection": "--
|
|
31
|
-
"_yDirection": "
|
|
32
|
-
"--yDirection": "--
|
|
33
|
-
"__SPolygon": "
|
|
34
|
-
"_color": "
|
|
35
|
-
"--color": "--
|
|
36
|
-
"_pattern": "
|
|
37
|
-
"--pattern": "--
|
|
38
|
-
"__SPolygonDot": "
|
|
39
|
-
"_transparent": "
|
|
40
|
-
"__SPolygonLine": "
|
|
41
|
-
"__SPieRect": "
|
|
24
|
+
"__SAxis": "___SAxis_1i4jk_gg_",
|
|
25
|
+
"__SAxisLine": "___SAxisLine_1i4jk_gg_",
|
|
26
|
+
"__SAxisTick": "___SAxisTick_1i4jk_gg_",
|
|
27
|
+
"_active": "__active_1i4jk_gg_",
|
|
28
|
+
"__SAxisLabel": "___SAxisLabel_1i4jk_gg_",
|
|
29
|
+
"_xDirection": "__xDirection_1i4jk_gg_",
|
|
30
|
+
"--xDirection": "--xDirection_1i4jk",
|
|
31
|
+
"_yDirection": "__yDirection_1i4jk_gg_",
|
|
32
|
+
"--yDirection": "--yDirection_1i4jk",
|
|
33
|
+
"__SPolygon": "___SPolygon_1i4jk_gg_",
|
|
34
|
+
"_color": "__color_1i4jk_gg_",
|
|
35
|
+
"--color": "--color_1i4jk",
|
|
36
|
+
"_pattern": "__pattern_1i4jk_gg_",
|
|
37
|
+
"--pattern": "--pattern_1i4jk",
|
|
38
|
+
"__SPolygonDot": "___SPolygonDot_1i4jk_gg_",
|
|
39
|
+
"_transparent": "__transparent_1i4jk_gg_",
|
|
40
|
+
"__SPolygonLine": "___SPolygonLine_1i4jk_gg_",
|
|
41
|
+
"__SPieRect": "___SPieRect_1i4jk_gg_"
|
|
42
42
|
})
|
|
43
43
|
);
|
|
44
44
|
const clampAngle = (angle) => {
|
package/lib/esm/RadialTree.mjs
CHANGED
|
@@ -14,22 +14,22 @@ const style = (
|
|
|
14
14
|
/*__reshadow_css_start__*/
|
|
15
15
|
(sstyled.insert(
|
|
16
16
|
/*__inner_css_start__*/
|
|
17
|
-
".
|
|
17
|
+
".___SRadian_tu12w_gg_{cursor:pointer;fill:var(--intergalactic-text-large-info,oklch(.23 .009 245))}.___SLine_tu12w_gg_{stroke:var(--intergalactic-text-large-info,oklch(.23 .009 245))}.___SLine_tu12w_gg_.__stroke_tu12w_gg_{stroke:var(--stroke_tu12w)}.___SLine_tu12w_gg_.__transparent_tu12w_gg_{opacity:.3}.___SCap_tu12w_gg_{transition:r .1s}.___SCap_tu12w_gg_.__pattern_tu12w_gg_{stroke:var(--intergalactic-chart-grid-border,#fff);stroke-width:1px}.___SCap_tu12w_gg_.__transparent_tu12w_gg_,.___SIcon_tu12w_gg_.__transparent_tu12w_gg_{opacity:.3}.___SLabel_tu12w_gg_{fill:var(--color_tu12w)}.___SLabel_tu12w_gg_.__transparent_tu12w_gg_{opacity:.3}@media (hover:hover){.___SRadian_tu12w_gg_:hover .___SLabel_tu12w_gg_{cursor:pointer;filter:brightness(.6)}}@media (prefers-reduced-motion){.___SLineCap_tu12w_gg_{transition:none}}",
|
|
18
18
|
/*__inner_css_end__*/
|
|
19
|
-
"
|
|
19
|
+
"tu12w_gg_"
|
|
20
20
|
), /*__reshadow_css_end__*/
|
|
21
21
|
{
|
|
22
|
-
"__SRadian": "
|
|
23
|
-
"__SLine": "
|
|
24
|
-
"_stroke": "
|
|
25
|
-
"--stroke": "--
|
|
26
|
-
"_transparent": "
|
|
27
|
-
"__SCap": "
|
|
28
|
-
"_pattern": "
|
|
29
|
-
"__SIcon": "
|
|
30
|
-
"__SLabel": "
|
|
31
|
-
"--color": "--
|
|
32
|
-
"__SLineCap": "
|
|
22
|
+
"__SRadian": "___SRadian_tu12w_gg_",
|
|
23
|
+
"__SLine": "___SLine_tu12w_gg_",
|
|
24
|
+
"_stroke": "__stroke_tu12w_gg_",
|
|
25
|
+
"--stroke": "--stroke_tu12w",
|
|
26
|
+
"_transparent": "__transparent_tu12w_gg_",
|
|
27
|
+
"__SCap": "___SCap_tu12w_gg_",
|
|
28
|
+
"_pattern": "__pattern_tu12w_gg_",
|
|
29
|
+
"__SIcon": "___SIcon_tu12w_gg_",
|
|
30
|
+
"__SLabel": "___SLabel_tu12w_gg_",
|
|
31
|
+
"--color": "--color_tu12w",
|
|
32
|
+
"__SLineCap": "___SLineCap_tu12w_gg_"
|
|
33
33
|
})
|
|
34
34
|
);
|
|
35
35
|
const baseAngle = -Math.PI / 2;
|
package/lib/esm/Reference.mjs
CHANGED
|
@@ -9,24 +9,27 @@ const style = (
|
|
|
9
9
|
/*__reshadow_css_start__*/
|
|
10
10
|
(sstyled.insert(
|
|
11
11
|
/*__inner_css_start__*/
|
|
12
|
-
".
|
|
12
|
+
".___SReferenceLine_w3kqr_gg_{fill:none;stroke:var(--intergalactic-chart-grid-y-accent-hover-line,oklch(.88 .011 234.9))}.___STitle_w3kqr_gg_{font-size:var(--intergalactic-fs-100,12px);fill:var(--intergalactic-chart-grid-text-label,#00132466);transform-origin:var(--transform-origin_w3kqr)}.___STitle_w3kqr_gg_._position_top_w3kqr_gg_{text-anchor:middle}.___STitle_w3kqr_gg_._position_bottom_w3kqr_gg_{text-anchor:middle;dominant-baseline:hanging}.___STitle_w3kqr_gg_._position_left_w3kqr_gg_,.___STitle_w3kqr_gg_._position_right_w3kqr_gg_{transform:rotate(-90deg);dominant-baseline:middle;text-anchor:middle}.___SBackground_w3kqr_gg_{fill:var(--intergalactic-chart-grid-period-bg,oklch(.96 .005 232.5))}.___SStripes_w3kqr_gg_{fill:var(--fill_w3kqr)}.___SStripesPatternPath_w3kqr_gg_{stroke:var(--intergalactic-chart-grid-period-pattern,oklch(.95 .006 232.7));stroke-width:1px}",
|
|
13
13
|
/*__inner_css_end__*/
|
|
14
|
-
"
|
|
14
|
+
"w3kqr_gg_"
|
|
15
15
|
), /*__reshadow_css_end__*/
|
|
16
16
|
{
|
|
17
|
-
"__SReferenceLine": "
|
|
18
|
-
"__STitle": "
|
|
19
|
-
"--transform-origin": "--transform-
|
|
20
|
-
"_position_top": "
|
|
21
|
-
"_position_bottom": "
|
|
22
|
-
"_position_right": "
|
|
23
|
-
"_position_left": "
|
|
24
|
-
"__SBackground": "
|
|
25
|
-
"__SStripes": "
|
|
26
|
-
"--fill": "--
|
|
27
|
-
"__SStripesPatternPath": "
|
|
17
|
+
"__SReferenceLine": "___SReferenceLine_w3kqr_gg_",
|
|
18
|
+
"__STitle": "___STitle_w3kqr_gg_",
|
|
19
|
+
"--transform-origin": "--transform-origin_w3kqr",
|
|
20
|
+
"_position_top": "_position_top_w3kqr_gg_",
|
|
21
|
+
"_position_bottom": "_position_bottom_w3kqr_gg_",
|
|
22
|
+
"_position_right": "_position_right_w3kqr_gg_",
|
|
23
|
+
"_position_left": "_position_left_w3kqr_gg_",
|
|
24
|
+
"__SBackground": "___SBackground_w3kqr_gg_",
|
|
25
|
+
"__SStripes": "___SStripes_w3kqr_gg_",
|
|
26
|
+
"--fill": "--fill_w3kqr",
|
|
27
|
+
"__SStripesPatternPath": "___SStripesPatternPath_w3kqr_gg_"
|
|
28
28
|
})
|
|
29
29
|
);
|
|
30
|
+
const STROKE_WIDTH = 1;
|
|
31
|
+
const NOTCH_WIDTH = 9;
|
|
32
|
+
const NOTCH_DELTA = NOTCH_WIDTH / 2 - STROKE_WIDTH / 4;
|
|
30
33
|
const side2direction = {
|
|
31
34
|
left: "vertical",
|
|
32
35
|
right: "vertical",
|
|
@@ -41,7 +44,19 @@ const lineDirection2props = {
|
|
|
41
44
|
x1: x,
|
|
42
45
|
x2: x,
|
|
43
46
|
y1: yRange[0],
|
|
44
|
-
y2: yRange[1]
|
|
47
|
+
y2: yRange[1],
|
|
48
|
+
notchFirst: {
|
|
49
|
+
x1: x - NOTCH_DELTA,
|
|
50
|
+
x2: x + NOTCH_DELTA,
|
|
51
|
+
y1: yRange[0],
|
|
52
|
+
y2: yRange[0]
|
|
53
|
+
},
|
|
54
|
+
notchLast: {
|
|
55
|
+
x1: x - NOTCH_DELTA,
|
|
56
|
+
x2: x + NOTCH_DELTA,
|
|
57
|
+
y1: yRange[1],
|
|
58
|
+
y2: yRange[1]
|
|
59
|
+
}
|
|
45
60
|
};
|
|
46
61
|
},
|
|
47
62
|
horizontal: ([xScale, yScale], value) => {
|
|
@@ -51,7 +66,19 @@ const lineDirection2props = {
|
|
|
51
66
|
x1: xRange[0],
|
|
52
67
|
x2: xRange[1],
|
|
53
68
|
y1: y,
|
|
54
|
-
y2: y
|
|
69
|
+
y2: y,
|
|
70
|
+
notchFirst: {
|
|
71
|
+
x1: xRange[0],
|
|
72
|
+
x2: xRange[0],
|
|
73
|
+
y1: y - NOTCH_DELTA,
|
|
74
|
+
y2: y + NOTCH_DELTA
|
|
75
|
+
},
|
|
76
|
+
notchLast: {
|
|
77
|
+
x1: xRange[1],
|
|
78
|
+
x2: xRange[1],
|
|
79
|
+
y1: y - NOTCH_DELTA,
|
|
80
|
+
y2: y + NOTCH_DELTA
|
|
81
|
+
}
|
|
55
82
|
};
|
|
56
83
|
}
|
|
57
84
|
};
|
|
@@ -148,12 +175,22 @@ class ReferenceLineRoot extends Component {
|
|
|
148
175
|
styles
|
|
149
176
|
} = this.asProps;
|
|
150
177
|
const positionProps = lineDirection2props[side2direction[position]];
|
|
178
|
+
const {
|
|
179
|
+
notchFirst,
|
|
180
|
+
notchLast,
|
|
181
|
+
...line
|
|
182
|
+
} = positionProps(scale, value);
|
|
151
183
|
return _ref = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SReferenceLine, _ref.cn("SReferenceLine", {
|
|
152
|
-
"render": "
|
|
184
|
+
"render": "g",
|
|
153
185
|
"__excludeProps": ["data", "scale", "format", "value", "color"],
|
|
154
|
-
"stroke": resolveColor(color)
|
|
155
|
-
|
|
156
|
-
|
|
186
|
+
"stroke": resolveColor(color)
|
|
187
|
+
}), /* @__PURE__ */ React.createElement("line", _ref.cn("line", {
|
|
188
|
+
...notchFirst
|
|
189
|
+
})), /* @__PURE__ */ React.createElement("line", _ref.cn("line", {
|
|
190
|
+
...line
|
|
191
|
+
})), /* @__PURE__ */ React.createElement("line", _ref.cn("line", {
|
|
192
|
+
...notchLast
|
|
193
|
+
}))), title && /* @__PURE__ */ React.createElement(ReferenceLine.Title, null, title));
|
|
157
194
|
}
|
|
158
195
|
}
|
|
159
196
|
_defineProperty(ReferenceLineRoot, "displayName", "ReferenceLine");
|
package/lib/esm/ScatterPlot.mjs
CHANGED
|
@@ -13,19 +13,19 @@ const style = (
|
|
|
13
13
|
/*__reshadow_css_start__*/
|
|
14
14
|
(sstyled.insert(
|
|
15
15
|
/*__inner_css_start__*/
|
|
16
|
-
".
|
|
16
|
+
".___SScatterPlot_srw2j_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));transition-property:cx,cy;transition-duration:var(--duration_srw2j);transition-timing-function:ease-in-out;opacity:.5}@media (hover:hover){.___SScatterPlot_srw2j_gg_:hover{opacity:.8}}.___SScatterPlot_srw2j_gg_.__color_srw2j_gg_{fill:var(--color_srw2j)}.___SScatterPlot_srw2j_gg_.__pattern_srw2j_gg_.__color_srw2j_gg_{fill:var(--pattern_srw2j);stroke:var(--color_srw2j);stroke-width:1px}.___SScatterPlot_srw2j_gg_.__transparent_srw2j_gg_{opacity:.3}.___SValue_srw2j_gg_{text-anchor:middle;font-size:var(--intergalactic-fs-50,10px);stroke:var(--intergalactic-chart-palette-order-9,oklch(.53 .157 279.2))}.___SValue_srw2j_gg_.__color_srw2j_gg_{stroke:var(--color_srw2j)}.___SValue_srw2j_gg_.__transparent_srw2j_gg_{opacity:.3}",
|
|
17
17
|
/*__inner_css_end__*/
|
|
18
|
-
"
|
|
18
|
+
"srw2j_gg_"
|
|
19
19
|
), /*__reshadow_css_end__*/
|
|
20
20
|
{
|
|
21
|
-
"__SScatterPlot": "
|
|
22
|
-
"_color": "
|
|
23
|
-
"--color": "--
|
|
24
|
-
"_pattern": "
|
|
25
|
-
"--pattern": "--
|
|
26
|
-
"_transparent": "
|
|
27
|
-
"__SValue": "
|
|
28
|
-
"--duration": "--
|
|
21
|
+
"__SScatterPlot": "___SScatterPlot_srw2j_gg_",
|
|
22
|
+
"_color": "__color_srw2j_gg_",
|
|
23
|
+
"--color": "--color_srw2j",
|
|
24
|
+
"_pattern": "__pattern_srw2j_gg_",
|
|
25
|
+
"--pattern": "--pattern_srw2j",
|
|
26
|
+
"_transparent": "__transparent_srw2j_gg_",
|
|
27
|
+
"__SValue": "___SValue_srw2j_gg_",
|
|
28
|
+
"--duration": "--duration_srw2j"
|
|
29
29
|
})
|
|
30
30
|
);
|
|
31
31
|
class ScatterPlotRoot extends Component {
|
package/lib/esm/Tooltip.mjs
CHANGED
|
@@ -12,22 +12,22 @@ const style = (
|
|
|
12
12
|
/*__reshadow_css_start__*/
|
|
13
13
|
(sstyled.insert(
|
|
14
14
|
/*__inner_css_start__*/
|
|
15
|
-
'.
|
|
15
|
+
'.___STooltip_5s0wq_gg_{font-size:var(--intergalactic-fs-100,12px);line-height:var(--intergalactic-lh-100,1.3334);font-feature-settings:"tnum";font-variant-numeric:tabular-nums;position:relative;color:var(--intergalactic-text-primary-invert,oklch(.991 .005 232.5/.959));background-color:var(--intergalactic-tooltip-bg-invert,oklch(.23 .009 245));border-radius:var(--intergalactic-popper-rounded,6px);border:1px solid var(--intergalactic-tooltip-border-invert,oklch(.4 .015 245));box-sizing:border-box;box-shadow:var(--intergalactic-box-shadow-popper,1px 1px 10px 0 oklch(.324 .077 242.1/.079));padding:var(--intergalactic-spacing-3x,12px)}.___STitle_5s0wq_gg_{color:var(--intergalactic-text-secondary-invert,#e1f2ffb9);margin-bottom:var(--intergalactic-spacing-2x,8px)}@media (color-gamut:p3){.___STitle_5s0wq_gg_{color:var(--intergalactic-text-secondary-invert,oklch(.953 .025 240.1/.726))}}.___SDotGroup_5s0wq_gg_{display:flex;align-items:center}.___SDot_5s0wq_gg_{margin-right:var(--intergalactic-spacing-2x,8px)}.___SDotCircle_5s0wq_gg_.__color_5s0wq_gg_.__lightness_5s0wq_gg_{background-color:var(--color_5s0wq);width:10px;height:10px;border-radius:50%;box-shadow:0 0 0 1px oklch(from var(--color_5s0wq) calc(l + var(--lightness_5s0wq)) c h)}.___SFooter_5s0wq_gg_{background:var(--intergalactic-bg-secondary-invert,oklch(.907 .048 245.2/.129));color:var(--intergalactic-text-secondary-invert,#e1f2ffb9);padding:var(--intergalactic-spacing-1x,4px) var(--intergalactic-spacing-3x,12px);border-radius:0 0 var(--intergalactic-rounded-medium,6px) var(--intergalactic-rounded-medium,6px);margin:var(--intergalactic-spacing-3x,12px) calc(var(--intergalactic-spacing-3x, 12px)*-1) calc(var(--intergalactic-spacing-3x, 12px)*-1)}@media (color-gamut:p3){.___SFooter_5s0wq_gg_{color:var(--intergalactic-text-secondary-invert,oklch(.953 .025 240.1/.726))}}.___SDotPattern_5s0wq_gg_{stroke-width:1px;stroke:oklch(from var(--intergalactic-chart-grid-border,#fff) l c h/.5)}',
|
|
16
16
|
/*__inner_css_end__*/
|
|
17
|
-
"
|
|
17
|
+
"5s0wq_gg_"
|
|
18
18
|
), /*__reshadow_css_end__*/
|
|
19
19
|
{
|
|
20
|
-
"__STooltip": "
|
|
21
|
-
"__STitle": "
|
|
22
|
-
"__SDotGroup": "
|
|
23
|
-
"__SDot": "
|
|
24
|
-
"__SDotCircle": "
|
|
25
|
-
"_color": "
|
|
26
|
-
"_lightness": "
|
|
27
|
-
"--color": "--
|
|
28
|
-
"--lightness": "--
|
|
29
|
-
"__SFooter": "
|
|
30
|
-
"__SDotPattern": "
|
|
20
|
+
"__STooltip": "___STooltip_5s0wq_gg_",
|
|
21
|
+
"__STitle": "___STitle_5s0wq_gg_",
|
|
22
|
+
"__SDotGroup": "___SDotGroup_5s0wq_gg_",
|
|
23
|
+
"__SDot": "___SDot_5s0wq_gg_",
|
|
24
|
+
"__SDotCircle": "___SDotCircle_5s0wq_gg_",
|
|
25
|
+
"_color": "__color_5s0wq_gg_",
|
|
26
|
+
"_lightness": "__lightness_5s0wq_gg_",
|
|
27
|
+
"--color": "--color_5s0wq",
|
|
28
|
+
"--lightness": "--lightness_5s0wq",
|
|
29
|
+
"__SFooter": "___SFooter_5s0wq_gg_",
|
|
30
|
+
"__SDotPattern": "___SDotPattern_5s0wq_gg_"
|
|
31
31
|
})
|
|
32
32
|
);
|
|
33
33
|
const TooltipDotRenderContext = /* @__PURE__ */ React.createContext({
|
|
@@ -69,12 +69,14 @@ class TooltipRoot extends Component {
|
|
|
69
69
|
const {
|
|
70
70
|
x,
|
|
71
71
|
y,
|
|
72
|
-
hideHoverLine
|
|
72
|
+
hideHoverLine,
|
|
73
|
+
hideTickHover
|
|
73
74
|
} = this.asProps;
|
|
74
75
|
return {
|
|
75
76
|
x,
|
|
76
77
|
y,
|
|
77
|
-
hideHoverLine
|
|
78
|
+
hideHoverLine,
|
|
79
|
+
hideTickHover
|
|
78
80
|
};
|
|
79
81
|
}
|
|
80
82
|
getPopperProps() {
|
|
@@ -13,12 +13,12 @@ const styles = (
|
|
|
13
13
|
/*__reshadow_css_start__*/
|
|
14
14
|
(sstyled.insert(
|
|
15
15
|
/*__inner_css_start__*/
|
|
16
|
-
".
|
|
16
|
+
".___SPlotA11yView_h2yn2_gg_{position:relative;display:block;background-color:var(--intergalactic-bg-primary-neutral,oklch(1 0 0));color:var(--intergalactic-text-primary,oklch(.23 .009 245));border:3px solid var(--intergalactic-border-primary,oklch(.277 .066 242.6/.18));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}.___SPlotA11yView_h2yn2_gg_ a{cursor:pointer;-webkit-text-decoration:underline;text-decoration:underline;margin-bottom:var(--intergalactic-spacing-2x,8px);display:block}.___SPlotA11yView_h2yn2_gg_ :is(table,td,th){border:1px solid var(--intergalactic-border-primary,oklch(.277 .066 242.6/.18))}",
|
|
17
17
|
/*__inner_css_end__*/
|
|
18
|
-
"
|
|
18
|
+
"h2yn2_gg_"
|
|
19
19
|
), /*__reshadow_css_end__*/
|
|
20
20
|
{
|
|
21
|
-
"__SPlotA11yView": "
|
|
21
|
+
"__SPlotA11yView": "___SPlotA11yView_h2yn2_gg_"
|
|
22
22
|
})
|
|
23
23
|
);
|
|
24
24
|
function PlotA11yView({
|
|
@@ -25,28 +25,29 @@ const style = (
|
|
|
25
25
|
/*__reshadow_css_start__*/
|
|
26
26
|
(sstyled.insert(
|
|
27
27
|
/*__inner_css_start__*/
|
|
28
|
-
".
|
|
28
|
+
".___SChart_1e5sk_gg_{width:100%;height:100%;min-width:0;min-height:0}.___STooltipChildrenWrapper_1e5sk_gg_{display:grid;grid-gap:var(--intergalactic-spacing-2x,8px);gap:var(--intergalactic-spacing-2x,8px);align-items:center}.___STooltipChildrenWrapper_1e5sk_gg_._columnsCount_2_1e5sk_gg_{grid-template-columns:auto minmax(28px,max-content)}.___STooltipChildrenWrapper_1e5sk_gg_._columnsCount_2_1e5sk_gg_ .___STooltipDivider_1e5sk_gg_{grid-column:span 2}.___STooltipChildrenWrapper_1e5sk_gg_._columnsCount_3_1e5sk_gg_{grid-template-columns:auto minmax(28px,max-content) minmax(28px,max-content)}.___STooltipChildrenWrapper_1e5sk_gg_._columnsCount_3_1e5sk_gg_ .___STooltipDivider_1e5sk_gg_{grid-column:span 3}.___STooltipDeltaWrapper_1e5sk_gg_{gap:var(--intergalactic-spacing-05x,2px);justify-content:flex-end}.___STooltipDeltaWrapper_1e5sk_gg_._trend_upward_1e5sk_gg_{color:var(--intergalactic-chart-data-success,oklch(.82 .19 143))}.___STooltipDeltaWrapper_1e5sk_gg_._trend_downward_1e5sk_gg_{color:var(--intergalactic-chart-data-critical,#ff7d7d)}@media (color-gamut:p3){.___STooltipDeltaWrapper_1e5sk_gg_._trend_downward_1e5sk_gg_{color:var(--intergalactic-chart-data-critical,oklch(.74 .19 22))}}.___STooltipDeltaWrapper_1e5sk_gg_._trend_stable_1e5sk_gg_{color:var(--intergalactic-text-secondary-invert,#e1f2ffb9)}@media (color-gamut:p3){.___STooltipDeltaWrapper_1e5sk_gg_._trend_stable_1e5sk_gg_{color:var(--intergalactic-text-secondary-invert,oklch(.953 .025 240.1/.726))}}.___STooltipDeltaWrapper_1e5sk_gg_._deltaPercentGrowthColor_critical_1e5sk_gg_._trend_upward_1e5sk_gg_{color:var(--intergalactic-chart-data-critical,#ff7d7d)}@media (color-gamut:p3){.___STooltipDeltaWrapper_1e5sk_gg_._deltaPercentGrowthColor_critical_1e5sk_gg_._trend_upward_1e5sk_gg_{color:var(--intergalactic-chart-data-critical,oklch(.74 .19 22))}}.___STooltipDeltaWrapper_1e5sk_gg_._deltaPercentGrowthColor_critical_1e5sk_gg_._trend_downward_1e5sk_gg_{color:var(--intergalactic-chart-data-success,oklch(.82 .19 143))}.___STooltipDeltaWrapper_1e5sk_gg_ .___STooltipDeltaIcon_1e5sk_gg_{align-self:center}",
|
|
29
29
|
/*__inner_css_end__*/
|
|
30
|
-
"
|
|
30
|
+
"1e5sk_gg_"
|
|
31
31
|
), /*__reshadow_css_end__*/
|
|
32
32
|
{
|
|
33
|
-
"__SChart": "
|
|
34
|
-
"__STooltipChildrenWrapper": "
|
|
35
|
-
"_columnsCount_2": "
|
|
36
|
-
"__STooltipDivider": "
|
|
37
|
-
"_columnsCount_3": "
|
|
38
|
-
"__STooltipDeltaWrapper": "
|
|
39
|
-
"_trend_upward": "
|
|
40
|
-
"_trend_downward": "
|
|
41
|
-
"_trend_stable": "
|
|
42
|
-
"
|
|
33
|
+
"__SChart": "___SChart_1e5sk_gg_",
|
|
34
|
+
"__STooltipChildrenWrapper": "___STooltipChildrenWrapper_1e5sk_gg_",
|
|
35
|
+
"_columnsCount_2": "_columnsCount_2_1e5sk_gg_",
|
|
36
|
+
"__STooltipDivider": "___STooltipDivider_1e5sk_gg_",
|
|
37
|
+
"_columnsCount_3": "_columnsCount_3_1e5sk_gg_",
|
|
38
|
+
"__STooltipDeltaWrapper": "___STooltipDeltaWrapper_1e5sk_gg_",
|
|
39
|
+
"_trend_upward": "_trend_upward_1e5sk_gg_",
|
|
40
|
+
"_trend_downward": "_trend_downward_1e5sk_gg_",
|
|
41
|
+
"_trend_stable": "_trend_stable_1e5sk_gg_",
|
|
42
|
+
"_deltaPercentGrowthColor_critical": "_deltaPercentGrowthColor_critical_1e5sk_gg_",
|
|
43
|
+
"__STooltipDeltaIcon": "___STooltipDeltaIcon_1e5sk_gg_"
|
|
43
44
|
})
|
|
44
45
|
);
|
|
45
46
|
const NOT_A_VALUE = "n/a";
|
|
46
47
|
class AbstractChart extends Component {
|
|
47
48
|
constructor(props) {
|
|
48
49
|
super(props);
|
|
49
|
-
_defineProperty(this, "plotPadding",
|
|
50
|
+
_defineProperty(this, "plotPadding", 10);
|
|
50
51
|
_defineProperty(this, "dataHints", makeDataHintsContainer());
|
|
51
52
|
_defineProperty(this, "chartRef", /* @__PURE__ */ React.createRef());
|
|
52
53
|
_defineProperty(this, "legendRef", /* @__PURE__ */ React.createRef());
|
|
@@ -470,7 +471,8 @@ class AbstractChart extends Component {
|
|
|
470
471
|
const curr = data[index][key];
|
|
471
472
|
if (typeof prev !== "number" || typeof curr !== "number") return null;
|
|
472
473
|
if (prev === 0) return curr === 0 ? 0 : null;
|
|
473
|
-
|
|
474
|
+
const percent = (curr - prev) / Math.abs(prev) * 100;
|
|
475
|
+
return Number(percent.toFixed(1));
|
|
474
476
|
}
|
|
475
477
|
getTooltipChildren(options) {
|
|
476
478
|
var _ref2;
|
|
@@ -526,24 +528,25 @@ class AbstractChart extends Component {
|
|
|
526
528
|
renderTooltipPercentDelta(delta) {
|
|
527
529
|
var _ref3;
|
|
528
530
|
const {
|
|
529
|
-
styles
|
|
531
|
+
styles,
|
|
532
|
+
deltaPercentGrowthColor
|
|
530
533
|
} = this.asProps;
|
|
531
534
|
const trend = this.getTooltipPercentDeltaTrend(delta);
|
|
532
535
|
const STooltipDeltaWrapper = Flex;
|
|
533
536
|
const STooltipDeltaIcon = trend === "upward" ? DiffUp : DiffDown;
|
|
534
|
-
const displayedDelta = delta !== null ? this.defaultTooltipFormatter(Math.abs(delta)) : null;
|
|
535
537
|
return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(
|
|
536
538
|
STooltipDeltaWrapper,
|
|
537
539
|
_ref3.cn("STooltipDeltaWrapper", {
|
|
538
|
-
"trend": trend
|
|
540
|
+
"trend": trend,
|
|
541
|
+
"deltaPercentGrowthColor": deltaPercentGrowthColor
|
|
539
542
|
}),
|
|
540
543
|
(trend === "upward" || trend === "downward") && /* @__PURE__ */ React.createElement(STooltipDeltaIcon, _ref3.cn("STooltipDeltaIcon", {
|
|
541
544
|
"width": 8.5,
|
|
542
545
|
"height": 8.5
|
|
543
546
|
})),
|
|
544
|
-
trend !== "unknown" &&
|
|
547
|
+
trend !== "unknown" && /* @__PURE__ */ React.createElement(Text, _ref3.cn("Text", {
|
|
545
548
|
"size": 100
|
|
546
|
-
}),
|
|
549
|
+
}), Math.abs(delta), "%")
|
|
547
550
|
);
|
|
548
551
|
}
|
|
549
552
|
renderTooltipTotalLine(dataItem) {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const GOOD = /* @__PURE__ */ Symbol("GOOD");
|
|
2
|
+
const BAD = /* @__PURE__ */ Symbol("BAD");
|
|
3
|
+
const INSIGHTFUL = /* @__PURE__ */ Symbol("INSIGHTFUL");
|
|
4
|
+
const HIGHLIGHT_DOT = /* @__PURE__ */ Symbol("HIGHLIGHT_DOT");
|
|
5
|
+
const DATA_TYPE = /* @__PURE__ */ Symbol("DATA_TYPE");
|
|
6
|
+
const FORECAST = /* @__PURE__ */ Symbol("FORECAST_DATA");
|
|
7
|
+
const POTENTIAL = /* @__PURE__ */ Symbol("POTENTIAL_DATA");
|
|
8
|
+
export {
|
|
9
|
+
BAD,
|
|
10
|
+
DATA_TYPE,
|
|
11
|
+
FORECAST,
|
|
12
|
+
GOOD,
|
|
13
|
+
HIGHLIGHT_DOT,
|
|
14
|
+
INSIGHTFUL,
|
|
15
|
+
POTENTIAL
|
|
16
|
+
};
|