Description
Describe your issue
As an attempt to keep things more organized in diagrams, sometimes the layout algorithm places the diagram differently based on which node and edge types are being laid out. For example, when in the same layer, cause nodes will be left of problem nodes which are left of benefit nodes. When I change a Cause to a Benefit, the layout could be affected, but currently we aren't recalculating layout after using the "Change node type" or "Change edge type" features, so I have to refresh the page to see the new layout.
Example of changing node type:
chrome_iqxJEuiPyY.mp4
Example of changing edge type:
chrome_r83Qv9eoqf.mp4
I should be able to see the layout impact as soon as I change a node or edge type.
Solution you'd like
Trigger re-layout after changing the type of a node or edge.
Alternatives you've considered
No response
Additional context
No response
Technical ideas and questions
There are a few ways to trigger re-layout, but triggering based on a change to a node/edge seems like it'd make most sense by including the node.type
and edge.label
when constructing the diagramHash
here:
ameliorate/src/web/topic/hooks/diagramHooks.ts
Lines 28 to 39 in 559ee53
Note: confusingly, edge.label
is the edge "type". There's some tech debt with naming there; edge.type
is used for our flowchart library's edge type.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status
Activity