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 topic/reasons graph widget #606

Merged
merged 9 commits into from
Nov 9, 2021
Merged

Conversation

jasalisbury
Copy link
Contributor

Description of change

  • pull bar graph into it's own component
  • bar graph now scrolls just the graph content, allows title/labels to still be shown when the graph is scrolled
  • add topic/reason freq widget. Can switch between display of reasons or topics
  • added backend test helpers to quickly (as in how long to code) create activity reports and destroy them for tests, along with any needed associations

How to test

Browse to the grantee tta record page

Issue(s)

Checklists

Every PR

  • Meets issue criteria
  • JIRA ticket status updated
  • Code is meaningfully tested
  • Meets accessibility standards (WCAG 2.1 Levels A, AA)
  • API Documentation updated
  • Boundary diagram updated
  • Logical Data Model updated
  • Architectural Decision Records written for major infrastructure decisions

Production Deploy

  • Staging smoke test completed

After merge/deploy

  • Update JIRA ticket status

 * pull bar graph into it's own component
 * bar graph now scrolls just the graph content, allows title/labels to
still be shown when the graph is scrolled
 * add topic/reason freq widget. Can switch between display of reasons
or topics
 * added backend test helpers to quickly (as in how long to code) create
activity reports and destroy them for tests, along with any needed associations
Copy link
Collaborator

@thewatermethod thewatermethod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had several comments written when I realized I'll have to restart my computer in order to actually test it out. Looks great so far though!

frontend/package.json Show resolved Hide resolved
frontend/src/components/ButtonSelect.js Show resolved Hide resolved
frontend/src/pages/GranteeRecord/pages/TTAHistory.js Outdated Show resolved Hide resolved
frontend/src/widgets/FrequencyGraph.js Outdated Show resolved Hide resolved
src/testUtils.js Show resolved Hide resolved
src/widgets/frequencyGraph.js Outdated Show resolved Hide resolved
@thewatermethod
Copy link
Collaborator

thewatermethod commented Nov 3, 2021

I actually seem to be running into the same issue as previous, where using the Plot.ly react library crashes my docker container. I'll set aside some time to try and figure out if I can fix this on my setup

Screen Shot 2021-11-03 at 10 00 49 AM

I apologize, I should have documented having this issue at the time

@jasalisbury
Copy link
Contributor Author

I actually seem to be running into the same issue as previous, where using the Plot.ly react library crashes my docker container. I'll set aside some time to try and figure out if I can fix this on my setup

Screen Shot 2021-11-03 at 10 00 49 AM

I apologize, I should have documented having this issue at the time

Strange. Let me know if you can't get it to work, I haven't seen anything like that locally.

@thewatermethod
Copy link
Collaborator

I think this is less of a point about this code and more about plot.ly in general but these bundle sizes are kind of absurd.

Before react-plot.ly (17.18 mb)
before

After react-plot.ly (26.42 mb)
after

If we are going to need to support low bandwidth users, we may need to find a new library.

@jasalisbury
Copy link
Contributor Author

I think this is less of a point about this code and more about plot.ly in general but these bundle sizes are kind of absurd.

Before react-plot.ly (17.18 mb) before

After react-plot.ly (26.42 mb) after

If we are going to need to support low bandwidth users, we may need to find a new library.

Might be time to split up application code from our dependencies, so users only need to download the bigger dependencies bundle when dependencies are updated (which is infrequently). Hopefully react-create-app is easy to configure to do that.

@GarrettEHill
Copy link
Collaborator

GarrettEHill commented Nov 5, 2021

Not sure if this should be specific to this review, but are we doing any compaction or compression on the js files are all data from the server to reduce bandwidth/download size?

Would incorporating something like https://hub.docker.com/r/tdewolff/minify be a good idea?

@jasalisbury jasalisbury reopened this Nov 8, 2021
@jasalisbury
Copy link
Contributor Author

jasalisbury commented Nov 8, 2021

Not sure if this should be specific to this review, but are we doing any compaction or compression on the js files are all data from the server to reduce bandwidth/download size?

Would incorporating something like https://hub.docker.com/r/tdewolff/minify be a good idea?

Network tab from the prod site (without caching)

Screenshot from 2021-11-08 09-52-39

From react-create-app https://create-react-app.dev/docs/production-build

Looks like react-create-app splits out dependencies for us automagically. It also minifies our code for us. Most of the time users are going to be downloading the main.* files as that is where our code/css lives.

(Note this does NOT include the new plotly dependency)

thewatermethod
thewatermethod previously approved these changes Nov 8, 2021
Copy link
Collaborator

@thewatermethod thewatermethod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to work on the accessibility!

Re: the bundle size issue - seems like 99% of our users would not experience much of a downside for having a giant bundle. (I would still think that low-bandwidth users might need a more engineered solution, but that's an issue for another day!)

@jasalisbury
Copy link
Contributor Author

Seems like we have a setting in github where a commit after a review resets the review

@thewatermethod thewatermethod self-requested a review November 8, 2021 18:08
Copy link
Collaborator

@thewatermethod thewatermethod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇

@jasalisbury jasalisbury merged commit f9d28ac into main Nov 9, 2021
@jasalisbury jasalisbury deleted the js-394-add-topics-reasons-graph branch November 9, 2021 14:57
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.

3 participants