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

Method set_style_on_elements

js/src/Graph.ts:563–578  ·  view source on GitHub ↗
(style, indices)

Source from the content-addressed store, hash-verified

561 }
562
563 set_style_on_elements(style, indices) {
564 // If the index array is undefined or of length=0, exit the
565 // function without doing anything
566 if (!indices || indices.length === 0) {
567 return;
568 }
569 // Also, return if the style object itself is blank
570 if (style !== undefined && Object.keys(style).length === 0) {
571 return;
572 }
573 let nodes = this.d3el.selectAll('.element');
574 nodes = nodes.filter((data, index) => {
575 return indices.indexOf(index) !== -1;
576 });
577 applyStyles(nodes, style);
578 }
579
580 compute_view_padding() {
581 const xPadding = d3.max<number>(

Callers 1

apply_stylesMethod · 0.95

Calls 1

applyStylesFunction · 0.90

Tested by

no test coverage detected