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

Function apply_styles

js/src/Mark.ts:288–307  ·  view source on GitHub ↗
(style_arr?)

Source from the content-addressed store, hash-verified

286 }
287
288 apply_styles(style_arr?) {
289 if (style_arr === undefined || style_arr == null) {
290 style_arr = [this.selected_style, this.unselected_style];
291 }
292 const all_indices = _.range(this.model.mark_data.length);
293 for (let i = 0; i < style_arr.length; i++) {
294 this.clear_style(style_arr[i]);
295 }
296
297 this.set_default_style(all_indices);
298
299 this.set_style_on_elements(
300 this.selected_style,
301 Array.from(this.selected_indices || [])
302 );
303 const unselected_indices = !this.selected_indices
304 ? []
305 : _.difference(all_indices, Array.from(this.selected_indices));
306 this.set_style_on_elements(this.unselected_style, unselected_indices);
307 }
308
309 // Abstract functions which have to be overridden by the specific mark
310 abstract clear_style(style_dict, indices?, elements?);

Callers

nothing calls this directly

Calls 4

rangeMethod · 0.80
clear_styleMethod · 0.45
set_default_styleMethod · 0.45
set_style_on_elementsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…