Optional
config: GrapholscapeConfigProtected
_incrementalProtected
availableProtected
displayedProtected
entityProtected
themesThe container in which the bottom-right buttons are placed. You can use this container to add your own Buttons if you want to.
The current diagram's id
The current selected entity name type (label, full iri or prefixed iri)
Filename for exports. String in the form: "[ontology name]-[diagram name]-v[ontology version]"
The current renderer state
An array of available renderer's state for this Grapholscape instance
The current selected Entity
The current theme used by Grapholscape
The available themes for this Grapholscape instance
The container in which Grapholscape places the UI components. You can use this container to add new widgets or dialogs if you want to.
Center the viewport on a single element.
If you specify a different diagram from the current one, it will be displayed
the element's id (can be a node or an edge)
Optional
diagramId: numberthe diagram's id (default: the current one)
Optional
zoom: numberthe level zoom to apply, do not pass it if you don't want zoom to change
Center viewport on a single entity occurrence given its IRI
the iri of the entity to find and center on
Optional
diagramId: numberthe diagram containing the entity. If not specified, the first entity occurrence in any diagram will be used.
Optional
zoom: numberthe level of zoom to apply. If not specified, zoom level won't be changed.
Export current diagram and download it as a PNG image.
custom file name. Defaults to exportFileName
Export current diagram and download it as an SVG.
custom file name. Defaults to exportFileName
Filter elements on the diagram.
It will be currently applied only if the user defined callback on the event FilterRequest returns true and if the internal logic allows for the filter to be applied.
the filter to apply, can be an object of type Filter, DefaultFilterKeyEnum or a string representing the unique key of a defined filter
Select an element in a diagram.
If you specify a different diagram from the current one, it will be displayed
the element's id (can be a node or an edge)
Optional
diagramId: numberthe diagram's id (default: the current one)
Center viewport on a single entity occurrence and selects it given its IRI
the iri of the entity to find and center on
Optional
diagramId: numberthe diagram containing the entity. If not specified, the first entity occurrence in any diagram will be used.
Optional
zoom: numberthe level of zoom to apply. If not specified, zoom level won't be changed.
Change the displayed entity's names.
the entity name type to set
Change the language used for the labels and comments
The language must be supported by the ontology or the first available language for a given label/comment wil be used as fallback
the language to set Language
Change the current renderer (Graphol - Lite - Floaty).
A RendererState is an implementation for the iRenderState interface that changes the way the Renderer performs the main operations on a Diagram such as rendering it and filtering elements in it. The renderer states included in Grapholscape are: GrapholRendererState, LiteRendererState and FloatyRendererState.
// Setting the floaty renderer state
import { FloatyRendererState } from 'grapholscape'
grapholscape.setRenderer(new FloatyRendererState())
the renderer state instance to set, if you want to reuse these instances it's totally up to you.
Unfilter elements on the diagram.
It will be currently deactivated only if the user defined callback on the event FilterRequest returns true and if the internal logic allows for the filter to be deactivated.
the filter to disable, can be an object of type Filter, DefaultFilterKeyEnum or a string representing the unique key of a defined filter
Register a callback for a given event.
Remarks
Check LifecycleEvent and IonEvent for the full list of events/callbacks types
Param
The event for which register a callback.
Param
Function to call when the specified event occurs
Example
reacting to a node selection