nychealth / EH-dataportal

Source code for the Environment & Health Data Portal
https://a816-dohbesp.nyc.gov/IndicatorPublic/
Apache License 2.0
10 stars 4 forks source link

Build "Take Action" widget #7

Closed mmontesanonyc closed 1 year ago

mmontesanonyc commented 2 years ago

Some details and backstory here.

A Take Action page would let a user:

We can also build out other Take Action functions, including a 311 widget, and links to a limited set of advocacy orgs/CBOs working on relevant issues.

mmontesanonyc commented 2 years ago

I think there are a couple of first steps here that I'd like to get moving on -

mmontesanonyc commented 2 years ago

Shell page built here. Right now it just has a very rough interaction pattern built into it - @cgettings, can you build the initial locator feature? Enter address, get council district?

mmontesanonyc commented 1 year ago

I poked around with this geocoder that Grant had initially put together - it uses the nyc-lib npm package maintained by DOITT, part of the NYC Core Framework.

anyway, it's almost all automatic - it handles the geocoding, and returns a map.location object. map.location.data is full of a bunch of info we can use (much more than pictured here).

image
mmontesanonyc commented 1 year ago

So here's the challenge, @cgettings - grabbing council district, name, neighborhoods, and email address from this page.

Would love if we can make this a js object so that the geocoding can get us the council district, and we can match/filter the js object to return the council member's name, neighborhoods, email address.

cgettings commented 1 year ago

This will be really easy with R. I can write something for the EHDP-data repo, then we can grab the JSON like all the other data.

mmontesanonyc commented 1 year ago

🙏 that'll be great, thanks!

mmontesanonyc commented 1 year ago

Basic functionality is in place, though will note that the JS-generated email address isn't accurate (for districts with a single digit the email address is just District1@... but the code-generated email addresses are District01@...) and the text formatting is not idea. Plus, I'm fiddling around with some better display/interaction-flow approaches.

mmontesanonyc commented 1 year ago

I've done a bunch of fiddling to iron out formatting issues, and I think the only thing outstanding is getting CM's names in there - so @cgettings if you're able to do that R scrape and generate that file, then I'll add a few more fields from that file (CM's names, neighborhood names).

At that point I'll want to merge to development, share with Mike and Cari, and have a conversation about what other kinds of actions we can support.

Will be good to brainstorm some additional text to incorporate to this, too - I'm sure I didn't get it right on the first time. And, we could also build a GA4 event so that we can track the number of sent emails (or at least, the number of times somebody clicks "send emails" - the final event is out of our hands).

mmontesanonyc commented 1 year ago

Heya, I'd like to get moving on this - think you can run that scrape @cgettings ? Or maybe you'd like to delegate to AM? Can chat in today's site meeting.

mmontesanonyc commented 1 year ago

Merging this to development so we can demo to folks.

mmontesanonyc commented 1 year ago

A couple things are sliiiightly wonky.

I'm sure this is iron-outable, but also want to get some conversations moving in the review chain.

mmontesanonyc commented 1 year ago

NB: I moved the email widget to a subpage of the Take-Action section, so that we can have the dialog as another subpage.

image

mmontesanonyc commented 1 year ago

Email function

mmontesanonyc commented 1 year ago

Got this into a modal fired by a button on the DE, below keywords. It works a little bit awkwardly:

mmontesanonyc commented 1 year ago

Revising this functionality... Some notes:

Notes for next week:

mmontesanonyc commented 1 year ago

Hi all, big updates to Take Action are up on the feature-take-action branch - serve that up and go to ... `/EH-dataportal/take-action/email-electeds.

A few requests:

@cgettings @etorem @sportsmanam

etorem commented 1 year ago
mmontesanonyc commented 1 year ago

@etorem thanks! i think that first one is a real issue for sure - I've got to make sure that somebody can go back to the beginning and re-do if they want to.

mmontesanonyc commented 1 year ago
mmontesanonyc commented 1 year ago

Create crosswalk as yaml file in /data directory - for /data-explorer content. (Or all content? Start with data-explorer and go from there.)

Crosswalk: indicators to relevant 311 topics with KA-codes.

We'll have multiple options for many indicators; instead of 311 button, 311 button launches modal with specific options. Can also include "search 311 for [general option]" and use search result format, eg https://portal.311.nyc.gov/search/?q=housing

mmontesanonyc commented 1 year ago

Requested: remove 'email' functionality, retain tips.

mmontesanonyc commented 1 year ago

@cgettings, @etorem - mocked up the 311 jawn in feature-311-links branch. Please take a look and LMK thoughts - thanks!

etorem commented 1 year ago

That's great - I think it looks good! One thing to consider is that, although the first indicator in the list loads automatically for some topics; you have to actually click on it for the 311 menu options to appear at the bottom of the page. I wonder if that means people might not notice it's there if they are just browsing the first available indicator instead of going deeper into the other datasets?

Some examples:

If you click on Air Quality > Asthma, this doesn't occur and the button appears at the bottom.

If you click on Healthy eating > Unhealthy food access, this does occur and the buttons do not appear until you click on the first indicator. This also occurs with Climate > Daytime Summer Surface Temperatures

mmontesanonyc commented 1 year ago

yeah, thanks for spotting that - I've was fiddling with some things in the loading order, but couldn't quite get it... I think I have now.

mmontesanonyc commented 1 year ago

OK, 311 is merged into dev - I'd like to share this with some folks to get their take on it.

mmontesanonyc commented 1 year ago

NB: consolidated implementation on dev, awaiting go-ahead on prod, all merged together at feature-take-action:

image

I went with:

mmontesanonyc commented 1 year ago

Closing, deployed!