()
| 214 | } |
| 215 | |
| 216 | update_style(): void { |
| 217 | const fill = this.model.get('fill'), |
| 218 | fillColor = this.model.get('fill_colors'), |
| 219 | fillOpacities = this.model.get('fill_opacities'); |
| 220 | // update curve colors |
| 221 | const curves = this.d3el.selectAll('.curve'); |
| 222 | curves |
| 223 | .select('.line') |
| 224 | .style('opacity', this.get_mark_opacity.bind(this)) |
| 225 | .style('stroke', (d, i) => { |
| 226 | return this.get_mark_color(d, i) || fillColor[i]; |
| 227 | }) |
| 228 | .style('fill', (d, i) => { |
| 229 | return fill === 'inside' ? this.get_fill_color(d, i) : ''; |
| 230 | }) |
| 231 | .style('fill-opacity', (d, i) => { |
| 232 | return fill === 'inside' ? fillOpacities[i] : ''; |
| 233 | }); |
| 234 | curves |
| 235 | .select('.area') |
| 236 | .style('fill', (d, i) => { |
| 237 | return this.get_fill_color(d, i); |
| 238 | }) |
| 239 | .style('opacity', (d, i) => { |
| 240 | return fillOpacities[i]; |
| 241 | }); |
| 242 | this.update_marker_style(); |
| 243 | // update legend style |
| 244 | if (this.legendEl) { |
| 245 | this.legendEl |
| 246 | .select('.line') |
| 247 | .style('stroke', (d, i) => { |
| 248 | return this.get_mark_color(d, i) || fillColor[i]; |
| 249 | }) |
| 250 | .style('opacity', this.get_mark_opacity.bind(this)) |
| 251 | .style('fill', (d, i) => { |
| 252 | return this.model.get('fill') === 'none' |
| 253 | ? '' |
| 254 | : this.get_fill_color(d, i); |
| 255 | }); |
| 256 | this.legendEl |
| 257 | .select('.dot') |
| 258 | .style('stroke', (d, i) => { |
| 259 | return this.get_mark_color(d, i) || fillColor[i]; |
| 260 | }) |
| 261 | .style('opacity', this.get_mark_opacity.bind(this)) |
| 262 | .style('fill', (d, i) => { |
| 263 | return this.get_mark_color(d, i) || fillColor[i]; |
| 264 | }); |
| 265 | this.legendEl |
| 266 | .select('text') |
| 267 | .style('fill', (d, i) => { |
| 268 | return this.get_mark_color(d, i) || fillColor[i]; |
| 269 | }) |
| 270 | .style('opacity', this.get_mark_opacity.bind(this)); |
| 271 | } |
| 272 | this.update_stroke_width(this.model, this.model.get('stroke_width')); |
| 273 | this.update_line_style(); |
no test coverage detected