quantified-uncertainty / squiggle

An estimation language
https://squiggle-language.com
MIT License
150 stars 23 forks source link

Canvas chart layouts (broken/incomplete) #3310

Open berekuk opened 3 months ago

berekuk commented 3 months ago

This PR is in bad shape, and doesn't even pass typescript checks right now, but I want to preserve it, just in case.

It includes: 1) an attempt to layout charts with https://www.yogalayout.dev/ and a new function-based API on top of that, inspired by React 2) mostly complete rewrite of DistributionsChart with that API 3) incomplete/broken attempt to integrate yoga layout with React more deeply (see ReactCanvas)

(1) is tolerable, but turned out to be too clunky in some places.

(3) is promising, but polishing it would take too much time: it's not obvious where to use useEffect and where to useLayoutEffect, and the separation between layout stage where we calculate positions and sizes, and drawing stage, is a hard problem.

vercel[bot] commented 3 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
quri-hub ❌ Failed (Inspect) Jun 6, 2024 5:25pm
quri-ui ✅ Ready (Inspect) Visit Preview Jun 6, 2024 5:25pm
squiggle-components ❌ Failed (Inspect) Jun 6, 2024 5:25pm
squiggle-website ❌ Failed (Inspect) Jun 6, 2024 5:25pm
changeset-bot[bot] commented 3 months ago

⚠️ No Changeset found

Latest commit: 93743a6323ff49dd71ef276cb6d96765a7d2313e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR