load

loads data from an external file

promise load(string url);

Parameters

urlstringthe URL of an external file

Returns

promisea promise of data loading

Example

diagram.data.load("../common/data.json");

Related samples

Details

The component will make an AJAX call and expect the remote URL to provide valid JSON data.

Data loading is asynchronous, so you need to wrap any after-loading code into a promise:

diagram.data.load("../some/data").then(function(){
    diagram.selection.add(123);
});
See also
Back to top