GeezerVison is showing maxgraph.github.io — ActorShape | @maxgraph/core
Constructors
constructor
-
new ActorShape( bounds?: Rectangle | null, fill?: string, stroke?: string, strokeWidth?: number,): ActorShape
The renderer never uses this signature: CellRenderer.createShape instantiates a registered shape with
new shapeConstructor(), then populates it from the cell style. It only applies to a shape built by hand.
Parameters
- bounds: Rectangle | null = null
- fill: string = NONE
- stroke: string = NONE
- strokeWidth: number = 1
Returns ActorShape
Properties
antiAlias
antiAlias: boolean = true
Rendering hint for configuring the canvas.
boundingBox
Contains the bounding box of the shape, that is, the smallest rectangle
that includes all pixels of the shape.
bounds
Holds the Rectangle that specifies the bounds of this shape.
cursor
cursor: string = ''
dialect
Holds the dialect in which the shape is to be painted.
endArrow
endArrow: string = NONE
endSize
endSize: number = 1
fillOpacity
fillOpacity: number = 100
flipH
flipH: boolean = false
flipV
flipV: boolean = false
glass
glass: boolean = false
gradient
gradient: string = NONE
imageSrc
imageSrc: string | null = null
indicator
indicator: Shape | null = null
indicatorColor
indicatorColor: string = NONE
indicatorGradientColor
indicatorGradientColor: string = NONE
indicatorImageSrc
indicatorImageSrc: string | null = null
indicatorShape
indicatorShape: typeof Shape | null = null
indicatorStrokeColor
indicatorStrokeColor: string = NONE
isDashed
isDashed: boolean = false
isRounded
isRounded: boolean = false
isShadow
isShadow: boolean = false
minSvgStrokeWidth
minSvgStrokeWidth: number = 1
Minimum stroke width for SVG output.
node
node: SVGGElement
Holds the outermost DOM node that represents this shape.
opacity
opacity: number = 100
originalPointerEvents
originalPointerEvents: boolean | null = null
outline
outline: boolean = false
Specifies if the shape should be drawn as an outline. This disables all
fill colors and can be used to disable other drawing states that should
not be painted for outlines. Default is false. This should be set before
calling .
pointerEvents
pointerEvents: boolean = true
Specifies if pointer events should be handled. Default is true.
points
points: (
Point | null)
[] = []
Holds the array of that specify the points of this shape.
preserveImageAspect
preserveImageAspect: boolean = false
Switch to preserve image aspect.
rotation
rotation: number = 0
scale
scale: number = 1
Holds the scale in which the shape is being painted.
shapePointerEvents
shapePointerEvents: boolean = false
Specifies if pointer events outside of shape should be handled. Default
is false.
spacing
spacing: number = 0
startArrow
startArrow: string = NONE
startSize
startSize: number = 1
state
Optional reference to the corresponding .
stencilPointerEvents
stencilPointerEvents: boolean = false
Specifies if pointer events outside of stencils should be handled. Default
is false. Set this to true for backwards compatibility with the 1.x branch.
stroke
stroke: string = NONE
strokeOpacity
strokeOpacity: number = 100
strokeWidth
strokeWidth: number = 1
style
Optional reference to the style of the corresponding .
svgPointerEvents
svgPointerEvents: string = 'all'
Specifies if pointer events should be handled. Default is true.
svgStrokeTolerance
svgStrokeTolerance: number = 8
useSvgBoundingBox
useSvgBoundingBox: boolean = true
Allows to use the SVG bounding box in SVG. Default is false for performance
reasons.
verticalTextRotation
verticalTextRotation: number = 0
visible
visible: boolean = true
Specifies if the shape is visible. Default is true.
Methods
addPoints
-
addPoints( c: AbstractCanvas2D, pts: Point[], rounded?: boolean, arcSize: number, close?: boolean, exclude?: number[], initialMove?: boolean,): void
Paints the given points with rounded corners.
Parameters
- c: AbstractCanvas2D
- pts: Point[]
- rounded: boolean = false
- arcSize: number
- close: boolean = false
- exclude: number[] = []
- initialMove: boolean = true
Returns void
afterPaint
-
Invokes after paint was called.
Returns void
apply
-
Applies the style of the given to the shape. This
implementation assigns the following styles to local fields:
- <'fillColor'> => fill
- <'gradientColor'> => gradient
- <'gradientDirection'> => gradientDirection
- <'opacity'> => opacity
- Constants#STYLE_FILL_OPACITY => fillOpacity
- Constants#STYLE_STROKE_OPACITY => strokeOpacity
- <'strokeColor'> => stroke
- <'strokeWidth'> => strokewidth
- <'shadow'> => isShadow
- <'dashed'> => isDashed
- <'spacing'> => spacing
- <'startSize'> => startSize
- <'endSize'> => endSize
- <'rounded'> => isRounded
- <'startArrow'> => startArrow
- <'endArrow'> => endArrow
- <'rotation'> => rotation
- <'direction'> => direction
- <'glass'> => glass
This keeps a reference to the