iink-ts - v5.0.0
    Preparing search index...

    Class EdgeUtil

    Hierarchy (View Summary)

    Index
    • Parameters

      Returns edge is TEdgeArc

      True if the edge is an arc

    • Parameters

      Returns symbol is TEdge

      True if symbol is an edge

    • Moves, turns or scales this symbol by composing the matrix onto the one it already carries.

      One implementation for every type, where there used to be one per type per operation. A symbol's coordinates are not touched: the matrix is the whole of what a transform changes, so there is no per-type geometry to update and nothing derived left to refresh.

      Override only for a type whose transform is not affine — DecoratorUtil overrides it to a no-op because a decorator follows its targets rather than moving on its own.

      Parameters

      Returns void

    • Parameters

      • center: TPoint
      • startAngle: number
      • sweepAngle: number
      • radiusX: number
      • radiusY: number
      • phi: number
      • OptionalstartDecoration: Arrow
      • OptionalendDecoration: Arrow
      • Optionalstyle: {
            color?: string;
            fill?: string;
            opacity?: number;
            pen?: TPenNib;
            penAngle?: number;
            penSmoothing?: number;
            penSpeed?: number;
            width?: number;
            [key: string]: string | number | undefined;
        }

      Returns TEdgeArc

    • Parameters

      • partial: {
            center?: { x?: number; y?: number };
            creationTime?: number;
            endAnchor?: {
                entryPoint?: { x?: number; y?: number };
                normalizedX?: number;
                normalizedY?: number;
                symbolId?: string;
            };
            endDecoration?: Arrow;
            id?: string;
            kind?: Arc;
            modificationDate?: number;
            phi?: number;
            radiusX?: number;
            radiusY?: number;
            startAnchor?: {
                entryPoint?: { x?: number; y?: number };
                normalizedX?: number;
                normalizedY?: number;
                symbolId?: string;
            };
            startAngle?: number;
            startDecoration?: Arrow;
            style?: {
                color?: string;
                fill?: string;
                opacity?: number;
                pen?: TPenNib;
                penAngle?: number;
                penSmoothing?: number;
                penSpeed?: number;
                width?: number;
                [key: string]: string
                | number
                | undefined;
            };
            sweepAngle?: number;
            transform?: {
                tx?: number;
                ty?: number;
                xx?: number;
                xy?: number;
                yx?: number;
                yy?: number;
            };
            type?: Edge;
        }
        • Optionalcenter?: { x?: number; y?: number }
        • OptionalcreationTime?: number
        • OptionalendAnchor?: {
              entryPoint?: { x?: number; y?: number };
              normalizedX?: number;
              normalizedY?: number;
              symbolId?: string;
          }
          • OptionalentryPoint?: { x?: number; y?: number }

            Intersection of the edge with the shape border, in world coordinates.

          • OptionalnormalizedX?: number
          • OptionalnormalizedY?: number
          • OptionalsymbolId?: string
        • OptionalendDecoration?: Arrow
        • Optionalid?: string
        • Optionalkind?: Arc
        • OptionalmodificationDate?: number
        • Optionalphi?: number
        • OptionalradiusX?: number
        • OptionalradiusY?: number
        • OptionalstartAnchor?: {
              entryPoint?: { x?: number; y?: number };
              normalizedX?: number;
              normalizedY?: number;
              symbolId?: string;
          }
          • OptionalentryPoint?: { x?: number; y?: number }

            Intersection of the edge with the shape border, in world coordinates.

          • OptionalnormalizedX?: number
          • OptionalnormalizedY?: number
          • OptionalsymbolId?: string
        • OptionalstartAngle?: number
        • OptionalstartDecoration?: Arrow
        • Optionalstyle?: {
              color?: string;
              fill?: string;
              opacity?: number;
              pen?: TPenNib;
              penAngle?: number;
              penSmoothing?: number;
              penSpeed?: number;
              width?: number;
              [key: string]: string | number | undefined;
          }
        • OptionalsweepAngle?: number
        • Optionaltransform?: { tx?: number; ty?: number; xx?: number; xy?: number; yx?: number; yy?: number }

          Where this symbol sits, relative to the coordinates it stores.

          A transform writes here and nowhere else: the raw coordinates are what the symbol was created with and never move again. That is what lets the renderer apply a change by rewriting one attribute instead of rebuilding the element, and what keeps undo exact — re-applying an inverse matrix restores the value bit for bit, where re-transforming coordinates accumulated rounding.

          • Optionaltx?: number

            translation x

          • Optionalty?: number

            translation y

          • Optionalxx?: number

            scaling x

          • Optionalxy?: number

            shearing y

          • Optionalyx?: number

            shearing x

          • Optionalyy?: number

            scaling y

        • Optionaltype?: Edge

      Returns TEdgeArc

    • Parameters

      • start: TPoint
      • end: TPoint
      • OptionalstartDecoration: Arrow
      • OptionalendDecoration: Arrow
      • Optionalstyle: {
            color?: string;
            fill?: string;
            opacity?: number;
            pen?: TPenNib;
            penAngle?: number;
            penSmoothing?: number;
            penSpeed?: number;
            width?: number;
            [key: string]: string | number | undefined;
        }

      Returns TEdgeLine

    • Parameters

      • partial: {
            creationTime?: number;
            end?: { x?: number; y?: number };
            endAnchor?: {
                entryPoint?: { x?: number; y?: number };
                normalizedX?: number;
                normalizedY?: number;
                symbolId?: string;
            };
            endDecoration?: Arrow;
            id?: string;
            kind?: Line;
            modificationDate?: number;
            start?: { x?: number; y?: number };
            startAnchor?: {
                entryPoint?: { x?: number; y?: number };
                normalizedX?: number;
                normalizedY?: number;
                symbolId?: string;
            };
            startDecoration?: Arrow;
            style?: {
                color?: string;
                fill?: string;
                opacity?: number;
                pen?: TPenNib;
                penAngle?: number;
                penSmoothing?: number;
                penSpeed?: number;
                width?: number;
                [key: string]: string
                | number
                | undefined;
            };
            transform?: {
                tx?: number;
                ty?: number;
                xx?: number;
                xy?: number;
                yx?: number;
                yy?: number;
            };
            type?: Edge;
        }
        • OptionalcreationTime?: number
        • Optionalend?: { x?: number; y?: number }
        • OptionalendAnchor?: {
              entryPoint?: { x?: number; y?: number };
              normalizedX?: number;
              normalizedY?: number;
              symbolId?: string;
          }
          • OptionalentryPoint?: { x?: number; y?: number }

            Intersection of the edge with the shape border, in world coordinates.

          • OptionalnormalizedX?: number
          • OptionalnormalizedY?: number
          • OptionalsymbolId?: string
        • OptionalendDecoration?: Arrow
        • Optionalid?: string
        • Optionalkind?: Line
        • OptionalmodificationDate?: number
        • Optionalstart?: { x?: number; y?: number }
        • OptionalstartAnchor?: {
              entryPoint?: { x?: number; y?: number };
              normalizedX?: number;
              normalizedY?: number;
              symbolId?: string;
          }
          • OptionalentryPoint?: { x?: number; y?: number }

            Intersection of the edge with the shape border, in world coordinates.

          • OptionalnormalizedX?: number
          • OptionalnormalizedY?: number
          • OptionalsymbolId?: string
        • OptionalstartDecoration?: Arrow
        • Optionalstyle?: {
              color?: string;
              fill?: string;
              opacity?: number;
              pen?: TPenNib;
              penAngle?: number;
              penSmoothing?: number;
              penSpeed?: number;
              width?: number;
              [key: string]: string | number | undefined;
          }
        • Optionaltransform?: { tx?: number; ty?: number; xx?: number; xy?: number; yx?: number; yy?: number }

          Where this symbol sits, relative to the coordinates it stores.

          A transform writes here and nowhere else: the raw coordinates are what the symbol was created with and never move again. That is what lets the renderer apply a change by rewriting one attribute instead of rebuilding the element, and what keeps undo exact — re-applying an inverse matrix restores the value bit for bit, where re-transforming coordinates accumulated rounding.

          • Optionaltx?: number

            translation x

          • Optionalty?: number

            translation y

          • Optionalxx?: number

            scaling x

          • Optionalxy?: number

            shearing y

          • Optionalyx?: number

            shearing x

          • Optionalyy?: number

            scaling y

        • Optionaltype?: Edge

      Returns TEdgeLine

    • Parameters

      • points: TPoint[]
      • OptionalstartDecoration: Arrow
      • OptionalendDecoration: Arrow
      • Optionalstyle: {
            color?: string;
            fill?: string;
            opacity?: number;
            pen?: TPenNib;
            penAngle?: number;
            penSmoothing?: number;
            penSpeed?: number;
            width?: number;
            [key: string]: string | number | undefined;
        }

      Returns TEdgePolyLine

    • Parameters

      • partial: {
            creationTime?: number;
            endAnchor?: {
                entryPoint?: { x?: number; y?: number };
                normalizedX?: number;
                normalizedY?: number;
                symbolId?: string;
            };
            endDecoration?: Arrow;
            id?: string;
            kind?: PolyEdge;
            modificationDate?: number;
            points?: ({ x?: number; y?: number } | undefined)[];
            startAnchor?: {
                entryPoint?: { x?: number; y?: number };
                normalizedX?: number;
                normalizedY?: number;
                symbolId?: string;
            };
            startDecoration?: Arrow;
            style?: {
                color?: string;
                fill?: string;
                opacity?: number;
                pen?: TPenNib;
                penAngle?: number;
                penSmoothing?: number;
                penSpeed?: number;
                width?: number;
                [key: string]: string
                | number
                | undefined;
            };
            transform?: {
                tx?: number;
                ty?: number;
                xx?: number;
                xy?: number;
                yx?: number;
                yy?: number;
            };
            type?: Edge;
        }
        • OptionalcreationTime?: number
        • OptionalendAnchor?: {
              entryPoint?: { x?: number; y?: number };
              normalizedX?: number;
              normalizedY?: number;
              symbolId?: string;
          }
          • OptionalentryPoint?: { x?: number; y?: number }

            Intersection of the edge with the shape border, in world coordinates.

          • OptionalnormalizedX?: number
          • OptionalnormalizedY?: number
          • OptionalsymbolId?: string
        • OptionalendDecoration?: Arrow
        • Optionalid?: string
        • Optionalkind?: PolyEdge
        • OptionalmodificationDate?: number
        • Optionalpoints?: ({ x?: number; y?: number } | undefined)[]
        • OptionalstartAnchor?: {
              entryPoint?: { x?: number; y?: number };
              normalizedX?: number;
              normalizedY?: number;
              symbolId?: string;
          }
          • OptionalentryPoint?: { x?: number; y?: number }

            Intersection of the edge with the shape border, in world coordinates.

          • OptionalnormalizedX?: number
          • OptionalnormalizedY?: number
          • OptionalsymbolId?: string
        • OptionalstartDecoration?: Arrow
        • Optionalstyle?: {
              color?: string;
              fill?: string;
              opacity?: number;
              pen?: TPenNib;
              penAngle?: number;
              penSmoothing?: number;
              penSpeed?: number;
              width?: number;
              [key: string]: string | number | undefined;
          }
        • Optionaltransform?: { tx?: number; ty?: number; xx?: number; xy?: number; yx?: number; yy?: number }

          Where this symbol sits, relative to the coordinates it stores.

          A transform writes here and nowhere else: the raw coordinates are what the symbol was created with and never move again. That is what lets the renderer apply a change by rewriting one attribute instead of rebuilding the element, and what keeps undo exact — re-applying an inverse matrix restores the value bit for bit, where re-transforming coordinates accumulated rounding.

          • Optionaltx?: number

            translation x

          • Optionalty?: number

            translation y

          • Optionalxx?: number

            scaling x

          • Optionalxy?: number

            shearing y

          • Optionalyx?: number

            shearing x

          • Optionalyy?: number

            scaling y

        • Optionaltype?: Edge

      Returns TEdgePolyLine

    • Parameters

      Returns string

    • Parameters

      Returns TPoint[]

    • An unregistered kind gets an empty path: no vertices, no edges, an empty box at the origin, and so no overlap with anything — the same answer the record fallback gave.

      Parameters

      Returns Geometry2d

    • Which of the three kinds it is, on top of what every symbol's group carries.

      Parameters

      Returns Record<string, string>

    • Parameters

      Returns string

    • Stroked on no fill — a line encloses nothing — plus whichever arrow heads it carries.

      Parameters

      Returns Record<string, string>

    • The d of the path this symbol draws.

      Separate from PathSymbolUtil.getPathAttributes because it is the one part no default can supply and the one part a new type always has to write: d is the shape as drawn.

      Parameters

      Returns string

    • Parameters

      Returns string

    • A polyline's vertices are the points it stores, returned as-is.

      Named rather than inlined so every caller goes through one place: getGeometry, getResizePoints and the edge-kind table all used to reach for the stored vertices field.

      Parameters

      Returns TPoint[]

    • Computed raw, from the table, same as always — then carried through the matrix like any other point a util hands back. A resize handle drawn straight from these has to land where the edge is actually drawn, not where it was before its last translate/rotate/resize.

      Parameters

      Returns TResizePoint[]

    • Kind by kind, then carried through the matrix — an edge snaps on its own vertices, not on the corners of a box it never drew.

      Parameters

      Returns TPoint[]

    • The element that draws this symbol.

      Required rather than optional: a symbol nothing can draw is a symbol the canvas cannot show, and when this was optional a custom util that omitted it registered successfully and then silently rendered nothing. Return undefined only for a state deliberately left undrawn — the decorator does that for a kind it does not own.

      Honoured by the SVG renderer, which InteractiveInkCanvas, InkCanvas and InteractiveInkSSRCanvas all use. InkCanvasDeprecated (INK_V1) ignores it: it draws through CanvasRenderer, which dispatches on isStroke and two fixed renderer tables instead of asking the registry, so a registered custom symbol is invisible there and logs "symbol type unknown". That variant is deprecated and not worth wiring up.

      Parameters

      Returns SVGGraphicsElement

    • Parameters

      Returns string

    • Whether a resize of this symbol must preserve its aspect ratio.

      False by default. IIResizeManager decided this with isText(s) || isMath(s) || (isShape(s) && isCircleShape(s)), which is a question about a symbol asked from outside it — so a custom symbol could never require a locked ratio, however badly a free scale would distort it.

      Parameters

      Returns boolean

    • points, carried through symbol.transform the same way a transform manager moves the symbol itself — used by getSnapPoints/getResizePoints overrides, which compute in the symbol's raw frame and hand the result through this once, forward, rather than every symbol type mapping its own points individually.

      Forward, and exact: a point maps to a point however the matrix turns or scales, so points are already the symbol's own geometry, and mapping a point through a matrix is always exact, however that matrix turns or scales.

      Parameters

      Returns TPoint[]

    • Moves the vertex a resize handle owns, by writing into the geometry the line actually stores.

      A line's vertices are its start and end, and computeVertices returns those very objects — so the drag handler used to mutate line.vertices[i] and reach them by aliasing. That worked only as long as the array was stored and shared; a computed one would take the write and throw it away, silently. This says which field a handle owns instead of relying on that.

      Parameters

      Returns void

    • Moves the vertex a resize handle owns, by writing into the geometry the polyline stores.

      A polyline's vertices are its points, so the drag handler used to reach them by aliasing through the stored array. See EdgeUtil.moveLineVertex for why that is no longer relied on.

      Parameters

      Returns void

    • Whether a query box touches this symbol — the question selection and erasing both ask.

      Answered by the shape getGeometry returns, so a type describes what it is once and inherits this. Every built-in used to write the same one line here. Override it only for a type whose hit test is not a question about its outline.

      Parameters

      Returns boolean

    • Moves this symbol by a matrix.

      Concrete rather than abstract: every built-in type composes the matrix the same way, through applyTransform, and none of the six overrides this. A custom util only needs its own body if it stores something a matrix cannot express.

      Parameters

      Returns void

    type: Edge = SymbolType.Edge