@evergis/charts 2.0.16 → 2.0.17
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/dist/charts/LineChart/types.d.ts +3 -1
- package/dist/charts.cjs.development.js +19 -13
- package/dist/charts.cjs.development.js.map +1 -1
- package/dist/charts.cjs.production.min.js +1 -1
- package/dist/charts.cjs.production.min.js.map +1 -1
- package/dist/charts.esm.js +19 -13
- package/dist/charts.esm.js.map +1 -1
- package/package.json +2 -2
|
@@ -51,7 +51,7 @@ export declare type LineChartProps = {
|
|
|
51
51
|
xScaleItemWidth?: number;
|
|
52
52
|
};
|
|
53
53
|
export declare type LineChartDot = {
|
|
54
|
-
radius
|
|
54
|
+
radius?: number;
|
|
55
55
|
style?: string;
|
|
56
56
|
filter?: (value: LineChartData, index: number, circles: (d3.BaseType | SVGCircleElement)[] | ArrayLike<d3.BaseType | SVGCircleElement>) => boolean;
|
|
57
57
|
};
|
|
@@ -65,7 +65,9 @@ export declare type LineChartData = {
|
|
|
65
65
|
style?: string;
|
|
66
66
|
dot?: LineChartDot;
|
|
67
67
|
dynamicDotStyle?: string;
|
|
68
|
+
dynamicDotOff?: boolean;
|
|
68
69
|
areaStyle?: string;
|
|
70
|
+
tooltipOrder?: number;
|
|
69
71
|
};
|
|
70
72
|
export declare type LineChartDatas = Omit<LineChartData, 'values'> & {
|
|
71
73
|
value: number | null;
|
|
@@ -1721,16 +1721,21 @@ const drawTooltip$1 = (_ref) => {
|
|
|
1721
1721
|
const mouseRect = mouseGlobal.append('rect').attr('width', x2 - x1).attr('height', Math.abs(y1 - y2)).attr('class', lineChartClassNames.lineChartMouseRect).attr('transform', "translate(" + x1 + ", " + y2 + ")");
|
|
1722
1722
|
const mouseLine = mouseGlobal.append('path').attr('class', lineChartClassNames.lineChartMouseLine).style('opacity', '0');
|
|
1723
1723
|
const lines = svg.selectAll("." + lineChartClassNames.lineChartLine).nodes();
|
|
1724
|
-
const circles = mouseGlobal.selectAll('circle').data(chartData
|
|
1724
|
+
const circles = mouseGlobal.selectAll('circle').data(chartData.filter((_ref3) => {
|
|
1725
1725
|
let {
|
|
1726
|
-
|
|
1726
|
+
dynamicDotOff
|
|
1727
1727
|
} = _ref3;
|
|
1728
|
-
return
|
|
1729
|
-
}).attr('
|
|
1728
|
+
return !dynamicDotOff;
|
|
1729
|
+
})).join('circle').attr('class', lineChartClassNames.lineChartMouseCircle).attr('r', dynamicCircleRadius).attr('fill', (_ref4) => {
|
|
1730
1730
|
let {
|
|
1731
1731
|
stroke
|
|
1732
1732
|
} = _ref4;
|
|
1733
1733
|
return stroke || 'none';
|
|
1734
|
+
}).attr('stroke', (_ref5) => {
|
|
1735
|
+
let {
|
|
1736
|
+
stroke
|
|
1737
|
+
} = _ref5;
|
|
1738
|
+
return stroke || 'none';
|
|
1734
1739
|
}).style('opacity', '0');
|
|
1735
1740
|
let labelContainer = d3.select("." + lineChartClassNames.lineChartMouseLabelContainer);
|
|
1736
1741
|
|
|
@@ -1791,27 +1796,27 @@ const drawTooltip$1 = (_ref) => {
|
|
|
1791
1796
|
circles.attr('transform', (lineChartData, index) => {
|
|
1792
1797
|
const value = getValue(lineChartData.values);
|
|
1793
1798
|
return positions[index] && value ? 'translate(' + x + ',' + positions[index].y + ')' : 'translate(-9999, -9999)';
|
|
1794
|
-
}).attr('style', (
|
|
1799
|
+
}).attr('style', (_ref6) => {
|
|
1795
1800
|
let {
|
|
1796
1801
|
dynamicDotStyle
|
|
1797
|
-
} =
|
|
1802
|
+
} = _ref6;
|
|
1798
1803
|
return dynamicDotStyle || '';
|
|
1799
1804
|
});
|
|
1800
|
-
const datas = chartData.map((
|
|
1805
|
+
const datas = chartData.map((_ref7, i) => {
|
|
1801
1806
|
let {
|
|
1802
1807
|
values
|
|
1803
|
-
} =
|
|
1804
|
-
rest = _objectWithoutPropertiesLoose(
|
|
1808
|
+
} = _ref7,
|
|
1809
|
+
rest = _objectWithoutPropertiesLoose(_ref7, ["values"]);
|
|
1805
1810
|
|
|
1806
1811
|
return _extends({}, rest, {
|
|
1807
1812
|
value: getValue(values),
|
|
1808
1813
|
invertValue: positions[i] ? yScale.invert(positions[i].y) : 0
|
|
1809
1814
|
});
|
|
1810
1815
|
});
|
|
1811
|
-
const noHasData = datas.every((
|
|
1816
|
+
const noHasData = datas.every((_ref8) => {
|
|
1812
1817
|
let {
|
|
1813
1818
|
value
|
|
1814
|
-
} =
|
|
1819
|
+
} = _ref8;
|
|
1815
1820
|
return isVoid(value);
|
|
1816
1821
|
});
|
|
1817
1822
|
|
|
@@ -1826,7 +1831,8 @@ const drawTooltip$1 = (_ref) => {
|
|
|
1826
1831
|
|
|
1827
1832
|
const prevValue = (_datas$Number = datas[Number(acc)]) == null ? void 0 : _datas$Number.value;
|
|
1828
1833
|
const value = (_datas$Number2 = datas[Number(key)]) == null ? void 0 : _datas$Number2.value;
|
|
1829
|
-
|
|
1834
|
+
const dynamicDotOff = argData == null ? void 0 : argData[index].dynamicDotOff;
|
|
1835
|
+
return index === 0 || isVoid(value) || dynamicDotOff ? acc : isVoid(prevValue) || positions[acc].y > positions[key].y ? key : acc;
|
|
1830
1836
|
}, '0');
|
|
1831
1837
|
const labelTexts = labels && labels.style('left', left + "px").style('top', (_, i) => {
|
|
1832
1838
|
const index = typeof stackedTooltipIndex === 'number' ? stackedTooltipIndex : stackedTooltip ? topIndex : i;
|
|
@@ -2072,7 +2078,7 @@ const draw$3 = (node, props) => {
|
|
|
2072
2078
|
filter
|
|
2073
2079
|
} = dot;
|
|
2074
2080
|
const dotsGroup = dotsGlobal.append('g').attr('class', lineChartClassNames.lineChartDotsGlobal);
|
|
2075
|
-
dotsGroup.selectAll('circle').data(values).join('circle').attr('cx', (_, index) => xScale(index)).attr('class', lineChartClassNames.lineChartDot).attr('cy', d => yScale(d)).attr('r', radius).attr('style', style || '');
|
|
2081
|
+
dotsGroup.selectAll('circle').data(values).join('circle').attr('cx', (_, index) => xScale(index)).attr('class', lineChartClassNames.lineChartDot).attr('cy', d => yScale(d)).attr('r', radius || 0).attr('style', style || '');
|
|
2076
2082
|
|
|
2077
2083
|
if (filter) {
|
|
2078
2084
|
dotsGroup.selectAll('circle').select((_, i, g) => filter(item, i, g) ? g[i] : null).remove();
|