MCPcopy Create free account
hub / github.com/bqplot/bqplot / compute_view_padding

Method compute_view_padding

js/src/Lines.ts:752–770  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

750 }
751
752 compute_view_padding(): void {
753 //This function sets the padding for the view through the variables
754 //xPadding and yPadding which are view specific paddings in pixel
755 let xPadding;
756 if (this.model.get('marker')) {
757 const markerPadding = Math.sqrt(this.model.get('marker_size')) / 2 + 1.0;
758 const linePadding = this.model.get('stroke_width') / 2.0;
759 xPadding = Math.max(markerPadding, linePadding);
760 } else {
761 xPadding = this.model.get('stroke_width') / 2.0;
762 }
763
764 const yPadding = xPadding;
765 if (xPadding !== this.xPadding || yPadding !== this.yPadding) {
766 this.xPadding = xPadding;
767 this.yPadding = yPadding;
768 this.trigger('mark_padding_updated');
769 }
770 }
771
772 update_marker_style() {
773 const that = this;

Callers 3

renderMethod · 0.95
update_stroke_widthMethod · 0.95
update_marker_sizeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected