question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Master list of potential Plotly backend enhancements

See original GitHub issue

Overview

As discussed briefly in https://github.com/ioam/holoviews/pull/3194 with @philippjfr , this is an issue to catalog some of the ways that the plotly backend could be enhanced by taking advantage of existing plotly.py/plotly.js features. Feedback appreciated 🙂

Established Elements

The following elements are supported by matplotlib and/or bokeh and could also be supported with plotly.

Potential new elements

The following are potential new elements that I don’t think are currently supported by matplotlib/bokeh (but if I’m wrong we can just bump them up to the previous section)

General Improvements / Fixes:

  • Convert (Item)Table from figure factor to dedicated table trace type (https://plot.ly/python/table/). This trace type supports scrolling and can handle much larger tables.
  • Move from plotly.tools.make_subplots to using layout.grid for laying out subplots. This way all trace types are supported (the make_subplots approach only really supports 2D and 3D subplots, not tables, polar, etc.). Replaced by new subplot foundations in https://github.com/ioam/holoviews/pull/3255.

Streams

Plotly.js emits the events needed to detect selecting, clicking, and hovering over points in a trace. It also emits events in response to zoom and pan. It does not currently emit events for clicking and hovering the plot background (only when clicking or hover on particular points).

So I think it would be possible to support the, Selection1D, Range(X/Y), and Bounds(X/Y) streams across the elements based on scatter, scatter polar, bar, bar polar, ternary, and heatmap traces.

  • Selection1D
  • Range(X/Y)
  • Bounds(X/Y)

There might be a bit of a mismatch with the click/hover events. since plotly.js associates these with points and it looks like Holoviews wants positions.

Datashader

With the RangeXY stream and ability to display RGB images I think it should be possible to support datashader. Here’s an example of wireing up datashader in plotly.py directly with FigureWidget callbacks https://plot.ly/python/change-callbacks-datashader/.

Performance

All of plotly’s 3D trace types are WebGL accelerated. The 2D scatter trace (which would be used for the scatter, line, area, and spread elements) and scatter polar trace have both D3+SVG and WebGL implementations. The WebGL implementations support a million or so points and are pretty much feature complete so we would want to default to these, with the option of falling back to non-WebGL for generating static images in vector format.

Static image export

plotly.py recently got (standalone offline) static image export support, see https://plot.ly/python/static-image-export/. This is electron-based and so it was possible to package everything using conda without a dependency on a system web browser or webdriver. It supports raster (png, jpg, webp) and vector (svg, pdf, eps) image formats, and all formats support figures with multiple subplots. Note: All plot types can be output to vector formats, but stuff that’s rendered with webgl will be embedded in raster form.

LaTeX

Plotly supports rendering labels and annotations with LaTeX using MathJax. This is now supported in the Jupyter notebook, JupyterLab, in standalone html files, and in static image export (raster and vector). So this would make the plotly backend capable of supporting both interactive exploration and the generation of publication quality vector images with LaTeX typesetting.

Themes

Plotly recently got theming support (See https://medium.com/@plotlygraphs/introducing-plotly-py-theming-b644109ac9c7). It’s possible to configure a theme to be used by default, so it might not be necessary for Holoviews to be aware of them. But it might also be nice to be able to configure the current theme as an option.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:4
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jbednarcommented, Nov 26, 2018

That’s a very helpful list! And a lot of work. 😃 For my own work, I’m most interested in prioritizing the Potential new elements, particularly the 3D ones, to exploit the unique features of Plotly compared to the other HoloViews backends. But others may be interested in helping Plotly achieve feature parity with the other backends by fleshing out the Established Elements, so that HoloViews becomes a viable high-level API for working with Plotly.

0reactions
jonmmeasecommented, Dec 9, 2018

FYI, I’ve started playing with adding support for the Selection1D stream. What I have is a bit of a mess, but I think I’ve worked out a rough approach for adding interactive stream support. Hopefully I’ll be able to get something in PR shape this week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Master list of potential Plotly backend enhancements #3196
Potential new elements. The following are potential new elements that I don't think are currently supported by matplotlib/bokeh (but if I'm ...
Read more >
Pandas plotting backend in Python
The Plotly backend supports the following kind s of Pandas plots: scatter , line , area , bar , barh , hist and...
Read more >
Taking Another Look at Plotly - Practical Business Python
Plotly continues to evolve as a python visualization library. This article covers some of the recent improvements and why you might want to ......
Read more >
Releases — HoloViews v1.15.3
Features relating to datashader support, linked selection and improvements to the Bokeh plotting backend are called out in their own sections.
Read more >
Which library should I use for my Python dashboard?
When it comes to data visualization there are many possible tools Matplotlib, Plotly, Bokeh… Which one is fitting my short term goals, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found