Skip to content

Commit

Permalink
Dragging nodes to reorder positions (#24)
Browse files Browse the repository at this point in the history
* Dragging nodes
* Use persistProperties method to store settings;
* Add field names to tooltip labels title.
* Add scale of node position in resizing viewport
* Add UT for drag & drop testing
  • Loading branch information
zBritva authored and ignatvilesov committed Aug 22, 2017
1 parent fe22ced commit c6188f6
Show file tree
Hide file tree
Showing 8 changed files with 361 additions and 37 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.4.0

* Feature to move nodes to any place in the viewport

## 1.3.1

* Fix applying settings of link labels
Expand Down
20 changes: 20 additions & 0 deletions capabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,26 @@
}
}
}
},
"nodeComplexSettings": {
"displayName": "Sankey settigns",
"displayNameKey": "Visual_SankeySettings",
"properties": {
"nodePositions": {
"displayName": "Node positions",
"displayNameKey": "Visual_NodePositions",
"type": {
"text": true
}
},
"viewportSize": {
"displayName": "Viewport sizes",
"displayNameKey": "Visual_ViewportSize",
"type": {
"text": true
}
}
}
}
},
"sorting": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "powerbi-visuals-sankey",
"version": "1.3.1",
"version": "1.4.0",
"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 Down
4 changes: 2 additions & 2 deletions pbiviz.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"visual": {
"name": "SankeyDiagram",
"displayName": "Sankey 1.3.1",
"displayName": "Sankey 1.4.0",
"guid": "SankeyDiagram1446463184954",
"visualClassName": "SankeyDiagram",
"version": "1.3.1",
"version": "1.4.0",
"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"
Expand Down
7 changes: 7 additions & 0 deletions src/dataInterfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ module powerbi.extensibility.visual {
colour: string;
selectableDataPoints?: SelectableDataPoint[];
cloneLink?: SankeyDiagramNode;
settings?: SankeyDiagramNodePositionSetting;
}

export interface SankeyDiagramLink extends
Expand Down Expand Up @@ -116,4 +117,10 @@ module powerbi.extensibility.visual {
destination: any;
weigth: number;
}

export interface SankeyDiagramNodePositionSetting {
name: string;
y?: string;
x?: string;
}
}
15 changes: 14 additions & 1 deletion src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,26 @@ module powerbi.extensibility.visual {
}

export class SankeyLnScaleSettings {
public show: boolean= false;
public show: boolean = false;
}

export class SankeyComplexSettings {
public nodePositions: string = "[]";
public viewportSize: string = "{}";
}

export interface ViewportSize {
height?: string;
width?: string;
}

export class SankeyDiagramSettings extends DataViewObjectsParser {
public linkLabels: SankeyDiagramLinkLabelsSettings = new SankeyDiagramLinkLabelsSettings();
public labels: SankeyDiagramLabelsSettings = new SankeyDiagramLabelsSettings();
public _scale: SankeyDiagramScaleSettings = new SankeyDiagramScaleSettings();
public scaleSettings: SankeyLnScaleSettings = new SankeyLnScaleSettings();
public nodeComplexSettings: SankeyComplexSettings = new SankeyComplexSettings();
public _nodePositions: SankeyDiagramNodePositionSetting[] = [];
public _viewportSize: ViewportSize = {};
}
}
Loading

0 comments on commit c6188f6

Please sign in to comment.