Graph Export

Register a function that can add a menu option in export context menu. If multiple export plugins are registered, they are placed in an "Export" submenu.

Tutorial

Web Plugin

Register the resources need for export, a plugin, component, template, stylesheet, and message bundle.

app.registerJavaScript("/org/visallo/examples/graph_export/plugin.js", true);
app.registerJavaScript("/org/visallo/examples/graph_export/configuration.js", false);
app.registerJavaScriptTemplate("/org/visallo/examples/graph_export/template.hbs");
app.registerLess("/org/visallo/examples/graph_export/style.less");
app.registerResourceBundle("/org/visallo/examples/graph_export/messages.properties");

Register Extension

Register the extension to add a menu item to the graph context menu.

visallo.registry.registerExtension('org.visallo.graph.export', {
    menuItem: i18n('org.visallo.examples.graph_export.label'),
    componentPath: 'org/visallo/examples/graph_export/configuration'
});

Define Component

Create the Flight component that logs the Cytoscape json backup.

return api.defineComponent(GraphExportExample);

function GraphExportExample() {

    this.after('initialize', function() {
        this.$node.html(template({
            productId: this.attr.productId,
            workspaceId: this.attr.workspaceId
        }));
        this.$node.find('pre')[0].textContent = JSON.stringify(this.attr.cy.json(), null, 2)
    });

Style

Add some stylesheet declarations in a wrapper class to avoid collisions with other plugins.

.org-visallo-examples-graph_export {

    pre {
        // 10 lines hidden…
    }

    code {
        // 7 lines hidden…
    }
}

results matching ""

    No results matching ""