GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • @maxgraph/core

This view

  • Original page
  • New address

GeezerVison is showing maxgraph.github.io — TextShape | @maxgraph/core

  • TextShape

Class TextShape

Extends Shape to implement a text shape.

This shape is NOT registered in ShapeRegistry when using Graph or calling registerDefaultShapes. It is the label shape: it is created by CellRenderer.createLabel and stored in CellState.text, next to the shape of the cell itself. It is not usable as a value of the shape style, because shapes coming from ShapeRegistry are constructed without any argument whereas this one requires a value and bounds, and because getTextRotation would then recurse endlessly on its own state.

Rotation of vertical labels

The rotation applied to a vertical label (a cell whose horizontal style is false) does not come from this shape. getTextRotation delegates to the shape of the cell, CellState.shape, so the verticalTextRotation declared here is never read while the label belongs to a cell state. To change vertical text from "bottom to top" (the -90 degrees default) to "top to bottom", set Shape.verticalTextRotation on the shape of the cell. No global configuration object covers it, so the change goes through a CellRenderer subclass:

import { CellRenderer, Graph } from '@maxgraph/core';
import type { CellState, Shape } from '@maxgraph/core';

class TopToBottomCellRenderer extends CellRenderer {
override createShape(state: CellState): Shape {
const shape = super.createShape(state);
shape.verticalTextRotation = 90;
return shape;
}
}

class TopToBottomGraph extends Graph {
override createCellRenderer(): CellRenderer {
return new TopToBottomCellRenderer();
}
}

BaseGraph takes the renderer as a collaborator instead of a factory method: new BaseGraph({ container, cellRenderer: new TopToBottomCellRenderer() }).

Beware that 0 does not mean "no extra rotation": Shape.getTextRotation computes this.verticalTextRotation || -90, so a value of 0 falls back to -90 degrees.

Hierarchy (View Summary)

  • Shape
    • TextShape
  • Defined in view/shape/node/TextShape.ts:98
Index

Constructors

constructor

Properties

align antiAlias background baseSpacingBottom baseSpacingLeft baseSpacingRight baseSpacingTop border boundingBox bounds cacheEnabled clipped color cursor dialect direction endArrow endSize family fill fillOpacity flipH flipV fontStyle glass gradient gradientDirection horizontal ignoreClippedStringSize ignoreStringSize image imageSrc indicator indicatorColor indicatorDirection indicatorGradientColor indicatorImageSrc indicatorShape indicatorStrokeColor isDashed isRounded isShadow labelPadding lastValue margin minSvgStrokeWidth node oldGradients opacity originalPointerEvents outline overflow overlay pointerEvents points preserveImageAspect replaceLinefeeds rotation scale shapePointerEvents size spacing spacingBottom spacingLeft spacingRight spacingTop startArrow startSize state stencil stencilPointerEvents stroke strokeOpacity strokeWidth style svgPointerEvents svgStrokeTolerance textDirection unrotatedBoundingBox useSvgBoundingBox valign value verticalTextRotation visible wrap

Methods

addPoints afterPaint apply augmentBoundingBox beforePaint checkBounds clear configureCanvas create createBoundingBox createCanvas createSvgCanvas createTransparentSvgRectangle destroy destroyCanvas getArcSize getAutoDirection getBaseArcSize getContentNode getCursor getGradientBounds getHtmlValue getLabelBounds getLabelMargins getRotation getShapeRotation getSpacing getSvgScreenOffset getTextCss getTextRotation init initStyles isHtmlAllowed isPaintBoundsInverted isRoundable paint paintBackground paintEdgeShape paintForeground paintGlassEffect paintVertexShape redraw redrawHtmlShape redrawShape releaseSvgGradients resetStyles setCursor setTransparentBackgroundImage updateBoundingBox updateBoundsFromPoints updateFont updateInnerHtml updateMargin updateSize updateTransform updateValue

Constructors

constructor

  • new TextShape(
        value: string | HTMLElement | SVGGElement,
        bounds: Rectangle,
        align?: AlignValue,
        valign?: VAlignValue,
        color?: string,
        family?: string,
        size?: number,
        fontStyle?: number,
        spacing?: number,
        spacingTop?: number,
        spacingRight?: number,
        spacingBottom?: number,
        spacingLeft?: number,
        horizontal?: boolean,
        background?: string,
        border?: string,
        wrap?: boolean,
        clipped?: boolean,
        overflow?: OverflowValue,
        labelPadding?: number,
        textDirection?: TextDirectionValue,
    ): TextShape

    Parameters

    • value: string | HTMLElement | SVGGElement
    • bounds: Rectangle
    • align: AlignValue = 'center'
    • valign: VAlignValue = 'middle'
    • color: string = 'black'
    • family: string = StyleDefaultsConfig.fontFamily
    • size: number = StyleDefaultsConfig.fontSize
    • fontStyle: number = DEFAULT_FONTSTYLE
    • spacing: number = 2
    • spacingTop: number = 0
    • spacingRight: number = 0
    • spacingBottom: number = 0
    • spacingLeft: number = 0
    • horizontal: boolean = true
    • background: string = NONE
    • border: string = NONE
    • wrap: boolean = false
    • clipped: boolean = false
    • overflow: OverflowValue = 'visible'
    • labelPadding: number = 0
    • textDirection: TextDirectionValue = DEFAULT_TEXT_DIRECTION

    Returns TextShape

    Overrides Shape.constructor

    • Defined in view/shape/node/TextShape.ts:99

Properties

align

align: AlignValue
  • Defined in view/shape/node/TextShape.ts:152

antiAlias

antiAlias: boolean = true

Rendering hint for configuring the canvas.

Inherited from Shape.antiAlias

  • Defined in view/shape/Shape.ts:187

background

background: string
  • Defined in view/shape/node/TextShape.ts:164

baseSpacingBottom

baseSpacingBottom: number = 0

Specifies the spacing to be added to the bottom spacing. Default is 0. Use the value 1 here to get the same label positions as in mxGraph 1.x.

  • Defined in view/shape/node/TextShape.ts:186

baseSpacingLeft

baseSpacingLeft: number = 0

Specifies the spacing to be added to the left spacing. Default is 0.

  • Defined in view/shape/node/TextShape.ts:191

baseSpacingRight

baseSpacingRight: number = 0

Specifies the spacing to be added to the right spacing. Default is 0.

  • Defined in view/shape/node/TextShape.ts:196

baseSpacingTop

baseSpacingTop: number = 0

Specifies the spacing to be added to the top spacing. Default is 0. Use the value 5 here to get the same label positions as in mxGraph 1.x.

  • Defined in view/shape/node/TextShape.ts:180

border

border: string
  • Defined in view/shape/node/TextShape.ts:165

boundingBox

boundingBox: Rectangle | null = null

Contains the bounding box of the shape, that is, the smallest rectangle that includes all pixels of the shape.

Inherited from Shape.boundingBox

  • Defined in view/shape/Shape.ts:223

bounds

bounds: Rectangle

Holds the Rectangle that specifies the bounds of this shape.

Overrides Shape.bounds

  • Defined in view/shape/node/TextShape.ts:151

cacheEnabled

cacheEnabled: boolean = true

Specifies if caching for HTML labels should be enabled. Default is true.

  • Defined in view/shape/node/TextShape.ts:236

clipped

clipped: boolean
  • Defined in view/shape/node/TextShape.ts:167

color

color: string
  • Defined in view/shape/node/TextShape.ts:154

cursor

cursor: string = ''

Inherited from Shape.cursor

  • Defined in view/shape/Shape.ts:166

dialect

dialect: DialectValue | null = null

Holds the dialect in which the shape is to be painted.

Inherited from Shape.dialect

  • Defined in view/shape/Shape.ts:177

direction

direction: DirectionValue = 'east'

Inherited from Shape.direction

  • Defined in view/shape/Shape.ts:154

endArrow

endArrow: string = NONE

Inherited from Shape.endArrow

  • Defined in view/shape/Shape.ts:152

endSize

endSize: number = 1

Inherited from Shape.endSize

  • Defined in view/shape/Shape.ts:148

family

family: string
  • Defined in view/shape/node/TextShape.ts:155

fill

fill: string = NONE

Inherited from Shape.fill

  • Defined in view/shape/Shape.ts:130

fillOpacity

fillOpacity: number = 100

Inherited from Shape.fillOpacity

  • Defined in view/shape/Shape.ts:136

flipH

flipH: boolean = false

Overrides Shape.flipH

  • Defined in view/shape/node/TextShape.ts:173

flipV

flipV: boolean = false

Overrides Shape.flipV

  • Defined in view/shape/node/TextShape.ts:174

fontStyle

fontStyle: number
  • Defined in view/shape/node/TextShape.ts:157

glass

glass: boolean = false

Inherited from Shape.glass

  • Defined in view/shape/Shape.ts:172

gradient

gradient: string = NONE

Inherited from Shape.gradient

  • Defined in view/shape/Shape.ts:132

gradientDirection

gradientDirection: DirectionValue = 'east'

Inherited from Shape.gradientDirection

  • Defined in view/shape/Shape.ts:134

horizontal

horizontal: boolean
  • Defined in view/shape/node/TextShape.ts:163

ignoreClippedStringSize

ignoreClippedStringSize: boolean = true

Specifies if the string size should be measured in if the label is clipped and the label position is center and middle. If this is true, then the bounding box will be set to . Default is true. has precedence over this switch.

  • Defined in view/shape/node/TextShape.ts:219

ignoreStringSize

ignoreStringSize: boolean = false

Specifies if the actual string size should be measured. If disabled the boundingBox will not ignore the actual size of the string, otherwise will be used instead. Default is false.

  • Defined in view/shape/node/TextShape.ts:226

image

image: ImageBox | null = null

Inherited from Shape.image

  • Defined in view/shape/Shape.ts:280

imageSrc

imageSrc: string | null = null

Inherited from Shape.imageSrc

  • Defined in view/shape/Shape.ts:282

indicator

indicator: Shape | null = null

Inherited from Shape.indicator

  • Defined in view/shape/Shape.ts:123

indicatorColor

indicatorColor: string = NONE

Inherited from Shape.indicatorColor

  • Defined in view/shape/Shape.ts:284

indicatorDirection

indicatorDirection: DirectionValue = 'east'

Inherited from Shape.indicatorDirection

  • Defined in view/shape/Shape.ts:290

indicatorGradientColor

indicatorGradientColor: string = NONE

Inherited from Shape.indicatorGradientColor

  • Defined in view/shape/Shape.ts:288

indicatorImageSrc

indicatorImageSrc: string | null = null

Inherited from Shape.indicatorImageSrc

  • Defined in view/shape/Shape.ts:292

indicatorShape

indicatorShape: typeof Shape | null = null

Inherited from Shape.indicatorShape

  • Defined in view/shape/Shape.ts:124

indicatorStrokeColor

indicatorStrokeColor: string = NONE

Inherited from Shape.indicatorStrokeColor

  • Defined in view/shape/Shape.ts:286

isDashed

isDashed: boolean = false

Inherited from Shape.isDashed

  • Defined in view/shape/Shape.ts:128

isRounded

isRounded: boolean = false

Inherited from Shape.isRounded

  • Defined in view/shape/Shape.ts:162

isShadow

isShadow: boolean = false

Inherited from Shape.isShadow

  • Defined in view/shape/Shape.ts:160

labelPadding

labelPadding: number
  • Defined in view/shape/node/TextShape.ts:169

lastValue

lastValue: string | HTMLElement | SVGGElement | null = null

Contains the last rendered text value. Used for caching.

  • Defined in view/shape/node/TextShape.ts:231

margin

margin: Point | null = null
  • Defined in view/shape/node/TextShape.ts:171

minSvgStrokeWidth

minSvgStrokeWidth: number = 1

Minimum stroke width for SVG output.

Inherited from Shape.minSvgStrokeWidth

  • Defined in view/shape/Shape.ts:192

node

node: SVGGElement

Holds the outermost DOM node that represents this shape.

Inherited from Shape.node

  • Defined in view/shape/Shape.ts:207

oldGradients

oldGradients: GradientMap = {}

Inherited from Shape.oldGradients

  • Defined in view/shape/Shape.ts:170

opacity

opacity: number = 100

See

CellHighlight

Inherited from Shape.opacity

  • Defined in view/shape/Shape.ts:127

originalPointerEvents

originalPointerEvents: boolean | null = null

Inherited from Shape.originalPointerEvents

  • Defined in view/shape/Shape.ts:242

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 .

Inherited from Shape.outline

  • Defined in view/shape/Shape.ts:267

overflow

overflow: OverflowValue
  • Defined in view/shape/node/TextShape.ts:168

overlay

overlay: CellOverlay | null = null

Inherited from Shape.overlay

  • Defined in view/shape/Shape.ts:122

pointerEvents

pointerEvents: boolean = true

Specifies if pointer events should be handled. Default is true.

Inherited from Shape.pointerEvents

  • Defined in view/shape/Shape.ts:240

points

points: (Point | null)[] = []

Holds the array of that specify the points of this shape.

Inherited from Shape.points

  • Defined in view/shape/Shape.ts:202

preserveImageAspect

preserveImageAspect: boolean = false

Switch to preserve image aspect.

Default

false

Inherited from Shape.preserveImageAspect

  • Defined in view/shape/Shape.ts:121

replaceLinefeeds

replaceLinefeeds: boolean = true

Specifies if linefeeds in HTML labels should be replaced with BR tags. Default is true.

  • Defined in view/shape/node/TextShape.ts:202

rotation

rotation: number = 0

Inherited from Shape.rotation

  • Defined in view/shape/Shape.ts:164

scale

scale: number = 1

Holds the scale in which the shape is being painted.

Inherited from Shape.scale

  • Defined in view/shape/Shape.ts:182

shapePointerEvents

shapePointerEvents: boolean = false

Specifies if pointer events outside of shape should be handled. Default is false.

Inherited from Shape.shapePointerEvents

  • Defined in view/shape/Shape.ts:253

size

size: number
  • Defined in view/shape/node/TextShape.ts:156

spacing

spacing: number

Overrides Shape.spacing

  • Defined in view/shape/node/TextShape.ts:158

spacingBottom

spacingBottom: number
  • Defined in view/shape/node/TextShape.ts:161

spacingLeft

spacingLeft: number
  • Defined in view/shape/node/TextShape.ts:162

spacingRight

spacingRight: number
  • Defined in view/shape/node/TextShape.ts:160

spacingTop

spacingTop: number
  • Defined in view/shape/node/TextShape.ts:159

startArrow

startArrow: string = NONE

Inherited from Shape.startArrow

  • Defined in view/shape/Shape.ts:150

startSize

startSize: number = 1

Inherited from Shape.startSize

  • Defined in view/shape/Shape.ts:146

state

state: CellState | null = null

Optional reference to the corresponding .

Inherited from Shape.state

  • Defined in view/shape/Shape.ts:212

stencil

stencil: StencilShape | null = null

Holds the StencilShape that defines the shape.

Inherited from Shape.stencil

  • Defined in view/shape/Shape.ts:228

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.

Inherited from Shape.stencilPointerEvents

  • Defined in view/shape/Shape.ts:259

stroke

stroke: string = NONE

Inherited from Shape.stroke

  • Defined in view/shape/Shape.ts:140

strokeOpacity

strokeOpacity: number = 100

Inherited from Shape.strokeOpacity

  • Defined in view/shape/Shape.ts:138

strokeWidth

strokeWidth: number = 1

Inherited from Shape.strokeWidth

  • Defined in view/shape/Shape.ts:142

style

style: CellStateStyle | null = null

Optional reference to the style of the corresponding .

Inherited from Shape.style

  • Defined in view/shape/Shape.ts:217

svgPointerEvents

svgPointerEvents: string = 'all'

Specifies if pointer events should be handled. Default is true.

Inherited from Shape.svgPointerEvents

  • Defined in view/shape/Shape.ts:247

svgStrokeTolerance

svgStrokeTolerance: number = 8

Event-tolerance for SVG strokes (in px). This is only passed to the canvas in createSvgCanvas if pointerEvents is true.

Default

8

Inherited from Shape.svgStrokeTolerance

  • Defined in view/shape/Shape.ts:235

textDirection

textDirection: TextDirectionValue
  • Defined in view/shape/node/TextShape.ts:170

unrotatedBoundingBox

unrotatedBoundingBox: Rectangle | null = null
  • Defined in view/shape/node/TextShape.ts:172

useSvgBoundingBox

useSvgBoundingBox: boolean = true

Allows to use the SVG bounding box in SVG. Default is false for performance reasons.

Inherited from Shape.useSvgBoundingBox

  • Defined in view/shape/Shape.ts:278

valign

valign: VAlignValue
  • Defined in view/shape/node/TextShape.ts:153

value

value: string | HTMLElement | SVGGElement
  • Defined in view/shape/node/TextShape.ts:150

verticalTextRotation

verticalTextRotation: number = -90

Rotation for vertical text. Default is -90 (bottom to top).

This value is not used to rotate the label of a cell: getTextRotation delegates to CellState.shape, so the value that applies is the Shape.verticalTextRotation of the shape of the cell. See the documentation of this class for the way to change it.

Overrides Shape.verticalTextRotation

  • Defined in view/shape/node/TextShape.ts:211

visible

visible: boolean = true

Specifies if the shape is visible. Default is true.

Inherited from Shape.visible

  • Defined in view/shape/Shape.ts:272

wrap

wrap: boolean
  • Defined in view/shape/node/TextShape.ts:166

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

    Inherited from Shape.addPoints

    • Defined in view/shape/Shape.ts:839

afterPaint

  • afterPaint(c: AbstractCanvas2D): void

    Invokes after paint was called.

    Parameters

    • c: AbstractCanvas2D

    Returns void

    Inherited from Shape.afterPaint

    • Defined in view/shape/Shape.ts:589

apply

  • apply(state: CellState): void

    Extends mxShape to update the text styles.

    Parameters

    • state: CellState

      of the corresponding cell.

    Returns void

    Overrides Shape.apply

    • Defined in view/shape/node/TextShape.ts:405

augmentBoundingBox

  • augmentBoundingBox(bbox: Rectangle): void

    Augments the bounding box with the strokewidth and shadow offsets.

    Parameters

    • bbox: Rectangle

    Returns void

    Inherited from Shape.augmentBoundingBox

    • Defined in view/shape/Shape.ts:1105

beforePaint

  • beforePaint(c: AbstractCanvas2D): void

    Invoked before paint is called.

    Parameters

    • c: AbstractCanvas2D

    Returns void

    Inherited from Shape.beforePaint

    • Defined in view/shape/Shape.ts:582

checkBounds

  • checkBounds(): boolean

    Returns true if the bounds are not null and all of its variables are numeric.

    Returns boolean

    Overrides Shape.checkBounds

    • Defined in view/shape/node/TextShape.ts:248

clear

  • clear(): void

    Removes all child nodes and resets all CSS.

    Returns void

    Inherited from Shape.clear

    • Defined in view/shape/Shape.ts:373

configureCanvas

  • configureCanvas(
        c: AbstractCanvas2D,
        x: number,
        y: number,
        w: number,
        h: number,
    ): void

    Sets the state of the canvas for drawing the shape.

    Parameters

    • c: AbstractCanvas2D
    • x: number
    • y: number
    • w: number
    • h: number

    Returns void

    Overrides Shape.configureCanvas

    • Defined in view/shape/node/TextShape.ts:596

create

  • create(): SVGGElement

    Creates and returns the DOM node for the shape. This implementation assumes that maxGraph produces SVG elements.

    Returns SVGGElement

    Inherited from Shape.create

    • Defined in view/shape/Shape.ts:352

createBoundingBox

  • createBoundingBox(): Rectangle | null

    Returns a new rectangle that represents the bounding box of the bare shape with no shadows or strokewidths.

    Returns Rectangle | null

    Inherited from Shape.createBoundingBox

    • Defined in view/shape/Shape.ts:1088

createCanvas

  • createCanvas(): SvgCanvas2D | null

    Creates a new canvas for drawing this shape. May return null.

    Returns SvgCanvas2D | null

    Inherited from Shape.createCanvas

    • Defined in view/shape/Shape.ts:494

createSvgCanvas

  • createSvgCanvas(): SvgCanvas2D | null

    Creates and returns an SvgCanvas2D for rendering this shape.

    Returns SvgCanvas2D | null

    Inherited from Shape.createSvgCanvas

    • Defined in view/shape/Shape.ts:531

createTransparentSvgRectangle

  • createTransparentSvgRectangle(
        x: number,
        y: number,
        w: number,
        h: number,
    ): SVGRectElement

    Adds a transparent rectangle that catches all events.

    Parameters

    • x: number
    • y: number
    • w: number
    • h: number

    Returns SVGRectElement

    Inherited from Shape.createTransparentSvgRectangle

    • Defined in view/shape/Shape.ts:1174

destroy

  • destroy(): void

    Destroys the shape by removing it from the DOM and releasing the DOM node associated with the shape using Event#release.

    Returns void

    Inherited from Shape.destroy

    • Defined in view/shape/Shape.ts:1220

destroyCanvas

  • destroyCanvas(canvas: AbstractCanvas2D): void

    Destroys the given canvas which was used for drawing. This implementation increments the reference counts on all shared gradients used in the canvas.

    Parameters

    • canvas: AbstractCanvas2D

    Returns void

    Inherited from Shape.destroyCanvas

    • Defined in view/shape/Shape.ts:562

getArcSize

  • getArcSize(w: number, h: number): number

    Returns the arc size for the given dimension.

    Parameters

    • w: number
    • h: number

    Returns number

    Inherited from Shape.getArcSize

    • Defined in view/shape/Shape.ts:791

getAutoDirection

  • getAutoDirection(): TextDirectionValue

    Used to determine the automatic text direction.

    Returns 'ltr' or 'rtl' depending on the contents of value.

    This is not invoked for HTML, wrapped content or if value is a DOM node.

    Returns TextDirectionValue

    • Defined in view/shape/node/TextShape.ts:444

ProtectedgetBaseArcSize

  • getBaseArcSize(): number

    Base arc size for the shape, taken from the style.

    Returns number

    Since

    0.21.0

    Inherited from Shape.getBaseArcSize

    • Defined in view/shape/Shape.ts:784

getContentNode

  • getContentNode(): SVGGElement

    Returns the node that contains the rendered input.

    Returns SVGGElement

    • Defined in view/shape/node/TextShape.ts:458

getCursor

  • getCursor(): string

    Returns the current cursor.

    Returns string

    Inherited from Shape.getCursor

    • Defined in view/shape/Shape.ts:1033

getGradientBounds

  • getGradientBounds(
        c: AbstractCanvas2D,
        x: number,
        y: number,
        w: number,
        h: number,
    ): Rectangle

    Returns the bounding box for the gradient box for this shape.

    Parameters

    • c: AbstractCanvas2D
    • x: number
    • y: number
    • w: number
    • h: number

    Returns Rectangle

    Inherited from Shape.getGradientBounds

    • Defined in view/shape/Shape.ts:732

getHtmlValue

  • getHtmlValue(): string

    Private helper function to create SVG elements

    Returns string

    • Defined in view/shape/node/TextShape.ts:616

getLabelBounds

  • getLabelBounds(rect: Rectangle): Rectangle

    Returns the Rectangle for the label bounds of this shape, based on the given scaled and translated bounds of the shape. This method should not change the rectangle in-place. This implementation returns the given rect.

    Parameters

    • rect: Rectangle

    Returns Rectangle

    Inherited from Shape.getLabelBounds

    • Defined in view/shape/Shape.ts:401

getLabelMargins

  • getLabelMargins(rect: Rectangle | null): Rectangle | null

    Returns the scaled top, left, bottom and right margin to be used for computing the label bounds as an Rectangle, where the bottom and right margin are defined in the width and height of the rectangle, respectively.

    Parameters

    • rect: Rectangle | null

    Returns Rectangle | null

    Inherited from Shape.getLabelMargins

    • Defined in view/shape/Shape.ts:446

getRotation

  • getRotation(): number

    Returns the rotation from the style.

    Returns number

    Inherited from Shape.getRotation

    • Defined in view/shape/Shape.ts:1126

getShapeRotation

  • getShapeRotation(): number

    Returns 0 to avoid using rotation in the canvas via updateTransform.

    Returns number

    Overrides Shape.getShapeRotation

    • Defined in view/shape/node/TextShape.ts:574

getSpacing

  • getSpacing(): Point

    Returns the spacing as an Point.

    Returns Point

    • Defined in view/shape/node/TextShape.ts:944

getSvgScreenOffset

  • getSvgScreenOffset(): number

    Disables offset in IE9 for crisper image output.

    Returns number

    Overrides Shape.getSvgScreenOffset

    • Defined in view/shape/node/TextShape.ts:241

getTextCss

  • getTextCss(): string

    Private helper function to create SVG elements

    Returns string

    • Defined in view/shape/node/TextShape.ts:633

getTextRotation

  • getTextRotation(): number

    Returns the rotation for the text label of the corresponding shape.

    Returns number

    Overrides Shape.getTextRotation

    • Defined in view/shape/node/TextShape.ts:581

init

  • init(container: HTMLElement | SVGElement): void

    Initializes the shape by adding it into the given container if the node of the shape doesn't already have a parent.

    Parameters

    • container: HTMLElement | SVGElement

      DOM node that will contain the shape.

    Returns void

    Inherited from Shape.init

    • Defined in view/shape/Shape.ts:310

initStyles

  • initStyles(): void

    Sets the styles to their default values.

    Returns void

    Inherited from Shape.initStyles

    • Defined in view/shape/Shape.ts:319

isHtmlAllowed

  • isHtmlAllowed(): boolean

    Returns true if HTML is allowed for this shape. This implementation always returns false.

    Returns boolean

    Inherited from Shape.isHtmlAllowed

    • Defined in view/shape/Shape.ts:332

isPaintBoundsInverted

  • isPaintBoundsInverted(): boolean

    Inverts the bounds if Shape#isBoundsInverted returns true or if the horizontal style is false.

    Returns boolean

    Overrides Shape.isPaintBoundsInverted

    • Defined in view/shape/node/TextShape.ts:589

isRoundable

  • isRoundable(
        c: AbstractCanvas2D,
        x: number,
        y: number,
        w: number,
        h: number,
    ): boolean

    Hook for subclassers. This implementation returns false.

    Parameters

    • c: AbstractCanvas2D
    • x: number
    • y: number
    • w: number
    • h: number

    Returns boolean

    Inherited from Shape.isRoundable

    • Defined in view/shape/Shape.ts:1040

paint

  • paint(c: AbstractCanvas2D, update?: boolean): void

    Generic rendering code.

    Parameters

    • c: AbstractCanvas2D
    • update: boolean = false

    Returns void

    Overrides Shape.paint

    • Defined in view/shape/node/TextShape.ts:264

paintBackground

  • paintBackground(
        c: AbstractCanvas2D,
        x: number,
        y: number,
        w: number,
        h: number,
    ): void

    Hook for subclassers. This implementation is empty.

    Parameters

    • c: AbstractCanvas2D
    • x: number
    • y: number
    • w: number
    • h: number

    Returns void

    Inherited from Shape.paintBackground

    • Defined in view/shape/Shape.ts:762

paintEdgeShape

  • paintEdgeShape(c: AbstractCanvas2D, pts: Point[]): void

    Hook for subclassers. This implementation is empty.

    Parameters

    • c: AbstractCanvas2D
    • pts: Point[]

    Returns void

    Inherited from Shape.paintEdgeShape

    • Defined in view/shape/Shape.ts:776

paintForeground

  • paintForeground(
        c: AbstractCanvas2D,
        x: number,
        y: number,
        w: number,
        h: number,
    ): void

    Hook for subclassers. This implementation is empty.

    Parameters

    • c: AbstractCanvas2D
    • x: number
    • y: number
    • w: number
    • h: number

    Returns void

    Inherited from Shape.paintForeground

    • Defined in view/shape/Shape.ts:769

paintGlassEffect

  • paintGlassEffect(
        c: AbstractCanvas2D,
        x: number,
        y: number,
        w: number,
        h: number,
        arc: number,
    ): void

    Paints the glass gradient effect.

    Parameters

    • c: AbstractCanvas2D
    • x: number
    • y: number
    • w: number
    • h: number
    • arc: number

    Returns void

    Inherited from Shape.paintGlassEffect

    • Defined in view/shape/Shape.ts:803

paintVertexShape

  • paintVertexShape(
        c: AbstractCanvas2D,
        x: number,
        y: number,
        w: number,
        h: number,
    ): void

    Paints the vertex shape.

    Parameters

    • c: AbstractCanvas2D
    • x: number
    • y: number
    • w: number
    • h: number

    Returns void

    Inherited from Shape.paintVertexShape

    • Defined in view/shape/Shape.ts:750

redraw

  • redraw(): void

    Renders the text using the given DOM nodes.

    Returns void

    Overrides Shape.redraw

    • Defined in view/shape/node/TextShape.ts:342

redrawHtmlShape

  • redrawHtmlShape(): void

    Updates the HTML node(s) to reflect the latest bounds and scale.

    Returns void

    Overrides Shape.redrawHtmlShape

    • Defined in view/shape/node/TextShape.ts:660

redrawShape

  • redrawShape(): void

    Updates the SVG or VML shape.

    Returns void

    Inherited from Shape.redrawShape

    • Defined in view/shape/Shape.ts:471

releaseSvgGradients

  • releaseSvgGradients(grads: GradientMap): void

    Paints the line shape.

    Parameters

    • grads: GradientMap

    Returns void

    Inherited from Shape.releaseSvgGradients

    • Defined in view/shape/Shape.ts:1202

resetStyles

  • resetStyles(): void

    Resets all styles.

    Returns void

    Overrides Shape.resetStyles

    • Defined in view/shape/node/TextShape.ts:379

setCursor

  • setCursor(cursor: string): void

    Sets the cursor on the given shape.

    Parameters

    • cursor: string

      The cursor to be used.

    Returns void

    Inherited from Shape.setCursor

    • Defined in view/shape/Shape.ts:1025

setTransparentBackgroundImage

  • setTransparentBackgroundImage(node: SVGElement): void

    Sets a transparent background CSS style to catch all events.

    Paints the line shape.

    Parameters

    • node: SVGElement

    Returns void

    Inherited from Shape.setTransparentBackgroundImage

    • Defined in view/shape/Shape.ts:1195

updateBoundingBox

  • updateBoundingBox(): void

    Updates the for this shape using the given node and position.

    Returns void

    Overrides Shape.updateBoundingBox

    • Defined in view/shape/node/TextShape.ts:479

updateBoundsFromPoints

  • updateBoundsFromPoints(): void

    Updates the bounds based on the points.

    Returns void

    Inherited from Shape.updateBoundsFromPoints

    • Defined in view/shape/Shape.ts:382

updateFont

  • updateFont(node: HTMLElement | SVGGElement): void

    Updates the HTML node(s) to reflect the latest bounds and scale.

    Parameters

    • node: HTMLElement | SVGGElement

    Returns void

    • Defined in view/shape/node/TextShape.ts:831

updateInnerHtml

  • updateInnerHtml(elt: HTMLElement): void

    Sets the inner HTML of the given element to the .

    Parameters

    • elt: HTMLElement

    Returns void

    • Defined in view/shape/node/TextShape.ts:737

updateMargin

  • updateMargin(): void

    Returns the spacing as an Point.

    Returns void

    • Defined in view/shape/node/TextShape.ts:937

updateSize

  • updateSize(node: HTMLElement, enableWrap?: boolean): void

    Updates the HTML node(s) to reflect the latest bounds and scale.

    Parameters

    • node: HTMLElement
    • enableWrap: boolean = false

    Returns void

    • Defined in view/shape/node/TextShape.ts:870

updateTransform

  • updateTransform(
        c: AbstractCanvas2D,
        x: number,
        y: number,
        w: number,
        h: number,
    ): void

    Sets the scale and rotation on the given canvas.

    Parameters

    • c: AbstractCanvas2D
    • x: number
    • y: number
    • w: number
    • h: number

    Returns void

    Inherited from Shape.updateTransform

    • Defined in view/shape/Shape.ts:739

updateValue

  • updateValue(): void

    Updates the HTML node(s) to reflect the latest bounds and scale.

    Returns void

    • Defined in view/shape/node/TextShape.ts:760

Settings

Member Visibility
  • Protected
  • Inherited
Theme

On This Page

Rotation of vertical labels
Constructors
constructor
Properties
alignantiAliasbackgroundbaseSpacingBottombaseSpacingLeftbaseSpacingRightbaseSpacingTopborderboundingBoxboundscacheEnabledclippedcolorcursordialectdirectionendArrowendSizefamilyfillfillOpacityflipHflipVfontStyleglassgradientgradientDirectionhorizontalignoreClippedStringSizeignoreStringSizeimageimageSrcindicatorindicatorColorindicatorDirectionindicatorGradientColorindicatorImageSrcindicatorShapeindicatorStrokeColorisDashedisRoundedisShadowlabelPaddinglastValuemarginminSvgStrokeWidthnodeoldGradientsopacityoriginalPointerEventsoutlineoverflowoverlaypointerEventspointspreserveImageAspectreplaceLinefeedsrotationscaleshapePointerEventssizespacingspacingBottomspacingLeftspacingRightspacingTopstartArrowstartSizestatestencilstencilPointerEventsstrokestrokeOpacitystrokeWidthstylesvgPointerEventssvgStrokeTolerancetextDirectionunrotatedBoundingBoxuseSvgBoundingBoxvalignvalueverticalTextRotationvisiblewrap
Methods
addPointsafterPaintapplyaugmentBoundingBoxbeforePaintcheckBoundsclearconfigureCanvascreatecreateBoundingBoxcreateCanvascreateSvgCanvascreateTransparentSvgRectangledestroydestroyCanvasgetArcSizegetAutoDirectiongetBaseArcSizegetContentNodegetCursorgetGradientBoundsgetHtmlValuegetLabelBoundsgetLabelMarginsgetRotationgetShapeRotationgetSpacinggetSvgScreenOffsetgetTextCssgetTextRotationinitinitStylesisHtmlAllowedisPaintBoundsInvertedisRoundablepaintpaintBackgroundpaintEdgeShapepaintForegroundpaintGlassEffectpaintVertexShaperedrawredrawHtmlShaperedrawShapereleaseSvgGradientsresetStylessetCursorsetTransparentBackgroundImageupdateBoundingBoxupdateBoundsFromPointsupdateFontupdateInnerHtmlupdateMarginupdateSizeupdateTransformupdateValue
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.