We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
自定义dynamicGroup节点会报Cannot read properties of undefined (reading 'gridSize')错误
//这是CustomGroup.ts文件的代码 import { dynamicGroup } from "@logicflow/extension"; class CustomGroup extends dynamicGroup.view {} class CustomGroupModel extends dynamicGroup.model { getNodeStyle() { const style = super.getNodeStyle(); style.stroke = "#AEAFAE"; style.strokeDasharray = "3 3"; style.strokeWidth = 1; return style; } } export default { type: "CustomGroup", model: CustomGroup, view: CustomGroupModel, }; //这是CustomGroup.ts文件的代码 import LogicFlow from "@logicflow/core"; import { Control, Menu, DndPanel, DynamicGroup, SelectionSelect, MiniMap, } from "@logicflow/extension"; import "@logicflow/core/lib/style/index.css"; import "@logicflow/extension/lib/style/index.css"; const lf = ref<any>(null); const lfRef = ref<any>(null); const nodes = ref([ { id: "dynamic-group_1", type: "CustomGroup", x: 500, y: 140, // children: ["rect_3"], text: "dynamic-group_1", resizable: true, properties: { // resizable: true, collapsible: true, width: 420, height: 250, radius: 5, isCollapsed: true, }, }, ]); const edges = ref([]); onMounted(() => { lf.value = new LogicFlow({ container: lfRef.value, grid: true, multipleSelectKey: "alt", autoExpand: false, allowResize: true, allowRotate: true, keyboard: { enabled: true, }, plugins: [DynamicGroup, DndPanel, SelectionSelect, Menu], }); lf.value.register(CustomGroup); lf.value.render({ nodes: nodes.value, edges: edges.value, }); })
2.0.10
2.0.14
No response
The text was updated successfully, but these errors were encountered:
需要自定义dynamicgroup节点实现锚点的功能,dynamicgroup节点也可以做出发节点
Sorry, something went wrong.
这边先看下,稍等
朋友这里model和view写反了 export default { type: "CustomGroup", model: CustomGroup, view: CustomGroupModel, }; 应该是 export default { type: "CustomGroup", view: CustomGroup, model: CustomGroupModel, };
然后目前Group节点的锚点是透明的,如果要显示的话还需要重写getAnchorStyle,让锚点显示出来,可以参考这个demo里的customGroup2054.ts的实现看下 https://codesandbox.io/p/devbox/logicflow2-0demo-kv7vn5
DymoneLewis
No branches or pull requests
发生了什么?
自定义dynamicGroup节点会报Cannot read properties of undefined (reading 'gridSize')错误
logicflow/core版本
2.0.10
logicflow/extension版本
2.0.14
logicflow/engine版本
No response
浏览器&环境
No response
The text was updated successfully, but these errors were encountered: