()
| 496 | } |
| 497 | |
| 498 | update_fill(): void { |
| 499 | const fill = this.model.get('fill'), |
| 500 | area = fill === 'top' || fill === 'bottom' || fill === 'between'; |
| 501 | |
| 502 | const yScale = this.scales.y; |
| 503 | |
| 504 | this.area.defined((d: any) => { |
| 505 | return area && d.y !== null && isFinite(yScale.scale(d.y)); |
| 506 | }); |
| 507 | |
| 508 | if (fill == 'bottom') { |
| 509 | this.area.y0(this.parent.plotareaHeight); |
| 510 | } else if (fill == 'top') { |
| 511 | this.area.y0(0); |
| 512 | } else if (fill == 'between') { |
| 513 | this.area.y0((d: any) => { |
| 514 | return yScale.scale(d.y0) + yScale.offset; |
| 515 | }); |
| 516 | } |
| 517 | this.d3el |
| 518 | .selectAll('.curve') |
| 519 | .select('.area') |
| 520 | .attr('d', (d: any) => { |
| 521 | return this.area(d.values); |
| 522 | }); |
| 523 | this.d3el |
| 524 | .selectAll('.curve') |
| 525 | .select('.line') |
| 526 | .style('fill', (d, i) => { |
| 527 | return fill === 'inside' ? this.get_fill_color(d, i) : ''; |
| 528 | }); |
| 529 | // update legend fill |
| 530 | if (this.legendEl) { |
| 531 | this.legendEl.select('path').style('fill', (d, i) => { |
| 532 | return fill === 'none' ? '' : this.get_fill_color(d, i); |
| 533 | }); |
| 534 | } |
| 535 | } |
| 536 | |
| 537 | get_fill_color(data, index): string { |
| 538 | const fillColors: string = this.model.get('fill_colors'); |
nothing calls this directly
no test coverage detected