-
Notifications
You must be signed in to change notification settings - Fork 75
Closed
Labels
Description
These to lines have similar code that could be refactored into a common function. The logic for parsing nodes data and PlotlyJS data should be separated as well.
deepforge/src/common/viz/PlotlyDescExtractor.js
Lines 60 to 64 in 0cb4ba2
| let id = node.getId(), | |
| subGraphId = node.getParentId(), | |
| graphId = this._client.getNode(subGraphId).getParentId(), | |
| jobId = this._client.getNode(graphId).getParentId(), | |
| execId = this._client.getNode(jobId).getParentId(), |
deepforge/src/common/viz/PlotlyDescExtractor.js
Lines 90 to 94 in 0cb4ba2
| const id = imageNode.getId(), | |
| subGraphId = imageNode.getParentId(), | |
| graphId = this._client.getNode(subGraphId).getParentId(), | |
| jobId = this._client.getNode(graphId).getParentId(), | |
| execId = this._client.getNode(jobId).getParentId(), |
The node filtering functions donot have a scalable approach as the attributes could be conflicting for different new nodes added:
deepforge/src/common/viz/PlotlyDescExtractor.js
Lines 52 to 55 in 0cb4ba2
| desc.lines = children.filter((node) => node.getValidAttributeNames().includes('points')) | |
| .map(lineNode => this.getLineDesc(lineNode)); | |
| desc.images = children.filter(node => node.getValidAttributeNames().includes('rgbaMatrix')) | |
| .map(imageNode => this.getImageDesc(imageNode)); |