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

Poor performance of tooltips on geom_tile() #1038

Open
IKupriyanov-HORIS opened this issue Mar 7, 2024 · 1 comment
Open

Poor performance of tooltips on geom_tile() #1038

IKupriyanov-HORIS opened this issue Mar 7, 2024 · 1 comment
Assignees
Milestone

Comments

@IKupriyanov-HORIS
Copy link
Collaborator

Code snippet:

import numpy as np
from scipy.stats import multivariate_normal
from lets_plot import *
LetsPlot.setup_html()
np.random.seed(42)
n = 200
x = np.linspace(-1, 1, n)
y = np.linspace(-1, 1, n)
X, Y = np.meshgrid(x, y)
mean = np.zeros(2)
cov = [[1, -.5], [-.5, 1]]
rv = multivariate_normal(mean, cov)
Z = rv.pdf(np.dstack((X, Y)))

data = {
    'x': X.flatten(), 
    'y': Y.flatten(), 
    'z': Z.flatten()
}

ggplot(data) \
    + geom_tile(aes(x='x', y='y', fill='z', color='z'), size=1) \
    + scale_gradient(['color', 'fill'], low='#54278f', high='#f2f0f7') \

Tooltips are slow to appear:

slow_tooltip.mov
@IKupriyanov-HORIS IKupriyanov-HORIS self-assigned this Mar 7, 2024
@alshan alshan added this to the New milestone Mar 8, 2024
@IKupriyanov-HORIS
Copy link
Collaborator Author

Performance degradation caused by Chrome internals - profiler says it spent time in "Commit" task. To fix this, we may need to extract a tooltip layer into a separate SVG element.

@IKupriyanov-HORIS IKupriyanov-HORIS modified the milestones: New, Backlog Mar 29, 2024
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