check group
This commit is contained in:
1 parent
f37bf6b48a
commit
deaa12ff4b
9 files changed
+51
-16
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import G6 from "@antv/g6";
|
||||
import { useWorkspace } from "../contexts/workspace-context";
|
||||
import { TreeGraphData, getNodeType } from "../misc/b3type";
|
||||
import { checkTreeData, getNodeDefs } from "../misc/b3util";
|
||||
import { checkTreeData, nodeDefs, usingGroups } from "../misc/b3util";
|
||||
import i18n from "../misc/i18n";
|
||||
import { isMacos } from "../misc/keys";
|
||||
|
||||
@@ -142,14 +142,14 @@ G6.registerNode(
|
||||
},
|
||||
draw(cfg, group) {
|
||||
const data = cfg as TreeGraphData;
|
||||
const nodeDefs = getNodeDefs();
|
||||
const nodeDef = nodeDefs.get(data.name);
|
||||
let classify = getNodeType(nodeDef);
|
||||
let color = nodeDef.color || NODE_COLORS[classify] || NODE_COLORS["Other"];
|
||||
if (
|
||||
!nodeDefs.has(data.name) ||
|
||||
(data.path && !data.children?.length) ||
|
||||
!checkTreeData(data)
|
||||
!checkTreeData(data) ||
|
||||
(nodeDef.group && !usingGroups[nodeDef.group])
|
||||
) {
|
||||
classify = "Error";
|
||||
color = NODE_COLORS[classify];
|
||||
|
||||
Reference in new issue
Block a user