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

Method render

js/src/ColorAxis.ts:24–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22
23class 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) {

Callers

nothing calls this directly

Calls 8

set_scaleMethod · 0.95
get_topg_transformMethod · 0.95
create_listenersMethod · 0.95
create_axisMethod · 0.95
set_scales_rangeMethod · 0.95
append_axisMethod · 0.95
set_tick_valuesMethod · 0.80

Tested by

no test coverage detected