From 5f3c22fac84b288d4cf0ac3c7d91569f83e342fe Mon Sep 17 00:00:00 2001 From: nikkikapadia Date: Thu, 2 Jul 2026 12:24:25 -0400 Subject: [PATCH 1/3] fix(render): disable return before full canvas paint --- src/render.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/render.ts b/src/render.ts index 15fa5d5..dd43995 100644 --- a/src/render.ts +++ b/src/render.ts @@ -15,6 +15,14 @@ echarts.setPlatformAPI({ // ECharts always resizes the canvas after creating it, so these dimensions // are just placeholders. createCanvas: () => createCanvas(1, 1) as any, + // WARNING: SUPER HACKS 😭 + // Code for context: https://github.com/apache/echarts/blob/5b0f1fd21bc25bcfdb5845029a6ba3a77a4355af/src/core/echarts.ts#L662-L703 + // Echarts defaults to waiting 15ms per layer to paint but obviously + // charts with many data points (e.g. heatmaps) will take longer than that. + // Setting this to 0 makes ECharts ignore that 15ms budget and paint the + // chart fully; this means the code solely relies on the canvas paint to be finished + // before returning the rendered chart. This fixes the issue of the chart rendering partially. + getTime: () => 0, }); /** @@ -57,5 +65,5 @@ export function renderSync(style: RenderDescriptor, data: any) { // this to Infinity to disable it entirely. // https://echarts.apache.org/en/option.html#series-heatmap.progressive function disableProgressive(series: SeriesOption): SeriesOption { - return {...series, progressive: 0, progressiveThreshold: Infinity}; + return {...series, progressive: 0, animation: false}; } From 984b9a7593290bc7a449a0886af8f26f53b1ebc1 Mon Sep 17 00:00:00 2001 From: nikkikapadia Date: Thu, 2 Jul 2026 12:26:49 -0400 Subject: [PATCH 2/3] update comment --- src/render.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/render.ts b/src/render.ts index dd43995..f2f2509 100644 --- a/src/render.ts +++ b/src/render.ts @@ -17,6 +17,7 @@ echarts.setPlatformAPI({ createCanvas: () => createCanvas(1, 1) as any, // WARNING: SUPER HACKS 😭 // Code for context: https://github.com/apache/echarts/blob/5b0f1fd21bc25bcfdb5845029a6ba3a77a4355af/src/core/echarts.ts#L662-L703 + // PLZ NOTE: this hack is not documented in ECharts docs so please check the code link above for more details! // Echarts defaults to waiting 15ms per layer to paint but obviously // charts with many data points (e.g. heatmaps) will take longer than that. // Setting this to 0 makes ECharts ignore that 15ms budget and paint the From 9fd5b8dee54b1658293f0d353733f6309bd0331e Mon Sep 17 00:00:00 2001 From: nikkikapadia Date: Thu, 2 Jul 2026 14:24:52 -0400 Subject: [PATCH 3/3] add more info --- src/render.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/render.ts b/src/render.ts index f2f2509..ebee93b 100644 --- a/src/render.ts +++ b/src/render.ts @@ -16,8 +16,9 @@ echarts.setPlatformAPI({ // are just placeholders. createCanvas: () => createCanvas(1, 1) as any, // WARNING: SUPER HACKS 😭 - // Code for context: https://github.com/apache/echarts/blob/5b0f1fd21bc25bcfdb5845029a6ba3a77a4355af/src/core/echarts.ts#L662-L703 - // PLZ NOTE: this hack is not documented in ECharts docs so please check the code link above for more details! + // Code for context: https://github.com/apache/echarts/blob/master/src/core/echarts.ts#L662-L703 + // Commit where this feature was added: https://github.com/apache/echarts-website/commit/8e897fa1e58b30db1dae85a1e9060bdbc0f61b0c#diff-8f31957f9bb06adae78b3a13c71455fa2dac55acba01411459aeffa427da8bb5 + // PLZ NOTE: this is not documented in ECharts docs so please check the code links above for more details! // Echarts defaults to waiting 15ms per layer to paint but obviously // charts with many data points (e.g. heatmaps) will take longer than that. // Setting this to 0 makes ECharts ignore that 15ms budget and paint the