Skip to content

NodeGraph.deserialize_session() doesn't respesct nodes layout #313

@aloytag

Description

@aloytag

After creating a graph (NodeGraph instance) and saving it with graph.serialize_session(), I load it again using graph.deserialize_session() and detect that the vertical nodes are now in horizontal layout.

It might be interesting if the node had a property with the configured layout. This way it could be possible to recover the layout direction after serializing and deserializing back. I tried to do it without changing the library code. So in my code I created a function the deserializes the graph, then checks for that property and uses node.set_layout_direction(1) when appropriate. It works but, however, port names show in vertical nodes (when it is supposed to be hidden).
If I go deeper, I see the I have have to zoom (mouse scroll) before executing node.set_layout_direction(1). This way the node changes to vertical layout direction and port names remain hidden.

Regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions