| 112 | } |
| 113 | |
| 114 | private updateColors() { |
| 115 | this.d3el |
| 116 | .selectAll('.bargroup') |
| 117 | .selectAll('rect') |
| 118 | .style('fill', (d: BinData) => { |
| 119 | return this.get_colors(d.index); |
| 120 | }); |
| 121 | if (this.model.get('labels')) { |
| 122 | this.d3el |
| 123 | .selectAll('.bargroup') |
| 124 | .selectAll('text') |
| 125 | .style('fill', (d: BinData) => { |
| 126 | return this.get_colors(d.index); |
| 127 | }); |
| 128 | } |
| 129 | if (this.legend_el) { |
| 130 | this.legend_el.selectAll('rect').style('fill', (d: BinData) => { |
| 131 | return this.get_colors(d.index); |
| 132 | }); |
| 133 | this.legend_el.selectAll('text').style('fill', (d: BinData) => { |
| 134 | return this.get_colors(d.index); |
| 135 | }); |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | private updateStrokeAndOpacities() { |
| 140 | const stroke = this.model.get('stroke'); |