Subgraphs


A subgraph is a class or pattern that is built of a number of base objects.

An instance of the subgraph is created by selecting the subgraph in the subgraph palette,
and clicking MB1 in the working area. In the editor, the instances are handled as other objects,
and the fillcolor, bordercolor and linewidth of the instances can be set.

Color

You can set the fill color and border color of a subgraph object in the same way as the base
objects. It implies that these properties are set to all the base objects of the subgraph.
If you set the fill color of a subgraph that is drawn with shadows and reflections to give a 3D
effect, this effect will disappear and the objects is totally flattened out. To modify the color
of this kind of subgraph you use the functions for lightness, color intensity and color tone
in the tool panel.

Lightness
The function for lightness is found in the tool panel and marked with sun. Here are increase
and decrease buttons that makes the fill color of the object lighter or darker. The lightness
can be modified in seven steps.

Intensity
The function for color intensity is found in the tool panel and marked with three color points.
The intensity can be modified in three steps: strong intensity, medium and gray.

Shift
Color shift implies that every color in the subgraph object is rotated on the color circle.
An object that contains blue and green colors will, for example, after four shift steps contain
orange and red colors. The colors keeps their original lightness and intensity, and also their
internal color contrast.

The function is found in the tool panel and marked with color points surrounded by an circular
arrow. The colors of the first row of the color palette are not affected by the shift function.

Tone
Toning of an object, implies that all the color of the subgraph object gets the same color tone.
They keep their lightness and intensity. There are nine different color tones: gray,
yellowgreen, yellow, orange, red, violet, blue, seablue and green.

The function for tone is found in the color palette below the selection of fill, border and
text color. Here is also a button to reset the color of an objects to the original colors.

Animation and shift

Subgraphs with several pages
Animation and Shift are types of dynamics that don't just change the color of the subgraph,
they also change the shape. This is done by creating a subgraph with several pages.

To create additional pages for a subgraph you activate 'File/Page/Create next page'. This
function will create a new subgraph with the suffix '__px', where x is the page number, and
it will link this to the previous page by putting the name in the attribute NextSubgraph in
the graph attributes. For the last page, NextSubgraph is empty. When a page is created and
saved, you can easily shift to the next or previous page from 'File/Page/NextPage' and
'File/Page/PreviousPage' in the menu.

You should save the different pages with the same zoom factor, otherwise you might get one
pixels displacement of pages in runtime.

Shift

Shift between different pages in runtime is done with the dynamic types DigShift, DigFourShift
and AnalogShift. DigShift shifts between the first and second page depending on a digital
value. DigFourShift shifts between four pages depending on the values of three digital signals.
AnalogShift is connected to an analog signal, where the value corresponds the the index for
the page to be displayed (the first page has index 0).

Animation

When an animation is run, the pages are displayed, one after another and gives the impression
of movement.

The interval between each page shift, normally has to be much shorter than the normal update
interval. For a graph, you can state the animation scan time in 'File/Graph attributes' in the
menu. Note that the time is common for all subgraphs in the graph, and can not be stated for
each subgraph individually. A suitable value for the animation scan time is 0.2 seconds.

If an animation should rest on the same page for several animation cycles, you can enter the
number of cycles in AnimationCount in Graph attributes for the page.

Animations are handled by the dynamic type Animation. It is connected to a digital signal that
controls start and stop of the animation. It also has the attribute Sequence which tells
in which order, and on what condition, the animation is run. Sequence can have the value Cyclic,
Dig or ForwBack.

If Sequence is Cyclic, the first page is displayed when the value of the signal is 0. When the
value of the signal is 1, the animation is active. It starts at page 2 and continues to the
last page, after that it jumps to the second page again and continues to the last page etc.
This continues until the value of the signal becomes 0.

The sequence ForwBack is similar, but here, the animation runs continuously forward and back
between the first and last page, as long as the signal value is 1.

If Sequence is Dig the animation is run only when the signal value is changed. When the value
is changed to 1, the animation is run from the first to the last page, and stays on the last
page, when the value is changed to 0, the animation is run back to the first page, and rests
there.