Skip to content

Commit

Permalink
rename matrix chart to heatmap
Browse files Browse the repository at this point in the history
Signed-off-by: F.N. Claessen <felix@seita.nl>
  • Loading branch information
Flix6x committed Jul 28, 2023
1 parent 9b92b6e commit 8222cf8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion flexmeasures/api/dev/sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def get_chart(self, id: int, sensor: Sensor, **kwargs):
- "beliefs_after" (see the `timely-beliefs documentation <https://github.com/SeitaBV/timely-beliefs/blob/main/timely_beliefs/docs/timing.md/#events-and-sensors>`_)
- "beliefs_before" (see the `timely-beliefs documentation <https://github.com/SeitaBV/timely-beliefs/blob/main/timely_beliefs/docs/timing.md/#events-and-sensors>`_)
- "include_data" (if true, chart specs include the data; if false, use the `GET /api/dev/sensor/(id)/chart_data/ <../api/dev.html#get--api-dev-sensor-(id)-chart_data->`_ endpoint to fetch data)
- "chart_type" (currently 'bar_chart' and 'matrix_chart' are supported types)
- "chart_type" (currently 'bar_chart' and 'daily_heatmap' are supported types)
- "width" (an integer number of pixels; without it, the chart will be scaled to the full width of the container (hint: use ``<div style="width: 100%;">`` to set a div width to 100%)
- "height" (an integer number of pixels; without it, FlexMeasures sets a default, currently 300)
"""
Expand Down
4 changes: 2 additions & 2 deletions flexmeasures/data/models/charts/belief_charts.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def bar_chart(
return chart_specs


def matrix_chart(
def daily_heatmap(
sensor: "Sensor", # noqa F821
event_starts_after: datetime | None = None,
event_ends_before: datetime | None = None,
Expand Down Expand Up @@ -148,7 +148,7 @@ def matrix_chart(
],
}
chart_specs = {
"description": "A simple heatmap chart showing sensor data.",
"description": "A daily heatmap showing sensor data.",
# the sensor type is already shown as the y-axis title (avoid redundant info)
"title": capitalize(sensor.name) if sensor.name != sensor.sensor_type else None,
"layer": [
Expand Down
4 changes: 2 additions & 2 deletions flexmeasures/ui/templates/views/sensors.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
Select chart
</button>
<ul class="dropdown-menu center-aligned" aria-labelledby="chartTypeDropdown">
<li><a class="dropdown-item" href="#" data-chart-type="bar_chart">Time series</a></li>
<li><a class="dropdown-item" href="#" data-chart-type="matrix_chart">Time of day</a></li>
<li><a class="dropdown-item" href="#" data-chart-type="bar_chart">Bar chart</a></li>
<li><a class="dropdown-item" href="#" data-chart-type="daily_heatmap">Daily heatmap</a></li>
</ul>
</div>
</div>
Expand Down

0 comments on commit 8222cf8

Please sign in to comment.