MCPcopy
hub / github.com/chartbrew/chartbrew / previewChart

Method previewChart

server/controllers/ChartController.js:1019–1035  ·  view source on GitHub ↗
(chart, projectId, user, noSource)

Source from the content-addressed store, hash-verified

1017 }
1018
1019 previewChart(chart, projectId, user, noSource) {
1020 return this.getPreviewData(chart, projectId, user, noSource)
1021 .then((data) => {
1022 if (chart.type === "table") {
1023 return dataExtractor(chart);
1024 }
1025
1026 const axisChart = new AxisChart(data);
1027 return axisChart.plot();
1028 })
1029 .then((chartData) => {
1030 return new Promise((resolve) => resolve(chartData));
1031 })
1032 .catch((error) => {
1033 return new Promise((resolve, reject) => reject(error));
1034 });
1035 }
1036
1037 getChartData(id) {
1038 let gChartData;

Callers 1

ChartRoute.jsFile · 0.80

Calls 2

getPreviewDataMethod · 0.95
plotMethod · 0.95

Tested by

no test coverage detected