| | | | Browse by category |
Question
How to perform different graph layouts on nested graphers using XML and CSS?
Answer
This sample renders a SDM diagram, whose content is defined in an .xml
file, using the style stated in the .css
file.
It performs tree layout on the top grapher with the flow direction of the links towards the bottom and sets hierarchical layout on the subgrapher with flow direction to the right. Additional information can be found in IlvGraphLayoutRenderer
class reference manual,"Specifying a different layout for each subgraph" section.
If you want to perform different layouts on nested graphers using Java API instead, you can use IlvRecursiveMultipleLayout.setLayout(Object
subgraph, IlvGraphLayout layout)
API.
You can download the sample in attachment and unzip it. To run the sample, put the files Main.java
, simple.xml
, and simple.css
in the same folder. Then, compile and run the Main class with java Main.