UNPKG

91.5 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../ts/visualsExtensibility/telemetry/generateGuid.ts","../ts/visualsExtensibility/telemetry/events.ts","../ts/visualsExtensibility/decorators/VisualPlugin.ts","../ts/visualsExtensibility/components/selectionManager.ts","../ts/visualsExtensibility/components/selectionIdBuilder.ts","../ts/visualsExtensibility/versioning/VisualAdapter.ts","VisualsExtensibility.js","../ts/visualsExtensibility/versioning/VisualSafeExecutionWrapper.ts","../ts/visualsExtensibility/versioning/versions/v1.0.0.ts","../ts/visualsExtensibility/versioning/versions/v1.1.0.ts"],"names":["powerbi","visuals","telemetry","generateGuid","guid","idx","guidDigitsItem","Math","random","toString","ExtensibilityVisualApiUsage","name","apiVersion","custom","parentId","isError","errorSource","errorCode","undefined","info","event","category","time","Date","now","id","getFormattedInfoObject","formattedObject","ErrorSource","privateFields","orgInfoFields","ExtensibilityVisualApiUsageLoggers","loggers","VisualException","visualType","isCustom","source","lineNumber","columnNumber","stack","message","VisualExceptionLoggers","extensibility","VisualPlugin","options","constructor","__capabilities__","capabilities","SelectionManager","this","hostServices","selectedIds","promiseFactory","prototype","select","selectionId","multiSelect","deferred","defer","shouldRetainSelection","sendSelectionToHost","selectInternal","resolve","promise","showContextMenu","position","sendContextMenuToHost","hasSelection","length","clear","getSelectionIds","ids","selectArgs","data","filter","value","hasIdentity","map","getSelector","data2","getSelectorsByColumn","_","isEmpty","onSelect","selectors","args","onContextMenu","selectionIds","compact","containsSelection","d","equals","push","list","some","SelectionIdBuilder","withCategory","categoryColumn","index","queryName","identity","ensureDataMap","withSeries","seriesColumn","valueColumn","withMeasure","measureId","measure","createSelectionId","SelectionId","createWithSelectorForColumnAndMeasure","dataMap","createVisualAdapter","visualPlugin","telemetryService","visualTelemetryInfo","VisualSafeExecutionWrapper","VisualAdapter","visualApiVersions","plugin","version","versionIndex","getVersionIndex","apiVersionIndex","legacy","logEvent","User","init","element","empty","visual","create","visualLegacy","host","hostAdapter","get","overloadMethods","update","type","VisualUpdateType","Resize","visualHasMethod","onResizing","viewport","resizeMode","Data","onDataChanged","pick","ViewMode","onViewModeChanged","viewMode","destroy","enumerateObjectInstances","enumerateObjectRepetition","finalViewport","onClearSelection","canResizeTo","unwrap","Object","defineProperty","enumerable","configurable","methodName","visualNew","isFunction","versionCount","i","overloads","getCompiledOverloads","key","overloadFactory","assign","wrappedVisual","visualInfo","silent","_this","executeSafely","isCustomVisual","callback","exception","fileName","v100","ResizeEnd","dataViews","v110","createSelectionIdBuilder","createSelectionManager"],"mappings":"AA0BA,GAAOA,UAAP,SAAOA,GAAQ,GAAAC,IAAA,SAAAA,GAAQ,GAAAC,IAAA,SAAAA,GAKnB,QAAAC,KACI,GAAIC,GAAO,GACPC,EAAM,CAEV,KAAKA,EAAM,EAAS,GAANA,EAAUA,GAAO,EAAG,CAC9B,GAAIC,GAAiC,GAAhBC,KAAKC,SAAgB,CAC1C,QAAQH,GACJ,IAAK,GACL,IAAK,IACL,IAAK,IACL,IAAK,IACDD,GAAQ,IAGhBA,GAAQE,EAAeG,SAAS,IAGpC,MAAOL,GAjBKF,EAAAC,aAAYA,GALTD,EAAAD,EAAAC,YAAAD,EAAAC,gBAARD,EAAAD,EAAAC,UAAAD,EAAAC,cAARD,UAAAA,YCAP,IAAOA,UAAP,SAAOA,GAAQ,GAAAC,IAAA,SAAAA,GAAQ,GAAAC,IAAA,SAAAA,GAiBRA,EAAAQ,4BAA8B,SAASC,EAAcC,EAAoBC,EAAiBC,EAAkBC,EAA0BC,EAAsCC,GAAhE,SAAAF,IAAAA,GAAA,GAA0B,SAAAC,IAAAA,EAAAE,QAAsC,SAAAD,IAAAA,EAAAC,OACnL,IAAIC,IACAR,KAAMA,EACNC,WAAYA,EACZC,OAAQA,EACRC,SAAUA,EACVC,QAASA,EACTC,YAAaA,EACbC,UAAWA,GAGXG,GACAT,KAAM,mCACNU,SAAU,EACVC,KAAMC,KAAKC,MACXC,GAAIvB,EAAAC,eACJuB,uBAAwB,WACpB,GAAIC,I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soft Corporation\r\n * All rights reserved. \r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"\"Software\"\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n * \r\n * The above copyright notice and this permission notice shall be included in \r\n * all copies or substantial portions of the Software.\r\n * \r\n * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\n * THE SOFTWARE.\r\n */\r\n\r\nmodule powerbi.visuals.telemetry {\r\n /**\r\n * Creates a client-side Guid string.\r\n * @returns A string representation of a Guid.\r\n */\r\n export function generateGuid(): string {\r\n let guid = \"\",\r\n idx = 0;\r\n\r\n for (idx = 0; idx < 32; idx += 1) {\r\n let guidDigitsItem = Math.random() * 16 | 0;\r\n switch (idx) {\r\n case 8:\r\n case 12:\r\n case 16:\r\n case 20:\r\n guid += \"-\";\r\n break;\r\n }\r\n guid += guidDigitsItem.toString(16);\r\n }\r\n\r\n return guid;\r\n }\r\n}","/*\r\n * Power BI Visualizations\r\n *\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. \r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"\"Software\"\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n * \r\n * The above copyright notice and this permission notice shall be included in \r\n * all copies or substantial portions of the Software.\r\n * \r\n * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\n * THE SOFTWARE.\r\n */\r\n\r\nmodule powerbi.visuals.telemetry {\r\n\r\n /**\r\n * Event fired when a visual is loaded through the visual adapter\r\n * @param name Name (guid) of the visual. \r\n * @param apiVersion Api version used by the visual. \r\n * @param custom Is the visual custom? \r\n * @param parentId Id of the parent event \r\n * @param isError True - action failed. \r\n * @param errorSource Source of the error. PowerBI = PowerBI has a problem, External = External Service (e.g. on-prem AS server is down), User = User error (e.g. uploading too much and hitting resource limitations. \r\n * @param errorCode PowerBI Error Code \r\n *\r\n * Generated by: Extensibility/events.bond\r\n */\r\n\r\n export declare var ExtensibilityVisualApiUsageLoggers: number;\r\n\r\n export var ExtensibilityVisualApiUsage = function(name: string, apiVersion: string, custom: boolean, parentId: string, isError: boolean = false, errorSource: ErrorSource = undefined, errorCode: string = undefined): ITelemetryEventI<IPBIExtensibilityVisualApiUsage> {\r\n var info = {\r\n name: name,\r\n apiVersion: apiVersion,\r\n custom: custom,\r\n parentId: parentId,\r\n isError: isError,\r\n errorSource: errorSource,\r\n errorCode: errorCode,\r\n };\r\n\r\n var event: ITelemetryEventI<IPBIExtensibilityVisualApiUsage> = {\r\n name: 'PBI.Extensibility.VisualApiUsage',\r\n category: TelemetryCategory.CustomerAction,\r\n time: Date.now(),\r\n id: generateGuid(),\r\n getFormattedInfoObject: function() {\r\n var formattedObject = {\r\n name: info.name,\r\n apiVersion: info.apiVersion,\r\n custom: info.custom,\r\n parentId: info.parentId,\r\n isError: info.isError,\r\n };\r\n if (typeof info.errorSource !== 'undefined') {\r\n formattedObject['errorSource'] = ErrorSource[info.errorSource];\r\n }\r\n if (typeof info.errorCode !== 'undefined') {\r\n formattedObject['errorCode'] = info.errorCode;\r\n }\r\n return formattedObject;\r\n },\r\n info: info,\r\n privateFields: [],\r\n orgInfoFields: []\r\n };\r\n\r\n if (typeof ExtensibilityVisualApiUsageLoggers !== 'undefined') {\r\n event.loggers = ExtensibilityVisualApiUsageLoggers;\r\n }\r\n\r\n return event;\r\n };\r\n\r\n /**\r\n * Event fired for uncaught exception in IVisual.\r\n * @param visualType Type of the visual. \r\n * @param isCustom Is the visual custom? \r\n * @param apiVersion Api version used by the visual \r\n * @param source Source URL \r\n * @param lineNumber Line number \r\n * @param columnNumber Column number \r\n * @param stack Stack trace \r\n * @param message Error exception message. \r\n *\r\n * Generated by JsCommon/commonTelemetryEvents.bond\r\n */\r\n\r\n export declare var VisualExceptionLoggers: number;\r\n\r\n export var VisualException = function(visualType: string, isCustom: boolean, apiVersion: string, source: string, lineNumber: number, columnNumber: number, stack: string, message: string): ITelemetryEventI<IPBIVisualException> {\r\n var info = {\r\n visualType: visualType,\r\n isCustom: isCustom,\r\n apiVersion: apiVersion,\r\n source: source,\r\n lineNumber: lineNumber,\r\n columnNumber: columnNumber,\r\n stack: stack,\r\n message: message,\r\n };\r\n\r\n var event: ITelemetryEventI<IPBIVisualException> = {\r\n name: 'PBI.VisualException',\r\n category: TelemetryCategory.CriticalError,\r\n time: Date.now(),\r\n id: generateGuid(),\r\n getFormattedInfoObject: function() {\r\n var formattedObject = {\r\n visualType: info.visualType,\r\n isCustom: info.isCustom,\r\n apiVersion: info.apiVersion,\r\n source: info.source,\r\n lineNumber: info.lineNumber,\r\n columnNumber: info.columnNumber,\r\n stack: info.stack,\r\n message: info.message,\r\n };\r\n return formattedObject;\r\n },\r\n info: info,\r\n privateFields: [],\r\n orgInfoFields: []\r\n };\r\n\r\n if (typeof VisualExceptionLoggers !== 'undefined') {\r\n event.loggers = VisualExceptionLoggers;\r\n }\r\n\r\n return event;\r\n };\r\n}","/*\r\n * Power BI Visualizations\r\n *\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. \r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"\"Software\"\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n * \r\n * The above copyright notice and this permission notice shall be included in \r\n * all copies or substantial portions of the Software.\r\n * \r\n * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\n * THE SOFTWARE.\r\n */\r\n\r\nmodule powerbi.extensibility {\r\n export function VisualPlugin(options: IVisualPluginOptions): ClassDecorator {\r\n return function (constructor: IVisualConstructor): void {\r\n constructor.__capabilities__ = options.capabilities;\r\n };\r\n }\r\n}","/*\r\n* Power BI Visualizations\r\n*\r\n* Copyright (c) Microsoft Corporation\r\n* All rights reserved. \r\n* MIT License\r\n*\r\n* Permission is hereby granted, free of charge, to any person obtaining a copy\r\n* of this software and associated documentation files (the \"\"Software\"\"), to deal\r\n* in the Software without restriction, including without limitation the rights\r\n* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n* copies of the Software, and to permit persons to whom the Software is\r\n* furnished to do so, subject to the following conditions:\r\n* \r\n* The above copyright notice and this permission notice shall be included in \r\n* all copies or substantial portions of the Software.\r\n* \r\n* THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \r\n* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \r\n* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \r\n* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \r\n* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\n* THE SOFTWARE.\r\n*/\r\n\r\nmodule powerbi.extensibility {\r\n import IPoint = visuals.IPoint;\r\n\r\n export interface SelectionManagerOptions{\r\n hostServices: IVisualHostServices;\r\n };\r\n\r\n export class SelectionManager implements ISelectionManager {\r\n private selectedIds: ISelectionId[];\r\n private hostServices: IVisualHostServices;\r\n private promiseFactory: IPromiseFactory;\r\n\r\n public constructor(options: SelectionManagerOptions) {\r\n this.hostServices = options.hostServices;\r\n this.selectedIds = [];\r\n this.promiseFactory = this.hostServices.promiseFactory();\r\n }\r\n \r\n public select(selectionId: ISelectionId, multiSelect: boolean = false): IPromise<ISelectionId[]> {\r\n let deferred: IDeferred<data.Selector[]> = this.promiseFactory.defer();\r\n \r\n if (this.hostServices.shouldRetainSelection()) {\r\n this.sendSelectionToHost([selectionId]);\r\n }\r\n else {\r\n this.selectInternal(selectionId, multiSelect);\r\n this.sendSelectionToHost(this.selectedIds);\r\n }\r\n\r\n deferred.resolve(this.selectedIds);\r\n return deferred.promise;\r\n }\r\n\r\n public showContextMenu(selectionId: ISelectionId, position: IPoint): IPromise<{}> {\r\n let deferred: IDeferred<{}> = this.promiseFactory.defer();\r\n\r\n this.sendContextMenuToHost(selectionId, position);\r\n\r\n deferred.resolve(null);\r\n return deferred.promise;\r\n }\r\n\r\n public hasSelection(): boolean {\r\n return this.selectedIds.length > 0;\r\n }\r\n\r\n public clear(): IPromise<{}> {\r\n let deferred = this.promiseFactory.defer();\r\n this.selectedIds = [];\r\n this.sendSelectionToHost([]);\r\n deferred.resolve(null);\r\n return deferred.promise;\r\n }\r\n\r\n public getSelectionIds(): ISelectionId[] {\r\n return this.selectedIds;\r\n }\r\n\r\n private sendSelectionToHost(ids: ISelectionId[]) {\r\n let selectArgs: SelectEventArgs = {\r\n data: ids\r\n .filter((value: ISelectionId) => (<visuals.SelectionId>value).hasIdentity())\r\n .map((value: ISelectionId) => (<visuals.SelectionId>value).getSelector())\r\n };\r\n\r\n let data2 = this.getSelectorsByColumn(ids);\r\n\r\n if (!_.isEmpty(data2))\r\n selectArgs.data2 = data2;\r\n\r\n this.hostServices.onSelect(selectArgs);\r\n }\r\n\r\n private sendContextMenuToHost(selectionId: ISelectionId, position: IPoint): void {\r\n let selectors = this.getSelectorsByColumn([selectionId]);\r\n if (_.isEmpty(selectors))\r\n return;\r\n\r\n let args: ContextMenuArgs = {\r\n data: selectors,\r\n position: position\r\n };\r\n\r\n this.hostServices.onContextMenu(args);\r\n }\r\n\r\n private getSelectorsByColumn(selectionIds: ISelectionId[]): SelectorsByColumn[] {\r\n return _(selectionIds)\r\n .filter(value => (<visuals.SelectionId>value).hasIdentity)\r\n .map(value => (<visuals.SelectionId>value).getSelectorsByColumn())\r\n .compact()\r\n .value();\r\n }\r\n\r\n private selectInternal(selectionId: ISelectionId, multiSelect: boolean) {\r\n if (SelectionManager.containsSelection(this.selectedIds, selectionId)) {\r\n this.selectedIds = multiSelect\r\n ? this.selectedIds.filter(d => !(<visuals.SelectionId>selectionId).equals(<visuals.SelectionId>d))\r\n : this.selectedIds.length > 1\r\n ? [selectionId] : [];\r\n } else {\r\n if (multiSelect)\r\n this.selectedIds.push(selectionId);\r\n else\r\n this.selectedIds = [selectionId];\r\n }\r\n }\r\n\r\n public static containsSelection(list: ISelectionId[], id: ISelectionId) {\r\n return list.some(d => (<visuals.SelectionId>id).equals(<visuals.SelectionId>d));\r\n }\r\n }\r\n} ","/*\r\n * Power BI Visualizations\r\n *\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. \r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"\"Software\"\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n * \r\n * The above copyright notice and this permission notice shall be included in \r\n * all copies or substantial portions of the Software.\r\n * \r\n * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\n * THE SOFTWARE.\r\n */\r\n\r\nmodule powerbi.extensibility {\r\n /**\r\n * This class is designed to simplify the creation of SelectionId objects\r\n * It allows chaining to build up an object before calling 'create' to build a SelectionId\r\n */\r\n export class SelectionIdBuilder implements ISelectionIdBuilder {\r\n private dataMap: SelectorForColumn;\r\n private measure: string;\r\n\r\n public withCategory(categoryColumn: DataViewCategoryColumn, index: number): this{\r\n if (categoryColumn && categoryColumn.source && categoryColumn.source.queryName && categoryColumn.identity)\r\n this.ensureDataMap()[categoryColumn.source.queryName] = categoryColumn.identity[index];\r\n \r\n return this;\r\n }\r\n\r\n public withSeries(seriesColumn: DataViewValueColumns, valueColumn: DataViewValueColumn | DataViewValueColumnGroup): this {\r\n if (seriesColumn && seriesColumn.source && seriesColumn.source.queryName && valueColumn)\r\n this.ensureDataMap()[seriesColumn.source.queryName] = valueColumn.identity;\r\n\r\n return this;\r\n }\r\n\r\n public withMeasure(measureId: string): this {\r\n this.measure = measureId;\r\n\r\n return this;\r\n }\r\n\r\n public createSelectionId(): ISelectionId {\r\n return visuals.SelectionId.createWithSelectorForColumnAndMeasure(this.ensureDataMap(), this.measure);\r\n }\r\n\r\n private ensureDataMap(): SelectorForColumn {\r\n if (!this.dataMap)\r\n this.dataMap = {};\r\n\r\n return this.dataMap;\r\n }\r\n }\r\n}\r\n","/*\r\n * Power BI Visualizations\r\n *\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved.\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"\"Software\"\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in\r\n * all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\n * THE SOFTWARE.\r\n */\r\n\r\nmodule powerbi.extensibility {\r\n\r\n import ITelemetryService = visuals.telemetry.ITelemetryService;\r\n import ExtensibilityVisualApiUsage = visuals.telemetry.ExtensibilityVisualApiUsage;\r\n import VisualTelemetryInfo = visuals.telemetry.VisualTelemetryInfo;\r\n\r\n //TODO: refactor this into a service\r\n export let visualApiVersions: VisualVersion[] = [];\r\n\r\n export function createVisualAdapter(visualPlugin: IVisualPlugin, telemetryService?: powerbi.ITelemetryService | ITelemetryService): powerbi.IVisual {\r\n let visualTelemetryInfo: VisualTelemetryInfo = {\r\n name: visualPlugin.name,\r\n apiVersion: visualPlugin.apiVersion,\r\n custom: !!visualPlugin.custom\r\n };\r\n return new VisualSafeExecutionWrapper(new VisualAdapter(visualPlugin, <ITelemetryService>telemetryService), visualTelemetryInfo, <ITelemetryService>telemetryService);\r\n }\r\n\r\n export class VisualAdapter implements powerbi.IVisual, WrappedVisual {\r\n private visual: powerbi.IVisual | powerbi.extensibility.IVisual;\r\n private apiVersionIndex: number;\r\n private plugin: powerbi.IVisualPlugin;\r\n private telemetryService: ITelemetryService;\r\n private legacy: boolean;\r\n\r\n constructor(visualPlugin: IVisualPlugin, telemetryService?: ITelemetryService) {\r\n this.telemetryService = telemetryService;\r\n this.plugin = visualPlugin;\r\n\r\n let version = visualPlugin.apiVersion;\r\n let versionIndex = this.getVersionIndex(version);\r\n let isError = false;\r\n\r\n if (!version) {\r\n this.legacy = true;\r\n }\r\n else if (versionIndex > -1) {\r\n this.apiVersionIndex = versionIndex;\r\n this.legacy = false;\r\n }\r\n else {\r\n debug.assertFail(\"The API version '\" + version + \"' is invalid.\");\r\n isError = true;\r\n }\r\n\r\n if (this.telemetryService) {\r\n this.telemetryService.logEvent(\r\n ExtensibilityVisualApiUsage,\r\n this.plugin.name,\r\n this.plugin.apiVersion,\r\n !!this.plugin.custom,\r\n undefined,\r\n isError,\r\n visuals.telemetry.ErrorSource.User\r\n );\r\n }\r\n }\r\n\r\n public init(options: powerbi.VisualInitOptions) {\r\n debug.assertValue(options.element, \"options.element\");\r\n debug.assertValue(options.host, \"options.host\");\r\n\r\n options.element.empty();\r\n\r\n if (this.legacy) {\r\n this.visual = this.plugin.create();\r\n this.visualLegacy.init(options);\r\n }\r\n else {\r\n let host = visualApiVersions[this.apiVersionIndex].hostAdapter(options.host);\r\n this.visual = this.plugin.create({\r\n element: options.element.get(0),\r\n host: host\r\n });\r\n this.overloadMethods();\r\n }\r\n }\r\n\r\n public update(options: powerbi.VisualUpdateOptions): void {\r\n if (options.type & VisualUpdateType.Resize && this.visualHasMethod('onResizing')) {\r\n this.onResizing(options.viewport, options.resizeMode);\r\n } else if (this.visualHasMethod('update')) {\r\n this.visualLegacy.update(options);\r\n } else {\r\n if (!options.type || options.type & VisualUpdateType.Data) {\r\n this.onDataChanged(<VisualDataChangedOptions>_.pick(options, ['dataViews', 'operationKind']));\r\n }\r\n if (options.type & VisualUpdateType.ViewMode) {\r\n this.onViewModeChanged(options.viewMode);\r\n }\r\n }\r\n }\r\n\r\n public destroy(): void {\r\n if (this.visualHasMethod('destroy')) {\r\n this.visualLegacy.destroy();\r\n }\r\n }\r\n\r\n public enumerateObjectInstances(options: EnumerateVisualObjectInstancesOptions): VisualObjectInstanceEnumeration {\r\n if (!this.visualHasMethod('enumerateObjectInstances')) {\r\n return;\r\n }\r\n return this.visualLegacy.enumerateObjectInstances(options);\r\n }\r\n\r\n public enumerateObjectRepetition(): VisualObjectRepetition[] {\r\n if (!this.visualHasMethod('enumerateObjectRepetition')) {\r\n return;\r\n }\r\n return this.visualLegacy.enumerateObjectRepetition();\r\n }\r\n\r\n public onResizing(finalViewport: IViewport, resizeMode: ResizeMode): void {\r\n if (this.visualHasMethod('onResizing')) {\r\n this.visualLegacy.onResizing(finalViewport, resizeMode);\r\n }\r\n }\r\n\r\n public onDataChanged(options: VisualDataChangedOptions): void {\r\n if (this.visualHasMethod('onDataChanged')) {\r\n this.visualLegacy.onDataChanged(options);\r\n }\r\n }\r\n\r\n public onViewModeChanged(viewMode: ViewMode): void {\r\n if (this.visualHasMethod('onViewModeChanged')) {\r\n this.visualLegacy.onViewModeChanged(viewMode);\r\n }\r\n }\r\n\r\n public onClearSelection(): void {\r\n if (this.visualHasMethod('onClearSelection')) {\r\n this.visualLegacy.onClearSelection();\r\n }\r\n }\r\n\r\n public canResizeTo(viewport: IViewport): boolean {\r\n if (this.visualHasMethod('canResizeTo')) {\r\n return this.visualLegacy.canResizeTo(viewport);\r\n }\r\n }\r\n\r\n public unwrap(): powerbi.IVisual {\r\n return <powerbi.IVisual>this.visual;\r\n }\r\n\r\n private get visualNew(): powerbi.extensibility.IVisual {\r\n if (this.legacy) return;\r\n return <powerbi.extensibility.IVisual>this.visual;\r\n }\r\n\r\n private get visualLegacy(): powerbi.IVisual {\r\n if (!this.legacy) return;\r\n return <powerbi.IVisual>this.visual;\r\n }\r\n\r\n private visualHasMethod(methodName: string): boolean {\r\n let visual = this.legacy ? this.visualLegacy : this.visualNew;\r\n return visual && _.isFunction(visual[methodName]);\r\n }\r\n\r\n private getVersionIndex(version: string): number {\r\n if (version) {\r\n let versionCount = extensibility.visualApiVersions.length;\r\n for (let i = 0; i < versionCount; i++) {\r\n if (extensibility.visualApiVersions[i].version === version) {\r\n return i;\r\n }\r\n }\r\n }\r\n return -1;\r\n }\r\n\r\n private overloadMethods(): void {\r\n let overloads = this.getCompiledOverloads();\r\n for (let key in overloads) {\r\n this[key] = overloads[key];\r\n }\r\n }\r\n\r\n private getCompiledOverloads(): VisualVersionOverloads {\r\n let overloads: VisualVersionOverloads = {};\r\n let versionIndex = this.apiVersionIndex;\r\n let visualNew = this.visualNew;\r\n for (let i = 0; i <= versionIndex; i++) {\r\n let overloadFactory = extensibility.visualApiVersions[i].overloads;\r\n if (_.isFunction(overloadFactory)) {\r\n _.assign(overloads, overloadFactory(visualNew));\r\n }\r\n }\r\n return overloads;\r\n }\r\n }\r\n}","/*\n * Power BI Visualizations\n *\n * Copyright (c) Microsoft Corporation\n * All rights reserved.\n * MIT License\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"\"Software\"\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n///<reference path=\"../../Typedefs/jquery/jquery.d.ts\"/>\n///<reference path=\"../../Typedefs/globalize/globalize.d.ts\"/>\n///<reference path=\"../../Typedefs/lodash/lodash.d.ts\"/>\n/*\n * Power BI Visualizations\n *\n * Copyright (c) Microsoft Corporation\n * All rights reserved.\n * MIT License\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"\"Software\"\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nvar powerbi;\n(function (powerbi) {\n var visuals;\n (function (visuals) {\n var telemetry;\n (function (telemetry) {\n /**\n * Creates a client-side Guid string.\n * @returns A string representation of a Guid.\n */\n function generateGuid() {\n var guid = \"\", idx = 0;\n for (idx = 0; idx < 32; idx += 1) {\n var guidDigitsItem = Math.random() * 16 | 0;\n switch (idx) {\n case 8:\n case 12:\n case 16:\n case 20:\n guid += \"-\";\n break;\n }\n guid += guidDigitsItem.toString(16);\n }\n return guid;\n }\n telemetry.generateGuid = generateGuid;\n })(telemetry = visuals.telemetry || (visuals.telemetry = {}));\n })(visuals = powerbi.visuals || (powerbi.visuals = {}));\n})(powerbi || (powerbi = {}));\n/*\n * Power BI Visualizations\n *\n * Copyright (c) Microsoft Corporation\n * All rights reserved.\n * MIT License\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"\"Software\"\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nvar powerbi;\n(function (powerbi) {\n var visuals;\n (function (visuals) {\n var telemetry;\n (function (telemetry) {\n telemetry.ExtensibilityVisualApiUsage = function (name, apiVersion, custom, parentId, isError, errorSource, errorCode) {\n if (isError === void 0) { isError = false; }\n if (errorSource === void 0) { errorSource = undefined; }\n if (errorCode === void 0) { errorCode = undefined; }\n var info = {\n name: name,\n apiVersion: apiVersion,\n custom: custom,\n parentId: parentId,\n isError: isError,\n errorSource: errorSource,\n errorCode: errorCode,\n };\n var event = {\n name: 'PBI.Extensibility.VisualApiUsage',\n category: 1 /* CustomerAction */,\n time: Date.now(),\n id: telemetry.generateGuid(),\n getFormattedInfoObject: function () {\n var formattedObject = {\n name: info.name,\n apiVersion: info.apiVersion,\n custom: info.custom,\n parentId: info.parentId,\n isError: info.isError,\n };\n if (typeof info.errorSource !== 'undefined') {\n formattedObject['errorSource'] = telemetry.ErrorSource[info.errorSource];\n }\n if (typeof info.errorCode !== 'undefined') {\n formattedObject['errorCode'] = info.errorCode;\n }\n return formattedObject;\n },\n info: info,\n privateFields: [],\n orgInfoFields: []\n };\n if (typeof telemetry.ExtensibilityVisualApiUsageLoggers !== 'undefined') {\n event.loggers = telemetry.ExtensibilityVisualApiUsageLoggers;\n }\n return event;\n };\n telemetry.VisualException = function (visualType, isCustom, apiVersion, source, lineNumber, columnNumber, stack, message) {\n var info = {\n visualType: visualType,\n isCustom: isCustom,\n apiVersion: apiVersion,\n source: source,\n lineNumber: lineNumber,\n columnNumber: columnNumber,\n stack: stack,\n message: message,\n };\n var event = {\n name: 'PBI.VisualException',\n category: 2 /* CriticalError */,\n time: Date.now(),\n id: telemetry.generateGuid(),\n getFormattedInfoObject: function () {\n var formattedObject = {\n visualType: info.visualType,\n isCustom: info.isCustom,\n apiVersion: info.apiVersion,\n source: info.source,\n lineNumber: info.lineNumber,\n columnNumber: info.columnNumber,\n stack: info.stack,\n message: info.message,\n };\n return formattedObject;\n },\n info: info,\n privateFields: [],\n orgInfoFields: []\n };\n if (typeof telemetry.VisualExceptionLoggers !== 'undefined') {\n event.loggers = telemetry.VisualExceptionLoggers;\n }\n return event;\n };\n })(telemetry = visuals.telemetry || (visuals.telemetry = {}));\n })(visuals = powerbi.visuals || (powerbi.visuals = {}));\n})(powerbi || (powerbi = {}));\n/*\n * Power BI Visualizations\n *\n * Copyright (c) Microsoft Corporation\n * All rights reserved.\n * MIT License\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"\"Software\"\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nvar powerbi;\n(function (powerbi) {\n var extensibility;\n (function (extensibility) {\n function VisualPlugin(options) {\n return function (constructor) {\n constructor.__capabilities__ = options.capabilities;\n };\n }\n extensibility.VisualPlugin = VisualPlugin;\n })(extensibility = powerbi.extensibility || (powerbi.extensibility = {}));\n})(powerbi || (powerbi = {}));\n/*\n* Power BI Visualizations\n*\n* Copyright (c) Microsoft Corporation\n* All rights reserved.\n* MIT License\n*\n* Permission is hereby granted, free of charge, to any person obtaining a copy\n* of this software and associated documentation files (the \"\"Software\"\"), to deal\n* in the Software without restriction, including without limitation the rights\n* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n* copies of the Software, and to permit persons to whom the Software is\n* furnished to do so, subject to the following conditions:\n*\n* The above copyright notice and this permission notice shall be included in\n* all copies or substantial portions of the Software.\n*\n* THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n* THE SOFTWARE.\n*/\nvar powerbi;\n(function (powerbi) {\n var extensibility;\n (function (extensibility) {\n ;\n var SelectionManager = (function () {\n function SelectionManager(options) {\n this.hostServices = options.hostServices;\n this.selectedIds = [];\n this.promiseFactory = this.hostServices.promiseFactory();\n }\n SelectionManager.prototype.select = function (selectionId, multiSelect) {\n if (multiSelect === void 0) { multiSelect = false; }\n var deferred = this.promiseFactory.defer();\n if (this.hostServices.shouldRetainSelection()) {\n this.sendSelectionToHost([selectionId]);\n }\n else {\n this.selectInternal(selectionId, multiSelect);\n this.sendSelectionToHost(this.selectedIds);\n }\n deferred.resolve(this.selectedIds);\n return deferred.promise;\n };\n SelectionManager.prototype.showContextMenu = function (selectionId, position) {\n var deferred = this.promiseFactory.defer();\n this.sendContextMenuToHost(selectionId, position);\n deferred.resolve(null);\n return deferred.promise;\n };\n SelectionManager.prototype.hasSelection = function () {\n return this.selectedIds.length > 0;\n };\n SelectionManager.prototype.clear = function () {\n var deferred = this.promiseFactory.defer();\n this.selectedIds = [];\n this.sendSelectionToHost([]);\n deferred.resolve(null);\n return deferred.promise;\n };\n SelectionManager.prototype.getSelectionIds = function () {\n return this.selectedIds;\n };\n SelectionManager.prototype.sendSelectionToHost = function (ids) {\n var selectArgs = {\n data: ids\n .filter(function (value) { return value.hasIdentity(); })\n .map(function (value) { return value.getSelector(); })\n };\n var data2 = this.getSelectorsByColumn(ids);\n if (!_.isEmpty(data2))\n selectArgs.data2 = data2;\n this.hostServices.onSelect(selectArgs);\n };\n SelectionManager.prototype.sendContextMenuToHost = function (selectionId, position) {\n var selectors = this.getSelectorsByColumn([selectionId]);\n if (_.isEmpty(selectors))\n return;\n var args = {\n data: selectors,\n position: position\n };\n this.hostServices.onContextMenu(args);\n };\n SelectionManager.prototype.getSelectorsByColumn = function (selectionIds) {\n return _(selectionIds)\n .filter(function (value) { return value.hasIdentity; })\n .map(function (value) { return value.getSelectorsByColumn(); })\n .compact()\n .value();\n };\n SelectionManager.prototype.selectInternal = function (selectionId, multiSelect) {\n if (SelectionManager.containsSelection(this.selectedIds, selectionId)) {\n this.selectedIds = multiSelect\n ? this.selectedIds.filter(function (d) { return !selectionId.equals(d); })\n : this.selectedIds.length > 1\n ? [selectionId] : [];\n }\n else {\n if (multiSelect)\n this.selectedIds.push(selectionId);\n else\n this.selectedIds = [selectionId];\n }\n };\n SelectionManager.containsSelection = function (list, id) {\n return list.some(function (d) { return id.equals(d); });\n };\n return SelectionManager;\n }());\n extensibility.SelectionManager = SelectionManager;\n })(extensibility = powerbi.extensibility || (powerbi.extensibility = {}));\n})(powerbi || (powerbi = {}));\n/*\n * Power BI Visualizations\n *\n * Copyright (c) Microsoft Corporation\n * All rights reserved.\n * MIT License\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"\"Software\"\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nvar powerbi;\n(function (powerbi) {\n var extensibility;\n (function (extensibility) {\n /**\n * This class is designed to simplify the creation of SelectionId objects\n * It allows chaining to build up an object before calling 'create' to build a SelectionId\n */\n var SelectionIdBuilder = (function () {\n function SelectionIdBuilder() {\n }\n SelectionIdBuilder.prototype.withCategory = function (categoryColumn, index) {\n if (categoryColumn && categoryColumn.source && categoryColumn.source.queryName && categoryColumn.identity)\n this.ensureDataMap()[categoryColumn.source.queryName] = categoryColumn.identity[index];\n return this;\n };\n SelectionIdBuilder.prototype.withSeries = function (seriesColumn, valueColumn) {\n if (seriesColumn && seriesColumn.source && seriesColumn.source.queryName && valueColumn)\n this.ensureDataMap()[seriesColumn.source.queryName] = valueColumn.identity;\n return this;\n };\n SelectionIdBuilder.prototype.withMeasure = function (measureId) {\n this.measure = measureId;\n return this;\n };\n SelectionIdBuilder.prototype.createSelectionId = function () {\n return powerbi.visuals.SelectionId.createWithSelectorForColumnAndMeasure(this.ensureDataMap(), this.measure);\n };\n SelectionIdBuilder.prototype.ensureDataMap = function () {\n if (!this.dataMap)\n this.dataMap = {};\n return this.dataMap;\n };\n return SelectionIdBuilder;\n }());\n extensibility.SelectionIdBuilder = SelectionIdBuilder;\n })(extensibility = powerbi.extensibility || (powerbi.extensibility = {}));\n})(powerbi || (powerbi = {}));\n/*\n * Power BI Visualizations\n *\n * Copyright (c) Microsoft Corporation\n * All rights reserved.\n * MIT License\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"\"Software\"\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nvar powerbi;\n(function (powerbi) {\n var extensibility;\n (function (extensibility) {\n var ExtensibilityVisualApiUsage = powerbi.visuals.telemetry.ExtensibilityVisualApiUsage;\n //TODO: refactor this into a service\n extensibility.visualApiVersions = [];\n function createVisualAdapter(visualPlugin, telemetryService) {\n var visualTelemetryInfo = {\n name: visualPlugin.name,\n apiVersion: visualPlugin.apiVersion,\n custom: !!visualPlugin.custom\n };\n return new extensibility.VisualSafeExecutionWrapper(new VisualAdapter(visualPlugin, telemetryService), visualTelemetryInfo, telemetryService);\n }\n extensibility.createVisualAdapter = createVisualAdapter;\n var VisualAdapter = (function () {\n function VisualAdapter(visualPlugin, telemetryService) {\n this.telemetryService = telemetryService;\n this.plugin = visualPlugin;\n var version = visualPlugin.apiVersion;\n var versionIndex = this.getVersionIndex(version);\n var isError = false;\n if (!version) {\n this.legacy = true;\n }\n else if (versionIndex > -1) {\n this.apiVersionIndex = versionIndex;\n this.legacy = false;\n }\n else {\n debug.assertFail(\"The API version '\" + version + \"' is invalid.\");\n isError = true;\n }\n if (this.telemetryService) {\n this.telemetryService.logEvent(ExtensibilityVisualApiUsage, this.plugin.name, this.plugin.apiVersion, !!this.plugin.custom, undefined, isError, powerbi.visuals.telemetry.ErrorSource.User);\n }\n }\n VisualAdapter.prototype.init = function (options) {\n debug.assertValue(options.element, \"options.element\");\n debug.assertValue(options.host, \"options.host\");\n options.element.empty();\n if (this.legacy) {\n this.visual = this.plugin.create();\n this.visualLegacy.init(options);\n }\n else {\n var host = extensibility.visualApiVersions[this.apiVersionIndex].hostAdapter(options.host);\n this.visual = this.plugin.create({\n element: options.element.get(0),\n host: host\n });\n this.overloadMethods();\n }\n };\n VisualAdapter.prototype.update = function (options) {\n if (options.type & powerbi.VisualUpdateType.Resize && this.visualHasMethod('onResizing')) {\n this.onResizing(options.viewport, options.resizeMode);\n }\n else if (this.visualHasMethod('update')) {\n this.visualLegacy.update(options);\n }\n else {\n if (!options.type || options.type & powerbi.VisualUpdateType.Data) {\n this.onDataChanged(_.pick(options, ['dataViews', 'operationKind']));\n }\n if (options.type & powerbi.VisualUpdateType.ViewMode) {\n this.onViewModeChanged(options.viewMode);\n }\n }\n };\n VisualAdapter.prototype.destroy = function () {\n if (this.visualHasMethod('destroy')) {\n this.visualLegacy.destroy();\n }\n };\n VisualAdapter.prototype.enumerateObjectInstances = function (options) {\n if (!this.visualHasMethod('enumerateObjectInstances')) {\n return;\n }\n return this.visualLegacy.enumerateObjectInstances(options);\n };\n VisualAdapter.prototype.enumerateObjectRepetition = function () {\n if (!this.visualHasMethod('enumerateObjectRepetition')) {\n return;\n }\n return this.visualLegacy.enumerateObjectRepetition();\n };\n VisualAdapter.prototype.onResizing = function (finalViewport, resizeMode) {\n if (this.visualHasMethod('onResizing')) {\n this.visualLegacy.onResizing(finalViewport, resizeMode);\n }\n };\n VisualAdapter.prototype.onDataChanged = function (options) {\n if (this.visualHasMethod('onDataChanged')) {\n this.visualLegacy.onDataChanged(options);\n }\n };\n VisualAdapter.prototype.onViewModeChanged = function (viewMode) {\n if (this.visualHasMethod('onViewModeChanged')) {\n this.visualLegacy.onViewModeChanged(viewMode);\n }\n };\n VisualAdapter.prototype.onClearSelection = function () {\n if (this.visualHasMethod('onClearSelection')) {\n this.visualLegacy.onClearSelection();\n }\n };\n VisualAdapter.prototype.canResizeTo = function (viewport) {\n if (this.visualHasMethod('canResizeTo')) {\n return this.visualLegacy.canResizeTo(viewport);\n }\n };\n VisualAdapter.prototype.unwrap = function () {\n return this.visual;\n };\n Object.defineProperty(VisualAdapter.prototype, \"visualNew\", {\n get: function () {\n if (this.legacy)\n return;\n return this.visual;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(VisualAdapter.prototype, \"visualLegacy\", {\n get: function () {\n if (!this.legacy)\n return;\n return this.visual;\n },\n enumerable: true,\n configurable: true\n });\n VisualAdapter.prototype.visualHasMethod = function (methodName) {\n var visual = this.legacy ? this.visualLegacy : this.visualNew;\n return visual && _.isFunction(visual[methodName]);\n };\n VisualAdapter.prototype.getVersionIndex = function (version) {\n if (version) {\n var versionCount = extensibility.visualApiVersions.length;\n for (var i = 0; i < versionCount; i++) {\n if (extensibility.visualApiVersions[i].version === version) {\n return i;\n }\n }\n }\n return -1;\n };\n VisualAdapter.prototype.overloadMethods = function () {\n var overloads = this.getCompiledOverloads();\n for (var key in overloads) {\n this[key] = overloads[key];\n }\n };\n VisualAdapter.prototype.getCompiledOverloads = function () {\n var overloads = {};\n var versionIndex = this.apiVersionIndex;\n var visualNew = this.visualNew;\n for (var i = 0; i <= versionIndex; i++) {\n var overloadFactory = extensibility.visualApiVersions[i].overloads;\n if (_.isFunction(overloadFactory)) {\n _.assign(overloads, overloadFactory(visualNew));\n }\n }\n return overloads;\n };\n return VisualAdapter;\n }());\n extensibility.VisualAdapter = VisualAdapter;\n })(extensibility = powerbi.extensibility || (powerbi.extensibility = {}));\n})(powerbi || (powerbi = {}));\n/*\n * Power BI Visualizations\n *\n * Copyright (c) Microsoft Corporation\n * All rights reserved.\n * MIT License\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"\"Software\"\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nvar powerbi;\n(function (powerbi) {\n var extensibility;\n (function (extensibility) {\n var VisualException = powerbi.visuals.telemetry.VisualException;\n var VisualSafeExecutionWrapper = (function () {\n function VisualSafeExecutionWrapper(wrappedVisual, visualInfo, telemetryService, silent) {\n this.wrappedVisual = wrappedVisual;\n this.visualInfo = visualInfo;\n this.telemetryService = telemetryService;\n this.silent = silent;\n }\n VisualSafeExecutionWrapper.prototype.init = function (options) {\n var _this = this;\n if (this.wrappedVisual.init) {\n this.executeSafely(function () { return _this.wrappedVisual.init(options); });\n }\n };\n VisualSafeExecutionWrapper.prototype.destroy = function () {\n var _this = this;\n if (this.wrappedVisual.destroy)\n this.executeSafely(function () { return _this.wrappedVisual.destroy(); });\n };\n VisualSafeExecutionWrapper.prototype.update = function (options) {\n var _this = this;\n if (this.wrappedVisual.update)\n this.executeSafely(function () { return _this.wrappedVisual.update(options); });\n };\n VisualSafeExecutionWrapper.prototype.onResizing = function (finalViewport, resizeMode) {\n var _this = this;\n if (this.wrappedVisual.onResizing)\n this.executeSafely(function () { return _this.wrappedVisual.onResizing(finalViewport, resizeMode); });\n };\n VisualSafeExecutionWrapper.prototype.onDataChanged = function (options) {\n var _this = this;\n if (this.wrappedVisual.onDataChanged)\n this.executeSafely(function () { return _this.wrappedVisual.onDataChanged(options); });\n };\n VisualSafeExecutionWrapper.prototype.onViewModeChanged = function (viewMode) {\n var _this = this;\n if (this.wrappedVisual.onViewModeChanged)\n this.executeSafely(function () { return _this.wrappedVisual.onViewModeChanged(viewMode); });\n };\n VisualSafeExecutionWrapper.prototype.onClearSelection = function () {\n var _this = this;\n if (this.wrappedVisual.onClearSelection)\n this.executeSafely(function () { return _this.wrappedVisual.onClearSelection(); });\n };\n VisualSafeExecutionWrapper.prototype.canResizeTo = function (viewport) {\n var _this = this;\n if (this.wrappedVisual.canResizeTo)\n return this.executeSafely(function () { return _this.wrappedVisual.canResizeTo(viewport); });\n };\n VisualSafeExecutionWrapper.prototype.enumerateObjectInstances = function (options) {\n var _this = this;\n if (this.wrappedVisual.enumerateObjectInstances)\n return this.executeSafely(function () { return _this.wrappedVisual.enumerateObjectInstances(options); });\n };\n VisualSafeExecutionWrapper.prototype.enumerateObjectRepetition = function () {\n var _this = this;\n if (this.wrappedVisual.enumerateObjectRepetition)\n return this.executeSafely(function () { return _this.wrappedVisual.enumerateObjectRepetition(); });\n };\n VisualSafeExecutionWrapper.prototype.unwrap = function () {\n var visual = this.wrappedVisual;\n return visual.unwrap ? visual.unwrap() : visual;\n };\n VisualSafeExecutionWrapper.prototype.isCustomVisual = function () {\n return this.visualInfo.custom;\n };\n VisualSafeExecutionWrapper.prototype.executeSafely = function (callback) {\n try {\n return callback();\n }\n catch (exception) {\n if (!this.silent) {\n console.error(\"Visual exception\", exception.stack || exception);\n }\n if (this.telemetryService) {\n this.telemetryService.logEvent(VisualException, this.visualInfo.name, this.visualInfo.custom, this.visualInfo.apiVersion, exception.fileName, exception.lineNumber, exception.columnNumber, exception.stack, exception.message);\n }\n }\n };\n return VisualSafeExecutionWrapper;\n }());\n extensibility.VisualSafeExecutionWrapper = VisualSafeExecutionWrapper;\n })(extensibility = powerbi.extensibility || (powerbi.extensibility = {}));\n})(powerbi || (powerbi = {}));\n/*\n * Power BI Visualizations\n *\n * Copyright (c) Microsoft Corporation\n * All rights reserved.\n * MIT License\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"\"Software\"\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nvar powerbi;\n(function (powerbi) {\n var extensibility;\n (function (extensibility) {\n var v100;\n (function (v100) {\n var overloadFactory = function (visual) {\n return {\n update: function (options) {\n if (visual.update) {\n var type = options.type || powerbi.VisualUpdateType.Data;\n if (type & powerbi.VisualUpdateType.Resize && options.resizeMode === 2 /* Resized */) {\n type |= powerbi.VisualUpdateType.ResizeEnd;\n }\n visual.update({\n viewport: options.viewport,\n dataViews: options.dataViews,\n type: type\n });\n }\n },\n destroy: function () {\n if (visual.destroy) {\n visual.destroy();\n }\n },\n enumerateObjectInstances: function (options) {\n if (visual.enumerateObjectInstances) {\n return visual.enumerateObjectInstances(options);\n }\n }\n };\n };\n var hostAdapter = function (host) {\n return {};\n };\n extensibility.visualApiVersions.push({\n version: '1.0.0',\n overloads: overloadFactory,\n hostAdapter: hostAdapter\n });\n })(v100 = extensibility.v100 || (extensibility.v100 = {}));\n })(extensibility = powerbi.extensibility || (powerbi.extensibility = {}));\n})(powerbi || (powerbi = {}));\n/*\n * Power BI Visualizations\n *\n * Copyright (c) Microsoft Corporation\n * All rights reserved.\n * MIT License\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"\"Software\"\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nvar powerbi;\n(function (powerbi) {\n var extensibility;\n (function (extensibility) {\n var v110;\n (function (v110) {\n var hostAdapter = function (host) {\n return {\n createSelectionIdBuilder: function () { return new powerbi.visuals.SelectionIdBuilder(); },\n createSelectionManager: function () { return new extensibility.SelectionManager({ hostServices: host }); }\n };\n };\n extensibility.visualApiVersions.push({\n version: '1.1.0',\n hostAdapter: hostAdapter\n });\n })(v110 = extensibility.v110 || (extensibility.v110 = {}));\n })(extensibility = powerbi.extensibility || (powerbi.extensibility = {}));\n})(powerbi || (powerbi = {}));\n\n\n","/*\r\n * Power BI Visualizations\r\n *\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved.\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"\"Software\"\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in\r\n * all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\n * THE SOFTWARE.\r\n */\r\n\r\nmodule powerbi.extensibility {\r\n\r\n import ITelemetryService = visuals.telemetry.ITelemetryService;\r\n import VisualTelemetryInfo = visuals.telemetry.VisualTelemetryInfo;\r\n import VisualException = powerbi.visuals.telemetry.VisualException;\r\n\r\n export class VisualSafeExecutionWrapper implements powerbi.IVisual, WrappedVisual {\r\n constructor(\r\n private wrappedVisual: powerbi.IVisual,\r\n private visualInfo: VisualTelemetryInfo,\r\n private telemetryService: ITelemetryService,\r\n private silent?: boolean) { }\r\n\r\n public init(options: VisualInitOptions): void {\r\n if (this.wrappedVisual.init) {\r\n this.executeSafely(() => this.wrappedVisual.init(options));\r\n }\r\n }\r\n\r\n public destroy(): void {\r\n if (this.wrappedVisual.destroy)\r\n this.executeSafely(() => this.wrappedVisual.destroy());\r\n }\r\n\r\n public update(options: powerbi.VisualUpdateOptions): void {\r\n if (this.wrappedVisual.update)\r\n this.executeSafely(() => this.wrappedVisual.update(options));\r\n }\r\n\r\n public onResizing(finalViewport: IViewport, resizeMode: ResizeMode): void {\r\n if (this.wrappedVisual.onResizing)\r\n this.executeSafely(() => this.wrappedVisual.onResizing(finalViewport, resizeMode));\r\n }\r\n\r\n public onDataChanged(options: VisualDataChangedOptions): void {\r\n if (this.wrappedVisual.onDataChanged)\r\n this.executeSafely(() => this.wrappedVisual.onDataChanged(options));\r\n }\r\n\r\n public onViewModeChanged(viewMode: ViewMode): void {\r\n if (this.wrappedVisual.onViewModeChanged)\r\n this.executeSafely(() => this.wrappedVisual.onViewModeChanged(viewMode));\r\n }\r\n\r\n public onClearSelection(): void {\r\n if (this.wrappedVisual.onClearSelection)\r\n this.executeSafely(() => this.wrappedVisual.onClearSelection());\r\n }\r\n\r\n public canResizeTo(viewport: IViewport): boolean {\r\n if (this.wrappedVisual.canResizeTo)\r\n return this.executeSafely(() => this.wrappedVisual.canResizeTo(viewport));\r\n }\r\n\r\n public enumerateObjectInstances(options: EnumerateVisualObjectInstancesOptions): VisualObjectInstanceEnumeration {\r\n if (this.wrappedVisual.enumerateObjectInstances)\r\n return this.executeSafely(() => this.wrappedVisual.enumerateObjectInstances(options));\r\n }\r\n\r\n public enumerateObjectRepetition(): VisualObjectRepetition[] {\r\n if (this.wrappedVisual.enumerateObjectRepetition)\r\n return this.executeSafely(() => this.wrappedVisual.enumerateObjectRepetition());\r\n }\r\n\r\n public unwrap(): powerbi.IVisual {\r\n let visual = <powerbi.IVisual & WrappedVisual>this.wrappedVisual;\r\n return visual.unwrap ? visual.unwrap() : visual;\r\n }\r\n\r\n public isCustomVisual(): boolean {\r\n return this.visualInfo.custom;\r\n }\r\n\r\n private executeSafely(callback: () => any): any {\r\n try {\r\n return callback();\r\n } catch (exception) {\r\n if (!this.silent) {\r\n console.error(\"Visual exception\", exception.stack || exception);\r\n }\r\n\r\n if (this.telemetryService) {\r\n this.telemetryService.logEvent(\r\n VisualException,\r\n this.visualInfo.name,\r\n this.visualInfo.custom,\r\n this.visualInfo.apiVersion,\r\n exception.fileName,\r\n exception.lineNumber,\r\n exception.columnNumber,\r\n exception.stack,\r\n exception.message);\r\n }\r\n }\r\n }\r\n }\r\n}","/*\r\n * Power BI Visualizations\r\n *\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. \r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"\"Software\"\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n * \r\n * The above copyright notice and this permission notice shall be included in \r\n * all copies or substantial portions of the Software.\r\n * \r\n * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\n * THE SOFTWARE.\r\n */\r\n\r\nmodule powerbi.extensibility.v100 {\r\n let overloadFactory: VisualVersionOverloadFactory = (visual: IVisual) => {\r\n return {\r\n update: (options: powerbi.VisualUpdateOptions) => {\r\n if (visual.update) {\r\n let type = options.type || VisualUpdateType.Data;\r\n if(type & VisualUpdateType.Resize && options.resizeMode === ResizeMode.Resized) {\r\n type |= VisualUpdateType.ResizeEnd;\r\n } \r\n visual.update({\r\n viewport: options.viewport,\r\n dataViews: options.dataViews,\r\n type: type\r\n });\r\n }\r\n },\r\n destroy: () => {\r\n if (visual.destroy) {\r\n visual.destroy();\r\n }\r\n },\r\n enumerateObjectInstances: (options: EnumerateVisualObjectInstancesOptions) => {\r\n if (visual.enumerateObjectInstances) {\r\n return visual.enumerateObjectInstances(options);\r\n }\r\n }\r\n };\r\n };\r\n\r\n let hostAdapter: VisualHostAdapter = (host: IVisualHostServices): IVisualHost => {\r\n return {};\r\n };\r\n\r\n visualApiVersions.push({\r\n version: '1.0.0',\r\n overloads: overloadFactory,\r\n hostAdapter: hostAdapter\r\n });\r\n}","/*\r\n * Power BI Visualizations\r\n *\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. \r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"\"Software\"\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n * \r\n * The above copyright notice and this permission notice shall be included in \r\n * all copies or substantial portions of the Software.\r\n * \r\n * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\n * THE SOFTWARE.\r\n */\r\n\r\nmodule powerbi.extensibility.v110 {\r\n let hostAdapter: VisualHostAdapter = (host: powerbi.IVisualHostServices): IVisualHost => {\r\n return {\r\n createSelectionIdBuilder: () => new visuals.SelectionIdBuilder(),\r\n createSelectionManager: () => new SelectionManager({ hostServices: host })\r\n };\r\n };\r\n\r\n visualApiVersions.push({\r\n version: '1.1.0',\r\n hostAdapter: hostAdapter\r\n });\r\n}"],"sourceRoot":"/source/"}
\No newline at end of file