Layout issues
Two issues in this ticket
When there are multiple graphs trying to place themselves in the 0,0 position then stack vertically instead of filling the horizontal space first then moving to the next row.
In a single template when a new row starts it overlaps with the row about it.
The first can be reproduced by using the attached templates cpu_0fa47984-825b-46f1-9ca5-0366e3281cc5.json, mem_4a805493-f7ef-4da0-8de8-e78afd899722.json and load_ec6c48f4-48ca-4ba7-a842-5b700e19f274.json
The second with the file system_060227b4-b7eb-49b6-820b-608ebf32409e.json
cpu_0fa47984-825b-46f1-9ca5-0366e3281cc5.txt load_ec6c48f4-48ca-4ba7-a842-5b700e19f274.txt mem_4a805493-f7ef-4da0-8de8-e78afd899722.txt
Hey @alexpaxton, do you think you've got any quick fixes for this?
Also, it looks like @jademcgough is taking a look at this one, so maybe sync up with her if you're not sure where to dig in. Thanks!
I can't repro the second bug. I'm on my 15" laptop screen so it could be the screen size, but I've tried changing my resolution and browser zoom and it does a good job of resizing whatever I do.
Are you running off of the master branch? Looks a bit like the bug I fixed on Friday (which hasn't been merged into develop).
I'll come back to that in a bit and see if I can repro, but going to look into the first issue now.
The second is inexplicably reproducing for me now, working on a fix.
I'm altering the row height to adjust for the overlap issue (e43d814052cdc42201683664c5e7f5ac0f6af3cb). Please keep in mind, when creating layouts, that we are using a fixed height currently (which is fine, because dygraphs default to a 320 pixel height). The "h" value in the layout should always be 4.
It's possible that I'm missing something, as I'm not super familiar with the react-grid-layout library, but I can't find any configuration options for changing the way items stack when placed in the (0,0) position. I think they intend for positions to be preset in the layouts, so it's a little unusual that we're dynamically bringing in layouts.
I just created a branch (https://github.com/influxdata/chronograf/tree/fix/horizontal-graphs) which sets positions programmatically. They'll always be consistent in their position (for a given group of layouts), but you won't be able to set the position for graphs in the layout anymore. It feels a little hacky to me, but it works.
Hacky but working sounds like exactly what we need right now.
@nhaugo is fine with the positioning fix. I'm going to merge it in and close this issue.