Replies: 4 comments 8 replies
-
Hi Dan, Adding visual style properties to the library, without modifying the library directly, is not likely to be pragmatic. A feature that merits a style property ought to be integrated into the library itself. Let's start by enumerating your proposed features with questions like these: Which of these features could be accomplished on top of the library? Conversely, which features would absolutely require direct integration in the library? Which features could be new extensions? Could some features be accomplished already, with a combination of existing style properties and extensions? Looking forward to your response, Max |
Beta Was this translation helpful? Give feedback.
-
Thanks @maxkfranz! Let's run through them.
|
Beta Was this translation helpful? Give feedback.
-
We’ll need to make an issue for the milestone anyway, so we might as well start with that. It will be good practice for the other, more complex features, even though the outline specification would be simple. In future, the issues will be increasingly important for the other features, to avoid unnecessary or duplicated effort. Imagine implementing an entire costly feature, and then later discovering that it has to be redone.On Aug 17, 2023, at 03:13, Dan Prince ***@***.***> wrote:
Sure. Happy for us to just land a PR directly or is it useful to kick off with an issue describing how we see the outline style property working?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
We are interested in styling the edge lines with "border-xxx" attributes (color/opacity/width/...). |
Beta Was this translation helpful? Give feedback.
-
We'd love to use Cytoscape.js as part of a project, but one of the blockers is not having a clear way to extend the rendering functionality.
For example, we'd like to add a "bullseye" decoration, which would render a smaller inset version of a node's shape, with its own size and color. This would also involve adding additional style properties.
Currently it seems like the unrecognised properties aren't parsed (or at least they aren't accessible through
pstyle
) and the best way I can see to augment the renderer involves patching outdrawNode
. For example:The problem with this approach is that the only control is whether the additional decorations are rendered above or below the original renderer's node. This means we can't render the bullseye above the node body, but below the label.
The simplest way to achieve this would be to fork Cytoscape and add the appropriate properties and renderer handling for them.
If any of these kinds of properties would be accepted upstream, then we'd be happy to contribute them.
Some of these go beyond rendering concerns and into the interaction layer. For example scale and margin both change the overall shape with respect to layout and connection positions.
The ideal scenario would be an extension point that would allow us to register additional styles and extend the existing canvas renderer for drawing them, but definitely recognise that this might just be an awkward API to design for a fairly limited use case.
Good to start that conversation either way, so that we can get some idea of how to move forwards!
Beta Was this translation helpful? Give feedback.
All reactions