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

some charts don't render correctly on load (but then render correctly when you perturb them) #506

Closed
quinn-dougherty opened this issue May 10, 2022 · 5 comments · Fixed by #893 or #1377
Assignees

Comments

@quinn-dougherty
Copy link
Contributor

Description:

2022-05-10_12-46
2022-05-10_12-46_1

Steps to reproduce:

  1. https://develop--squiggle-documentation.netlify.app/docs/Features/Distributions#mixture
  2. click With Continuous and Discrete tab
  3. observe chart not rendering correctly
  4. do a idempotent operation to the squiggle string (like remove a ) and re-add it)
  5. observe chart that we want

Expected behavior:

the chart that shows in step 4 should be on load

What I got instead:

chart seems borked.

@Hazelfire
Copy link
Collaborator

That seems very odd. I think I know why that happens

@OAGr
Copy link
Contributor

OAGr commented May 15, 2022

Right now the memoization is kinda hacky. It probably would be good to submit the entire Squiggle string to the FunctionChart, for it to use as one of the keys for memoization.

@berekuk
Copy link
Collaborator

berekuk commented Jun 18, 2022

This is due to docusaurus rendering all tabs in advance (facebook/docusaurus#3706), and squiggle-components using useSize, which assigns zero width for tabs rendered offscreen.

@berekuk
Copy link
Collaborator

berekuk commented Jul 28, 2022

I thought I'd need useMeasure or Resize Observer API to detect when the component appears on screen, but turns out there's a lazy option for <Tabs>. Yay.

PR incoming.

@OAGr
Copy link
Contributor

OAGr commented Jul 28, 2022

Some are still broken:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
5 participants