-
Notifications
You must be signed in to change notification settings - Fork 16
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
Fix layout on assets detail page #2279
Conversation
PR deployed in Google Cloud |
PR deployed in Google Cloud |
c22f9f6
to
2bff3a2
Compare
This looks good! One more thing that would be great in this ticket is if we could prevent the vertical jumping of the page on load which happens while the charts are loading. There's an example here that shows what I mean. Also I got the name wrong, the ticket was supposed to say fix |
Ok, so I did some research into CLS - The best way to fix it, as suggested is to add a fixed height to the container around the graph. Which I did, now, if the data is non-available for the graph, we then have a big container with no data on it (which can be weird), I kept the changes and you can check asset performance graph to see it working. If we decide we don't want an empty container when no data is available and we want to hide the container (as it was prev), we need to be ok with the content switching in the x axis, so in this example, the key metrics card switching to the left. Let me know which option you prefer and I'll make the changes. Im personally fine with the fixed height to avoid any jumping either on the x or y axis of the page. |
deecda6
to
fabb6e3
Compare
I think it's better to fix the height because we will generally assume that the subquery is working and the data will load. The table on the asset detail page looks good now when it loads, no more content jumping 🙌 if you could just do the same for the rest of the graphs that would be amazing!
|
Yes, will do that - I was waiting to confirm which approach to take. Thank YOU! @sophialittlejohn |
5c906ce
to
9dacc38
Compare
const aggregatedData = data.reduce((acc, cur, index) => { | ||
if (index % 2 === 0) { | ||
acc.push(cur) | ||
} | ||
return acc | ||
}, []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is every second item being skipped in the data array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that should be handled by the charts lib (recharts) itself We've done it in some other charts. You can programmatically determine how many data points should be shown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to do that or do we want to keep the data as in the picture (with -35 degree) so it doesn't look all grouped together (impossible to read)? I'm open to both options but I'm not sure if we want to display all of the data anyways.
9dacc38
to
c90c3e2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
c90c3e2
to
2ef57d9
Compare
#2223
Picture 1
Picture 2
Screen.Recording.2024-07-11.at.11.42.43.AM.mov
Picture 3