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

As a neighborhood citizen scientist or resident, I want to understand what a dot on the map represents #331

Open
8 of 12 tasks
theecrit opened this issue May 20, 2021 · 18 comments
Assignees
Labels
component: design component: front-end component: user interface feature: map issue type: dependency Issue must be completed alongside or after another issue (be sure to link the dependent issues). issue type: enhancement New feature or request milestone: MVP Required to ship status: ready to work on Prioritized and ready for a contributor to move to "In Progress"

Comments

@theecrit
Copy link
Collaborator

theecrit commented May 20, 2021

Description

Each dot on the map represents a PM2.5 reading recorded at a specific time and place. Each dot will be color coded according to the EPA AQI (per #237). But as a citizen scientist, I may want more details, including:

  • What the specific PM2.5 reading for that location is.
  • What time of day the reading was recorded.
  • Any other readings for that location (since the map defaults to displaying only the max reading for a given geopoint).
  • Where the reading falls in terms of health risk.

Acceptance criteria

The basic approach is to display a popup containing metadata when the viewer hovers over or clicks on (TBD) a specific geolocation marker. This popup should include:

  • All PM2.5 readings taken at the selected lon/lat point for the displayed collection session.
  • The time of day for each reading.
  • A color indicator for at least the max reading.
  • Add link to EPA-hosted information about AQI. (Jess to provide)

Wireframes

Design direction 2 (needs design exploration)

In this approach, the geolocation metadata would appear in a separate area of the interface (see example below). This might mean replacing the session metadata sidebar, or adding a new section below/above the map itself.

Designs
Example from Willet et al (note this issue doesn't cover any time-based representations):

Screen Shot 2021-06-30 at 10 35 24 AM

Technical considerations

  • Assumes Display and color code readings on the map #237 is complete.
  • The primary sensor reading displayed should be pulled from most recent timestamp at that location.
  • “Other readings” should only appear if there are other readings.
  • “Other readings” should display in reverse chronological order.
  • Popup and its contents must be discoverable by screen readers.
  • Screen readers must be able to read back the content in proper order without confusing the user (for example, any color indicators need to be properly named and defined).
  • For mobile users, tooltip should display on tap (w/ tap to remove).
  • TBD (needs testing): For desktop users, tooltip should display on either hover or on mouse click.

Potentially helpful documentation

@theecrit theecrit added issue type: dependency Issue must be completed alongside or after another issue (be sure to link the dependent issues). status: ready to work on Prioritized and ready for a contributor to move to "In Progress" and removed status: needs definition Issue needs more info to be ready to work on labels Aug 25, 2021
@TangoYankee
Copy link
Member

Resource for developers: Adding interaction to points in a data layer

@exchrotek
Copy link
Collaborator

Resource: https://visgl.github.io/react-map-gl/

@exchrotek
Copy link
Collaborator

Michael is getting used to ReactJS. He has it so you can now hover over an area and a pop up shows the data value and x,y coordinates.

mnorelli added a commit that referenced this issue Feb 8, 2022
@mnorelli
Copy link
Collaborator

mnorelli commented Feb 16, 2022

#331 breakdown of steps to implement

- [ ] set click listener on a point
does it make sense to create listeners for every point?
why not just collect a mouse click and see what's under it?

Instead

  • return point values on hover
  • get the value for the first point
  • write value and other properties to a popup
  • get time and date values and show them for first point

Configure the popup per spec

  • draft colorbar
  • create variables that affect pointer color and position on color bar
  • build as a component
  • wire up point return value(s) to popup component

Handle multiple points in a radius

  • list as "Other Readings"

- [ ] add EPA AQI link if showing info using a hover, can't click inside the box that the hover reveals

  • refactor for screen readers

I'll ask for assistance expressing the colorbar CSS in ReactJS and connecting it to returned point properties
figured it out, yay

@exchrotek
Copy link
Collaborator

exchrotek commented Feb 16, 2022 via email

@mnorelli
Copy link
Collaborator

Please bring devils! Thanks, @exchrotek !

I found it really easy to implement a return of points around an x/y versus a listener-per-point, which I guessed would add processing load and a slew of events to manage. In this novice's estimation, the Mapbox solution for this seemed simpler, more familiar to me, more elegant.

And, no, not a fixed decision to hover instead of click. I thought (please advise if needed) that I'd start with hover for proof-of-concept, then split off the hover/click decision after the code and CSS were established. Easy to switch, I thought.

Similarly, whether to have the returned point info, which might be quite a long list, in the map or on the right of the map outside the frame is still to be decided, again once user map interactions can return data.

@exchrotek
Copy link
Collaborator

exchrotek commented Feb 16, 2022 via email

@exchrotek
Copy link
Collaborator

exchrotek commented Feb 16, 2022 via email

@mnorelli
Copy link
Collaborator

mnorelli commented Feb 23, 2022

I was a little confused before. I'm using the onHover method inside of ReactMapGL component. (It so reminds me of the Mapbox hover event, I assumed it was so.) I don't actually know the performance hit vs. hella onClick listeners, but it's so much less work since the data is added as one big layer made from an array of points, not individual points that have to be handled. I think this is intention of this ReactMapGL/Mapbox map data structure and attendant methods. See line 99 in ../web/src/components/map/box.js in branch 331_dot_attributes. Hope that helps!

@mnorelli
Copy link
Collaborator

We'll need to decide if this works as a hover or if it should be a click. Again, getting back to the topic raised in a thread I can't find now, it all depends on how WOEIP uses or wants to interact with these data.

@exchrotek
Copy link
Collaborator

exchrotek commented Feb 23, 2022 via email

@exchrotek
Copy link
Collaborator

exchrotek commented Feb 23, 2022 via email

@mnorelli
Copy link
Collaborator

mnorelli commented Mar 2, 2022

The code I'll request be pulled will not yet:

  • be accessible to screen readers
  • implement onClick for mobile

I'm hoping we can accept the hover code for desktop and make a new issue to cover those items

@exchrotek
Copy link
Collaborator

exchrotek commented Mar 2, 2022 via email

@mnorelli mnorelli mentioned this issue Mar 2, 2022
6 tasks
@hawser
Copy link

hawser commented Mar 2, 2022

I did a basic search for hover alternatives on mobile, it seems as if there really aren't any. The advice I found stated, "You can manage hover effects with touchscreens but it can be a little awkward. You may be better off designing them out altogether and using something else entirely. If you’re set on using them on your desktop site, you generally have three alternatives to hover effects on mobile websites:

  1. Remove them altogether and replace them with the primary action.
  2. Add a secondary menu where you can either tap once for the hover effect and once more for the primary action.
  3. Place the hover information on its own page.

@exchrotek
Copy link
Collaborator

exchrotek commented Mar 2, 2022 via email

@gsehrlich
Copy link
Collaborator

Per conversation today with @exchrotek (and a previous comment by Michael), we need a hover box to stay open when the cursor moves so that the user can access the question mark button shown in the wireframes (referred to here as "EPA AQI link"). We thought on hover the box should open and on click it should stay open.

If we implement this, I'm thinking on hover the cursor should also change to a pointing hand. Once the box is open, another click outside the box closes it (and could open another). Do we also need an X in the top right of the hover box? Do we need it to close when Esc is pressed?

This might be an interim solution to the touchscreen problem too.

@hawser

@gsehrlich gsehrlich self-assigned this May 4, 2022
@theecrit
Copy link
Collaborator Author

@theecrit to write up post-MVP issue for full educational window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: design component: front-end component: user interface feature: map issue type: dependency Issue must be completed alongside or after another issue (be sure to link the dependent issues). issue type: enhancement New feature or request milestone: MVP Required to ship status: ready to work on Prioritized and ready for a contributor to move to "In Progress"
Projects
None yet
Development

No branches or pull requests

6 participants