Skip to content
  1. API
  2. Ogma
  3. tools

Ogma.tools.legend

Legend API: functions to display a legend in the Ogma container to explain the meaning of nodes and edges.

ogma.tools.legend.disable()

Disable the legend.

Returns

  • Promise<void>

ogma.tools.legend.enable([options])

Enable the legend. Provides indications on the meaning of the color, size, shape, image and icon of nodes and edges.

Important! In order to be generated for a specific attribute (color, size, etc), the following requirements must be met:

  • There must be exactly one rule for that attribute. If there are multiple rules for an attribute, only the first one is taken into account (which may lead to an incorrect legend)
  • This rule must have been created with `ogma.rules.map()` or `ogma.rules.slice()`. If it's not the case, the widget for this attribute will not be shown.

Arguments

Returns

  • Promise<void>

ogma.tools.legend.enabled()

Indicates if the legend is enabled.

Returns

  • boolean

ogma.tools.legend.export([settings])

Arguments

Returns

  • Promise<HTMLCanvasElement> Exports legend contents on a Canvas element

ogma.tools.legend.getOptions()

Get Legend settings.

Returns