predict-idlab / plotly-resampler

Visualize large time series data with plotly.py
https://predict-idlab.github.io/plotly-resampler/latest
MIT License
993 stars 67 forks source link

cannot get dynamic resampling in databricks python notebook (or generated html) #205

Open jhgorse opened 1 year ago

jhgorse commented 1 year ago

Greetings,

I am trying to generate a standalone html file, as plotly does, with the plotly-resampler such that it will dynamically resample based on zoom events. Currently, I get statically resampled windowed data that does not resample on zoom.

I have tried various combinations from the documentation, including:

Databricks notebook is free here: https://community.cloud.databricks.com/login.html

The only addition I made were the python libraries here with this cell: %pip install plotly_resampler lttbc

Thank you for your time.

Cheers, Joe

jonasvdd commented 1 year ago

Hi @jhgorse,

regarding the HTML export, I suggest you first look at our docs' FAQ and this related issue #175

I have not yet tried the DataBricks notebooks. But we already observed that plotly-resampler does not seem to work in Kaggle notebooks. This is caused by: 1) Kaggle did not seem to support Plotly FigureWidgets at the time of the investigation. Can you make a plain plotly FigureWidget work in the Databricks notebook environment? 2) Furthermore, the notebooks did not allow forwarding the network port that needs to be spawned for the Dash app. Are there any settings or documentation w.r.t. port forwarding for Databricks notebooks?

As a final note. Plotly-resampler leverages the Python back-end to perform aggregation based on javascript (front-end) interaction. So you always need a connected kernel to perform aggregation. The only way you would be able to create such resample visualizations in HTML without a connected Python kernel is if the unaggregated data resides within the HTML file and the aggregation would be performed in the JavaScript code. This would increase the size of HTML files significantly, making it a big hassle to share and load these files.

I hope this answers your question, Kind regards Jonas

jhgorse commented 1 year ago

Jonas,

Thank you kindly for writing.

The FAQ question and answer content What is the difference between plotly-resampler figures and plain plotly figures? belong on the main github plotly-resampler readme. Before Features and after the intro paragraph. This is the key architectural information which communicates what plotly-resampler actually is. Thus prescribing its intended use and limitations.

I read #175. My use case is different.

We have a lot of data. Few look at it. The notebooks are all specialized with great learning curves and people are spread thin. I want to fix the viewing problem by making self-contained, browser-only dependency, html js plots with a good deal of data historical data up to the present. The target is about 50 to 100 MB of compressed data, which gets you pretty far in terms of visibility. If they want to change things, use the notebook it came from. I want data exploration to be painless click-drag, point zoom, plotly-esque. I want it to start zoomed out and allow significant zooming in to the finer granular data.

So, if possible, I want a standalone plotly-resampler.

If I must have a server involved in this, then I also want live, real-time updates (sub 5 second latency). =)

Hope this finds you well.

Cheers, Joe