Loads an existing drawing into the Web SDK editor.
.load(/* String */ drawingData, /* Function */ onSuccess, /* Function */ onError)
The load method will load three types of diagrams into the Web SDK editor:
Note: When a legacy diagram or file is loaded, there will be a short delay while the editor converts the legacy data to the format required by the Web SDK editor. If the diagram file contains multiple diagrams, only the first diagram will be loaded. After conversion, a subsequent call to the store method will retrieve the diagram in the SVG diagram format.
A function with no parameters. This function will be called when the diagram has been loaded successfully.
A function that accepts one parameter, an Error object. This function will be called if the load fails. The passed Error object indicates the nature of the failure. This function may return true to indicate that the error has been handled. If the function does not return true, the error will be passed on to the built-in error handler.
/* This example assumes that editor is an initialized ESDWeb object */ function onSuccess() { // The load was successful... // Any operations that depend on the loaded diagram must // be done within the body of this callback function. } function onError(error) { alert('Diagram load failed' + error.message); } // diagramData contains a diagram in SVG or legacy string format. editor.load(diagramData, onSuccess, onError);