-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
Clearing title and label with vis-network #739
Comments
I've discovered how to remove title and label from edge and node, but in a very goofy way... By in a unit of work first remove the object from the |
It turns out that vis-network handle node and edge differently on further investigation. E.g. when I update a node and set property To do the goofy way as I put yesterday (remove the node or edge from the Please, have a look at why it's impossible to clear out label/title with edges (not good with nodes either). The second alternative is to simply put a space as label/title, but then an annoying pop-up (for title) is displayed every time a mouse cursor hovers over, e.g. an edge. Not a good user experience either. Thanks |
Further examining the source code, maybe the problem is with this... When the edge in the
Remember that I want to clear out the label, so the value of the label is The call gets to the actual checking of the label, and here it only accepts type of
But if we back up in the call chain, we see that Perhaps it would be good to do the following with the check for validity of the label:
To enable the possibility of clearing out labels in the network. |
Hi, Doing the change as I earlier mentioned, breaks another code section that relies on if (!ComponentUtil.isValidLabel(text)) {
return this.lines.finalize();
}
var font = this.parent.fontOptions;
// Normalize the end-of-line's to a single representation - order important
text = text.replace(/\r\n/g, '\n'); // Dos EOL's
text = text.replace(/\r/g, '\n'); // Mac EOL's If adding the following check (and the change as put earlier) if ((text === undefined) || !ComponentUtil.isValidLabel(text)) {
return this.lines.finalize();
} Then we have the ability to clear out the label, by setting the label to The thing remaining is clearing out the title (the text that pops up when mouse hovering on the element). Thanks |
I'd like to solve this in Vis Data. There really should be a way to remove props from items in data sets. However the fact that |
Thanks @Thomaash, |
Hello,
I've discovered that ones I set a title or label with a vis-network edge, then it's hard to clear it out. I can clear out the label for an edge by providing a string with a space, e.g.
' '
, but it will not work with the title. The title will show a small pop-up that is empty. I've tried updating the edge withundefined
(causes no change to the edge),null
and empty string''
and string with one space' '
only causes the small pop-up to be empty (with mouse over the edge).I've looked through the issues and so on, and not seen anything about this particular case, that is, clearing out a title or label for edge or node. It would be great to know if there is an issue with vis-network (maybe in combination with
DataSet
) or if there is some other way it's supposed to be done.I'm currently on Using Windows 10, Chrome and Edge Chrome.
Thanks
The text was updated successfully, but these errors were encountered: