Skip to content

Commit

Permalink
updates heatmap mouseover to deal with magnitude
Browse files Browse the repository at this point in the history
  • Loading branch information
lshapz committed Oct 31, 2018
1 parent 92a8852 commit 43a17ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 1 addition & 5 deletions src/assets/mocks/d3/dateHeatmapMock.json
Expand Up @@ -7,10 +7,6 @@
"x": "2017-11-29",
"magnitude": 0
},
{
"x": "2017-11-30",
"magnitude": 0
},
{
"x": "2017-11-28",
"magnitude": 1
Expand Down Expand Up @@ -1099,4 +1095,4 @@
"x": "2017-02-08",
"magnitude": 1
}
]
]
5 changes: 3 additions & 2 deletions src/components/visualizations/d3/HeatMap.vue
Expand Up @@ -63,6 +63,7 @@
* Possible values are
* "calendar" - date time string
* "other" - any number, string, etc.
* if calendar type, dataModel must be pre-processed so there is only one data point for each date mapped
*/
dataType: {
type: String,
Expand Down Expand Up @@ -385,9 +386,9 @@
let item = this.dataModel.filter(function(item) {
return item.x === d.x;
});
})[0];
let tooltipText = "Occurrences: " + "<b>" + item.length + "</b>" + "<br>X: " + "<b>" + d.x + "</b></br>";
let tooltipText = "Occurrences: " + "<b>" + item.magnitude + "</b>" + "<br>X: " + "<b>" + d.x + "</b></br>";
if (d.y) {
tooltipText += "<b>Y: " + d.y + "</b>";
Expand Down

0 comments on commit 43a17ac

Please sign in to comment.