(model, new_colors)
| 48 | } |
| 49 | |
| 50 | update_colors(model, new_colors) { |
| 51 | if (!this.model.dirty) { |
| 52 | const stroke = this.model.get('stroke'); |
| 53 | const len = new_colors.length; |
| 54 | this.d3el |
| 55 | .selectAll('.dot') |
| 56 | .style( |
| 57 | 'fill', |
| 58 | this.model.get('fill') ? this.get_mark_color.bind(this) : 'none' |
| 59 | ) |
| 60 | .style('stroke', stroke ? stroke : this.get_mark_color.bind(this)); |
| 61 | |
| 62 | if (this.legend_el) { |
| 63 | this.legend_el |
| 64 | .select('path') |
| 65 | .style('fill', (d, i) => { |
| 66 | return new_colors[i % len]; |
| 67 | }) |
| 68 | .style( |
| 69 | 'stroke', |
| 70 | stroke |
| 71 | ? stroke |
| 72 | : (d, i) => { |
| 73 | return new_colors[i % len]; |
| 74 | } |
| 75 | ); |
| 76 | this.legend_el.select('text').style( |
| 77 | 'fill', |
| 78 | this.model.get('fill') |
| 79 | ? (d, i) => { |
| 80 | return new_colors[i % len]; |
| 81 | } |
| 82 | : 'none' |
| 83 | ); |
| 84 | } |
| 85 | } |
| 86 | this.apply_styles(); |
| 87 | } |
| 88 | |
| 89 | update_fill(model, fill) { |
| 90 | const colors = this.model.get('colors'); |
nothing calls this directly
no test coverage detected