Replies: 1 comment
-
some pseudo code of the idea class NodeConfig {
shape = "flow-chart-node"
behaviors = [
DraggableBehavior,
ResizableBehavior,
PortsBehavior,
RenderBehavior
]
}
const config = new GraphConfigBuilder()
.registerNode(new NodeConfig())
.withBehavior(DragMove)
.withBehavior(UndoRedo)
.build();
const [state, dispatch] = useReducer(config.getReducer())
<Editor state={state} dispatch={dispatch} config={config}>
<Graph />
</Editor> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently all drag drop behaviors are hardcoded.
We can't describe a node that are not resizable while draggable natively.
Some nodes may have different drag behavior, such as align to flex/grid layout.
The API should be like
while
Notice these APIs are not final, just a draft.
Beta Was this translation helpful? Give feedback.
All reactions