# Representations in ParaView

**URL:** https://discourse.paraview.org/t/representations-in-paraview/11381
**Category:** Development
**Created:** [February 11, 2023, 11:29pm UTC](https://discourse.paraview.org/t/representations-in-paraview/11381 "2023-02-11T23:29:00Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![dcthomp](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dcthomp/32/20_2.png) [@dcthomp](https://discourse.paraview.org/u/dcthomp)
#### Post date: [February 11, 2023, 11:29pm UTC](https://discourse.paraview.org/t/representations-in-paraview/11381/1 "2023-02-11T23:29:00Z")

</div>

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.

 ![representation_graph_3](https://discourse.paraview.org/uploads/default/original/2X/7/7ef1d1f3f02cb0f5560f69d1cb6dec3a6d585e03.png)

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](https://discourse.paraview.org/uploads/short-url/5EoHhHXtXeO1Kld2HzylrvPMIQg.css) (1.0 KB)  
[representation\_graph.py](https://discourse.paraview.org/uploads/short-url/vVdBLALtbBHflpjGXEDVv9jSSzf.py) (2.8 KB)

---

<div class="post-metadata">

### Author: ![Andrew\_Maclean](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/e56c9b/32.png) [@Andrew\_Maclean](https://discourse.paraview.org/u/Andrew_Maclean)
#### Post date: [February 12, 2023, 1:14am UTC](https://discourse.paraview.org/t/representations-in-paraview/11381/2 "2023-02-12T01:14:32Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Andrew\_Maclean](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/e56c9b/32.png) [@Andrew\_Maclean](https://discourse.paraview.org/u/Andrew_Maclean)
#### Post date: [February 16, 2023, 12:05am UTC](https://discourse.paraview.org/t/representations-in-paraview/11381/3 "2023-02-16T00:05:52Z")

</div>

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:

```bash

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`.

---

<div class="post-metadata">

### Author: ![dcthomp](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dcthomp/32/20_2.png) [@dcthomp](https://discourse.paraview.org/u/dcthomp)
#### Post date: [February 16, 2023, 7:18am UTC](https://discourse.paraview.org/t/representations-in-paraview/11381/4 "2023-02-16T07:18:16Z")

</div>

@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).
