@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/charts.esm.js
CHANGED
|
@@ -6,10 +6,10 @@ import ReactDOMServer from 'react-dom/server';
|
|
|
6
6
|
import { uniqueId } from 'lodash';
|
|
7
7
|
import { unmountComponentAtNode, render } from 'react-dom';
|
|
8
8
|
|
|
9
|
-
const Wrapper = styled.div `
|
|
10
|
-
position: relative;
|
|
11
|
-
width: 100%;
|
|
12
|
-
box-sizing: border-box;
|
|
9
|
+
const Wrapper = styled.div `
|
|
10
|
+
position: relative;
|
|
11
|
+
width: 100%;
|
|
12
|
+
box-sizing: border-box;
|
|
13
13
|
`;
|
|
14
14
|
|
|
15
15
|
function useNode() {
|
|
@@ -107,10 +107,10 @@ const drawMarkers = ({ svg, markers, width, left, top, count, yScale }) => {
|
|
|
107
107
|
});
|
|
108
108
|
};
|
|
109
109
|
|
|
110
|
-
const SwipeScrollContainer = styled.div `
|
|
111
|
-
width: 100%;
|
|
112
|
-
overflow: hidden;
|
|
113
|
-
user-select: none;
|
|
110
|
+
const SwipeScrollContainer = styled.div `
|
|
111
|
+
width: 100%;
|
|
112
|
+
overflow: hidden;
|
|
113
|
+
user-select: none;
|
|
114
114
|
`;
|
|
115
115
|
|
|
116
116
|
function animate({ duration, timing, draw, }) {
|
|
@@ -262,37 +262,37 @@ const getTranslate$1 = ({ anchor, index, translateX, translateY, }) => {
|
|
|
262
262
|
}
|
|
263
263
|
return `translate(${translateX}px, ${translateY}px)`;
|
|
264
264
|
};
|
|
265
|
-
const Label$2 = styled.div `
|
|
266
|
-
display: flex;
|
|
267
|
-
align-items: center;
|
|
268
|
-
font-size: 12px;
|
|
265
|
+
const Label$2 = styled.div `
|
|
266
|
+
display: flex;
|
|
267
|
+
align-items: center;
|
|
268
|
+
font-size: 12px;
|
|
269
269
|
`;
|
|
270
|
-
const Name$1 = styled.div `
|
|
271
|
-
text-align: center;
|
|
272
|
-
max-width: 120px;
|
|
270
|
+
const Name$1 = styled.div `
|
|
271
|
+
text-align: center;
|
|
272
|
+
max-width: 120px;
|
|
273
273
|
`;
|
|
274
|
-
const middleBadgeStyles = css `
|
|
275
|
-
position: absolute;
|
|
276
|
-
top: 50%;
|
|
277
|
-
right: 0;
|
|
278
|
-
transform: translate(calc(100% + 6px), -50%);
|
|
274
|
+
const middleBadgeStyles = css `
|
|
275
|
+
position: absolute;
|
|
276
|
+
top: 50%;
|
|
277
|
+
right: 0;
|
|
278
|
+
transform: translate(calc(100% + 6px), -50%);
|
|
279
279
|
`;
|
|
280
|
-
const DefaultBadge = styled.div `
|
|
281
|
-
display: flex;
|
|
282
|
-
align-items: center;
|
|
283
|
-
padding: 2px 4px;
|
|
284
|
-
border-radius: 4px;
|
|
285
|
-
color: rgb(255, 255, 255);
|
|
286
|
-
background-color: rgb(144, 197, 61);
|
|
287
|
-
margin-left: 8px;
|
|
280
|
+
const DefaultBadge = styled.div `
|
|
281
|
+
display: flex;
|
|
282
|
+
align-items: center;
|
|
283
|
+
padding: 2px 4px;
|
|
284
|
+
border-radius: 4px;
|
|
285
|
+
color: rgb(255, 255, 255);
|
|
286
|
+
background-color: rgb(144, 197, 61);
|
|
287
|
+
margin-left: 8px;
|
|
288
288
|
`;
|
|
289
|
-
const MiddleBadge = styled(DefaultBadge) `
|
|
290
|
-
${middleBadgeStyles}
|
|
289
|
+
const MiddleBadge = styled(DefaultBadge) `
|
|
290
|
+
${middleBadgeStyles}
|
|
291
291
|
`;
|
|
292
|
-
const BadgePrefix = styled.div `
|
|
293
|
-
margin-left: 4px;
|
|
294
|
-
font-size: 10px;
|
|
295
|
-
color: rgba(255, 255, 255, 0.54);
|
|
292
|
+
const BadgePrefix = styled.div `
|
|
293
|
+
margin-left: 4px;
|
|
294
|
+
font-size: 10px;
|
|
295
|
+
color: rgba(255, 255, 255, 0.54);
|
|
296
296
|
`;
|
|
297
297
|
|
|
298
298
|
const radarChartclassNames = {
|
|
@@ -307,29 +307,29 @@ const radarChartclassNames = {
|
|
|
307
307
|
radarLabelBadgePrefix: 'radarLabelBadgePrefix',
|
|
308
308
|
radarCircle: 'radarCircle',
|
|
309
309
|
};
|
|
310
|
-
const SvgWrapper$5 = styled(Wrapper) `
|
|
311
|
-
.${radarChartclassNames.radarAxis} {
|
|
312
|
-
path,
|
|
313
|
-
line,
|
|
314
|
-
circle {
|
|
315
|
-
fill: none;
|
|
316
|
-
stroke-width: 1px;
|
|
317
|
-
stroke: rgba(149, 149, 149, 0.18);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
.${radarChartclassNames.radarAxisText} {
|
|
321
|
-
font-size: 12px;
|
|
322
|
-
fill-opacity: 0.56;
|
|
323
|
-
}
|
|
324
|
-
.${radarChartclassNames.radarPolygon} {
|
|
325
|
-
fill-opacity: 0.06;
|
|
326
|
-
stroke-width: 2px;
|
|
327
|
-
fill: rgb(144, 197, 61);
|
|
328
|
-
stroke: rgb(144, 197, 61);
|
|
329
|
-
}
|
|
330
|
-
.${radarChartclassNames.radarCircle} {
|
|
331
|
-
fill: rgb(144, 197, 61);
|
|
332
|
-
}
|
|
310
|
+
const SvgWrapper$5 = styled(Wrapper) `
|
|
311
|
+
.${radarChartclassNames.radarAxis} {
|
|
312
|
+
path,
|
|
313
|
+
line,
|
|
314
|
+
circle {
|
|
315
|
+
fill: none;
|
|
316
|
+
stroke-width: 1px;
|
|
317
|
+
stroke: rgba(149, 149, 149, 0.18);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
.${radarChartclassNames.radarAxisText} {
|
|
321
|
+
font-size: 12px;
|
|
322
|
+
fill-opacity: 0.56;
|
|
323
|
+
}
|
|
324
|
+
.${radarChartclassNames.radarPolygon} {
|
|
325
|
+
fill-opacity: 0.06;
|
|
326
|
+
stroke-width: 2px;
|
|
327
|
+
fill: rgb(144, 197, 61);
|
|
328
|
+
stroke: rgb(144, 197, 61);
|
|
329
|
+
}
|
|
330
|
+
.${radarChartclassNames.radarCircle} {
|
|
331
|
+
fill: rgb(144, 197, 61);
|
|
332
|
+
}
|
|
333
333
|
`;
|
|
334
334
|
|
|
335
335
|
const getTranslate = ({ anchor, index, translateX, translateY, }) => {
|
|
@@ -351,8 +351,8 @@ const LabelContainer$1 = styled.div.attrs(props => ({
|
|
|
351
351
|
style: {
|
|
352
352
|
transform: getTranslate(props),
|
|
353
353
|
},
|
|
354
|
-
})) `
|
|
355
|
-
position: absolute;
|
|
354
|
+
})) `
|
|
355
|
+
position: absolute;
|
|
356
356
|
`;
|
|
357
357
|
|
|
358
358
|
const degByIndex = (index, count) => {
|
|
@@ -616,24 +616,24 @@ const pieChartclassNames = {
|
|
|
616
616
|
pieTooltipColorBox: 'pieTooltipColorBox',
|
|
617
617
|
pieFullChartTooltipCircle: 'pieFullChartTooltipCircle',
|
|
618
618
|
};
|
|
619
|
-
const SvgWrapper$4 = styled(Wrapper) `
|
|
620
|
-
.${pieChartclassNames.pieSliceLabel} {
|
|
621
|
-
fill: #4a4a4a;
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
.${pieChartclassNames.pieRadialLabel} {
|
|
625
|
-
position: absolute;
|
|
626
|
-
max-width: 128px;
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
.${pieChartclassNames.pieRadialLink} {
|
|
630
|
-
stroke: #000;
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
.${pieChartclassNames.pieFullChartTooltipCircle} {
|
|
634
|
-
fill: transparent;
|
|
635
|
-
cursor: pointer;
|
|
636
|
-
}
|
|
619
|
+
const SvgWrapper$4 = styled(Wrapper) `
|
|
620
|
+
.${pieChartclassNames.pieSliceLabel} {
|
|
621
|
+
fill: #4a4a4a;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
.${pieChartclassNames.pieRadialLabel} {
|
|
625
|
+
position: absolute;
|
|
626
|
+
max-width: 128px;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
.${pieChartclassNames.pieRadialLink} {
|
|
630
|
+
stroke: #000;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
.${pieChartclassNames.pieFullChartTooltipCircle} {
|
|
634
|
+
fill: transparent;
|
|
635
|
+
cursor: pointer;
|
|
636
|
+
}
|
|
637
637
|
`;
|
|
638
638
|
|
|
639
639
|
function radiansToDegrees(radians) {
|
|
@@ -733,90 +733,90 @@ const drawRadialLabels = ({ arc, enableRadialLabels, global, node, radius, dataR
|
|
|
733
733
|
}
|
|
734
734
|
};
|
|
735
735
|
|
|
736
|
-
const TooltipFlex$1 = styled.div `
|
|
737
|
-
width: 0;
|
|
738
|
-
height: 0;
|
|
739
|
-
display: flex;
|
|
740
|
-
align-items: flex-end;
|
|
741
|
-
justify-content: center;
|
|
742
|
-
pointer-events: none;
|
|
743
|
-
white-space: nowrap;
|
|
736
|
+
const TooltipFlex$1 = styled.div `
|
|
737
|
+
width: 0;
|
|
738
|
+
height: 0;
|
|
739
|
+
display: flex;
|
|
740
|
+
align-items: flex-end;
|
|
741
|
+
justify-content: center;
|
|
742
|
+
pointer-events: none;
|
|
743
|
+
white-space: nowrap;
|
|
744
744
|
`;
|
|
745
745
|
const LabelFlex = styled(TooltipFlex$1) ``;
|
|
746
|
-
const LabelFlexCenter = styled(LabelFlex) `
|
|
747
|
-
align-items: center;
|
|
746
|
+
const LabelFlexCenter = styled(LabelFlex) `
|
|
747
|
+
align-items: center;
|
|
748
748
|
`;
|
|
749
|
-
const TooltipContainer = styled.div `
|
|
750
|
-
position: relative;
|
|
751
|
-
font-size: 11px;
|
|
752
|
-
color: #fff;
|
|
753
|
-
margin-bottom: 8px;
|
|
754
|
-
padding: 4px 6px;
|
|
755
|
-
background-color: rgba(48, 69, 79, 1);
|
|
756
|
-
border-radius: 4px;
|
|
757
|
-
box-shadow: 0 0.1875rem 0.5rem rgba(48, 69, 79, 0.06);
|
|
758
|
-
|
|
759
|
-
:before {
|
|
760
|
-
content: '';
|
|
761
|
-
position: absolute;
|
|
762
|
-
bottom: 0;
|
|
763
|
-
left: 50%;
|
|
764
|
-
transform: translate(-50%, 100%);
|
|
765
|
-
width: 0;
|
|
766
|
-
height: 0;
|
|
767
|
-
border-style: solid;
|
|
768
|
-
border-width: 4px 3px 0 3px;
|
|
769
|
-
border-color: rgba(48, 69, 79, 1) transparent transparent transparent;
|
|
770
|
-
}
|
|
749
|
+
const TooltipContainer = styled.div `
|
|
750
|
+
position: relative;
|
|
751
|
+
font-size: 11px;
|
|
752
|
+
color: #fff;
|
|
753
|
+
margin-bottom: 8px;
|
|
754
|
+
padding: 4px 6px;
|
|
755
|
+
background-color: rgba(48, 69, 79, 1);
|
|
756
|
+
border-radius: 4px;
|
|
757
|
+
box-shadow: 0 0.1875rem 0.5rem rgba(48, 69, 79, 0.06);
|
|
758
|
+
|
|
759
|
+
:before {
|
|
760
|
+
content: '';
|
|
761
|
+
position: absolute;
|
|
762
|
+
bottom: 0;
|
|
763
|
+
left: 50%;
|
|
764
|
+
transform: translate(-50%, 100%);
|
|
765
|
+
width: 0;
|
|
766
|
+
height: 0;
|
|
767
|
+
border-style: solid;
|
|
768
|
+
border-width: 4px 3px 0 3px;
|
|
769
|
+
border-color: rgba(48, 69, 79, 1) transparent transparent transparent;
|
|
770
|
+
}
|
|
771
771
|
`;
|
|
772
|
-
const TooltipGroupName = styled.div `
|
|
773
|
-
font-size: 14px;
|
|
774
|
-
margin-bottom: 6px;
|
|
772
|
+
const TooltipGroupName = styled.div `
|
|
773
|
+
font-size: 14px;
|
|
774
|
+
margin-bottom: 6px;
|
|
775
775
|
`;
|
|
776
|
-
const TooltipItem = styled.div `
|
|
777
|
-
display: flex;
|
|
778
|
-
align-items: center;
|
|
779
|
-
margin-bottom: 0.25rem;
|
|
780
|
-
|
|
781
|
-
&:last-of-type {
|
|
782
|
-
margin-bottom: 0;
|
|
783
|
-
}
|
|
776
|
+
const TooltipItem = styled.div `
|
|
777
|
+
display: flex;
|
|
778
|
+
align-items: center;
|
|
779
|
+
margin-bottom: 0.25rem;
|
|
780
|
+
|
|
781
|
+
&:last-of-type {
|
|
782
|
+
margin-bottom: 0;
|
|
783
|
+
}
|
|
784
784
|
`;
|
|
785
|
-
const ColFlex = styled.div `
|
|
786
|
-
display: flex;
|
|
787
|
-
align-items: center;
|
|
788
|
-
margin-right: 4px;
|
|
785
|
+
const ColFlex = styled.div `
|
|
786
|
+
display: flex;
|
|
787
|
+
align-items: center;
|
|
788
|
+
margin-right: 4px;
|
|
789
789
|
`;
|
|
790
|
-
const ColorBox = styled.div `
|
|
791
|
-
margin-right: 4px;
|
|
792
|
-
width: 10px;
|
|
793
|
-
height: 10px;
|
|
794
|
-
border-radius: 2px;
|
|
790
|
+
const ColorBox = styled.div `
|
|
791
|
+
margin-right: 4px;
|
|
792
|
+
width: 10px;
|
|
793
|
+
height: 10px;
|
|
794
|
+
border-radius: 2px;
|
|
795
795
|
`;
|
|
796
|
-
const ColorLine = styled(ColorBox) `
|
|
797
|
-
height: 2px;
|
|
798
|
-
border-radius: 0;
|
|
796
|
+
const ColorLine = styled(ColorBox) `
|
|
797
|
+
height: 2px;
|
|
798
|
+
border-radius: 0;
|
|
799
799
|
`;
|
|
800
|
-
const Name = styled.div `
|
|
801
|
-
margin-right: 4px;
|
|
800
|
+
const Name = styled.div `
|
|
801
|
+
margin-right: 4px;
|
|
802
802
|
`;
|
|
803
|
-
const Value = styled.div `
|
|
804
|
-
text-align: right;
|
|
805
|
-
flex-shrink: 0;
|
|
806
|
-
flex-grow: 1;
|
|
803
|
+
const Value = styled.div `
|
|
804
|
+
text-align: right;
|
|
805
|
+
flex-shrink: 0;
|
|
806
|
+
flex-grow: 1;
|
|
807
807
|
`;
|
|
808
|
-
const Label$1 = styled.div `
|
|
809
|
-
position: relative;
|
|
810
|
-
font-size: 11px;
|
|
811
|
-
color: #fff;
|
|
812
|
-
font-weight: bold;
|
|
813
|
-
letter-spacing: 0.52px;
|
|
808
|
+
const Label$1 = styled.div `
|
|
809
|
+
position: relative;
|
|
810
|
+
font-size: 11px;
|
|
811
|
+
color: #fff;
|
|
812
|
+
font-weight: bold;
|
|
813
|
+
letter-spacing: 0.52px;
|
|
814
814
|
`;
|
|
815
|
-
const LabelTop = styled(Label$1) `
|
|
816
|
-
top: 6px;
|
|
815
|
+
const LabelTop = styled(Label$1) `
|
|
816
|
+
top: 6px;
|
|
817
817
|
`;
|
|
818
|
-
const LabelBottom = styled(Label$1) `
|
|
819
|
-
bottom: 6px;
|
|
818
|
+
const LabelBottom = styled(Label$1) `
|
|
819
|
+
bottom: 6px;
|
|
820
820
|
`;
|
|
821
821
|
|
|
822
822
|
const drawTooltip$3 = ({ fullChartTooltip, global, tooltipRoot, data, tooltipClassName, tooltipBind, renderTooltip, arc, allSlices, tooltipStyle, width, height, radius, }) => {
|
|
@@ -1261,53 +1261,53 @@ const calendarChartClassNames = {
|
|
|
1261
1261
|
...legendClassNames,
|
|
1262
1262
|
};
|
|
1263
1263
|
const headerHeight = "20px";
|
|
1264
|
-
const SvgWrapper$3 = styled(Wrapper) `
|
|
1265
|
-
.${calendarChartClassNames.calendarYear} {
|
|
1266
|
-
display: flex;
|
|
1267
|
-
margin-bottom: 16px;
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
.${calendarChartClassNames.calendarYearTitle} {
|
|
1271
|
-
display: inline-flex;
|
|
1272
|
-
align-items: flex-end;
|
|
1273
|
-
height: ${headerHeight};
|
|
1274
|
-
margin-bottom: 4px;
|
|
1275
|
-
font-weight: bold;
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1278
|
-
.${calendarChartClassNames.calendarHeader} {
|
|
1279
|
-
height: ${headerHeight};
|
|
1280
|
-
margin-bottom: 4px;
|
|
1281
|
-
position: relative;
|
|
1282
|
-
display: flex;
|
|
1283
|
-
}
|
|
1284
|
-
|
|
1285
|
-
.${calendarChartClassNames.calendarMonth} {
|
|
1286
|
-
font-size: 14px;
|
|
1287
|
-
bottom: 0;
|
|
1288
|
-
position: absolute;
|
|
1289
|
-
}
|
|
1290
|
-
|
|
1291
|
-
.${calendarChartClassNames.calendarAxis} {
|
|
1292
|
-
display: flex;
|
|
1293
|
-
flex-direction: column;
|
|
1294
|
-
margin-right: 10px;
|
|
1295
|
-
}
|
|
1296
|
-
|
|
1297
|
-
.${calendarChartClassNames.calendarWeekDay} {
|
|
1298
|
-
font-size: 12px;
|
|
1299
|
-
display: inline-flex;
|
|
1300
|
-
align-items: center;
|
|
1301
|
-
justify-content: flex-end;
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
.${calendarChartClassNames.calendarDays} {
|
|
1305
|
-
position: relative;
|
|
1306
|
-
}
|
|
1307
|
-
|
|
1308
|
-
.${calendarChartClassNames.calendarDay} {
|
|
1309
|
-
position: absolute;
|
|
1310
|
-
}
|
|
1264
|
+
const SvgWrapper$3 = styled(Wrapper) `
|
|
1265
|
+
.${calendarChartClassNames.calendarYear} {
|
|
1266
|
+
display: flex;
|
|
1267
|
+
margin-bottom: 16px;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
.${calendarChartClassNames.calendarYearTitle} {
|
|
1271
|
+
display: inline-flex;
|
|
1272
|
+
align-items: flex-end;
|
|
1273
|
+
height: ${headerHeight};
|
|
1274
|
+
margin-bottom: 4px;
|
|
1275
|
+
font-weight: bold;
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
.${calendarChartClassNames.calendarHeader} {
|
|
1279
|
+
height: ${headerHeight};
|
|
1280
|
+
margin-bottom: 4px;
|
|
1281
|
+
position: relative;
|
|
1282
|
+
display: flex;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
.${calendarChartClassNames.calendarMonth} {
|
|
1286
|
+
font-size: 14px;
|
|
1287
|
+
bottom: 0;
|
|
1288
|
+
position: absolute;
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
.${calendarChartClassNames.calendarAxis} {
|
|
1292
|
+
display: flex;
|
|
1293
|
+
flex-direction: column;
|
|
1294
|
+
margin-right: 10px;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
.${calendarChartClassNames.calendarWeekDay} {
|
|
1298
|
+
font-size: 12px;
|
|
1299
|
+
display: inline-flex;
|
|
1300
|
+
align-items: center;
|
|
1301
|
+
justify-content: flex-end;
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
.${calendarChartClassNames.calendarDays} {
|
|
1305
|
+
position: relative;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
.${calendarChartClassNames.calendarDay} {
|
|
1309
|
+
position: absolute;
|
|
1310
|
+
}
|
|
1311
1311
|
`;
|
|
1312
1312
|
|
|
1313
1313
|
const draw$3 = (node, props) => {
|
|
@@ -1534,67 +1534,67 @@ const lineChartClassNames = {
|
|
|
1534
1534
|
lineChartMouseLabelContainer: "lineChartMouseLabelContainer",
|
|
1535
1535
|
lineChartMouseLabel: "lineChartMouseLabel",
|
|
1536
1536
|
};
|
|
1537
|
-
const SvgWrapper$2 = styled(Wrapper) `
|
|
1538
|
-
.${lineChartClassNames.lineChartYScaleGlobal},
|
|
1539
|
-
.${lineChartClassNames.lineChartXScaleGlobal},
|
|
1540
|
-
.${lineChartClassNames.lineChartGridGlobal} {
|
|
1541
|
-
shape-rendering: crispEdges;
|
|
1542
|
-
}
|
|
1543
|
-
|
|
1544
|
-
.${lineChartClassNames.lineChartLinesGlobal} {
|
|
1545
|
-
fill: none;
|
|
1546
|
-
stroke: steelblue;
|
|
1547
|
-
stroke-width: 1.5px;
|
|
1548
|
-
stroke-linejoin: round;
|
|
1549
|
-
stroke-linecap: round;
|
|
1550
|
-
}
|
|
1551
|
-
|
|
1552
|
-
.${lineChartClassNames.lineChartArea} {
|
|
1553
|
-
fill-opacity: 0.24;
|
|
1554
|
-
}
|
|
1555
|
-
|
|
1556
|
-
.${lineChartClassNames.lineChartGridLineX},
|
|
1557
|
-
.${lineChartClassNames.lineChartGridLineY},
|
|
1558
|
-
.${lineChartClassNames.lineChartMouseLine} {
|
|
1559
|
-
stroke: rgba(149, 149, 149, 0.24);
|
|
1560
|
-
}
|
|
1561
|
-
|
|
1562
|
-
.${lineChartClassNames.lineChartMouseLine},
|
|
1563
|
-
.${lineChartClassNames.lineChartMouseCircle} {
|
|
1564
|
-
transition: opacity linear 200ms;
|
|
1565
|
-
pointer-events: none;
|
|
1566
|
-
stroke-width: 1px;
|
|
1567
|
-
}
|
|
1568
|
-
|
|
1569
|
-
.${lineChartClassNames.lineChartDot} {
|
|
1570
|
-
stroke: #fff;
|
|
1571
|
-
stroke-width: 2px;
|
|
1572
|
-
}
|
|
1573
|
-
|
|
1574
|
-
.${lineChartClassNames.lineChartMouseLine} {
|
|
1575
|
-
shape-rendering: crispEdges;
|
|
1576
|
-
}
|
|
1577
|
-
|
|
1578
|
-
.${lineChartClassNames.lineChartMouseRect} {
|
|
1579
|
-
fill: none;
|
|
1580
|
-
pointer-events: all;
|
|
1581
|
-
}
|
|
1537
|
+
const SvgWrapper$2 = styled(Wrapper) `
|
|
1538
|
+
.${lineChartClassNames.lineChartYScaleGlobal},
|
|
1539
|
+
.${lineChartClassNames.lineChartXScaleGlobal},
|
|
1540
|
+
.${lineChartClassNames.lineChartGridGlobal} {
|
|
1541
|
+
shape-rendering: crispEdges;
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
.${lineChartClassNames.lineChartLinesGlobal} {
|
|
1545
|
+
fill: none;
|
|
1546
|
+
stroke: steelblue;
|
|
1547
|
+
stroke-width: 1.5px;
|
|
1548
|
+
stroke-linejoin: round;
|
|
1549
|
+
stroke-linecap: round;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
.${lineChartClassNames.lineChartArea} {
|
|
1553
|
+
fill-opacity: 0.24;
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
.${lineChartClassNames.lineChartGridLineX},
|
|
1557
|
+
.${lineChartClassNames.lineChartGridLineY},
|
|
1558
|
+
.${lineChartClassNames.lineChartMouseLine} {
|
|
1559
|
+
stroke: rgba(149, 149, 149, 0.24);
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
.${lineChartClassNames.lineChartMouseLine},
|
|
1563
|
+
.${lineChartClassNames.lineChartMouseCircle} {
|
|
1564
|
+
transition: opacity linear 200ms;
|
|
1565
|
+
pointer-events: none;
|
|
1566
|
+
stroke-width: 1px;
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
.${lineChartClassNames.lineChartDot} {
|
|
1570
|
+
stroke: #fff;
|
|
1571
|
+
stroke-width: 2px;
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
.${lineChartClassNames.lineChartMouseLine} {
|
|
1575
|
+
shape-rendering: crispEdges;
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
.${lineChartClassNames.lineChartMouseRect} {
|
|
1579
|
+
fill: none;
|
|
1580
|
+
pointer-events: all;
|
|
1581
|
+
}
|
|
1582
1582
|
`;
|
|
1583
|
-
const TooltipStyles$2 = createGlobalStyle `
|
|
1584
|
-
.${lineChartClassNames.lineChartMouseLabel} {
|
|
1585
|
-
transition: opacity linear 200ms;
|
|
1586
|
-
z-index: 100;
|
|
1587
|
-
|
|
1588
|
-
.${lineChartClassNames.lineChartLabelFlex} {
|
|
1589
|
-
justify-content: flex-start;
|
|
1590
|
-
align-items: center;
|
|
1591
|
-
pointer-events: none;
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
|
-
.${lineChartClassNames.lineChartLabel} {
|
|
1595
|
-
margin: 0 0 0 10px;
|
|
1596
|
-
}
|
|
1597
|
-
}
|
|
1583
|
+
const TooltipStyles$2 = createGlobalStyle `
|
|
1584
|
+
.${lineChartClassNames.lineChartMouseLabel} {
|
|
1585
|
+
transition: opacity linear 200ms;
|
|
1586
|
+
z-index: 100;
|
|
1587
|
+
|
|
1588
|
+
.${lineChartClassNames.lineChartLabelFlex} {
|
|
1589
|
+
justify-content: flex-start;
|
|
1590
|
+
align-items: center;
|
|
1591
|
+
pointer-events: none;
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
.${lineChartClassNames.lineChartLabel} {
|
|
1595
|
+
margin: 0 0 0 10px;
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
1598
|
`;
|
|
1599
1599
|
|
|
1600
1600
|
const drawGrid$2 = ({ svg, yScale, xScale, yTicksCount, lastIndex, drawGridX, drawGridY, }) => {
|
|
@@ -1630,28 +1630,29 @@ const drawGrid$2 = ({ svg, yScale, xScale, yTicksCount, lastIndex, drawGridX, dr
|
|
|
1630
1630
|
}
|
|
1631
1631
|
};
|
|
1632
1632
|
|
|
1633
|
-
const LabelContainer = styled.div `
|
|
1634
|
-
width: 0;
|
|
1635
|
-
height: 0;
|
|
1636
|
-
display: flex;
|
|
1637
|
-
align-items: flex-end;
|
|
1638
|
-
justify-content: center;
|
|
1639
|
-
font-size: 12px;
|
|
1640
|
-
white-space: nowrap;
|
|
1633
|
+
const LabelContainer = styled.div `
|
|
1634
|
+
width: 0;
|
|
1635
|
+
height: 0;
|
|
1636
|
+
display: flex;
|
|
1637
|
+
align-items: flex-end;
|
|
1638
|
+
justify-content: center;
|
|
1639
|
+
font-size: 12px;
|
|
1640
|
+
white-space: nowrap;
|
|
1641
1641
|
`;
|
|
1642
|
-
const Label = styled.div `
|
|
1643
|
-
margin-bottom: 4px;
|
|
1642
|
+
const Label = styled.div `
|
|
1643
|
+
margin-bottom: 4px;
|
|
1644
1644
|
`;
|
|
1645
1645
|
|
|
1646
1646
|
const labelClassName = "d3-chart-label";
|
|
1647
|
-
const drawLabel = ({ node, data,
|
|
1647
|
+
const drawLabel = ({ node, data, yScaleOf, xScale, formatLabel, eachLabel, }) => {
|
|
1648
1648
|
const labelsDiv = d3
|
|
1649
1649
|
.select(node)
|
|
1650
1650
|
.append("div")
|
|
1651
1651
|
.attr("class", labelClassName);
|
|
1652
1652
|
const format = d3.format(",");
|
|
1653
|
-
|
|
1654
|
-
|
|
1653
|
+
data.forEach(series => {
|
|
1654
|
+
const values = series.values;
|
|
1655
|
+
const yScale = yScaleOf(series);
|
|
1655
1656
|
labelsDiv
|
|
1656
1657
|
.append("div")
|
|
1657
1658
|
.selectAll("div")
|
|
@@ -1670,7 +1671,7 @@ const drawLabel = ({ node, data, yScale, xScale, formatLabel, eachLabel, }) => {
|
|
|
1670
1671
|
});
|
|
1671
1672
|
};
|
|
1672
1673
|
|
|
1673
|
-
const drawTooltip$2 = ({ svg, node, data: argData, xScale, yScale, dynamicCircleRadius, formatDynamicTooltip, renderTooltip, stackedTooltipIndex, stackedTooltip, tooltipLineTop, tooltipRoot, tooltipClassName, dotSnapping, lastIndex, }) => {
|
|
1674
|
+
const drawTooltip$2 = ({ svg, node, data: argData, xScale, yScale, yScaleOf, dynamicCircleRadius, formatDynamicTooltip, renderTooltip, stackedTooltipIndex, stackedTooltip, tooltipLineTop, tooltipRoot, tooltipClassName, dotSnapping, lastIndex, }) => {
|
|
1674
1675
|
const container = tooltipRoot || document.querySelector("body");
|
|
1675
1676
|
const format = d3.format(",");
|
|
1676
1677
|
const chartData = argData.filter(({ tooltipOff }) => !tooltipOff);
|
|
@@ -1779,7 +1780,7 @@ const drawTooltip$2 = ({ svg, node, data: argData, xScale, yScale, dynamicCircle
|
|
|
1779
1780
|
positions[index] = {
|
|
1780
1781
|
x: x1 + Math.round(currIndex) * step,
|
|
1781
1782
|
y: typeof argData[index].values[Math.round(currIndex)] === "number"
|
|
1782
|
-
?
|
|
1783
|
+
? yScaleOf(argData[index])(argData[index].values[Math.round(currIndex)])
|
|
1783
1784
|
: 0,
|
|
1784
1785
|
};
|
|
1785
1786
|
}
|
|
@@ -1795,7 +1796,7 @@ const drawTooltip$2 = ({ svg, node, data: argData, xScale, yScale, dynamicCircle
|
|
|
1795
1796
|
const datas = chartData.map(({ values, ...rest }, i) => ({
|
|
1796
1797
|
...rest,
|
|
1797
1798
|
value: getValue(values),
|
|
1798
|
-
invertValue: positions[i] ?
|
|
1799
|
+
invertValue: positions[i] ? yScaleOf(rest).invert(positions[i].y) : 0,
|
|
1799
1800
|
}));
|
|
1800
1801
|
const noHasData = datas.every(({ value }) => isVoid(value));
|
|
1801
1802
|
if (noHasData && isVisible) {
|
|
@@ -1883,7 +1884,7 @@ const drawTooltip$2 = ({ svg, node, data: argData, xScale, yScale, dynamicCircle
|
|
|
1883
1884
|
};
|
|
1884
1885
|
|
|
1885
1886
|
const draw$2 = (node, props) => {
|
|
1886
|
-
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,
|
|
1887
|
+
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;
|
|
1887
1888
|
if (node !== null && chartData.length) {
|
|
1888
1889
|
const data = stacked ? stackedData(chartData) : chartData;
|
|
1889
1890
|
const marginTop = margin ? margin.top : 0;
|
|
@@ -1893,12 +1894,21 @@ const draw$2 = (node, props) => {
|
|
|
1893
1894
|
const { width: nodeWidth } = node.getBoundingClientRect();
|
|
1894
1895
|
const width = props.width || nodeWidth;
|
|
1895
1896
|
const height = props.height || 0;
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
const
|
|
1900
|
-
|
|
1901
|
-
|
|
1897
|
+
// Серии разводятся по двум шкалам: без axis серия считается левой, поэтому график с одной
|
|
1898
|
+
// осью ведёт себя ровно как раньше — правая шкала не создаётся и геометрия не меняется.
|
|
1899
|
+
const isRightSeries = ({ axis }) => axis === 'right';
|
|
1900
|
+
const leftData = data.filter(series => !isRightSeries(series));
|
|
1901
|
+
const rightData = data.filter(isRightSeries);
|
|
1902
|
+
const hasLeftAxis = leftData.length > 0;
|
|
1903
|
+
const hasRightAxis = rightData.length > 0;
|
|
1904
|
+
const domainOf = (series, propMin, propMax) => [
|
|
1905
|
+
typeof propMin === 'number'
|
|
1906
|
+
? propMin
|
|
1907
|
+
: d3.min(series, ({ values }) => d3.min(values)) || 0,
|
|
1908
|
+
typeof propMax === 'number'
|
|
1909
|
+
? propMax
|
|
1910
|
+
: d3.max(series, ({ values }) => d3.max(values)) || 0,
|
|
1911
|
+
];
|
|
1902
1912
|
const prevStrokes = new Map();
|
|
1903
1913
|
if (transitionDuration > 0) {
|
|
1904
1914
|
d3.select(node)
|
|
@@ -1914,32 +1924,48 @@ const draw$2 = (node, props) => {
|
|
|
1914
1924
|
];
|
|
1915
1925
|
const yScale = d3
|
|
1916
1926
|
.scaleLinear()
|
|
1917
|
-
.domain(
|
|
1927
|
+
.domain(domainOf(hasLeftAxis ? leftData : data, props.min, props.max))
|
|
1918
1928
|
.range(yRange)
|
|
1919
1929
|
.nice();
|
|
1930
|
+
const yScaleRight = hasRightAxis
|
|
1931
|
+
? d3
|
|
1932
|
+
.scaleLinear()
|
|
1933
|
+
.domain(domainOf(rightData, props.rightMin, props.rightMax))
|
|
1934
|
+
.range(yRange)
|
|
1935
|
+
.nice()
|
|
1936
|
+
: undefined;
|
|
1937
|
+
// Основная шкала — левая; если левых серий нет, её место занимает правая, чтобы сетка,
|
|
1938
|
+
// маркеры и customize получили осмысленную шкалу.
|
|
1939
|
+
const primaryScale = hasLeftAxis || !yScaleRight ? yScale : yScaleRight;
|
|
1940
|
+
const scaleOf = series => series && isRightSeries(series) && yScaleRight ? yScaleRight : primaryScale;
|
|
1920
1941
|
customYScale && customYScale(yScale);
|
|
1921
1942
|
const yTicksCountDefault = 8;
|
|
1922
1943
|
const yAxisLeft = d3.axisLeft(yScale).ticks(yTicksCountDefault);
|
|
1923
1944
|
customYAxis && customYAxis(yAxisLeft);
|
|
1924
|
-
const yTicksCount = yAxisLeft.tickArguments()[0];
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1945
|
+
const yTicksCount = yAxisLeft.tickArguments()[0] ?? yTicksCountDefault;
|
|
1946
|
+
// Деления двух шкал должны попадать на одни и те же высоты, иначе линии сетки идут по левой
|
|
1947
|
+
// оси, а подписи правой висят между ними. `nice` с явным числом делений округляет домен так,
|
|
1948
|
+
// что обе оси дают одинаковое их количество. Для графика с одной осью домен не трогаем —
|
|
1949
|
+
// иначе поменялась бы геометрия уже существующих графиков.
|
|
1950
|
+
if (hasLeftAxis && yScaleRight) {
|
|
1951
|
+
yScale.nice(yTicksCount);
|
|
1952
|
+
yScaleRight.nice(yTicksCount);
|
|
1953
|
+
}
|
|
1954
|
+
let yAxisWidth = 0;
|
|
1955
|
+
if (hasLeftAxis) {
|
|
1956
|
+
const yAxis = svg
|
|
1957
|
+
.append('g')
|
|
1958
|
+
.attr('class', lineChartClassNames.lineChartYScaleGlobal)
|
|
1959
|
+
.call(yAxisLeft)
|
|
1960
|
+
.call(customYAxisSelection ? customYAxisSelection : none);
|
|
1961
|
+
({ width: yAxisWidth } = computeDimensions(yAxis));
|
|
1962
|
+
yAxis.attr('transform', `translate(${marginLeft + yAxisWidth}, 0)`);
|
|
1963
|
+
}
|
|
1932
1964
|
let yAxisRightWidth = 0;
|
|
1933
1965
|
const left = marginLeft + yAxisWidth + (yAxisPadding || 0);
|
|
1934
|
-
if (
|
|
1935
|
-
const
|
|
1936
|
-
|
|
1937
|
-
const yRightScale = d3
|
|
1938
|
-
.scaleLinear()
|
|
1939
|
-
.domain([rightAxisMin || 0, rightAxisMax || 0])
|
|
1940
|
-
.range(yRange)
|
|
1941
|
-
.nice();
|
|
1942
|
-
const yAxisRightTicks = d3.axisRight(yRightScale).ticks(yTicksCountDefault);
|
|
1966
|
+
if (yScaleRight) {
|
|
1967
|
+
const yAxisRightTicks = d3.axisRight(yScaleRight).ticks(yTicksCount);
|
|
1968
|
+
(customYAxisRight || customYAxis)?.(yAxisRightTicks);
|
|
1943
1969
|
const yAxisRight = svg
|
|
1944
1970
|
.append('g')
|
|
1945
1971
|
.attr('class', `${lineChartClassNames.lineChartYScaleGlobal} ${lineChartClassNames.lineChartYScaleRight}`)
|
|
@@ -1975,7 +2001,7 @@ const draw$2 = (node, props) => {
|
|
|
1975
2001
|
customXAxis && customXAxis(xAxisBottom);
|
|
1976
2002
|
drawGrid$2({
|
|
1977
2003
|
svg,
|
|
1978
|
-
yScale,
|
|
2004
|
+
yScale: primaryScale,
|
|
1979
2005
|
xScale,
|
|
1980
2006
|
yTicksCount,
|
|
1981
2007
|
lastIndex,
|
|
@@ -1991,19 +2017,26 @@ const draw$2 = (node, props) => {
|
|
|
1991
2017
|
const { height: xAxisHeight } = computeDimensions(xAxis);
|
|
1992
2018
|
xAxis.attr('transform', `translate(0, ${height - Math.ceil(xAxisHeight) - marginBottom})`);
|
|
1993
2019
|
}
|
|
1994
|
-
const
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2020
|
+
const createLine = (scale) => {
|
|
2021
|
+
const generator = d3
|
|
2022
|
+
.line()
|
|
2023
|
+
.defined(d => d !== null)
|
|
2024
|
+
.x((_, index) => xScale(index))
|
|
2025
|
+
.y((d) => scale(d))
|
|
2026
|
+
.curve(curve || d3.curveLinear);
|
|
2027
|
+
customLine && customLine(generator);
|
|
2028
|
+
return generator;
|
|
2029
|
+
};
|
|
2030
|
+
const line = createLine(primaryScale);
|
|
2031
|
+
const lineRight = yScaleRight ? createLine(yScaleRight) : line;
|
|
2032
|
+
const lineOf = (series) => isRightSeries(series) && yScaleRight ? lineRight : line;
|
|
2001
2033
|
const withAreas = data.some(({ fill }) => fill);
|
|
2002
2034
|
if (withAreas) {
|
|
2003
2035
|
let dataIndex = -2;
|
|
2004
2036
|
const getArea = (d) => {
|
|
2005
2037
|
const { minAreaValues } = d;
|
|
2006
|
-
const
|
|
2038
|
+
const scale = scaleOf(d);
|
|
2039
|
+
const minTick = scale.ticks()[0];
|
|
2007
2040
|
return d3
|
|
2008
2041
|
.area()
|
|
2009
2042
|
.defined(d => d !== null)
|
|
@@ -2017,18 +2050,18 @@ const draw$2 = (node, props) => {
|
|
|
2017
2050
|
minValue = minAreaValues[index] || minValue;
|
|
2018
2051
|
}
|
|
2019
2052
|
else if (minAreaValues) {
|
|
2020
|
-
minValue =
|
|
2053
|
+
minValue = scale((minValue - value));
|
|
2021
2054
|
}
|
|
2022
2055
|
const currData = data[dataIndex];
|
|
2023
2056
|
return stacked
|
|
2024
2057
|
? dataIndex > -1
|
|
2025
|
-
?
|
|
2058
|
+
? scale(typeof currData.values[index] !== 'number'
|
|
2026
2059
|
? 0
|
|
2027
2060
|
: currData.values[index])
|
|
2028
|
-
:
|
|
2029
|
-
:
|
|
2061
|
+
: scale(minValue)
|
|
2062
|
+
: scale(minValue);
|
|
2030
2063
|
})
|
|
2031
|
-
.y1((d) =>
|
|
2064
|
+
.y1((d) => scale(d))
|
|
2032
2065
|
.curve(areaCurve || curve || d3.curveLinear);
|
|
2033
2066
|
};
|
|
2034
2067
|
svg
|
|
@@ -2052,7 +2085,7 @@ const draw$2 = (node, props) => {
|
|
|
2052
2085
|
.data(data)
|
|
2053
2086
|
.join('path')
|
|
2054
2087
|
.attr('class', lineChartClassNames.lineChartLine)
|
|
2055
|
-
.attr('d', (d) =>
|
|
2088
|
+
.attr('d', (d) => lineOf(d)(d.values))
|
|
2056
2089
|
.attr('style', ({ style }) => style || '');
|
|
2057
2090
|
if (transitionDuration > 0 && prevStrokes.size > 0) {
|
|
2058
2091
|
lineSelection
|
|
@@ -2072,6 +2105,7 @@ const draw$2 = (node, props) => {
|
|
|
2072
2105
|
dots.forEach(item => {
|
|
2073
2106
|
const { values, dot } = item;
|
|
2074
2107
|
const { radius, style, filter } = dot;
|
|
2108
|
+
const scale = scaleOf(item);
|
|
2075
2109
|
const dotsGroup = dotsGlobal
|
|
2076
2110
|
.append('g')
|
|
2077
2111
|
.attr('class', lineChartClassNames.lineChartDotsGlobal);
|
|
@@ -2081,7 +2115,7 @@ const draw$2 = (node, props) => {
|
|
|
2081
2115
|
.join('circle')
|
|
2082
2116
|
.attr('cx', (_, index) => xScale(index))
|
|
2083
2117
|
.attr('class', lineChartClassNames.lineChartDot)
|
|
2084
|
-
.attr('cy', d =>
|
|
2118
|
+
.attr('cy', d => scale(d))
|
|
2085
2119
|
.attr('r', radius || 0)
|
|
2086
2120
|
.attr('style', style || '');
|
|
2087
2121
|
if (filter) {
|
|
@@ -2093,12 +2127,12 @@ const draw$2 = (node, props) => {
|
|
|
2093
2127
|
});
|
|
2094
2128
|
}
|
|
2095
2129
|
const count = data?.[0]?.values?.length || 0;
|
|
2096
|
-
drawMarkers({ svg, markers, width, left, top: height - marginTop, count, yScale });
|
|
2130
|
+
drawMarkers({ svg, markers, width, left, top: height - marginTop, count, yScale: primaryScale });
|
|
2097
2131
|
d3.select(node)
|
|
2098
2132
|
.select(`.${labelClassName}`)
|
|
2099
2133
|
.remove();
|
|
2100
2134
|
withLabels &&
|
|
2101
|
-
drawLabel({ node, eachLabel, data,
|
|
2135
|
+
drawLabel({ node, eachLabel, data, yScaleOf: scaleOf, xScale, formatLabel });
|
|
2102
2136
|
if (dynamicTooltipEnable) {
|
|
2103
2137
|
drawTooltip$2({
|
|
2104
2138
|
tooltipLineTop,
|
|
@@ -2110,14 +2144,15 @@ const draw$2 = (node, props) => {
|
|
|
2110
2144
|
svg,
|
|
2111
2145
|
data,
|
|
2112
2146
|
xScale,
|
|
2113
|
-
yScale,
|
|
2147
|
+
yScale: primaryScale,
|
|
2148
|
+
yScaleOf: scaleOf,
|
|
2114
2149
|
dynamicCircleRadius,
|
|
2115
2150
|
tooltipClassName,
|
|
2116
2151
|
dotSnapping,
|
|
2117
2152
|
lastIndex,
|
|
2118
2153
|
});
|
|
2119
2154
|
}
|
|
2120
|
-
customize && customize({ svg, yScale, xScale });
|
|
2155
|
+
customize && customize({ svg, yScale: primaryScale, yScaleRight, xScale });
|
|
2121
2156
|
}
|
|
2122
2157
|
};
|
|
2123
2158
|
|
|
@@ -2251,66 +2286,66 @@ const barChartClassNames = {
|
|
|
2251
2286
|
...labelClassnames,
|
|
2252
2287
|
...barChartLinesClassNames,
|
|
2253
2288
|
};
|
|
2254
|
-
const SvgWrapper$1 = styled(Wrapper) `
|
|
2255
|
-
display: ${({ selectable }) => selectable && "inline-block"};
|
|
2256
|
-
user-select: ${({ selectable }) => selectable && "none"};
|
|
2257
|
-
width: ${({ selectable }) => selectable && "auto"};
|
|
2258
|
-
|
|
2259
|
-
line {
|
|
2260
|
-
stroke-width: 1px;
|
|
2261
|
-
shape-rendering: crispEdges;
|
|
2262
|
-
}
|
|
2263
|
-
|
|
2264
|
-
.${barChartClassNames.barChartGridLineX},
|
|
2265
|
-
.${barChartClassNames.barChartGridLineY} {
|
|
2266
|
-
stroke: rgba(48, 69, 79, 0.06);
|
|
2267
|
-
}
|
|
2268
|
-
|
|
2269
|
-
.${barChartClassNames.barChartMouseRect} {
|
|
2270
|
-
}
|
|
2271
|
-
|
|
2272
|
-
.${barChartClassNames.barChartMouseRect} {
|
|
2273
|
-
fill: none;
|
|
2274
|
-
pointer-events: all;
|
|
2275
|
-
}
|
|
2276
|
-
|
|
2277
|
-
.${barChartClassNames.barChartLinesGlobal} {
|
|
2278
|
-
stroke-width: 1.5px;
|
|
2279
|
-
stroke-linejoin: round;
|
|
2280
|
-
stroke-linecap: round;
|
|
2281
|
-
}
|
|
2282
|
-
|
|
2283
|
-
.${barChartClassNames.barChartLine} {
|
|
2284
|
-
shape-rendering: auto;
|
|
2285
|
-
}
|
|
2286
|
-
|
|
2287
|
-
.${barChartClassNames.barChartArea} {
|
|
2288
|
-
fill-opacity: 0.24;
|
|
2289
|
-
}
|
|
2290
|
-
|
|
2291
|
-
.${barChartClassNames.barChartSelection} {
|
|
2292
|
-
position: absolute;
|
|
2293
|
-
top: 0;
|
|
2294
|
-
width: 0;
|
|
2295
|
-
background: rgba(0, 170, 255, 0.06);
|
|
2296
|
-
box-shadow: 1px 0 0 #00AAFF, -1px 0 0 #00AAFF;
|
|
2297
|
-
pointer-events: none;
|
|
2298
|
-
}
|
|
2289
|
+
const SvgWrapper$1 = styled(Wrapper) `
|
|
2290
|
+
display: ${({ selectable }) => selectable && "inline-block"};
|
|
2291
|
+
user-select: ${({ selectable }) => selectable && "none"};
|
|
2292
|
+
width: ${({ selectable }) => selectable && "auto"};
|
|
2293
|
+
|
|
2294
|
+
line {
|
|
2295
|
+
stroke-width: 1px;
|
|
2296
|
+
shape-rendering: crispEdges;
|
|
2297
|
+
}
|
|
2298
|
+
|
|
2299
|
+
.${barChartClassNames.barChartGridLineX},
|
|
2300
|
+
.${barChartClassNames.barChartGridLineY} {
|
|
2301
|
+
stroke: rgba(48, 69, 79, 0.06);
|
|
2302
|
+
}
|
|
2303
|
+
|
|
2304
|
+
.${barChartClassNames.barChartMouseRect} {
|
|
2305
|
+
}
|
|
2306
|
+
|
|
2307
|
+
.${barChartClassNames.barChartMouseRect} {
|
|
2308
|
+
fill: none;
|
|
2309
|
+
pointer-events: all;
|
|
2310
|
+
}
|
|
2311
|
+
|
|
2312
|
+
.${barChartClassNames.barChartLinesGlobal} {
|
|
2313
|
+
stroke-width: 1.5px;
|
|
2314
|
+
stroke-linejoin: round;
|
|
2315
|
+
stroke-linecap: round;
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2318
|
+
.${barChartClassNames.barChartLine} {
|
|
2319
|
+
shape-rendering: auto;
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
.${barChartClassNames.barChartArea} {
|
|
2323
|
+
fill-opacity: 0.24;
|
|
2324
|
+
}
|
|
2325
|
+
|
|
2326
|
+
.${barChartClassNames.barChartSelection} {
|
|
2327
|
+
position: absolute;
|
|
2328
|
+
top: 0;
|
|
2329
|
+
width: 0;
|
|
2330
|
+
background: rgba(0, 170, 255, 0.06);
|
|
2331
|
+
box-shadow: 1px 0 0 #00AAFF, -1px 0 0 #00AAFF;
|
|
2332
|
+
pointer-events: none;
|
|
2333
|
+
}
|
|
2299
2334
|
`;
|
|
2300
|
-
const TooltipStyles$1 = createGlobalStyle `
|
|
2301
|
-
.${barChartClassNames.barChartMouseTooltip} {
|
|
2302
|
-
z-index: 100;
|
|
2303
|
-
transition: all linear 144ms;
|
|
2304
|
-
|
|
2305
|
-
.${barChartClassNames.barChartTooltipItem} {
|
|
2306
|
-
padding: 0.125rem;
|
|
2307
|
-
margin-bottom: 4px;
|
|
2308
|
-
|
|
2309
|
-
:last-of-type {
|
|
2310
|
-
margin-bottom: 0;
|
|
2311
|
-
}
|
|
2312
|
-
}
|
|
2313
|
-
}
|
|
2335
|
+
const TooltipStyles$1 = createGlobalStyle `
|
|
2336
|
+
.${barChartClassNames.barChartMouseTooltip} {
|
|
2337
|
+
z-index: 100;
|
|
2338
|
+
transition: all linear 144ms;
|
|
2339
|
+
|
|
2340
|
+
.${barChartClassNames.barChartTooltipItem} {
|
|
2341
|
+
padding: 0.125rem;
|
|
2342
|
+
margin-bottom: 4px;
|
|
2343
|
+
|
|
2344
|
+
:last-of-type {
|
|
2345
|
+
margin-bottom: 0;
|
|
2346
|
+
}
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2314
2349
|
`;
|
|
2315
2350
|
|
|
2316
2351
|
const useSelection = (node, props) => {
|
|
@@ -3150,45 +3185,45 @@ const horizontalBarChartClassNames = {
|
|
|
3150
3185
|
horizontalBarChartTooltipName: "horizontalBarChartTooltipName",
|
|
3151
3186
|
horizontalBarChartTooltipValue: "horizontalBarChartTooltipValue",
|
|
3152
3187
|
};
|
|
3153
|
-
const Table = styled.table `
|
|
3154
|
-
width: 100%;
|
|
3188
|
+
const Table = styled.table `
|
|
3189
|
+
width: 100%;
|
|
3155
3190
|
`;
|
|
3156
|
-
const LabelCell = styled.div `
|
|
3157
|
-
text-align: right;
|
|
3191
|
+
const LabelCell = styled.div `
|
|
3192
|
+
text-align: right;
|
|
3158
3193
|
`;
|
|
3159
|
-
const BarFlex = styled.div `
|
|
3160
|
-
width: 100%;
|
|
3161
|
-
display: flex;
|
|
3162
|
-
height: 1rem;
|
|
3194
|
+
const BarFlex = styled.div `
|
|
3195
|
+
width: 100%;
|
|
3196
|
+
display: flex;
|
|
3197
|
+
height: 1rem;
|
|
3163
3198
|
`;
|
|
3164
|
-
const BarsTd = styled.td `
|
|
3165
|
-
width: 100%;
|
|
3166
|
-
position: relative;
|
|
3167
|
-
vertical-align: middle;
|
|
3199
|
+
const BarsTd = styled.td `
|
|
3200
|
+
width: 100%;
|
|
3201
|
+
position: relative;
|
|
3202
|
+
vertical-align: middle;
|
|
3168
3203
|
`;
|
|
3169
|
-
const TooltipFlex = styled(TooltipFlex$1) `
|
|
3170
|
-
position: absolute;
|
|
3171
|
-
top: 0;
|
|
3172
|
-
left: 50%;
|
|
3173
|
-
transform: translate(-50%, -50%);
|
|
3174
|
-
will-change: left, top;
|
|
3204
|
+
const TooltipFlex = styled(TooltipFlex$1) `
|
|
3205
|
+
position: absolute;
|
|
3206
|
+
top: 0;
|
|
3207
|
+
left: 50%;
|
|
3208
|
+
transform: translate(-50%, -50%);
|
|
3209
|
+
will-change: left, top;
|
|
3175
3210
|
`;
|
|
3176
|
-
const StackSumContainer = styled.div `
|
|
3177
|
-
position: relative;
|
|
3211
|
+
const StackSumContainer = styled.div `
|
|
3212
|
+
position: relative;
|
|
3178
3213
|
`;
|
|
3179
|
-
const StackSum = styled.div `
|
|
3180
|
-
white-space: nowrap;
|
|
3181
|
-
position: absolute;
|
|
3182
|
-
top: 50%;
|
|
3183
|
-
left: 50%;
|
|
3184
|
-
transform: translate(0, -50%);
|
|
3214
|
+
const StackSum = styled.div `
|
|
3215
|
+
white-space: nowrap;
|
|
3216
|
+
position: absolute;
|
|
3217
|
+
top: 50%;
|
|
3218
|
+
left: 50%;
|
|
3219
|
+
transform: translate(0, -50%);
|
|
3185
3220
|
`;
|
|
3186
|
-
const StackWrapper = styled.div `
|
|
3187
|
-
position: absolute;
|
|
3188
|
-
top: 0;
|
|
3189
|
-
display: flex;
|
|
3190
|
-
justify-content: flex-start;
|
|
3191
|
-
height: 100%;
|
|
3221
|
+
const StackWrapper = styled.div `
|
|
3222
|
+
position: absolute;
|
|
3223
|
+
top: 0;
|
|
3224
|
+
display: flex;
|
|
3225
|
+
justify-content: flex-start;
|
|
3226
|
+
height: 100%;
|
|
3192
3227
|
`;
|
|
3193
3228
|
|
|
3194
3229
|
const Tooltip$1 = ({ renderTooltip, bars, style, className, }) => {
|
|
@@ -3240,10 +3275,10 @@ const useStackWrapper = (stackedTooltip) => {
|
|
|
3240
3275
|
: ({ children }) => (jsx(Fragment$1, { children: children })), [stackedTooltip]);
|
|
3241
3276
|
};
|
|
3242
3277
|
|
|
3243
|
-
const BarStyled = styled.div `
|
|
3244
|
-
position: relative;
|
|
3245
|
-
display: inline-flex;
|
|
3246
|
-
height: 100%;
|
|
3278
|
+
const BarStyled = styled.div `
|
|
3279
|
+
position: relative;
|
|
3280
|
+
display: inline-flex;
|
|
3281
|
+
height: 100%;
|
|
3247
3282
|
`;
|
|
3248
3283
|
|
|
3249
3284
|
const Bar = ({ withTooltip, bar, formatNativeTitle, tooltipBind, mouseMove, mouseLeave, pointerEventsNone, isFirstChild, isLastChild, isOnlyChild, }) => {
|
|
@@ -3260,23 +3295,23 @@ const Bar = ({ withTooltip, bar, formatNativeTitle, tooltipBind, mouseMove, mous
|
|
|
3260
3295
|
}, title: formatNativeTitle ? formatNativeTitle(bar) : "", onMouseOver: onMouseMove, onMouseMove: tooltipBind ? onMouseMove : void 0, onMouseOut: onMouseLeave }));
|
|
3261
3296
|
};
|
|
3262
3297
|
|
|
3263
|
-
const TickTd = styled.td `
|
|
3264
|
-
position: relative;
|
|
3298
|
+
const TickTd = styled.td `
|
|
3299
|
+
position: relative;
|
|
3265
3300
|
`;
|
|
3266
|
-
const Ticks = styled.div `
|
|
3267
|
-
position: relative;
|
|
3268
|
-
height: 1rem;
|
|
3301
|
+
const Ticks = styled.div `
|
|
3302
|
+
position: relative;
|
|
3303
|
+
height: 1rem;
|
|
3269
3304
|
`;
|
|
3270
|
-
const Tick = styled.div `
|
|
3271
|
-
white-space: nowrap;
|
|
3272
|
-
width: 0;
|
|
3273
|
-
height: 0;
|
|
3274
|
-
position: absolute;
|
|
3275
|
-
top: 50%;
|
|
3276
|
-
transform: translateY(-50%);
|
|
3277
|
-
display: flex;
|
|
3278
|
-
align-items: center;
|
|
3279
|
-
justify-content: center;
|
|
3305
|
+
const Tick = styled.div `
|
|
3306
|
+
white-space: nowrap;
|
|
3307
|
+
width: 0;
|
|
3308
|
+
height: 0;
|
|
3309
|
+
position: absolute;
|
|
3310
|
+
top: 50%;
|
|
3311
|
+
transform: translateY(-50%);
|
|
3312
|
+
display: flex;
|
|
3313
|
+
align-items: center;
|
|
3314
|
+
justify-content: center;
|
|
3280
3315
|
`;
|
|
3281
3316
|
|
|
3282
3317
|
const hundred = 100;
|
|
@@ -3375,29 +3410,29 @@ const bubbleChartClassNames = {
|
|
|
3375
3410
|
bubbleChartTooltipFlex: "bubbleChartTooltipFlex",
|
|
3376
3411
|
bubbleChartTip: "bubbleChartTip",
|
|
3377
3412
|
};
|
|
3378
|
-
const SvgWrapper = styled(Wrapper) `
|
|
3379
|
-
.${bubbleChartClassNames.bubbleChartYAxis},
|
|
3380
|
-
.${bubbleChartClassNames.bubbleChartXAxis},
|
|
3381
|
-
.${bubbleChartClassNames.bubbleChartGridGlobal} {
|
|
3382
|
-
shape-rendering: crispEdges;
|
|
3383
|
-
}
|
|
3384
|
-
|
|
3385
|
-
.${bubbleChartClassNames.bubbleChartGridLineX},
|
|
3386
|
-
.${bubbleChartClassNames.bubbleChartGridLineY} {
|
|
3387
|
-
stroke: rgba(149, 149, 149, 0.24);
|
|
3388
|
-
}
|
|
3389
|
-
|
|
3390
|
-
.${bubbleChartClassNames.bubbleChartYScaleLabel} {
|
|
3391
|
-
font-size: 10px;
|
|
3392
|
-
}
|
|
3413
|
+
const SvgWrapper = styled(Wrapper) `
|
|
3414
|
+
.${bubbleChartClassNames.bubbleChartYAxis},
|
|
3415
|
+
.${bubbleChartClassNames.bubbleChartXAxis},
|
|
3416
|
+
.${bubbleChartClassNames.bubbleChartGridGlobal} {
|
|
3417
|
+
shape-rendering: crispEdges;
|
|
3418
|
+
}
|
|
3419
|
+
|
|
3420
|
+
.${bubbleChartClassNames.bubbleChartGridLineX},
|
|
3421
|
+
.${bubbleChartClassNames.bubbleChartGridLineY} {
|
|
3422
|
+
stroke: rgba(149, 149, 149, 0.24);
|
|
3423
|
+
}
|
|
3424
|
+
|
|
3425
|
+
.${bubbleChartClassNames.bubbleChartYScaleLabel} {
|
|
3426
|
+
font-size: 10px;
|
|
3427
|
+
}
|
|
3393
3428
|
`;
|
|
3394
|
-
const TooltipStyles = createGlobalStyle `
|
|
3395
|
-
.${bubbleChartClassNames.bubbleChartTooltipContainer} {
|
|
3396
|
-
position: absolute;
|
|
3397
|
-
transition: opacity 150ms cubic-bezier(0.2, 1, 0.6, 1);
|
|
3398
|
-
pointer-events: none;
|
|
3399
|
-
z-index: 1;
|
|
3400
|
-
}
|
|
3429
|
+
const TooltipStyles = createGlobalStyle `
|
|
3430
|
+
.${bubbleChartClassNames.bubbleChartTooltipContainer} {
|
|
3431
|
+
position: absolute;
|
|
3432
|
+
transition: opacity 150ms cubic-bezier(0.2, 1, 0.6, 1);
|
|
3433
|
+
pointer-events: none;
|
|
3434
|
+
z-index: 1;
|
|
3435
|
+
}
|
|
3401
3436
|
`;
|
|
3402
3437
|
|
|
3403
3438
|
const drawGrid = ({ svg, yScale, xScale, yTicksCount, drawGridX, drawGridY, }) => {
|
|
@@ -3434,14 +3469,14 @@ const drawGrid = ({ svg, yScale, xScale, yTicksCount, drawGridX, drawGridY, }) =
|
|
|
3434
3469
|
}
|
|
3435
3470
|
};
|
|
3436
3471
|
|
|
3437
|
-
const Tooltip = styled.div `
|
|
3438
|
-
width: 0;
|
|
3439
|
-
height: 0;
|
|
3440
|
-
display: flex;
|
|
3441
|
-
align-items: flex-end;
|
|
3442
|
-
justify-content: center;
|
|
3443
|
-
font-size: 12px;
|
|
3444
|
-
white-space: nowrap;
|
|
3472
|
+
const Tooltip = styled.div `
|
|
3473
|
+
width: 0;
|
|
3474
|
+
height: 0;
|
|
3475
|
+
display: flex;
|
|
3476
|
+
align-items: flex-end;
|
|
3477
|
+
justify-content: center;
|
|
3478
|
+
font-size: 12px;
|
|
3479
|
+
white-space: nowrap;
|
|
3445
3480
|
`;
|
|
3446
3481
|
|
|
3447
3482
|
const drawTooltip = ({ bubbles, tooltipRoot, tooltipClassName, renderTooltip, }) => {
|