Skip to content

Commit 1b726fc

Browse files
committed
1 parent 3e3ba32 commit 1b726fc

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

pbiviz.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"displayName": "Heatmap",
55
"guid": "PBI_CV_FCF70EF9_270E_4A52_913E_345CC4A8BFBA",
66
"visualClassName": "Visual",
7-
"version": "4.0.0",
7+
"version": "4.0.1",
88
"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.",
99
"supportUrl": "http://powerbi.sjkp.dk/support",
1010
"gitHubUrl": "https://github.com/sjkp/heatmap"

src/visual.ts

+18-15
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ module powerbi.extensibility.visual {
183183
}
184184
this.maxValue = tmpMax;
185185
}
186+
console.log('maxvalue: ' + this.maxValue);
187+
console.log('use Percentage scaling' + this.usePercentageScaling);
186188
// draw a grayscale heatmap by putting a blurred circle at each data point
187189
for (var i = 0, len = this.dataPoints.length, p; i < len; i++) {
188190
p = this.dataPoints[i];
@@ -248,7 +250,7 @@ module powerbi.extensibility.visual {
248250

249251
// Convert a DataView into a view model
250252
public static converter(dataView: DataView): HeatMapDataModel {
251-
console.log('converter', dataView);
253+
console.log('converter', dataView);
252254
var dataPoints: HeatMapData[] = [];
253255
var xCol, yCol, iCol;
254256
xCol = yCol = iCol = -1;
@@ -257,24 +259,25 @@ module powerbi.extensibility.visual {
257259
var values = catDv.values;
258260
if (typeof (dataView.metadata.columns[0].roles) !== 'undefined') {
259261
for (var i = 0; i < catDv.values.length; i++) {
260-
var colRole = values[i].source.displayName
261-
switch (colRole) {
262-
case "X":
263-
xCol = index;
264-
break;
265-
case "Y":
266-
yCol = index;
267-
break;
268-
case "Intensity":
269-
iCol = index;
270-
break;
271-
case "Category":
272-
break;
262+
var colRole = values[i].source.roles;
263+
if (colRole["X"]) {
264+
xCol = index;
265+
}
266+
if (colRole["Y"]) {
267+
yCol = index;
268+
}
269+
270+
if (colRole["Intensity"]) {
271+
iCol = index;
272+
}
273+
if (colRole["Category"]) {
274+
continue;
273275
}
274276
index++;
275277
}
276278
} else {
277279
//For sandbox mode
280+
console.log('in sandbox mode');
278281
xCol = 0;
279282
yCol = 1;
280283
iCol = 2;
@@ -297,7 +300,7 @@ module powerbi.extensibility.visual {
297300
});
298301
}
299302
}
300-
303+
//console.log('data', dataPoints);
301304
return {
302305
dataArray: dataPoints
303306
};

0 commit comments

Comments
 (0)