Skip to content

Commit fb22e01

Browse files
ninelcc336Claude Opus 4.7claude
authored
suppress streaming rendering errors by adding streaming mode to … (#406)
* fix: suppress streaming rendering errors by adding streaming mode to GPTVis Co-Authored-By: Claude Opus 4.7 <[[email protected]](<> "mailto:[email protected]")> * feat(streaming): suppress unhandled rejections from G2/G6 in streaming component * docs(examples): fix config documentation mismatches in examplesData - Add missing axisXTitle/axisYTitle config for boxplot and violin chart - Add missing type property and reorder galleryExamples for fishbone diagram - Expand style sub-properties (backgroundColor, palette) for flow diagram - Fix venn diagram data.sets type from string[] to string[] | string Co-Authored-By: Claude Opus 4.7 <[email protected]> * style(gpt-vis): delete empty line --------- Co-authored-by: Claude Opus 4.7 <[[email protected]](<> "mailto:[email protected]")> Co-authored-by: Claude Opus 4.7 <[email protected]>
1 parent 5cde2b3 commit fb22e01

6 files changed

Lines changed: 56 additions & 4 deletions

File tree

site/app/components/StreamingRender/index.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ export default function StreamingRender({
3333
}
3434
}, []);
3535

36+
// Suppress unhandled rejections from G2/G6 during streaming
37+
useEffect(() => {
38+
if (!streaming) return;
39+
const handler = (e: PromiseRejectionEvent) => {
40+
e.preventDefault();
41+
};
42+
window.addEventListener('unhandledrejection', handler);
43+
return () => window.removeEventListener('unhandledrejection', handler);
44+
}, [streaming]);
45+
3646
// Reset userScrolledUp when streaming starts
3747
useEffect(() => {
3848
if (streaming) userScrolledUpRef.current = false;

site/app/examples/examplesData/boxplot.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ export const boxplotData = {
5454
valueType: 'string',
5555
description: 'Chart title.',
5656
},
57+
{
58+
property: 'axisXTitle',
59+
type: 'optional',
60+
valueType: 'string',
61+
description: 'X-axis title.',
62+
},
63+
{
64+
property: 'axisYTitle',
65+
type: 'optional',
66+
valueType: 'string',
67+
description: 'Y-axis title.',
68+
},
5769
{
5870
property: 'theme',
5971
type: 'optional',

site/app/examples/examplesData/fishbone-diagram.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ export const fishboneDiagramData = {
44
id: 'fishbone-diagram',
55
name: 'Fishbone diagram',
66
icon: Fish,
7+
galleryExamples:
8+
'vis fishbone-diagram\ntitle "Low Production Efficiency"\ndata\n name "Low Production Efficiency"\n children\n - name "Equipment Issues"\n children\n - name "Aging Equipment"\n - name "Staff Issues"\n children\n - name "Insufficient Skills"\n - name "Process Issues"\n children\n - name "Cumbersome Processes"',
79
description:
810
'A professional chart that displays root causes of problems through a tree structure',
911
knowledge: {
@@ -18,6 +20,12 @@ export const fishboneDiagramData = {
1820
{
1921
name: 'Configuration Options',
2022
config: [
23+
{
24+
property: 'type',
25+
type: 'required',
26+
valueType: 'string',
27+
description: 'Value must be "fishbone-diagram".',
28+
},
2129
{
2230
property: 'data',
2331
type: 'required',
@@ -88,8 +96,6 @@ export const fishboneDiagramData = {
8896
},
8997
],
9098
},
91-
galleryExamples:
92-
'vis fishbone-diagram\ntitle "Low Production Efficiency"\ndata\n name "Low Production Efficiency"\n children\n - name "Equipment Issues"\n children\n - name "Aging Equipment"\n - name "Staff Issues"\n children\n - name "Insufficient Skills"\n - name "Process Issues"\n children\n - name "Cumbersome Processes"',
9399
examples: [
94100
{
95101
title: 'Product Profit Below Target (default theme)',

site/app/examples/examplesData/flow-diagram.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,18 @@ export const flowDiagramData = {
8686
valueType: 'Object',
8787
description: 'Chart style.',
8888
},
89+
{
90+
property: 'style.backgroundColor',
91+
type: 'optional',
92+
valueType: 'string',
93+
description: 'Must be a valid color value.',
94+
},
95+
{
96+
property: 'style.palette',
97+
type: 'optional',
98+
valueType: 'string[]',
99+
description: 'Must be an array of valid color values.',
100+
},
89101
],
90102
},
91103
],

site/app/examples/examplesData/venn-diagram.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ export const vennDiagramData = {
3434
{
3535
property: 'data.sets',
3636
type: 'required',
37-
valueType: 'string[]',
37+
valueType: 'string[] | string',
3838
description:
39-
'Set identifier, indicates which set(s) the item belongs to. Can be a single set or combination.',
39+
'Set identifier, indicates which set(s) the item belongs to. Can be a single set, combination, or comma-separated string.',
4040
},
4141
{
4242
property: 'data.value',

site/app/examples/examplesData/violin-chart.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ export const violinChartData = {
5555
valueType: 'string',
5656
description: 'Chart title.',
5757
},
58+
{
59+
property: 'axisXTitle',
60+
type: 'optional',
61+
valueType: 'string',
62+
description: 'X-axis title.',
63+
},
64+
{
65+
property: 'axisYTitle',
66+
type: 'optional',
67+
valueType: 'string',
68+
description: 'Y-axis title.',
69+
},
5870
{
5971
property: 'theme',
6072
type: 'optional',

0 commit comments

Comments
 (0)