MCPcopy Index your code
hub / github.com/microsoft/data-formulator / buildEmbeddedDataForChart

Function buildEmbeddedDataForChart

src/app/restyle.ts:37–54  ·  view source on GitHub ↗
(
    chart: Chart,
    rows: any[],
    tableMetadata: any,
    conceptShelfItems: FieldItem[],
)

Source from the content-addressed store, hash-verified

35 * something back.
36 */
37export function buildEmbeddedDataForChart(
38 chart: Chart,
39 rows: any[],
40 tableMetadata: any,
41 conceptShelfItems: FieldItem[],
42): any[] {
43 const fullSpec = assembleVegaChart(
44 chart.chartType,
45 chart.encodingMap,
46 conceptShelfItems,
47 rows,
48 tableMetadata,
49 300, 300, false, chart.config,
50 );
51 if (!fullSpec || fullSpec === 'Table') return rows;
52 const values = (fullSpec as any)?.data?.values;
53 return Array.isArray(values) ? values : rows;
54}
55
56/**
57 * Build the Vega-Lite spec to send to the restyle agent.

Callers 2

ChartRenderServiceFunction · 0.90

Calls 1

assembleVegaChartFunction · 0.90

Tested by

no test coverage detected