stamen / chartographer

https://stamen.github.io/chartographer/
MIT License
19 stars 4 forks source link

Perf improvement #38

Closed aparlato closed 1 year ago

aparlato commented 2 years ago

Closes https://github.com/stamen/chartographer/issues/37

This PR caps possible combinations of properties and values to a maximum of 10. This value is contained in a store and as followup we could allow the user to manipulate it.

This PR also moves expandLayers work into a web worker to run on a separate thread. This will open up space to allow other operations to happen while loading if needed. Right now, we are using this ability to show a loading progress bar based on the number of layers that have been expanded to give the user and idea of how long it will take instead of thinking it's just hanging/frozen.

Lastly, we only expand layers on a style once now and keep that value in a store so that we don't need to load on every page.

Using the provided example style I'm seeing a lot of problems happen on the lines page, but this feels unrelated to this PR (and probably related to the style), so I'm inclined to address separately.

@ebrelsford I want to put this PR up now so it doesn't bloat, but I could see additional followup tasks to:

🚨 Also last thing to note: This PR looks larger than it is because my prettier setup formatted the files I worked in. Sorry for that. We should implement a prettier setup in this repo and consistify it.

aparlato commented 2 years ago

@ebrelsford good call, I just moved the expanded layers logic up a level to App.svelte!

aparlato commented 2 years ago

Noting for myself on here followup issues to open once this merges: