+
+
+
{name}
+ {elapsed_time && (
+
+
80分位耗时
+
{elapsed_time}
+
+ )}
+
+
+ {isCollapsed ? '展开' : '收起'}
+
+
+ {!isCollapsed && (
+
+ {children?.map((child, index) => (
+
+ ))}
+
+ )}
+
+ );
+};
+
+function isGroupCollapsed(data) {
+ return isBoolean(data.style?.collapsed) ? data.style?.collapsed : data.data.status === 'finished';
+}
+
+function isSingleStep(data) {
+ return !data.data.children;
+}
+
+const DemoFlowGraph = () => {
+ const [data, setData] = useState(undefined);
+
+ useEffect(() => {
+ fetch('https://assets.antv.antgroup.com/antd-charts/product-activation.json')
+ .then((res) => res.json())
+ .then(setData);
+ }, []);
+
+ const options = {
+ autoFit: 'view',
+ data,
+ node: {
+ style: {
+ component: function (data) {
+ if (isSingleStep(data)) return