@evergis/charts 3.1.14 → 3.1.16

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/index.js CHANGED
@@ -27,10 +27,10 @@ function _interopNamespaceDefault(e) {
27
27
 
28
28
  var d3__namespace = /*#__PURE__*/_interopNamespaceDefault(d3);
29
29
 
30
- const Wrapper = styled.div `
31
- position: relative;
32
- width: 100%;
33
- box-sizing: border-box;
30
+ const Wrapper = styled.div `
31
+ position: relative;
32
+ width: 100%;
33
+ box-sizing: border-box;
34
34
  `;
35
35
 
36
36
  function useNode() {
@@ -78,10 +78,60 @@ const appendSvg = (node, width, height) => {
78
78
  return svg;
79
79
  };
80
80
 
81
- const SwipeScrollContainer = styled.div `
82
- width: 100%;
83
- overflow: hidden;
84
- user-select: none;
81
+ const drawMarkers = ({ svg, markers, width, left, top, count, yScale }) => {
82
+ markers?.filter(marker => marker?.value > -1).forEach(marker => {
83
+ const x = left + ((width - left) / count * marker.value + 1);
84
+ if (marker.horizontal) {
85
+ if (marker.line) {
86
+ svg.append('line')
87
+ .style("stroke", marker.lineColor || marker.color || "inherit")
88
+ .style("stroke-width", 1)
89
+ .style("stroke-dasharray", ("5, 3"))
90
+ .attr("x1", left)
91
+ .attr("y1", yScale(marker.value) + 1)
92
+ .attr("x2", width)
93
+ .attr("y2", yScale(marker.value) + 1);
94
+ }
95
+ svg.append("text")
96
+ .attr("y", yScale(marker.value) + 1)
97
+ .attr("x", left)
98
+ .attr('text-anchor', 'middle')
99
+ .attr("class", ["marker", marker.className].filter(Boolean).join(" "))
100
+ .style("fill", marker?.color || "inherit")
101
+ .text(marker.label);
102
+ return;
103
+ }
104
+ if (marker.line) {
105
+ svg.append('line')
106
+ .style("stroke", marker.lineColor || marker.color || "inherit")
107
+ .style("stroke-width", 1)
108
+ .style("stroke-dasharray", ("5, 3"))
109
+ .attr("x1", x)
110
+ .attr("y1", 0)
111
+ .attr("x2", x)
112
+ .attr("y2", (top - 12));
113
+ }
114
+ svg.append("text")
115
+ .attr("y", top - 4)
116
+ .attr("x", x)
117
+ .attr("text-anchor", (_, i) => !marker.align && !i ? "left"
118
+ : marker.align === "right"
119
+ ? "end"
120
+ : marker.align === "left"
121
+ ? "start"
122
+ : "middle")
123
+ .attr("class", ["marker", marker.className].filter(Boolean).join(" "))
124
+ .style("fill", marker?.color || "inherit")
125
+ .style("font-size", "0.625rem")
126
+ .style("line-height", "0")
127
+ .text(marker.label);
128
+ });
129
+ };
130
+
131
+ const SwipeScrollContainer = styled.div `
132
+ width: 100%;
133
+ overflow: hidden;
134
+ user-select: none;
85
135
  `;
86
136
 
87
137
  function animate({ duration, timing, draw, }) {
@@ -233,37 +283,37 @@ const getTranslate$1 = ({ anchor, index, translateX, translateY, }) => {
233
283
  }
234
284
  return `translate(${translateX}px, ${translateY}px)`;
235
285
  };
236
- const Label$2 = styled.div `
237
- display: flex;
238
- align-items: center;
239
- font-size: 12px;
286
+ const Label$2 = styled.div `
287
+ display: flex;
288
+ align-items: center;
289
+ font-size: 12px;
240
290
  `;
241
- const Name$1 = styled.div `
242
- text-align: center;
243
- max-width: 120px;
291
+ const Name$1 = styled.div `
292
+ text-align: center;
293
+ max-width: 120px;
244
294
  `;
245
- const middleBadgeStyles = styled.css `
246
- position: absolute;
247
- top: 50%;
248
- right: 0;
249
- transform: translate(calc(100% + 6px), -50%);
295
+ const middleBadgeStyles = styled.css `
296
+ position: absolute;
297
+ top: 50%;
298
+ right: 0;
299
+ transform: translate(calc(100% + 6px), -50%);
250
300
  `;
251
- const DefaultBadge = styled.div `
252
- display: flex;
253
- align-items: center;
254
- padding: 2px 4px;
255
- border-radius: 4px;
256
- color: rgb(255, 255, 255);
257
- background-color: rgb(144, 197, 61);
258
- margin-left: 8px;
301
+ const DefaultBadge = styled.div `
302
+ display: flex;
303
+ align-items: center;
304
+ padding: 2px 4px;
305
+ border-radius: 4px;
306
+ color: rgb(255, 255, 255);
307
+ background-color: rgb(144, 197, 61);
308
+ margin-left: 8px;
259
309
  `;
260
- const MiddleBadge = styled(DefaultBadge) `
261
- ${middleBadgeStyles}
310
+ const MiddleBadge = styled(DefaultBadge) `
311
+ ${middleBadgeStyles}
262
312
  `;
263
- const BadgePrefix = styled.div `
264
- margin-left: 4px;
265
- font-size: 10px;
266
- color: rgba(255, 255, 255, 0.54);
313
+ const BadgePrefix = styled.div `
314
+ margin-left: 4px;
315
+ font-size: 10px;
316
+ color: rgba(255, 255, 255, 0.54);
267
317
  `;
268
318
 
269
319
  const radarChartclassNames = {
@@ -278,29 +328,29 @@ const radarChartclassNames = {
278
328
  radarLabelBadgePrefix: 'radarLabelBadgePrefix',
279
329
  radarCircle: 'radarCircle',
280
330
  };
281
- const SvgWrapper$5 = styled(Wrapper) `
282
- .${radarChartclassNames.radarAxis} {
283
- path,
284
- line,
285
- circle {
286
- fill: none;
287
- stroke-width: 1px;
288
- stroke: rgba(149, 149, 149, 0.18);
289
- }
290
- }
291
- .${radarChartclassNames.radarAxisText} {
292
- font-size: 12px;
293
- fill-opacity: 0.56;
294
- }
295
- .${radarChartclassNames.radarPolygon} {
296
- fill-opacity: 0.06;
297
- stroke-width: 2px;
298
- fill: rgb(144, 197, 61);
299
- stroke: rgb(144, 197, 61);
300
- }
301
- .${radarChartclassNames.radarCircle} {
302
- fill: rgb(144, 197, 61);
303
- }
331
+ const SvgWrapper$5 = styled(Wrapper) `
332
+ .${radarChartclassNames.radarAxis} {
333
+ path,
334
+ line,
335
+ circle {
336
+ fill: none;
337
+ stroke-width: 1px;
338
+ stroke: rgba(149, 149, 149, 0.18);
339
+ }
340
+ }
341
+ .${radarChartclassNames.radarAxisText} {
342
+ font-size: 12px;
343
+ fill-opacity: 0.56;
344
+ }
345
+ .${radarChartclassNames.radarPolygon} {
346
+ fill-opacity: 0.06;
347
+ stroke-width: 2px;
348
+ fill: rgb(144, 197, 61);
349
+ stroke: rgb(144, 197, 61);
350
+ }
351
+ .${radarChartclassNames.radarCircle} {
352
+ fill: rgb(144, 197, 61);
353
+ }
304
354
  `;
305
355
 
306
356
  const getTranslate = ({ anchor, index, translateX, translateY, }) => {
@@ -322,8 +372,8 @@ const LabelContainer$1 = styled.div.attrs(props => ({
322
372
  style: {
323
373
  transform: getTranslate(props),
324
374
  },
325
- })) `
326
- position: absolute;
375
+ })) `
376
+ position: absolute;
327
377
  `;
328
378
 
329
379
  const degByIndex = (index, count) => {
@@ -596,21 +646,21 @@ const pieChartclassNames = {
596
646
  pieTooltipColorBox: 'pieTooltipColorBox',
597
647
  pieFullChartTooltipCircle: 'pieFullChartTooltipCircle',
598
648
  };
599
- const SvgWrapper$4 = styled(Wrapper) `
600
- .${pieChartclassNames.pieSliceLabel} {
601
- fill: #4a4a4a;
602
- }
603
- .${pieChartclassNames.pieRadialLabel} {
604
- position: absolute;
605
- max-width: 128px;
606
- }
607
- .${pieChartclassNames.pieRadialLink} {
608
- stroke: #000;
609
- }
610
- .${pieChartclassNames.pieFullChartTooltipCircle} {
611
- fill: transparent;
612
- cursor: pointer;
613
- }
649
+ const SvgWrapper$4 = styled(Wrapper) `
650
+ .${pieChartclassNames.pieSliceLabel} {
651
+ fill: #4a4a4a;
652
+ }
653
+ .${pieChartclassNames.pieRadialLabel} {
654
+ position: absolute;
655
+ max-width: 128px;
656
+ }
657
+ .${pieChartclassNames.pieRadialLink} {
658
+ stroke: #000;
659
+ }
660
+ .${pieChartclassNames.pieFullChartTooltipCircle} {
661
+ fill: transparent;
662
+ cursor: pointer;
663
+ }
614
664
  `;
615
665
 
616
666
  const getMidFactor = (d) => d.startAngle + (d.endAngle - d.startAngle) / 2 < Math.PI ? 1 : -1;
@@ -701,90 +751,90 @@ const drawRadialLabels = ({ arc, enableRadialLabels, global, node, radius, dataR
701
751
  }
702
752
  };
703
753
 
704
- const TooltipFlex$1 = styled.div `
705
- width: 0;
706
- height: 0;
707
- display: flex;
708
- align-items: flex-end;
709
- justify-content: center;
710
- pointer-events: none;
711
- white-space: nowrap;
754
+ const TooltipFlex$1 = styled.div `
755
+ width: 0;
756
+ height: 0;
757
+ display: flex;
758
+ align-items: flex-end;
759
+ justify-content: center;
760
+ pointer-events: none;
761
+ white-space: nowrap;
712
762
  `;
713
763
  const LabelFlex = styled(TooltipFlex$1) ``;
714
- const LabelFlexCenter = styled(LabelFlex) `
715
- align-items: center;
764
+ const LabelFlexCenter = styled(LabelFlex) `
765
+ align-items: center;
716
766
  `;
717
- const TooltipContainer = styled.div `
718
- position: relative;
719
- font-size: 11px;
720
- color: #fff;
721
- margin-bottom: 8px;
722
- padding: 4px 6px;
723
- background-color: rgba(48, 69, 79, 1);
724
- border-radius: 4px;
725
- box-shadow: 0 0.1875rem 0.5rem rgba(48, 69, 79, 0.06);
726
-
727
- :before {
728
- content: '';
729
- position: absolute;
730
- bottom: 0;
731
- left: 50%;
732
- transform: translate(-50%, 100%);
733
- width: 0;
734
- height: 0;
735
- border-style: solid;
736
- border-width: 4px 3px 0 3px;
737
- border-color: rgba(48, 69, 79, 1) transparent transparent transparent;
738
- }
767
+ const TooltipContainer = styled.div `
768
+ position: relative;
769
+ font-size: 11px;
770
+ color: #fff;
771
+ margin-bottom: 8px;
772
+ padding: 4px 6px;
773
+ background-color: rgba(48, 69, 79, 1);
774
+ border-radius: 4px;
775
+ box-shadow: 0 0.1875rem 0.5rem rgba(48, 69, 79, 0.06);
776
+
777
+ :before {
778
+ content: '';
779
+ position: absolute;
780
+ bottom: 0;
781
+ left: 50%;
782
+ transform: translate(-50%, 100%);
783
+ width: 0;
784
+ height: 0;
785
+ border-style: solid;
786
+ border-width: 4px 3px 0 3px;
787
+ border-color: rgba(48, 69, 79, 1) transparent transparent transparent;
788
+ }
739
789
  `;
740
- const TooltipGroupName = styled.div `
741
- font-size: 14px;
742
- margin-bottom: 6px;
790
+ const TooltipGroupName = styled.div `
791
+ font-size: 14px;
792
+ margin-bottom: 6px;
743
793
  `;
744
- const TooltipItem = styled.div `
745
- display: flex;
746
- align-items: center;
747
- margin-bottom: 0.25rem;
748
-
749
- &:last-of-type {
750
- margin-bottom: 0;
751
- }
794
+ const TooltipItem = styled.div `
795
+ display: flex;
796
+ align-items: center;
797
+ margin-bottom: 0.25rem;
798
+
799
+ &:last-of-type {
800
+ margin-bottom: 0;
801
+ }
752
802
  `;
753
- const ColFlex = styled.div `
754
- display: flex;
755
- align-items: center;
756
- margin-right: 4px;
803
+ const ColFlex = styled.div `
804
+ display: flex;
805
+ align-items: center;
806
+ margin-right: 4px;
757
807
  `;
758
- const ColorBox = styled.div `
759
- margin-right: 4px;
760
- width: 10px;
761
- height: 10px;
762
- border-radius: 2px;
808
+ const ColorBox = styled.div `
809
+ margin-right: 4px;
810
+ width: 10px;
811
+ height: 10px;
812
+ border-radius: 2px;
763
813
  `;
764
- const ColorLine = styled(ColorBox) `
765
- height: 2px;
766
- border-radius: 0;
814
+ const ColorLine = styled(ColorBox) `
815
+ height: 2px;
816
+ border-radius: 0;
767
817
  `;
768
- const Name = styled.div `
769
- margin-right: 4px;
818
+ const Name = styled.div `
819
+ margin-right: 4px;
770
820
  `;
771
- const Value = styled.div `
772
- text-align: right;
773
- flex-shrink: 0;
774
- flex-grow: 1;
821
+ const Value = styled.div `
822
+ text-align: right;
823
+ flex-shrink: 0;
824
+ flex-grow: 1;
775
825
  `;
776
- const Label$1 = styled.div `
777
- position: relative;
778
- font-size: 11px;
779
- color: #fff;
780
- font-weight: bold;
781
- letter-spacing: 0.52px;
826
+ const Label$1 = styled.div `
827
+ position: relative;
828
+ font-size: 11px;
829
+ color: #fff;
830
+ font-weight: bold;
831
+ letter-spacing: 0.52px;
782
832
  `;
783
- const LabelTop = styled(Label$1) `
784
- top: 6px;
833
+ const LabelTop = styled(Label$1) `
834
+ top: 6px;
785
835
  `;
786
- const LabelBottom = styled(Label$1) `
787
- bottom: 6px;
836
+ const LabelBottom = styled(Label$1) `
837
+ bottom: 6px;
788
838
  `;
789
839
 
790
840
  const drawTooltip$3 = ({ fullChartTooltip, global, tooltipRoot, data, tooltipClassName, tooltipBind, renderTooltip, arc, allSlices, tooltipStyle, width, height, radius, }) => {
@@ -1173,53 +1223,53 @@ const calendarChartClassNames = {
1173
1223
  ...legendClassNames,
1174
1224
  };
1175
1225
  const headerHeight = "20px";
1176
- const SvgWrapper$3 = styled(Wrapper) `
1177
- .${calendarChartClassNames.calendarYear} {
1178
- display: flex;
1179
- margin-bottom: 16px;
1180
- }
1181
-
1182
- .${calendarChartClassNames.calendarYearTitle} {
1183
- display: inline-flex;
1184
- align-items: flex-end;
1185
- height: ${headerHeight};
1186
- margin-bottom: 4px;
1187
- font-weight: bold;
1188
- }
1189
-
1190
- .${calendarChartClassNames.calendarHeader} {
1191
- height: ${headerHeight};
1192
- margin-bottom: 4px;
1193
- position: relative;
1194
- display: flex;
1195
- }
1196
-
1197
- .${calendarChartClassNames.calendarMonth} {
1198
- font-size: 14px;
1199
- bottom: 0;
1200
- position: absolute;
1201
- }
1202
-
1203
- .${calendarChartClassNames.calendarAxis} {
1204
- display: flex;
1205
- flex-direction: column;
1206
- margin-right: 10px;
1207
- }
1208
-
1209
- .${calendarChartClassNames.calendarWeekDay} {
1210
- font-size: 12px;
1211
- display: inline-flex;
1212
- align-items: center;
1213
- justify-content: flex-end;
1214
- }
1215
-
1216
- .${calendarChartClassNames.calendarDays} {
1217
- position: relative;
1218
- }
1219
-
1220
- .${calendarChartClassNames.calendarDay} {
1221
- position: absolute;
1222
- }
1226
+ const SvgWrapper$3 = styled(Wrapper) `
1227
+ .${calendarChartClassNames.calendarYear} {
1228
+ display: flex;
1229
+ margin-bottom: 16px;
1230
+ }
1231
+
1232
+ .${calendarChartClassNames.calendarYearTitle} {
1233
+ display: inline-flex;
1234
+ align-items: flex-end;
1235
+ height: ${headerHeight};
1236
+ margin-bottom: 4px;
1237
+ font-weight: bold;
1238
+ }
1239
+
1240
+ .${calendarChartClassNames.calendarHeader} {
1241
+ height: ${headerHeight};
1242
+ margin-bottom: 4px;
1243
+ position: relative;
1244
+ display: flex;
1245
+ }
1246
+
1247
+ .${calendarChartClassNames.calendarMonth} {
1248
+ font-size: 14px;
1249
+ bottom: 0;
1250
+ position: absolute;
1251
+ }
1252
+
1253
+ .${calendarChartClassNames.calendarAxis} {
1254
+ display: flex;
1255
+ flex-direction: column;
1256
+ margin-right: 10px;
1257
+ }
1258
+
1259
+ .${calendarChartClassNames.calendarWeekDay} {
1260
+ font-size: 12px;
1261
+ display: inline-flex;
1262
+ align-items: center;
1263
+ justify-content: flex-end;
1264
+ }
1265
+
1266
+ .${calendarChartClassNames.calendarDays} {
1267
+ position: relative;
1268
+ }
1269
+
1270
+ .${calendarChartClassNames.calendarDay} {
1271
+ position: absolute;
1272
+ }
1223
1273
  `;
1224
1274
 
1225
1275
  const draw$3 = (node, props) => {
@@ -1446,67 +1496,67 @@ const lineChartClassNames = {
1446
1496
  lineChartMouseLabelContainer: "lineChartMouseLabelContainer",
1447
1497
  lineChartMouseLabel: "lineChartMouseLabel",
1448
1498
  };
1449
- const SvgWrapper$2 = styled(Wrapper) `
1450
- .${lineChartClassNames.lineChartYScaleGlobal},
1451
- .${lineChartClassNames.lineChartXScaleGlobal},
1452
- .${lineChartClassNames.lineChartGridGlobal} {
1453
- shape-rendering: crispEdges;
1454
- }
1455
-
1456
- .${lineChartClassNames.lineChartLinesGlobal} {
1457
- fill: none;
1458
- stroke: steelblue;
1459
- stroke-width: 1.5px;
1460
- stroke-linejoin: round;
1461
- stroke-linecap: round;
1462
- }
1463
-
1464
- .${lineChartClassNames.lineChartArea} {
1465
- fill-opacity: 0.24;
1466
- }
1467
-
1468
- .${lineChartClassNames.lineChartGridLineX},
1469
- .${lineChartClassNames.lineChartGridLineY},
1470
- .${lineChartClassNames.lineChartMouseLine} {
1471
- stroke: rgba(149, 149, 149, 0.24);
1472
- }
1473
-
1474
- .${lineChartClassNames.lineChartMouseLine},
1475
- .${lineChartClassNames.lineChartMouseCircle} {
1476
- transition: opacity linear 200ms;
1477
- pointer-events: none;
1478
- stroke-width: 1px;
1479
- }
1480
-
1481
- .${lineChartClassNames.lineChartDot} {
1482
- stroke: #fff;
1483
- stroke-width: 2px;
1484
- }
1485
-
1486
- .${lineChartClassNames.lineChartMouseLine} {
1487
- shape-rendering: crispEdges;
1488
- }
1489
-
1490
- .${lineChartClassNames.lineChartMouseRect} {
1491
- fill: none;
1492
- pointer-events: all;
1493
- }
1499
+ const SvgWrapper$2 = styled(Wrapper) `
1500
+ .${lineChartClassNames.lineChartYScaleGlobal},
1501
+ .${lineChartClassNames.lineChartXScaleGlobal},
1502
+ .${lineChartClassNames.lineChartGridGlobal} {
1503
+ shape-rendering: crispEdges;
1504
+ }
1505
+
1506
+ .${lineChartClassNames.lineChartLinesGlobal} {
1507
+ fill: none;
1508
+ stroke: steelblue;
1509
+ stroke-width: 1.5px;
1510
+ stroke-linejoin: round;
1511
+ stroke-linecap: round;
1512
+ }
1513
+
1514
+ .${lineChartClassNames.lineChartArea} {
1515
+ fill-opacity: 0.24;
1516
+ }
1517
+
1518
+ .${lineChartClassNames.lineChartGridLineX},
1519
+ .${lineChartClassNames.lineChartGridLineY},
1520
+ .${lineChartClassNames.lineChartMouseLine} {
1521
+ stroke: rgba(149, 149, 149, 0.24);
1522
+ }
1523
+
1524
+ .${lineChartClassNames.lineChartMouseLine},
1525
+ .${lineChartClassNames.lineChartMouseCircle} {
1526
+ transition: opacity linear 200ms;
1527
+ pointer-events: none;
1528
+ stroke-width: 1px;
1529
+ }
1530
+
1531
+ .${lineChartClassNames.lineChartDot} {
1532
+ stroke: #fff;
1533
+ stroke-width: 2px;
1534
+ }
1535
+
1536
+ .${lineChartClassNames.lineChartMouseLine} {
1537
+ shape-rendering: crispEdges;
1538
+ }
1539
+
1540
+ .${lineChartClassNames.lineChartMouseRect} {
1541
+ fill: none;
1542
+ pointer-events: all;
1543
+ }
1494
1544
  `;
1495
- const TooltipStyles$2 = styled.createGlobalStyle `
1496
- .${lineChartClassNames.lineChartMouseLabel} {
1497
- transition: opacity linear 200ms;
1498
- z-index: 100;
1499
-
1500
- .${lineChartClassNames.lineChartLabelFlex} {
1501
- justify-content: flex-start;
1502
- align-items: center;
1503
- pointer-events: none;
1504
- }
1505
-
1506
- .${lineChartClassNames.lineChartLabel} {
1507
- margin: 0 0 0 10px;
1508
- }
1509
- }
1545
+ const TooltipStyles$2 = styled.createGlobalStyle `
1546
+ .${lineChartClassNames.lineChartMouseLabel} {
1547
+ transition: opacity linear 200ms;
1548
+ z-index: 100;
1549
+
1550
+ .${lineChartClassNames.lineChartLabelFlex} {
1551
+ justify-content: flex-start;
1552
+ align-items: center;
1553
+ pointer-events: none;
1554
+ }
1555
+
1556
+ .${lineChartClassNames.lineChartLabel} {
1557
+ margin: 0 0 0 10px;
1558
+ }
1559
+ }
1510
1560
  `;
1511
1561
 
1512
1562
  const drawGrid$2 = ({ svg, yScale, xScale, yTicksCount, lastIndex, drawGridX, drawGridY, }) => {
@@ -1542,17 +1592,17 @@ const drawGrid$2 = ({ svg, yScale, xScale, yTicksCount, lastIndex, drawGridX, dr
1542
1592
  }
1543
1593
  };
1544
1594
 
1545
- const LabelContainer = styled.div `
1546
- width: 0;
1547
- height: 0;
1548
- display: flex;
1549
- align-items: flex-end;
1550
- justify-content: center;
1551
- font-size: 12px;
1552
- white-space: nowrap;
1595
+ const LabelContainer = styled.div `
1596
+ width: 0;
1597
+ height: 0;
1598
+ display: flex;
1599
+ align-items: flex-end;
1600
+ justify-content: center;
1601
+ font-size: 12px;
1602
+ white-space: nowrap;
1553
1603
  `;
1554
- const Label = styled.div `
1555
- margin-bottom: 4px;
1604
+ const Label = styled.div `
1605
+ margin-bottom: 4px;
1556
1606
  `;
1557
1607
 
1558
1608
  const labelClassName = "d3-chart-label";
@@ -1665,6 +1715,9 @@ const drawTooltip$2 = ({ svg, node, data: argData, xScale, yScale, dynamicCircle
1665
1715
  let target = null;
1666
1716
  while (true) {
1667
1717
  target = Math.floor((beginning + end) / 2);
1718
+ if (!target) {
1719
+ break;
1720
+ }
1668
1721
  pos = line.getPointAtLength(target);
1669
1722
  if ((target === end || target === beginning) && pos.x !== x) {
1670
1723
  break;
@@ -1787,7 +1840,7 @@ const drawTooltip$2 = ({ svg, node, data: argData, xScale, yScale, dynamicCircle
1787
1840
  };
1788
1841
 
1789
1842
  const draw$2 = (node, props) => {
1790
- const { data: chartData, labels, margin, customYAxisSelection, customXAxisSelection, customYAxis, customXAxis, curve, yAxisPadding, xAxisPadding, drawGridY, drawGridX, withLabels, formatLabel, eachLabel, stacked, dynamicTooltipEnable, dynamicCircleRadius, formatDynamicTooltip, renderTooltip, stackedTooltip, stackedTooltipIndex, tooltipLineTop, customize, customYScale, customLine, tooltipClassName, xScaleItemWidth, areaCurve, dotSnapping, rightAxis, } = props;
1843
+ const { data: chartData, labels, margin, customYAxisSelection, customXAxisSelection, customYAxis, customXAxis, curve, yAxisPadding, xAxisPadding, drawGridY, drawGridX, withLabels, formatLabel, eachLabel, stacked, dynamicTooltipEnable, dynamicCircleRadius, formatDynamicTooltip, renderTooltip, stackedTooltip, stackedTooltipIndex, tooltipLineTop, customize, customYScale, customLine, tooltipClassName, xScaleItemWidth, areaCurve, dotSnapping, rightAxis, markers, } = props;
1791
1844
  if (node !== null && chartData.length) {
1792
1845
  const data = stacked ? stackedData(chartData) : chartData;
1793
1846
  const marginTop = margin ? margin.top : 0;
@@ -1826,6 +1879,7 @@ const draw$2 = (node, props) => {
1826
1879
  const { width: yAxisWidth } = computeDimensions(yAxis);
1827
1880
  yAxis.attr('transform', `translate(${marginLeft + yAxisWidth}, 0)`);
1828
1881
  let yAxisRightWidth = 0;
1882
+ const left = marginLeft + yAxisWidth + (yAxisPadding || 0);
1829
1883
  if (rightAxis) {
1830
1884
  const rightAxisMin = d3__namespace.min(rightAxis);
1831
1885
  const rightAxisMax = d3__namespace.max(rightAxis);
@@ -1851,7 +1905,7 @@ const draw$2 = (node, props) => {
1851
1905
  .scaleLinear()
1852
1906
  .domain([0, lastIndex])
1853
1907
  .range([
1854
- marginLeft + yAxisWidth + (yAxisPadding || 0),
1908
+ left,
1855
1909
  width - yAxisRightWidth - marginRight,
1856
1910
  ]);
1857
1911
  const xAxisBottom = d3__namespace
@@ -1978,6 +2032,8 @@ const draw$2 = (node, props) => {
1978
2032
  }
1979
2033
  });
1980
2034
  }
2035
+ const count = data?.[0]?.values?.length || 0;
2036
+ drawMarkers({ svg, markers, width, left, top: height - marginTop, count, yScale });
1981
2037
  d3__namespace.select(node)
1982
2038
  .select(`.${labelClassName}`)
1983
2039
  .remove();
@@ -2135,65 +2191,66 @@ const barChartClassNames = {
2135
2191
  ...labelClassnames,
2136
2192
  ...barChartLinesClassNames,
2137
2193
  };
2138
- const SvgWrapper$1 = styled(Wrapper) `
2139
- display: ${({ selectable }) => selectable && "inline-block"};
2140
- user-select: ${({ selectable }) => selectable && "none"};
2141
- width: ${({ selectable }) => selectable && "auto"};
2142
-
2143
- line {
2144
- stroke-width: 1px;
2145
- shape-rendering: crispEdges;
2146
- }
2147
-
2148
- .${barChartClassNames.barChartGridLineX},
2149
- .${barChartClassNames.barChartGridLineY} {
2150
- stroke: rgba(48, 69, 79, 0.06);
2151
- }
2152
-
2153
- .${barChartClassNames.barChartMouseRect} {
2154
- }
2155
-
2156
- .${barChartClassNames.barChartMouseRect} {
2157
- fill: none;
2158
- pointer-events: all;
2159
- }
2160
-
2161
- .${barChartClassNames.barChartLinesGlobal} {
2162
- stroke-width: 1.5px;
2163
- stroke-linejoin: round;
2164
- stroke-linecap: round;
2165
- }
2166
-
2167
- .${barChartClassNames.barChartLine} {
2168
- shape-rendering: auto;
2169
- }
2170
-
2171
- .${barChartClassNames.barChartArea} {
2172
- fill-opacity: 0.24;
2173
- }
2174
-
2175
- .${barChartClassNames.barChartSelection} {
2176
- position: absolute;
2177
- top: 0;
2178
- width: 0;
2179
- background: rgba(0, 170, 255, 0.06);
2180
- box-shadow: 1px 0 0 #00AAFF, -1px 0 0 #00AAFF;
2181
- pointer-events: none;
2182
- }
2194
+ const SvgWrapper$1 = styled(Wrapper) `
2195
+ display: ${({ selectable }) => selectable && "inline-block"};
2196
+ user-select: ${({ selectable }) => selectable && "none"};
2197
+ width: ${({ selectable }) => selectable && "auto"};
2198
+
2199
+ line {
2200
+ stroke-width: 1px;
2201
+ shape-rendering: crispEdges;
2202
+ }
2203
+
2204
+ .${barChartClassNames.barChartGridLineX},
2205
+ .${barChartClassNames.barChartGridLineY} {
2206
+ stroke: rgba(48, 69, 79, 0.06);
2207
+ }
2208
+
2209
+ .${barChartClassNames.barChartMouseRect} {
2210
+ }
2211
+
2212
+ .${barChartClassNames.barChartMouseRect} {
2213
+ fill: none;
2214
+ pointer-events: all;
2215
+ }
2216
+
2217
+ .${barChartClassNames.barChartLinesGlobal} {
2218
+ stroke-width: 1.5px;
2219
+ stroke-linejoin: round;
2220
+ stroke-linecap: round;
2221
+ }
2222
+
2223
+ .${barChartClassNames.barChartLine} {
2224
+ shape-rendering: auto;
2225
+ }
2226
+
2227
+ .${barChartClassNames.barChartArea} {
2228
+ fill-opacity: 0.24;
2229
+ }
2230
+
2231
+ .${barChartClassNames.barChartSelection} {
2232
+ position: absolute;
2233
+ top: 0;
2234
+ width: 0;
2235
+ background: rgba(0, 170, 255, 0.06);
2236
+ box-shadow: 1px 0 0 #00AAFF, -1px 0 0 #00AAFF;
2237
+ pointer-events: none;
2238
+ }
2183
2239
  `;
2184
- const TooltipStyles$1 = styled.createGlobalStyle `
2185
- .${barChartClassNames.barChartMouseTooltip} {
2186
- z-index: 100;
2187
- transition: all linear 144ms;
2188
-
2189
- .${barChartClassNames.barChartTooltipItem} {
2190
- margin-bottom: 4px;
2191
-
2192
- :last-of-type {
2193
- margin-bottom: 0;
2194
- }
2195
- }
2196
- }
2240
+ const TooltipStyles$1 = styled.createGlobalStyle `
2241
+ .${barChartClassNames.barChartMouseTooltip} {
2242
+ z-index: 100;
2243
+ transition: all linear 144ms;
2244
+
2245
+ .${barChartClassNames.barChartTooltipItem} {
2246
+ padding: 0.125rem;
2247
+ margin-bottom: 4px;
2248
+
2249
+ :last-of-type {
2250
+ margin-bottom: 0;
2251
+ }
2252
+ }
2253
+ }
2197
2254
  `;
2198
2255
 
2199
2256
  const useSelection = (node, props) => {
@@ -2786,8 +2843,9 @@ const draw$1 = (node, props) => {
2786
2843
  });
2787
2844
  customYAxis && customYAxis(yAxis);
2788
2845
  const { width: yAxisWidth } = computeDimensions(yAxis);
2846
+ const left = marginLeft + yAxisWidth + (yAxisPadding || 0);
2789
2847
  const range = [
2790
- marginLeft + yAxisWidth + (yAxisPadding || 0),
2848
+ left,
2791
2849
  width - marginRight,
2792
2850
  ];
2793
2851
  const xScale = d3__namespace
@@ -2865,48 +2923,8 @@ const draw$1 = (node, props) => {
2865
2923
  const bars = drawBars
2866
2924
  ? drawBars({ groups, yScale, marshalledData, barWidth })
2867
2925
  : getBars({ groups, barWidth });
2868
- markers.forEach((marker) => {
2869
- if (!marker) {
2870
- return;
2871
- }
2872
- if (marker.horizontal) {
2873
- if (marker.line) {
2874
- svg.append('line')
2875
- .style("stroke", marker.lineColor || marker.color || "inherit")
2876
- .style("stroke-width", 1)
2877
- .style("stroke-dasharray", ("5, 3"))
2878
- .attr("x1", marginLeft + yAxisWidth)
2879
- .attr("y1", yScale(marker.value) + 1)
2880
- .attr("x2", width)
2881
- .attr("y2", yScale(marker.value) + 1);
2882
- }
2883
- svg.append("text")
2884
- .attr("y", yScale(marker.value) + 1)
2885
- .attr("x", marginLeft + yAxisWidth)
2886
- .attr('text-anchor', 'middle')
2887
- .attr("class", ["marker", marker.className].filter(Boolean).join(" "))
2888
- .style("fill", marker?.color || "inherit")
2889
- .text(marker.label);
2890
- return;
2891
- }
2892
- if (marker.line) {
2893
- svg.append('line')
2894
- .style("stroke", marker.lineColor || marker.color || "inherit")
2895
- .style("stroke-width", 1)
2896
- .style("stroke-dasharray", ("5, 3"))
2897
- .attr("x1", width / data.length * marker.value + 1)
2898
- .attr("y1", 0)
2899
- .attr("x2", width / data.length * marker.value + 1)
2900
- .attr("y2", (height - marginTop - marginBottom + 8));
2901
- }
2902
- svg.append("text")
2903
- .attr("y", height - 2)
2904
- .attr("x", width / data.length * marker.value + 1)
2905
- .attr('text-anchor', marker.align === 'right' ? 'end' : marker.align === 'left' ? 'start' : 'middle')
2906
- .attr("class", ["marker", marker.className].filter(Boolean).join(" "))
2907
- .style("fill", marker?.color || "inherit")
2908
- .text(marker.label);
2909
- });
2926
+ const count = data?.length || 0;
2927
+ drawMarkers({ svg, markers, width, left, top: height - marginTop, count, yScale });
2910
2928
  let lines = null;
2911
2929
  if (Array.isArray(lineData) && lineData.length > 0) {
2912
2930
  lines = drawLines({
@@ -3040,45 +3058,45 @@ const horizontalBarChartClassNames = {
3040
3058
  horizontalBarChartTooltipName: "horizontalBarChartTooltipName",
3041
3059
  horizontalBarChartTooltipValue: "horizontalBarChartTooltipValue",
3042
3060
  };
3043
- const Table = styled.table `
3044
- width: 100%;
3061
+ const Table = styled.table `
3062
+ width: 100%;
3045
3063
  `;
3046
- const LabelCell = styled.div `
3047
- text-align: right;
3064
+ const LabelCell = styled.div `
3065
+ text-align: right;
3048
3066
  `;
3049
- const BarFlex = styled.div `
3050
- width: 100%;
3051
- display: flex;
3052
- height: 1rem;
3067
+ const BarFlex = styled.div `
3068
+ width: 100%;
3069
+ display: flex;
3070
+ height: 1rem;
3053
3071
  `;
3054
- const BarsTd = styled.td `
3055
- width: 100%;
3056
- position: relative;
3057
- vertical-align: middle;
3072
+ const BarsTd = styled.td `
3073
+ width: 100%;
3074
+ position: relative;
3075
+ vertical-align: middle;
3058
3076
  `;
3059
- const TooltipFlex = styled(TooltipFlex$1) `
3060
- position: absolute;
3061
- top: 0;
3062
- left: 50%;
3063
- transform: translate(-50%, -50%);
3064
- will-change: left, top;
3077
+ const TooltipFlex = styled(TooltipFlex$1) `
3078
+ position: absolute;
3079
+ top: 0;
3080
+ left: 50%;
3081
+ transform: translate(-50%, -50%);
3082
+ will-change: left, top;
3065
3083
  `;
3066
- const StackSumContainer = styled.div `
3067
- position: relative;
3084
+ const StackSumContainer = styled.div `
3085
+ position: relative;
3068
3086
  `;
3069
- const StackSum = styled.div `
3070
- white-space: nowrap;
3071
- position: absolute;
3072
- top: 50%;
3073
- left: 50%;
3074
- transform: translate(0, -50%);
3087
+ const StackSum = styled.div `
3088
+ white-space: nowrap;
3089
+ position: absolute;
3090
+ top: 50%;
3091
+ left: 50%;
3092
+ transform: translate(0, -50%);
3075
3093
  `;
3076
- const StackWrapper = styled.div `
3077
- position: absolute;
3078
- top: 0;
3079
- display: flex;
3080
- justify-content: flex-start;
3081
- height: 100%;
3094
+ const StackWrapper = styled.div `
3095
+ position: absolute;
3096
+ top: 0;
3097
+ display: flex;
3098
+ justify-content: flex-start;
3099
+ height: 100%;
3082
3100
  `;
3083
3101
 
3084
3102
  const Tooltip$1 = ({ renderTooltip, bars, style, className, }) => {
@@ -3130,10 +3148,10 @@ const useStackWrapper = (stackedTooltip) => {
3130
3148
  : ({ children }) => (jsxRuntime.jsx(react.Fragment, { children: children })), [stackedTooltip]);
3131
3149
  };
3132
3150
 
3133
- const BarStyled = styled.div `
3134
- position: relative;
3135
- display: inline-flex;
3136
- height: 100%;
3151
+ const BarStyled = styled.div `
3152
+ position: relative;
3153
+ display: inline-flex;
3154
+ height: 100%;
3137
3155
  `;
3138
3156
 
3139
3157
  const Bar = ({ withTooltip, bar, formatNativeTitle, tooltipBind, mouseMove, mouseLeave, pointerEventsNone, isFirstChild, isLastChild, isOnlyChild, }) => {
@@ -3150,23 +3168,23 @@ const Bar = ({ withTooltip, bar, formatNativeTitle, tooltipBind, mouseMove, mous
3150
3168
  }, title: formatNativeTitle ? formatNativeTitle(bar) : "", onMouseOver: onMouseMove, onMouseMove: tooltipBind ? onMouseMove : void 0, onMouseOut: onMouseLeave }));
3151
3169
  };
3152
3170
 
3153
- const TickTd = styled.td `
3154
- position: relative;
3171
+ const TickTd = styled.td `
3172
+ position: relative;
3155
3173
  `;
3156
- const Ticks = styled.div `
3157
- position: relative;
3158
- height: 1rem;
3174
+ const Ticks = styled.div `
3175
+ position: relative;
3176
+ height: 1rem;
3159
3177
  `;
3160
- const Tick = styled.div `
3161
- white-space: nowrap;
3162
- width: 0;
3163
- height: 0;
3164
- position: absolute;
3165
- top: 50%;
3166
- transform: translateY(-50%);
3167
- display: flex;
3168
- align-items: center;
3169
- justify-content: center;
3178
+ const Tick = styled.div `
3179
+ white-space: nowrap;
3180
+ width: 0;
3181
+ height: 0;
3182
+ position: absolute;
3183
+ top: 50%;
3184
+ transform: translateY(-50%);
3185
+ display: flex;
3186
+ align-items: center;
3187
+ justify-content: center;
3170
3188
  `;
3171
3189
 
3172
3190
  const hundred = 100;
@@ -3265,29 +3283,29 @@ const bubbleChartClassNames = {
3265
3283
  bubbleChartTooltipFlex: "bubbleChartTooltipFlex",
3266
3284
  bubbleChartTip: "bubbleChartTip",
3267
3285
  };
3268
- const SvgWrapper = styled(Wrapper) `
3269
- .${bubbleChartClassNames.bubbleChartYAxis},
3270
- .${bubbleChartClassNames.bubbleChartXAxis},
3271
- .${bubbleChartClassNames.bubbleChartGridGlobal} {
3272
- shape-rendering: crispEdges;
3273
- }
3274
-
3275
- .${bubbleChartClassNames.bubbleChartGridLineX},
3276
- .${bubbleChartClassNames.bubbleChartGridLineY} {
3277
- stroke: rgba(149, 149, 149, 0.24);
3278
- }
3279
-
3280
- .${bubbleChartClassNames.bubbleChartYScaleLabel} {
3281
- font-size: 10px;
3282
- }
3286
+ const SvgWrapper = styled(Wrapper) `
3287
+ .${bubbleChartClassNames.bubbleChartYAxis},
3288
+ .${bubbleChartClassNames.bubbleChartXAxis},
3289
+ .${bubbleChartClassNames.bubbleChartGridGlobal} {
3290
+ shape-rendering: crispEdges;
3291
+ }
3292
+
3293
+ .${bubbleChartClassNames.bubbleChartGridLineX},
3294
+ .${bubbleChartClassNames.bubbleChartGridLineY} {
3295
+ stroke: rgba(149, 149, 149, 0.24);
3296
+ }
3297
+
3298
+ .${bubbleChartClassNames.bubbleChartYScaleLabel} {
3299
+ font-size: 10px;
3300
+ }
3283
3301
  `;
3284
- const TooltipStyles = styled.createGlobalStyle `
3285
- .${bubbleChartClassNames.bubbleChartTooltipContainer} {
3286
- position: absolute;
3287
- transition: opacity 150ms cubic-bezier(0.2, 1, 0.6, 1);
3288
- pointer-events: none;
3289
- z-index: 1;
3290
- }
3302
+ const TooltipStyles = styled.createGlobalStyle `
3303
+ .${bubbleChartClassNames.bubbleChartTooltipContainer} {
3304
+ position: absolute;
3305
+ transition: opacity 150ms cubic-bezier(0.2, 1, 0.6, 1);
3306
+ pointer-events: none;
3307
+ z-index: 1;
3308
+ }
3291
3309
  `;
3292
3310
 
3293
3311
  const drawGrid = ({ svg, yScale, xScale, yTicksCount, drawGridX, drawGridY, }) => {
@@ -3324,14 +3342,14 @@ const drawGrid = ({ svg, yScale, xScale, yTicksCount, drawGridX, drawGridY, }) =
3324
3342
  }
3325
3343
  };
3326
3344
 
3327
- const Tooltip = styled.div `
3328
- width: 0;
3329
- height: 0;
3330
- display: flex;
3331
- align-items: flex-end;
3332
- justify-content: center;
3333
- font-size: 12px;
3334
- white-space: nowrap;
3345
+ const Tooltip = styled.div `
3346
+ width: 0;
3347
+ height: 0;
3348
+ display: flex;
3349
+ align-items: flex-end;
3350
+ justify-content: center;
3351
+ font-size: 12px;
3352
+ white-space: nowrap;
3335
3353
  `;
3336
3354
 
3337
3355
  const drawTooltip = ({ bubbles, tooltipRoot, tooltipClassName, renderTooltip, }) => {
@@ -3548,6 +3566,7 @@ exports.appendSvg = appendSvg;
3548
3566
  exports.barChartClassNames = barChartClassNames;
3549
3567
  exports.bubbleChartClassNames = bubbleChartClassNames;
3550
3568
  exports.calendarChartClassNames = calendarChartClassNames;
3569
+ exports.drawMarkers = drawMarkers;
3551
3570
  exports.horizontalBarChartClassNames = horizontalBarChartClassNames;
3552
3571
  exports.lineChartClassNames = lineChartClassNames;
3553
3572
  exports.pieChartclassNames = pieChartclassNames;