Improved Text Representation in ParaView

New properties for the TextSourceRepresentation have been added in ParaView enabling the customization of the background and the border of a text created, for example, through the Text or Programmable Annotation sources. Besides, you can now also write multi-line and multi-column text and equations using the pipe symbol (|) and newlines.

These changes are already available in the latest master and will be released with ParaView 5.10.0.

Text background styling

Figure 1. The new styling properties of the TextSourceRepresentation in ParaView master.
  • Show Background : This property controls the background visibility : “Never”, “Only On Hover” (visible only when the mouse hovers the text) or “Always”. The Background Properties property group is visible if you select “Always” or “Only On Hover” and lets you customize the text background.
  • Background Color : This property controls the text background color.
  • Border Color : This property controls the color of the visible border if the Border Thickness is different than 0.
  • Border Thickness : This property controls the border thickness in screen units. A value of 0 hides the border.
  • Corner Radius : This property controls the radius of the corners of the border in percent of the maximum (between 0.0 and 1.0). A value of 1.0 means that the corner will be fully round and is defaulted to 0.0 (squared corners).
  • Padding : This property allows you to add a free space between the text and the border. It is expressed in pixel units.
Figure 2. Example of a green text with a blue background color, a thick pink half-round border and a padding of 25 pixels, rendered in ParaView master.

Multi-lines and multi-colums text

You can now write multi-lines and multi-columns text in a Text or a Programmable Annotation source. This feature uses the MathText backend as introduced in ParaView 4.0, so you need to compile ParaView with Python enabled via the CMake variable PARAVIEW_USE_PYTHON (or use a binary release with Python enabled). This also means that you can mix equations and text.

Figure 3. Multi-line and multi-column text and equation rendering (3 lines, 3 columns each) with centered horizontal and vertical justification rendered in ParaView master.

To render a multi-line text, you just have to write a new line in the text. To define a new column, you must write a pipe (symbol |) as seen in figure 3.

In figure 3, you can see that the text is composed of 3 lines, each with 3 columns, so the text contains 9 cells. If a line does not contain any pipe symbol then columns are automatically added at the end of the line. This means that the number of text columns is the maximum number of pipe symbols (or columns) of all individual lines of the text.

The Vertical Justification and Horizontal Justification properties of the text can be useful when rendering multi-cells texts to control the cells justification.

Acknowledgements

This work was supported by CEA

Developments were done by Kitware Europe, France 

Questions or comments are always welcome!

X