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

Method update_scale_domain

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

Source from the content-addressed store, hash-verified

246 }
247
248 update_scale_domain() {
249 // Sets the scale domain (Range of input values)
250
251 const is_vertical = ['left', 'right'].includes(this.model.get('side'));
252
253 const initial_range = is_vertical
254 ? this.parent.padded_range('y', this.axis_scale.model)
255 : this.parent.padded_range('x', this.axis_scale.model);
256
257 const target_range = is_vertical
258 ? this.parent.range('y')
259 : this.parent.range('x');
260
261 this.axis_scale.expandDomain(initial_range, target_range);
262 this.axis.scale(this.axis_scale.scale as d3.AxisScale<d3.AxisDomain>);
263 }
264
265 update_offset_scale_domain() {
266 // Sets the domain (range of input values) of the offset scale

Callers 2

update_scalesMethod · 0.95
create_scalesFunction · 0.45

Calls 2

padded_rangeMethod · 0.80
rangeMethod · 0.80

Tested by

no test coverage detected