@evergis/charts 2.0.87 → 2.0.91

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.
@@ -42,9 +42,11 @@ export declare type BubbleChartProps = {
42
42
  maxYValue?: number;
43
43
  drawGridY?: boolean;
44
44
  drawGridX?: boolean;
45
+ xScaleLog?: boolean;
45
46
  xScaleItemWidth?: number;
46
47
  bubbleStyle?: string;
47
48
  customize?: (props: BubbleChartCustomizeProps) => void;
49
+ yScaleLog?: boolean;
48
50
  yScaleLabel?: string;
49
51
  yScaleLabelPadding?: number;
50
52
  enableTooltip?: boolean;
@@ -3395,9 +3395,11 @@ const draw$5 = (node, props) => {
3395
3395
  maxYValue,
3396
3396
  drawGridY,
3397
3397
  drawGridX,
3398
+ xScaleLog,
3398
3399
  xScaleItemWidth,
3399
3400
  bubbleStyle,
3400
3401
  customize,
3402
+ yScaleLog,
3401
3403
  yScaleLabel,
3402
3404
  yScaleLabelPadding,
3403
3405
  enableTooltip,
@@ -3442,7 +3444,7 @@ const draw$5 = (node, props) => {
3442
3444
  return sizeValue;
3443
3445
  })]).range([minSize || bubbleChartDefaultProps.minSize, maxSize || bubbleChartDefaultProps.maxSize]);
3444
3446
  const yRange1 = height - marginTop - marginBottom - (xAxisPadding || 0);
3445
- const yScale = d3.scaleLinear().domain([minY, maxY]).range([yRange1, marginTop]).nice();
3447
+ const yScale = yScaleLog ? d3.scaleLog().domain([minY, maxY]).range([yRange1, marginTop]).nice() : d3.scaleLinear().domain([minY, maxY]).range([yRange1, marginTop]).nice();
3446
3448
  customYScale && customYScale(yScale);
3447
3449
  const yTicks = yScale.ticks();
3448
3450
  const yAxisLeft = d3.axisLeft(yScale).ticks(yTicksCountDefault);
@@ -3468,7 +3470,7 @@ const draw$5 = (node, props) => {
3468
3470
  width: yAxisWidth
3469
3471
  } = computeDimensions(yAxis);
3470
3472
  const range = [marginLeft + yAxisWidth + (yAxisPadding || 0) + yScaleLabelHeight, width - marginRight];
3471
- const xScale = d3.scaleLinear().domain([d3.min(data, _ref5 => {
3473
+ const xScale = xScaleLog ? d3.scaleLog().domain([d3.min(data, _ref5 => {
3472
3474
  let {
3473
3475
  xValue
3474
3476
  } = _ref5;
@@ -3478,6 +3480,16 @@ const draw$5 = (node, props) => {
3478
3480
  xValue
3479
3481
  } = _ref6;
3480
3482
  return xValue;
3483
+ })]).range(range) : d3.scaleLinear().domain([d3.min(data, _ref7 => {
3484
+ let {
3485
+ xValue
3486
+ } = _ref7;
3487
+ return xValue;
3488
+ }), d3.max(data, _ref8 => {
3489
+ let {
3490
+ xValue
3491
+ } = _ref8;
3492
+ return xValue;
3481
3493
  })]).range(range);
3482
3494
  customXScale && customXScale(xScale);
3483
3495
  const xAxisBottom = d3.axisBottom(xScale);
@@ -3500,35 +3512,35 @@ const draw$5 = (node, props) => {
3500
3512
  drawGridX
3501
3513
  });
3502
3514
  xAxis.attr('transform', "translate(0, " + (yScale(yTicks[0]) + (xAxisPadding || 0)) + ")");
3503
- const bubbles = svg.append('g').selectAll('dot').data(data).enter().append('circle').attr('class', bubbleChartClassNames.bubbleChartCircle).attr('cx', _ref7 => {
3515
+ const bubbles = svg.append('g').selectAll('dot').data(data).enter().append('circle').attr('class', bubbleChartClassNames.bubbleChartCircle).attr('cx', _ref9 => {
3504
3516
  let {
3505
3517
  xValue
3506
- } = _ref7;
3518
+ } = _ref9;
3507
3519
  return xScale(xValue);
3508
- }).attr('cy', _ref8 => {
3520
+ }).attr('cy', _ref10 => {
3509
3521
  let {
3510
3522
  yValue
3511
- } = _ref8;
3523
+ } = _ref10;
3512
3524
  return yScale(yValue);
3513
- }).attr('r', _ref9 => {
3525
+ }).attr('r', _ref11 => {
3514
3526
  let {
3515
3527
  sizeValue
3516
- } = _ref9;
3528
+ } = _ref11;
3517
3529
  return sizeScale(sizeValue) / 2;
3518
- }).attr('fill', _ref10 => {
3530
+ }).attr('fill', _ref12 => {
3519
3531
  let {
3520
3532
  color
3521
- } = _ref10;
3533
+ } = _ref12;
3522
3534
  return color || 'rgba(0, 176, 113, 0.6)';
3523
- }).attr('stroke', _ref11 => {
3535
+ }).attr('stroke', _ref13 => {
3524
3536
  let {
3525
3537
  stroke
3526
- } = _ref11;
3538
+ } = _ref13;
3527
3539
  return stroke || 'transparent';
3528
- }).attr('style', _ref12 => {
3540
+ }).attr('style', _ref14 => {
3529
3541
  let {
3530
3542
  style
3531
- } = _ref12;
3543
+ } = _ref14;
3532
3544
  return style || bubbleStyle || '';
3533
3545
  });
3534
3546