@evergis/charts 2.0.91 → 2.0.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/charts/BubbleChart/types.d.ts +1 -2
- package/dist/charts.cjs.development.js +35 -27
- package/dist/charts.cjs.development.js.map +1 -1
- package/dist/charts.cjs.production.min.js +1 -1
- package/dist/charts.cjs.production.min.js.map +1 -1
- package/dist/charts.esm.js +35 -27
- package/dist/charts.esm.js.map +1 -1
- package/package.json +2 -2
|
@@ -42,11 +42,10 @@ export declare type BubbleChartProps = {
|
|
|
42
42
|
maxYValue?: number;
|
|
43
43
|
drawGridY?: boolean;
|
|
44
44
|
drawGridX?: boolean;
|
|
45
|
-
|
|
45
|
+
scaleLog?: boolean;
|
|
46
46
|
xScaleItemWidth?: number;
|
|
47
47
|
bubbleStyle?: string;
|
|
48
48
|
customize?: (props: BubbleChartCustomizeProps) => void;
|
|
49
|
-
yScaleLog?: boolean;
|
|
50
49
|
yScaleLabel?: string;
|
|
51
50
|
yScaleLabelPadding?: number;
|
|
52
51
|
enableTooltip?: boolean;
|
|
@@ -3395,11 +3395,10 @@ const draw$5 = (node, props) => {
|
|
|
3395
3395
|
maxYValue,
|
|
3396
3396
|
drawGridY,
|
|
3397
3397
|
drawGridX,
|
|
3398
|
-
|
|
3398
|
+
scaleLog,
|
|
3399
3399
|
xScaleItemWidth,
|
|
3400
3400
|
bubbleStyle,
|
|
3401
3401
|
customize,
|
|
3402
|
-
yScaleLog,
|
|
3403
3402
|
yScaleLabel,
|
|
3404
3403
|
yScaleLabelPadding,
|
|
3405
3404
|
enableTooltip,
|
|
@@ -3432,19 +3431,29 @@ const draw$5 = (node, props) => {
|
|
|
3432
3431
|
return yValue;
|
|
3433
3432
|
});
|
|
3434
3433
|
const svg = appendSvg(node, width, height || 0);
|
|
3435
|
-
const sizeScale = d3.
|
|
3434
|
+
const sizeScale = scaleLog ? d3.scaleLog().domain([d3.min(data, _ref3 => {
|
|
3436
3435
|
let {
|
|
3437
3436
|
sizeValue
|
|
3438
3437
|
} = _ref3;
|
|
3439
3438
|
return sizeValue;
|
|
3440
|
-
}), d3.max(data, _ref4 => {
|
|
3439
|
+
}) || 0.1, d3.max(data, _ref4 => {
|
|
3441
3440
|
let {
|
|
3442
3441
|
sizeValue
|
|
3443
3442
|
} = _ref4;
|
|
3444
3443
|
return sizeValue;
|
|
3444
|
+
}) || 0.1]).range([minSize || bubbleChartDefaultProps.minSize || 0.1, maxSize || bubbleChartDefaultProps.maxSize || 0.1]) : d3.scaleLinear().domain([d3.min(data, _ref5 => {
|
|
3445
|
+
let {
|
|
3446
|
+
sizeValue
|
|
3447
|
+
} = _ref5;
|
|
3448
|
+
return sizeValue;
|
|
3449
|
+
}), d3.max(data, _ref6 => {
|
|
3450
|
+
let {
|
|
3451
|
+
sizeValue
|
|
3452
|
+
} = _ref6;
|
|
3453
|
+
return sizeValue;
|
|
3445
3454
|
})]).range([minSize || bubbleChartDefaultProps.minSize, maxSize || bubbleChartDefaultProps.maxSize]);
|
|
3446
3455
|
const yRange1 = height - marginTop - marginBottom - (xAxisPadding || 0);
|
|
3447
|
-
const yScale =
|
|
3456
|
+
const yScale = scaleLog ? d3.scaleLog().domain([minY || 0.1, maxY || 0.1]).range([yRange1 || 0.1, marginTop || 0.1]).nice() : d3.scaleLinear().domain([minY, maxY]).range([yRange1, marginTop]).nice();
|
|
3448
3457
|
customYScale && customYScale(yScale);
|
|
3449
3458
|
const yTicks = yScale.ticks();
|
|
3450
3459
|
const yAxisLeft = d3.axisLeft(yScale).ticks(yTicksCountDefault);
|
|
@@ -3469,28 +3478,27 @@ const draw$5 = (node, props) => {
|
|
|
3469
3478
|
const {
|
|
3470
3479
|
width: yAxisWidth
|
|
3471
3480
|
} = computeDimensions(yAxis);
|
|
3472
|
-
const
|
|
3473
|
-
const xScale = xScaleLog ? d3.scaleLog().domain([d3.min(data, _ref5 => {
|
|
3481
|
+
const xScale = scaleLog ? d3.scaleLog().domain([d3.min(data, _ref7 => {
|
|
3474
3482
|
let {
|
|
3475
3483
|
xValue
|
|
3476
|
-
} =
|
|
3484
|
+
} = _ref7;
|
|
3477
3485
|
return xValue;
|
|
3478
|
-
}), d3.max(data,
|
|
3486
|
+
}) || 0.1, d3.max(data, _ref8 => {
|
|
3479
3487
|
let {
|
|
3480
3488
|
xValue
|
|
3481
|
-
} =
|
|
3489
|
+
} = _ref8;
|
|
3482
3490
|
return xValue;
|
|
3483
|
-
})]).range(
|
|
3491
|
+
}) || 0.1]).range([marginLeft + yAxisWidth + (yAxisPadding || 0) + yScaleLabelHeight || 0.1, width - marginRight || 0.1]) : d3.scaleLinear().domain([d3.min(data, _ref9 => {
|
|
3484
3492
|
let {
|
|
3485
3493
|
xValue
|
|
3486
|
-
} =
|
|
3494
|
+
} = _ref9;
|
|
3487
3495
|
return xValue;
|
|
3488
|
-
}), d3.max(data,
|
|
3496
|
+
}), d3.max(data, _ref10 => {
|
|
3489
3497
|
let {
|
|
3490
3498
|
xValue
|
|
3491
|
-
} =
|
|
3499
|
+
} = _ref10;
|
|
3492
3500
|
return xValue;
|
|
3493
|
-
})]).range(
|
|
3501
|
+
})]).range([marginLeft + yAxisWidth + (yAxisPadding || 0) + yScaleLabelHeight, width - marginRight]);
|
|
3494
3502
|
customXScale && customXScale(xScale);
|
|
3495
3503
|
const xAxisBottom = d3.axisBottom(xScale);
|
|
3496
3504
|
|
|
@@ -3512,35 +3520,35 @@ const draw$5 = (node, props) => {
|
|
|
3512
3520
|
drawGridX
|
|
3513
3521
|
});
|
|
3514
3522
|
xAxis.attr('transform', "translate(0, " + (yScale(yTicks[0]) + (xAxisPadding || 0)) + ")");
|
|
3515
|
-
const bubbles = svg.append('g').selectAll('dot').data(data).enter().append('circle').attr('class', bubbleChartClassNames.bubbleChartCircle).attr('cx',
|
|
3523
|
+
const bubbles = svg.append('g').selectAll('dot').data(data).enter().append('circle').attr('class', bubbleChartClassNames.bubbleChartCircle).attr('cx', _ref11 => {
|
|
3516
3524
|
let {
|
|
3517
3525
|
xValue
|
|
3518
|
-
} =
|
|
3526
|
+
} = _ref11;
|
|
3519
3527
|
return xScale(xValue);
|
|
3520
|
-
}).attr('cy',
|
|
3528
|
+
}).attr('cy', _ref12 => {
|
|
3521
3529
|
let {
|
|
3522
3530
|
yValue
|
|
3523
|
-
} =
|
|
3531
|
+
} = _ref12;
|
|
3524
3532
|
return yScale(yValue);
|
|
3525
|
-
}).attr('r',
|
|
3533
|
+
}).attr('r', _ref13 => {
|
|
3526
3534
|
let {
|
|
3527
3535
|
sizeValue
|
|
3528
|
-
} =
|
|
3536
|
+
} = _ref13;
|
|
3529
3537
|
return sizeScale(sizeValue) / 2;
|
|
3530
|
-
}).attr('fill',
|
|
3538
|
+
}).attr('fill', _ref14 => {
|
|
3531
3539
|
let {
|
|
3532
3540
|
color
|
|
3533
|
-
} =
|
|
3541
|
+
} = _ref14;
|
|
3534
3542
|
return color || 'rgba(0, 176, 113, 0.6)';
|
|
3535
|
-
}).attr('stroke',
|
|
3543
|
+
}).attr('stroke', _ref15 => {
|
|
3536
3544
|
let {
|
|
3537
3545
|
stroke
|
|
3538
|
-
} =
|
|
3546
|
+
} = _ref15;
|
|
3539
3547
|
return stroke || 'transparent';
|
|
3540
|
-
}).attr('style',
|
|
3548
|
+
}).attr('style', _ref16 => {
|
|
3541
3549
|
let {
|
|
3542
3550
|
style
|
|
3543
|
-
} =
|
|
3551
|
+
} = _ref16;
|
|
3544
3552
|
return style || bubbleStyle || '';
|
|
3545
3553
|
});
|
|
3546
3554
|
|