kieler / klighd-vscode

Eclipse Public License 2.0
8 stars 6 forks source link

Code Review: tik/proxy-view #86

Closed fight4day closed 4 months ago

fight4day commented 2 years ago

Draft of the proxy-view. This pull request is used as means of a code review.

https://github.com/kieler/KLighD/pull/129

fight4day commented 2 years ago

Could it be that the id change is persistent, on the SKEdge, between renderings and that both the edge and its proxy are rendered? In the next rendering the original edge would have the proxy's id and as getProxId does not add the proxy suffix when already present its not added again for the proxy resulting in them having the same id.

Thanks for the input! I get what you mean and looked at it but believe that's not what's causing the bug. If that was the case, the error would appear anytime the cloned SKEdge is rendered for the second time and as it stands right now, the error is logged only in some cases for large diagrams. Also, it would be weird for the same thing to work with SKNodes but not SKEdges, but then again, the handling might be different in unexpected ways :v

At the moment I think the edge proxies are causing it themselves. Somehow they seem to appear on the document twice with the same ids..? I'll definitely keep it in mind though

Eddykasp commented 9 months ago

To create a "signpost" projection of proxies onto edges (if they are on-screen), the way proxies are created and positioned has to be modified. In proxy-view.ts the method getTransform is responsible for positioning a node's proxy. The current structure only creates a single proxy for such any node. In a signpost projection we would require more. Additionally it needs to decided how to handle nodes where there currently is no connecting edge on screen. The simplest approach would be to not create a proxy in that case. But we could also use a radial projection for those nodes. Going further it might make sense for the synthesis to be able to specify using semantic tags, which projection should be used.

Spline intersections: https://scholarsarchive.byu.edu/cgi/viewcontent.cgi?article=1000&context=facpub chapter 7

De Casteljau's Algorithm