Closed pixelzoom closed 1 year ago
Summary of the important bits in the above commit:
GraphNodeOptions.createCurveNode
GraphNodeOptions.hasDefaultCurveNode
which determines whether GraphNode creates a non-interactive CurveNodehasDefaultCurveNode: false
for OriginalGraphNode, since we'll be creating our own interactive TransformedCurveNodeoriginalCurveNode
to OriginalGraph, and instantiated it directly: this.originalGraphNode = new TransformedCurveNode(...)
.// eslint-disable-line
.This looks much nicer to me. And I can sleep better without the // eslint-disable-line
:)
@veillette have a look, let me know if you have questions/concerns, or feel free to close.
PS: I confirmed that Screenshot is still working correctly after this change.
I reviewed this. Our overriding of CurveNode was always a bit awkward. Much better. Cl;osing
Related to #262 (Self code review)
There's a part of the GraphNode API that I keep bumping into, and it feels unnecessarily complicated. It's
GraphNodeOptions.createCurveNode
.The default value in GraphNode.ts is:
And the override in OriginalGraphNode.ts is:
And then this cast is needed in OriginalGraphNode.ts, which requires disabling ESlint:
I think it would be cleaner to:
GraphNodeOptions.createCurveNode
with a flag (likehasDefaultCurveNode: boolean
) that tellsGraphNode
whether to create a default CurveNode instancethis.originalCurveNode
to OriginalGraphNode.ts and instantiate it directlyThis I shall investigate.