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

Adjust color/styling of different layers #292

Merged
merged 5 commits into from
Jul 26, 2023
Merged

Adjust color/styling of different layers #292

merged 5 commits into from
Jul 26, 2023

Conversation

dabreegster
Copy link
Contributor

Notably, let the user choose to color interventions by ATF funding round. As we get more scheme-level data (like construction/completion status), this could become more useful. I've adjusted the basemap style and most colors using my best judgment and some of the brand guidelines, but this is still very much in need of design help.
Screenshot from 2023-07-26 12-06-28
Most of the PR is refactoring, I'll comment inline

Copy link
Contributor Author

@dabreegster dabreegster left a comment

Choose a reason for hiding this comment

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

Async review welcome

@@ -54,6 +55,13 @@
Major Road Network
</ExternalLink>.
</p>
<p>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Going back to the stand-up this morning, some kind of standardized data catalog where we record license, owner, when we accessed the data, etc would be handy, and we can surface some of this info if it's useful

];
}

$map.setPaintProperty("interventions-points", "circle-color", color);
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 how to change a layer's styling rules dynamically

@@ -35,17 +34,12 @@ export function processInput(
}

for (let feature of gj.features) {
schemes.get(feature.properties!.scheme_reference).num_features++;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I cleaned up these problems in the latest version of the scheme file I've sent around

@@ -21,6 +21,7 @@
choices={[
["streets", "Streets"],
["hybrid", "Satellite"],
["dataviz", "Dataviz"],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

MapTiler has a bunch of basemap styles. This one looks the most neutral to me, showing enough to help people orient, but getting out of the way to let the data on top show clearly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just refactored this multi-row color legend pattern

@@ -52,24 +53,19 @@ export class RouteTool {
id: "route-points",
source,
filter: isPoint,
color: [
"match",
color: matchValue(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There were a few places where we were using maplibre case or match manually. All using this one helper method now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There were too many functions added to types.ts. Ideally these could be methods on the Schema type, but since it's just a wrapper around a string, haven't sorted out exactly how to do that yet

@dabreegster dabreegster merged commit 509abd8 into main Jul 26, 2023
2 checks passed
@dabreegster dabreegster deleted the group_coloring branch July 26, 2023 11:14
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.

1 participant