Skip to main content

Visualize large time series data with plotly.py in NiceGUI

Project description

NicePlotly-Resampler

PyPI PyPI downloads GitHub license GitHub issues

NicePloty-Resampler is a tool for integrating Plotly into NiceGUI, designed to handle large time series datasets efficiently. To achieve this, it dynamically downsamples data based on the current graph view, ensuring smooth user interactions like panning and zooming.

Instead of implementing its own downsampling algorithms, NicePloty-Resampler utilizes the advanced functionality of tsdownsample, which offers highly optimized methods for selecting representative data points. This allows the library to provide exceptional performance while maintaining simplicity.

By default, NicePloty-Resampler uses the MinMaxLTTB method to reduce datasets to 1000 key points for visualization.

example

Install

pip install niceplotly-resampler

Usage

from nicegui import ui
import plotly.graph_objects as go; import numpy as np
from niceplotly_resampler import FigureResampler

x = np.arange(1_000_000)
noisy_sin = (3 + np.sin(x / 200) + np.random.randn(len(x)) / 10) * x / 1_000

fig = FigureResampler(go.Figure())
fig.add_trace(go.Scattergl(name='noisy sine', showlegend=True, x=x, y=noisy_sin))
fig.update_layout(title='Noisy sine wave example', template='plotly_dark', title_x=0.5)

with ui.row().classes('w-full h-full'):
    fig.show(options={"displayModeBar": False}).classes('w-full h-full')
ui.run()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

niceplotly_resampler-0.1.2.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

niceplotly_resampler-0.1.2-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file niceplotly_resampler-0.1.2.tar.gz.

File metadata

  • Download URL: niceplotly_resampler-0.1.2.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for niceplotly_resampler-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6cf93150f97ed7a0c785d4a42430499c7d1a5f95b1648f2cb41e5076358fae0a
MD5 cfa75dba3e68403bb1390b6d6315450e
BLAKE2b-256 c8957f3f34986a7a77bee6e79f7535fbd1e0f1d1c0205ee4883bba4f70b3ca58

See more details on using hashes here.

File details

Details for the file niceplotly_resampler-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for niceplotly_resampler-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e704082c3321c959f945f2923a32f0c14f2cfe050336dfc6fd8578bf1e9f7ec0
MD5 7d66b6897cb2fb222174f85fefb28e28
BLAKE2b-256 c86aa9a69713c91d58a697fc13db3972257d6a06b073ac2c40e3de5186c3f084

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page