@semcore/d3-chart 17.0.0-prerelease.9 → 17.0.1
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 +20 -1
- package/lib/cjs/Area.js +11 -11
- package/lib/cjs/Axis.js +16 -16
- package/lib/cjs/Bar.js +16 -16
- package/lib/cjs/Bubble.js +20 -15
- package/lib/cjs/Bubble.js.map +1 -1
- package/lib/cjs/CompactHorizontalBar.js +16 -16
- package/lib/cjs/Donut.js +9 -9
- package/lib/cjs/Dots.js +8 -8
- package/lib/cjs/HorizontalBar.js +16 -16
- package/lib/cjs/Hover.js +3 -3
- package/lib/cjs/Line.js +9 -9
- package/lib/cjs/Plot.js +2 -2
- package/lib/cjs/Radar.js +19 -19
- package/lib/cjs/RadialTree.js +12 -12
- package/lib/cjs/Reference.js +12 -12
- package/lib/cjs/ScatterPlot.js +9 -9
- package/lib/cjs/Tooltip.js +9 -9
- package/lib/cjs/Venn.js +9 -9
- package/lib/cjs/a11y/PlotA11yModule.js +2 -2
- package/lib/cjs/a11y/PlotA11yView.js +7 -7
- package/lib/cjs/a11y/PlotA11yView.js.map +1 -1
- package/lib/cjs/component/Chart/AbstractChart.js +9 -21
- package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.js +197 -57
- package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +17 -17
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +6 -6
- package/lib/cjs/style/bubble.shadow.css +4 -0
- package/lib/cjs/utils.js +3 -2
- package/lib/cjs/utils.js.map +1 -1
- package/lib/es6/Area.js +11 -11
- package/lib/es6/Axis.js +16 -16
- package/lib/es6/Bar.js +16 -16
- package/lib/es6/Bubble.js +20 -15
- package/lib/es6/Bubble.js.map +1 -1
- package/lib/es6/CompactHorizontalBar.js +16 -16
- package/lib/es6/Donut.js +9 -9
- package/lib/es6/Dots.js +8 -8
- package/lib/es6/HorizontalBar.js +16 -16
- package/lib/es6/Hover.js +3 -3
- package/lib/es6/Line.js +9 -9
- package/lib/es6/Plot.js +2 -2
- package/lib/es6/Radar.js +19 -19
- package/lib/es6/RadialTree.js +12 -12
- package/lib/es6/Reference.js +12 -12
- package/lib/es6/ScatterPlot.js +9 -9
- package/lib/es6/Tooltip.js +9 -9
- package/lib/es6/Venn.js +9 -9
- package/lib/es6/a11y/PlotA11yModule.js +2 -2
- package/lib/es6/a11y/PlotA11yView.js +6 -5
- package/lib/es6/a11y/PlotA11yView.js.map +1 -1
- package/lib/es6/component/Chart/AbstractChart.js +9 -21
- package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
- package/lib/es6/component/Chart/CigaretteChart.js +199 -59
- package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/es6/component/Chart/CigaretteChart.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +17 -17
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +6 -6
- package/lib/es6/style/bubble.shadow.css +4 -0
- package/lib/es6/utils.js +3 -2
- package/lib/es6/utils.js.map +1 -1
- package/lib/esm/AnimatedClipPath.mjs +1 -1
- package/lib/esm/Area.mjs +14 -14
- package/lib/esm/Axis.mjs +21 -23
- package/lib/esm/Bar.mjs +18 -18
- package/lib/esm/Bubble.mjs +24 -20
- package/lib/esm/CompactHorizontalBar.mjs +21 -20
- package/lib/esm/Donut.mjs +15 -13
- package/lib/esm/Dots.mjs +10 -10
- package/lib/esm/HorizontalBar.mjs +18 -18
- package/lib/esm/Hover.mjs +6 -6
- package/lib/esm/Line.mjs +12 -12
- package/lib/esm/Pattern.mjs +6 -7
- package/lib/esm/Plot.mjs +6 -7
- package/lib/esm/Radar.mjs +27 -29
- package/lib/esm/RadialTree.mjs +30 -75
- package/lib/esm/Reference.mjs +13 -13
- package/lib/esm/ResponsiveContainer.mjs +3 -5
- package/lib/esm/ScatterPlot.mjs +12 -11
- package/lib/esm/StackBar.mjs +2 -2
- package/lib/esm/StackedArea.mjs +2 -2
- package/lib/esm/Tooltip.mjs +15 -17
- package/lib/esm/Venn.mjs +13 -12
- package/lib/esm/a11y/DataAccessibilityTable.mjs +2 -4
- package/lib/esm/a11y/PlotA11yModule.mjs +5 -4
- package/lib/esm/a11y/PlotA11yView.mjs +14 -21
- 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 +25 -38
- 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 +204 -64
- 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 +6 -6
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +19 -19
- package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +9 -10
- 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/style/bubble.shadow.css +4 -0
- package/lib/esm/utils.mjs +3 -3
- package/lib/types/a11y/PlotA11yView.d.ts +1 -1
- package/lib/types/component/Chart/AbstractChart.d.ts +4 -7
- package/lib/types/component/Chart/CigaretteChart.type.d.ts +7 -4
- package/package.json +17 -17
|
@@ -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";
|
|
@@ -14,27 +14,27 @@ const style = (
|
|
|
14
14
|
/*__reshadow_css_start__*/
|
|
15
15
|
(sstyled.insert(
|
|
16
16
|
/*__inner_css_start__*/
|
|
17
|
-
'.
|
|
17
|
+
'.___SLegendItem_11yr1_gg_{min-width:0;align-items:flex-start}@media (hover:hover){.___SLegendItem_11yr1_gg_:hover{cursor:pointer}.___SLegendItem_11yr1_gg_.__disabled_11yr1_gg_:hover{cursor:default}}.___SPointShape_11yr1_gg_.__color_11yr1_gg_{background-color:var(--color_11yr1);margin-right:8px;flex-shrink:0}.___SPointShape_11yr1_gg_._shape_Circle_11yr1_gg_._size_l_11yr1_gg_{width:16px;height:16px;border-radius:8px;margin-top:4px}.___SPointShape_11yr1_gg_._shape_Circle_11yr1_gg_._size_m_11yr1_gg_{width:12px;height:12px;border-radius:6px;margin-top:4px}.___SPointShape_11yr1_gg_._shape_Line_11yr1_gg_._size_l_11yr1_gg_{width:16px;height:4px;border-radius:3px;margin-top:9px}.___SPointShape_11yr1_gg_._shape_Line_11yr1_gg_._size_m_11yr1_gg_{width:12px;height:4px;border-radius:3px;margin-top:8px}.___SPointShape_11yr1_gg_._shape_Square_11yr1_gg_._size_l_11yr1_gg_{width:16px;height:16px;border-radius:2px;margin-top:4px}.___SPointShape_11yr1_gg_._shape_Square_11yr1_gg_._size_m_11yr1_gg_{width:12px;height:12px;border-radius:2px;margin-top:4px}.___SPointShape_11yr1_gg_._shape_Pattern_11yr1_gg_{background-color:transparent;margin-right:4px}.___SIcon_11yr1_gg_{line-height:0;margin-right:4px}.___SIcon_11yr1_gg_._size_l_11yr1_gg_{margin-top:4px}.___SIcon_11yr1_gg_._size_m_11yr1_gg_{margin-top:2px}.___SLabel_11yr1_gg_{min-width:0}.___SAdditionalLabel_11yr1_gg_._size_l_11yr1_gg_,.___SCount_11yr1_gg_._size_l_11yr1_gg_,.___SLabel_11yr1_gg_._size_l_11yr1_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SAdditionalLabel_11yr1_gg_._size_m_11yr1_gg_,.___SCount_11yr1_gg_._size_m_11yr1_gg_,.___SLabel_11yr1_gg_._size_m_11yr1_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SAdditionalLabel_11yr1_gg_,.___SCount_11yr1_gg_{margin-left:4px}.___SAdditionalLabel_11yr1_gg_{white-space:nowrap;display:flex;align-items:flex-start}.___SAdditionalLabel_11yr1_gg_::before{content:"";display:inline-block;background-color:var(--intergalactic-text-secondary, #6c6e79);height:4px;width:4px;border-radius:2px;margin-right:4px}.___SAdditionalLabel_11yr1_gg_._size_l_11yr1_gg_::before{margin-top:10px}.___SAdditionalLabel_11yr1_gg_._size_m_11yr1_gg_::before{margin-top:8px}.___SPatternSymbol_11yr1_gg_{transform:scale(.8)}',
|
|
18
18
|
/*__inner_css_end__*/
|
|
19
|
-
"
|
|
19
|
+
"11yr1_gg_"
|
|
20
20
|
), /*__reshadow_css_end__*/
|
|
21
21
|
{
|
|
22
|
-
"__SLegendItem": "
|
|
23
|
-
"_disabled": "
|
|
24
|
-
"__SPointShape": "
|
|
25
|
-
"_color": "
|
|
26
|
-
"--color": "--
|
|
27
|
-
"_shape_Circle": "
|
|
28
|
-
"_size_l": "
|
|
29
|
-
"_size_m": "
|
|
30
|
-
"_shape_Line": "
|
|
31
|
-
"_shape_Square": "
|
|
32
|
-
"_shape_Pattern": "
|
|
33
|
-
"__SIcon": "
|
|
34
|
-
"__SLabel": "
|
|
35
|
-
"__SAdditionalLabel": "
|
|
36
|
-
"__SCount": "
|
|
37
|
-
"__SPatternSymbol": "
|
|
22
|
+
"__SLegendItem": "___SLegendItem_11yr1_gg_",
|
|
23
|
+
"_disabled": "__disabled_11yr1_gg_",
|
|
24
|
+
"__SPointShape": "___SPointShape_11yr1_gg_",
|
|
25
|
+
"_color": "__color_11yr1_gg_",
|
|
26
|
+
"--color": "--color_11yr1",
|
|
27
|
+
"_shape_Circle": "_shape_Circle_11yr1_gg_",
|
|
28
|
+
"_size_l": "_size_l_11yr1_gg_",
|
|
29
|
+
"_size_m": "_size_m_11yr1_gg_",
|
|
30
|
+
"_shape_Line": "_shape_Line_11yr1_gg_",
|
|
31
|
+
"_shape_Square": "_shape_Square_11yr1_gg_",
|
|
32
|
+
"_shape_Pattern": "_shape_Pattern_11yr1_gg_",
|
|
33
|
+
"__SIcon": "___SIcon_11yr1_gg_",
|
|
34
|
+
"__SLabel": "___SLabel_11yr1_gg_",
|
|
35
|
+
"__SAdditionalLabel": "___SAdditionalLabel_11yr1_gg_",
|
|
36
|
+
"__SCount": "___SCount_11yr1_gg_",
|
|
37
|
+
"__SPatternSymbol": "___SPatternSymbol_11yr1_gg_"
|
|
38
38
|
})
|
|
39
39
|
);
|
|
40
40
|
const enhance = [resolveColorEnhance(), uniqueIDEnhancement()];
|
|
@@ -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 } from "@semcore/base-components";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { BaseLegend } from "../BaseLegend.mjs";
|
|
@@ -9,21 +9,20 @@ const style = (
|
|
|
9
9
|
/*__reshadow_css_start__*/
|
|
10
10
|
(sstyled.insert(
|
|
11
11
|
/*__inner_css_start__*/
|
|
12
|
-
'.
|
|
12
|
+
'.___SLegendTable_1ep80_gg_.__columns-count_1ep80_gg_{font-feature-settings:"tnum";font-variant-numeric:tabular-nums;display:grid;grid-template-columns:auto .2fr;align-items:center;height:-moz-fit-content;height:fit-content;grid-column-gap:16px;grid-row-gap:8px}.___SColumnItem_1ep80_gg_._size_l_1ep80_gg_{font-size:var(--intergalactic-fs-300, 16px);text-align:right}.___SColumnItem_1ep80_gg_._size_m_1ep80_gg_{font-size:var(--intergalactic-fs-200, 14px);text-align:right}',
|
|
13
13
|
/*__inner_css_end__*/
|
|
14
|
-
"
|
|
14
|
+
"1ep80_gg_"
|
|
15
15
|
), /*__reshadow_css_end__*/
|
|
16
16
|
{
|
|
17
|
-
"__SLegendTable": "
|
|
18
|
-
"_columns-count": "__columns-
|
|
19
|
-
"__SColumnItem": "
|
|
20
|
-
"_size_l": "
|
|
21
|
-
"_size_m": "
|
|
17
|
+
"__SLegendTable": "___SLegendTable_1ep80_gg_",
|
|
18
|
+
"_columns-count": "__columns-count_1ep80_gg_",
|
|
19
|
+
"__SColumnItem": "___SColumnItem_1ep80_gg_",
|
|
20
|
+
"_size_l": "_size_l_1ep80_gg_",
|
|
21
|
+
"_size_m": "_size_m_1ep80_gg_"
|
|
22
22
|
})
|
|
23
23
|
);
|
|
24
24
|
class LegendTableRoot extends BaseLegend {
|
|
25
25
|
render() {
|
|
26
|
-
var _a;
|
|
27
26
|
var _ref = this.asProps, _ref3;
|
|
28
27
|
const SLegendTable = Box;
|
|
29
28
|
const {
|
|
@@ -32,7 +31,7 @@ class LegendTableRoot extends BaseLegend {
|
|
|
32
31
|
size = "m",
|
|
33
32
|
items
|
|
34
33
|
} = this.asProps;
|
|
35
|
-
const columnsCount =
|
|
34
|
+
const columnsCount = items[0]?.columns.length;
|
|
36
35
|
return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SLegendTable, _ref3.cn("SLegendTable", {
|
|
37
36
|
...assignProps({
|
|
38
37
|
"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;
|
|
@@ -205,7 +205,7 @@ const calculateBubbleDomain = (data, key, range) => {
|
|
|
205
205
|
const maxValueShift = valueScale(maxestValue) * pixelRatio;
|
|
206
206
|
min -= minValueShift * 2;
|
|
207
207
|
max += maxValueShift * 2;
|
|
208
|
-
return [min, max];
|
|
208
|
+
return [Math.floor(min), Math.floor(max)];
|
|
209
209
|
};
|
|
210
210
|
const PlotEventEmitter = EventEmitter;
|
|
211
211
|
export {
|
|
@@ -11,4 +11,4 @@ export type A11yViewProps = {
|
|
|
11
11
|
triggerRef: React.RefObject<HTMLElement>;
|
|
12
12
|
onCloseHandler: () => void;
|
|
13
13
|
};
|
|
14
|
-
export declare
|
|
14
|
+
export declare function PlotA11yView({ id, payload: providedData, hints, plotLabel, triggerRef, plotRef, config: providedConfig, locale, onCloseHandler, }: A11yViewProps): React.ReactElement;
|
|
@@ -5,7 +5,7 @@ import type { BaseChartProps, BaseLegendProps, ListData, ObjectData } from './Ab
|
|
|
5
5
|
import type { HoverLine, HoverRect } from '../..';
|
|
6
6
|
import { interpolateValue } from '../../utils';
|
|
7
7
|
import type { LegendItem } from '../ChartLegend/LegendItem/LegendItem.type';
|
|
8
|
-
type ChartState = {
|
|
8
|
+
export type ChartState = {
|
|
9
9
|
dataDefinitions: Array<LegendItem & {
|
|
10
10
|
columns: React.ReactNode[];
|
|
11
11
|
}>;
|
|
@@ -13,7 +13,7 @@ type ChartState = {
|
|
|
13
13
|
withTrend: boolean;
|
|
14
14
|
};
|
|
15
15
|
export declare const NOT_A_VALUE = "n/a";
|
|
16
|
-
export declare abstract class AbstractChart<
|
|
16
|
+
export declare abstract class AbstractChart<Data extends ListData | ObjectData, Props extends BaseChartProps<Data>, Enhancers extends readonly ((...args: any[]) => any)[] = [], DefaultProps = {}, State extends ChartState = ChartState> extends Component<Props, Enhancers, Readonly<{}>, DefaultProps, State> {
|
|
17
17
|
static style: {
|
|
18
18
|
[key: string]: string;
|
|
19
19
|
};
|
|
@@ -23,9 +23,8 @@ export declare abstract class AbstractChart<D extends ListData | ObjectData, T e
|
|
|
23
23
|
*/
|
|
24
24
|
protected plotPadding: number;
|
|
25
25
|
protected dataHints: import("../../a11y/hints").DataStructureHints;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
componentDidUpdate(prevProps: T): void;
|
|
26
|
+
constructor(props: Props);
|
|
27
|
+
componentDidUpdate(prevProps: Props): void;
|
|
29
28
|
protected getDefaultDataDefinitions(): Array<LegendItem & {
|
|
30
29
|
columns: React.ReactNode[];
|
|
31
30
|
}>;
|
|
@@ -40,7 +39,6 @@ export declare abstract class AbstractChart<D extends ListData | ObjectData, T e
|
|
|
40
39
|
protected get flatValues(): Set<number>;
|
|
41
40
|
protected get maxStackedValue(): number;
|
|
42
41
|
protected totalValue(data: ObjectData): number;
|
|
43
|
-
protected percentValue(data: ObjectData, key: string): string;
|
|
44
42
|
protected getValueScale(values: number[]): number;
|
|
45
43
|
protected setHighlightedLine(index: number): void;
|
|
46
44
|
protected handleChangeVisible(id: string, isVisible: boolean): void;
|
|
@@ -59,4 +57,3 @@ export declare abstract class AbstractChart<D extends ListData | ObjectData, T e
|
|
|
59
57
|
protected renderTooltipTotalLine<D extends ObjectData>(dataItem: D): React.JSX.Element | null;
|
|
60
58
|
render(): React.ReactNode;
|
|
61
59
|
}
|
|
62
|
-
export {};
|
|
@@ -2,8 +2,8 @@ import type { Intergalactic } from '@semcore/core';
|
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
import type { BaseChartProps } from './AbstractChart.type';
|
|
4
4
|
import type { interpolateValue } from '../../utils';
|
|
5
|
-
type
|
|
6
|
-
export type CigaretteChartData = Record<
|
|
5
|
+
export type CigaretteChartDataKey = string;
|
|
6
|
+
export type CigaretteChartData = Record<CigaretteChartDataKey, number | typeof interpolateValue>;
|
|
7
7
|
export type CigaretteChartProps = Intergalactic.InternalTypings.EfficientOmit<BaseChartProps<CigaretteChartData>, 'xScale' | 'yScale'> & {
|
|
8
8
|
/** Title text displayed in the tooltip */
|
|
9
9
|
tooltipTitle?: string;
|
|
@@ -11,12 +11,15 @@ export type CigaretteChartProps = Intergalactic.InternalTypings.EfficientOmit<Ba
|
|
|
11
11
|
tooltipViewType?: 'all' | 'single';
|
|
12
12
|
/** Show percent value in tooltip */
|
|
13
13
|
showPercentValueInTooltip?: boolean;
|
|
14
|
+
/** Custom percent formatter. */
|
|
15
|
+
percentFormatter?: (value: number) => number;
|
|
14
16
|
/** Header content for the chart */
|
|
15
17
|
header?: React.ReactNode;
|
|
16
18
|
/** Animation duration in milliseconds */
|
|
17
19
|
duration?: number;
|
|
18
20
|
/** Click handler that receives the data key and event */
|
|
19
|
-
onClick?: (key:
|
|
21
|
+
onClick?: (key: CigaretteChartDataKey, event: React.SyntheticEvent) => void;
|
|
22
|
+
/** Minimal bar width in pixels. Default is `2`. */
|
|
23
|
+
minimalBarWidth?: number;
|
|
20
24
|
};
|
|
21
25
|
export type CigaretteChartType = Intergalactic.Component<'div', CigaretteChartProps>;
|
|
22
|
-
export {};
|
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.
|
|
4
|
+
"version": "17.0.1",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/esm/index.mjs",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
"author": "UI-kit team <ui-kit-team@semrush.com>",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"exports": {
|
|
12
|
-
"
|
|
12
|
+
"types": "./lib/types/index.d.ts",
|
|
13
13
|
"import": "./lib/esm/index.mjs",
|
|
14
|
-
"
|
|
14
|
+
"require": "./lib/cjs/index.js"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@formatjs/intl": "2.3.0",
|
|
18
|
-
"@semcore/checkbox": "
|
|
19
|
-
"@semcore/divider": "
|
|
20
|
-
"@semcore/typography": "
|
|
18
|
+
"@semcore/checkbox": "^17.0.1",
|
|
19
|
+
"@semcore/divider": "^17.0.1",
|
|
20
|
+
"@semcore/typography": "^17.0.1",
|
|
21
21
|
"@types/d3-shape": "^3.1.7",
|
|
22
22
|
"@upsetjs/venn.js": "1.4.2",
|
|
23
23
|
"d3-array": "3.1.6",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"hoist-non-react-statics": "3.3.2"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@semcore/base-components": "^
|
|
35
|
-
"@semcore/icon": "^
|
|
34
|
+
"@semcore/base-components": "^17.0.1",
|
|
35
|
+
"@semcore/icon": "^17.0.1"
|
|
36
36
|
},
|
|
37
37
|
"repository": {
|
|
38
38
|
"type": "git",
|
|
@@ -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": "
|
|
48
|
-
"@semcore/base-components": "
|
|
49
|
-
"@semcore/
|
|
50
|
-
"@semcore/
|
|
51
|
-
"@semcore/
|
|
52
|
-
"@semcore/
|
|
53
|
-
"@semcore/
|
|
47
|
+
"@semcore/core": "17.0.1",
|
|
48
|
+
"@semcore/base-components": "17.0.1",
|
|
49
|
+
"@semcore/icon": "17.0.1",
|
|
50
|
+
"@semcore/button": "17.0.1",
|
|
51
|
+
"@semcore/checkbox": "17.0.1",
|
|
52
|
+
"@semcore/divider": "17.0.1",
|
|
53
|
+
"@semcore/dropdown-menu": "17.0.1",
|
|
54
|
+
"@semcore/ellipsis": "17.0.1",
|
|
54
55
|
"@semcore/testing-utils": "1.0.0",
|
|
55
|
-
"@semcore/typography": "
|
|
56
|
-
"@semcore/icon": "16.7.2-prerelease.9"
|
|
56
|
+
"@semcore/typography": "17.0.1"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "pnpm semcore-builder --source=js,ts && pnpm vite build"
|