You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Label is initialised with an invalid label (such as an empty string), the visible() function still says that it is visible.
Similarly, the draw() function does not short-circuit when the label is invalid.
The root cause is Label.js line 42 which sets options.label to an empty string.
Both the visible and draw functions are checking for undefined, not empty string - so that is why they don't work as expected.
Label.js:
if (ComponentUtil.isValidLabel(options.label)) {
this.labelDirty = true
} else {
// Bad label! Change the option value to prevent bad stuff happening
options.label = '' **************** THIS IS THE PROBLEM - SHOULD BE undefined **************
}
PR coming.
The text was updated successfully, but these errors were encountered:
channeladam
added a commit
to channeladam/visjs-network
that referenced
this issue
Jan 18, 2019
When Label is initialised with an invalid label (such as an empty string), the visible() function still says that it is visible.
Similarly, the draw() function does not short-circuit when the label is invalid.
The root cause is Label.js line 42 which sets options.label to an empty string.
Both the visible and draw functions are checking for undefined, not empty string - so that is why they don't work as expected.
Label.js:
if (ComponentUtil.isValidLabel(options.label)) {
this.labelDirty = true
} else {
// Bad label! Change the option value to prevent bad stuff happening
options.label = '' **************** THIS IS THE PROBLEM - SHOULD BE undefined **************
}
PR coming.
The text was updated successfully, but these errors were encountered: