grafana-cal-heatmap-panel icon indicating copy to clipboard operation
grafana-cal-heatmap-panel copied to clipboard

Partially address FR #5 (Automatically setting a cell size)

Open MacroPower opened this issue 5 years ago • 0 comments

Let me preface by saying that I'm not certain this is the correct way to do this. It was the best I could come up with for now, without editing cal-heatmap itself.

This partially addresses https://github.com/NeoCat/grafana-cal-heatmap-panel/issues/5

This PR adds getAutoCellSize(), in which I return the max acceptable cell size given the size of the panel element. This is done by hardcoding the cal-heatmap default rows and cols for each unique domain set. The total available space is divided by the number of expected cells, taking other elements such as padding into consideration.

You can activate auto-sizing by setting:

  • cell size to null or zero
  • row/col limit to null
  • vertical orientation to false

Let me know what you think.

MacroPower avatar Oct 23 '19 18:10 MacroPower