Skip to content

Commit

Permalink
Heatmap default options (#640)
Browse files Browse the repository at this point in the history
* Heatmap default options

* update changelog

---------

Co-authored-by: Sergey Galkin <[email protected]>
  • Loading branch information
fred84 and Sergey Galkin authored Jan 12, 2024
1 parent 3565974 commit 715cacd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Changelog
.. _`docs`: https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/manage-dashboard-links/#dashboard-links

* Added ...
* Fix default options for Heatmap
* Add Unit option for Graph panel
* Added Minimum option for Timeseries
* Added Maximum option for Timeseries
Expand Down
2 changes: 1 addition & 1 deletion grafanalib/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3561,7 +3561,7 @@ class Heatmap(Panel):
heatmap = {}
hideZeroBuckets = attr.ib(default=False)
highlightCards = attr.ib(default=True)
options = attr.ib(default=None)
options = attr.ib(default=attr.Factory(list))

xAxis = attr.ib(
default=attr.Factory(XAxis),
Expand Down
6 changes: 6 additions & 0 deletions grafanalib/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,12 @@ def test_sql_target_with_source_files():
print(t.to_json_data()["targets"][0])


def test_default_heatmap():
h = G.Heatmap()

assert h.to_json_data()["options"] == []


class TestDashboardLink():

def test_validators(self):
Expand Down

0 comments on commit 715cacd

Please sign in to comment.