()
| 750 | } |
| 751 | |
| 752 | private _paint() { |
| 753 | delete this._cachedAttrToProjector; |
| 754 | |
| 755 | const drawSteps = this._generateDrawSteps(); |
| 756 | const dataToDraw = this._getDataToDraw(); |
| 757 | const drawers = this.datasets().map((dataset) => this._datasetToDrawer.get(dataset)); |
| 758 | |
| 759 | if (this.renderer() === "canvas") { |
| 760 | const canvas = this._canvas.node(); |
| 761 | const context = canvas.getContext("2d"); |
| 762 | context.clearRect(0, 0, canvas.clientWidth, canvas.clientHeight); |
| 763 | this._bufferCanvasValid = false; |
| 764 | } |
| 765 | |
| 766 | this.datasets().forEach((ds, i) => { |
| 767 | const appliedDrawSteps = Plot.applyDrawSteps(drawSteps, ds); |
| 768 | drawers[i].draw(dataToDraw.get(ds), appliedDrawSteps); |
| 769 | }); |
| 770 | |
| 771 | const times = this.datasets().map((ds, i) => Plot.getTotalDrawTime(dataToDraw.get(ds), drawSteps)); |
| 772 | const maxTime = Utils.Math.max(times, 0); |
| 773 | this._additionalPaint(maxTime); |
| 774 | } |
| 775 | |
| 776 | /** |
| 777 | * Retrieves the drawn visual elements for the specified Datasets as a d3 Selection. |
no test coverage detected