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

Method clear_style

js/src/Pie.ts:487–502  ·  view source on GitHub ↗
(style_dict, indices?)

Source from the content-addressed store, hash-verified

485 }
486
487 clear_style(style_dict, indices?) {
488 // Function to clear the style of a dict on some or all the elements of the
489 // chart. If indices is null, clears the style on all elements. If
490 // not, clears on only the elements whose indices are matching.
491 let elements = this.pieSelection.selectAll('.slice');
492 if (indices) {
493 elements = elements.filter((d, index) => {
494 return indices.indexOf(index) !== -1;
495 });
496 }
497 const clearing_style = {};
498 for (const key in style_dict) {
499 clearing_style[key] = null;
500 }
501 applyStyles(elements, clearing_style);
502 }
503
504 set_style_on_elements(style, indices?) {
505 // If the index array is undefined or of length=0, exit the

Callers 1

reset_selectionMethod · 0.95

Calls 1

applyStylesFunction · 0.90

Tested by

no test coverage detected