developmentseed / scoreboard

Encouraging OpenStreetMap mappers with badges, graphs & stats! ✨🕹
https://developmentseed.org/scoreboard
27 stars 9 forks source link

Timeseries UI #603

Open necoline opened 4 years ago

necoline commented 4 years ago

image

The UI mockup shows 6 columns of measurements and counts (roads, buildings, poi, railways, coastlines, waterways) , As you can see below, there are additional measurements and counts available from osmesa (16 actually). Reducing the margins on the report would be a good idea, to make more space. And maybe add a tool for toggling columns on and off? (this is going to come up elsewhere too in Scoreboard, because landuse and natural are newly added categories and there should be a separate JIRA issue about adding those new columns to existing reports).

# measurements
- 'road_km'
- 'waterway_km'
- 'coastline_km'
- 'railline_km'
- 'landuse_km2'
- 'natural_km2'
# counts
- 'roads'
- 'waterways'
- 'coastlines'
- 'buildings'
- 'railway_features'
- 'raillines'
- 'pois'
- 'landuse'
- 'natural'
- 'other'
  1. The Country column as shown in the UI mockup does not make sense to me, in this context. I think it was just copy-pasted from a previous User report. I propose strike the Country column because it seems convoluted with the countries dropdown. I think what’s shown in that Country column the user’s home country from the scoreboard profile/ preferences. The country dropdown would, instead, be filter for the timeseries query which is what we want I think.
  2. Note in the UI mockup there are Teams and Campaigns dropdown menus in the report!!! That is going to be a heavy-ish lift for the UI dev and perhaps additional scoreboard business logic. Not sure how that’s going to work really. Probably needs discussion to get nailed down. The timeseries api is going to offer a set of filters, based on the osmesa db, but Teams and Campaigns are not among them. The filters will be userIdsFilter , categoriesFilter , countriesFilter , hashtagsFilter , hashtagPrefixFilter and of course, startDate , endDate. In other words UI is going to have to come up with query parameters for these filters, make the timerseries api call, and then come up with the dropdown contents itself. I do not have a clear idea of the UI data flow- whether the dropdown menus would have to be constructed before, or after, making a timeseries query. Later today I should have the openapi api.yml doc updated in scoreboard, which will show the proposed timeseries response data structure. Once that’s agreed upon, then @necoline you can start to build the UI, by mocking the api responses as much as that’s possible, and also deciding what additional business logic will need to be added to scoreboard to supplement what the timeseries api returns.
necoline commented 4 years ago

Re: Column Number

16 is a lot of columns. I think the ideas of reducing column width and toggling columns could be an option. I think a few ways to go about it might be:

Single table: user select columns

Multiple Table

necoline commented 4 years ago

Re: Country column

I agree, I feel comfortable dropping this

necoline commented 4 years ago

Re: Teams and Campaigns dropdown

This is an excellent point, I'm going to do some initial scoping of the existing setup and update this with a proposal to kick around.

necoline commented 4 years ago

A few points of clarification on the UI:

LanesGood commented 4 years ago

@necoline @guidorice these are all great points, thanks for outlining them in detail. A few thoughts

guidorice commented 4 years ago

we should refine the visualization once we know what the API is capable of returning

@LanesGood @necoline here is what the work-in-progress api endpoint (will be) capable of returning:

https://github.com/developmentseed/scoreboard/blob/feature/timeseries-api/api/docs/api.yml#L143

the corresponding PR is https://github.com/developmentseed/scoreboard/pull/612

If you run the branch locally, you can use the Swagger UI viewer for the api docs. I believe Postman has similar functionality and @necoline is using that to develop against a mocked api.

I hope this helps inform the UI functionality!

LanesGood commented 2 years ago

Potential UI/UX enhancements (compared to staging)

Form controls

Table

Chart

General page UI

cc @kamicut @maxgrossman

maxgrossman commented 2 years ago

Just dropping notes on our question "do reported stats match actual stats" in #702.

See here/compare for yourself that at aggregate statistics are matching for the measurements. But as you can see I am double counting on the edits/changesets, so i'll fix that.

Screenshot from 2022-10-17 14-53-49 Screenshot from 2022-10-17 14-54-07 Screenshot from 2022-10-17 14-54-20

It looks like the API responds correctly so must be something in the UI (note the resp json below for edirckenson only having the 1 changeset like the profile page does).

{
    "bins": [
        {
            "user_id": 6601365,
            "bin_start": "2018-10-17",
            "bin_end": "2019-10-17",
            "name": "edircksen",
            "hashtags": [
                "osmus-tasks-153"
            ],
            "countries": [
                "SHN"
            ],
            "measurements": {
                "waterway_km_added": 1.839
            },
            "counts": {
                "roads_added": 18
            },
            "changeset_count": 1,
            "edit_count": 18
        },
        {
            "user_id": 6601365,
            "bin_start": "2019-10-17",
            "bin_end": "2020-10-17",
            "name": "edircksen",
            "hashtags": [],
            "countries": [],
            "measurements": {},
            "counts": {},
            "changeset_count": 0,
            "edit_count": 0
        },
        {
            "user_id": 6601365,
            "bin_start": "2020-10-17",
            "bin_end": "2021-10-17",
            "name": "edircksen",
            "hashtags": [],
            "countries": [],
            "measurements": {},
            "counts": {},
            "changeset_count": 0,
            "edit_count": 0
        },
        {
            "user_id": 6601365,
            "bin_start": "2021-10-17",
            "bin_end": "2022-10-17",
            "name": "edircksen",
            "hashtags": [],
            "countries": [],
            "measurements": {},
            "counts": {},
            "changeset_count": 0,
            "edit_count": 0
        }
    ]
}

I also noticed that Minh's waterway count showing 170.85 in timeseries screenshot and 170.9 on the profile page. I think that's due to the user page doing some rounding when formatting.

If consistency there matters, we could make timeseries round to 1 decimal place.

maxgrossman commented 2 years ago

double count fixed in d59a362

LanesGood commented 1 year ago

Following up on my comment in the PR, I've mocked up a single-dimension chart and table for visualizing the actual time series data:

ScoreboardTimeseries_v2

This does introduce a number of complications that were also discussed 2 years ago, above: