-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Allow null and NaN in text templates #7360
Conversation
keep the original isValidTextValue except in templating
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexcjohnson I'm curious why line 90 doesn't need to be
out[j] = npGet(curCont[j], parts.slice(i + 1))(retainNull);
i.e. passing the retainNull
value to the recursive function call.
Not important or a blocker, just idle curiousity!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch @emilykl! I'm not sure we actually use array index -1 for "get properties inside each array element" anywhere (I suppose users could access this via Plotly.restyle
or Plotly.relayout
but that way they don't have access to nestedProperty
directly), and I certainly didn't need it for my use case, but since it's there we should support it -> a348c24
Fixes #7317
There can be good reasons to leave null values in the data to be shown in hover and text templates, but we were treating this as a broken template string. This allows those values to stay and get stringified.