Skip to content

Commit

Permalink
Reorganize settings code. Add data labels to cells (#6)
Browse files Browse the repository at this point in the history
* Reorganize settings code. Add data labels to cells
* Add CHANGELOG.md
* Add UT for new data labels feature
  • Loading branch information
zBritva authored and ignatvilesov committed Aug 4, 2017
1 parent 07e2fa0 commit 0ebb592
Show file tree
Hide file tree
Showing 9 changed files with 584 additions and 490 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 1.0.1

* Data labels displaying in cells
41 changes: 41 additions & 0 deletions capabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,47 @@
"displayNameKey": "Visual_General_Buckets"
}
}
},
"labels": {
"displayName": "Data labels",
"displayNameKey": "Visual_DataPointsLabels",
"properties": {
"show": {
"displayName": "Show",
"displayNameKey": "Visual_Show",
"type": {
"bool": true
}
},
"fill": {
"displayName": "Color",
"displayNameKey": "Visual_LabelsFill",
"type": {
"fill": {
"solid": {
"color": true
}
}
}
},
"fontSize": {
"displayName": "Text Size",
"displayNameKey": "Visual_TextSize",
"type": {
"formatting": {
"fontSize": true
}
}
},
"forceDisplay": {
"displayName": "Force display",
"displayNameKey": "Visual_Force_Display",
"description": "Display all labels anyway",
"type": {
"bool": true
}
}
}
}
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"tslint": "4.4.2",
"tslint-microsoft-contrib": "4.0.0",
"powerbi-visuals-tools": "1.7.1",
"powerbi-visuals-utils-dataviewutils": "1.2.0",
"powerbi-visuals-utils-formattingutils": "0.4.0",
"powerbi-visuals-utils-tooltiputils": "0.3.0",
"powerbi-visuals-utils-svgutils": "1.0.0",
Expand All @@ -40,7 +41,7 @@
"powerbi-visuals-utils-testutils": "1.0.1"
},
"scripts": {
"postinstall": "pbiviz update 1.7.0",
"postinstall": "pbiviz update 1.6.0",
"pbiviz": "pbiviz",
"start": "pbiviz start",
"package": "pbiviz package",
Expand Down
7 changes: 4 additions & 3 deletions pbiviz.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"visual": {
"name": "TableHeatMap",
"displayName": "Table Heatmap",
"displayName": "Table Heatmap 1.0.1",
"guid": "TableHeatMap1443716069308",
"visualClassName": "TableHeatMap",
"version": "0.2.6",
"version": "1.0.1",
"description": "You can use this custom visual to build a table heat map that can be used to visualise and compare data values in an easy and intuitive way. You have a built-in option within this visual to specify the number of buckets used for splitting your data. Additionally, you can also customise it by choosing a colour scheme in line with your brand colours",
"supportUrl": "http://community.powerbi.com",
"gitHubUrl": "https://github.com/Microsoft/powerbi-visuals-heatmap"
},
"apiVersion": "1.7.0",
"apiVersion": "1.6.0",
"author": {
"name": "Microsoft",
"email": "[email protected]"
Expand All @@ -22,6 +22,7 @@
"node_modules/globalize/lib/globalize.js",
"node_modules/jquery/dist/jquery.min.js",
"external/init.jquery.js",
"node_modules/powerbi-visuals-utils-dataviewutils/lib/index.js",
"node_modules/powerbi-visuals-utils-typeutils/lib/index.js",
"node_modules/powerbi-visuals-utils-interactivityutils/lib/index.js",
"node_modules/powerbi-visuals-utils-tooltiputils/lib/index.js",
Expand Down
88 changes: 88 additions & 0 deletions src/dataInterfaces.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
module powerbi.extensibility.visual {
import IValueFormatter = powerbi.extensibility.utils.formatting.IValueFormatter;
export interface TableHeatMapDataPoint {
categoryX: string;
categoryY: string;
value: number;
valueStr: string;
}

export interface TableHeatMapChartData {
dataPoints: TableHeatMapDataPoint[];
categoryX: string[];
categoryY: string[];
categoryValueFormatter: IValueFormatter;
valueFormatter: IValueFormatter;
}

export interface IMargin {
left?: number;
right?: number;
bottom?: number;
top?: number;
}

export interface TextProperties {
text?: string;
fontFamily: string;
fontSize: string;
fontWeight?: string;
fontStyle?: string;
fontVariant?: string;
whiteSpace?: string;
}

export interface IColorArray {
3: string[];
4: string[];
5: string[];
6: string[];
7: string[];
8: string[];
9?: string[];
10?: string[];
11?: string[];
12?: string[];
13?: string[];
14?: string[];
}

export interface IColorBrewer {
YlGn: IColorArray;
YlGnBu: IColorArray;
GnBu: IColorArray;
BuGn: IColorArray;
PuBuGn: IColorArray;
PuBu: IColorArray;
BuPu: IColorArray;
RdPu: IColorArray;
PuRd: IColorArray;
OrRd: IColorArray;
YlOrRd: IColorArray;
YlOrBr: IColorArray;
Purples: IColorArray;
Blues: IColorArray;
Greens: IColorArray;
Oranges: IColorArray;
Reds: IColorArray;
Greys: IColorArray;
PuOr: IColorArray;
BrBG: IColorArray;
PRGn: IColorArray;
PiYG: IColorArray;
RdBu: IColorArray;
RdGy: IColorArray;
RdYlBu: IColorArray;
Spectral: IColorArray;
RdYlGn: IColorArray;
Accent: IColorArray;
Dark2: IColorArray;
Paired: IColorArray;
Pastel1: IColorArray;
Pastel2: IColorArray;
Set1: IColorArray;
Set2: IColorArray;
Set3: IColorArray;
}

}
Loading

0 comments on commit 0ebb592

Please sign in to comment.