Skip to content

Commit

Permalink
fix: empty array
Browse files Browse the repository at this point in the history
  • Loading branch information
lkd01632719 committed Jan 12, 2024
1 parent 58c8f5a commit 13296f5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/plots/src/core/plots/sankey/adaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ export function adaptor(params: Params) {
},
];
if (isArray(data)) {
set(options, 'data', {
value: data,
transform: defaultTransform,
});
if (data.length > 0) {
set(options, 'data', {
value: data,
transform: defaultTransform,
});
} else {
delete options.children;
}
} else if (get(data, 'type') === 'fetch' && get(data, 'value')) {
const transform = get(data, 'transform');
if (isArray(transform)) {
Expand Down

0 comments on commit 13296f5

Please sign in to comment.