Skip to content

Conversation

mfisher87
Copy link
Member

@mfisher87 mfisher87 commented May 21, 2025

Resolves #651

Description

This render type uses a hex code in a vector feature's attribute to define each feature's color.

For example, this undersea cables dataset includes a bunch of lines, each containing a color attribute which has a hex color code value.

The new render type allows selecting from attributes with values that look like hex color codes, and using the color from that attribute to color the feature.

Checklist

  • PR has a descriptive title and content.
  • PR description contains references to any issues the PR resolves, e.g. Resolves #XXX.
  • PR has one of the labels: documentation, bug, enhancement, feature, maintenance
  • Checks are passing.
    Failing lint checks can be resolved with:
    • pre-commit run --all-files
    • jlpm run lint

📚 Documentation preview: https://jupytergis--713.org.readthedocs.build/en/713/
💡 JupyterLite preview: https://jupytergis--713.org.readthedocs.build/en/713/lite

This render type uses a hex code in a vector attribute to define each
feature's color.
@mfisher87 mfisher87 added the enhancement New feature or request label May 21, 2025
Copy link
Contributor

Binder 👈 Launch a Binder on branch mfisher87/jupytergis/canonical-vector-color

Copy link
Contributor

github-actions bot commented May 21, 2025

Integration tests report: appsharing.space

@mfisher87 mfisher87 marked this pull request as ready for review May 21, 2025 03:04
@mfisher87 mfisher87 requested review from arjxn-py and martinRenou and removed request for arjxn-py May 21, 2025 03:04
@mfisher87
Copy link
Member Author

Is "canonical" a good name for this render type? I kind of hate it... maybe "Direct"? Other ideas?

Copy link
Member

@arjxn-py arjxn-py left a comment

Choose a reason for hiding this comment

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

Thanks for starting this Matt :)

Looks like this is still a WIP? does it work for any example?

For me it fails with:

canonical.mp4

@mfisher87
Copy link
Member Author

mfisher87 commented May 21, 2025

@arjxn-py Thanks for the review! Please try the undersea cables dataset listed in the PR description! That one contains a color attribute with hex codes.

@mfisher87 mfisher87 marked this pull request as draft May 21, 2025 14:36
@mfisher87
Copy link
Member Author

While I was in there, I also added checks for "graduated" and "categorized" render types; both require numeric values right now. In the future, we want to support non-numeric fields to be displayed with categorical rendering: #654

I also feel that we need to DRY and simplify this logic a little bit: #717

Copy link
Member

@arjxn-py arjxn-py left a comment

Choose a reason for hiding this comment

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

Looks Good!
Works Well, Thanks :)

@mfisher87 mfisher87 merged commit 0c76b7c into geojupyter:main May 22, 2025
14 checks passed
@mfisher87 mfisher87 deleted the canonical-vector-color branch May 22, 2025 15:05
@mfisher87 mfisher87 changed the title Implement new "Canonical" render type for vector layers Support coloring vector features by an attribute containing a hex color code May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support coloring vector features based on an attribute containing a hex color code
2 participants