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

Add ability to filter table by map extent #1049

Open
azizaparveen opened this issue Dec 6, 2024 · 19 comments
Open

Add ability to filter table by map extent #1049

azizaparveen opened this issue Dec 6, 2024 · 19 comments
Assignees
Labels
2-ENH New feature or request Manager component
Milestone

Comments

@azizaparveen
Copy link
Collaborator

Describe requirements

During the R3 Instant Apps holistic event, we received a request to filter the table in Manager by the map extent.

"I'd like to be able to zoom in on my map and select and filter out the table based on what I select. Or even filter down my table as I zoom in on the map. "

I think this is a feature worth considering. We could potentially try to add a toggle for this in the filter tool, or a button in the map. This would only apply in split view I think.

Alternatives

No response

Other Relevant Info

No response

Impact

No response

@azizaparveen azizaparveen added the 2-ENH New feature or request label Dec 6, 2024
@azizaparveen
Copy link
Collaborator Author

FeatureTable supports listening to map extent changes https://developers.arcgis.com/javascript/latest/sample-code/widgets-featuretable-map/, so this will be easy to implement.
image

@azizaparveen azizaparveen added this to the 2025.R01 milestone Dec 6, 2024
@azizaparveen
Copy link
Collaborator Author

  • This will be a toggle in Filter modal
  • With this change Filter button needs to be visible all times (not only when filters are configured)

image

@azizaparveen
Copy link
Collaborator Author

cc @skrishn

@azizaparveen
Copy link
Collaborator Author

azizaparveen commented Dec 13, 2024

@sumitzarkar we decided on a different design on this,

  • It will be a separate button on the toolbar
  • The button will only show up in split view layout
  • when selected it will turn esri blue when selected (I will share the what that looks like soon)

icon ul: https://developers.arcgis.com/calcite-design-system/icons/?categories=GIS&icon=extent-filter&query=

image

cc @sarahmcdonald7

@sumitzarkar
Copy link
Collaborator

@azizaparveen

The button will only show up in split view layout

  1. As we will be showing this button only in split view, then what should be the behavior when the filterByExtent is enabled and switching to TableView and Mapview?
  2. Also, what should be the behavior when switching back to split view?

@azizaparveen
Copy link
Collaborator Author

@sumitzarkar we went back to previous design again and will not use button.

  • Moving forward with the filter by extent setting in the filter modal
  • Filter button in the table toolbar will always show since the filter by extent will always be available
  • Will leave the setting as is if users navigate to other layouts (Table/map)
    • If we get feedback that this is confusing we will look into greying out the setting in the other layouts, or adding a tool tip next to the setting saying it is only for the split view
  • We should confirm that the record count updates correctly when filter by extent is on
  • In the future we should consider adding a config setting that allows users to have setting on by default
    • Determine if it would be an app, map or layer setting

image

@azizaparveen
Copy link
Collaborator Author

azizaparveen commented Dec 19, 2024

@chris-fox and @sarahmcdonald7, I was thinking of expected behavior of this functionality when there is selection, looked at Pro and Dashboard behavior and here is what makes sense to me

Current behavior
• Selected features pop-up shows up in the Info panel
• Count shows total and selected count,
• Selected features are highlighted in the table

Expected behavior
Can only think of the following scenarios at this moment
Map extent change and selected features are not within the map extent
Now If map extent changes and if the selected features are not within the current extent, I expect it to reflect in the info window, table and count (Dashboard and Pro have the similar behavior). Here is a dashboard app that kind of mimic the similar functionality https://arcgis4localgov2.maps.arcgis.com/apps/dashboards/d0a4599795654bb7ae20f9933b16f39c (only thing is dashboard does not retain selection when features are not within the extent)

• Info window will return back to initial state (no feature pop-up showing)
• Table will only show the features that are within the current map extent.
• Total count will show total number of features shown in the map and 0 selected
• Selection will persist (Pro behavior)
• May be we can show a message in the info panel that selected record is not within the current map extent

Map extent change and selected feature/s are within the map extent
• Info window will only show selected features pop-up within the map extent
• Table will show features within the map extent, selected features will be highlighted in the table as usual
• Count will reflect the number of features and selected features within the extent.

@azizaparveen
Copy link
Collaborator Author

@sarahmcdonald7 and @chris-fox, another scenario similar to selection because we select feature first then go in edit mode. I didn't find any other apps doing the exact same thing. When in edit mode from table , Dashboard focused on the edit modal and user can't do anything else unless they cancel out of it.

When we are in editing mode
We are in split view layout and change the layout to map layout

Current behavior
• The feature is still in Edit mode
• Selected features are highlighted in the map no matter whether they are visible within the current map extent or not

Expected behavior
(assuming user is aware that filter by extent is on since it user initiated action)

Map extent change due to the aspect ratio (we try to preserve extent when we change layout) and selected feature is not within the map extent

• If there were any changes made to the feature in editing mode prior to change layout, show discard edit message and Info Panel will return to initial state.
• If there were no changes made to the feature, info panel will return to initial state
• May be we can show a message in the info panel that selected record is not within the current map extent

Map extent change and selected feature is within the map extent
• The feature will be in Edit mode
• Feature will be highlighted and visible in map

@chris-fox
Copy link
Collaborator

Makes sense to me @azizaparveen

@sumitzarkar
Copy link
Collaborator

@azizaparveen @chris-fox

Based on the discussion in #1049 (comment) and #1049 (comment) we analyzed and we can implement the following behaviors:

When selected features are outside the map extent:

  • The info panel will reset to the initial state (no pop-up).
    The table will show features within the extent only, no features will highlighted.
  • Counts will reflect features within the extent (0 selected).
  • Selection will persist (when the selected extent is changed to the area of selected features). Also, an optional message can be shown on the info card indicating that selected features are outside the extent.

When selected features are within the map extent:

  • The info panel will show the selected features within the extent.
  • Table will highlight selected features within the extent.
  • Counts will be updated accordingly.

While in editing mode and changing the layout to map layout:

If the selected feature is not within the map extent:

If there were any changes made to the feature in editing mode prior to the layout change, show a discard edits message and reset the Info Panel to the initial state.

  • We see challenges in implementing this approach as if any edits are made and after the extent is changed that feature is no longer available
    In this case, we currently see the discard popup, and if the user chooses to Continue Editing, then it is not a valid workflow.

Proposed Solutions:

  1. Don't show the discard popup directly discard the edits and persist the selection

    • Remove the feature from editing and reset the Info Panel to the initial state.
    • And, if the extent is again changed so that the feature is in current extent then the selection will persist but user have to enter in edit mode again using the edit button
  2. If the discard popup is required:

    • If the user clicks "Discard edits", clear the selection and reset the Info Panel.
    • If the user clicks "Continue editing," stay in edit mode, adjust the map extent to bring the feature into view, and maintain the feature selection.

If the selected feature is within the map extent:

  • The feature will remain in edit mode.
  • The feature will be highlighted and visible on the map.

Please let us know your thoughts on this

@azizaparveen
Copy link
Collaborator Author

While in editing mode and changing the layout to map layout:

If the selected feature is not within the map extent:

If there were any changes made to the feature in editing mode prior to the layout change, show a discard edits message and reset the Info Panel to the initial state.

  • We see challenges in implementing this approach as if any edits are made and after the extent is changed that feature is no longer available
    In this case, we currently see the discard popup, and if the user chooses to Continue Editing, then it is not a valid workflow.

Proposed Solutions:

  1. Don't show the discard popup directly discard the edits and persist the selection

    • Remove the feature from editing and reset the Info Panel to the initial state.
    • And, if the extent is again changed so that the feature is in current extent then the selection will persist but user have to enter in edit mode again using the edit button
  2. If the discard popup is required:

    • If the user clicks "Discard edits", clear the selection and reset the Info Panel.
    • If the user clicks "Continue editing," stay in edit mode, adjust the map extent to bring the feature into view, and maintain the feature selection.

If the selected feature is within the map extent:

  • The feature will remain in edit mode.
  • The feature will be highlighted and visible on the map.

Please let us know your thoughts on this

@sumitzarkar , I am leaning towards the 2nd option here. typical workflow in this case I think is, users would want to change layout for editing feature with more map space. In this scenario, I think they will most likely want to keep the same feature in editing mode, so we adjust the extent to bring the selected feature in view and if they want to discard the edit and move on to select another feature they can.

@sarahmcdonald7
Copy link
Collaborator

@azizaparveen I agree - I think the 2nd option makes the most sense.

@azizaparveen
Copy link
Collaborator Author

@sumitzarkar I talked to Chris about this and he suggested another option, which is not honoring the map extent filtering when we are in editing mode, kind of like what Dashboard does, it only allows editing in that mode, could you please look into this option and see if we can implement it.

@azizaparveen
Copy link
Collaborator Author

@sarahmcdonald7 what do you think about adding a info button right after this settings that says, "In editing mode, the 'Filter by visible map extent' function will stay disabled".
Please let me know if you any suggestion for the string above, I just provided a spaceholder.

Image

@sarahmcdonald7
Copy link
Collaborator

@azizaparveen That works for me! Just a quick question to clarify the behavior. Is 'Editing mode' when a feature is selected in the table and is being edited in the pop-up panel? This wouldn't include if a user was editing directly in the table?

@sarahmcdonald7
Copy link
Collaborator

@azizaparveen I am not sure if we should use 'editing mode' in the tool tip, it's not a phrase that we use typically while editing. Could we say, "While editing a feature in the map, the 'filter by visible extent' tool will not respected".
I think I might be a little confused on this behavior though. Do you know when this will be available to test on devext?

@azizaparveen
Copy link
Collaborator Author

@azizaparveen That works for me! Just a quick question to clarify the behavior. Is 'Editing mode' when a feature is selected in the table and is being edited in the pop-up panel? This wouldn't include if a user was editing directly in the table?

Edit mode means, when a feature is selected in the table and is being edited in the pop-up panel, for in table editing I don't think it will be an issue, because users are going to edit one field at a time.

@azizaparveen
Copy link
Collaborator Author

@azizaparveen I am not sure if we should use 'editing mode' in the tool tip, it's not a phrase that we use typically while editing. Could we say, "While editing a feature in the map, the 'filter by visible extent' tool will not respected". I think I might be a little confused on this behavior though. Do you know when this will be available to test on devext?

Yeah, we can definitely use this string "While editing a feature in the map, the 'filter by visible extent' tool will not respected", Cybertech team is planning a code drop on Monday, so hopefully Tuesday on 28th

@azizaparveen
Copy link
Collaborator Author

@sumitzarkar please use this string for info icon "While editing a feature in the map, the 'filter by visible extent' tool will not respected"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2-ENH New feature or request Manager component
Projects
None yet
Development

No branches or pull requests

4 participants