UNPKG

56.2 kBSource Map (JSON)View Raw
1{"version":3,"file":"VisualsExtensibility.js","sources":["webpack:///webpack/bootstrap c35d750342349c7c595f?6b86******","webpack:///./src/Clients/VisualsExtensibility/module.ts","webpack:///./src/Clients/VisualsExtensibility/_references.ts","webpack:///./src/Clients/VisualsExtensibility/typedefs/typedefs.ts","webpack:///./src/Clients/VisualsExtensibility/telemetry/generateGuid.ts","webpack:///./src/Clients/VisualsExtensibility/telemetry/events.ts","webpack:///./src/Clients/VisualsExtensibility/decorators/VisualPlugin.ts","webpack:///./src/Clients/VisualsExtensibility/components/selectionManager.ts","webpack:///./src/Clients/VisualsExtensibility/components/selectionIdBuilder.ts","webpack:///./src/Clients/VisualsExtensibility/versioning/VisualAdapter.ts","webpack:///./src/Clients/VisualsExtensibility/versioning/VisualPluginAdapter.ts","webpack:///./src/Clients/VisualsExtensibility/versioning/VisualSafeExecutionWrapper.ts","webpack:///./src/Clients/VisualsExtensibility/versioning/versions/v1.0.0.ts","webpack:///./src/Clients/VisualsExtensibility/versioning/versions/v1.1.0.ts"],"sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap c35d750342349c7c595f\n **/","/// <reference path=\"./_references.ts\"/>\r\n\r\nwindow.jsCommon = window.jsCommon || {};\r\nwindow.powerbi = window.powerbi || {};\r\nwindow.debug = window.debug || {};\r\nwindow.InJs = window.InJs || {};\r\n\r\n// Require all files from the `_references.ts`\r\nrequire(\"ReferencesLoader!./_references.ts\");\r\n\r\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/Clients/VisualsExtensibility/module.ts\n **/","/*** IMPORTS FROM imports-loader ***/\nvar jsCommon = window.jsCommon;\nvar powerbi = window.powerbi;\nvar powerbitests = window.powerbitests;\nvar InJs = window.InJs;\nvar debug = window.debug;\nvar jasmine = window.jasmine;\nvar Microsoft = window.Microsoft;\n\n/// <reference path=\"../../../src/Clients/Typedefs/webpack/webpack-env.d.ts\"/>\r\n/// <reference path=\"../../../src/Clients/Typedefs/common/window.d.ts\"/>\r\nrequire(\"./typedefs/typedefs.ts\");\r\n/// <reference path=\"../VisualsContracts/_references.ts\"/>\r\n/// <reference path=\"../VisualsCommon/_references.ts\"/>\r\n/// <reference path=\"../VisualsData/_references.ts\"/>\r\nrequire(\"./telemetry/generateGuid.ts\");\r\nrequire(\"./telemetry/events.ts\");\r\nrequire(\"./decorators/VisualPlugin.ts\");\r\nrequire(\"./components/selectionManager.ts\");\r\nrequire(\"./components/selectionIdBuilder.ts\");\r\nrequire(\"./versioning/VisualAdapter.ts\");\r\nrequire(\"./versioning/VisualPluginAdapter.ts\");\r\nrequire(\"./versioning/VisualSafeExecutionWrapper.ts\");\r\nrequire(\"./versioning/versions/v1.0.0.ts\");\r\nrequire(\"./versioning/versions/v1.1.0.ts\");\r\n\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./build/webpack/ReferencesLoader.js!./src/Clients/VisualsExtensibility/_references.ts\n ** module id = 439\n ** module chunks = 6 7\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\n///<reference path=\"../../Typedefs/jquery/jquery.d.ts\"/>\r\n///<reference path=\"../../Typedefs/globalize/globalize.d.ts\"/>\r\n///<reference path=\"../../Typedefs/lodash/lodash.d.ts\"/>\r\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/Clients/VisualsExtensibility/typedefs/typedefs.ts\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\n/// <reference path=\"../_references.ts\"/>\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}\n\n\n/** WEBPACK FOOTER **\n ** ./src/Clients/VisualsExtensibility/telemetry/generateGuid.ts\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\n/// <reference path=\"../_references.ts\"/>\r\n\r\nmodule powerbi.visuals.telemetry {\r\n var g = jsCommon.Utility.generateGuid;\r\n\r\n export interface IPBIVisualApiUsage extends ICustomerAction {\r\n \tname: string;\r\n \tapiVersion: string;\r\n \tcustom: boolean;\r\n }\r\n\r\n /**\r\n * Event fired when a visual is loaded through the VisualSafeExecutionWrapper\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: commonTelemetryEvents.bond\r\n */\r\n\r\n export declare var VisualApiUsageLoggers: number;\r\n\r\n export var VisualApiUsage = function (name: string, apiVersion: string, custom: boolean, parentId: string, isError: boolean = false, errorSource: powerbi.visuals.telemetry.ErrorSource = undefined, errorCode: string = undefined): ITelemetryEventI<IPBIVisualApiUsage> {\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<IPBIVisualApiUsage> = {\r\n name: 'PBI.Visual.ApiUsage',\r\n category: TelemetryCategory.CustomerAction,\r\n time: Date.now(),\r\n id: g(),\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'] = powerbi.visuals.telemetry.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 powerbi.visuals.telemetry.VisualApiUsageLoggers !== 'undefined') {\r\n event.loggers = powerbi.visuals.telemetry.VisualApiUsageLoggers;\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.Visual.Exception',\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}\n\n\n/** WEBPACK FOOTER **\n ** ./src/Clients/VisualsExtensibility/telemetry/events.ts\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\n/// <reference path=\"../_references.ts\"/>\r\n\r\nmodule powerbi.extensibility {\r\n export function VisualPlugin(options: IVisualPluginOptions): ClassDecorator {\r\n return function (constructor: IVisualConstructor): void {\r\n constructor.__transform__ = options.transform;\r\n };\r\n }\r\n}\n\n\n/** WEBPACK FOOTER **\n ** ./src/Clients/VisualsExtensibility/decorators/VisualPlugin.ts\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\n/// <reference path=\"../_references.ts\"/>\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} \n\n\n/** WEBPACK FOOTER **\n ** ./src/Clients/VisualsExtensibility/components/selectionManager.ts\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\n/// <reference path=\"../_references.ts\"/>\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\n\n\n/** WEBPACK FOOTER **\n ** ./src/Clients/VisualsExtensibility/components/selectionIdBuilder.ts\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\n/// <reference path=\"../_references.ts\"/>\r\n\r\nmodule powerbi.extensibility {\r\n import ITelemetryService = visuals.telemetry.ITelemetryService;\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 visualAdapter: VisualAdapter = new VisualAdapter(visualPlugin, <ITelemetryService> telemetryService);\r\n\r\n return new VisualSafeExecutionWrapper(\r\n visualAdapter, \r\n visualPlugin,\r\n <ITelemetryService> telemetryService,\r\n visualAdapter.isPluginInError);\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 public isPluginInError: boolean = false;\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\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 this.isPluginInError = true;\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) === VisualUpdateType.Resize && this.visualHasMethod('onResizing')) {\r\n //a couple custom visuals depend on both onResizing and Update being called\r\n //TODO: remove this once enough custom visuals are ported to new api\r\n if (this.plugin.custom && this.visualHasMethod('update')) {\r\n this.visualLegacy.update(options);\r\n }\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\n\n/** WEBPACK FOOTER **\n ** ./src/Clients/VisualsExtensibility/versioning/VisualAdapter.ts\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\n/// <reference path=\"../_references.ts\"/>\r\n\r\nmodule powerbi.extensibility {\r\n\r\n /**\r\n * Translates visual plugin produced by pbiviz cli tools\r\n * The function mutates the plugin\r\n * \r\n * TODO: add separate capabilities interfaces and versioning support\r\n */\r\n export function translateVisualPlugin(plugin: IVisualPlugin): void {\r\n translateCapabilities(plugin.capabilities);\r\n }\r\n\r\n function translateCapabilities(capabilities: VisualCapabilities): void {\r\n if (!capabilities) return;\r\n\r\n translateObjects(capabilities.objects);\r\n\r\n translateDataRoles(capabilities.dataRoles);\r\n }\r\n\r\n /**\r\n * Translates objects\r\n * - allows passing EnumMembers in json (converted to EnumType)\r\n */\r\n function translateObjects(objects: data.DataViewObjectDescriptors): void {\r\n for (let key in objects) {\r\n let object = objects[key];\r\n if (!object) continue;\r\n let properties = object.properties;\r\n if (properties) {\r\n for (let pKey in properties) {\r\n let property = properties[pKey];\r\n if (!property) continue;\r\n let propertyType = (<ValueTypeDescriptor>property.type);\r\n if (propertyType && propertyType.enumeration) {\r\n propertyType.enumeration = createEnumType(<IEnumMember[]>(<any>propertyType.enumeration));\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Translates data roles\r\n * - allows using strings for kind in json\r\n */\r\n function translateDataRoles(dataRoles: VisualDataRole[]): void {\r\n for (let key in dataRoles) {\r\n let dataRole = dataRoles[key];\r\n if (dataRole && dataRole.kind) {\r\n switch (dataRole.kind.toString().toLowerCase()) {\r\n case 'grouping':\r\n dataRole.kind = VisualDataRoleKind.Grouping;\r\n break;\r\n case 'measure':\r\n dataRole.kind = VisualDataRoleKind.Measure;\r\n break;\r\n case 'groupingormeasure':\r\n dataRole.kind = VisualDataRoleKind.GroupingOrMeasure;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n}\n\n\n/** WEBPACK FOOTER **\n ** ./src/Clients/VisualsExtensibility/versioning/VisualPluginAdapter.ts\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\n/// <reference path=\"../_references.ts\"/>\r\n\r\nmodule powerbi.extensibility {\r\n\r\n import ITelemetryService = visuals.telemetry.ITelemetryService;\r\n import VisualException = powerbi.visuals.telemetry.VisualException;\r\n\r\n export class VisualSafeExecutionWrapper implements powerbi.IVisual, WrappedVisual {\r\n private perfLoadEvent: powerbi.visuals.telemetry.IDeferredTelemetryEvent;\r\n \r\n constructor(\r\n private wrappedVisual: powerbi.IVisual,\r\n private visualPlugin: IVisualPlugin,\r\n private telemetryService: ITelemetryService,\r\n private isPluginInError: boolean,\r\n private silent?: boolean) \r\n {\r\n if (this.telemetryService) {\r\n this.perfLoadEvent = this.telemetryService.startEvent(\r\n powerbi.visuals.telemetry.VisualApiUsage,\r\n visualPlugin.name, // name\r\n visualPlugin.apiVersion, // apiVersion\r\n !!visualPlugin.custom, // is this a custom visual?\r\n undefined, // parentId\r\n isPluginInError, // isError\r\n visuals.telemetry.ErrorSource.User, // errorSource\r\n undefined // errorCode\r\n );\r\n }\r\n }\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 // We don't want to .resolve() any perf event here. Instead, we simply cancel it.\r\n if (this.perfLoadEvent) {\r\n this.perfLoadEvent = null;\r\n }\r\n }\r\n\r\n public update(options: powerbi.VisualUpdateOptions): void {\r\n if (this.wrappedVisual.update) {\r\n this.executeSafely(() => {\r\n this.wrappedVisual.update(options);\r\n \r\n if (this.perfLoadEvent) {\r\n this.perfLoadEvent.resolve();\r\n this.perfLoadEvent = null;\r\n }\r\n });\r\n } \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.visualPlugin.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.visualPlugin.name,\r\n !!this.visualPlugin.custom,\r\n this.visualPlugin.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 if (this.perfLoadEvent) {\r\n this.perfLoadEvent.reject();\r\n this.perfLoadEvent = null;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/Clients/VisualsExtensibility/versioning/VisualSafeExecutionWrapper.ts\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\n/// <reference path=\"../../_references.ts\"/>\r\n\r\nmodule powerbi.extensibility.v100 {\r\n\r\n export function convertLegacyUpdateType(options: powerbi.VisualUpdateOptions): VisualUpdateType {\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 return type;\r\n }\r\n\r\n let overloadFactory: VisualVersionOverloadFactory = (visual: IVisual) => {\r\n return {\r\n update: (options: powerbi.VisualUpdateOptions) => {\r\n if (visual.update) {\r\n visual.update({\r\n viewport: options.viewport,\r\n dataViews: options.dataViews,\r\n type: convertLegacyUpdateType(options)\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}\n\n\n/** WEBPACK FOOTER **\n ** ./src/Clients/VisualsExtensibility/versioning/versions/v1.0.0.ts\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\n/// <reference path=\"../../_references.ts\"/>\r\n\r\nmodule powerbi.extensibility.v110 {\r\n\r\n let overloadFactory: VisualVersionOverloadFactory = (visual: IVisual) => {\r\n return {\r\n update: (options: powerbi.VisualUpdateOptions) => {\r\n if (visual.update) {\r\n let updateOptions: VisualUpdateOptions = {\r\n viewport: options.viewport,\r\n dataViews: options.dataViews,\r\n type: v100.convertLegacyUpdateType(options)\r\n };\r\n\r\n let transform: IVisualDataViewTransform = (<IVisualConstructor>(<any>visual.constructor)).__transform__;\r\n if (_.isFunction(transform)) {\r\n visual.update(updateOptions, transform(updateOptions.dataViews));\r\n } else {\r\n visual.update(updateOptions);\r\n }\r\n }\r\n }\r\n };\r\n };\r\n\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 colors: powerbi.visuals.ThemeManager.getDefaultTheme(),\r\n };\r\n };\r\n\r\n visualApiVersions.push({\r\n version: '1.1.0',\r\n overloads: overloadFactory,\r\n hostAdapter: hostAdapter\r\n });\r\n}\n\n\n/** WEBPACK FOOTER **\n ** ./src/Clients/VisualsExtensibility/versioning/versions/v1.1.0.ts\n **/"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;ACtCA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACzBA;;;;;;;;;;;;;;;;;;;;;;;;AAwBA;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;AC7BA;;;;;;;;;;;;;;;;;;;;;;;;AAwBA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;;;AAGA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAlBA;AAmBA;AAAA;AAAA;AACA;;;;;;;;;;;;;;;;;ACrDA;;;;;;;;;;;;;;;;;;;;;;;;AAwBA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAuBA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAAA;AACA;;;;;;;;;;;;;;;;;AC1JA;;;;;;;;;;;;;;;;;;;;;;;;AAwBA;AAEA;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AAJA;AAKA;AAAA;AACA;;;;;;;;;;;;;;;;;ACnCA;;;;;;;;;;;;;;;;;;;;;;;;AAwBA;AAEA;AAEA;AAAA;AAAA;AAAA;AAKA;AAEA;AAKA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAxGA;AAyGA;AAAA;AACA;;;;;;;;;;;;;;;;;AC7IA;;;;;;;;;;;;;;;;;;;;;;;;AAwBA;AAEA;AAEA;AAAA;AAAA;AAAA;AACA;;;AAGA;AACA;AAAA;AAkCA;AA9BA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAlCA;AAmCA;AAAA;AACA;;;;;;;;;;;;;;;;;ACrEA;;;;;;;;;;;;;;;;;;;;;;;;AAwBA;AAEA;AAEA;AAAA;AAAA;AAAA;AAGA;AACA;AAEA;AACA;AAEA;AAKA;AARA;AAUA;AAQA;AAFA;AAGA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AACA;AAAA;AACA;AACA;;;AAAA;AAEA;AAAA;AACA;AAAA;AACA;AACA;;;AAAA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAxKA;AAyKA;AAAA;AACA;;;;;;;;;;;;;;;;;ACtNA;;;;;;;;;;;;;;;;;;;;;;;;AAwBA;AAEA;AAEA;AAAA;AAAA;AAAA;AAEA;;;;;AAKA;AACA;AACA;AACA;AAFA;AAIA;AACA;AAAA;AAEA;AAEA;AACA;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;;;;;;;;;;;;;;;;;AC7FA;;;;;;;;;;;;;;;;;;;;;;;;AAwBA;AAEA;AAEA;AAAA;AAAA;AAAA;AAGA;AAEA;AAGA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AA7HA;AA8HA;AAAA;AACA;;;;;;;;;;;;;;;;;AChKA;;;;;;;;;;;;;;;;;;;;;;;;AAwBA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AANA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;;;;;;;;;;;;;;;;;ACxEA;;;;;;;;;;;;;;;;;;;;;;;;AAwBA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;;;;;","sourceRoot":""}
\No newline at end of file