Closed mkelly1495 closed 2 years ago
The rounded shapes seem to only support rounded, convex corners (#2496). Your suggested shapes have concave curves, and that seems quite a bit different to me. Maybe @josejulio could chime in re. his rounded shapes feature.
It seems that it may be better to add the shapes natively. That may be easier for AND and OR, and other shapes like NOT or XOR probably aren't practical via the polygon feature anyway. Once you add AND and OR, it's inevitable that people are going to ask for the others. These shapes would probably work nicely with taxi edges.
PRs are welcome for new node shapes. You can look at @josejulio's PR #2496 for a good example of the process.
The rounded shapes seem to only support rounded, convex corners (#2496). Your suggested shapes have concave curves, and that seems quite a bit different to me. Maybe @josejulio could chime in re. his rounded shapes feature.
That's correct. The PR only introduce support for the rounded corners. Passing the polygon points to generateRoundPolygon
will only make the curved corners and that won't be useful for the and/or gates.
Referenced PR gives some reference on the needed pieces:
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
Cytoscapejs already has the ability to create rounded polygons using a set of points (internally). However, the functionality is internal and cannot be utilized for custom shapes. I propose adding the ability to specify
shape: round-polygon
with a list ofshape-polygon-points
(similar to what is used forpolygon
). This will allow shapes that require arcs (e.g.and
,or
gate symbols) to be drawn without requiring a ton of points.Motivation for new feature
I would like to be able to have graphs that include
and
andor
gate symbols. These symbols are fairly simple but require arcs that are not easily created using straight line polygons. This issue would be resolved by having the ability to specify the polygon as round-polygon. Then the shapes could be created with only a few points and wouldn't have any jagged edges.So essentially, I'm asking for support for
shape: round-polygon
that takes the points specified by ashape-polygon-points
style property and invokes thenode-shapes.js
generateRoundPolygon
function with the specified points in order to render the desired shape. Currently this function is invoked internally to support the fixed set of rounded shapes (e.g.round-diamond
).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.