()
| 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) => { |
no test coverage detected