Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FreeForm

A class to create a new free form shape.

Hierarchy

Index

Constructors

constructor

Properties

fill

fill: string

Fill color of the shape.

holderSelection

holderSelection: Selection<SVGGElement, any, any, any>

D3 selection of the svg group defining the shape holder.

id

id: string

Id of the shape.

path

path: Point[]

List of point in the shape.

pathSelection

pathSelection: Selection<SVGPathElement, Point[], any, any>

D3 selection of the svg path representing this shape.

shapeSelection

shapeSelection: Selection<SVGGElement, any, any, any>

D3 selection of the svg group defining the shape.

stroke

stroke: string

Stroke color of the shape.

strokeWidth

strokeWidth: number

Stroke width of the shape.

translate

translate: object

Translate property of the shape

Type declaration

  • dx: number
  • dy: number

Methods

addPoint

  • addPoint(pt: Point): void

addToCanvas

  • addToCanvas(canvas: Canvas): void

getFill

  • getFill(): string

getStroke

  • getStroke(): string

getStrokeWidth

  • getStrokeWidth(): number

getTranslate

  • getTranslate(): object

isPicked

  • isPicked(pt: Point): boolean

removeFromCanvas

  • removeFromCanvas(canvas: Canvas): void

repaint

  • repaint(): void

select

  • select(peerId: string, color: string): void
  • Selects the shape for a peer.

    Parameters

    • peerId: string

      Peer that selected the shape.

    • color: string

      Color of the rectangle around the shape.

    Returns void

setFill

  • setFill(color: string): void

setPoints

  • setPoints(points: Point[]): void

setStroke

  • setStroke(color: string): void

setStrokeWidth

  • setStrokeWidth(width: number): void

setTranslate

  • setTranslate(translate: object): void

toJSON

  • toJSON(): any

translateBy

  • translateBy(dx: number, dy: number): void
  • Translates the shape by dx and dy.

    Parameters

    • dx: number

      X-axis translation value.

    • dy: number

      Y-axis translation value.

    Returns void

unselect

  • unselect(peerId: string): void

Static getSelectedShapes

  • getSelectedShapes(): Shape[]

Static getShape

  • getShape(d3Selection: Selection<any, any, any, any>): Shape
  • Gets the shape from a d3 selection.

    Parameters

    • d3Selection: Selection<any, any, any, any>

      D3 selection to get the shape from.

    Returns Shape

    shape

Static isShape

  • isShape(d3Selection: Selection<any, any, any, any>): boolean
  • Determines whether a D3 selection is a shape.

    Parameters

    • d3Selection: Selection<any, any, any, any>

      The selection to test.

    Returns boolean

    true if shape.

Generated using TypeDoc