-
Beta Was this translation helpful? Give feedback.
Answered by
yvonneyx
Apr 14, 2025
Replies: 1 comment 3 replies
-
需要对数据进行单独处理,可以参考下述例子: const graph = new Graph({
container: 'container',
data: treeToGraphData(data, {
getNodeData: (datum, depth) => {
if (!datum.style) datum.style = {};
datum.style.collapsed = depth >= 2;
if (!datum.children) return datum;
const { children, ...restDatum } = datum;
return { ...restDatum, children: children.map((child) => child.id) };
},
}), |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
yvonneyx
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
需要对数据进行单独处理,可以参考下述例子: