MCPcopy Index your code
hub / github.com/bqplot/bqplot / getBBox

Method getBBox

js/src/Axis.ts:1030–1052  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1028 }
1029
1030 getBBox(): DOMRect {
1031 // To get the bounding box, we don't want to include the gridlines, so we disable them
1032 this.axis.tickSize(6); // Default value is 6
1033 this.g_axisline.call(this.axis);
1034 // we also don't use the label if the label_offset is negative
1035 const negativeLabelOffset =
1036 this.model.get('label_offset') && this.model.get('label_offset').length
1037 ? this.model.get('label_offset')[0] == '-'
1038 : false;
1039 if (negativeLabelOffset) {
1040 this.g_axisline.select('text.axislabel').style('display', 'none');
1041 }
1042 // note that we use getBoundingClientRect to take into account transformations (such as rotations)
1043 const box = this.d3el.node().getBoundingClientRect();
1044 // and restore the gridlines
1045 this.update_grid_lines();
1046 this.g_axisline.call(this.axis);
1047 // and restore label
1048 if (negativeLabelOffset) {
1049 this.g_axisline.select('text.axislabel').style('display', '');
1050 }
1051 return box;
1052 }
1053
1054 setAutoOffset(autoOffset) {
1055 this.autoOffset = autoOffset;

Callers 4

calculateAutoSizeMethod · 0.95
drawMethod · 0.80
updateDecoratorsMethod · 0.80
figure.tsFile · 0.80

Calls 1

update_grid_linesMethod · 0.95

Tested by

no test coverage detected