|
1 | 1 | /*!
|
2 |
| - * ApexCharts v3.43.2-0 |
| 2 | + * ApexCharts v3.44.0 |
3 | 3 | * (c) 2018-2023 ApexCharts
|
4 | 4 | * Released under the MIT License.
|
5 | 5 | */
|
|
7172 | 7172 | opts.pSize = pSize;
|
7173 | 7173 | }
|
7174 | 7174 |
|
7175 |
| - if (p.x[q] < 0 || p.x[q] > w.globals.gridWidth || p.y[q] < 0 || p.y[q] > w.globals.gridHeight) { |
| 7175 | + if (p.x[q] < 0 || p.x[q] > w.globals.gridWidth || p.y[q] < -w.globals.markers.largestSize || p.y[q] > w.globals.gridHeight + w.globals.markers.largestSize) { |
7176 | 7176 | opts.pSize = 0;
|
7177 | 7177 | }
|
7178 | 7178 |
|
|
10183 | 10183 | }
|
10184 | 10184 | }
|
10185 | 10185 |
|
10186 |
| - gl.dom.elGridRect = graphics.drawRect(-strokeSize / 2 - barWidthLeft - 2, -strokeSize / 2, gl.gridWidth + strokeSize + barWidthRight + barWidthLeft + 4, gl.gridHeight + strokeSize, 0, '#fff'); |
| 10186 | + gl.dom.elGridRect = graphics.drawRect(-strokeSize - barWidthLeft - 2, -strokeSize * 2 - 2, gl.gridWidth + strokeSize + barWidthRight + barWidthLeft + 4, gl.gridHeight + strokeSize * 4 + 4, 0, '#fff'); |
10187 | 10187 | var markerSize = w.globals.markers.largestSize + 1;
|
10188 | 10188 | gl.dom.elGridRectMarker = graphics.drawRect(-markerSize * 2, -markerSize * 2, gl.gridWidth + markerSize * 4, gl.gridHeight + markerSize * 4, 0, '#fff');
|
10189 | 10189 | gl.dom.elGridRectMask.appendChild(gl.dom.elGridRect.node);
|
@@ -13583,14 +13583,19 @@
|
13583 | 13583 | var gl = w.globals;
|
13584 | 13584 | this.lgRect = this.dimHelpers.getLegendsRect();
|
13585 | 13585 |
|
13586 |
| - if (this.isSparkline && (w.config.markers.discrete.length > 0 || w.config.markers.size > 0)) { |
13587 |
| - Object.entries(this.gridPad).forEach(function (_ref) { |
13588 |
| - var _ref2 = _slicedToArray(_ref, 2), |
13589 |
| - k = _ref2[0], |
13590 |
| - v = _ref2[1]; |
| 13586 | + if (this.isSparkline) { |
| 13587 | + if (w.config.markers.discrete.length > 0 || w.config.markers.size > 0) { |
| 13588 | + Object.entries(this.gridPad).forEach(function (_ref) { |
| 13589 | + var _ref2 = _slicedToArray(_ref, 2), |
| 13590 | + k = _ref2[0], |
| 13591 | + v = _ref2[1]; |
13591 | 13592 |
|
13592 |
| - _this.gridPad[k] = Math.max(v, _this.w.globals.markers.largestSize / 1.5); |
13593 |
| - }); |
| 13593 | + _this.gridPad[k] = Math.max(v, _this.w.globals.markers.largestSize / 1.5); |
| 13594 | + }); |
| 13595 | + } |
| 13596 | + |
| 13597 | + this.gridPad.top = Math.max(w.config.stroke.width / 2, this.gridPad.top); |
| 13598 | + this.gridPad.bottom = Math.max(w.config.stroke.width / 2, this.gridPad.bottom); |
13594 | 13599 | }
|
13595 | 13600 |
|
13596 | 13601 | if (gl.axisCharts) {
|
@@ -23630,15 +23635,24 @@
|
23630 | 23635 |
|
23631 | 23636 | for (var i = 0; i < points.length; i++) {
|
23632 | 23637 | var point = points[i];
|
| 23638 | + var prevPoint = points[i - 1]; |
23633 | 23639 | var n = point.length;
|
| 23640 | + var pn = prevPoint === null || prevPoint === void 0 ? void 0 : prevPoint.length; |
23634 | 23641 |
|
23635 |
| - if (n > 4) { |
23636 |
| - p += "C".concat(point[0], ", ").concat(point[1]); |
23637 |
| - p += ", ".concat(point[2], ", ").concat(point[3]); |
23638 |
| - p += ", ".concat(point[4], ", ").concat(point[5]); |
23639 |
| - } else if (n > 2) { |
23640 |
| - p += "S".concat(point[0], ", ").concat(point[1]); |
| 23642 | + if (i > 1 && Math.abs(point[n - 2] - prevPoint[pn - 2]) < 30) { |
| 23643 | + // fallback to quadratic curve if the x distance is too small |
| 23644 | + // or if the curve goes backward too much |
| 23645 | + p += "Q".concat(point[0], ", ").concat(point[1]); |
23641 | 23646 | p += ", ".concat(point[2], ", ").concat(point[3]);
|
| 23647 | + } else { |
| 23648 | + if (n > 4) { |
| 23649 | + p += "C".concat(point[0], ", ").concat(point[1]); |
| 23650 | + p += ", ".concat(point[2], ", ").concat(point[3]); |
| 23651 | + p += ", ".concat(point[4], ", ").concat(point[5]); |
| 23652 | + } else if (n > 2) { |
| 23653 | + p += "S".concat(point[0], ", ").concat(point[1]); |
| 23654 | + p += ", ".concat(point[2], ", ").concat(point[3]); |
| 23655 | + } |
23642 | 23656 | }
|
23643 | 23657 | }
|
23644 | 23658 |
|
@@ -24387,13 +24401,13 @@
|
24387 | 24401 |
|
24388 | 24402 | if (curve === 'smooth') {
|
24389 | 24403 | var shouldRenderMonotone = type === 'rangeArea' ? xArrj.length === w.globals.dataPoints : j === series[i].length - 2;
|
| 24404 | + var smoothInputs = xArrj.map(function (_, i) { |
| 24405 | + return [xArrj[i], yArrj[i]]; |
| 24406 | + }).filter(function (_) { |
| 24407 | + return _[1] !== null; |
| 24408 | + }); |
24390 | 24409 |
|
24391 |
| - if (shouldRenderMonotone) { |
24392 |
| - var smoothInputs = xArrj.map(function (_, i) { |
24393 |
| - return [xArrj[i], yArrj[i]]; |
24394 |
| - }).filter(function (_) { |
24395 |
| - return _[1] !== null; |
24396 |
| - }); |
| 24410 | + if (shouldRenderMonotone && smoothInputs.length > 1) { |
24397 | 24411 | var points = spline.points(smoothInputs);
|
24398 | 24412 | linePath += svgPath(points);
|
24399 | 24413 |
|
|
26005 | 26019 | 'xmlns:data': 'ApexChartsNS',
|
26006 | 26020 | transform: "translate(".concat(cnf.chart.offsetX, ", ").concat(cnf.chart.offsetY, ")")
|
26007 | 26021 | });
|
26008 |
| - gl.dom.Paper.node.style.background = cnf.theme.mode === 'dark' && cnf.chart.background === 'transparent' ? 'rgba(0, 0, 0, 0.8)' : cnf.chart.background; |
| 26022 | + gl.dom.Paper.node.style.background = cnf.theme.mode === 'dark' && !cnf.chart.background ? 'rgba(0, 0, 0, 0.8)' : cnf.chart.background; |
26009 | 26023 | this.setSVGDimensions(); // append foreignElement (legend's parent)
|
26010 | 26024 | // legend is kept in foreignElement to be included while exporting
|
26011 | 26025 | // removing foreignElement and creating legend through HTML will not render legend in export
|
@@ -26667,11 +26681,12 @@
|
26667 | 26681 | var w = this.w;
|
26668 | 26682 | var ser = w.config.series[i];
|
26669 | 26683 | return _objectSpread2(_objectSpread2({}, w.config.series[i]), {}, {
|
26670 |
| - name: s.name ? s.name : ser && ser.name, |
26671 |
| - color: s.color ? s.color : ser && ser.color, |
26672 |
| - type: s.type ? s.type : ser && ser.type, |
26673 |
| - group: s.group ? s.group : ser && ser.group, |
26674 |
| - data: s.data ? s.data : ser && ser.data |
| 26684 | + name: s.name ? s.name : ser === null || ser === void 0 ? void 0 : ser.name, |
| 26685 | + color: s.color ? s.color : ser === null || ser === void 0 ? void 0 : ser.color, |
| 26686 | + type: s.type ? s.type : ser === null || ser === void 0 ? void 0 : ser.type, |
| 26687 | + group: s.group ? s.group : ser === null || ser === void 0 ? void 0 : ser.group, |
| 26688 | + data: s.data ? s.data : ser === null || ser === void 0 ? void 0 : ser.data, |
| 26689 | + zIndex: typeof s.zIndex !== 'undefined' ? s.zIndex : i |
26675 | 26690 | });
|
26676 | 26691 | }
|
26677 | 26692 | }, {
|
|
0 commit comments