MCPcopy Create free account
hub / github.com/REditorSupport/vscode-R / getPlotContent

Method getPlotContent

src/plotViewer/index.ts:647–671  ·  view source on GitHub ↗
(id: HttpgdPlotId, width: number, height: number, zoom: number)

Source from the content-addressed store, hash-verified

645
646 // get content of a single plot
647 protected async getPlotContent(id: HttpgdPlotId, width: number, height: number, zoom: number): Promise<HttpgdPlot<string>> {
648
649 const args = {
650 id: id,
651 height: height,
652 width: width,
653 zoom: zoom,
654 renderer: 'svgp'
655 };
656
657 const plotContent = await this.api.getPlot(args);
658 const svg = await plotContent?.text() || '';
659
660 const plt: HttpgdPlot<string> = {
661 id: id,
662 data: svg,
663 height: height,
664 width: width,
665 zoom: zoom,
666 };
667
668 this.viewHeight ??= plt.height;
669 this.viewWidth ??= plt.width;
670 return plt;
671 }
672
673
674 // functions for initial or re-drawing of html:

Callers 2

resizePlotMethod · 0.95
refreshPlotsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected