Importer

Search
Feedback

With the Importer module the user can restore a graphview that was previously saved with the exportermodule. The importer will first load all graph views that are saved in the context of the set variable “currentViewId”. Then the user can choose the view that will be restored in the Structr Graph-Browser.

Dependencies for this module:

  • jquery
  • sigma.min.js
  • graph.browser.core.js
  • graph.browser.modulecontrol.js
  • graph.browser.restcontrol.js
  • graph.browser.modules.importer.js

Settings

fields type description
onSuccess function Called when the graph view is succesfully restored
OnError function Called when something went wrong while loading the graph view

Example

var graphSettings = {
    graphContainer: 'graph-container',
    moduleSettings: {'importer': {'onSuccess': myOnSuccessFunction, 'onError': myOnErrorFunction} }
};

var graphBrowser = new GraphBrowser(graphSettings);

Needed HTML fields

HTML IDs description
impoprter-controlElement When this element is clicked, the importermodule will load all graphViews that are stored under the current window
importer-loadGraph-graphNames This should be a container in wich the graphViews for the current window can be inserted as labels with radiobuttons. With the radiobuttons the user can choose wich graphview he wants to load into the graph-browser
importer-loadGraph-submit When the element with this id is clicked, the selected radiobuttons’ graphView will be loaded into the graph-browser
importer-loadGraph-radiobuttons Inside the labels is a radiobutton for each graphView that can be loaded from the current window

Created HTML fields

tag HTML IDs classes purpose
<label> importer-loadGraph-radiobuttons importer-loadGraph-radiobuttons Inside the labels is a radiobutton for each graphView that can be loaded from the current window

Graph-Browser

About this article
Last change 2016-08-29
Topics ExperimentalStructr 2.0