USEPA / haztrak

An open-source web app that illustrates how waste management software can interface with RCRAInfo to track hazardous waste electronically
https://usepa.github.io/haztrak/
MIT License
48 stars 20 forks source link

Charts enhancement #733

Closed sheckathorne closed 2 months ago

sheckathorne commented 3 months ago

I'm currently exploring enhancing the charts on the main dashboard to make them more interactive, starting with the Pie chart.

The idea is to create an "exploding pie" that can present extra information (in this case just the % of total) and inform the user that there is some clickable action to take when mousing over.

https://github.com/USEPA/haztrak/assets/21269876/ca756b8f-2407-4df7-89dd-dc4e395e0cc6

The one issue I'm encountering is that the chart animations only work correctly when Strict Mode is turned off, because the double rendering throws off the built-in chart event "onAnimationEnd".

dpgraham4401 commented 3 months ago

I like the interactivity and the added breakdown (percentage) provided by the enhancement (TBH I've forgotten what it currently does), and if you're excited about working on it further then I'd be happy to accept a PR that made these changes.

As you probably figured out, the graphs are connected to dummy data (which is embarrassing on my part), we haven't had the time to implement these aggregates in the backend. I'm currently focused on authorization changes that are associated with the Remote Signer Policy which came out a year+ ago. So I won't be able to get to that for the foreseeable future.

Let me know if you need assistance with the strict mode problems, I wonder if it's an issue related to the charts library. I think disabling strict mode would be a mistake.

sheckathorne commented 3 months ago

Totally agree on the strict mode part. I think there must be a way to make it work, maybe via an effect? I set down React for about 2.5 years so I’m feeling a bit rusty.

I’ll open a PR and you can review whenever you get some time if that works for you.