Upgrade API and dependencies. Use unpatched Vega.
This commit is contained in:
Родитель
7e34f567f0
Коммит
36635cf464
|
@ -1336,12 +1336,26 @@ declare module powerbi.extensibility {
|
|||
export function VisualPlugin (options: IVisualPluginOptions): ClassDecorator;
|
||||
}
|
||||
|
||||
declare module powerbi.extensibility {
|
||||
export interface ILocalizationManager {
|
||||
getDisplayName(key: string): string;
|
||||
}
|
||||
}
|
||||
|
||||
declare module powerbi.extensibility {
|
||||
export interface IAuthenticationService {
|
||||
getAADToken(visualId?: string): IPromise<string>;
|
||||
}
|
||||
}
|
||||
|
||||
declare module powerbi {
|
||||
export interface IFilter { }
|
||||
}
|
||||
|
||||
/**
|
||||
* Change Log Version 1.8.0
|
||||
* Change Log Version 1.10.0
|
||||
* Added ILocalizationManager
|
||||
* Added authenticationService
|
||||
*/
|
||||
|
||||
declare module powerbi.extensibility.visual {
|
||||
|
@ -1368,10 +1382,13 @@ declare module powerbi.extensibility.visual {
|
|||
applyJsonFilter: (filter: IFilter, objectName: string, propertyName: string, action: FilterAction) => void;
|
||||
tooltipService: ITooltipService;
|
||||
telemetry: ITelemetryService;
|
||||
authenticationService: IAuthenticationService;
|
||||
locale: string;
|
||||
allowInteractions: boolean;
|
||||
launchUrl: (url: string) => void;
|
||||
instanceId: string;
|
||||
refreshHostData: () => void;
|
||||
createLocalizationManager: () => ILocalizationManager;
|
||||
}
|
||||
|
||||
export interface VisualUpdateOptions extends extensibility.VisualUpdateOptions {
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"PBI_API_VERSION": "v1.8.0",
|
||||
"PBI_API_VERSION": "v1.10.0",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"dataRoles": {
|
||||
|
@ -64,6 +64,10 @@
|
|||
"type": "string",
|
||||
"description": "A description of this role shown to the user as a tooltip"
|
||||
},
|
||||
"descriptionKey": {
|
||||
"type": "string",
|
||||
"description": "The localization key for the description in the stringResourced file"
|
||||
},
|
||||
"preferredTypes": {
|
||||
"type": "array",
|
||||
"description": "Defines the preferred type of data for this data role",
|
||||
|
@ -643,6 +647,10 @@
|
|||
"type": "string",
|
||||
"description": "A description of this object shown to the user as a tooltip"
|
||||
},
|
||||
"descriptionKey": {
|
||||
"type": "string",
|
||||
"description": "The localization key for the description in the stringResourced file"
|
||||
},
|
||||
"properties": {
|
||||
"type": "object",
|
||||
"description": "A list of unique properties contained in this group",
|
||||
|
@ -675,6 +683,10 @@
|
|||
"type": "string",
|
||||
"description": "A description of this property shown to the user as a tooltip"
|
||||
},
|
||||
"descriptionKey": {
|
||||
"type": "string",
|
||||
"description": "The localization key for the description in the stringResourced file"
|
||||
},
|
||||
"placeHolderText": {
|
||||
"type": "string",
|
||||
"description": "Text to display if the field is empty"
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"PBI_API_VERSION": "v1.8.0",
|
||||
"PBI_API_VERSION": "v1.10.0",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"cranPackages": {
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"PBI_API_VERSION": "v1.8.0",
|
||||
"PBI_API_VERSION": "v1.10.0",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"apiVersion": {
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"PBI_API_VERSION": "v1.8.0",
|
||||
"PBI_API_VERSION": "v1.10.0",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"locale": {
|
|
@ -15,12 +15,6 @@ Run `npm start` in a terminal.
|
|||
|
||||
The open PowerBI with developer mode enabled and create a developer visual.
|
||||
|
||||
## Update Vega
|
||||
|
||||
PowerBI uses a secure iframe that disallows access to certain variables on the `window` variable. Vega reads the device pixel ratio to render visualizations on a canvas with the correct resolution. Since the variable is not available, we currenlty have to patch Vega so that it does not access it.
|
||||
|
||||
To do so, run `cp node_modules/vega/build/vega.js libs/vega.js` then replace the access to `window.devicePixelRatio` with a constant (e.g. `2`).
|
||||
|
||||
## Contributing
|
||||
|
||||
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
|
||||
|
|
35788
libs/vega.js
35788
libs/vega.js
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
13
package.json
13
package.json
|
@ -6,18 +6,19 @@
|
|||
"url": "https://github.com/Microsoft/vegalite-for-powerbi.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"powerbi-visuals-utils-dataviewutils": "1.2.0",
|
||||
"vega": "^3.0.7",
|
||||
"vega-lite": "^2.0.1"
|
||||
"powerbi-visuals-utils-dataviewutils": "1.4.1",
|
||||
"vega": "^3.0.8",
|
||||
"vega-lite": "^2.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"powerbi-visuals-tools": "^1.8.1",
|
||||
"tslint": "^5.8.0",
|
||||
"typescript": "^2.6.1"
|
||||
"powerbi-visuals-tools": "^1.10.0",
|
||||
"tslint": "^5.9.1",
|
||||
"typescript": "^2.6.2"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "pbiviz start",
|
||||
"build": "pbiviz package",
|
||||
"pbiviz": "pbiviz",
|
||||
"lint": "tslint tsconfig.json",
|
||||
"cert": "pbiviz --install-cert"
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"supportUrl": "https://github.com/Microsoft/vegalite-for-powerbi/issues",
|
||||
"gitHubUrl": "https://github.com/Microsoft/vegalite-for-powerbi"
|
||||
},
|
||||
"apiVersion": "1.8.0",
|
||||
"apiVersion": "1.10.0",
|
||||
"author": {
|
||||
"name": "Dominik Moritz",
|
||||
"email": "t-romor@microsoft.com"
|
||||
|
@ -20,7 +20,7 @@
|
|||
"externalJS": [
|
||||
"node_modules/powerbi-visuals-utils-dataviewutils/lib/index.js",
|
||||
"node_modules/vega-lite/build/vega-lite.js",
|
||||
"libs/vega.js"
|
||||
"node_modules/vega/build/vega.js"
|
||||
],
|
||||
"style": "style/visual.less",
|
||||
"capabilities": "capabilities.json",
|
||||
|
|
|
@ -97,7 +97,7 @@ module powerbi.extensibility.visual {
|
|||
};
|
||||
|
||||
const vgSpec = vl.compile(spec).spec;
|
||||
|
||||
|
||||
const runtime = vega.parse(vgSpec);
|
||||
|
||||
this.view = new vega.View(runtime)
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
"out": "./.tmp/build/visual.js"
|
||||
},
|
||||
"files": [
|
||||
".api/v1.8.0/PowerBI-visuals.d.ts",
|
||||
".api/v1.10.0/PowerBI-visuals.d.ts",
|
||||
"node_modules/powerbi-visuals-utils-dataviewutils/lib/index.d.ts",
|
||||
"src/settings.ts",
|
||||
"src/logger.ts",
|
||||
|
|
Загрузка…
Ссылка в новой задаче