GeezerVison is showing maxgraph.github.io — CellHighlight | @maxgraph/core
A helper class to highlight cells. Here is an example for a given cell.
const highlight = new CellHighlight(graph, '#ff0000', 2);
highlight.highlight(graph.view.getState(cell));
Constructors
constructor
-
new CellHighlight( graph: AbstractGraph, highlightColor?: string, strokeWidth?: number, dashed?: boolean,): CellHighlight
Parameters
- graph: AbstractGraph
OptionalhighlightColor: string
OptionalstrokeWidth: number
Optionaldashed: boolean
Returns CellHighlight
Properties
dashed
dashed: boolean = false
highlightColor
highlightColor: string
keepOnTop
keepOnTop: boolean = false
Specifies if the highlights should appear on top of everything else in the overlay pane.
opacity
opacity: number = 100
repaintHandler
repaintHandler: Function
resetHandler
resetHandler: Function
Holds the handler that automatically invokes reset if the highlight should be hidden.
shape
shape: Shape | null = null
spacing
spacing: number = 2
Specifies the spacing between the highlight for vertices and the vertex.
strokeWidth
strokeWidth: number = 0
Methods
createShape
-
createShape(): Shape | null
Creates and returns the highlight shape for the given state.
Returns Shape | null
destroy
-
Destroys the handler and all its resources and DOM nodes.
Returns void
drawHighlight
-
Creates and returns the highlight shape for the given state.
Returns void
getStrokeWidth
-
getStrokeWidth(state?: CellState | null): number
Updates the highlight after a change of the model or view.
Returns number
hide
-
Resets the state of the cell marker.
Returns void
isHighlightAt
-
isHighlightAt(x: number, y: number): boolean
Returns true if this highlight is at the given position.
Returns boolean
repaint
-
Updates the highlight after a change of the model or view.
Returns void
setHighlightColor
-
setHighlightColor(color: string): void
Sets the color of the rectangle used to highlight drop targets.
Parameters
- color: string
String that represents the new highlight color.
Returns void
On This Page
Constructors
Properties
Methods