Previous Up Next
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

3 Working with libraries of subfigures

There are geometric constructions, say finding the midpoint of an interval, which need to be often performed but they are not completely trivial. Furthermore, such constructions produce numerous additional cycles, which make a figure much difficult to perceive. To resolve such situation MoebInv libraries provide a tool called subfigure, that is a figure used inside of another main figure. In the programming language subfigure can be viewed as a macro-like mechanism. Several subfigures can be collected into a library. There is full freedom to operate and use such libraries from Yaglom.

The following instructions are illustrated in the following video Simpson line and library of subfigures: https://youtu.be/GUmCppyUv60

3.1 Subfigures from a library and the figure

A user can employ subfigures from two sources:

  1. A pre-loaded library. There may exist many different libraries stored on media. Only one library can be loaded at a time. User can edit, merge and store content of libraries, see below.
  2. A figure may contain some subfigures which are not in the currently loaded library. If present, these figures are listed to the user under a separate heading.

The user can add any subfigure from the figure to the current library. For this select by RightClick its context menu and choose Append to the library action. Further subfigure usage and library editing are explained in the following paragraphs.

3.2 Using a subfigure

To use a subfigure (either from the current library or current figure) select by RightClick its context menu and choose Use this subfigure ⚙ action. You will be presented with a dialog which will briefly describe the subfigure and tells which cycles need to be provided in a particular order.

In the edit box provided you need to give comma-separated list of labels of cycles which you want to use. You may also specify a generation for newly created cycle(s) as discussed above, see 3.
Advise: You can create several figures simultaneously providing the list of cycles to be used. Here are some examples for midpoint subfigure:

3.3 Creation of a subfigure

A subfigure can be created from Yaglom as any other figure, yet using submenu SubfiguresNew subfigure simplifies some tasks. Notably, the following rules need to be observed:

  1. A subfigure shall have some generation zero cycles which are used as subfigure input or parameters. Such cycles have to be labelled as variable000, variable001, ….
    1. At least one input cycle labelled variable000 has to be present in every subfigures.
    2. If subfigure needs n+1 input cycles they need to be called variable000, variable001, …, variable00n without gaps.
    3. A label shall has exactly three decimal digit (padded by zeroes if needed). In particular the number of input cycles is limited by 1000.
    4. If subfigure is used, cycles provided as parameters are substituted to variable000, variable001, …in the natural order. The number of provided parameters shall not exceed the number of existing variables in the subfigure.
    5. If number of parameters provided is less than the number of variables in a subfigure, then remaining variables preserve the default values which were in use during the subfigure creation in Yaglom.
  2. The output (or result) of a subfigure is all cycles from generation-1 or later without children. That is, all cycles which are not shall be considered as the subfigure output.
  3. Only output of a subfigure will be explicitly added to the surrounding figure. will not be seen from the embedding figure.
  4. A subfigure needs to have a clear description. This description can be added through EditProperties menu or will be prompted at an attempt to add a subfigure. The description shall have two parts:
    1. A short (<80 chars) clear title ending by the period character and new line. This title will be indicate the subfigure in the library list.
    2. The rest of description shall clearly state subfigure purpose (output), number and meaning of the expected variables (inputs) with predefined order.

Advise: since variables of a subfigure shall have the predefined labels, you will need to switch to either manual label creation or fine-tune automatic naming. The later adjustment will be done for you if SubfiguresNew subfigure submenu is used. Other cycles in the subfigure may have arbitrary names which can be either automatically or manually assigned.

3.4 Addition of a figure as a subfigure to the current library

Once you created a desired subfigure in accordance with the rules in the previous subsection you can:

  1. Save it as ordinary figure in a separate file from FileSave As menu.
  2. Add it to the end of the current library from SubfiguresAdd the figure to library menu. Thereafter the position of the subfigure within the library can be arbitrary changed.
  3. Insert it at an arbitrary position through the context menu called by RightClick on a particular subfigure and selecting Add current figure before this.

In addition to the library is attempted Yaglom makes a basic sanity check of the subfigure for suitability (see the previous subsection) and some warning and advises can be issued to a user.

You may also append a previously saved library (see option 1 in § 3.6) to the currently loaded through the menu SubfiguresAppend file to library.

3.5 Editing the current library

The context menu in Library of subfigures (called by RightClick) allow you either use a specific subfigure (see § 3.2) or modify the current library in the following way:

  1. Reorder subfigures in the library by moving selected figure up or down in the list.
  2. Edit the selected subfigure by loading it into the Graphical View. Edited subfigure can be inserted in the current library as a new subfigure or saved in a separate file (e.g. for addition to another library).
  3. Remove the selected subfigure from the current library.
    Caution: this operation cannot be reverted and the subfigure will be permanently lost. You may want to save the subfigure as separate file (see the above operation) before removing it from the library.
  4. Add current figure (if it is suitable, see § 3.3) as subfigure to this library, see § 3.4.

3.6 Manipulating libraries of subfigures

The following operation are available in Subfigures menu and give a user a full control of libraries of subfigures:

  1. Store current library as a separate file for further use.
  2. Load subfigure library, which was previously stored.
  3. Append file to library: all subfigures found in the stored library will be appended to already existing subfigures in the current library. Of course, such a merge of library can be done repeatedly and the result stored as a new combined library.
  4. Store & make it default: the stored library will be automatically loaded at every new start-up of Yaglom. Such a default library can be also chosen from ToolsSettingsGUI submenu.

Combining operations from §§ 3.53.6 a user can create and use arbitrary number of subfigure libraries specially tailored for different tasks.


Previous Up Next