Skip to content

Commit

Permalink
Display numbers issue (#21)
Browse files Browse the repository at this point in the history
* Fix scale settings text.
* Fix displaying visual with numbers
* Downgrade API version to 1.6.0
  • Loading branch information
zBritva authored and ignatvilesov committed Jul 28, 2017
1 parent a9853d5 commit 8370f5d
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 26 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.2.7

* Fix scale settings text.
* Fix displaying the visual with numeric at Source and Destination fields
* Downgrade API version to 1.6.0

## 1.2.5

* Fix selection issue for cloned nodes in dataset with cycles
Expand Down
16 changes: 1 addition & 15 deletions capabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,6 @@
},
"Weight": {
"min": 0,
"max": 0
}
},
{
"Source": {
"min": 0,
"max": 1
},
"Destination": {
"min": 0,
"max": 1
},
"Weight": {
"min": 1,
"max": 1
}
}
Expand Down Expand Up @@ -184,7 +170,7 @@
}
},
"scaleSettings": {
"displayName": "Scale settings",
"displayName": "Enable logarithmic scale",
"displayNameKey": "Visual_ScaleSettings",
"properties": {
"show": {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "powerbi-visuals-sankey",
"version": "1.2.5",
"version": "1.2.7",
"description": "Sankey is a type of flow diagram in which the width of the series is in proportion to the quantity of the flow. Use it to find major contributions to an overall flow.",
"repository": {
"type": "git",
Expand All @@ -10,7 +10,7 @@
"powerbi-visuals"
],
"scripts": {
"postinstall": "pbiviz update 1.7.0",
"postinstall": "pbiviz update 1.6.0",
"typings": "typings",
"pbiviz": "pbiviz",
"start": "pbiviz start",
Expand Down
4 changes: 2 additions & 2 deletions pbiviz.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"displayName": "Sankey",
"guid": "SankeyDiagram1446463184954",
"visualClassName": "SankeyDiagram",
"version": "1.2.5",
"version": "1.2.7",
"description": "Sankey is a type of flow diagram in which the width of the series is in proportion to the quantity of the flow. Use it to find major contributions to an overall flow.",
"supportUrl": "http://community.powerbi.com",
"gitHubUrl": "https://github.com/Microsoft/powerbi-visuals-sankey"
},
"apiVersion": "1.7.0",
"apiVersion": "1.6.0",
"author": {
"name": "Microsoft",
"email": "[email protected]"
Expand Down
10 changes: 5 additions & 5 deletions src/visual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ module powerbi.extensibility.visual {
let createdNodes: SankeyDiagramNode[] = [];
for (let nodeName in cycles) {
let firstCyclesNode: SankeyDiagramNode = (cycles[nodeName].filter((node: SankeyDiagramNode): boolean => {
if (node.label.name === nodeName) {
if ((node.label.name || "").toString() === (nodeName || "").toString()) {
return true;
}
return false;
Expand Down Expand Up @@ -506,16 +506,16 @@ module powerbi.extensibility.visual {

let labelsDictionary: Object = { };
sourceCategories.forEach((item: any, index: number) => {
labelsDictionary[item] = sourceCategoriesLabels[index];
labelsDictionary[item] = sourceCategoriesLabels[index] || "";
});
destinationCategories.forEach((item: any, index: number) => {
labelsDictionary[item] = destinationCategoriesLabels[index];
labelsDictionary[item] = destinationCategoriesLabels[index] || "";
});

let categories: any[] = sourceCategories.concat(destinationCategories);

categories.forEach((item: any, index: number) => {
let formattedValue: string = valueFormatterForCategories.format((<string>labelsDictionary[item]).replace(SankeyDiagram.DublicatedNamePostfix, "")),
let formattedValue: string = valueFormatterForCategories.format((<string>labelsDictionary[item].toString()).replace(SankeyDiagram.DublicatedNamePostfix, "")),
label: SankeyDiagramLabel,
selectableDataPoint: SelectableDataPoint,
textProperties: TextProperties = {
Expand All @@ -527,7 +527,7 @@ module powerbi.extensibility.visual {
label = {
internalName: item,
name: item,
formattedName: valueFormatterForCategories.format((<string>labelsDictionary[item]).replace(SankeyDiagram.DublicatedNamePostfix, "")),
formattedName: valueFormatterForCategories.format((<string>labelsDictionary[item].toString()).replace(SankeyDiagram.DublicatedNamePostfix, "")),
width: textMeasurementService.measureSvgTextWidth(textProperties),
height: textMeasurementService.estimateSvgTextHeight(textProperties),
color: settings.labels.fill
Expand Down
2 changes: 1 addition & 1 deletion test/_references.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/// <reference path="../node_modules/@types/lodash/index.d.ts" />

// Power BI API
/// <reference path="../.api/v1.7.0/PowerBI-visuals.d.ts" />
/// <reference path="../.api/v1.6.0/PowerBI-visuals.d.ts" />

// Power BI Extensibility
/// <reference path="../node_modules/powerbi-visuals-utils-dataviewutils/lib/index.d.ts" />
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"node_modules/@types/d3/index.d.ts",
"node_modules/@types/jquery/index.d.ts",
"node_modules/@types/lodash/index.d.ts",
".api/v1.7.0/PowerBI-visuals.d.ts",
".api/v1.6.0/PowerBI-visuals.d.ts",
"node_modules/powerbi-visuals-utils-dataviewutils/lib/index.d.ts",
"node_modules/powerbi-visuals-utils-typeutils/lib/index.d.ts",
"node_modules/powerbi-visuals-utils-svgutils/lib/index.d.ts",
Expand Down

0 comments on commit 8370f5d

Please sign in to comment.