Skip to content

Commit bab0ae5

Browse files
Change default attribute names; remove default project seed. Closes #13 (#14)
* Change default attribute names; remove default project seed. Closes #13 * WIP- remove defaultMetaNodeName for panel options
1 parent 5cc9d5e commit bab0ae5

File tree

5 files changed

+5
-20
lines changed

5 files changed

+5
-20
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ To use it in your own visualizer to visualize plotly JSON from your project node
2222
panel parameters.
2323
```
2424
params = {
25-
activeNodeMetaName: The active node meta name for PlotlyGraph panel to be applied
2625
plotlyDataAttribute: The active node attribute which stores plotly JSON
2726
embedded: If true, the visualizer will expect a parent visualizer to call "selectedObjectChanged". If false, it will subscribe to WebGME events.
2827
}

config/config.default.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ var config = require('./config.webgme'),
66
// Add/overwrite any additional settings here
77
// config.server.port = 8080;
88
// config.mongo.uri = 'mongodb://127.0.0.1:27017/webgme_my_app';
9-
config.seedProjects.basePaths = ['src/seeds/project'];
10-
config.seedProjects.defaultProject = 'project';
119

1210
validateConfig(config);
1311
module.exports = config;

src/seeds/project/project.webgmex

-3.81 KB
Binary file not shown.

src/visualizers/panels/PlotlyGraph/PlotlyGraphControl.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ define([
77
) {
88
'use strict';
99

10-
const GRAPH = 'Graph',
11-
DATA = 'data';
12-
1310
function PlotlyGraphControl(options) {
1411

1512
this._logger = options.logger.fork('Control');
@@ -20,8 +17,7 @@ define([
2017
this._widget = options.widget;
2118

2219
this._embedded = options.embedded;
23-
this._activeNodeMetaName = options.activeNodeMetaName || GRAPH;
24-
this._plotlyDataAttribute = options.plotlyDataAttribute || DATA;
20+
this._plotlyDataAttribute = options.plotlyDataAttribute;
2521
this._currentNodeId = null;
2622
this._currentNodeParentId = undefined;
2723
this._logger.debug('ctor finished');
@@ -64,15 +60,7 @@ define([
6460
PlotlyGraphControl.prototype._getObjectDescriptor = function (nodeId) {
6561
let node = this._client.getNode(nodeId),
6662
desc;
67-
const isGraph = node => {
68-
if(node) {
69-
const metaNode = this._client.getNode(node.getMetaTypeId());
70-
return metaNode ?
71-
metaNode.getAttribute('name') === this._activeNodeMetaName :
72-
false;
73-
}
74-
};
75-
if(isGraph(node)){
63+
if(node){
7664
const plotlyData = node.getAttribute(this._plotlyDataAttribute);
7765
if(plotlyData){
7866
desc = { plotlyData: JSON.parse(plotlyData) };

src/visualizers/panels/PlotlyGraph/PlotlyGraphPanel.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ define([
1616
) {
1717
'use strict';
1818

19+
const DEFAULT_PLOTLY_DATA_ATTRIBUTE = 'data';
20+
1921
function PlotlyGraphPanel(layoutManager, params) {
2022
let options = {};
2123
//set properties from options
@@ -27,8 +29,7 @@ define([
2729

2830
this._client = params.client;
2931
this._embedded = params.embedded;
30-
this._activeNodeMetaName = params.activeNodeMetaName;
31-
this._plotlyDataAttribute = params.plotlyDataAttribute;
32+
this._plotlyDataAttribute = params.plotlyDataAttribute || DEFAULT_PLOTLY_DATA_ATTRIBUTE;
3233

3334
//initialize UI
3435
this._initialize();
@@ -57,7 +58,6 @@ define([
5758
client: this._client,
5859
embedded: this._embedded,
5960
widget: this.widget,
60-
activeNodeMetaName: this._activeNodeMetaName,
6161
plotlyDataAttribute: this._plotlyDataAttribute
6262
});
6363

0 commit comments

Comments
 (0)