GoJS API
/ to search
    Preparing search index...

    Class LinkLabelOnPathDraggingTool

    This is an extension and not part of the main GoJS library. Note that the API for this class may change at any time. If you intend to use an extension in production, you should copy the code to your own source directory. See the Extensions intro page for more information.

    The LinkLabelOnPathDraggingTool class lets the user move a label on a go.Link while keeping the label on the link's path. This tool only works when the Link has a label marked by the "_isLinkLabel" property.

    If you want to experiment with this extension, try the Link Label On Path Dragging sample.

    Hierarchy

    • unknown
      • LinkLabelOnPathDraggingTool
    Index

    Constructors

    Methods

    • This tool can only start if the mouse has moved enough so that it is not a click, and if the mouse down point is on a GraphObject "label" in a Link Panel, as determined by findLabel.

      Returns boolean

    • Start a transaction, call findLabel and remember it as the "label" property, and remember the original values for the label's segment properties.

      Returns void

    • Restore the label's original value for GraphObject.segment... properties.

      Returns void

    • Stop any ongoing transaction.

      Returns void

    • During the drag, call updateSegmentOffset in order to set the segment... properties of the label.

      Returns void

    • At the end of the drag, update the segment properties of the label and finish the tool, completing a transaction.

      Returns void

    • Clear any reference to a label element.

      Returns void

    • From the GraphObject at the mouse point, search up the visual tree until we get to an object that has the "_isLinkLabel" property set to true and that is an immediate child of a Link Panel.

      Returns any

      This returns null if no such label is at the mouse down point.

    • Save the label's go.GraphObject.segmentFraction at the closest point to the mouse.

      Returns void

    Properties

    label: any

    The label being dragged.