()
| 22 | |
| 23 | class ColorBar extends Axis { |
| 24 | async render() { |
| 25 | this.parent = this.options.parent; |
| 26 | this.vertical = ['left', 'right'].includes(this.model.get('side')); |
| 27 | |
| 28 | const scale_promise = this.set_scale(this.model.get('scale')); |
| 29 | this.side = this.model.get('side'); |
| 30 | this.x_offset = 100; |
| 31 | this.y_offset = 40; |
| 32 | this.bar_height = 20; |
| 33 | this.d3el |
| 34 | .attr('class', 'ColorBar') |
| 35 | .attr('display', this.model.get('visible') ? 'inline' : 'none') |
| 36 | .attr('transform', this.get_topg_transform()); |
| 37 | |
| 38 | this.ordinal = false; |
| 39 | this.num_ticks = this.model.get('num_ticks'); |
| 40 | |
| 41 | await scale_promise; |
| 42 | |
| 43 | this.create_listeners(); |
| 44 | this.create_axis(); |
| 45 | this.set_tick_values(); |
| 46 | this.tick_format = this.generate_tick_formatter(); |
| 47 | this.set_scales_range(); |
| 48 | this.append_axis(); |
| 49 | } |
| 50 | |
| 51 | create_listeners() { |
| 52 | this.listenTo(this.model, 'change:scale', function (model, value) { |
nothing calls this directly
no test coverage detected