The arki.graph.graph_parser library facilitates manipulation of grphical views, supporting the following features:
- Getting and modifying object object graphical position
- Getting and modifying object expand status
- Getting and modifying flows, their waypoints and label positions
- Getting and modifying oouterbox, goto/from box information
The library provides thefollowing classes:
- Graph
- GraphObject
- GraphLink
- GraphGotoFrom
- GraphOuterBox
Common usage patterns
Modifying object positions
- Create Graph instance from the ArkObjRef (see constructor for parameters)
- Modifying objects:
- If you need to modify existing object, you ask Graph to get corresponding GraphObject (use Graph.GetChild), then modify this object's position using SetPos
- If you want to add new object, not yet existing in graph (if GetChild returned None), you can use Graph.AddChild
- After you finished editing, you call Graph.Update() to write modifications back to arKitect.
Alternatively to 2b), you can ask arKitect to create default graph in the Graph constructor, using parameter regenerate_xml=True, and use 2a).
Reading object positions
- Create Graph instance from the ArkObjRef (see constructor for parameters)
- Having ArkObjRef, get the corresponding GraphObject using Graph.GetChild, then read this object's position using GetPos