Skip to content

Identify tool#270

Merged
martinRenou merged 30 commits intogeojupyter:mainfrom
gjmooney:identify_tool
Jan 10, 2025
Merged

Identify tool#270
martinRenou merged 30 commits intogeojupyter:mainfrom
gjmooney:identify_tool

Conversation

@gjmooney
Copy link
Collaborator

@gjmooney gjmooney commented Dec 24, 2024

First iteration of identify tool mentioned in #237

This only works for tiff and vector layers right now.

identify

You can also see the identified features of the user you are following now
collabfeature

@gjmooney gjmooney requested a review from mfisher87 December 24, 2024 16:01
@github-actions
Copy link
Contributor

Binder 👈 Launch a Binder on branch gjmooney/jupytergis/identify_tool

@github-actions
Copy link
Contributor

github-actions bot commented Dec 24, 2024

Integration tests report: appsharing.space

@github-actions
Copy link
Contributor

Preview using JupyterLite: appsharing.space

@github-actions
Copy link
Contributor

Docs preview: appsharing.space

@gjmooney gjmooney added the enhancement New feature or request label Dec 24, 2024
@mfisher87
Copy link
Member

Sick!!!

@gjmooney gjmooney force-pushed the identify_tool branch 3 times, most recently from abf2261 to 5247bef Compare January 8, 2025 13:54
@gjmooney gjmooney marked this pull request as ready for review January 8, 2025 13:54
@gjmooney gjmooney requested a review from martinRenou January 8, 2025 13:54
@mfisher87
Copy link
Member

mfisher87 commented Jan 8, 2025

@gjmooney ready for the WIP indicator be removed from the PR title?

@gjmooney gjmooney changed the title [WIP] Identify tool Identify tool Jan 8, 2025
Copy link
Member

@mfisher87 mfisher87 left a comment

Choose a reason for hiding this comment

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

Looks great to me! I don't yet feel confident enough in the overall architecture to "approve" such a big change, so I'll just leave my comments :)

Comment on lines 231 to 248
fill: new Fill({
color: '#f37626'
})
Copy link
Member

Choose a reason for hiding this comment

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

I think this looks great! But I'm also wondering if we should more closely mirror the QGIS behavior which is to apply a heavy red stroke to identified features. Will Jupyter Orange more readily conflict with common colormaps? In QGreenland we chose a white-to-orange colormap for earthquakes, I don't really remember why, but for that colormap, Jupyter Orange would not stand out.

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Personally, I think the red QGIS uses is hideous, and hard to see. Any color we use for the highlight could potentially conflict with a colormap, ideally the highlight color should be user customizable (along with the width, hit tolerance, etc.). For now I made the color a little more red and added a border so hopefully they stand out a bit more.

highlightstroke

Copy link
Member

Choose a reason for hiding this comment

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

I agree the color in QGIS is pretty ugly :) But since the effect in QGIS is a heavy stroke on the existing point, even if the color conflicts, the feature becomes visibly larger. We can always continue to tweak on user feedback; thanks for hearing me out!

label: '',
commands: options.commands
})
);
Copy link
Member

@mfisher87 mfisher87 Jan 8, 2025

Choose a reason for hiding this comment

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

Thinking aloud about the future, we could have more buttons here for "point identify", "polygon identify", "bbox identify", and "normal mode"?

syncViewport(viewport?: IViewPortState, emitter?: string): void {
this.sharedModel.awareness.setLocalStateField('viewportState', {
value: viewport,
emitter: emitter
Copy link
Member

Choose a reason for hiding this comment

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

Let's ban this style with a lint rule? :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🤷 I'm fine with either way

@mfisher87
Copy link
Member

You can also see the identified features of the user you are following now

This is super slick!! 🤩

Copy link
Member

@martinRenou martinRenou left a comment

Choose a reason for hiding this comment

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

Amazing! That looks neat 😄

As a follow-up, it may be nice to make the list of selected features on the right more interactive (highlight/pan-to feature on click etc). I will open an issue to track this.

@martinRenou
Copy link
Member

martinRenou commented Jan 10, 2025

please update snapshots!

Copy link
Member

Choose a reason for hiding this comment

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

Could this be an actual issue with the PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed the stroke for the default style for some reason? I'll just put it back.

Copy link
Member

@martinRenou martinRenou left a comment

Choose a reason for hiding this comment

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

Thanks!

@martinRenou martinRenou merged commit c2372d3 into geojupyter:main Jan 10, 2025
@gjmooney gjmooney deleted the identify_tool branch January 10, 2025 11:34
HaudinFlorence pushed a commit to HaudinFlorence/jupytergis that referenced this pull request Jan 28, 2026
* Identify tool start

* Collapsable attempt

* Keep UI basic

* Handle HTML

* Add toolbar icon

* Add identify toggle

* Move filters to left panel

* Set up identify panel

* Move features list to panel

* Grid attempt

* Get panel looking good

* Improve CSS

* Clear panel on file change

* Get toolbar to work with multiple files

* Clean up

* Add identify for webgltile layers

* Handle no selected layer

* Highlight selected vector features

* Use getFeatures for interaction

* Use feature ref in handler

* Display collaborators features if following

* Update identify switch

* Remove unused execute args

* Make identify button toggleable and add esc keybinding

* Tweak highlight color

* Require layer to be selected

* Have first feature expanded by default

* Iterate on layer requirement

* Put stroke back

* Update Playwright Snapshots

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.

3 participants