| 578 | } |
| 579 | |
| 580 | compute_view_padding() { |
| 581 | const xPadding = d3.max<number>( |
| 582 | this.model.mark_data.map((d) => { |
| 583 | return ( |
| 584 | (d.shape_attrs.r || d.shape_attrs.width / 2 || d.shape_attrs.rx) + 1.0 |
| 585 | ); |
| 586 | }) |
| 587 | ); |
| 588 | |
| 589 | const yPadding = d3.max<number>( |
| 590 | this.model.mark_data.map((d) => { |
| 591 | return ( |
| 592 | (d.shape_attrs.r || d.shape_attrs.height / 2 || d.shape_attrs.ry) + |
| 593 | 1.0 |
| 594 | ); |
| 595 | }) |
| 596 | ); |
| 597 | |
| 598 | if (xPadding !== this.xPadding || yPadding !== this.yPadding) { |
| 599 | this.xPadding = xPadding; |
| 600 | this.yPadding = xPadding; |
| 601 | this.trigger('mark_padding_updated'); |
| 602 | } |
| 603 | } |
| 604 | |
| 605 | private updateLinkDistance() { |
| 606 | const x_scale = this.scales.x, |