@evergis/charts 4.0.46 → 4.0.48
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/LICENSE +21 -21
- package/README.md +25 -25
- package/dist/charts/LineChart/drawLabel/index.d.ts +1 -1
- package/dist/charts/LineChart/drawLabel/types.d.ts +3 -2
- package/dist/charts/LineChart/drawTooltip/index.d.ts +1 -1
- package/dist/charts/LineChart/drawTooltip/types.d.ts +4 -1
- package/dist/charts/LineChart/types.d.ts +15 -1
- package/dist/charts.esm.js +491 -456
- package/dist/charts.esm.js.map +1 -1
- package/dist/index.js +491 -456
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
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() {
|
|
@@ -128,10 +128,10 @@ const drawMarkers = ({ svg, markers, width, left, top, count, yScale }) => {
|
|
|
128
128
|
});
|
|
129
129
|
};
|
|
130
130
|
|
|
131
|
-
const SwipeScrollContainer = styled.div `
|
|
132
|
-
width: 100%;
|
|
133
|
-
overflow: hidden;
|
|
134
|
-
user-select: none;
|
|
131
|
+
const SwipeScrollContainer = styled.div `
|
|
132
|
+
width: 100%;
|
|
133
|
+
overflow: hidden;
|
|
134
|
+
user-select: none;
|
|
135
135
|
`;
|
|
136
136
|
|
|
137
137
|
function animate({ duration, timing, draw, }) {
|
|
@@ -283,37 +283,37 @@ const getTranslate$1 = ({ anchor, index, translateX, translateY, }) => {
|
|
|
283
283
|
}
|
|
284
284
|
return `translate(${translateX}px, ${translateY}px)`;
|
|
285
285
|
};
|
|
286
|
-
const Label$2 = styled.div `
|
|
287
|
-
display: flex;
|
|
288
|
-
align-items: center;
|
|
289
|
-
font-size: 12px;
|
|
286
|
+
const Label$2 = styled.div `
|
|
287
|
+
display: flex;
|
|
288
|
+
align-items: center;
|
|
289
|
+
font-size: 12px;
|
|
290
290
|
`;
|
|
291
|
-
const Name$1 = styled.div `
|
|
292
|
-
text-align: center;
|
|
293
|
-
max-width: 120px;
|
|
291
|
+
const Name$1 = styled.div `
|
|
292
|
+
text-align: center;
|
|
293
|
+
max-width: 120px;
|
|
294
294
|
`;
|
|
295
|
-
const middleBadgeStyles = styled.css `
|
|
296
|
-
position: absolute;
|
|
297
|
-
top: 50%;
|
|
298
|
-
right: 0;
|
|
299
|
-
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%);
|
|
300
300
|
`;
|
|
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;
|
|
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;
|
|
309
309
|
`;
|
|
310
|
-
const MiddleBadge = styled(DefaultBadge) `
|
|
311
|
-
${middleBadgeStyles}
|
|
310
|
+
const MiddleBadge = styled(DefaultBadge) `
|
|
311
|
+
${middleBadgeStyles}
|
|
312
312
|
`;
|
|
313
|
-
const BadgePrefix = styled.div `
|
|
314
|
-
margin-left: 4px;
|
|
315
|
-
font-size: 10px;
|
|
316
|
-
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);
|
|
317
317
|
`;
|
|
318
318
|
|
|
319
319
|
const radarChartclassNames = {
|
|
@@ -328,29 +328,29 @@ const radarChartclassNames = {
|
|
|
328
328
|
radarLabelBadgePrefix: 'radarLabelBadgePrefix',
|
|
329
329
|
radarCircle: 'radarCircle',
|
|
330
330
|
};
|
|
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
|
-
}
|
|
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
|
+
}
|
|
354
354
|
`;
|
|
355
355
|
|
|
356
356
|
const getTranslate = ({ anchor, index, translateX, translateY, }) => {
|
|
@@ -372,8 +372,8 @@ const LabelContainer$1 = styled.div.attrs(props => ({
|
|
|
372
372
|
style: {
|
|
373
373
|
transform: getTranslate(props),
|
|
374
374
|
},
|
|
375
|
-
})) `
|
|
376
|
-
position: absolute;
|
|
375
|
+
})) `
|
|
376
|
+
position: absolute;
|
|
377
377
|
`;
|
|
378
378
|
|
|
379
379
|
const degByIndex = (index, count) => {
|
|
@@ -637,24 +637,24 @@ const pieChartclassNames = {
|
|
|
637
637
|
pieTooltipColorBox: 'pieTooltipColorBox',
|
|
638
638
|
pieFullChartTooltipCircle: 'pieFullChartTooltipCircle',
|
|
639
639
|
};
|
|
640
|
-
const SvgWrapper$4 = styled(Wrapper) `
|
|
641
|
-
.${pieChartclassNames.pieSliceLabel} {
|
|
642
|
-
fill: #4a4a4a;
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
.${pieChartclassNames.pieRadialLabel} {
|
|
646
|
-
position: absolute;
|
|
647
|
-
max-width: 128px;
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
.${pieChartclassNames.pieRadialLink} {
|
|
651
|
-
stroke: #000;
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
.${pieChartclassNames.pieFullChartTooltipCircle} {
|
|
655
|
-
fill: transparent;
|
|
656
|
-
cursor: pointer;
|
|
657
|
-
}
|
|
640
|
+
const SvgWrapper$4 = styled(Wrapper) `
|
|
641
|
+
.${pieChartclassNames.pieSliceLabel} {
|
|
642
|
+
fill: #4a4a4a;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
.${pieChartclassNames.pieRadialLabel} {
|
|
646
|
+
position: absolute;
|
|
647
|
+
max-width: 128px;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
.${pieChartclassNames.pieRadialLink} {
|
|
651
|
+
stroke: #000;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
.${pieChartclassNames.pieFullChartTooltipCircle} {
|
|
655
|
+
fill: transparent;
|
|
656
|
+
cursor: pointer;
|
|
657
|
+
}
|
|
658
658
|
`;
|
|
659
659
|
|
|
660
660
|
function radiansToDegrees(radians) {
|
|
@@ -754,90 +754,90 @@ const drawRadialLabels = ({ arc, enableRadialLabels, global, node, radius, dataR
|
|
|
754
754
|
}
|
|
755
755
|
};
|
|
756
756
|
|
|
757
|
-
const TooltipFlex$1 = styled.div `
|
|
758
|
-
width: 0;
|
|
759
|
-
height: 0;
|
|
760
|
-
display: flex;
|
|
761
|
-
align-items: flex-end;
|
|
762
|
-
justify-content: center;
|
|
763
|
-
pointer-events: none;
|
|
764
|
-
white-space: nowrap;
|
|
757
|
+
const TooltipFlex$1 = styled.div `
|
|
758
|
+
width: 0;
|
|
759
|
+
height: 0;
|
|
760
|
+
display: flex;
|
|
761
|
+
align-items: flex-end;
|
|
762
|
+
justify-content: center;
|
|
763
|
+
pointer-events: none;
|
|
764
|
+
white-space: nowrap;
|
|
765
765
|
`;
|
|
766
766
|
const LabelFlex = styled(TooltipFlex$1) ``;
|
|
767
|
-
const LabelFlexCenter = styled(LabelFlex) `
|
|
768
|
-
align-items: center;
|
|
767
|
+
const LabelFlexCenter = styled(LabelFlex) `
|
|
768
|
+
align-items: center;
|
|
769
769
|
`;
|
|
770
|
-
const TooltipContainer = styled.div `
|
|
771
|
-
position: relative;
|
|
772
|
-
font-size: 11px;
|
|
773
|
-
color: #fff;
|
|
774
|
-
margin-bottom: 8px;
|
|
775
|
-
padding: 4px 6px;
|
|
776
|
-
background-color: rgba(48, 69, 79, 1);
|
|
777
|
-
border-radius: 4px;
|
|
778
|
-
box-shadow: 0 0.1875rem 0.5rem rgba(48, 69, 79, 0.06);
|
|
779
|
-
|
|
780
|
-
:before {
|
|
781
|
-
content: '';
|
|
782
|
-
position: absolute;
|
|
783
|
-
bottom: 0;
|
|
784
|
-
left: 50%;
|
|
785
|
-
transform: translate(-50%, 100%);
|
|
786
|
-
width: 0;
|
|
787
|
-
height: 0;
|
|
788
|
-
border-style: solid;
|
|
789
|
-
border-width: 4px 3px 0 3px;
|
|
790
|
-
border-color: rgba(48, 69, 79, 1) transparent transparent transparent;
|
|
791
|
-
}
|
|
770
|
+
const TooltipContainer = styled.div `
|
|
771
|
+
position: relative;
|
|
772
|
+
font-size: 11px;
|
|
773
|
+
color: #fff;
|
|
774
|
+
margin-bottom: 8px;
|
|
775
|
+
padding: 4px 6px;
|
|
776
|
+
background-color: rgba(48, 69, 79, 1);
|
|
777
|
+
border-radius: 4px;
|
|
778
|
+
box-shadow: 0 0.1875rem 0.5rem rgba(48, 69, 79, 0.06);
|
|
779
|
+
|
|
780
|
+
:before {
|
|
781
|
+
content: '';
|
|
782
|
+
position: absolute;
|
|
783
|
+
bottom: 0;
|
|
784
|
+
left: 50%;
|
|
785
|
+
transform: translate(-50%, 100%);
|
|
786
|
+
width: 0;
|
|
787
|
+
height: 0;
|
|
788
|
+
border-style: solid;
|
|
789
|
+
border-width: 4px 3px 0 3px;
|
|
790
|
+
border-color: rgba(48, 69, 79, 1) transparent transparent transparent;
|
|
791
|
+
}
|
|
792
792
|
`;
|
|
793
|
-
const TooltipGroupName = styled.div `
|
|
794
|
-
font-size: 14px;
|
|
795
|
-
margin-bottom: 6px;
|
|
793
|
+
const TooltipGroupName = styled.div `
|
|
794
|
+
font-size: 14px;
|
|
795
|
+
margin-bottom: 6px;
|
|
796
796
|
`;
|
|
797
|
-
const TooltipItem = styled.div `
|
|
798
|
-
display: flex;
|
|
799
|
-
align-items: center;
|
|
800
|
-
margin-bottom: 0.25rem;
|
|
801
|
-
|
|
802
|
-
&:last-of-type {
|
|
803
|
-
margin-bottom: 0;
|
|
804
|
-
}
|
|
797
|
+
const TooltipItem = styled.div `
|
|
798
|
+
display: flex;
|
|
799
|
+
align-items: center;
|
|
800
|
+
margin-bottom: 0.25rem;
|
|
801
|
+
|
|
802
|
+
&:last-of-type {
|
|
803
|
+
margin-bottom: 0;
|
|
804
|
+
}
|
|
805
805
|
`;
|
|
806
|
-
const ColFlex = styled.div `
|
|
807
|
-
display: flex;
|
|
808
|
-
align-items: center;
|
|
809
|
-
margin-right: 4px;
|
|
806
|
+
const ColFlex = styled.div `
|
|
807
|
+
display: flex;
|
|
808
|
+
align-items: center;
|
|
809
|
+
margin-right: 4px;
|
|
810
810
|
`;
|
|
811
|
-
const ColorBox = styled.div `
|
|
812
|
-
margin-right: 4px;
|
|
813
|
-
width: 10px;
|
|
814
|
-
height: 10px;
|
|
815
|
-
border-radius: 2px;
|
|
811
|
+
const ColorBox = styled.div `
|
|
812
|
+
margin-right: 4px;
|
|
813
|
+
width: 10px;
|
|
814
|
+
height: 10px;
|
|
815
|
+
border-radius: 2px;
|
|
816
816
|
`;
|
|
817
|
-
const ColorLine = styled(ColorBox) `
|
|
818
|
-
height: 2px;
|
|
819
|
-
border-radius: 0;
|
|
817
|
+
const ColorLine = styled(ColorBox) `
|
|
818
|
+
height: 2px;
|
|
819
|
+
border-radius: 0;
|
|
820
820
|
`;
|
|
821
|
-
const Name = styled.div `
|
|
822
|
-
margin-right: 4px;
|
|
821
|
+
const Name = styled.div `
|
|
822
|
+
margin-right: 4px;
|
|
823
823
|
`;
|
|
824
|
-
const Value = styled.div `
|
|
825
|
-
text-align: right;
|
|
826
|
-
flex-shrink: 0;
|
|
827
|
-
flex-grow: 1;
|
|
824
|
+
const Value = styled.div `
|
|
825
|
+
text-align: right;
|
|
826
|
+
flex-shrink: 0;
|
|
827
|
+
flex-grow: 1;
|
|
828
828
|
`;
|
|
829
|
-
const Label$1 = styled.div `
|
|
830
|
-
position: relative;
|
|
831
|
-
font-size: 11px;
|
|
832
|
-
color: #fff;
|
|
833
|
-
font-weight: bold;
|
|
834
|
-
letter-spacing: 0.52px;
|
|
829
|
+
const Label$1 = styled.div `
|
|
830
|
+
position: relative;
|
|
831
|
+
font-size: 11px;
|
|
832
|
+
color: #fff;
|
|
833
|
+
font-weight: bold;
|
|
834
|
+
letter-spacing: 0.52px;
|
|
835
835
|
`;
|
|
836
|
-
const LabelTop = styled(Label$1) `
|
|
837
|
-
top: 6px;
|
|
836
|
+
const LabelTop = styled(Label$1) `
|
|
837
|
+
top: 6px;
|
|
838
838
|
`;
|
|
839
|
-
const LabelBottom = styled(Label$1) `
|
|
840
|
-
bottom: 6px;
|
|
839
|
+
const LabelBottom = styled(Label$1) `
|
|
840
|
+
bottom: 6px;
|
|
841
841
|
`;
|
|
842
842
|
|
|
843
843
|
const drawTooltip$3 = ({ fullChartTooltip, global, tooltipRoot, data, tooltipClassName, tooltipBind, renderTooltip, arc, allSlices, tooltipStyle, width, height, radius, }) => {
|
|
@@ -1282,53 +1282,53 @@ const calendarChartClassNames = {
|
|
|
1282
1282
|
...legendClassNames,
|
|
1283
1283
|
};
|
|
1284
1284
|
const headerHeight = "20px";
|
|
1285
|
-
const SvgWrapper$3 = styled(Wrapper) `
|
|
1286
|
-
.${calendarChartClassNames.calendarYear} {
|
|
1287
|
-
display: flex;
|
|
1288
|
-
margin-bottom: 16px;
|
|
1289
|
-
}
|
|
1290
|
-
|
|
1291
|
-
.${calendarChartClassNames.calendarYearTitle} {
|
|
1292
|
-
display: inline-flex;
|
|
1293
|
-
align-items: flex-end;
|
|
1294
|
-
height: ${headerHeight};
|
|
1295
|
-
margin-bottom: 4px;
|
|
1296
|
-
font-weight: bold;
|
|
1297
|
-
}
|
|
1298
|
-
|
|
1299
|
-
.${calendarChartClassNames.calendarHeader} {
|
|
1300
|
-
height: ${headerHeight};
|
|
1301
|
-
margin-bottom: 4px;
|
|
1302
|
-
position: relative;
|
|
1303
|
-
display: flex;
|
|
1304
|
-
}
|
|
1305
|
-
|
|
1306
|
-
.${calendarChartClassNames.calendarMonth} {
|
|
1307
|
-
font-size: 14px;
|
|
1308
|
-
bottom: 0;
|
|
1309
|
-
position: absolute;
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
|
-
.${calendarChartClassNames.calendarAxis} {
|
|
1313
|
-
display: flex;
|
|
1314
|
-
flex-direction: column;
|
|
1315
|
-
margin-right: 10px;
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
|
-
.${calendarChartClassNames.calendarWeekDay} {
|
|
1319
|
-
font-size: 12px;
|
|
1320
|
-
display: inline-flex;
|
|
1321
|
-
align-items: center;
|
|
1322
|
-
justify-content: flex-end;
|
|
1323
|
-
}
|
|
1324
|
-
|
|
1325
|
-
.${calendarChartClassNames.calendarDays} {
|
|
1326
|
-
position: relative;
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
|
-
.${calendarChartClassNames.calendarDay} {
|
|
1330
|
-
position: absolute;
|
|
1331
|
-
}
|
|
1285
|
+
const SvgWrapper$3 = styled(Wrapper) `
|
|
1286
|
+
.${calendarChartClassNames.calendarYear} {
|
|
1287
|
+
display: flex;
|
|
1288
|
+
margin-bottom: 16px;
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
.${calendarChartClassNames.calendarYearTitle} {
|
|
1292
|
+
display: inline-flex;
|
|
1293
|
+
align-items: flex-end;
|
|
1294
|
+
height: ${headerHeight};
|
|
1295
|
+
margin-bottom: 4px;
|
|
1296
|
+
font-weight: bold;
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
.${calendarChartClassNames.calendarHeader} {
|
|
1300
|
+
height: ${headerHeight};
|
|
1301
|
+
margin-bottom: 4px;
|
|
1302
|
+
position: relative;
|
|
1303
|
+
display: flex;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
.${calendarChartClassNames.calendarMonth} {
|
|
1307
|
+
font-size: 14px;
|
|
1308
|
+
bottom: 0;
|
|
1309
|
+
position: absolute;
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
.${calendarChartClassNames.calendarAxis} {
|
|
1313
|
+
display: flex;
|
|
1314
|
+
flex-direction: column;
|
|
1315
|
+
margin-right: 10px;
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
.${calendarChartClassNames.calendarWeekDay} {
|
|
1319
|
+
font-size: 12px;
|
|
1320
|
+
display: inline-flex;
|
|
1321
|
+
align-items: center;
|
|
1322
|
+
justify-content: flex-end;
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
.${calendarChartClassNames.calendarDays} {
|
|
1326
|
+
position: relative;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
.${calendarChartClassNames.calendarDay} {
|
|
1330
|
+
position: absolute;
|
|
1331
|
+
}
|
|
1332
1332
|
`;
|
|
1333
1333
|
|
|
1334
1334
|
const draw$3 = (node, props) => {
|
|
@@ -1555,67 +1555,67 @@ const lineChartClassNames = {
|
|
|
1555
1555
|
lineChartMouseLabelContainer: "lineChartMouseLabelContainer",
|
|
1556
1556
|
lineChartMouseLabel: "lineChartMouseLabel",
|
|
1557
1557
|
};
|
|
1558
|
-
const SvgWrapper$2 = styled(Wrapper) `
|
|
1559
|
-
.${lineChartClassNames.lineChartYScaleGlobal},
|
|
1560
|
-
.${lineChartClassNames.lineChartXScaleGlobal},
|
|
1561
|
-
.${lineChartClassNames.lineChartGridGlobal} {
|
|
1562
|
-
shape-rendering: crispEdges;
|
|
1563
|
-
}
|
|
1564
|
-
|
|
1565
|
-
.${lineChartClassNames.lineChartLinesGlobal} {
|
|
1566
|
-
fill: none;
|
|
1567
|
-
stroke: steelblue;
|
|
1568
|
-
stroke-width: 1.5px;
|
|
1569
|
-
stroke-linejoin: round;
|
|
1570
|
-
stroke-linecap: round;
|
|
1571
|
-
}
|
|
1572
|
-
|
|
1573
|
-
.${lineChartClassNames.lineChartArea} {
|
|
1574
|
-
fill-opacity: 0.24;
|
|
1575
|
-
}
|
|
1576
|
-
|
|
1577
|
-
.${lineChartClassNames.lineChartGridLineX},
|
|
1578
|
-
.${lineChartClassNames.lineChartGridLineY},
|
|
1579
|
-
.${lineChartClassNames.lineChartMouseLine} {
|
|
1580
|
-
stroke: rgba(149, 149, 149, 0.24);
|
|
1581
|
-
}
|
|
1582
|
-
|
|
1583
|
-
.${lineChartClassNames.lineChartMouseLine},
|
|
1584
|
-
.${lineChartClassNames.lineChartMouseCircle} {
|
|
1585
|
-
transition: opacity linear 200ms;
|
|
1586
|
-
pointer-events: none;
|
|
1587
|
-
stroke-width: 1px;
|
|
1588
|
-
}
|
|
1589
|
-
|
|
1590
|
-
.${lineChartClassNames.lineChartDot} {
|
|
1591
|
-
stroke: #fff;
|
|
1592
|
-
stroke-width: 2px;
|
|
1593
|
-
}
|
|
1594
|
-
|
|
1595
|
-
.${lineChartClassNames.lineChartMouseLine} {
|
|
1596
|
-
shape-rendering: crispEdges;
|
|
1597
|
-
}
|
|
1598
|
-
|
|
1599
|
-
.${lineChartClassNames.lineChartMouseRect} {
|
|
1600
|
-
fill: none;
|
|
1601
|
-
pointer-events: all;
|
|
1602
|
-
}
|
|
1558
|
+
const SvgWrapper$2 = styled(Wrapper) `
|
|
1559
|
+
.${lineChartClassNames.lineChartYScaleGlobal},
|
|
1560
|
+
.${lineChartClassNames.lineChartXScaleGlobal},
|
|
1561
|
+
.${lineChartClassNames.lineChartGridGlobal} {
|
|
1562
|
+
shape-rendering: crispEdges;
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
.${lineChartClassNames.lineChartLinesGlobal} {
|
|
1566
|
+
fill: none;
|
|
1567
|
+
stroke: steelblue;
|
|
1568
|
+
stroke-width: 1.5px;
|
|
1569
|
+
stroke-linejoin: round;
|
|
1570
|
+
stroke-linecap: round;
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
.${lineChartClassNames.lineChartArea} {
|
|
1574
|
+
fill-opacity: 0.24;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
.${lineChartClassNames.lineChartGridLineX},
|
|
1578
|
+
.${lineChartClassNames.lineChartGridLineY},
|
|
1579
|
+
.${lineChartClassNames.lineChartMouseLine} {
|
|
1580
|
+
stroke: rgba(149, 149, 149, 0.24);
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
.${lineChartClassNames.lineChartMouseLine},
|
|
1584
|
+
.${lineChartClassNames.lineChartMouseCircle} {
|
|
1585
|
+
transition: opacity linear 200ms;
|
|
1586
|
+
pointer-events: none;
|
|
1587
|
+
stroke-width: 1px;
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
.${lineChartClassNames.lineChartDot} {
|
|
1591
|
+
stroke: #fff;
|
|
1592
|
+
stroke-width: 2px;
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
.${lineChartClassNames.lineChartMouseLine} {
|
|
1596
|
+
shape-rendering: crispEdges;
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
.${lineChartClassNames.lineChartMouseRect} {
|
|
1600
|
+
fill: none;
|
|
1601
|
+
pointer-events: all;
|
|
1602
|
+
}
|
|
1603
1603
|
`;
|
|
1604
|
-
const TooltipStyles$2 = styled.createGlobalStyle `
|
|
1605
|
-
.${lineChartClassNames.lineChartMouseLabel} {
|
|
1606
|
-
transition: opacity linear 200ms;
|
|
1607
|
-
z-index: 100;
|
|
1608
|
-
|
|
1609
|
-
.${lineChartClassNames.lineChartLabelFlex} {
|
|
1610
|
-
justify-content: flex-start;
|
|
1611
|
-
align-items: center;
|
|
1612
|
-
pointer-events: none;
|
|
1613
|
-
}
|
|
1614
|
-
|
|
1615
|
-
.${lineChartClassNames.lineChartLabel} {
|
|
1616
|
-
margin: 0 0 0 10px;
|
|
1617
|
-
}
|
|
1618
|
-
}
|
|
1604
|
+
const TooltipStyles$2 = styled.createGlobalStyle `
|
|
1605
|
+
.${lineChartClassNames.lineChartMouseLabel} {
|
|
1606
|
+
transition: opacity linear 200ms;
|
|
1607
|
+
z-index: 100;
|
|
1608
|
+
|
|
1609
|
+
.${lineChartClassNames.lineChartLabelFlex} {
|
|
1610
|
+
justify-content: flex-start;
|
|
1611
|
+
align-items: center;
|
|
1612
|
+
pointer-events: none;
|
|
1613
|
+
}
|
|
1614
|
+
|
|
1615
|
+
.${lineChartClassNames.lineChartLabel} {
|
|
1616
|
+
margin: 0 0 0 10px;
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
1619
|
`;
|
|
1620
1620
|
|
|
1621
1621
|
const drawGrid$2 = ({ svg, yScale, xScale, yTicksCount, lastIndex, drawGridX, drawGridY, }) => {
|
|
@@ -1651,28 +1651,29 @@ const drawGrid$2 = ({ svg, yScale, xScale, yTicksCount, lastIndex, drawGridX, dr
|
|
|
1651
1651
|
}
|
|
1652
1652
|
};
|
|
1653
1653
|
|
|
1654
|
-
const LabelContainer = styled.div `
|
|
1655
|
-
width: 0;
|
|
1656
|
-
height: 0;
|
|
1657
|
-
display: flex;
|
|
1658
|
-
align-items: flex-end;
|
|
1659
|
-
justify-content: center;
|
|
1660
|
-
font-size: 12px;
|
|
1661
|
-
white-space: nowrap;
|
|
1654
|
+
const LabelContainer = styled.div `
|
|
1655
|
+
width: 0;
|
|
1656
|
+
height: 0;
|
|
1657
|
+
display: flex;
|
|
1658
|
+
align-items: flex-end;
|
|
1659
|
+
justify-content: center;
|
|
1660
|
+
font-size: 12px;
|
|
1661
|
+
white-space: nowrap;
|
|
1662
1662
|
`;
|
|
1663
|
-
const Label = styled.div `
|
|
1664
|
-
margin-bottom: 4px;
|
|
1663
|
+
const Label = styled.div `
|
|
1664
|
+
margin-bottom: 4px;
|
|
1665
1665
|
`;
|
|
1666
1666
|
|
|
1667
1667
|
const labelClassName = "d3-chart-label";
|
|
1668
|
-
const drawLabel = ({ node, data,
|
|
1668
|
+
const drawLabel = ({ node, data, yScaleOf, xScale, formatLabel, eachLabel, }) => {
|
|
1669
1669
|
const labelsDiv = d3__namespace
|
|
1670
1670
|
.select(node)
|
|
1671
1671
|
.append("div")
|
|
1672
1672
|
.attr("class", labelClassName);
|
|
1673
1673
|
const format = d3__namespace.format(",");
|
|
1674
|
-
|
|
1675
|
-
|
|
1674
|
+
data.forEach(series => {
|
|
1675
|
+
const values = series.values;
|
|
1676
|
+
const yScale = yScaleOf(series);
|
|
1676
1677
|
labelsDiv
|
|
1677
1678
|
.append("div")
|
|
1678
1679
|
.selectAll("div")
|
|
@@ -1691,7 +1692,7 @@ const drawLabel = ({ node, data, yScale, xScale, formatLabel, eachLabel, }) => {
|
|
|
1691
1692
|
});
|
|
1692
1693
|
};
|
|
1693
1694
|
|
|
1694
|
-
const drawTooltip$2 = ({ svg, node, data: argData, xScale, yScale, dynamicCircleRadius, formatDynamicTooltip, renderTooltip, stackedTooltipIndex, stackedTooltip, tooltipLineTop, tooltipRoot, tooltipClassName, dotSnapping, lastIndex, }) => {
|
|
1695
|
+
const drawTooltip$2 = ({ svg, node, data: argData, xScale, yScale, yScaleOf, dynamicCircleRadius, formatDynamicTooltip, renderTooltip, stackedTooltipIndex, stackedTooltip, tooltipLineTop, tooltipRoot, tooltipClassName, dotSnapping, lastIndex, }) => {
|
|
1695
1696
|
const container = tooltipRoot || document.querySelector("body");
|
|
1696
1697
|
const format = d3__namespace.format(",");
|
|
1697
1698
|
const chartData = argData.filter(({ tooltipOff }) => !tooltipOff);
|
|
@@ -1800,7 +1801,7 @@ const drawTooltip$2 = ({ svg, node, data: argData, xScale, yScale, dynamicCircle
|
|
|
1800
1801
|
positions[index] = {
|
|
1801
1802
|
x: x1 + Math.round(currIndex) * step,
|
|
1802
1803
|
y: typeof argData[index].values[Math.round(currIndex)] === "number"
|
|
1803
|
-
?
|
|
1804
|
+
? yScaleOf(argData[index])(argData[index].values[Math.round(currIndex)])
|
|
1804
1805
|
: 0,
|
|
1805
1806
|
};
|
|
1806
1807
|
}
|
|
@@ -1816,7 +1817,7 @@ const drawTooltip$2 = ({ svg, node, data: argData, xScale, yScale, dynamicCircle
|
|
|
1816
1817
|
const datas = chartData.map(({ values, ...rest }, i) => ({
|
|
1817
1818
|
...rest,
|
|
1818
1819
|
value: getValue(values),
|
|
1819
|
-
invertValue: positions[i] ?
|
|
1820
|
+
invertValue: positions[i] ? yScaleOf(rest).invert(positions[i].y) : 0,
|
|
1820
1821
|
}));
|
|
1821
1822
|
const noHasData = datas.every(({ value }) => isVoid(value));
|
|
1822
1823
|
if (noHasData && isVisible) {
|
|
@@ -1904,7 +1905,7 @@ const drawTooltip$2 = ({ svg, node, data: argData, xScale, yScale, dynamicCircle
|
|
|
1904
1905
|
};
|
|
1905
1906
|
|
|
1906
1907
|
const draw$2 = (node, props) => {
|
|
1907
|
-
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,
|
|
1908
|
+
const { data: chartData, labels, margin, customYAxisSelection, customXAxisSelection, customYAxis, customYAxisRight, customXAxis, curve, yAxisPadding, xAxisPadding, drawGridY, drawGridX, withLabels, formatLabel, eachLabel, stacked, dynamicTooltipEnable, dynamicCircleRadius, formatDynamicTooltip, renderTooltip, stackedTooltip, stackedTooltipIndex, tooltipLineTop, customize, customYScale, customLine, tooltipClassName, xScaleItemWidth, areaCurve, dotSnapping, markers, transitionDuration = 300, } = props;
|
|
1908
1909
|
if (node !== null && chartData.length) {
|
|
1909
1910
|
const data = stacked ? stackedData(chartData) : chartData;
|
|
1910
1911
|
const marginTop = margin ? margin.top : 0;
|
|
@@ -1914,12 +1915,21 @@ const draw$2 = (node, props) => {
|
|
|
1914
1915
|
const { width: nodeWidth } = node.getBoundingClientRect();
|
|
1915
1916
|
const width = props.width || nodeWidth;
|
|
1916
1917
|
const height = props.height || 0;
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
const
|
|
1921
|
-
|
|
1922
|
-
|
|
1918
|
+
// Серии разводятся по двум шкалам: без axis серия считается левой, поэтому график с одной
|
|
1919
|
+
// осью ведёт себя ровно как раньше — правая шкала не создаётся и геометрия не меняется.
|
|
1920
|
+
const isRightSeries = ({ axis }) => axis === 'right';
|
|
1921
|
+
const leftData = data.filter(series => !isRightSeries(series));
|
|
1922
|
+
const rightData = data.filter(isRightSeries);
|
|
1923
|
+
const hasLeftAxis = leftData.length > 0;
|
|
1924
|
+
const hasRightAxis = rightData.length > 0;
|
|
1925
|
+
const domainOf = (series, propMin, propMax) => [
|
|
1926
|
+
typeof propMin === 'number'
|
|
1927
|
+
? propMin
|
|
1928
|
+
: d3__namespace.min(series, ({ values }) => d3__namespace.min(values)) || 0,
|
|
1929
|
+
typeof propMax === 'number'
|
|
1930
|
+
? propMax
|
|
1931
|
+
: d3__namespace.max(series, ({ values }) => d3__namespace.max(values)) || 0,
|
|
1932
|
+
];
|
|
1923
1933
|
const prevStrokes = new Map();
|
|
1924
1934
|
if (transitionDuration > 0) {
|
|
1925
1935
|
d3__namespace.select(node)
|
|
@@ -1935,32 +1945,48 @@ const draw$2 = (node, props) => {
|
|
|
1935
1945
|
];
|
|
1936
1946
|
const yScale = d3__namespace
|
|
1937
1947
|
.scaleLinear()
|
|
1938
|
-
.domain(
|
|
1948
|
+
.domain(domainOf(hasLeftAxis ? leftData : data, props.min, props.max))
|
|
1939
1949
|
.range(yRange)
|
|
1940
1950
|
.nice();
|
|
1951
|
+
const yScaleRight = hasRightAxis
|
|
1952
|
+
? d3__namespace
|
|
1953
|
+
.scaleLinear()
|
|
1954
|
+
.domain(domainOf(rightData, props.rightMin, props.rightMax))
|
|
1955
|
+
.range(yRange)
|
|
1956
|
+
.nice()
|
|
1957
|
+
: undefined;
|
|
1958
|
+
// Основная шкала — левая; если левых серий нет, её место занимает правая, чтобы сетка,
|
|
1959
|
+
// маркеры и customize получили осмысленную шкалу.
|
|
1960
|
+
const primaryScale = hasLeftAxis || !yScaleRight ? yScale : yScaleRight;
|
|
1961
|
+
const scaleOf = series => series && isRightSeries(series) && yScaleRight ? yScaleRight : primaryScale;
|
|
1941
1962
|
customYScale && customYScale(yScale);
|
|
1942
1963
|
const yTicksCountDefault = 8;
|
|
1943
1964
|
const yAxisLeft = d3__namespace.axisLeft(yScale).ticks(yTicksCountDefault);
|
|
1944
1965
|
customYAxis && customYAxis(yAxisLeft);
|
|
1945
|
-
const yTicksCount = yAxisLeft.tickArguments()[0];
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1966
|
+
const yTicksCount = yAxisLeft.tickArguments()[0] ?? yTicksCountDefault;
|
|
1967
|
+
// Деления двух шкал должны попадать на одни и те же высоты, иначе линии сетки идут по левой
|
|
1968
|
+
// оси, а подписи правой висят между ними. `nice` с явным числом делений округляет домен так,
|
|
1969
|
+
// что обе оси дают одинаковое их количество. Для графика с одной осью домен не трогаем —
|
|
1970
|
+
// иначе поменялась бы геометрия уже существующих графиков.
|
|
1971
|
+
if (hasLeftAxis && yScaleRight) {
|
|
1972
|
+
yScale.nice(yTicksCount);
|
|
1973
|
+
yScaleRight.nice(yTicksCount);
|
|
1974
|
+
}
|
|
1975
|
+
let yAxisWidth = 0;
|
|
1976
|
+
if (hasLeftAxis) {
|
|
1977
|
+
const yAxis = svg
|
|
1978
|
+
.append('g')
|
|
1979
|
+
.attr('class', lineChartClassNames.lineChartYScaleGlobal)
|
|
1980
|
+
.call(yAxisLeft)
|
|
1981
|
+
.call(customYAxisSelection ? customYAxisSelection : none);
|
|
1982
|
+
({ width: yAxisWidth } = computeDimensions(yAxis));
|
|
1983
|
+
yAxis.attr('transform', `translate(${marginLeft + yAxisWidth}, 0)`);
|
|
1984
|
+
}
|
|
1953
1985
|
let yAxisRightWidth = 0;
|
|
1954
1986
|
const left = marginLeft + yAxisWidth + (yAxisPadding || 0);
|
|
1955
|
-
if (
|
|
1956
|
-
const
|
|
1957
|
-
|
|
1958
|
-
const yRightScale = d3__namespace
|
|
1959
|
-
.scaleLinear()
|
|
1960
|
-
.domain([rightAxisMin || 0, rightAxisMax || 0])
|
|
1961
|
-
.range(yRange)
|
|
1962
|
-
.nice();
|
|
1963
|
-
const yAxisRightTicks = d3__namespace.axisRight(yRightScale).ticks(yTicksCountDefault);
|
|
1987
|
+
if (yScaleRight) {
|
|
1988
|
+
const yAxisRightTicks = d3__namespace.axisRight(yScaleRight).ticks(yTicksCount);
|
|
1989
|
+
(customYAxisRight || customYAxis)?.(yAxisRightTicks);
|
|
1964
1990
|
const yAxisRight = svg
|
|
1965
1991
|
.append('g')
|
|
1966
1992
|
.attr('class', `${lineChartClassNames.lineChartYScaleGlobal} ${lineChartClassNames.lineChartYScaleRight}`)
|
|
@@ -1996,7 +2022,7 @@ const draw$2 = (node, props) => {
|
|
|
1996
2022
|
customXAxis && customXAxis(xAxisBottom);
|
|
1997
2023
|
drawGrid$2({
|
|
1998
2024
|
svg,
|
|
1999
|
-
yScale,
|
|
2025
|
+
yScale: primaryScale,
|
|
2000
2026
|
xScale,
|
|
2001
2027
|
yTicksCount,
|
|
2002
2028
|
lastIndex,
|
|
@@ -2012,19 +2038,26 @@ const draw$2 = (node, props) => {
|
|
|
2012
2038
|
const { height: xAxisHeight } = computeDimensions(xAxis);
|
|
2013
2039
|
xAxis.attr('transform', `translate(0, ${height - Math.ceil(xAxisHeight) - marginBottom})`);
|
|
2014
2040
|
}
|
|
2015
|
-
const
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2041
|
+
const createLine = (scale) => {
|
|
2042
|
+
const generator = d3__namespace
|
|
2043
|
+
.line()
|
|
2044
|
+
.defined(d => d !== null)
|
|
2045
|
+
.x((_, index) => xScale(index))
|
|
2046
|
+
.y((d) => scale(d))
|
|
2047
|
+
.curve(curve || d3__namespace.curveLinear);
|
|
2048
|
+
customLine && customLine(generator);
|
|
2049
|
+
return generator;
|
|
2050
|
+
};
|
|
2051
|
+
const line = createLine(primaryScale);
|
|
2052
|
+
const lineRight = yScaleRight ? createLine(yScaleRight) : line;
|
|
2053
|
+
const lineOf = (series) => isRightSeries(series) && yScaleRight ? lineRight : line;
|
|
2022
2054
|
const withAreas = data.some(({ fill }) => fill);
|
|
2023
2055
|
if (withAreas) {
|
|
2024
2056
|
let dataIndex = -2;
|
|
2025
2057
|
const getArea = (d) => {
|
|
2026
2058
|
const { minAreaValues } = d;
|
|
2027
|
-
const
|
|
2059
|
+
const scale = scaleOf(d);
|
|
2060
|
+
const minTick = scale.ticks()[0];
|
|
2028
2061
|
return d3__namespace
|
|
2029
2062
|
.area()
|
|
2030
2063
|
.defined(d => d !== null)
|
|
@@ -2038,18 +2071,18 @@ const draw$2 = (node, props) => {
|
|
|
2038
2071
|
minValue = minAreaValues[index] || minValue;
|
|
2039
2072
|
}
|
|
2040
2073
|
else if (minAreaValues) {
|
|
2041
|
-
minValue =
|
|
2074
|
+
minValue = scale((minValue - value));
|
|
2042
2075
|
}
|
|
2043
2076
|
const currData = data[dataIndex];
|
|
2044
2077
|
return stacked
|
|
2045
2078
|
? dataIndex > -1
|
|
2046
|
-
?
|
|
2079
|
+
? scale(typeof currData.values[index] !== 'number'
|
|
2047
2080
|
? 0
|
|
2048
2081
|
: currData.values[index])
|
|
2049
|
-
:
|
|
2050
|
-
:
|
|
2082
|
+
: scale(minValue)
|
|
2083
|
+
: scale(minValue);
|
|
2051
2084
|
})
|
|
2052
|
-
.y1((d) =>
|
|
2085
|
+
.y1((d) => scale(d))
|
|
2053
2086
|
.curve(areaCurve || curve || d3__namespace.curveLinear);
|
|
2054
2087
|
};
|
|
2055
2088
|
svg
|
|
@@ -2073,7 +2106,7 @@ const draw$2 = (node, props) => {
|
|
|
2073
2106
|
.data(data)
|
|
2074
2107
|
.join('path')
|
|
2075
2108
|
.attr('class', lineChartClassNames.lineChartLine)
|
|
2076
|
-
.attr('d', (d) =>
|
|
2109
|
+
.attr('d', (d) => lineOf(d)(d.values))
|
|
2077
2110
|
.attr('style', ({ style }) => style || '');
|
|
2078
2111
|
if (transitionDuration > 0 && prevStrokes.size > 0) {
|
|
2079
2112
|
lineSelection
|
|
@@ -2093,6 +2126,7 @@ const draw$2 = (node, props) => {
|
|
|
2093
2126
|
dots.forEach(item => {
|
|
2094
2127
|
const { values, dot } = item;
|
|
2095
2128
|
const { radius, style, filter } = dot;
|
|
2129
|
+
const scale = scaleOf(item);
|
|
2096
2130
|
const dotsGroup = dotsGlobal
|
|
2097
2131
|
.append('g')
|
|
2098
2132
|
.attr('class', lineChartClassNames.lineChartDotsGlobal);
|
|
@@ -2102,7 +2136,7 @@ const draw$2 = (node, props) => {
|
|
|
2102
2136
|
.join('circle')
|
|
2103
2137
|
.attr('cx', (_, index) => xScale(index))
|
|
2104
2138
|
.attr('class', lineChartClassNames.lineChartDot)
|
|
2105
|
-
.attr('cy', d =>
|
|
2139
|
+
.attr('cy', d => scale(d))
|
|
2106
2140
|
.attr('r', radius || 0)
|
|
2107
2141
|
.attr('style', style || '');
|
|
2108
2142
|
if (filter) {
|
|
@@ -2114,12 +2148,12 @@ const draw$2 = (node, props) => {
|
|
|
2114
2148
|
});
|
|
2115
2149
|
}
|
|
2116
2150
|
const count = data?.[0]?.values?.length || 0;
|
|
2117
|
-
drawMarkers({ svg, markers, width, left, top: height - marginTop, count, yScale });
|
|
2151
|
+
drawMarkers({ svg, markers, width, left, top: height - marginTop, count, yScale: primaryScale });
|
|
2118
2152
|
d3__namespace.select(node)
|
|
2119
2153
|
.select(`.${labelClassName}`)
|
|
2120
2154
|
.remove();
|
|
2121
2155
|
withLabels &&
|
|
2122
|
-
drawLabel({ node, eachLabel, data,
|
|
2156
|
+
drawLabel({ node, eachLabel, data, yScaleOf: scaleOf, xScale, formatLabel });
|
|
2123
2157
|
if (dynamicTooltipEnable) {
|
|
2124
2158
|
drawTooltip$2({
|
|
2125
2159
|
tooltipLineTop,
|
|
@@ -2131,14 +2165,15 @@ const draw$2 = (node, props) => {
|
|
|
2131
2165
|
svg,
|
|
2132
2166
|
data,
|
|
2133
2167
|
xScale,
|
|
2134
|
-
yScale,
|
|
2168
|
+
yScale: primaryScale,
|
|
2169
|
+
yScaleOf: scaleOf,
|
|
2135
2170
|
dynamicCircleRadius,
|
|
2136
2171
|
tooltipClassName,
|
|
2137
2172
|
dotSnapping,
|
|
2138
2173
|
lastIndex,
|
|
2139
2174
|
});
|
|
2140
2175
|
}
|
|
2141
|
-
customize && customize({ svg, yScale, xScale });
|
|
2176
|
+
customize && customize({ svg, yScale: primaryScale, yScaleRight, xScale });
|
|
2142
2177
|
}
|
|
2143
2178
|
};
|
|
2144
2179
|
|
|
@@ -2272,66 +2307,66 @@ const barChartClassNames = {
|
|
|
2272
2307
|
...labelClassnames,
|
|
2273
2308
|
...barChartLinesClassNames,
|
|
2274
2309
|
};
|
|
2275
|
-
const SvgWrapper$1 = styled(Wrapper) `
|
|
2276
|
-
display: ${({ selectable }) => selectable && "inline-block"};
|
|
2277
|
-
user-select: ${({ selectable }) => selectable && "none"};
|
|
2278
|
-
width: ${({ selectable }) => selectable && "auto"};
|
|
2279
|
-
|
|
2280
|
-
line {
|
|
2281
|
-
stroke-width: 1px;
|
|
2282
|
-
shape-rendering: crispEdges;
|
|
2283
|
-
}
|
|
2284
|
-
|
|
2285
|
-
.${barChartClassNames.barChartGridLineX},
|
|
2286
|
-
.${barChartClassNames.barChartGridLineY} {
|
|
2287
|
-
stroke: rgba(48, 69, 79, 0.06);
|
|
2288
|
-
}
|
|
2289
|
-
|
|
2290
|
-
.${barChartClassNames.barChartMouseRect} {
|
|
2291
|
-
}
|
|
2292
|
-
|
|
2293
|
-
.${barChartClassNames.barChartMouseRect} {
|
|
2294
|
-
fill: none;
|
|
2295
|
-
pointer-events: all;
|
|
2296
|
-
}
|
|
2297
|
-
|
|
2298
|
-
.${barChartClassNames.barChartLinesGlobal} {
|
|
2299
|
-
stroke-width: 1.5px;
|
|
2300
|
-
stroke-linejoin: round;
|
|
2301
|
-
stroke-linecap: round;
|
|
2302
|
-
}
|
|
2303
|
-
|
|
2304
|
-
.${barChartClassNames.barChartLine} {
|
|
2305
|
-
shape-rendering: auto;
|
|
2306
|
-
}
|
|
2307
|
-
|
|
2308
|
-
.${barChartClassNames.barChartArea} {
|
|
2309
|
-
fill-opacity: 0.24;
|
|
2310
|
-
}
|
|
2311
|
-
|
|
2312
|
-
.${barChartClassNames.barChartSelection} {
|
|
2313
|
-
position: absolute;
|
|
2314
|
-
top: 0;
|
|
2315
|
-
width: 0;
|
|
2316
|
-
background: rgba(0, 170, 255, 0.06);
|
|
2317
|
-
box-shadow: 1px 0 0 #00AAFF, -1px 0 0 #00AAFF;
|
|
2318
|
-
pointer-events: none;
|
|
2319
|
-
}
|
|
2310
|
+
const SvgWrapper$1 = styled(Wrapper) `
|
|
2311
|
+
display: ${({ selectable }) => selectable && "inline-block"};
|
|
2312
|
+
user-select: ${({ selectable }) => selectable && "none"};
|
|
2313
|
+
width: ${({ selectable }) => selectable && "auto"};
|
|
2314
|
+
|
|
2315
|
+
line {
|
|
2316
|
+
stroke-width: 1px;
|
|
2317
|
+
shape-rendering: crispEdges;
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2320
|
+
.${barChartClassNames.barChartGridLineX},
|
|
2321
|
+
.${barChartClassNames.barChartGridLineY} {
|
|
2322
|
+
stroke: rgba(48, 69, 79, 0.06);
|
|
2323
|
+
}
|
|
2324
|
+
|
|
2325
|
+
.${barChartClassNames.barChartMouseRect} {
|
|
2326
|
+
}
|
|
2327
|
+
|
|
2328
|
+
.${barChartClassNames.barChartMouseRect} {
|
|
2329
|
+
fill: none;
|
|
2330
|
+
pointer-events: all;
|
|
2331
|
+
}
|
|
2332
|
+
|
|
2333
|
+
.${barChartClassNames.barChartLinesGlobal} {
|
|
2334
|
+
stroke-width: 1.5px;
|
|
2335
|
+
stroke-linejoin: round;
|
|
2336
|
+
stroke-linecap: round;
|
|
2337
|
+
}
|
|
2338
|
+
|
|
2339
|
+
.${barChartClassNames.barChartLine} {
|
|
2340
|
+
shape-rendering: auto;
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
.${barChartClassNames.barChartArea} {
|
|
2344
|
+
fill-opacity: 0.24;
|
|
2345
|
+
}
|
|
2346
|
+
|
|
2347
|
+
.${barChartClassNames.barChartSelection} {
|
|
2348
|
+
position: absolute;
|
|
2349
|
+
top: 0;
|
|
2350
|
+
width: 0;
|
|
2351
|
+
background: rgba(0, 170, 255, 0.06);
|
|
2352
|
+
box-shadow: 1px 0 0 #00AAFF, -1px 0 0 #00AAFF;
|
|
2353
|
+
pointer-events: none;
|
|
2354
|
+
}
|
|
2320
2355
|
`;
|
|
2321
|
-
const TooltipStyles$1 = styled.createGlobalStyle `
|
|
2322
|
-
.${barChartClassNames.barChartMouseTooltip} {
|
|
2323
|
-
z-index: 100;
|
|
2324
|
-
transition: all linear 144ms;
|
|
2325
|
-
|
|
2326
|
-
.${barChartClassNames.barChartTooltipItem} {
|
|
2327
|
-
padding: 0.125rem;
|
|
2328
|
-
margin-bottom: 4px;
|
|
2329
|
-
|
|
2330
|
-
:last-of-type {
|
|
2331
|
-
margin-bottom: 0;
|
|
2332
|
-
}
|
|
2333
|
-
}
|
|
2334
|
-
}
|
|
2356
|
+
const TooltipStyles$1 = styled.createGlobalStyle `
|
|
2357
|
+
.${barChartClassNames.barChartMouseTooltip} {
|
|
2358
|
+
z-index: 100;
|
|
2359
|
+
transition: all linear 144ms;
|
|
2360
|
+
|
|
2361
|
+
.${barChartClassNames.barChartTooltipItem} {
|
|
2362
|
+
padding: 0.125rem;
|
|
2363
|
+
margin-bottom: 4px;
|
|
2364
|
+
|
|
2365
|
+
:last-of-type {
|
|
2366
|
+
margin-bottom: 0;
|
|
2367
|
+
}
|
|
2368
|
+
}
|
|
2369
|
+
}
|
|
2335
2370
|
`;
|
|
2336
2371
|
|
|
2337
2372
|
const useSelection = (node, props) => {
|
|
@@ -3171,45 +3206,45 @@ const horizontalBarChartClassNames = {
|
|
|
3171
3206
|
horizontalBarChartTooltipName: "horizontalBarChartTooltipName",
|
|
3172
3207
|
horizontalBarChartTooltipValue: "horizontalBarChartTooltipValue",
|
|
3173
3208
|
};
|
|
3174
|
-
const Table = styled.table `
|
|
3175
|
-
width: 100%;
|
|
3209
|
+
const Table = styled.table `
|
|
3210
|
+
width: 100%;
|
|
3176
3211
|
`;
|
|
3177
|
-
const LabelCell = styled.div `
|
|
3178
|
-
text-align: right;
|
|
3212
|
+
const LabelCell = styled.div `
|
|
3213
|
+
text-align: right;
|
|
3179
3214
|
`;
|
|
3180
|
-
const BarFlex = styled.div `
|
|
3181
|
-
width: 100%;
|
|
3182
|
-
display: flex;
|
|
3183
|
-
height: 1rem;
|
|
3215
|
+
const BarFlex = styled.div `
|
|
3216
|
+
width: 100%;
|
|
3217
|
+
display: flex;
|
|
3218
|
+
height: 1rem;
|
|
3184
3219
|
`;
|
|
3185
|
-
const BarsTd = styled.td `
|
|
3186
|
-
width: 100%;
|
|
3187
|
-
position: relative;
|
|
3188
|
-
vertical-align: middle;
|
|
3220
|
+
const BarsTd = styled.td `
|
|
3221
|
+
width: 100%;
|
|
3222
|
+
position: relative;
|
|
3223
|
+
vertical-align: middle;
|
|
3189
3224
|
`;
|
|
3190
|
-
const TooltipFlex = styled(TooltipFlex$1) `
|
|
3191
|
-
position: absolute;
|
|
3192
|
-
top: 0;
|
|
3193
|
-
left: 50%;
|
|
3194
|
-
transform: translate(-50%, -50%);
|
|
3195
|
-
will-change: left, top;
|
|
3225
|
+
const TooltipFlex = styled(TooltipFlex$1) `
|
|
3226
|
+
position: absolute;
|
|
3227
|
+
top: 0;
|
|
3228
|
+
left: 50%;
|
|
3229
|
+
transform: translate(-50%, -50%);
|
|
3230
|
+
will-change: left, top;
|
|
3196
3231
|
`;
|
|
3197
|
-
const StackSumContainer = styled.div `
|
|
3198
|
-
position: relative;
|
|
3232
|
+
const StackSumContainer = styled.div `
|
|
3233
|
+
position: relative;
|
|
3199
3234
|
`;
|
|
3200
|
-
const StackSum = styled.div `
|
|
3201
|
-
white-space: nowrap;
|
|
3202
|
-
position: absolute;
|
|
3203
|
-
top: 50%;
|
|
3204
|
-
left: 50%;
|
|
3205
|
-
transform: translate(0, -50%);
|
|
3235
|
+
const StackSum = styled.div `
|
|
3236
|
+
white-space: nowrap;
|
|
3237
|
+
position: absolute;
|
|
3238
|
+
top: 50%;
|
|
3239
|
+
left: 50%;
|
|
3240
|
+
transform: translate(0, -50%);
|
|
3206
3241
|
`;
|
|
3207
|
-
const StackWrapper = styled.div `
|
|
3208
|
-
position: absolute;
|
|
3209
|
-
top: 0;
|
|
3210
|
-
display: flex;
|
|
3211
|
-
justify-content: flex-start;
|
|
3212
|
-
height: 100%;
|
|
3242
|
+
const StackWrapper = styled.div `
|
|
3243
|
+
position: absolute;
|
|
3244
|
+
top: 0;
|
|
3245
|
+
display: flex;
|
|
3246
|
+
justify-content: flex-start;
|
|
3247
|
+
height: 100%;
|
|
3213
3248
|
`;
|
|
3214
3249
|
|
|
3215
3250
|
const Tooltip$1 = ({ renderTooltip, bars, style, className, }) => {
|
|
@@ -3261,10 +3296,10 @@ const useStackWrapper = (stackedTooltip) => {
|
|
|
3261
3296
|
: ({ children }) => (jsxRuntime.jsx(react.Fragment, { children: children })), [stackedTooltip]);
|
|
3262
3297
|
};
|
|
3263
3298
|
|
|
3264
|
-
const BarStyled = styled.div `
|
|
3265
|
-
position: relative;
|
|
3266
|
-
display: inline-flex;
|
|
3267
|
-
height: 100%;
|
|
3299
|
+
const BarStyled = styled.div `
|
|
3300
|
+
position: relative;
|
|
3301
|
+
display: inline-flex;
|
|
3302
|
+
height: 100%;
|
|
3268
3303
|
`;
|
|
3269
3304
|
|
|
3270
3305
|
const Bar = ({ withTooltip, bar, formatNativeTitle, tooltipBind, mouseMove, mouseLeave, pointerEventsNone, isFirstChild, isLastChild, isOnlyChild, }) => {
|
|
@@ -3281,23 +3316,23 @@ const Bar = ({ withTooltip, bar, formatNativeTitle, tooltipBind, mouseMove, mous
|
|
|
3281
3316
|
}, title: formatNativeTitle ? formatNativeTitle(bar) : "", onMouseOver: onMouseMove, onMouseMove: tooltipBind ? onMouseMove : void 0, onMouseOut: onMouseLeave }));
|
|
3282
3317
|
};
|
|
3283
3318
|
|
|
3284
|
-
const TickTd = styled.td `
|
|
3285
|
-
position: relative;
|
|
3319
|
+
const TickTd = styled.td `
|
|
3320
|
+
position: relative;
|
|
3286
3321
|
`;
|
|
3287
|
-
const Ticks = styled.div `
|
|
3288
|
-
position: relative;
|
|
3289
|
-
height: 1rem;
|
|
3322
|
+
const Ticks = styled.div `
|
|
3323
|
+
position: relative;
|
|
3324
|
+
height: 1rem;
|
|
3290
3325
|
`;
|
|
3291
|
-
const Tick = styled.div `
|
|
3292
|
-
white-space: nowrap;
|
|
3293
|
-
width: 0;
|
|
3294
|
-
height: 0;
|
|
3295
|
-
position: absolute;
|
|
3296
|
-
top: 50%;
|
|
3297
|
-
transform: translateY(-50%);
|
|
3298
|
-
display: flex;
|
|
3299
|
-
align-items: center;
|
|
3300
|
-
justify-content: center;
|
|
3326
|
+
const Tick = styled.div `
|
|
3327
|
+
white-space: nowrap;
|
|
3328
|
+
width: 0;
|
|
3329
|
+
height: 0;
|
|
3330
|
+
position: absolute;
|
|
3331
|
+
top: 50%;
|
|
3332
|
+
transform: translateY(-50%);
|
|
3333
|
+
display: flex;
|
|
3334
|
+
align-items: center;
|
|
3335
|
+
justify-content: center;
|
|
3301
3336
|
`;
|
|
3302
3337
|
|
|
3303
3338
|
const hundred = 100;
|
|
@@ -3396,29 +3431,29 @@ const bubbleChartClassNames = {
|
|
|
3396
3431
|
bubbleChartTooltipFlex: "bubbleChartTooltipFlex",
|
|
3397
3432
|
bubbleChartTip: "bubbleChartTip",
|
|
3398
3433
|
};
|
|
3399
|
-
const SvgWrapper = styled(Wrapper) `
|
|
3400
|
-
.${bubbleChartClassNames.bubbleChartYAxis},
|
|
3401
|
-
.${bubbleChartClassNames.bubbleChartXAxis},
|
|
3402
|
-
.${bubbleChartClassNames.bubbleChartGridGlobal} {
|
|
3403
|
-
shape-rendering: crispEdges;
|
|
3404
|
-
}
|
|
3405
|
-
|
|
3406
|
-
.${bubbleChartClassNames.bubbleChartGridLineX},
|
|
3407
|
-
.${bubbleChartClassNames.bubbleChartGridLineY} {
|
|
3408
|
-
stroke: rgba(149, 149, 149, 0.24);
|
|
3409
|
-
}
|
|
3410
|
-
|
|
3411
|
-
.${bubbleChartClassNames.bubbleChartYScaleLabel} {
|
|
3412
|
-
font-size: 10px;
|
|
3413
|
-
}
|
|
3434
|
+
const SvgWrapper = styled(Wrapper) `
|
|
3435
|
+
.${bubbleChartClassNames.bubbleChartYAxis},
|
|
3436
|
+
.${bubbleChartClassNames.bubbleChartXAxis},
|
|
3437
|
+
.${bubbleChartClassNames.bubbleChartGridGlobal} {
|
|
3438
|
+
shape-rendering: crispEdges;
|
|
3439
|
+
}
|
|
3440
|
+
|
|
3441
|
+
.${bubbleChartClassNames.bubbleChartGridLineX},
|
|
3442
|
+
.${bubbleChartClassNames.bubbleChartGridLineY} {
|
|
3443
|
+
stroke: rgba(149, 149, 149, 0.24);
|
|
3444
|
+
}
|
|
3445
|
+
|
|
3446
|
+
.${bubbleChartClassNames.bubbleChartYScaleLabel} {
|
|
3447
|
+
font-size: 10px;
|
|
3448
|
+
}
|
|
3414
3449
|
`;
|
|
3415
|
-
const TooltipStyles = styled.createGlobalStyle `
|
|
3416
|
-
.${bubbleChartClassNames.bubbleChartTooltipContainer} {
|
|
3417
|
-
position: absolute;
|
|
3418
|
-
transition: opacity 150ms cubic-bezier(0.2, 1, 0.6, 1);
|
|
3419
|
-
pointer-events: none;
|
|
3420
|
-
z-index: 1;
|
|
3421
|
-
}
|
|
3450
|
+
const TooltipStyles = styled.createGlobalStyle `
|
|
3451
|
+
.${bubbleChartClassNames.bubbleChartTooltipContainer} {
|
|
3452
|
+
position: absolute;
|
|
3453
|
+
transition: opacity 150ms cubic-bezier(0.2, 1, 0.6, 1);
|
|
3454
|
+
pointer-events: none;
|
|
3455
|
+
z-index: 1;
|
|
3456
|
+
}
|
|
3422
3457
|
`;
|
|
3423
3458
|
|
|
3424
3459
|
const drawGrid = ({ svg, yScale, xScale, yTicksCount, drawGridX, drawGridY, }) => {
|
|
@@ -3455,14 +3490,14 @@ const drawGrid = ({ svg, yScale, xScale, yTicksCount, drawGridX, drawGridY, }) =
|
|
|
3455
3490
|
}
|
|
3456
3491
|
};
|
|
3457
3492
|
|
|
3458
|
-
const Tooltip = styled.div `
|
|
3459
|
-
width: 0;
|
|
3460
|
-
height: 0;
|
|
3461
|
-
display: flex;
|
|
3462
|
-
align-items: flex-end;
|
|
3463
|
-
justify-content: center;
|
|
3464
|
-
font-size: 12px;
|
|
3465
|
-
white-space: nowrap;
|
|
3493
|
+
const Tooltip = styled.div `
|
|
3494
|
+
width: 0;
|
|
3495
|
+
height: 0;
|
|
3496
|
+
display: flex;
|
|
3497
|
+
align-items: flex-end;
|
|
3498
|
+
justify-content: center;
|
|
3499
|
+
font-size: 12px;
|
|
3500
|
+
white-space: nowrap;
|
|
3466
3501
|
`;
|
|
3467
3502
|
|
|
3468
3503
|
const drawTooltip = ({ bubbles, tooltipRoot, tooltipClassName, renderTooltip, }) => {
|