cytoscape.js-edgehandles
cytoscape.js-edgehandles copied to clipboard
Cannot style ghost node
I want to use the created ghost node as some kind of placeholder to allow users to create a new target node (in case the user stops the edge handling and the mouse is not on a existing target node).
However, I noticed that my styling (targeting the classname 'eh-ghost-node') about width, height and opacity etc are not applied. This is due to this plugin setting those hardcoded.
My workaround now is just overriding those styles upon the 'ehstart' event like this:
this.cy.on('ehstart', () => {
window.setTimeout(() => {
this.cy.nodes('.eh-ghost-node').style({
"width": 300,
"height": 30,
'opacity': 1
});
}, 10)
});
But that's of course rather ugly. Is it an idea to only apply the default styling when no custom styling is available?
You're outlining a new use case.
Current behaviour prevents user error w.r.t. the stylesheet. You can currently start with no special styles in your stylesheet and the extension 'just works', even though it's unstyled and it's not pretty.
Your proposed use case looks valid and it would be good to support it -- but it would be good to keep this nice, old behaviour in some way for the benefit of novices.
This issue has been automatically marked as stale, because it has not had activity within the past 30 days. It will be closed if no further activity occurs within the next 30 days. If a feature request is important to you, please consider making a pull request. Thank you for your contributions.
@nielsboogaard, would you make a pull request with your proposed changes?
hey @maxkfranz have to see when I have time for this, but I'll give it a try!
Great. Let me know if you have any questions.
Let's plan to keep the current behaviour by default, since it serves most use cases well. Your new behaviour could be exposed in a new boolean option.
This issue has been automatically marked as stale, because it has not had activity within the past 30 days. It will be closed if no further activity occurs within the next 30 days. If a feature request is important to you, please consider making a pull request. Thank you for your contributions.
This issue has been automatically marked as stale, because it has not had activity within the past 30 days. It will be closed if no further activity occurs within the next 30 days. If a feature request is important to you, please consider making a pull request. Thank you for your contributions.