-
Notifications
You must be signed in to change notification settings - Fork 0
Display and filter sub features inside a vertex
By adding the class ChildrenContainer to an html element inside the style editor, that element will become a container for the root node of his childrens who fulfill the filtering conditions, inserted inside reserved attributes.
attributes, references, operations, parameters, literals, annotations are reserved attributes that determine whether or not children of that type are displayed.
Valid values are listed here: Boolean conventions
The default value if the attribute is empty, non-existant, or with invalid value is "true".
If the basic filtering attributes are not enough, you can pass a function returning a boolean for custom filtering.
The function must be written in javascript as text inside the filter optional attribute.
When drawing the vertex of a Classifier, the validator will be called for every sub-element (Children) contained in the classifier.
The function must have the following properties:
- 1° parameter of type ModelPiece, will contain the current children being evaluated.
- 2° parameter of type Number, it contains the index of the iteration through childrens.
- 3° parameter of type List contains the array being iterated. Can be used to compare an element to his predecessor / successor or to make more complex filters.
- Must return a boolean.
The following is an example signature in typescript
(elem: ModelPiece, index: number, list: ModelPiece[]) => boolean;
Inherited features are displayed by default for M1-objects and hidden by default for M2-objects.
This behaviour can be changed by setting a boolean string inside the optional attribute inheritance
Homonimous variables shadowed by subclassing are ruled by the attribute shadowed.
The attribute support true, false, null values.
- If is true, only shadowed features will pass the filter.
- If is false (defeault), only non-shadowed features will pass the filter.
- If is null, any feature will pass the filter.
ChildContainer is an alias for ChildrenContainer
AttributeContainer is a shortcut of ChildrenContainer with attributes set to true, and all other basic filtering attributes set to false.
Same goes for all other children types.
Annotations and parameter filtering are not supported yet.