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

As a Sustainability apps user I would like to have a first MVP of the web-component implemented #1

Open
2 of 4 tasks
rcavaliere opened this issue May 17, 2024 · 17 comments
Assignees

Comments

@rcavaliere
Copy link
Member

rcavaliere commented May 17, 2024

  • integration of Suedtirol Radelt data
  • review of reference design (for just this MVP - see detailed proposals below)
  • application of MVP design
  • integration in the Open Data Hub Web Components Store (with configurator of the design aspects)

Requirement: the filter "Sustainability Action" and "Organisation" should be considered even in the web-component and in the configuration of the web-component store.

Expected behavior:

  • if in the web component configuration just a sustainability action is chosen -> the web-component does not present the sustainability action filter
  • if in the web component configuration just an organisation is chosen -> the web-component does not present the organisation filter
  • if in the web component configuration a sustainability action and an organisation is chosen -> the web-component does not present any filter
  • if in the web component configuration no filters are applied -> the web-component present both filters

Review of reference design:
240523_ConceptAPPReview_NOI.pdf

@rcavaliere
Copy link
Member Author

Just a clarification: in the field "Organisationen" we expect to see the nr of organizations, by enlarging the details we just see here the nr. of organizations divided per type.

@rcavaliere
Copy link
Member Author

Another comment: for the field "Teilnehmerranking" should not contain e.g. "Autonome Provinz Bozen". I would suggest here:

  • no "Details ausblenden"
  • possibility to change ref. criteria for the ranking (e.g. KM, CO2)
  • search button
  • ranking

Please also include the possibility to scroll down the ranking.

Also the search must be defined. What happens if no result is obtained? What happens if a research returns multiple results? What happens if a user then selects an organization? In this last scenario: ranking centered to the position of this organization, which is properly highlighted (e.g. other background color) in the ranking

@rcavaliere
Copy link
Member Author

rcavaliere commented Aug 30, 2024

@Peter080202 I add also here the reference to the API calls:

These end-points retrieve only the last value. For getting the history, there is another API call (check https://swagger.opendatahub.com/?url=https://mobility.api.opendatahub.com/v2/apispec)

@rcavaliere
Copy link
Member Author

Short summary of what we have agreed today with @Peter080202, relevant also for @danielecanu:

First implementation iteration (next week - to be discussed during the meeting scheduled on 6.9):

  • first integration of Open Data Hub API
  • visualization of "basic" KPI (e.g. number of km traveled, CO2 emissions reduced, nr. of participants, nr. of organizations, ranking of the organizations)
  • implementation of all filters stuff -> first adaptation of original design proposal

Second implementation iteration:

  • additional details / plots. Based on the available data, we could have as detail for the KPIs "number of km traveled", "CO2 emissions reduced" the temporal evolution (not a yearly basis based on the data available, but e.g. on a monthly basis)
  • additional integration of Open Data Hub -> another API call must be used in order to retrieve the time series of the KPI evolution during time

@rcavaliere
Copy link
Member Author

rcavaliere commented Sep 16, 2024

@Peter080202 @danielecanu as agreed today, following points should be fixed in order to complete a first MVP with Suedtirol Radelt data:

  • add the "Challenge" filter (in the PDF called "Sustainability Action" filter, e.g. "Alto Adige Pedala 2023")
  • hide the filters related to the different APPs (Suedtirol Radelt, ummadum, Loc.All)
  • allow the ranking to be sorted according to different KPIs. Relevant KPI made available via API: km (API parameter: "km_total"), CO2 (API parameter: "co2"), participants (API parameter: "number_of_people"), money saved (API parameter: "money_saved")
  • on the left we have four different boxes, two on the top and two on the bottom. Each box refers to one of the four KPIs.
  • when an organization is clicked in the ranking, the ranking can not be scrolled up and down, the organization remains highlighted and the proper KPIs are updated in the four boxes in the left. By default, the boxes show the total values for all companies.
  • if the filter "Challenge" is not applied, it is possible to see in the boxes the data for each challenge. Please consider in this first implementation iteration just the list view, the plot with time series will be implemented at a later stage. Please note that if a Challenge is selected in the filter, then we will have just the four numbers in the box, without any details below each box.

We also decided to leave the organization filter out, since it is already possible to search in the ranking and select one certain organization.

For the PR, it is probably better that you pull the application that we can then directly integrate and configure in the web-components store. Please include all relevant variables that can be set in the configuration of the web-component, including the "Challenge"

@Peter080202
Copy link
Collaborator

@rcavaliere
I have finished implementing the above points. I have two questions:
How to retrieve the challenges for the "Sustainability Action" filter e.g. "Alto Adige Pedala 2023"? Is there an existing endpoint that returns all available challenges?
How to apply the action filter to the API calls? In specific I mean these calls:
https://mobility.api.opendatahub.testingmachine.eu/v2/flat,node/CompanyGamificationAction/*/latest?where=sactive.eq.true&limit=-1
and
https://mobility.api.opendatahub.testingmachine.eu/v2/flat,node/GamificationAction/*/latest?where=sactive.eq.true&limit=-1

@rcavaliere
Copy link
Member Author

@Peter080202 at present it seems that we are importing only the data from the challenge 2024, but we are still checking the data flow. However the rule would be the following:

  • in CompanyGamificationAction, the challenge name is appended to sname, e.g. "Gruppo Sportivo Fortezza-Südtirol radelt 2024" (i.e. CompanyName-ChallengeName)
  • in GamificationAction, it is always in sname (in this case is bilingual, i.e. nameDE_nameIT)

In generale, the latter method returns all available Challenge, you should distinguish the different "stations" provided here. You could use also a different API call, if you want to have just this list.

@rcavaliere
Copy link
Member Author

@Peter080202 in the meantime, we have solved the issue with the data flow, now it seems that everything runs in a stable way.
In order to get the timeseries of a certain KPI related to a certain company, consider e.g. this API call:

https://mobility.api.opendatahub.testingmachine.eu/v2/flat,node/CompanyGamificationAction/km_average/2024-09-21T00:00:00.000Z/2024-09-24T23:59:59.999Z?limit=-1&where=sname.eq.Sasa%20SpA-S%C3%BCdtirol%20radelt%202024

With this call we have asked the data of the last three days (21.09 - 24.09) related to the KPI km_average related to the company Sasa SpA-Südtirol radelt 2024.

@Peter080202
Copy link
Collaborator

@rcavaliere , I just submitted the pull request for the first version. The PR doesn't include any logic for generating charts as I encountered an issue with the provided API. Since we are visualising data for e.g. Südtirol Radelt 2024, I believe it would make sense to call the endpoint using a start date of 2024-01-01T00:00:00.000Z and an end date of 2024-12-31T23:59:59.999Z. However, the API currently only supports a date range of up to 5 days. Could this limit be extended, perhaps to 31 days, so that we can at least fetch data month by month and aggregate it, resulting in 12 requests per year?

Additionally, @danielecanu suggested that summing up the values for the entire year may not be the best approach, as we could be in July and Südtirol Radelt 2024 might only return data until June 2024, which will probably lead to a dent in the curve. He proposed that it may be more appropriate to draw separate lines for each action, resulting in x lines where x equals the number of sustainability actions tracked. You can discuss this idea further in the next meeting.

Lastly, during our previous meeting, I mentioned an API issue where some organisations appeared twice (Marktgemeinde St. Lorenzen and Libera Universitá di Bolzano - Freie Universität Bozen). I've attached a screenshot showing the data for Marktgemeinde St. Lorenzen:

Screenshot 2024-09-27 at 07 54 33

Please reach out if you need any clarifications. Please also make sure to tag the developers who are taking over the project (@mathiasmader and @redek91).

Thanks!

@rcavaliere
Copy link
Member Author

@Peter080202 thanks for the feedback, we will discuss this.
We also check in the data this issue with duplicated records. Have a nice future, hope to see you again soon or later!

@rcavaliere
Copy link
Member Author

rcavaliere commented Oct 16, 2024

@mathiasmader @redek91 @danielecanu we have deployed the first version of the web-component here: https://webcomponents.opendatahub.testingmachine.eu/webcomponent/sustainability-apps

I think we have some issues with the graphical elements, e.g. we don't see the arrow left and rights so it is everything a little bit ugly at the moment. Don't we also have a basic graphical layout for the entire web-component to be used?

I kindly ask you to check this, you can refer to my colleague @clezag if we need to adapt something in our deployment. Apart from this, from a technical perspective everything is implemented as we agreed and the data is properly shown. One usability issue that I have currently seen is that if you try to select another organisation from the list in order to check the specific KPI associated to it, this is not possible. I would also like to have the possibility to not select any organisation at all and see the total KPIs.

One additional feature which would be nice to see is the historical evolution of the KPI. Now that we have a stable data flow, we have seen that in the back-end the KPIs are updated once a day, i.e. we have an updated measurement in correspondence of each day. This means that we could simply draw some plots in the empty part of the web-component by just showing for each calendar day the correspondent value. The API call to be used to retrieve this is to be found here: #1 (comment)

So by summarizing, before considering this first implementation iteration closed, I would request you the following:

  • Check current issues with the graphical layout of the web-component, which seems to be not correctly deployed
  • Solve the usability issue with the selection of the organization
  • Implement the visualization of historical values

Can you provide us an estimation for checking and implementing all this? We could also organize a short meeting if needed, or to better explain all these point or (if everything is clear) once a new Pull Request (PR) is made and deployed, so that we can discuss and finally approve all this and organize the next steps.

@redek91
Copy link
Collaborator

redek91 commented Oct 16, 2024

@rcavaliere I already opened a PR for the graphical issues. #6

@rcavaliere
Copy link
Member Author

@redek91 thanks for the notice, we integrated the PR and now can see the graphical elements correctly. What about the overall possibility of personalizing the layout of the web-component?

@redek91
Copy link
Collaborator

redek91 commented Oct 17, 2024

@rcavaliere I will make an estimation of the work for the display of the historical data.

I think there is a misunderstanding on how the component is working right now:

  • The selection of the organization in the configuration only sets the organization that is shown on the top of the 3rd column, and does not filter the other KPIs My mistake, the KPIs are in fact filtered, but should be make the list items selectable and filter the data by the selected item?
  • As for the layout, I can't see any setting that changes the view of the KPIs beside the font color, should there be a list of specific layouts?

We should organize a meeting with @danielecanu and @mathiasmader to clarify these points.

@redek91
Copy link
Collaborator

redek91 commented Oct 17, 2024

A solution to the usability issue could be to have a organization preselected and a dropdown with all the organizations and filter by the selected one, the selection could also be removed. And keep the list of all organization unfiltered and highlight the selected one. Something like this
image

@rcavaliere
Copy link
Member Author

@redek91 yes, I like your idea, actually we already discussed it. From an usability point of view, I think it's the best choice possible.

@rcavaliere
Copy link
Member Author

@redek91 can we plan to have the organization filter view implemented this week? And maybe the plots with the historical data next week? Let me know about a possible implementation plan, so that we can have a first complete PoC

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

No branches or pull requests

4 participants