HighlightLayer

HighlightLayer

new HighlightLayer(graph, props) → {HighlightLayer}

Source:
Properties:
Name Type Description
guid string

Unique GUID for highlight layer.

graph Graph

Main Graph Object.

type string

Store layer type, will have several layers of Highlighted text in graph, e-g: - the law, the process description (default), the best practice etc.

text string

Stores Text for the layer as string, which will be null by default.

name string

Stores Name of the layer, default name will be called 'decription'.

Main HighlightLayer Class, it will be used to create layers for Highlights in DCR

Parameters:
Name Type Description
graph Graph

A graph object of the current application is passed so it can be used to update the garph easily.

props object

An object is passed with basic or updates to basic properties of the layer object.

Returns:

Returns HighlightLayer Object.

Type
HighlightLayer

Methods

(static) getHighlights() → {array}

Source:

Get Highlights related to a layer of graph.

Returns:
  • An array of graph Highlights.
Type
array

(static) remove() → {boolean}

Source:

Remove Highlight layer

Example
var myApp = new DCR();
myApp.addHighlightLayer({
                name: 'New Layer',
                text: 'some layer text'
            })
myApp.HighlightLayers[0].remove(); // this will remove the Highlight Layer selected from graph Layers array, i-e 1st layer in the array
	
Returns:

Returns true or false based on operation success.

Type
boolean

(static) removeHighlights()

Source:

Remove Highlights related to a layer of graph.

Example
var myApp = new DCR();
myApp.addHighlightLayer({
				name: 'New Layer',
				text: 'some layer text'
			})
myApp.addHighlight({layers: [myApp.HighlightLayers[0]]}) // adds the highlight to layer
myApp.HighlightLayers[0].removeHighlights(); // this will remove the Highlights of Layer

(static) setAsDefault() → {HighlightLayer}

Source:

Set the Highlight layer as default, will unset default value for all other layers

Returns:

Returns an object of HighlightLayer Class.

Type
HighlightLayer