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

Browse page selected layers #521

Merged
merged 12 commits into from
Oct 8, 2024
Merged

Browse page selected layers #521

merged 12 commits into from
Oct 8, 2024

Conversation

dabreegster
Copy link
Contributor

Demo: https://acteng.github.io/atip/browse_layout_layers/browse.html (you have to manually load scheme data for the first two layers)

This does most of #519's part two. Now the left sidebar is used for selecting layers, but no legends/controls/help are shown there. Selected layers move to a panel on the right and are shown in the order selected. They can be toggled on/off and then deselected (from either the left or right side).

Getting this to work forced a good refactor of all the layers, organizing the different bits of their functionality.

$activeLayers = $activeLayers;
}

// The controls for each layer are defined in a layer component's optional
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a trick I've been using in many other projects. One Svelte component logically grouping some functionality can define some controls that wind up in different parts of the page. In this case, we're going a bit beyond that by centrally collecting all of the controls by name.

<div bind:this={contents}>
<CheckboxGroup small>
<div
style="display: flex; justify-content: space-between; white-space: nowrap"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nowrap thing is very weird and messes up vertical alignment. I can't make everything behave here, but we can iterate on it later

</span>
</div>
</CheckboxGroup>
{#if show}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is flexible. We might try using a collapsible card next. It should be easy to plug things in here and make them work for all layers

@@ -41,26 +37,6 @@
}
let state = customUrlState(name, defaultState, stringify, parse);

// Mutually exclusive, like a radio button. We need these for checkboxes to work
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Big change to this layer to use radio buttons. Probably should've been like this from the start

@@ -34,22 +34,19 @@
}
</script>

<Checkbox bind:checked={$show}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of boilerplate disappears

@dabreegster
Copy link
Contributor Author

Biggest ask here is running locally and helping test. I've skimmed through everything, but I might've made a mistake refactoring one of the layers

@Pete-Y-CS
Copy link
Contributor

barring a couple of font issues looks good to me

@dabreegster
Copy link
Contributor Author

Fixed and made hopefully reasonable decisions for the other things we discussed. I'll push and we can iterate further on the logged-in version. Thanks for helping test

@dabreegster dabreegster merged commit 8650cab into main Oct 8, 2024
2 checks passed
@dabreegster dabreegster deleted the browse_layout_layers branch October 8, 2024 15:30
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

Successfully merging this pull request may close these issues.

2 participants