Global

Methods

i18n(key, …args) → {string}

Source:

Use message bundles to convert keys to internationalized values.

Use registerMessageBundle in web plugin to register custom bundles.

Tokens can be placed in message values of the form: {n}, where n is the argument number to replace.

Will display console warning if key doesn't exist
Examples

Message Bundle Properties

visallo.help.logout=Logout
visallo.offline_overlay.last_check=Last checked {0}

Handlebars Template

{{ i18n 'visallo.help.logout' }}
{{ i18n 'visallo.offline_overlay.last_check', date }}

JavaScript Usage

i18n('visallo.help.logout')
// => Logout of Visallo

i18n('visallo.offline_overlay.last_check', new Date().toString())
// => Last checked 2017-02-09T18:29:47.333Z
Parameters:
Name Type Attributes Description
key string

The key to lookup

args string <repeatable>

The arguments to replace in the value

Returns:

The string

Type
string

Events

objectsSelected

Source:
Properties:
Name Type Description
data object
Properties
Name Type Description
vertices Array.<object>
edges Array.<object>
options object
Properties
Name Type Description
focus object

Used to scroll to sourceInfo of document text

Listen for this event to be notified of selection changes

Examples

From Flight

this.on(document, 'objectsSelected', function(event, data) {
    console.log('Selection:', data.vertices, data.edges);
})

Anywhere

$(document).on('objectsSelected', function(e, data) {
    console.log('Selection:', data.vertices, data.edges);
})

ontologyUpdated

Source:
Properties:
Name Type Description
data object
Properties
Name Type Description
ontology object

Triggered when the ontology is modified, either by changing the case or something was published.

Listen to this event to be notified and update views that might be using the ontology.

Examples

From Flight

this.on(document, 'ontologyUpdated', function(event, data) {
    console.log('Ontology:', data.ontology);
})

Anywhere

$(document).on('ontologyUpdated', function(event, data) {
    console.log('Ontology:', data.ontology);
})

selectObjects

Source:
Properties:
Name Type Attributes Description
data object <optional>
Properties
Name Type Attributes Default Description
vertexIds Array.<string> <optional>
[]

The vertexIds to select

edgeIds Array.<string> <optional>
[]

The edgeIds to select

vertices Array.<object> <optional>
[]

The vertices to select

edges Array.<object> <optional>
[]

The edges to select

Trigger this event to select edges or vertices. This will show blue selected background on these elements and open the Inspector.

Examples

From Flight component

this.trigger('selectObjects', { vertexIds: ['v1'] })

From anywhere

$(document).trigger('selectObjects', { edgeIds: ['e1'] })