Skip to content
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

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

Open
jhgorse opened this issue May 3, 2023 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation duplicate This issue or pull request already exists integration Integration with new environments/tools/...

Comments

@jhgorse
Copy link

jhgorse commented May 3, 2023

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:

  • register_plotly_resampler(mode="widget", default_n_shown_samples=1500) # auto inline_persistent inline widget
  • FigureWidgetResampler

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
Copy link
Member

jonasvdd commented May 4, 2023

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

@jonasvdd jonasvdd added documentation Improvements or additions to documentation duplicate This issue or pull request already exists integration Integration with new environments/tools/... labels May 4, 2023
@jonasvdd jonasvdd self-assigned this May 4, 2023
@jhgorse
Copy link
Author

jhgorse commented May 4, 2023

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

jonasvdd added a commit that referenced this issue May 7, 2023
jonasvdd added a commit that referenced this issue May 14, 2023
* 🍌 formatting

* 💨 first version of log axis support

* 🙈 fix tests

* 🔧 adresses #190 and #205

* 🙈 formatting

* Datetime bugfix (#209)

* 💪 add tests for #208

* 🙏 fix for #208

* Fixes #210 (#211)

* 💪 add tests for #208

* 🙏 fix for #208

* ✨ tests for #210

* 💪 code-fix for #210

* 🔧 tests for setting hf_x dynamically for #210

* 🔥 fix for setting hf_series x to a tz-aware pd.Series

* 🖊️ review

* 🔍 review code

* 🔍 fix helper method

* 🙏

---------

Co-authored-by: jvdd <boebievdd@gmail.com>

* 🔍 review

* 🖊️ review code

* ✨ improve docs + add rangeindex log test

* 💨 fix test + add example

* 🔍 review code

---------

Co-authored-by: jvdd <boebievdd@gmail.com>
Co-authored-by: Jeroen Van Der Donckt <18898740+jvdd@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation duplicate This issue or pull request already exists integration Integration with new environments/tools/...
Projects
None yet
Development

No branches or pull requests

2 participants