Closed Frankwayne closed 5 months ago
The only way I seem to be able to get the grid to output the correct y positions for my new rows is by adding the new row to the result of the first makeGrid function call and calling the function again. This of course changes the x size of my first row though.
I'm not inputing the startY parameter on the second call either
this was the MR feature I was trying to use
This looks to be some sort of lazy loading issue I'm running into.
calling just
g.util.grid.makeGrid(self.jobExecutorPanels, 6, 8, 9))
doesn't result in the correct y values. but if I apply the function at the end of the makeGrid function
std.map(function(p) p + { gridPos+: { y+: 9 } }, g.util.grid.makeGrid(self.jobExecutorPanels, 6, 8, 9))
it returns with the correct y positions.
Did this work before? Do you have some example code I could execute?
I just introduced a fix for startY
in #159, so perhaps your version is already outdated? :innocent:
I'm not sure if it ever worked before. I'll see if I can get some sample code, under some deadlines so it may take me bit to remove all company information.
I'm using the latest tag
import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'
its clearly working in some situations. The unit test I wrote for it appears work correctly but in my code I believe I'm still getting the same issue. Maybe I'm just doing something silly in my code base I haven't spotted yet.
it is making me feel a little crazy though as I thought I reproduced it last night and this AM it wasn't giving me the same results.
Using the latest directory is good, don't forget to call jb update
to also get the latest revision.
@Frankwayne Did you manage to resolve this?
I did not, I have bogged down with work tasks. @Duologic you can close the issue though, since I was able to see a working grid in the unit test I was writing for you.
Once I get a moment to retry and I'm able to reproduce outside of my code base, I will reopen and share the code.
I'm using the latest version
import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet'
and trying to make use of calling the new functionality of the grid.makeGrid function twice with the startY parameter but it does not appear to be working for me.
The first row and panels created are positioned correctly but the second call to makeGrid with the startY parameter leaves the gridPos.y = 0 for the next row and the below panels are spaced correctly with a gridPos.y = 1
This causes all of the panels to exist under the second row.