Representations in ParaView

I’m developing a new representation and needed to understand how the various classes interact (as of ParaView 5.11). I used the attached python script to generate a graph illustrating how they are used. It helped me; hopefully it will help you.

Some notes:

  • The nodes are representation types from ParaView’s views_and_representations.xml file.
    • The node colors indicate the type of proxy on the client side;
    • The text of the node is the name of the proxy type in the XML source; and
    • the arc colors indicate the nature of the relationship between the node types (inheritance or ownership).
  • It doesn’t include the <Extension …> tag yet, but these are present in ParaView’s views_and_representations.xml.
  • Note that the base proxy for the “composite” representation (PVRepresentationBase) owns subproxies corresponding to the various representation “styles” (e.g., OutlineRepresentation).
  • The various dataset-type-specific parents of PVRepresentationBase (e.g., UnstructuredGridRepresentation) then inherit the base composite proxy
  • I added the legend and moved some of the “dangling” nodes around after running dot to make the graph more legible.

representation_graph.css (1.0 KB)
representation_graph.py (2.8 KB)

4 Likes

@dcthomp this looks really good, it’s going to be so useful.

Here are some instructions on how to use it:

Edit representation_graph.py and change the line rv = minidom.parse(...) to point to your local copy of views_and_representations.xml.

Then:


python3 representation_graph.py > representation_graph
dot -O -n -Tsvg representation_graph

The output will be representation_graph.svg.

Open representation_graph.svg in your browser.

If the directed graph is not coloured, check that representation_graph.css is in the same folder as representation_graph.svg.

Note: If dot is not present, then install graphviz.

1 Like

@Andrew_Maclean Thanks for adding the more detailed instructions.

I’m still trying to figure a good way to illustrate which objects get instantiated on the server for each client proxy (without too much clutter).