komoplane
komoplane copied to clipboard
Incorrect Node Argument Order in addEdge Function
In the getGraphDataFunction
, the addEdge
function is called with the node arguments in the wrong order. Typically, an edge is drawn from a claim to its composition and composite resources. This means the source should be the claim, and the target should be the composition or composite resources. However, the function is currently being called with the composition and composite resources as the source and the claim as the target, which is incorrect.
https://github.com/komodorio/komoplane/blob/e04d6ecdbd0d9729d37b2d11a17024bbe566f8d9/pkg/frontend/src/pages/ClaimPage.tsx#L113-L132
Impact: This incorrect ordering has caused confusion in other parts of the code. For example, it has led to settings being configured incorrectly, such as using markerStart
instead of markerEnd
here:
https://github.com/komodorio/komoplane/blob/e04d6ecdbd0d9729d37b2d11a17024bbe566f8d9/pkg/frontend/src/components/graph/data.ts#L79
Additionally, this error results in calling getLayoutElement
with RL
arguments, even though the graph is supposed to be displayed with LR
(left-to-right) settings:
https://github.com/komodorio/komoplane/blob/e04d6ecdbd0d9729d37b2d11a17024bbe566f8d9/pkg/frontend/src/components/graph/RelationsGraph.tsx#L75-L79
I have a proposed solution for this issue. Please let me know if this understanding is correct and desirable.