-
Notifications
You must be signed in to change notification settings - Fork 43
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
Html label inside the node / node size as a function of html label / add hook for DOM update #12
Comments
@cversari can you share how are you calculating the node size based on the HTML label? |
@morficus just wrap the label content in a |
Hello Cristian! Did you manage to solve your problem? |
I can now update the node size by simply adding a return in addOrUpdateElem function
then update the node when creating the html label
however , I encountered a new problem , when I click the link on the label , It actually click the node , I haven't found a solution yet |
Hello,
first of all, thank you for this extension which I find extremely useful.
I am currently using the html label to display html content inside a node, by placing the label in the center of the node and resizing dynamically the node as a function of the size of the label (which may change over time during the lifetime of the node).
However I cannot do it in a clean way, because when the content of the label is changed, the addition of the html label to the DOM takes time and there is no triggered event that tells me when the document update is complete. Therefore I must use setTimeout() and wait for some milliseconds before calling the function that updates the sizes of the nodes. This is quite risky, because for some platforms the update time is long (mobile phones for example). On the other hand, having a too long timeout makes the UI quite impractical to use.
I also tried to add a script tag to the html label, to trigger a function as soon as the element is added to the DOM, but then the parsing of the label fails for some reason.
So here is my feature request: would it be possible to automatically update the size of the node as a function of the size of its html label?
Alternatively: would it be possible to specify a hook function in nodeHtmlLabel() parameters, that is triggered when the update of the DOM is complete?
Thank you
Cristian
The text was updated successfully, but these errors were encountered: