Flow chart control GoJS category index and other decorations

gojs is a powerful, fast and lightweight flowchart control that can help you create flowcharts in JavaScript and HTML5 Canvas programs, and greatly simplify your JavaScript / Canvas programs.

Hierarchical structure
Adornment is a special Part, which is associated with another Part, namely Adornment.adornedPart.

Adornments are usually associated with a particular GraphObject in the decorated Part - this is the value of adornedObject. However, the adornedObject may be empty, in which case the adornedPart will also be empty.

The area occupied by adornedObject is represented by a placeholder in the visual tree of Adornment. The placeholder is always Part.locationObject, although you can specify any Spot as Part.locationSpot. An ornament does not need to have a placeholder, but it can have at most one.

Decorations can be distinguished by their Part.category. This attribute can be an arbitrary string value, determined by the code that creates the decoration, and is usually a tool that hopes to be able to distinguish between different decorations. Use the Part.findAdornment method to find an adornment for a certain part of a given category.

For example, when the Part. category of the part Part.isSelected is "Selection", one of the Adornments created by Part.updateAdornments. The category of Adornments created by ResizingTool.updateAdornments is "Resize", which usually contains 8 handles for resizing.

In addition to selecting Adornment and tool Adornments, Adornments are also used for context menus and tool tips. In this case, AdornedObject refers to the GraphObject to which the context menu or tooltip is applied.

There can be no links to Adornment, and Adornment cannot have members or become members of a group.

An ornament cannot have its own ornament. An ornament cannot be selected.

Decorations cannot be positioned by layout, because they are usually positioned according to the part they decorate.

For more discussion and examples, see Selection, Tool Tips, Context Menu and Tools.



new Adornment(type?: PanelLayout)。Adornment(type?: PanelLayout): adornment


Optional type: PanelLayout

If not provided, the default panel type is Panel.Position.

Returns Adornment

adornedObject : GraphObject | null

Gets or set the GraphObject that is adorned. Setting this property will update the Part of the decorated object by calling Part.addAdornment. If the decoration does not decorate a specific object, this attribute may be empty.

Read-only adornedPart : Part | null

This read-only property returns the Part containing the adorned object. If the adornedObject is empty, the attribute is empty.

Read-only placeholder : Placeholder | null

This read-only attribute returns the placeholders that this Adornment can include in its visual tree. If there is no such placeholder object, this attribute may be empty.

Guess you like

Origin blog.51cto.com/15078157/2665715