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

Method update_curves_subset

js/src/Lines.ts:461–496  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

459 }
460
461 update_curves_subset(): void {
462 const displayLabels = this.model.get('labels_visibility') === 'label';
463 // Show a subset of the curves
464 const curvesSubset = this.model.get('curves_subset');
465 if (curvesSubset.length > 0) {
466 this.d3el
467 .selectAll('.curve')
468 .attr('display', (d, i) => {
469 return curvesSubset.indexOf(i) !== -1 ? 'inline' : 'none';
470 })
471 .select('.curve_label')
472 .attr('display', (d, i) => {
473 return curvesSubset.indexOf(i) !== -1 && displayLabels
474 ? 'inline'
475 : 'none';
476 });
477 if (this.legendEl) {
478 this.legendEl.attr('display', (d, i) => {
479 return curvesSubset.indexOf(i) !== -1 ? 'inline' : 'none';
480 });
481 }
482 this.d3el.selectAll('.curve');
483 } else {
484 //make all curves visible
485 this.d3el
486 .selectAll('.curve')
487 .attr('display', 'inline')
488 .select('.curve_label')
489 .attr('display', (d) => {
490 return displayLabels ? 'inline' : 'none';
491 });
492 if (this.legendEl) {
493 this.legendEl.attr('display', 'inline');
494 }
495 }
496 }
497
498 update_fill(): void {
499 const fill = this.model.get('fill'),

Callers 1

drawMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected