Skip to content

Commit 715cacd

Browse files
fred84Sergey Galkin
andauthored
Heatmap default options (#640)
* Heatmap default options * update changelog --------- Co-authored-by: Sergey Galkin <v.sergey.galkin@reddit.com>
1 parent 3565974 commit 715cacd

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Changelog
1010
.. _`docs`: https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/manage-dashboard-links/#dashboard-links
1111

1212
* Added ...
13+
* Fix default options for Heatmap
1314
* Add Unit option for Graph panel
1415
* Added Minimum option for Timeseries
1516
* Added Maximum option for Timeseries

grafanalib/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3561,7 +3561,7 @@ class Heatmap(Panel):
35613561
heatmap = {}
35623562
hideZeroBuckets = attr.ib(default=False)
35633563
highlightCards = attr.ib(default=True)
3564-
options = attr.ib(default=None)
3564+
options = attr.ib(default=attr.Factory(list))
35653565

35663566
xAxis = attr.ib(
35673567
default=attr.Factory(XAxis),

grafanalib/tests/test_core.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,12 @@ def test_sql_target_with_source_files():
11921192
print(t.to_json_data()["targets"][0])
11931193

11941194

1195+
def test_default_heatmap():
1196+
h = G.Heatmap()
1197+
1198+
assert h.to_json_data()["options"] == []
1199+
1200+
11951201
class TestDashboardLink():
11961202

11971203
def test_validators(self):

0 commit comments

Comments
 (0)