Rendering Expressions
Rendering expressions are expressions that contain rendering information. They can be created either using the Rendering Editor or by using a function that returns a rendering expression.
It's not normally necessary to work directly with rendering expressions unless you need to create a rendering function as part of an object definition. Most of the time, renderings can be created in the Rendering Editor and although these renderings are really rendering expressions, you normally never see the actual rendering expression.
We will illustrate the parts of a rendering expression with a few examples. The rendering expression for the Not object in the Logic namespace in the Standard notation is:
You can see this expression by opening the Boolean objects module of the Basics library, highlighting the first rendering and pressing Ctrl + C to copy the rendering. Now if you open the clipboard viewer or paste into another module, you should see the expression above.
The components of any rendering expression are Symbols, Lines, Groups and Parameters. The properties of a rendering determine how the components are connected (which defines the relative position of the different parts of the rendering) along with other properties of the rendering.
The styles that determine the font, font size, etc. can be either in the properties of the symbol or they can be attached to the Text object that is in the first parameter of the symbol. In the example of the Not object, above, the styles have been attached to the text object. This is usually easier because the text appears in the correct font in the rendering expression.
Another example of a rendering expression is the rendering of the Power object in the Math namespace:
This is an example of a rendering where one of the components has a Scale property. In this rendering, the second parameter is scaled to be smaller than the first. This is done by putting the Scale object in the second parameter of the Parameter component.
Another example of a rendering expression is the Div object in the Math namespace. The Standard rendering is:
Here, the size of the Line component is scaled to the size of the two parameters of the Div object. The scaling is described in the Scaling Symbols and Lines section of the documentation for the Rendering Editor.
If you copy any rendering that was created by the Rendering Editor, the rendering expression will be placed on the clipboard. You can paste this expression into a module. For example, if you are creating a rendering function, one way to start this process would be to create a rendering using the Rendering Editor, copy and paste that rendering into a clause in the rendering function and then edit the rendering as necessary to get the behavior that you want from the rendering function.
The complete list of components and properties that can be used in a rendering expression can be seen in the Rendering definition objects module in the Basics library