@semcore/d3-chart 17.0.0-prerelease.36 → 17.0.0-prerelease.37
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 +1 -1
- package/lib/esm/AnimatedClipPath.mjs +1 -1
- package/lib/esm/Area.mjs +1 -2
- package/lib/esm/Axis.mjs +4 -7
- package/lib/esm/Bar.mjs +1 -2
- package/lib/esm/Bubble.mjs +3 -5
- package/lib/esm/CompactHorizontalBar.mjs +4 -4
- package/lib/esm/Donut.mjs +5 -4
- package/lib/esm/Dots.mjs +1 -2
- package/lib/esm/HorizontalBar.mjs +1 -2
- package/lib/esm/Hover.mjs +2 -3
- package/lib/esm/Line.mjs +2 -3
- package/lib/esm/Pattern.mjs +6 -7
- package/lib/esm/Plot.mjs +3 -5
- package/lib/esm/Radar.mjs +7 -10
- package/lib/esm/RadialTree.mjs +17 -63
- package/lib/esm/Reference.mjs +0 -1
- package/lib/esm/ResponsiveContainer.mjs +3 -5
- package/lib/esm/ScatterPlot.mjs +2 -2
- package/lib/esm/StackBar.mjs +2 -2
- package/lib/esm/StackedArea.mjs +2 -2
- package/lib/esm/Tooltip.mjs +5 -8
- package/lib/esm/Venn.mjs +3 -3
- package/lib/esm/a11y/DataAccessibilityTable.mjs +2 -4
- package/lib/esm/a11y/PlotA11yModule.mjs +2 -2
- package/lib/esm/a11y/PlotA11yView.mjs +8 -16
- package/lib/esm/a11y/focus.mjs +2 -2
- package/lib/esm/a11y/hints.mjs +3 -3
- package/lib/esm/a11y/insights.mjs +15 -20
- package/lib/esm/a11y/intl.mjs +1 -1
- package/lib/esm/a11y/locale.mjs +1 -2
- package/lib/esm/a11y/serialize.mjs +17 -17
- package/lib/esm/component/Chart/AbstractChart.mjs +15 -17
- package/lib/esm/component/Chart/AreaChart.mjs +5 -4
- package/lib/esm/component/Chart/BarChart.mjs +4 -3
- package/lib/esm/component/Chart/BubbleChart.mjs +8 -8
- package/lib/esm/component/Chart/CigaretteChart.mjs +6 -6
- package/lib/esm/component/Chart/CompactHorizontalBarChart.mjs +2 -1
- package/lib/esm/component/Chart/DonutChart.mjs +3 -2
- package/lib/esm/component/Chart/HistogramChart.mjs +5 -4
- package/lib/esm/component/Chart/LineChart.mjs +5 -4
- package/lib/esm/component/Chart/RadarChart.mjs +4 -5
- package/lib/esm/component/Chart/ScatterPlotChart.mjs +3 -2
- package/lib/esm/component/Chart/VennChart.mjs +3 -3
- package/lib/esm/component/ChartLegend/BaseLegend.mjs +9 -14
- package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +1 -2
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +1 -2
- package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +2 -4
- package/lib/esm/component/ChartLegend/index.mjs +2 -0
- package/lib/esm/component/Cigarette/Cigarette.mjs +1 -2
- package/lib/esm/component/StackGroupBar/StackGroupBar.mjs +2 -3
- package/lib/esm/createElement.mjs +1 -1
- package/lib/esm/index.mjs +1 -0
- package/lib/esm/utils.mjs +2 -2
- package/package.json +13 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
import {
|
|
2
|
+
import { sstyled, assignProps, createComponent } from "@semcore/core";
|
|
3
3
|
import { Box, Flex } 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";
|
|
@@ -9,13 +9,14 @@ import Divider from "@semcore/divider";
|
|
|
9
9
|
import { Text } from "@semcore/typography";
|
|
10
10
|
import { scaleLinear, scaleThreshold } from "d3-scale";
|
|
11
11
|
import React from "react";
|
|
12
|
-
import
|
|
13
|
-
import { HoverRect } from "../../Hover.mjs";
|
|
14
|
-
import { eventToPoint, interpolateValue } from "../../utils.mjs";
|
|
12
|
+
import "../../index.mjs";
|
|
15
13
|
import { AbstractChart, NOT_A_VALUE } from "./AbstractChart.mjs";
|
|
16
14
|
import AnimatedClipPath from "../../AnimatedClipPath.mjs";
|
|
17
15
|
import { localizedMessages } from "../../translations/__intergalactic-dynamic-locales.mjs";
|
|
16
|
+
import { eventToPoint, interpolateValue } from "../../utils.mjs";
|
|
18
17
|
import Cigarette from "../Cigarette/Cigarette.mjs";
|
|
18
|
+
import { HoverRect } from "../../Hover.mjs";
|
|
19
|
+
import Plot from "../../Plot.mjs";
|
|
19
20
|
const DEFAULT_MINIMAL_BAR_WIDTH = 2;
|
|
20
21
|
const DEFAULT_GAP = 2;
|
|
21
22
|
class CigaretteChartComponent extends AbstractChart {
|
|
@@ -64,8 +65,7 @@ class CigaretteChartComponent extends AbstractChart {
|
|
|
64
65
|
});
|
|
65
66
|
}
|
|
66
67
|
resolveColor(id, index) {
|
|
67
|
-
|
|
68
|
-
return ((_a = this.props.colorMap) == null ? void 0 : _a[id]) ?? `blue-${5 - index}00`;
|
|
68
|
+
return this.props.colorMap?.[id] ?? `blue-${5 - index}00`;
|
|
69
69
|
}
|
|
70
70
|
getDefaultDataDefinitions() {
|
|
71
71
|
const dataDefinitions = super.getDefaultDataDefinitions();
|
|
@@ -3,9 +3,10 @@ import { createComponent } from "@semcore/core";
|
|
|
3
3
|
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
4
4
|
import { scaleBand, scaleLinear } from "d3-scale";
|
|
5
5
|
import React from "react";
|
|
6
|
-
import
|
|
6
|
+
import "../../index.mjs";
|
|
7
7
|
import { AbstractChart } from "./AbstractChart.mjs";
|
|
8
8
|
import { localizedMessages } from "../../translations/__intergalactic-dynamic-locales.mjs";
|
|
9
|
+
import CompactHorizontalBar from "../../CompactHorizontalBar.mjs";
|
|
9
10
|
class CompactHorizontalBarChartComponent extends AbstractChart {
|
|
10
11
|
get xScale() {
|
|
11
12
|
return this.asProps.xScale ?? this.valueScale;
|
|
@@ -5,9 +5,10 @@ import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
|
5
5
|
import { Text } from "@semcore/typography";
|
|
6
6
|
import { scaleLinear } from "d3-scale";
|
|
7
7
|
import React from "react";
|
|
8
|
-
import
|
|
8
|
+
import "../../index.mjs";
|
|
9
9
|
import { AbstractChart } from "./AbstractChart.mjs";
|
|
10
10
|
import { localizedMessages } from "../../translations/__intergalactic-dynamic-locales.mjs";
|
|
11
|
+
import Donut from "../../Donut.mjs";
|
|
11
12
|
class DonutChartComponent extends AbstractChart {
|
|
12
13
|
get xScale() {
|
|
13
14
|
const {
|
|
@@ -70,7 +71,7 @@ class DonutChartComponent extends AbstractChart {
|
|
|
70
71
|
}) => {
|
|
71
72
|
const title = dataDefinitions.find((item) => item.id === dataKey);
|
|
72
73
|
return {
|
|
73
|
-
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Donut.Tooltip.Title, null,
|
|
74
|
+
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Donut.Tooltip.Title, null, title?.label || dataKey), /* @__PURE__ */ React.createElement(Flex, {
|
|
74
75
|
justifyContent: "space-between"
|
|
75
76
|
}, /* @__PURE__ */ React.createElement(Text, {
|
|
76
77
|
bold: true
|
|
@@ -4,12 +4,13 @@ import { createComponent } from "@semcore/core";
|
|
|
4
4
|
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
5
5
|
import { scaleTime, scaleBand, scaleLinear } from "d3-scale";
|
|
6
6
|
import React from "react";
|
|
7
|
-
import
|
|
8
|
-
import StackBar from "../../StackBar.mjs";
|
|
9
|
-
import { HoverRect } from "../../Hover.mjs";
|
|
10
|
-
import { minMax } from "../../utils.mjs";
|
|
7
|
+
import "../../index.mjs";
|
|
11
8
|
import { AbstractChart } from "./AbstractChart.mjs";
|
|
12
9
|
import { localizedMessages } from "../../translations/__intergalactic-dynamic-locales.mjs";
|
|
10
|
+
import { minMax } from "../../utils.mjs";
|
|
11
|
+
import StackBar from "../../StackBar.mjs";
|
|
12
|
+
import Bar from "../../Bar.mjs";
|
|
13
|
+
import { HoverRect } from "../../Hover.mjs";
|
|
13
14
|
class HistogramChartComponent extends AbstractChart {
|
|
14
15
|
get xScale() {
|
|
15
16
|
const {
|
|
@@ -3,11 +3,12 @@ import { createComponent } from "@semcore/core";
|
|
|
3
3
|
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
4
4
|
import { scaleTime, scaleLinear } from "d3-scale";
|
|
5
5
|
import React from "react";
|
|
6
|
-
import
|
|
7
|
-
import { HoverLine } from "../../Hover.mjs";
|
|
8
|
-
import { minMax } from "../../utils.mjs";
|
|
6
|
+
import "../../index.mjs";
|
|
9
7
|
import { AbstractChart } from "./AbstractChart.mjs";
|
|
10
8
|
import { localizedMessages } from "../../translations/__intergalactic-dynamic-locales.mjs";
|
|
9
|
+
import { minMax } from "../../utils.mjs";
|
|
10
|
+
import Line from "../../Line.mjs";
|
|
11
|
+
import { HoverLine } from "../../Hover.mjs";
|
|
11
12
|
class LineChartComponent extends AbstractChart {
|
|
12
13
|
get xScale() {
|
|
13
14
|
const {
|
|
@@ -66,7 +67,7 @@ class LineChartComponent extends AbstractChart {
|
|
|
66
67
|
onClick: onClickLine
|
|
67
68
|
}, showDots && /* @__PURE__ */ React.createElement(Line.Dots, {
|
|
68
69
|
display: true
|
|
69
|
-
}),
|
|
70
|
+
}), area?.[item.id] && /* @__PURE__ */ React.createElement(Line.Area, {
|
|
70
71
|
area: area[item.id],
|
|
71
72
|
y0: "y0",
|
|
72
73
|
y1: "y1",
|
|
@@ -4,8 +4,9 @@ import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
|
4
4
|
import { scaleLinear } from "d3-scale";
|
|
5
5
|
import React from "react";
|
|
6
6
|
import { AbstractChart } from "./AbstractChart.mjs";
|
|
7
|
-
import
|
|
7
|
+
import "../../index.mjs";
|
|
8
8
|
import { localizedMessages } from "../../translations/__intergalactic-dynamic-locales.mjs";
|
|
9
|
+
import Radar from "../../Radar.mjs";
|
|
9
10
|
class RadarChartComponent extends AbstractChart {
|
|
10
11
|
renderChart() {
|
|
11
12
|
const {
|
|
@@ -48,11 +49,9 @@ class RadarChartComponent extends AbstractChart {
|
|
|
48
49
|
}, ({
|
|
49
50
|
index
|
|
50
51
|
}) => {
|
|
51
|
-
var _a;
|
|
52
52
|
return {
|
|
53
|
-
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Radar.Tooltip.Title, null,
|
|
54
|
-
|
|
55
|
-
const value = (_a2 = data[item.id]) == null ? void 0 : _a2[index];
|
|
53
|
+
children: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Radar.Tooltip.Title, null, data[groupKey]?.[index]), dataDefinitions.map((item) => {
|
|
54
|
+
const value = data[item.id]?.[index];
|
|
56
55
|
return item.checked && /* @__PURE__ */ React.createElement(Radar.Tooltip.Dot, {
|
|
57
56
|
color: item.color,
|
|
58
57
|
key: item.id
|
|
@@ -4,10 +4,11 @@ import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
|
4
4
|
import { Text } from "@semcore/typography";
|
|
5
5
|
import { scaleTime, scaleLinear } from "d3-scale";
|
|
6
6
|
import React from "react";
|
|
7
|
-
import
|
|
8
|
-
import { getScatterPlotRadius, minMax } from "../../utils.mjs";
|
|
7
|
+
import "../../index.mjs";
|
|
9
8
|
import { AbstractChart } from "./AbstractChart.mjs";
|
|
10
9
|
import { localizedMessages } from "../../translations/__intergalactic-dynamic-locales.mjs";
|
|
10
|
+
import { getScatterPlotRadius, minMax } from "../../utils.mjs";
|
|
11
|
+
import ScatterPlot from "../../ScatterPlot.mjs";
|
|
11
12
|
class ScatterPlotChartComponent extends AbstractChart {
|
|
12
13
|
get dataKeys() {
|
|
13
14
|
const {
|
|
@@ -4,9 +4,10 @@ import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
|
4
4
|
import { Text } from "@semcore/typography";
|
|
5
5
|
import { scaleLinear } from "d3-scale";
|
|
6
6
|
import React from "react";
|
|
7
|
-
import
|
|
7
|
+
import "../../index.mjs";
|
|
8
8
|
import { AbstractChart } from "./AbstractChart.mjs";
|
|
9
9
|
import { localizedMessages } from "../../translations/__intergalactic-dynamic-locales.mjs";
|
|
10
|
+
import Venn from "../../Venn.mjs";
|
|
10
11
|
class VennChartComponent extends AbstractChart {
|
|
11
12
|
get xScale() {
|
|
12
13
|
const {
|
|
@@ -81,8 +82,7 @@ class VennChartComponent extends AbstractChart {
|
|
|
81
82
|
return null;
|
|
82
83
|
}
|
|
83
84
|
const name = intersectionKeys.map((id) => {
|
|
84
|
-
|
|
85
|
-
return ((_a = dataDefinitions.find((legendItem) => legendItem.id === id)) == null ? void 0 : _a.label) || "";
|
|
85
|
+
return dataDefinitions.find((legendItem) => legendItem.id === id)?.label || "";
|
|
86
86
|
}).join(" & ");
|
|
87
87
|
return /* @__PURE__ */ React.createElement(Venn.Intersection, {
|
|
88
88
|
key: intersectionKey,
|
|
@@ -5,36 +5,31 @@ class BaseLegend extends Component {
|
|
|
5
5
|
constructor(...args) {
|
|
6
6
|
super(...args);
|
|
7
7
|
_defineProperty(this, "onChangeLegendItem", (shape) => (id, checked) => {
|
|
8
|
-
var _a, _b, _c, _d, _e, _f;
|
|
9
8
|
if (shape !== "Checkbox") return;
|
|
10
|
-
|
|
9
|
+
this.props.onChangeVisibleItem?.(id, checked);
|
|
11
10
|
if (checked) {
|
|
12
|
-
|
|
11
|
+
this.props.onMouseEnterItem?.(id);
|
|
13
12
|
} else {
|
|
14
|
-
|
|
13
|
+
this.props.onMouseLeaveItem?.(id);
|
|
15
14
|
}
|
|
16
15
|
});
|
|
17
16
|
_defineProperty(this, "onFocusLegendItem", (checked) => (id) => {
|
|
18
|
-
var _a, _b, _c, _d;
|
|
19
17
|
if (!checked) {
|
|
20
|
-
return
|
|
18
|
+
return this.props.onMouseLeaveItem?.(id);
|
|
21
19
|
}
|
|
22
|
-
|
|
20
|
+
this.props.onMouseEnterItem?.(id);
|
|
23
21
|
});
|
|
24
22
|
_defineProperty(this, "onBlurLegendItem", (id) => {
|
|
25
|
-
|
|
26
|
-
(_b = (_a = this.props).onMouseLeaveItem) == null ? void 0 : _b.call(_a, id);
|
|
23
|
+
this.props.onMouseLeaveItem?.(id);
|
|
27
24
|
});
|
|
28
25
|
_defineProperty(this, "bindOnMouseEnterItem", (id) => {
|
|
29
26
|
return (e) => {
|
|
30
|
-
|
|
31
|
-
(_b = (_a = this.props).onMouseEnterItem) == null ? void 0 : _b.call(_a, id, e);
|
|
27
|
+
this.props.onMouseEnterItem?.(id, e);
|
|
32
28
|
};
|
|
33
29
|
});
|
|
34
30
|
_defineProperty(this, "bindOnMouseLeaveItem", (id) => {
|
|
35
31
|
return (e) => {
|
|
36
|
-
|
|
37
|
-
(_b = (_a = this.props).onMouseLeaveItem) == null ? void 0 : _b.call(_a, id, e);
|
|
32
|
+
this.props.onMouseLeaveItem?.(id, e);
|
|
38
33
|
};
|
|
39
34
|
});
|
|
40
35
|
}
|
|
@@ -53,7 +48,7 @@ class BaseLegend extends Component {
|
|
|
53
48
|
} = this.asProps;
|
|
54
49
|
const dataHintsHandler = dataHints ? makeDataHintsHandlers(dataHints) : void 0;
|
|
55
50
|
items.forEach((legendItem) => {
|
|
56
|
-
dataHintsHandler
|
|
51
|
+
dataHintsHandler?.labelKey("value", legendItem.id, legendItem.label);
|
|
57
52
|
});
|
|
58
53
|
}
|
|
59
54
|
getItem(index) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
import {
|
|
2
|
+
import { sstyled, assignProps, createComponent } from "@semcore/core";
|
|
3
3
|
import { Flex } from "@semcore/base-components";
|
|
4
4
|
import Checkbox from "@semcore/checkbox";
|
|
5
5
|
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
@@ -8,7 +8,6 @@ import React from "react";
|
|
|
8
8
|
import { localizedMessages } from "../../../translations/__intergalactic-dynamic-locales.mjs";
|
|
9
9
|
import { BaseLegend } from "../BaseLegend.mjs";
|
|
10
10
|
import { LegendItemComponent } from "../LegendItem/LegendItem.mjs";
|
|
11
|
-
/*!__reshadow-styles__:"./legend-flex.shadow.css"*/
|
|
12
11
|
const style = (
|
|
13
12
|
/*__reshadow_css_start__*/
|
|
14
13
|
(sstyled.insert(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
import {
|
|
2
|
+
import { sstyled, Component, assignProps, createComponent } from "@semcore/core";
|
|
3
3
|
import { Flex, Box } from "@semcore/base-components";
|
|
4
4
|
import Checkbox from "@semcore/checkbox";
|
|
5
5
|
import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
|
|
@@ -9,7 +9,6 @@ import React from "react";
|
|
|
9
9
|
import { StaticShapes } from "./LegendItem.type.mjs";
|
|
10
10
|
import { PatternSymbol } from "../../../Pattern.mjs";
|
|
11
11
|
import { getChartDefaultColorName } from "../../../utils.mjs";
|
|
12
|
-
/*!__reshadow-styles__:"./legend-item.shadow.css"*/
|
|
13
12
|
const style = (
|
|
14
13
|
/*__reshadow_css_start__*/
|
|
15
14
|
(sstyled.insert(
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
import {
|
|
2
|
+
import { sstyled, assignProps, createComponent } from "@semcore/core";
|
|
3
3
|
import { Box } from "@semcore/base-components";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { BaseLegend } from "../BaseLegend.mjs";
|
|
6
6
|
import { LegendItemComponent } from "../LegendItem/LegendItem.mjs";
|
|
7
|
-
/*!__reshadow-styles__:"./legend-table.shadow.css"*/
|
|
8
7
|
const style = (
|
|
9
8
|
/*__reshadow_css_start__*/
|
|
10
9
|
(sstyled.insert(
|
|
@@ -23,7 +22,6 @@ const style = (
|
|
|
23
22
|
);
|
|
24
23
|
class LegendTableRoot extends BaseLegend {
|
|
25
24
|
render() {
|
|
26
|
-
var _a;
|
|
27
25
|
var _ref = this.asProps, _ref3;
|
|
28
26
|
const SLegendTable = Box;
|
|
29
27
|
const {
|
|
@@ -32,7 +30,7 @@ class LegendTableRoot extends BaseLegend {
|
|
|
32
30
|
size = "m",
|
|
33
31
|
items
|
|
34
32
|
} = this.asProps;
|
|
35
|
-
const columnsCount =
|
|
33
|
+
const columnsCount = items[0]?.columns.length;
|
|
36
34
|
return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SLegendTable, _ref3.cn("SLegendTable", {
|
|
37
35
|
...assignProps({
|
|
38
36
|
"columns-count": columnsCount + 1,
|
|
@@ -30,12 +30,11 @@ class CigaretteBarRoot extends Component {
|
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
_defineProperty(this, "setCursor", (value) => {
|
|
33
|
-
var _a;
|
|
34
33
|
const {
|
|
35
34
|
onClick
|
|
36
35
|
} = this.asProps;
|
|
37
36
|
if (onClick) {
|
|
38
|
-
|
|
37
|
+
this.refElement.current?.style.setProperty("cursor", value);
|
|
39
38
|
}
|
|
40
39
|
});
|
|
41
40
|
}
|
|
@@ -6,7 +6,7 @@ import React from "react";
|
|
|
6
6
|
import Bar, { MIN_HEIGHT } from "../../Bar.mjs";
|
|
7
7
|
import createElement from "../../createElement.mjs";
|
|
8
8
|
import { scaleToBand, getChartDefaultColorName } from "../../utils.mjs";
|
|
9
|
-
const XY0 = Symbol("XY0");
|
|
9
|
+
const XY0 = /* @__PURE__ */ Symbol("XY0");
|
|
10
10
|
class StackGroupBarRoot extends Component {
|
|
11
11
|
constructor(props) {
|
|
12
12
|
super(props);
|
|
@@ -40,11 +40,10 @@ class StackGroupBarRoot extends Component {
|
|
|
40
40
|
this.forceUpdate();
|
|
41
41
|
}
|
|
42
42
|
getSeries(group) {
|
|
43
|
-
var _a, _b;
|
|
44
43
|
const {
|
|
45
44
|
data
|
|
46
45
|
} = this.asProps;
|
|
47
|
-
return
|
|
46
|
+
return this.stacks[group]?.(data);
|
|
48
47
|
}
|
|
49
48
|
getBarProps({
|
|
50
49
|
y,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import {
|
|
2
|
+
import { CONTEXT_COMPONENT, createBaseComponent, createComponent } from "@semcore/core";
|
|
3
3
|
import assignProps from "@semcore/core/lib/utils/assignProps";
|
|
4
4
|
import getOriginChildren from "@semcore/core/lib/utils/getOriginChildren";
|
|
5
5
|
import propsForElement from "@semcore/core/lib/utils/propsForElement";
|
package/lib/esm/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as default2 } from "./Plot.mjs";
|
|
2
|
+
import "./component/ChartLegend/index.mjs";
|
|
2
3
|
import { default as default3 } from "./component/Chart/index.mjs";
|
|
3
4
|
import { default as default4 } from "./component/StackGroupBar/StackGroupBar.mjs";
|
|
4
5
|
import { SvgElement } from "./component/SvgElement.mjs";
|
package/lib/esm/utils.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import EventEmitter from "@semcore/core/lib/utils/eventEmitter";
|
|
2
2
|
import { extent, bisector } from "d3-array";
|
|
3
|
-
import {
|
|
3
|
+
import { scaleQuantize, scaleBand, scaleSqrt } from "d3-scale";
|
|
4
4
|
const eventToPoint = (event, svgRoot) => {
|
|
5
5
|
const node = event.currentTarget || event.target;
|
|
6
6
|
const rect = svgRoot.getBoundingClientRect();
|
|
@@ -163,7 +163,7 @@ const measureText = memoize((text, fontSize) => {
|
|
|
163
163
|
});
|
|
164
164
|
let idCounter = 0;
|
|
165
165
|
const uniqueId = (prefix = "id-") => `${prefix}${idCounter++}`;
|
|
166
|
-
const interpolateValue = Symbol("intergalactic-d3-chart-line-interpolate");
|
|
166
|
+
const interpolateValue = /* @__PURE__ */ Symbol("intergalactic-d3-chart-line-interpolate");
|
|
167
167
|
const getChartDefaultColorName = (index) => {
|
|
168
168
|
index++;
|
|
169
169
|
if (index < 1) index = 1;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/d3-chart",
|
|
3
3
|
"description": "Semrush D3 Chart Component",
|
|
4
|
-
"version": "17.0.0-prerelease.
|
|
4
|
+
"version": "17.0.0-prerelease.37",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/esm/index.mjs",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@formatjs/intl": "2.3.0",
|
|
18
|
-
"@semcore/checkbox": "^17.0.0-prerelease.
|
|
19
|
-
"@semcore/divider": "^17.0.0-prerelease.
|
|
20
|
-
"@semcore/typography": "^17.0.0-prerelease.
|
|
18
|
+
"@semcore/checkbox": "^17.0.0-prerelease.37",
|
|
19
|
+
"@semcore/divider": "^17.0.0-prerelease.37",
|
|
20
|
+
"@semcore/typography": "^17.0.0-prerelease.37",
|
|
21
21
|
"@types/d3-shape": "^3.1.7",
|
|
22
22
|
"@upsetjs/venn.js": "1.4.2",
|
|
23
23
|
"d3-array": "3.1.6",
|
|
@@ -44,16 +44,16 @@
|
|
|
44
44
|
"@types/d3-array": "^3.2.1",
|
|
45
45
|
"@types/d3-scale": "^4.0.9",
|
|
46
46
|
"@types/d3-transition": "^3.0.9",
|
|
47
|
-
"@semcore/core": "17.0.0-prerelease.
|
|
48
|
-
"@semcore/base-components": "17.0.0-prerelease.
|
|
49
|
-
"@semcore/
|
|
50
|
-
"@semcore/checkbox": "17.0.0-prerelease.
|
|
51
|
-
"@semcore/
|
|
52
|
-
"@semcore/
|
|
53
|
-
"@semcore/ellipsis": "16.0.12-prerelease.
|
|
54
|
-
"@semcore/icon": "16.7.2-prerelease.
|
|
47
|
+
"@semcore/core": "17.0.0-prerelease.37",
|
|
48
|
+
"@semcore/base-components": "17.0.0-prerelease.37",
|
|
49
|
+
"@semcore/button": "17.0.0-prerelease.37",
|
|
50
|
+
"@semcore/checkbox": "17.0.0-prerelease.37",
|
|
51
|
+
"@semcore/dropdown-menu": "17.0.0-prerelease.37",
|
|
52
|
+
"@semcore/divider": "17.0.0-prerelease.37",
|
|
53
|
+
"@semcore/ellipsis": "16.0.12-prerelease.37",
|
|
54
|
+
"@semcore/icon": "16.7.2-prerelease.37",
|
|
55
55
|
"@semcore/testing-utils": "1.0.0",
|
|
56
|
-
"@semcore/typography": "17.0.0-prerelease.
|
|
56
|
+
"@semcore/typography": "17.0.0-prerelease.37"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "pnpm semcore-builder --source=js,ts && pnpm vite build"
|