()
| 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; |
no test coverage detected