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

Highlight related members #3140

Closed
wants to merge 3 commits into from
Closed

Highlight related members #3140

wants to merge 3 commits into from

Conversation

Sinya
Copy link

@Sinya Sinya commented May 31, 2016

I notice the issue: indicate route membership with shadow #659 and related issues #2980 . I modify few lines in raw_membership_editor.js.

This make when selecting a relation, all members (including points, ways) are highlighted on the map.

highlight related members

@bhousel
Copy link
Member

bhousel commented Jun 1, 2016

I'm not sure if it's a good idea to class multiple things as selected without actually selecting them.. Doesn't this make the operations on radial menu misleading?

For example, in your screenshot above, it looks like 3 things are selected. If the user clicks the trash can on the menu, they'd end up deleting only the relation, leaving the member items around.

@Sinya
Copy link
Author

Sinya commented Jun 1, 2016

Thanks for suggestions :) I think I should new a class different from selected that just has highlight effect. And when selecting relation, it will lead editorPane to "relation edit mode". All members (including points, ways) are highlighted (maybe with color yellow?) with same relation. As the editorPane leave "relation edit mode" should cancel the highlight at the same time.

This my preliminary thought of this issue.

@slhh
Copy link
Contributor

slhh commented Jun 1, 2016

@bhousel, we have three different cases:

  • Relation members of a selected relation are already shown as selected in case of a multiselection (1 relation and at least one other feature selected). Unfortunately, this is the case where I would really agree on being misleading.
  • In case of a single relation being selected showing members as selected might become an issue in future, but currently I would disaree on being misleading. The radial menue is not available in this case, and the feature type in the inspector is indicating that a relation is selected.
  • One exception is a multipolygon relation because radial menu is available and the inspector is not clearly showing that a relation is selected. For example a multipolygon forest and a closed way forest are shown with the same feature type. Unfortunately, iD is already showing members as selected in the more misleading case of a selected multipolygon.

I suggest to always use a new member style to differentiate members of selected relations from selected objects. I believe differentiating member and selected style might be based on color only, because importance of the difference doesn't seem to be high enough to require considering colorblindness.

@slhh
Copy link
Contributor

slhh commented Jun 2, 2016

@Sinya Your pull request does support identifying members as a whole, but identifying members individually would still be an issue. How about integrating the related issue #2946 ?
In addition, hovering a member of the selected relation on the map should highlight the respective member in the all members section.

@bhousel
Copy link
Member

bhousel commented Jun 2, 2016

from @Sinya

Thanks for suggestions :) I think I should new a class different from selected that just has highlight effect. And when selecting relation, it will lead editorPane to "relation edit mode". All members (including points, ways) are highlighted (maybe with color yellow?) with same relation. As the editorPane leave "relation edit mode" should cancel the highlight at the same time.

from @slhh

I suggest to always use a new member style to differentiate members of selected relations from selected objects. I believe differentiating member and selected style might be based on color only, because importance of the difference doesn't seem to be high enough to require considering colorblindness.

Yes, any attempt at relation highlighting should really use a different style than selected.. It probably needs additional svg strokes drawn too, so that it can coexist with the selected halo. I think we should be able to find a way to make it recognizable by colorblind users.

from @slhh

One exception is a multipolygon relation because radial menu is available and the inspector is not clearly showing that a relation is selected.

Yeah, I realized this after I wrote my comment above - iD already does style multipolygon members as selected. Deleting a selected multipolygon with the trash can icon does leave the inners around.

@NopMap
Copy link
Contributor

NopMap commented Mar 12, 2018

I tried out this approach in my fork. Unfortunately it is not realistic for several reasons:

  • use of select (easy to solve)
  • it throws an exception if parts of the relation are not on screen (easy to solve)
  • static approach: the visible members of the relation are highlighted permanently. Additional members appearing by zooming or scrolling are not highlighted. All members remain highlighted when the relation is unselected. Multiple relations selected one after the other add up.

@slhh
Copy link
Contributor

slhh commented Mar 12, 2018

@NopMap

static approach: the visible members of the relation are highlighted permanently. Additional members appearing by zooming or scrolling are not highlighted.

I see two possible solutions:

  1. Let the code adding downloaded elements check whether they a member of a selected relation, and class them accordingly.
  2. Let mode select download missing members in mode.enter(), and let the callback add the member to class "member".
    In addition, we would likely need to prevent members of selected relations from getting unloaded. The class "member" might be useful to do this.

@bhousel How do you think about downloading missing members. It is clearly too much for relation highlighting alone, but would be benificial for example in the membership editor or for operations like splitting a multipolygon.
Maybe, we can add direct members only to the graph, but keep their out of view childs in a separate cache. Some operation would need to be able to access that cache, but D3 doesn't seem to need access.

All members remain highlighted when the relation is unselected. Multiple relations selected one after the other add up.

Mode.exit() of mode selected does already clear the "selected" and "related" (related parent for vertex navigation) class and can also clear a new "member" class.

The code should be moved into modes/selected.js anyway. Otherwise, it doesn't work in case a relation is one of multiple selected elements, because the membership editor wouldn't be called.

@bhousel
Copy link
Member

bhousel commented Oct 27, 2018

superseded by #5429

@bhousel bhousel closed this Oct 27, 2018
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.

None yet

4 participants