MCPcopy Create free account
hub / github.com/microsoft/data-formulator / getIdeasForVisualization

Function getIdeasForVisualization

src/views/EncodingShelfCard.tsx:578–599  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

576 ];
577
578 let getIdeasForVisualization = async () => {
579 if (!currentTable || isLoadingIdeas) return;
580
581 let chartAvailable = checkChartAvailability(chart, conceptShelfItems, currentTable.rows);
582 let currentChartPng = chartAvailable ? await vegaLiteSpecToPng(assembleVegaChart(
583 chart.chartType, chart.encodingMap, activeFields, currentTable.rows,
584 currentTable.metadata, 100, 80, false, chart.config)) : undefined;
585 if (currentChartPng) {
586 currentChartPng = await downscaleImageForAgent(currentChartPng);
587 }
588
589 await streamIdeas({
590 actionTableIds,
591 currentTable,
592 onIdeas: setIdeas,
593 onThinkingBuffer: setThinkingBuffer,
594 onLoadingChange: setIsLoadingIdeas,
595 onProgress: setIdeaPhase,
596 currentChartImage: currentChartPng,
597 currentDataSample: currentTable.rows.slice(0, 10),
598 });
599 }
600
601 // Function to handle idea chip click
602 const handleIdeaClick = (ideaText: string) => {

Callers 1

EncodingShelfCardFunction · 0.85

Calls 5

checkChartAvailabilityFunction · 0.90
assembleVegaChartFunction · 0.90
downscaleImageForAgentFunction · 0.90
vegaLiteSpecToPngFunction · 0.85
streamIdeasFunction · 0.85

Tested by

no test coverage detected