Recidiviz / public-dashboard

A public-facing dashboard to help educate citizens and build accountability
GNU General Public License v3.0
5 stars 3 forks source link

Chart titles are missing in demographic breakdown viz #571

Closed macfarlandian closed 2 years ago

macfarlandian commented 2 years ago

Describe the bug When viewing a demographic breakdown section (e.g., https://spotlight-staging.recidiviz.org/us-nd/narratives/probation/5), labels are missing on all but the last chart when you select a breakdown type.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://spotlight-staging.recidiviz.org/us-nd/narratives/probation/5
  2. Click on the dropdown and select one of the demographic types
  3. See error

Expected behavior Only the last chart should have a legend but all of the charts should have a title

Screenshots Screenshots revealing sensitive information must not be shared. If a screenshot is helpful in diagnosing and resolving the bug, please send this directly to a contact on the Recidiviz team. Screen Shot 2022-05-27 at 11 17 22 AM (this is not sensitive data)

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Not evident in prod yet so it must be the result of an unreleased change (I believe https://github.com/Recidiviz/public-dashboard/commit/6dc855249dbd20befea052d8a25fef8860b159c2) ... it appears that the prop that hides the legend is also inadvertently hiding the title in this situation)

lilidworkin commented 2 years ago

@terryttsai can you look into this when you have a chance, or maybe just assign to Ilya since according to the "Additional Context" it seems like it might be the result of one of his changes!

nasaownsky commented 2 years ago

@terryttsai I know solution for this problem, so if you haven't done it by now, I could handle it.

lilidworkin commented 2 years ago

Thank you @nasaownsky !!

terryttsai commented 2 years ago

Huh I thought I replied to this via email but I don't see my comment. I have a fix for this too: https://github.com/Recidiviz/public-dashboard/pull/573

Though poking around in the app, I see areas where we provide a legend on every bar rather than on the last bar, do we want to remove the legend in those places too?

terryttsai commented 2 years ago

In the racial disparities section:

Screen Shot 2022-05-31 at 10 02 14 AM Screen Shot 2022-05-31 at 10 02 19 AM Screen Shot 2022-05-31 at 10 02 24 AM
macfarlandian commented 2 years ago

yes I agree the desired behavior in these scenarios would be to only show the legend once, since it's the same for both charts in the section

lilidworkin commented 2 years ago

@terryttsai what's the status on this?

terryttsai commented 2 years ago

PR https://github.com/Recidiviz/public-dashboard/pull/573 is up for fixing the issue however we should create a new issue for removing the legends in areas where they're showing up more than once.

terryttsai commented 2 years ago

I'll create the follow-up issue and merge #573

lilidworkin commented 2 years ago

Thanks!!

terryttsai commented 2 years ago

Follow-up issue: https://github.com/Recidiviz/public-dashboard/issues/575