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

Method change_selected

js/src/Map.ts:331–378  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

329 }
330
331 change_selected() {
332 this.highlight_g.selectAll('path').remove();
333 const idx = this.model.get('selected');
334 const select = idx ? idx : [];
335 const temp = this.stroke_g.selectAll('path').data();
336 this.stroke_g.selectAll('path').style('stroke', (d, i) => {
337 return this.hoverfill(d, i);
338 });
339 const nodes = this.stroke_g.selectAll('path');
340 for (let i = 0; i < temp.length; i++) {
341 if (select.indexOf((temp[i] as any).id) > -1) {
342 this.highlight_g
343 .append(() => {
344 return (nodes.nodes()[i] as any).cloneNode(true);
345 })
346 .attr('id', (temp[i] as any).id)
347 .style('fill-opacity', () => {
348 if (
349 this.validate_color(
350 this.model.get('selected_styles').selected_fill
351 )
352 ) {
353 return 1.0;
354 } else {
355 return 0.0;
356 }
357 })
358 .style('fill', this.model.get('selected_styles').selected_fill)
359 .style('stroke-opacity', () => {
360 if (
361 this.validate_color(
362 this.model.get('selected_styles').selected_stroke
363 )
364 ) {
365 return 1.0;
366 } else {
367 return 0.0;
368 }
369 })
370 .style('stroke', this.model.get('selected_styles').selected_stroke)
371 .style(
372 'stroke-width',
373 this.model.get('selected_styles').selected_stroke_width
374 )
375 .classed('selected', true);
376 }
377 }
378 }
379
380 reset_selection() {
381 this.model.set('selected', []);

Callers

nothing calls this directly

Calls 3

hoverfillMethod · 0.95
validate_colorMethod · 0.95
removeMethod · 0.45

Tested by

no test coverage detected