Class Adornment

GoJS® Diagramming Components
version 3.0.2
by Northwoods Software®


An Adornment is a special kind of Part that is associated with another Part, the Adornment.adornedPart.

Adornments are normally associated with a particular GraphObject in the adorned Part -- that is the value of adornedObject. However, the adornedObject may be null, in which case the adornedPart will also be null.

The area occupied by the adorned object is represented in the Adornment's visual tree by a Placeholder. The placeholder is always the Part.locationObject, although you may specify any Spot as the Part.locationSpot. An adornment need not have a placeholder, but it may have at most one.

Adornments can be distinguished by their Part.category. This property can be an arbitrary string value determined by the code creating the adornment, typically a tool that wants to be able to tell various adornments apart from each other. Use the Part.findAdornment method to find an adornment for a part of a given category.

For example, one of the Adornments created by Part.updateAdornments when the part Part.isSelected has the Part.category of "Selection". Those created by ResizingTool.updateAdornments have a category of "Resize" and normally contain eight resize handles.

Besides the selection Adornment and tool Adornments, Adornments are also used for context menus and tooltips. The adornedObject in such cases refers to the GraphObject to which the the context menu or tooltip applies.

There cannot be any links connected to an Adornment, nor can an Adornment have members or be a member of a group.

An Adornment cannot have its own Adornments. An Adornment cannot be selected.

Adornments are not positioned by a Layout because they are normally positioned according to the Part that they adorn.

For more discussion and examples, see Selection, ToolTips, Context Menus, and Tools.



GraphObject.actionCancel GraphObject.actionDown GraphObject.actionMove GraphObject.actionUp GraphObject.actualBounds GraphObject.alignment GraphObject.alignmentFocus GraphObject.angle GraphObject.background GraphObject.column GraphObject.columnSpan GraphObject.contextClick GraphObject.contextMenu GraphObject.cursor GraphObject.desiredSize GraphObject.doubleClick GraphObject.enabledChanged GraphObject.fromEndSegmentLength GraphObject.fromLinkable GraphObject.fromLinkableDuplicates GraphObject.fromLinkableSelfNode GraphObject.fromMaxLinks GraphObject.fromShortLength GraphObject.fromSpot GraphObject.height GraphObject.isActionable GraphObject.isPanelMain GraphObject.margin GraphObject.maxSize GraphObject.measuredBounds GraphObject.minSize GraphObject.mouseDragEnter GraphObject.mouseDragLeave GraphObject.mouseDrop GraphObject.mouseEnter GraphObject.mouseHold GraphObject.mouseHover GraphObject.mouseLeave GraphObject.mouseOver GraphObject.naturalBounds GraphObject.opacity GraphObject.panel GraphObject.part GraphObject.pickable GraphObject.portId GraphObject.position GraphObject.row GraphObject.rowSpan GraphObject.scale GraphObject.segmentFraction GraphObject.segmentIndex GraphObject.segmentOffset GraphObject.segmentOrientation GraphObject.shadowVisible GraphObject.stretch GraphObject.toEndSegmentLength GraphObject.toLinkable GraphObject.toLinkableDuplicates GraphObject.toLinkableSelfNode GraphObject.toMaxLinks GraphObject.toShortLength GraphObject.toSpot GraphObject.toolTip GraphObject.visible GraphObject.width Panel.alignmentFocusName Panel.columnCount Panel.columnSizing Panel.defaultAlignment Panel.defaultColumnSeparatorDashArray Panel.defaultColumnSeparatorStroke Panel.defaultColumnSeparatorStrokeWidth Panel.defaultRowSeparatorDashArray Panel.defaultRowSeparatorStroke Panel.defaultRowSeparatorStrokeWidth Panel.defaultSeparatorPadding Panel.defaultStretch Panel.elements Panel.graduatedMax Panel.graduatedMin Panel.graduatedRange Panel.graduatedTickBase Panel.graduatedTickUnit Panel.gridCellSize Panel.gridOrigin Panel.isClipping Panel.isEnabled Panel.isOpposite Panel.itemArray Panel.itemCategoryProperty Panel.itemIndex Panel.itemTemplate Panel.itemTemplateMap Panel.leftIndex Panel.padding Panel.rowCount Panel.rowSizing Panel.topIndex Panel.type Panel.viewboxStretch Part.adornments Part.category Part.containingGroupChanged Part.copyable Part.deletable Part.diagram Part.dragComputation Part.groupable Part.highlightedChanged Part.isAnimated Part.isHighlighted Part.isInDocumentBounds Part.isLayoutPositioned Part.isSelected Part.isShadowed Part.isTopLevel Part.key Part.layer Part.layerChanged Part.layerName Part.layoutConditions Part.location Part.locationObject Part.locationObjectName Part.locationSpot Part.maxLocation Part.minLocation Part.movable Part.reshapable Part.resizable Part.resizeAdornmentTemplate Part.resizeCellSize Part.resizeObject Part.resizeObjectName Part.rotatable Part.rotateAdornmentTemplate Part.rotateObject Part.rotateObjectName Part.rotationSpot Part.selectable Part.selectionAdorned Part.selectionAdornmentTemplate Part.selectionChanged Part.selectionObject Part.selectionObjectName Part.shadowBlur Part.shadowColor Part.shadowOffset Part.text Part.textEditable Part.zOrder



  • Constructs an empty Adornment of the given type. Default type is Panel.Position. The panel type must be one of the PanelLayout static values (e.g. Panel.Position). The string value such as "Auto" may also be used.

    Usage example:

    // Constructs an Adornment, sets properties on it,
    // adds a data binding to it,
    // and adds two GraphObjects to the Adornment:
    const a = new go.Adornment("Auto", {
    margin: 5,
    background: "red"
    new go.Shape("RoundedRectangle")),
    new go.TextBlock("Some Text")


    • Optional type: string | PanelLayout

      a string or a PanelLayout, such as "Horizontal" or Panel.Vertical. If not supplied, the default Panel type is "Position".

    • Optional init: Partial<Adornment>

      Optional initialization properties.

    Returns Adornment

  • Constructs an empty Panel. Default type is Panel.Position.


    • Optional init: Partial<Adornment>

      Optional initialization properties.

    Returns Adornment


  • Gets or sets the GraphObject that is adorned. Setting this property updates the adorned object's Part by calling Part.addAdornment. This may be null if the Adornment does not adorn a particular object.

  • This read-only property returns the Part that contains the adorned object. This will be null if the adornedObject is null.

  • This read-only property returns a Placeholder that this Adornment may contain in its visual tree. This may be null if there is no such placeholder object in the visual tree of this Adornment.

    There may be at most one Placeholder in an Adornment. The Placeholder determines the Part.location for the Adornment, when it is visible. When there is a Placeholder, the Part.locationObjectName is ignored and the Part.locationObject will be this Placeholder.