MCPcopy
hub / github.com/palantir/plottable / _paint

Method _paint

src/plots/plot.ts:752–774  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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.

Callers 1

renderImmediatelyMethod · 0.95

Calls 10

_generateDrawStepsMethod · 0.95
_getDataToDrawMethod · 0.95
datasetsMethod · 0.95
rendererMethod · 0.95
_additionalPaintMethod · 0.95
applyDrawStepsMethod · 0.80
getTotalDrawTimeMethod · 0.80
drawMethod · 0.65
getMethod · 0.45
forEachMethod · 0.45

Tested by

no test coverage detected