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

[historical view] Enable country panel for other time aggregates part 4 #4211

Merged
merged 15 commits into from
Jun 3, 2022

Conversation

Kongkille
Copy link
Contributor

Since #4207 got quite big, I am splitting it out into some different milestone PRs on a temporary main branch

Important - Requires #4210 to be merged beforehand!

Description - Adjust graphs to production data

This PR updates the fetcher to call and use V5 history data and adjusts the graphs accordingly. So far this has only been tested on hourly and daily data. This should be the final PR for the temp_main branch.

(Note: there are some missing values in the tooltip and other places, which I have some pending changes on the app-backend to fix)

I had to slighly go into the datareducer, but just barely and there's no optimizations on how much it will call the backend, as we'll address that separately.

Preview

Screen.Recording.2022-05-31.at.16.08.47.mov

Copy link
Member

@madsnedergaard madsnedergaard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor question :)

@@ -183,10 +183,11 @@ const reducer = (state = initialDataState, action) => {
isLoadingHistories: false,
histories: {
...state.histories,
[action.zoneId]: action.payload.map((datapoint) => ({
[action.zoneId]: action.payload.zoneStates.map((datapoint) => ({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dunno if I missed this on the app-backend, but did we change the response? :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, should the mockserver be updated to match this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes so since we want some "metadata" on top, like stateAggregation and datetimes, it makes sense to have a level above it. Before it would just return an array

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mockserver data also serves the zonesStates for history

Comment on lines +17 to +18
// set index to the max of the range of selected time aggregate
dispatchApplication('selectedZoneTimeIndex', TIME_TO_RANGE[aggregate.toUpperCase()] - 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! :)

@Kongkille
Copy link
Contributor Author

@madsnedergaard ok so i've already found a few bugs, but I'll merge this one for now so we can merge this temp_branch

@Kongkille Kongkille merged commit 2e3c2aa into temp_main Jun 3, 2022
@Kongkille Kongkille deleted the mk/history-milestone-4 branch June 3, 2022 13:14
Kongkille pushed a commit that referenced this pull request Jun 8, 2022
* [historical view] Enable country panel for other time aggregates part 1 (#4208)

* Add new helpers

* Implement helpers

* use helpers in timecontrols

* Enable linting for formatting

* [historical view] Enable country panel for other time aggregates part 2 (#4209)

* Add new helpers

* Implement helpers

* use helpers in timecontrols

* Enable timecontrols

* timeaxis formats ticks depending on
language and aggregate

* [historical-view] Enable country panel for other time aggregates part 3 (#4210)

* Add new helpers

* Implement helpers

* use helpers in timecontrols

* Enable timecontrols

* timeaxis formats ticks depending on
language and aggregate

* Adds new title component

* Uses new countryPanel.

Unrelated, also disables the price graph for other aggregates

* Updates english translations using the
default option

* Updates all languages with automatic script

* Add en examples

* [historical view] Enable country panel for other time aggregates part 4 (#4211)

* Add new helpers

* Implement helpers

* use helpers in timecontrols

* Enable timecontrols

* timeaxis formats ticks depending on
language and aggregate

* Adds new title component

* Uses new countryPanel.

Unrelated, also disables the price graph for other aggregates

* Updates english translations using the
default option

* Updates all languages with automatic script

* uses v5 history when feature enabled

* Ensure timeindex is handled correctly when
switching between aggregates

* Ensure correct start and end date for graphs

* Disable capacity mention in tooltip for
other aggregations

* use constant

* Fix some bugs (#4224)

* Add new helpers

* Implement helpers

* use helpers in timecontrols

* Enable timecontrols

* timeaxis formats ticks depending on
language and aggregate

* Adds new title component

* Uses new countryPanel.

Unrelated, also disables the price graph for other aggregates

* Updates english translations using the
default option

* Updates all languages with automatic script

* uses v5 history when feature enabled

* Ensure timeindex is handled correctly when
switching between aggregates

* Ensure correct start and end date for graphs

* Disable capacity mention in tooltip for
other aggregations

* use constant

* Use 0 as start index when switching aggregates
to guarantee that it works

* Ensure map updates when switching aggregates

* add all formats

* Make areagraph adjust ticks correctly

* Make timeslider adjust correctly

* Adjust time to range temporarily to match
incoming data

* Ensure proper timeaxis frequency

* Uses v5 datetimes, and
makes sure that state is
refetched

* lint

* Address comments

* add loading

* setting to null is not ideal
but a bit better than 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants