diff --git a/README.md b/README.md index a246ce7..6c4dcc5 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,6 @@ To use it in your own visualizer to visualize plotly JSON from your project node panel parameters. ``` params = { - activeNodeMetaName: The active node meta name for PlotlyGraph panel to be applied plotlyDataAttribute: The active node attribute which stores plotly JSON embedded: If true, the visualizer will expect a parent visualizer to call "selectedObjectChanged". If false, it will subscribe to WebGME events. } diff --git a/config/config.default.js b/config/config.default.js index 495ee2c..c720d9b 100644 --- a/config/config.default.js +++ b/config/config.default.js @@ -6,8 +6,6 @@ var config = require('./config.webgme'), // Add/overwrite any additional settings here // config.server.port = 8080; // config.mongo.uri = 'mongodb://127.0.0.1:27017/webgme_my_app'; -config.seedProjects.basePaths = ['src/seeds/project']; -config.seedProjects.defaultProject = 'project'; validateConfig(config); module.exports = config; diff --git a/src/seeds/project/project.webgmex b/src/seeds/project/project.webgmex deleted file mode 100644 index 58db60a..0000000 Binary files a/src/seeds/project/project.webgmex and /dev/null differ diff --git a/src/visualizers/panels/PlotlyGraph/PlotlyGraphControl.js b/src/visualizers/panels/PlotlyGraph/PlotlyGraphControl.js index 6127544..8a6708f 100644 --- a/src/visualizers/panels/PlotlyGraph/PlotlyGraphControl.js +++ b/src/visualizers/panels/PlotlyGraph/PlotlyGraphControl.js @@ -7,9 +7,6 @@ define([ ) { 'use strict'; - const GRAPH = 'Graph', - DATA = 'data'; - function PlotlyGraphControl(options) { this._logger = options.logger.fork('Control'); @@ -20,8 +17,7 @@ define([ this._widget = options.widget; this._embedded = options.embedded; - this._activeNodeMetaName = options.activeNodeMetaName || GRAPH; - this._plotlyDataAttribute = options.plotlyDataAttribute || DATA; + this._plotlyDataAttribute = options.plotlyDataAttribute; this._currentNodeId = null; this._currentNodeParentId = undefined; this._logger.debug('ctor finished'); @@ -64,15 +60,7 @@ define([ PlotlyGraphControl.prototype._getObjectDescriptor = function (nodeId) { let node = this._client.getNode(nodeId), desc; - const isGraph = node => { - if(node) { - const metaNode = this._client.getNode(node.getMetaTypeId()); - return metaNode ? - metaNode.getAttribute('name') === this._activeNodeMetaName : - false; - } - }; - if(isGraph(node)){ + if(node){ const plotlyData = node.getAttribute(this._plotlyDataAttribute); if(plotlyData){ desc = { plotlyData: JSON.parse(plotlyData) }; diff --git a/src/visualizers/panels/PlotlyGraph/PlotlyGraphPanel.js b/src/visualizers/panels/PlotlyGraph/PlotlyGraphPanel.js index 0304671..9b907eb 100644 --- a/src/visualizers/panels/PlotlyGraph/PlotlyGraphPanel.js +++ b/src/visualizers/panels/PlotlyGraph/PlotlyGraphPanel.js @@ -16,6 +16,8 @@ define([ ) { 'use strict'; + const DEFAULT_PLOTLY_DATA_ATTRIBUTE = 'data'; + function PlotlyGraphPanel(layoutManager, params) { let options = {}; //set properties from options @@ -27,8 +29,7 @@ define([ this._client = params.client; this._embedded = params.embedded; - this._activeNodeMetaName = params.activeNodeMetaName; - this._plotlyDataAttribute = params.plotlyDataAttribute; + this._plotlyDataAttribute = params.plotlyDataAttribute || DEFAULT_PLOTLY_DATA_ATTRIBUTE; //initialize UI this._initialize(); @@ -57,7 +58,6 @@ define([ client: this._client, embedded: this._embedded, widget: this.widget, - activeNodeMetaName: this._activeNodeMetaName, plotlyDataAttribute: this._plotlyDataAttribute });