Conversation
| ACCENT_COLOR = '#007ACC' # Professional blue | ||
| FONT_FAMILY = 'Roboto' | ||
|
|
||
| def create_bokeh_theme(font_family=FONT_FAMILY, accent_color=ACCENT_COLOR): |
There was a problem hiding this comment.
I wish there was a better font default in HoloViews/ Bokeh. Or a very easy way to change it.
| 'Axis': { | ||
| 'axis_label_text_font': font_family, | ||
| 'axis_label_text_font_size': '12pt', | ||
| 'axis_label_text_font_style': 'bold', |
There was a problem hiding this comment.
I don't think the default italic style is readable or modern. bold is much better in my opinion.
| 'major_label_text_font': font_family, | ||
| 'major_label_text_font_size': '10pt', | ||
| 'major_tick_line_color': "black", # Remove tick marks | ||
| 'minor_tick_line_color': None |
There was a problem hiding this comment.
I think the minor lines should be removed in a business setting. They add too much complexity.
| 'label_text_font_size': '10pt' | ||
| }, | ||
| 'Toolbar': { | ||
| "autohide": True, |
There was a problem hiding this comment.
I wish that autohide=True by default. This is a huge simplification for users to look at. Especially for panel dashboards.
| }, | ||
| # Does not work via Theme, so added here for reference purposes until I figure out how to do it | ||
| 'Tooltip': { | ||
| "stylesheets": [f""" |
There was a problem hiding this comment.
I could not figure out how to change the tooltip text color. I believe this should work but does not. Maybe a Bokeh Theme issues?
| 'plot.min_border_top': 80, # Add padding on top | ||
| } | ||
|
|
||
| ElementPlot.param.backend_opts.default = GLOBAL_BACKEND_OPTS |
There was a problem hiding this comment.
I think this way of setting global opts is a hack. But it did not work setting them via hv.opts.defaults.
| ElementPlot.param.backend_opts.default = GLOBAL_BACKEND_OPTS | ||
| ElementPlot.param.yformatter.default = NumeralTickFormatter(format='0a') # 1k, ... | ||
|
|
||
| hv.opts.defaults( |
There was a problem hiding this comment.
I think the defaults below would give holoviews a more fresh and modern look.
| ('Magnitude', '@mag_class'), | ||
| ('Events', '@event_count{0,0}'), # Format: 1,234 | ||
| # tooltips below do currently not work on Labels | ||
| # ('Percentage', '@percentage{0 a}%'), # Format: 45.7% |
There was a problem hiding this comment.
Could not get additional tooltips working for Labels. Believe its a bug. Reported in #6769.
| # HOLOVIEWS OPTS SETUP - Define global configuration | ||
| # ============================================================================ | ||
|
|
||
| GLOBAL_BACKEND_OPTS={ |
There was a problem hiding this comment.
I tried to set these GLOBAL_OPTS in the bokeh Theme but could not get it working. Especially the min_border would be nice to set in the theme instead.
| } | ||
|
|
||
| ElementPlot.param.backend_opts.default = GLOBAL_BACKEND_OPTS | ||
| ElementPlot.param.yformatter.default = NumeralTickFormatter(format='0a') # 1k, ... |
There was a problem hiding this comment.
The default scientific notation on the y-axis is always a problem in a business context. Nobody uses it.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6772 +/- ##
=======================================
Coverage 89.23% 89.23%
=======================================
Files 340 340
Lines 73183 73183
=======================================
Hits 65303 65303
Misses 7880 7880 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I was struggling trying to create the most basic publication quality business like chart - a bar chart. So I would like to add a new category and an example to the gallery.
What I see very often in a business context is that people give up on bokeh/ holoviews because it does not look at pretty as alternative libraries. That is a shame because they are very powerful libraries that provides something unique.
I hope a "Business Quality" gallery category can help users and maybe inspire HoloViews/ Bokeh to provide more business friendly defaults and easy to use methods.
Inspired by https://www.atlassian.com/data/charts/bar-chart-complete-guide.
For inspiration andrew also created https://medium.com/@pYdeas/create-publication-styled-figures-with-hvplot-using-the-bokeh-backend-b623ab48a5d2.