-
-
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
Add labelalias
to various axes
#6481
Conversation
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 to see how compact the code change is! After considering my comment https://github.com/plotly/plotly.js/pull/6481/files#r1115892864 this looks ready to me 🚀
Co-authored-by: Alex Johnson <[email protected]>
There might be some limitations related to inherited object keys e.g. {
"constructor": "my constructor",
"hasOwnProperty": "my hasOwnProperty",
"isPrototypeOf": "my isPrototypeOf",
"propertyIsEnumerable": "my propertyIsEnumerable",
"toLocaleString": "my toLocaleString",
"toString": "my toString",
"valueOf": "my valueOf",
"__defineGetter__": "my __defineGetter__",
"__defineSetter__": "my __defineSetter__",
"__lookupGetter__": "my __lookupGetter__",
"__lookupSetter__": "my __lookupSetter__",
"__proto__": "my __proto__",
"get __proto__": "my get __proto__",
"set __proto__": "my set __proto__"
} Also there may be similar limitations in python dictionaries? cc: @nicolaskruchten |
Oh that's a good point - I don't think any of those built-in keys will be a string unless you do something truly strange... but it wouldn't hurt to tighten up the initial condition if(Lib.isPlainObject(ax.labelalias) && ax.labelalias.hasOwnProperty(out.text)) Or maybe even better, move the |
"40": "$40^2$", | ||
"60": "$60^2$", | ||
"80": "$80^2$", | ||
"100": "$100^2$" |
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.
Wondering if one could possibly add $
in prefix and suffix to render every tick by mathjax?
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.
Not sure why you would do that, but maybe it would work? Not particularly related to this PR though...
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.
To have dynamic mathjax labels when you zoom in & out.
Illustrated in c1d127e.
Addressed by 428096e. |
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.
🌟 💃
@plotly/plotly_js