Interests:
- AI safety (alignment)
- Machine learning & deep learning
- Science
- Maths
I was the original author and current maintainer of the Book Project and the Books API.
Web app that displays COVID-19 data and comparisons in an easy-to-read format
Home Page: https://covid19.karankumar.com/
License: GNU General Public License v3.0
Interests:
I was the original author and current maintainer of the Book Project and the Books API.
Sometimes, the following JSON exception is thrown:
Caused by: org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]
at org.json.JSONTokener.syntaxError(JSONTokener.java:507) ~[json-20200518.jar:na]
at org.json.JSONObject.<init>(JSONObject.java:222) ~[json-20200518.jar:na]
at org.json.JSONObject.<init>(JSONObject.java:406) ~[json-20200518.jar:na]
at com.karankumar.covid19stats.backend.GlobalStats.fetchSummary(GlobalStats.java:38) ~[classes/:na]
at com.karankumar.covid19stats.backend.GlobalStats.<init>(GlobalStats.java:24) ~[classes/:na]
at com.karankumar.covid19stats.ui.views.global.GlobalView.<init>(GlobalView.java:31) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[na:na]
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:200) ~[spring-beans-5.2.0.RELEASE.jar:5.2.0.RELEASE]
... 74 common frames omitted
The culprit:
JSONObject jsonObject = new JSONObject(data);
I have tried to print out the data (a String) before passing it into the JSONObject
constructor, but it did not print before the exception was thrown.
File: GlobalStats.java
Branch: master and ui (and possibly fetch-json)
Is your feature request related to a problem? Please describe.
It may frustrate some if only one Accordion item can be open at any one given time.
Describe the solution you'd like
Allow multiple accordion items to be open at any given time.
In the screenshot above, only one accordion item is open. If I open another accordion item, the top item (currently open item) will close.
Is your feature request related to a problem? Please describe.
The API allows 5 requests per day and around 30 overall.
Describe the solution you'd like
Cache the data to prevent going over the number of requests.
Show pie slices for other countries in both pie charts
Change the pie chart titles
Instead of 'Top 5 countries with the most cases', the title should be 'Total confirmed cases'
Similarly, instead of 'Top 5 countries with the most deaths', the title on the right pie chart should be 'Total deaths'
Describe the solution you'd like
Add Bucket4j for rate limiting.
Additional context
https://www.baeldung.com/spring-bucket4j
Add graphs on the country page to show how the number of cases and deaths (as two separate graphs) have changed over time since the first case or death was reported.
Add instructions to run the app in the README in the setup section after the routes have been fixed
Is your feature request related to a problem? Please describe.
The pie charts in particular are too small on mobile.
Describe the solution you'd like
Show one pie chart per row, perhaps, on mobile.
Additional context
On the number of confirmed cases, show a tooltip over every data point that shows the number of cases at that data point.
Add Lombok to reduce boilerplate code
Describe the solution you'd like
Add a search box to allow users to search for a specific country to filter by.
Describe alternatives you've considered
A dropdown list (ComboBox).
Describe the solution you'd like
Add a pie chart to show how the number of cases and deaths (as two separate pie charts) are spread across the top 5 countries with the most cases or deaths.
Cache the summary data to avoid having to send another request later.
This would require the cache value to be of type JSONObject
, for instance, instead of Integer
.
Describe the bug
The tab highlighted as the current tab is not always the page that you are. In this case, the highlighted tab is the 'global' tab, but the country page is shown.
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
A clear and concise description of what you expected to happen.
Screenshots
Additional context
This goes away if you switch tabs to the country tab, the global tab and then back to the country. This appears to only happen when the program first runs, which may suggest that is a mapping problem.
SummaryStats.java
to use this new FixedSizeSortedMapPossible implementation ideas:
The icon should appear underneath the text in a tab in MainView.java
Problem:
Fix the route mapping and links.
When a user presses the 'global' button in the menu, they should be redirected to the global endpoint.
Similarly, when a user presses the 'global' button in the menu, they should be redirected to the global endpoint.
Actual behaviour:
The endpoint does not change (see image).
Someone provided the following the feedback:
The two pie charts seem to be in the wrong order. At the top, the leftmost live count is the total number of deaths, and the rightmost live count is the total number of confirmed cases. It would make more sense to have the order of the pie charts to also follow this order: the number of deaths on the left and the number of confirmed cases on the right.
As with the global view, a data provider would allow the dropdown (ComboBox) list to only show countries for which there is data.
Is your feature request related to a problem? Please describe.
It can be confusing to look at a large number without any separators.
Describe the solution you'd like
Commas to delimit thousandths. For instance, 1,000,000 to represent 1 million, instead of 1000000.
Describe the bug
There are dips in the number of total deaths.
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
The number of total deaths should only ever rise (unless there was an issue with the counting).
The following classes contain lots of duplicated code fragments. The common parts should be extracted.
Describe the bug
The country ComboBox (dropdown list) is no longer wide enough to show the full country's name.
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
The ComboBox's width should be width enough for even the longest country's name in its list.
Screenshots
Additional context
The ComboBox was previously wide enough, but since it was added to a HorizontalLayout (along with the new reset button), invoking setMinWidth()
on it appears to have no effect.
Describe the bug
Global page no longer works, but the country summary page and the feedback page still works.
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
The app no longer works. This is what I get when I head to https://covid19.karankumar.com.
Screenshots
Additional context
Describe the solution you'd like
Show the number of cases and number of deaths for one country on one graph. The graph should not allow comparisosn with other countries (i.e., the graph should reset every time a new country is selected).
Describe the solution you'd like
Add a grid on the global page showing a breakdown of the stats (deaths, cases, recovered, etc.) for every country.
Describe alternatives you've considered
Only showing the stats for a country on the country page, but different stats could be shown there (e.g. the number of deaths over time, etc.).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.