-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New edge type: smooth-segments #3201
Comments
Would either rounded corner type have problematic edge cases? Would they give visually-pleasing results for all angles?
This looks reasonable.
There are a number of other properties that use the term 'round' or 'rounded', so we should use that to be consistent, i.e.
Do you mean the same as segments? The bezier edges control points don't correspond to where an edge lies, they correspond to points towards which the curve is pulled. The segment points specify exactly where the line should hit.
Good
Good. There should be a warning in the console if an insufficient number of radii are provided, as compared to the number of specified points. In that case, you could use the first value, the last value, or some default value -- just to show something so it's not completely broken with user error.
If you find that one type is superior to the other, let's just support that one to simplify things. If there are trade-offs, we should document them alongside this property. I suggest a more explicit property name, like Something like
|
@EliotRagueneau, I've added some specific comments in the previous post in this thread. The feature looks good. Let me know if you have any questions re. design decisions or re. implementation. If everything is clear, then I think this should just be merged in. |
It's better from a user's perspective to have separate, local shape enums (e.g. round-taxi), rather than a global one (e.g. edge-join: round). (1) Separate, local shapes are consistent with existing shapes, e.g. round-rectangle. Consistency facilitates learning. (2) Not all curve styles would support being rounded. Having a separate property (e.g. edge-join) would create opportunities for user error -- and disappointment. |
Okay, I'll add both |
This issue has been automatically marked as stale, because it has not had activity within the past 14 days. It will be closed if no further activity occurs within the next 7 days. If a feature request is important to you, please consider making a pull request. Thank you for your contributions. |
Description of new feature
It would be awesome to internally support a new edge type: smooth segments.
I have a working implementation using unbundled bezier edges already.
You can see a demo of it at https://reactome-pwp.github.io/PathwayBrowser/R-HSA-453279
However, to do this, I have to define 3 points for each segment end point, which is not super user-friendly, specially when using a tool like https://github.com/iVis-at-Bilkent/cytoscape.js-edge-editing.
Also, at the moment, I'm using quadratic curves to do the rounding of the corners, but I think it would look even better if we could use arcs instead.
The principle I used so far is represented in the following schema

In terms of added properties, I would consider adding the following:
curve-style
:smooth-segments
control-point-distances
: same as beziercontrol-point-weights
: same as beziercontrol-point-radii
:number
|number[]
|string
smoothing-type
:arc
|quadratic
The code implementing it the following:
Motivation for new feature
We would like to use this new edge type to allow both the easy creation of smooth cornered segment edges, using https://github.com/iVis-at-Bilkent/cytoscape.js-edge-editing or something similar, and an easy visualisation of it without multiplying the number of user inputs. This would be used in the incoming reactome-cytoscape-style, of which you can see our current demo at https://reactome-pwp.github.io/PathwayBrowser/R-HSA-453279.
For reviewers
Reviewers should ensure that the following tasks are carried out for incorporated issues:
unstable
branch via pull request. The corresponding pull request is cross-referenced.The text was updated successfully, but these errors were encountered: