-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Lens] workspace panel dimensions by chart type #136993
Comments
Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors) |
Pinging @elastic/datavis (Team:DataVis) |
Responded to the thread in Slack, but adding here for the sake of visibility. Personally, I’d prefer to get rid of the white shadowed panel/container for the visualization altogether in Lens, and simply make the center content area (containing toolbar visualization and suggestions) all on a white background. I think it would help reduce visual noise and avoid the box-in-a-box looks that a lot of areas suffer from. |
Another option suggested by @ThomThomson is to retain the border, but remove the differences in background color between the workspace and the sidebars. |
@ThomThomson great idea, we love such clean up: this box in box UI pattern start popping up a bit too much around our products, I think is safe and genuine to start cleaning it up a bit more |
Another idea mentioned in our weekly syc, do not change the workspace size but add a shadow instead to distinguish between the visualization and the panel. We should evaluate each one of them |
cc @gvnmagni |
@MichaelMarcialis I would love to discuss with you about this since we have few implications that are bigger than this single chart |
Yes, I'll put something on the calendar for us to sync up. The biggest question I have (assuming we wish to allow the white workspace panel to shrink/hug certain visualization types) is how will the workspace's DND drop zone be affected? Should the drop zone also shrink? Or should it always maintain the same full width/height dimensions? Something for us to discuss. Stay tuned. |
Hey, gang. @gvnmagni and I met up to discuss this issue. After discussing possible solutions, we ultimately landed on the same general direction that @drewdaemon described earlier. This includes:
If we're all in agreement with this direction, let me know and I'll plan to proceed with explorations on the drop zone question when I get a moment. |
@MichaelMarcialis yes this sounds great! Looking forward to the designs :) |
@stratoula: As promised, I've explored some possible directions on how to proceed with the workspace drop zones when we're dealing with a Lens visualization type that is restricted to a maximum width, maximum height, and/or an aspect ratio. Ultimately, I think I much prefer the panel-only direction out of the two explorations shown below. While the full workspace drop zone example does benefit from a consistent and very large size, it doesn't look too great on the metric example and looks like a visual bug on the time series example (with the drop zone appearing flush horizontally, but overflowing vertically). On the other hand, the panel-only direction looks nicer and intentionally placed in all examples. The only downside to this approach is that it will present users with a smaller drop zone for some visualization types, which will ask that they drag fields a bit further from the field list, but that's a tradeoff I'm willing to accept for the time being (and one we can monitor for feedback). CCing @gvnmagni in case he has any additional thoughts. Panel-Only Drop Zone (My Preferred Direction)Metric ExampleTime Series ExampleFull Workspace Drop ZoneMetric ExampleTime Series Example |
I love how clean and elegant it looks in the first option, I would prefer that as well. We can eventually enlarge that if users have troubles with it, but I doubt that it would be a problem 😊 |
@MichaelMarcialis thanks so much! The panel drop zone was my personal preference so happy that we agree! |
A few learnings: Aspect ratios are easy(-ish)Defining an aspect ratio without worrying about the actual dimensions is straightforward (e.g. line charts should be 16:9). Can use flexbox with the CSS Predicting metric dimensionsMetric dimensions are supposed to follow this logic
In the small multiples case,
So, width can always be known based on configuration, but height sometimes can't be known until we have data. Timing WRT to chart renderThe workspace panel should be resized in the same render cycle as the chart is drawn. Resizing too soonChart render is always after data is received. So, if the workspace is resized as soon as we know what size it should be (sometimes before data, and always before chart render) the previous chart will be displayed distorted before the new chart is rendered. Panel is resized before chart updates. New chart is eventually rendered into the panel. Resizing too lateHowever, if we wait to set the dimensions until the charts library notifies of a completed render, the chart will be drawn in an unsized dimension panel which is then sized, thereby triggering a second chart render. Screen.Recording.2023-10-19.at.9.22.19.AM.movConclusionThe existing charts notifications need to be extended with a "will-render" event that notifies the consumer that the chart will be rendered on the next cycle. That way, we can cue up the dimension change to coincide with the chart's render. @nickofthyme does this sound reasonable? Where dimensions should be computedThere seem to be two viable options as to where we compute the dimensions
With 1, we get the flexibility of knowing the panel dimensions before data has been received in some cases. I don't foresee much use for this but I guess it could be useful for #136995 if the user was to create a Lens visualization from dashboard and then click With 2, we don't need to move as much code and it makes sense to me that the expression renderer would request optimal dimensions/aspect ratio depending on the information it has. So, I lean toward 2, but I'm looking for feedback (cc @stratoula ) |
Great analysis here!
Is this second render ever noticeable by eye?
Yeah I think this sounds like a possible solution and I think pretty easy to implement from the charts size, just need to find where/when to fire the event to have the right affect. |
Yeah that's not good. Also thanks for sharing the playback speed option, didn't know that existed! 🎉 |
Yes this is not good, even without slowing the video I can see the flickering so I like the idea of the consumer notification.
I agree with option 2 Drew, it makes more sense to be on the expression renderer side. This is what I would expect as a developer 👍 |
For
|
Blocked on elastic/elastic-charts#2221 |
Blocked on elastic/elastic-charts#2238 |
Decided synchronously not to block this effort on elastic/elastic-charts#2238 |
Is the status on this still blocked ? @drewdaemon + @stratoula |
We are just waiting for this #170914 to be merged |
## Summary Close #136993 All charts remain the same except the following ## Metric Each tile gets `200px` if there are multiple and `300px` if it's a single. The default background is EUI empty. <img width="600" alt="Screenshot 2023-10-30 at 3 55 33 PM" src="https://github.com/elastic/kibana/assets/315764/74d7e6dc-c90a-4f60-bf56-94ab1556ad42"> <img width="600" alt="Screenshot 2023-10-30 at 3 56 36 PM" src="https://github.com/elastic/kibana/assets/315764/3254160a-b18a-4c04-b059-f20b8f1f246a"> ## XY Vertical time-series charts have `16:9` ratio but will stretch to any available width and won't shrink below 300px height. https://github.com/elastic/kibana/assets/315764/3e056ae8-bc65-4851-9ad9-6c8a81bdf58a ## Gauge Gauge gets `600px` for the long side, `300px` for the short side. <img width="600" alt="Screenshot 2023-11-28 at 11 22 20 AM" src="https://github.com/elastic/kibana/assets/315764/2b774515-f060-4c26-a0aa-efdeebfff0e5"> <img width="600" alt="Screenshot 2023-11-28 at 11 22 33 AM" src="https://github.com/elastic/kibana/assets/315764/62181021-d88a-4cb6-862b-42768a2df13e"> ## Known issues - [ ] text resizing on the metric elastic/elastic-charts#2238 https://github.com/elastic/kibana/assets/315764/0162f461-b544-44a9-971c-b2a0265d7d3a - [x] gauge isn't showing veil on willRender ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios Flaky test runner: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4755 --------- Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: nickofthyme <[email protected]> Co-authored-by: Stratoula Kalafateli <[email protected]> Co-authored-by: Marta Bondyra <[email protected]>
An idea from #134242 . We could allow visualization types to impose constraints on the dimensions of the workspace panel. These could be specific measurements or just an aspect ratio.
Potential benefits
Example from the metric vis:
The text was updated successfully, but these errors were encountered: