Closed Antiarchitect closed 6 months ago
The json format for rows is odd: for collapsed rows the panels are embedded into the row. For uncollapsed ones, they are outside the row, i.e. following the row. Just setting the row.withCollapsed()
isn't sufficient.
I have written the logic to sort out collapsed rows but it is currently intertwined with utils.makeGrid()
. It would be a great feature to make this logic available separately.
Calling util.panel.resolveCollapsedFlagOnRows(panels)
on the eventual array of panels should resolve this (introduced in #155).
https://grafana.github.io/grafonnet/API/util.html#fn-panelresolvecollapsedflagonrows
Not sure if it's a Grafonnet bug at all, but I faced it using Grafonnet:
If using
+ row.withCollapsed(false)
rows are empty (no panels) If using+ row.withCollapsed(true)
panels are in placeThere is a workaround in not using
rowWithPanels
but flattening row and successive panels but it's not very comfortable to use especially with nestedfor
cycles