Skip to content

Refactor PlotlyDescExtractor #1544

@umesh-timalsina

Description

@umesh-timalsina

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.

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(),

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:

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));

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions