-
-
Notifications
You must be signed in to change notification settings - Fork 545
enh(echarts): Support custom ticklabel formatter #7940
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7940 +/- ##
==========================================
- Coverage 87.12% 86.09% -1.03%
==========================================
Files 346 346
Lines 53225 53225
==========================================
- Hits 46372 45826 -546
- Misses 6853 7399 +546 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@@ -89,6 +89,11 @@ export class EChartsView extends HTMLBoxView { | |||
if ((window as any).echarts == null) { | |||
return | |||
} | |||
const series = this.model.data.series[0] |
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.
Documentation should be added :-)
@@ -89,6 +89,11 @@ export class EChartsView extends HTMLBoxView { | |||
if ((window as any).echarts == null) { | |||
return | |||
} | |||
const series = this.model.data.series[0] | |||
if (typeof series.axisLabel.formatter === "string") { |
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.
Its a general problem with our echarts implementation that we cannot use a js function. See #2634.
Would be nice with a general solution.
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.
See pyecharts might even support/ work with python functions.
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.
PyEcharts provides JSCode
utility class for supporting js functions.
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.
Its a general problem with our echarts implementation that we cannot use a js function
I will go even further, as each of these escape hatches with static configurations has this problem, another example is tabulator.
So I agree we should have a general solution for this. I need to look into how this can be done, as it needs to be done much earlier than here, likely with a custom model.
This was mainly a POC I pushed (and still a draft) to check if I could do it for this requested instance.
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.
The obvious solution would be to build on bokeh's CustomJS
support.
Resolves #7936
This could be generalized to a custom model. Currently, this is hardcoded to this one instance.
Details