Skip to content

Commit 6592127

Browse files
author
xueren.dt
committed
fix(ava): fix ci problem
1 parent dda0d50 commit 6592127

5 files changed

Lines changed: 6 additions & 13 deletions

File tree

packages/ava/src/advisor/advisor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ export class Advisor {
9999
});
100100
*
101101
*/
102-
render(params: { container: string; spec: Spec }) {
102+
render(container: string, spec: Spec) {
103103
const renderer = getRenderer();
104104
if (renderer) {
105-
return renderer(params);
105+
return renderer(container, spec);
106106
}
107107
logError('Chart render not configured, please bind a renderer first, GPT-Vis is recommended.');
108108
return null;

packages/ava/src/bind.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// import type { Spec } from '@antv/gpt-vis';
33
export type Spec = any;
44

5-
export type Renderer = (params: { container: string; spec: Spec }) => void;
5+
export type Renderer = (container: string, spec: Spec) => void;
66

77
// The renderer function bound from outside.
88
// Default is null.

playground/src/examples/advise/index.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ const AdviseSummary: React.FC = () => {
4040
try {
4141
if (parsedData) {
4242
const advises = await advisor.advise({ data: parsedData });
43-
advisor.render({
44-
container: '#chart',
45-
spec: advises[0].charts[0].spec,
46-
});
43+
advisor.render('#chart', advises[0].charts[0].spec);
4744
}
4845
} catch (_e) {
4946
// 忽略错误,仅用于验证 advisor.render

playground/src/examples/advise/multiple.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ const MultipleChartsDemo: React.FC = () => {
3636
const advise = async () => {
3737
const advises = await advisor.advise({ data });
3838
advises.forEach((item) => {
39-
advisor.render({
40-
container: '#charts',
41-
spec: item.charts[0].spec,
42-
});
39+
advisor.render('#charts', item.charts[0].spec);
4340
});
4441
};
4542

playground/src/utils/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import ReactDOM from 'react-dom/client';
44
import { DEFAULT_CHART_COMPONENTS } from '@antv/gpt-vis';
55
import { Spec } from '../../../packages/ava/src/bind';
66

7-
export const render = (params: { container: string; spec: Spec }) => {
8-
const { container, spec } = params || {};
7+
export const render = (container: string, spec: Spec) => {
98
const mount =
109
typeof container === 'string' ? (document.querySelector(container) as HTMLElement) : (container as HTMLElement);
1110
if (!mount) return;

0 commit comments

Comments
 (0)