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

fix(scatterplot): address an issue where maidr.show rendering is sluggish when there are massive data points #68

Closed
jooyoungseo opened this issue Aug 14, 2024 · 2 comments
Assignees

Comments

@jooyoungseo
Copy link
Member

Reproducible Steps

  1. Execute the following code in the Python repl:
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import maidr
diamonds = sns.load_dataset("diamonds")

# Scatter plot for Carat vs price in the diamonds dataset
plt.figure(figsize=(10, 6))
karrat = sns.scatterplot(data=diamonds, x="carat", y="price")
plt.title("Carat vs Price")
plt.xlabel("Carat")
plt.ylabel("Price")
plt.show()
maidr.show(karrat)
  1. Tab to the interactive maidr plot area in the browser and use RightArrow to navigate the data points.

Current Issue

maidr does not respond.

@SaaiVenkat
Copy link
Collaborator

SaaiVenkat commented Aug 14, 2024

Professor @jooyoungseo,

Benchmark Timings

  • plt.savefig(): 450 milliseconds (on average)
  • maidr.save_html(): 710 milliseconds (on average)

Observation

  • Even though the increase in time seems significant (around 50%), I believe the overall processing time is well within acceptable range.
  • The more time corresponds to the extraction of data and the injection of custom property for highlighting.

Thoughts

  • Python binder performs only the extraction, and the rendering is performed by the upstream library.
  • Since the datapoints are so many, handling the corresponding highlighting and sonification events makes the rendering sluggish. We should investigate more with the JS library.

@SaaiVenkat
Copy link
Collaborator

Moved the issue to the upstream repo - xability/maidr#518

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants