@fluentui/react-charts 0.0.0-nightly-20250826-0412.1 → 0.0.0-nightly-20250826-2140.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 +15 -48
- package/dist/index.d.ts +1 -15
- package/lib/components/AreaChart/AreaChart.js +1 -4
- package/lib/components/AreaChart/AreaChart.js.map +1 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.js +2 -2
- package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +15 -3
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.js +24 -24
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +14 -17
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +33 -6
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +16 -32
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +1 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +199 -294
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.js +1 -6
- package/lib/components/DonutChart/DonutChart.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.js +4 -21
- package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +4 -8
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +4 -23
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +17 -4
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +21 -4
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.js +114 -175
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +6 -26
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +81 -111
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/LineChart/LineChart.types.js.map +1 -1
- package/lib/components/LineChart/useLineChartStyles.styles.js +10 -23
- package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js +21 -4
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +25 -12
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js +12 -2
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js +30 -49
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js +7 -27
- package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +14 -8
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js +4 -27
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +6 -8
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +19 -5
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +44 -61
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +6 -7
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +19 -4
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
- package/lib/utilities/SVGTooltipText.js.map +1 -1
- package/lib/utilities/index.js +0 -1
- package/lib/utilities/index.js.map +1 -1
- package/lib/utilities/utilities.js +29 -0
- package/lib/utilities/utilities.js.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.js +1 -4
- package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +14 -2
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.js +24 -24
- package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +13 -15
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +32 -4
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +15 -31
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +198 -302
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.js +1 -6
- package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +4 -32
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +4 -8
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +3 -22
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +19 -2
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +20 -3
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +113 -174
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +5 -25
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.js +81 -111
- package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +9 -30
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +20 -2
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +33 -23
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +12 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.js +30 -49
- package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +5 -37
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +13 -7
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +3 -26
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +3 -5
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +17 -3
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +43 -60
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +3 -5
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +18 -3
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
- package/lib-commonjs/utilities/index.js +0 -1
- package/lib-commonjs/utilities/index.js.map +1 -1
- package/lib-commonjs/utilities/utilities.js +32 -0
- package/lib-commonjs/utilities/utilities.js.map +1 -1
- package/package.json +12 -12
- package/lib/utilities/Common.styles.js +0 -47
- package/lib/utilities/Common.styles.js.map +0 -1
- package/lib/utilities/Common.styles.raw.js +0 -47
- package/lib/utilities/Common.styles.raw.js.map +0 -1
- package/lib-commonjs/utilities/Common.styles.js +0 -71
- package/lib-commonjs/utilities/Common.styles.js.map +0 -1
- package/lib-commonjs/utilities/Common.styles.raw.js +0 -71
- package/lib-commonjs/utilities/Common.styles.raw.js.map +0 -1
|
@@ -91,7 +91,6 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
91
91
|
*/ export const LineChart = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
92
92
|
var _props_legendProps_selectedLegends, _props_legendProps;
|
|
93
93
|
let _hasMarkersMode = false;
|
|
94
|
-
let _isXAxisDateType = false;
|
|
95
94
|
let _points = _injectIndexPropertyInLineChartData(props.data.lineChartData);
|
|
96
95
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
97
96
|
let _calloutPoints = calloutData(_points) || [];
|
|
@@ -145,9 +144,6 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
145
144
|
y: 0
|
|
146
145
|
});
|
|
147
146
|
const [isPopoverOpen, setPopoverOpen] = React.useState(false);
|
|
148
|
-
const [YValue, setYValue] = React.useState('');
|
|
149
|
-
const [legendVal, setLegendVal] = React.useState('');
|
|
150
|
-
const [lineColor, setLineColor] = React.useState('');
|
|
151
147
|
const pointsRef = React.useRef([]);
|
|
152
148
|
const calloutPointsRef = React.useRef([]);
|
|
153
149
|
const classes = useLineChartStyles(props);
|
|
@@ -436,18 +432,13 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
436
432
|
const verticaLineHeight = containerHeight - margins.bottom + 6;
|
|
437
433
|
const yScale = _points[i].useSecondaryYScale && _yScaleSecondary ? _yScaleSecondary : _yScalePrimary;
|
|
438
434
|
if (_points[i].data.length === 1) {
|
|
439
|
-
var _points_i_lineOptions_mode, _points_i_lineOptions1;
|
|
440
435
|
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
441
436
|
const { x: x1, y: y1, xAxisCalloutData, xAxisCalloutAccessibilityData } = _points[i].data[0];
|
|
442
437
|
const circleId = `${_circleId}_${i}`;
|
|
443
438
|
const isLegendSelected = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;
|
|
444
439
|
const currentMarkerSize = _points[i].data[0].markerSize;
|
|
445
|
-
const supportsTextMode = (_points_i_lineOptions1 = _points[i].lineOptions) === null || _points_i_lineOptions1 === void 0 ? void 0 : (_points_i_lineOptions_mode = _points_i_lineOptions1.mode) === null || _points_i_lineOptions_mode === void 0 ? void 0 : _points_i_lineOptions_mode.includes('text');
|
|
446
|
-
const text = _points[i].data[0].text;
|
|
447
440
|
var _points_i_data__text;
|
|
448
|
-
pointsForLine.push(/*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(
|
|
449
|
-
key: `${circleId}_fragment`
|
|
450
|
-
}, /*#__PURE__*/ React.createElement("circle", {
|
|
441
|
+
pointsForLine.push(/*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("circle", {
|
|
451
442
|
id: circleId,
|
|
452
443
|
key: circleId,
|
|
453
444
|
r: currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : activePoint === circleId ? 5.5 : 3.5,
|
|
@@ -456,8 +447,8 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
456
447
|
fill: activePoint === circleId ? tokens.colorNeutralBackground1 : lineColor,
|
|
457
448
|
opacity: isLegendSelected ? 1 : 0.1,
|
|
458
449
|
tabIndex: isLegendSelected ? 0 : undefined,
|
|
459
|
-
onMouseOver: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale
|
|
460
|
-
onMouseMove: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale
|
|
450
|
+
onMouseOver: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale),
|
|
451
|
+
onMouseMove: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale),
|
|
461
452
|
onMouseOut: _handleMouseOut,
|
|
462
453
|
strokeWidth: activePoint === circleId ? DEFAULT_LINE_STROKE_SIZE : 0,
|
|
463
454
|
stroke: activePoint === circleId ? lineColor : '',
|
|
@@ -470,13 +461,13 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
470
461
|
onFocus: (event)=>_handleFocus(event, circleId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData),
|
|
471
462
|
onBlur: _handleMouseOut,
|
|
472
463
|
..._getClickHandler(_points[i].data[0].onDataPointClick)
|
|
473
|
-
}),
|
|
464
|
+
}), _points[i].data[0].text && /*#__PURE__*/ React.createElement("text", {
|
|
474
465
|
key: `${circleId}-label`,
|
|
475
466
|
x: _xAxisScale(x1),
|
|
476
467
|
y: yScale(y1) + Math.max(currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : 3.5, 4) + 12,
|
|
477
468
|
className: classes.markerLabel,
|
|
478
469
|
opacity: isLegendSelected ? 1 : 0.1
|
|
479
|
-
}, text)))
|
|
470
|
+
}, _points[i].data[0].text)));
|
|
480
471
|
}
|
|
481
472
|
let gapIndex = 0;
|
|
482
473
|
var _points_i_gaps_sort;
|
|
@@ -484,13 +475,13 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
484
475
|
const lineCurve = (_points_i_lineOptions = _points[i].lineOptions) === null || _points_i_lineOptions === void 0 ? void 0 : _points_i_lineOptions.curve;
|
|
485
476
|
// Use path rendering technique for larger datasets to optimize performance.
|
|
486
477
|
if ((props.optimizeLargeData || lineCurve) && _points[i].data.length > 1) {
|
|
487
|
-
var
|
|
478
|
+
var _points_i_lineOptions1;
|
|
488
479
|
const line = d3Line()// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
489
480
|
.x((d)=>_xAxisScale(d[0]))// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
490
481
|
.y((d)=>yScale(d[1])).curve(getCurveFactory(lineCurve));
|
|
491
482
|
const lineId = `${_lineId}_${i}`;
|
|
492
483
|
const borderId = `${_borderId}_${i}`;
|
|
493
|
-
const strokeWidth = ((
|
|
484
|
+
const strokeWidth = ((_points_i_lineOptions1 = _points[i].lineOptions) === null || _points_i_lineOptions1 === void 0 ? void 0 : _points_i_lineOptions1.strokeWidth) || props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;
|
|
494
485
|
const isLegendSelected = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;
|
|
495
486
|
const lineData = [];
|
|
496
487
|
for(let k = 0; k < _points[i].data.length; k++){
|
|
@@ -500,19 +491,19 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
500
491
|
]);
|
|
501
492
|
}
|
|
502
493
|
if (isLegendSelected) {
|
|
503
|
-
var
|
|
504
|
-
const lineBorderWidth = ((
|
|
494
|
+
var _points_i_lineOptions2, _points_i_lineOptions3;
|
|
495
|
+
const lineBorderWidth = ((_points_i_lineOptions2 = _points[i].lineOptions) === null || _points_i_lineOptions2 === void 0 ? void 0 : _points_i_lineOptions2.lineBorderWidth) ? Number.parseFloat(_points[i].lineOptions.lineBorderWidth.toString()) : 0;
|
|
505
496
|
if (lineBorderWidth > 0) {
|
|
506
|
-
var
|
|
497
|
+
var _points_i_lineOptions4, _points_i_lineOptions5;
|
|
507
498
|
var _points_i_lineOptions_strokeLinecap;
|
|
508
499
|
bordersForLine.push(/*#__PURE__*/ React.createElement("path", {
|
|
509
500
|
id: borderId,
|
|
510
501
|
key: borderId,
|
|
511
502
|
d: line(lineData),
|
|
512
503
|
fill: "transparent",
|
|
513
|
-
strokeLinecap: (_points_i_lineOptions_strokeLinecap = (
|
|
504
|
+
strokeLinecap: (_points_i_lineOptions_strokeLinecap = (_points_i_lineOptions4 = _points[i].lineOptions) === null || _points_i_lineOptions4 === void 0 ? void 0 : _points_i_lineOptions4.strokeLinecap) !== null && _points_i_lineOptions_strokeLinecap !== void 0 ? _points_i_lineOptions_strokeLinecap : 'round',
|
|
514
505
|
strokeWidth: Number.parseFloat(strokeWidth.toString()) + lineBorderWidth,
|
|
515
|
-
stroke: ((
|
|
506
|
+
stroke: ((_points_i_lineOptions5 = _points[i].lineOptions) === null || _points_i_lineOptions5 === void 0 ? void 0 : _points_i_lineOptions5.lineBorderColor) || tokens.colorNeutralBackground1,
|
|
516
507
|
opacity: 1
|
|
517
508
|
}));
|
|
518
509
|
}
|
|
@@ -525,7 +516,7 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
525
516
|
"data-is-focusable": true,
|
|
526
517
|
stroke: lineColor,
|
|
527
518
|
strokeWidth: strokeWidth,
|
|
528
|
-
strokeLinecap: (_points_i_lineOptions_strokeLinecap1 = (
|
|
519
|
+
strokeLinecap: (_points_i_lineOptions_strokeLinecap1 = (_points_i_lineOptions3 = _points[i].lineOptions) === null || _points_i_lineOptions3 === void 0 ? void 0 : _points_i_lineOptions3.strokeLinecap) !== null && _points_i_lineOptions_strokeLinecap1 !== void 0 ? _points_i_lineOptions_strokeLinecap1 : 'round',
|
|
529
520
|
onMouseMove: (event)=>_onMouseOverLargeDataset.bind(i, verticaLineHeight, event, yScale),
|
|
530
521
|
onMouseOver: (event)=>_onMouseOverLargeDataset.bind(i, verticaLineHeight, event, yScale),
|
|
531
522
|
onMouseOut: _handleMouseOut,
|
|
@@ -534,7 +525,7 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
534
525
|
tabIndex: isLegendSelected ? 0 : undefined
|
|
535
526
|
}));
|
|
536
527
|
} else {
|
|
537
|
-
var
|
|
528
|
+
var _points_i_lineOptions6;
|
|
538
529
|
var _points_i_lineOptions_strokeLinecap2;
|
|
539
530
|
linesForLine.push(/*#__PURE__*/ React.createElement("path", {
|
|
540
531
|
id: lineId,
|
|
@@ -544,7 +535,7 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
544
535
|
"data-is-focusable": false,
|
|
545
536
|
stroke: lineColor,
|
|
546
537
|
strokeWidth: strokeWidth,
|
|
547
|
-
strokeLinecap: (_points_i_lineOptions_strokeLinecap2 = (
|
|
538
|
+
strokeLinecap: (_points_i_lineOptions_strokeLinecap2 = (_points_i_lineOptions6 = _points[i].lineOptions) === null || _points_i_lineOptions6 === void 0 ? void 0 : _points_i_lineOptions6.strokeLinecap) !== null && _points_i_lineOptions_strokeLinecap2 !== void 0 ? _points_i_lineOptions_strokeLinecap2 : 'round',
|
|
548
539
|
opacity: 0.1
|
|
549
540
|
}));
|
|
550
541
|
}
|
|
@@ -564,7 +555,7 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
564
555
|
}));
|
|
565
556
|
} else if (!props.optimizeLargeData) {
|
|
566
557
|
for(let j = 1; j < _points[i].data.length; j++){
|
|
567
|
-
var
|
|
558
|
+
var _points_i_lineOptions7, _points_i_lineOptions_mode, _points_i_lineOptions8, _points_i_lineOptions_mode1, _points_i_lineOptions9;
|
|
568
559
|
const gapResult = _checkInGap(j, gaps, gapIndex);
|
|
569
560
|
const isInGap = gapResult.isInGap;
|
|
570
561
|
gapIndex = gapResult.gapIndex;
|
|
@@ -574,22 +565,20 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
574
565
|
const { x: x1, y: y1, xAxisCalloutData, xAxisCalloutAccessibilityData } = _points[i].data[j - 1];
|
|
575
566
|
const { x: x2, y: y2 } = _points[i].data[j];
|
|
576
567
|
let path = _getPath(_xAxisScale(x1), yScale(y1), circleId, j, false, _points[i].index);
|
|
577
|
-
const strokeWidth = ((
|
|
568
|
+
const strokeWidth = ((_points_i_lineOptions7 = _points[i].lineOptions) === null || _points_i_lineOptions7 === void 0 ? void 0 : _points_i_lineOptions7.strokeWidth) || props.strokeWidth || DEFAULT_LINE_STROKE_SIZE;
|
|
578
569
|
const isLegendSelected = _legendHighlighted(legendVal) || _noLegendHighlighted() || isSelectedLegend;
|
|
579
570
|
const currentPointHidden = _points[i].hideNonActiveDots && activePoint !== circleId;
|
|
580
|
-
const supportsTextMode = (_points_i_lineOptions9 = _points[i].lineOptions) === null || _points_i_lineOptions9 === void 0 ? void 0 : (_points_i_lineOptions_mode1 = _points_i_lineOptions9.mode) === null || _points_i_lineOptions_mode1 === void 0 ? void 0 : _points_i_lineOptions_mode1.includes('text');
|
|
581
|
-
const text = _points[i].data[j - 1].text;
|
|
582
571
|
let currentMarkerSize = _points[i].data[j - 1].markerSize;
|
|
583
572
|
var _points_i_data__text1;
|
|
584
|
-
pointsForLine.push(((
|
|
573
|
+
pointsForLine.push(((_points_i_lineOptions8 = _points[i].lineOptions) === null || _points_i_lineOptions8 === void 0 ? void 0 : (_points_i_lineOptions_mode = _points_i_lineOptions8.mode) === null || _points_i_lineOptions_mode === void 0 ? void 0 : _points_i_lineOptions_mode.includes('markers')) ? /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("circle", {
|
|
585
574
|
id: circleId,
|
|
586
575
|
key: circleId,
|
|
587
576
|
r: currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : 4,
|
|
588
577
|
cx: _xAxisScale(x1),
|
|
589
578
|
cy: yScale(y1),
|
|
590
579
|
"data-is-focusable": isLegendSelected,
|
|
591
|
-
onMouseOver: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale
|
|
592
|
-
onMouseMove: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale
|
|
580
|
+
onMouseOver: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale),
|
|
581
|
+
onMouseMove: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale),
|
|
593
582
|
onMouseOut: _handleMouseOut,
|
|
594
583
|
onFocus: (event)=>_handleFocus(event, lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData),
|
|
595
584
|
onBlur: _handleMouseOut,
|
|
@@ -600,19 +589,19 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
600
589
|
strokeWidth: strokeWidth,
|
|
601
590
|
role: "img",
|
|
602
591
|
"aria-label": (_points_i_data__text1 = _points[i].data[j - 1].text) !== null && _points_i_data__text1 !== void 0 ? _points_i_data__text1 : _getAriaLabel(i, j - 1)
|
|
603
|
-
}),
|
|
592
|
+
}), _points[i].data[j - 1].text && /*#__PURE__*/ React.createElement("text", {
|
|
604
593
|
key: `${circleId}-label`,
|
|
605
594
|
x: _xAxisScale(x1),
|
|
606
|
-
y: yScale(y1) +
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
}, text)) : /*#__PURE__*/ React.createElement("path", {
|
|
595
|
+
y: yScale(y1) + 12,
|
|
596
|
+
fontSize: 12,
|
|
597
|
+
className: classes.markerLabel
|
|
598
|
+
}, _points[i].data[j - 1].text)) : /*#__PURE__*/ React.createElement("path", {
|
|
610
599
|
id: circleId,
|
|
611
600
|
key: circleId,
|
|
612
601
|
d: path,
|
|
613
602
|
"data-is-focusable": isLegendSelected,
|
|
614
|
-
onMouseOver: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale
|
|
615
|
-
onMouseMove: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale
|
|
603
|
+
onMouseOver: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale),
|
|
604
|
+
onMouseMove: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale),
|
|
616
605
|
onMouseOut: _handleMouseOut,
|
|
617
606
|
onFocus: (event)=>_handleFocus(event, lineId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData),
|
|
618
607
|
onBlur: _handleMouseOut,
|
|
@@ -626,7 +615,7 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
626
615
|
tabIndex: isLegendSelected ? 0 : undefined
|
|
627
616
|
}));
|
|
628
617
|
if (j + 1 === _points[i].data.length) {
|
|
629
|
-
var
|
|
618
|
+
var _points_i_lineOptions_mode2, _points_i_lineOptions10;
|
|
630
619
|
// If this is last point of the line segment.
|
|
631
620
|
const lastCircleId = `${circleId}${j}L`;
|
|
632
621
|
const hiddenHoverCircleId = `${circleId}${j}D`;
|
|
@@ -634,20 +623,18 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
634
623
|
path = _getPath(_xAxisScale(x2), yScale(y2), lastCircleId, j, true, _points[i].index);
|
|
635
624
|
const { xAxisCalloutData: lastCirlceXCallout, xAxisCalloutAccessibilityData: lastCirlceXCalloutAccessibilityData } = _points[i].data[j];
|
|
636
625
|
currentMarkerSize = _points[i].data[j].markerSize;
|
|
637
|
-
const lastSupportsTextMode = (_points_i_lineOptions12 = _points[i].lineOptions) === null || _points_i_lineOptions12 === void 0 ? void 0 : (_points_i_lineOptions_mode4 = _points_i_lineOptions12.mode) === null || _points_i_lineOptions_mode4 === void 0 ? void 0 : _points_i_lineOptions_mode4.includes('text');
|
|
638
|
-
const lastText = _points[i].data[j].text;
|
|
639
626
|
var _points_i_data_j_text;
|
|
640
627
|
pointsForLine.push(/*#__PURE__*/ React.createElement(React.Fragment, {
|
|
641
628
|
key: `${lastCircleId}_container`
|
|
642
|
-
}, ((
|
|
629
|
+
}, ((_points_i_lineOptions10 = _points[i].lineOptions) === null || _points_i_lineOptions10 === void 0 ? void 0 : (_points_i_lineOptions_mode2 = _points_i_lineOptions10.mode) === null || _points_i_lineOptions_mode2 === void 0 ? void 0 : _points_i_lineOptions_mode2.includes('markers')) ? /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("circle", {
|
|
643
630
|
id: lastCircleId,
|
|
644
631
|
key: lastCircleId,
|
|
645
632
|
r: currentMarkerSize ? currentMarkerSize * extraMaxPixels / maxMarkerSize : 4,
|
|
646
633
|
cx: _xAxisScale(x2),
|
|
647
634
|
cy: yScale(y2),
|
|
648
635
|
"data-is-focusable": isLegendSelected,
|
|
649
|
-
onMouseOver: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale
|
|
650
|
-
onMouseMove: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale
|
|
636
|
+
onMouseOver: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale),
|
|
637
|
+
onMouseMove: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale),
|
|
651
638
|
onMouseOut: _handleMouseOut,
|
|
652
639
|
onFocus: (event)=>_handleFocus(event, lineId, x2, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData),
|
|
653
640
|
onBlur: _handleMouseOut,
|
|
@@ -658,18 +645,19 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
658
645
|
strokeWidth: strokeWidth,
|
|
659
646
|
role: "img",
|
|
660
647
|
"aria-label": (_points_i_data_j_text = _points[i].data[j].text) !== null && _points_i_data_j_text !== void 0 ? _points_i_data_j_text : _getAriaLabel(i, j)
|
|
661
|
-
}),
|
|
648
|
+
}), _points[i].data[j].text && /*#__PURE__*/ React.createElement("text", {
|
|
662
649
|
key: `${lastCircleId}-label`,
|
|
663
650
|
x: _xAxisScale(x2),
|
|
664
|
-
y: yScale(y2) +
|
|
651
|
+
y: yScale(y2) + 12,
|
|
652
|
+
fontSize: 12,
|
|
665
653
|
className: classes.markerLabel
|
|
666
|
-
}, text)) : /*#__PURE__*/ React.createElement("path", {
|
|
654
|
+
}, _points[i].data[j].text)) : /*#__PURE__*/ React.createElement("path", {
|
|
667
655
|
id: lastCircleId,
|
|
668
656
|
key: lastCircleId,
|
|
669
657
|
d: path,
|
|
670
658
|
"data-is-focusable": isLegendSelected,
|
|
671
|
-
onMouseOver: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale
|
|
672
|
-
onMouseMove: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale
|
|
659
|
+
onMouseOver: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale),
|
|
660
|
+
onMouseMove: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale),
|
|
673
661
|
onMouseOut: _handleMouseOut,
|
|
674
662
|
onFocus: (event)=>_handleFocus(event, lineId, x2, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData),
|
|
675
663
|
onBlur: _handleMouseOut,
|
|
@@ -689,8 +677,8 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
689
677
|
cy: yScale(y2),
|
|
690
678
|
opacity: 0,
|
|
691
679
|
width: 0,
|
|
692
|
-
onMouseOver: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale
|
|
693
|
-
onMouseMove: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale
|
|
680
|
+
onMouseOver: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale),
|
|
681
|
+
onMouseMove: (event)=>_handleHover(x2, y2, verticaLineHeight, lastCirlceXCallout, lastCircleId, lastCirlceXCalloutAccessibilityData, event, yScale),
|
|
694
682
|
onFocus: (event)=>_handleFocus(event, circleId, x1, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData),
|
|
695
683
|
onMouseOut: _handleMouseOut,
|
|
696
684
|
strokeWidth: 0,
|
|
@@ -698,14 +686,14 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
698
686
|
onBlur: _handleMouseOut
|
|
699
687
|
})));
|
|
700
688
|
}
|
|
701
|
-
if (!_hasMarkersMode || ((
|
|
689
|
+
if (!_hasMarkersMode || ((_points_i_lineOptions9 = _points[i].lineOptions) === null || _points_i_lineOptions9 === void 0 ? void 0 : (_points_i_lineOptions_mode1 = _points_i_lineOptions9.mode) === null || _points_i_lineOptions_mode1 === void 0 ? void 0 : _points_i_lineOptions_mode1.includes('lines'))) {
|
|
702
690
|
if (isLegendSelected) {
|
|
703
691
|
// don't draw line if it is in a gap
|
|
704
692
|
if (!isInGap) {
|
|
705
|
-
var
|
|
706
|
-
const lineBorderWidth = ((
|
|
693
|
+
var _points_i_lineOptions11, _points_i_lineOptions12, _points_i_lineOptions13, _points_i_lineOptions14;
|
|
694
|
+
const lineBorderWidth = ((_points_i_lineOptions11 = _points[i].lineOptions) === null || _points_i_lineOptions11 === void 0 ? void 0 : _points_i_lineOptions11.lineBorderWidth) ? Number.parseFloat(_points[i].lineOptions.lineBorderWidth.toString()) : 0;
|
|
707
695
|
if (lineBorderWidth > 0) {
|
|
708
|
-
var
|
|
696
|
+
var _points_i_lineOptions15, _points_i_lineOptions16;
|
|
709
697
|
var _points_i_lineOptions_strokeLinecap3;
|
|
710
698
|
bordersForLine.push(/*#__PURE__*/ React.createElement("line", {
|
|
711
699
|
id: borderId,
|
|
@@ -714,9 +702,9 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
714
702
|
y1: yScale(y1),
|
|
715
703
|
x2: _xAxisScale(x2),
|
|
716
704
|
y2: yScale(y2),
|
|
717
|
-
strokeLinecap: (_points_i_lineOptions_strokeLinecap3 = (
|
|
705
|
+
strokeLinecap: (_points_i_lineOptions_strokeLinecap3 = (_points_i_lineOptions15 = _points[i].lineOptions) === null || _points_i_lineOptions15 === void 0 ? void 0 : _points_i_lineOptions15.strokeLinecap) !== null && _points_i_lineOptions_strokeLinecap3 !== void 0 ? _points_i_lineOptions_strokeLinecap3 : 'round',
|
|
718
706
|
strokeWidth: Number.parseFloat(strokeWidth.toString()) + lineBorderWidth,
|
|
719
|
-
stroke: ((
|
|
707
|
+
stroke: ((_points_i_lineOptions16 = _points[i].lineOptions) === null || _points_i_lineOptions16 === void 0 ? void 0 : _points_i_lineOptions16.lineBorderColor) || tokens.colorNeutralBackground1,
|
|
720
708
|
opacity: 1
|
|
721
709
|
}));
|
|
722
710
|
}
|
|
@@ -732,20 +720,20 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
732
720
|
ref: (e)=>{
|
|
733
721
|
_refCallback(e, lineId);
|
|
734
722
|
},
|
|
735
|
-
onMouseOver: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale
|
|
736
|
-
onMouseMove: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale
|
|
723
|
+
onMouseOver: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale),
|
|
724
|
+
onMouseMove: (event)=>_handleHover(x1, y1, verticaLineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, event, yScale),
|
|
737
725
|
onMouseOut: _handleMouseOut,
|
|
738
726
|
stroke: lineColor,
|
|
739
|
-
strokeLinecap: (_points_i_lineOptions_strokeLinecap4 = (
|
|
740
|
-
strokeDasharray: (
|
|
741
|
-
strokeDashoffset: (
|
|
727
|
+
strokeLinecap: (_points_i_lineOptions_strokeLinecap4 = (_points_i_lineOptions12 = _points[i].lineOptions) === null || _points_i_lineOptions12 === void 0 ? void 0 : _points_i_lineOptions12.strokeLinecap) !== null && _points_i_lineOptions_strokeLinecap4 !== void 0 ? _points_i_lineOptions_strokeLinecap4 : 'round',
|
|
728
|
+
strokeDasharray: (_points_i_lineOptions13 = _points[i].lineOptions) === null || _points_i_lineOptions13 === void 0 ? void 0 : _points_i_lineOptions13.strokeDasharray,
|
|
729
|
+
strokeDashoffset: (_points_i_lineOptions14 = _points[i].lineOptions) === null || _points_i_lineOptions14 === void 0 ? void 0 : _points_i_lineOptions14.strokeDashoffset,
|
|
742
730
|
opacity: 1,
|
|
743
731
|
..._getClickHandler(_points[i].onLineClick)
|
|
744
732
|
}));
|
|
745
733
|
}
|
|
746
734
|
} else {
|
|
747
735
|
if (!isInGap) {
|
|
748
|
-
var
|
|
736
|
+
var _points_i_lineOptions17, _points_i_lineOptions18, _points_i_lineOptions19;
|
|
749
737
|
var _points_i_lineOptions_strokeLinecap5;
|
|
750
738
|
linesForLine.push(/*#__PURE__*/ React.createElement("line", {
|
|
751
739
|
id: lineId,
|
|
@@ -756,9 +744,9 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
756
744
|
y2: yScale(y2),
|
|
757
745
|
strokeWidth: strokeWidth,
|
|
758
746
|
stroke: lineColor,
|
|
759
|
-
strokeLinecap: (_points_i_lineOptions_strokeLinecap5 = (
|
|
760
|
-
strokeDasharray: (
|
|
761
|
-
strokeDashoffset: (
|
|
747
|
+
strokeLinecap: (_points_i_lineOptions_strokeLinecap5 = (_points_i_lineOptions17 = _points[i].lineOptions) === null || _points_i_lineOptions17 === void 0 ? void 0 : _points_i_lineOptions17.strokeLinecap) !== null && _points_i_lineOptions_strokeLinecap5 !== void 0 ? _points_i_lineOptions_strokeLinecap5 : 'round',
|
|
748
|
+
strokeDasharray: (_points_i_lineOptions18 = _points[i].lineOptions) === null || _points_i_lineOptions18 === void 0 ? void 0 : _points_i_lineOptions18.strokeDasharray,
|
|
749
|
+
strokeDashoffset: (_points_i_lineOptions19 = _points[i].lineOptions) === null || _points_i_lineOptions19 === void 0 ? void 0 : _points_i_lineOptions19.strokeDashoffset,
|
|
762
750
|
opacity: 0.1
|
|
763
751
|
}));
|
|
764
752
|
}
|
|
@@ -963,24 +951,11 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
963
951
|
setActivePoint(circleId);
|
|
964
952
|
}
|
|
965
953
|
}
|
|
966
|
-
function _handleHover(x, y, lineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, mouseEvent, yScale
|
|
954
|
+
function _handleHover(x, y, lineHeight, xAxisCalloutData, circleId, xAxisCalloutAccessibilityData, mouseEvent, yScale) {
|
|
967
955
|
mouseEvent === null || mouseEvent === void 0 ? void 0 : mouseEvent.persist();
|
|
968
956
|
const formattedData = x instanceof Date ? formatDate(x, props.useUTC) : x;
|
|
969
957
|
const xVal = x instanceof Date ? x.getTime() : x;
|
|
970
|
-
const yVal = y instanceof Date ? y.getTime() : y;
|
|
971
958
|
const found = find(_calloutPoints, (element)=>element.x === xVal);
|
|
972
|
-
let hoverDp = undefined;
|
|
973
|
-
if (props.isCalloutForStack === false && (found === null || found === void 0 ? void 0 : found.values)) {
|
|
974
|
-
const dp = find(found.values, (val)=>(val === null || val === void 0 ? void 0 : val.y) === yVal);
|
|
975
|
-
if (dp) {
|
|
976
|
-
hoverDp = {
|
|
977
|
-
x: xVal,
|
|
978
|
-
values: [
|
|
979
|
-
dp
|
|
980
|
-
]
|
|
981
|
-
};
|
|
982
|
-
}
|
|
983
|
-
}
|
|
984
959
|
// if no points need to be called out then don't show vertical line and callout card
|
|
985
960
|
if (found) {
|
|
986
961
|
d3Select(`#${_verticalLine}`).attr('transform', ()=>`translate(${_xAxisScale(x)}, ${yScale(y)})`).attr('visibility', 'visibility').attr('y2', `${lineHeight - 5 - yScale(y)}`);
|
|
@@ -989,11 +964,8 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
989
964
|
updatePosition(mouseEvent.clientX, mouseEvent.clientY);
|
|
990
965
|
xAxisCalloutData ? setHoverXValue(xAxisCalloutData) : setHoverXValue('' + formattedData);
|
|
991
966
|
setYValueHover(found.values);
|
|
992
|
-
setYValue(yVal);
|
|
993
|
-
setLegendVal(legendVal);
|
|
994
|
-
setLineColor(lineColor);
|
|
995
967
|
setStackCalloutProps(found);
|
|
996
|
-
setDataPointCalloutProps(
|
|
968
|
+
setDataPointCalloutProps(found);
|
|
997
969
|
setActivePoint(circleId);
|
|
998
970
|
setNearestCircleToHighlight(null);
|
|
999
971
|
}
|
|
@@ -1118,16 +1090,23 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
1118
1090
|
return ((_point_callOutAccessibilityData = point.callOutAccessibilityData) === null || _point_callOutAccessibilityData === void 0 ? void 0 : _point_callOutAccessibilityData.ariaLabel) || `${xValue}. ${legend}, ${yValue}.`;
|
|
1119
1091
|
}
|
|
1120
1092
|
function _getDomainNRangeValuesOfDateWithPadding(points, margins, width, isRTL, tickValues = [], chartType, barWidth) {
|
|
1121
|
-
|
|
1093
|
+
let sDate;
|
|
1094
|
+
let lDate;
|
|
1095
|
+
sDate = d3Min(points, (point)=>{
|
|
1096
|
+
return d3Min(point.data, (item)=>item.x);
|
|
1097
|
+
});
|
|
1098
|
+
lDate = d3Max(points, (point)=>{
|
|
1099
|
+
return d3Max(point.data, (item)=>item.x);
|
|
1100
|
+
});
|
|
1122
1101
|
// Include tickValues if present
|
|
1123
|
-
|
|
1102
|
+
sDate = d3Min([
|
|
1124
1103
|
...tickValues,
|
|
1125
|
-
|
|
1126
|
-
])
|
|
1127
|
-
|
|
1104
|
+
sDate
|
|
1105
|
+
]);
|
|
1106
|
+
lDate = d3Max([
|
|
1128
1107
|
...tickValues,
|
|
1129
|
-
|
|
1130
|
-
])
|
|
1108
|
+
lDate
|
|
1109
|
+
]);
|
|
1131
1110
|
// Calculate time-based padding (e.g. 10% of the date range)
|
|
1132
1111
|
const dateRange = lDate.getTime() - sDate.getTime();
|
|
1133
1112
|
const datePadding = _hasMarkersMode ? dateRange * 0.1 : 0;
|
|
@@ -1148,7 +1127,14 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
1148
1127
|
};
|
|
1149
1128
|
}
|
|
1150
1129
|
function _getDomainNRangeValuesWithPadding(points, margins, width, isRTL) {
|
|
1151
|
-
|
|
1130
|
+
_xMin = d3Min(points, (point)=>{
|
|
1131
|
+
return d3Min(point.data, (item)=>item.x);
|
|
1132
|
+
});
|
|
1133
|
+
_xMax = d3Max(points, (point)=>{
|
|
1134
|
+
return d3Max(point.data, (item)=>{
|
|
1135
|
+
return item.x;
|
|
1136
|
+
});
|
|
1137
|
+
});
|
|
1152
1138
|
if (_hasMarkersMode) {
|
|
1153
1139
|
_xPadding = (_xMax - _xMin) * 0.1;
|
|
1154
1140
|
}
|
|
@@ -1169,18 +1155,9 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
1169
1155
|
function _isChartEmpty() {
|
|
1170
1156
|
return !(props.data && props.data.lineChartData && props.data.lineChartData.length > 0 && props.data.lineChartData.filter((item)=>item.data.length).length > 0);
|
|
1171
1157
|
}
|
|
1172
|
-
function _setXMinMaxValues(points) {
|
|
1173
|
-
const getX = (item)=>_isXAxisDateType ? item.x : item.x;
|
|
1174
|
-
const minVal = d3Min(points, (point)=>d3Min(point.data, getX));
|
|
1175
|
-
const maxVal = d3Max(points, (point)=>d3Max(point.data, getX));
|
|
1176
|
-
_xMin = _isXAxisDateType ? minVal.getTime() : minVal;
|
|
1177
|
-
_xMax = _isXAxisDateType ? maxVal.getTime() : maxVal;
|
|
1178
|
-
_xMin = _xMin === Number.NEGATIVE_INFINITY || !_xMin ? 0 : _xMin;
|
|
1179
|
-
_xMax = _xMax === Number.POSITIVE_INFINITY || !_xMax ? 0 : _xMax;
|
|
1180
|
-
}
|
|
1181
1158
|
const { legendProps, tickValues, tickFormat, eventAnnotationProps } = props;
|
|
1182
1159
|
_points = _injectIndexPropertyInLineChartData(props.data.lineChartData);
|
|
1183
|
-
|
|
1160
|
+
const isXAxisDateType = getXAxisType(_points);
|
|
1184
1161
|
let points = _points;
|
|
1185
1162
|
if (legendProps && !!legendProps.canSelectMultipleLegends) {
|
|
1186
1163
|
points = selectedLegendPoints.length >= 1 ? selectedLegendPoints : _points;
|
|
@@ -1197,17 +1174,13 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
1197
1174
|
const calloutProps = {
|
|
1198
1175
|
YValueHover: YValueHover,
|
|
1199
1176
|
hoverXValue: hoverXValue,
|
|
1200
|
-
YValue: YValue,
|
|
1201
|
-
legend: legendVal,
|
|
1202
|
-
color: lineColor,
|
|
1203
|
-
XValue: hoverXValue,
|
|
1204
1177
|
descriptionMessage: props.getCalloutDescriptionMessage && stackCalloutProps ? props.getCalloutDescriptionMessage(stackCalloutProps) : undefined,
|
|
1205
1178
|
'data-is-focusable': true,
|
|
1206
1179
|
xAxisCalloutAccessibilityData: xAxisCalloutAccessibilityData,
|
|
1207
1180
|
...props.calloutProps,
|
|
1208
1181
|
clickPosition: clickPosition,
|
|
1209
1182
|
isPopoverOpen: isPopoverOpen,
|
|
1210
|
-
isCalloutForStack:
|
|
1183
|
+
isCalloutForStack: true,
|
|
1211
1184
|
culture: (_props_culture = props.culture) !== null && _props_culture !== void 0 ? _props_culture : 'en-us',
|
|
1212
1185
|
isCartesian: true,
|
|
1213
1186
|
customCallout: {
|
|
@@ -1231,7 +1204,7 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
1231
1204
|
getmargins: _getMargins,
|
|
1232
1205
|
getMinMaxOfYAxis: _getNumericMinMaxOfY,
|
|
1233
1206
|
getGraphData: _initializeLineChartData,
|
|
1234
|
-
xAxisType:
|
|
1207
|
+
xAxisType: isXAxisDateType ? XAxisTypes.DateAxis : XAxisTypes.NumericAxis,
|
|
1235
1208
|
getDomainNRangeValues: _getDomainNRangeValues,
|
|
1236
1209
|
createStringYAxis: createStringYAxis,
|
|
1237
1210
|
onChartMouseLeave: _handleChartMouseLeave,
|
|
@@ -1273,6 +1246,3 @@ const PATH_MULTIPLY_SIZE = 2.5;
|
|
|
1273
1246
|
});
|
|
1274
1247
|
});
|
|
1275
1248
|
LineChart.displayName = 'LineChart';
|
|
1276
|
-
LineChart.defaultProps = {
|
|
1277
|
-
isCalloutForStack: true
|
|
1278
|
-
};
|