Skip to content

Commit

Permalink
fix: renderer hanging on copying data
Browse files Browse the repository at this point in the history
  • Loading branch information
skokenes committed Oct 28, 2024
1 parent 9071fc8 commit 9625f43
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/malloy-render/src/component/chart/chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@ export function Chart(props: {
const {field, data} = props;
const chartProps = props.metadata.field(field).vegaChartProps!;
const spec = structuredClone(chartProps.spec);
const chartData = data.map(row => {
const rec = structuredClone(row);
// prevent structured clone from ripping out the QueryDataRow class
rec['__malloyDataRecord'] = row['__malloyDataRecord'];
return rec;
});
const chartData = structuredClone(data);
for (let i = 0; i < chartData.length; i++) {
chartData[i]['__malloyDataRecord'] = data[i]['__malloyDataRecord'];
}
// New vega charts use injectData handlers
if (chartProps.injectData && chartProps.specType === 'vega') {
chartProps.injectData(field, chartData, spec);
Expand Down

0 comments on commit 9625f43

Please sign in to comment.