micb25 / corona-jena

Erfassung und Visualisierung der Corona-Fallzahlen für Thüringen.
https://www.michael-böhme.de/corona/
GNU General Public License v3.0
13 stars 2 forks source link

How about using Chart.js? #10

Closed ghost closed 3 years ago

ghost commented 3 years ago

Maybe you want to consider using Chart.js to display the graph-data. In my opinion it is more user-friendly, HTML5 and there are some features like cursors.

Check the repository

If you want some help, let me know.

micb25 commented 3 years ago

Hello Max,

thank you for your suggestion.

I am familiar with ApexCharts.js and I thought about this once a while ago already, however, I decided to not include such features for the following reasons:

Number of graphs There are a lot of graphs on the front page (it kept growing) and also on other sub-pages. I compress these images already with pngquant to reduce the image size for faster loading times as well as for reducing the overall traffic of the site. I really like fast-loading, snappy, and responsive sites. At the same time, I really doubt that it would be the same user experience by replacing all the graphs by interactive JS-based graphs. Furthermore, it would be necessary to store the actual data somewhere and load it either on-demand directly from the JSON/CSV files or by having a dynamic webpage embedding those numbers. Both ways would end up in a lot of code rewriting without knowing if this would actually improve the user experience at all.

Desktop vs. mobile experience By using old-style gnuplot generated images, I can be totally certain that the graphs always look all the same on every device (aspect ratio, label and font size, etc.). I am afraid that, especially on mobile devices, due to limited screen space the look of the figures could be messed up. How could I know about such an issue? And how could I fix it without being able to reproduce the issue? Also think about older mobile devices with limited hardware capabilities. The number of data points is increasing on a daily or even on a hourly scale.

Don't get me wrong here. I totally see the point of a more user-friendly experience with interactive graphs. I think, however, that the overall layout of the website/dashboard would have to be changed in the first place (which also requires a lot of time). By just replacing all graphs by interactive ones, I think, the user experience could be worse (increased overhead, longer loading times, visual glitches).

Best regards Michael