Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sjkp committed Apr 23, 2018
1 parent 3e3ba32 commit 1b726fc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion pbiviz.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"displayName": "Heatmap",
"guid": "PBI_CV_FCF70EF9_270E_4A52_913E_345CC4A8BFBA",
"visualClassName": "Visual",
"version": "4.0.0",
"version": "4.0.1",
"description": "The Heatmap Visual enables users to draw a heatmap overlay from a X, Y coordinate set on to an existing image. The user specify the image, and provide a data set of X, Y coordinates and optionally an intensity for each data point. The radius and the bluriness of the heatmap bubbles can be customized as well as the max value for the intensity.",
"supportUrl": "http://powerbi.sjkp.dk/support",
"gitHubUrl": "https://github.com/sjkp/heatmap"
Expand Down
33 changes: 18 additions & 15 deletions src/visual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ module powerbi.extensibility.visual {
}
this.maxValue = tmpMax;
}
console.log('maxvalue: ' + this.maxValue);
console.log('use Percentage scaling' + this.usePercentageScaling);
// draw a grayscale heatmap by putting a blurred circle at each data point
for (var i = 0, len = this.dataPoints.length, p; i < len; i++) {
p = this.dataPoints[i];
Expand Down Expand Up @@ -248,7 +250,7 @@ module powerbi.extensibility.visual {

// Convert a DataView into a view model
public static converter(dataView: DataView): HeatMapDataModel {
console.log('converter', dataView);
console.log('converter', dataView);
var dataPoints: HeatMapData[] = [];
var xCol, yCol, iCol;
xCol = yCol = iCol = -1;
Expand All @@ -257,24 +259,25 @@ module powerbi.extensibility.visual {
var values = catDv.values;
if (typeof (dataView.metadata.columns[0].roles) !== 'undefined') {
for (var i = 0; i < catDv.values.length; i++) {
var colRole = values[i].source.displayName
switch (colRole) {
case "X":
xCol = index;
break;
case "Y":
yCol = index;
break;
case "Intensity":
iCol = index;
break;
case "Category":
break;
var colRole = values[i].source.roles;
if (colRole["X"]) {
xCol = index;
}
if (colRole["Y"]) {
yCol = index;
}

if (colRole["Intensity"]) {
iCol = index;
}
if (colRole["Category"]) {
continue;
}
index++;
}
} else {
//For sandbox mode
console.log('in sandbox mode');
xCol = 0;
yCol = 1;
iCol = 2;
Expand All @@ -297,7 +300,7 @@ module powerbi.extensibility.visual {
});
}
}

//console.log('data', dataPoints);
return {
dataArray: dataPoints
};
Expand Down

0 comments on commit 1b726fc

Please sign in to comment.