Skip to content

Commit

Permalink
legendTitle added to heatmaps to match rlc
Browse files Browse the repository at this point in the history
  • Loading branch information
kloivenn committed Jul 31, 2023
1 parent 8e5080d commit 22cada4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/src/linked-charts.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions example/hetamap.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
.ncols(30)
.mode("canvas")
.value((row, col) => Math.random())
.legendTitle("BBB!")
.place("#container");
</script>
2 changes: 1 addition & 1 deletion lib/linked-charts.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/heatmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export function heatmap(id, chart){
.add_property("on_labelClickCol")
.add_property("clusterRows", false)
.add_property("clusterCols", false)
.add_property("legendTitle", "")
.add_property("informText", function(rowId, colId) {
var value = chart.get_value(rowId, colId);
if(typeof value == "number")
Expand Down Expand Up @@ -649,7 +650,7 @@ export function heatmap(id, chart){
}

if(chart.showLegend() && chart.legend)
updateLegend();
updateLegend();
}

//some default onmouseover and onmouseout behaviour for cells and labels
Expand Down Expand Up @@ -1055,7 +1056,7 @@ export function heatmap(id, chart){

function updateLegend() {
chart.legend
.set_title({"heatmap": ""})
.set_title({"heatmap": chart.legendTitle()})
.add_block(chart.colourScale, "colour", "heatmap");

return chart;
Expand Down

0 comments on commit 22cada4

Please sign in to comment.