diff --git a/demo/package.json b/demo/package.json index e61d1e93..e2d43398 100644 --- a/demo/package.json +++ b/demo/package.json @@ -35,7 +35,7 @@ "fetch": "^1.0.0", "http-server": "^0.10.0", "jquery": "^3.1.0", - "powerbi-client": "^2.6.6", + "powerbi-client": "^2.6.9", "syntaxhighlighter": "4.0.1" }, "devDependencies": {} diff --git a/demo/v2-demo/images/closeWhite.png b/demo/v2-demo/images/closeWhite.png new file mode 100644 index 00000000..aa9cb92f Binary files /dev/null and b/demo/v2-demo/images/closeWhite.png differ diff --git a/demo/v2-demo/images/insightToActionIcon.svg b/demo/v2-demo/images/insightToActionIcon.svg new file mode 100644 index 00000000..c678c87b --- /dev/null +++ b/demo/v2-demo/images/insightToActionIcon.svg @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/v2-demo/images/themesIcon.svg b/demo/v2-demo/images/themesIcon.svg new file mode 100644 index 00000000..ba3532ad --- /dev/null +++ b/demo/v2-demo/images/themesIcon.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/v2-demo/index.html b/demo/v2-demo/index.html index b92cce66..5f502c8d 100644 --- a/demo/v2-demo/index.html +++ b/demo/v2-demo/index.html @@ -70,6 +70,8 @@ + + diff --git a/demo/v2-demo/live_showcases/bookmarks/showcase_bookmarks.html b/demo/v2-demo/live_showcases/bookmarks/showcase_bookmarks.html index 00397e1b..4bdfa4c9 100644 --- a/demo/v2-demo/live_showcases/bookmarks/showcase_bookmarks.html +++ b/demo/v2-demo/live_showcases/bookmarks/showcase_bookmarks.html @@ -25,7 +25,7 @@

Capture & share bookmarks

-
+
Bookmarks
diff --git a/demo/v2-demo/live_showcases/bookmarks/showcase_bookmarks.js b/demo/v2-demo/live_showcases/bookmarks/showcase_bookmarks.js index 361e8175..d69c9199 100644 --- a/demo/v2-demo/live_showcases/bookmarks/showcase_bookmarks.js +++ b/demo/v2-demo/live_showcases/bookmarks/showcase_bookmarks.js @@ -28,7 +28,7 @@ function embedBookmarksReport() { // Get report Id from session var embedReportId = GetSession(SessionKeys.EmbedId); - // We give the user View permissions + // Use View permissions var permissions = models.Permissions.View; // Embed configuration used to describe the what and how to embed @@ -85,7 +85,7 @@ function embedSharedBookmark(enableFilterPane, bookmarkState) { // Get report Id from session var embedReportId = GetSession(SessionKeys.EmbedId); - // We give the user View permissions + // Use View permissions var permissions = models.Permissions.View; // Get the bookmark name from url param @@ -261,7 +261,7 @@ function getBookmarkByID(bookmarkId) { // Build bookmark radio button HTML element function buildBookmarkElement(bookmark) { var labelElement = document.createElement("label"); - labelElement.setAttribute("class", "bookmarkContainer"); + labelElement.setAttribute("class", "showcaseRadioContainer"); var inputElement = document.createElement("input"); inputElement.setAttribute("type", "radio"); @@ -271,7 +271,7 @@ function buildBookmarkElement(bookmark) { labelElement.appendChild(inputElement); var spanElement = document.createElement("span"); - spanElement.setAttribute("class", "bookmarkCheckmark"); + spanElement.setAttribute("class", "showcaseRadioCheckmark"); labelElement.appendChild(spanElement); var secondSpanElement = document.createElement("span"); diff --git a/demo/v2-demo/live_showcases/custom_layout/showcase_custom_layout.html b/demo/v2-demo/live_showcases/custom_layout/showcase_custom_layout.html index 6127a6da..aa82e8a4 100644 --- a/demo/v2-demo/live_showcases/custom_layout/showcase_custom_layout.html +++ b/demo/v2-demo/live_showcases/custom_layout/showcase_custom_layout.html @@ -20,9 +20,9 @@

Dynamic report layout

-
+
Report visuals (Hide/Show)
-
+
diff --git a/demo/v2-demo/live_showcases/custom_layout/showcase_custom_layout.js b/demo/v2-demo/live_showcases/custom_layout/showcase_custom_layout.js index 810923d9..f9660f83 100644 --- a/demo/v2-demo/live_showcases/custom_layout/showcase_custom_layout.js +++ b/demo/v2-demo/live_showcases/custom_layout/showcase_custom_layout.js @@ -37,7 +37,7 @@ function embedCustomLayoutReport() { // Get report Id from session var embedReportId = GetSession(SessionKeys.EmbedId); - // We give the user View permissions + // Use View permissions var permissions = models.Permissions.View; // Embed configuration used to describe the what and how to embed diff --git a/demo/v2-demo/live_showcases/insight_to_action/showcase_insight_to_action.html b/demo/v2-demo/live_showcases/insight_to_action/showcase_insight_to_action.html new file mode 100644 index 00000000..9c8849ad --- /dev/null +++ b/demo/v2-demo/live_showcases/insight_to_action/showcase_insight_to_action.html @@ -0,0 +1,115 @@ +
+
+ +
+
Start a campaign with these customers
+
Hover over the table, and click on the three dots icon '...' at the upper right corner.
+
+
+ Next +
+
+ 1 of 2 +
+
+
+ +
+

Insight to action

+
+
+ This showcase demonstrates one example of how to leverage the ‘menu extensions’ and ‘export data’ APIs to give users the ability to take meaningful actions within seconds from analytics. The sample contains a basic customer relationship management module. The main table shows a list of customers who have not engaged with your service lately, and might not return. You can send these customers an offer to try and retain them.

+  1. Choose a list of customers
+
+ The sales report shows a list of possible churning customers. Use the slicers to define the list of customers you want to engage with.

+
+  2. Take actions to get them engaged
+
+ Follow the instructions on the tooltips to take actions straight from within the report.
+
+
+ +
+ +
+
+
Embedded view
+
+
+
+
+
+ Campaign distribution list + + + +
+
+
+
+
+
+ Send coupon +
+
+ Send discount +
+
+ Cancel +
+
+
+
+ +
+
Send offer
+
Choose the customers and send them an offering
+
+
+ Got it +
+
+
+
+
+
+ + + + +
+
+
+
Title
+ +
+
+
Body
+ +
+
+
+
+ Cancel +
+
+ Send +
+
+
+
Sent
+
+
+
+ + + + \ No newline at end of file diff --git a/demo/v2-demo/live_showcases/insight_to_action/showcase_insight_to_action.js b/demo/v2-demo/live_showcases/insight_to_action/showcase_insight_to_action.js new file mode 100644 index 00000000..bbbb61d2 --- /dev/null +++ b/demo/v2-demo/live_showcases/insight_to_action/showcase_insight_to_action.js @@ -0,0 +1,337 @@ +let InsightToActionShowcaseState = { + report: null, + data: null, + allChecked: false, + tooltipNextPressed: false, +} + +const dialogTooltipTimeout = 1500; +const sentMessageTimeout = 3000; + +// Embed the report and retrieve the existing report bookmarks +function embedInsightsToActionReport() { + InsightToActionShowcaseState.tooltipNextPressed = false; + + // Load sample report properties into session + return LoadInsightToActionShowcaseReportIntoSession().then(function () { + + // Get models. models contains enums that can be used + const models = window['powerbi-client'].models; + + // Get embed application token from session + let accessToken = GetSession(SessionKeys.AccessToken); + + // Get embed URL from session + let embedUrl = GetSession(SessionKeys.EmbedUrl); + + // Get report Id from session + let embedReportId = GetSession(SessionKeys.EmbedId); + + // Use View permissions + let permissions = models.Permissions.View; + + // Icon for the custom extension + const base64Icon = "data:image/png;base64,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" + + // Table visual name + const tableVisualName = "1149606f2a101953b4ba"; + + // Embed configuration used to describe the what and how to embed + // This object is used when calling powerbi.embed + // This also includes settings and options such as filters + // You can find more information at https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details + let config= { + type: 'report', + tokenType: models.TokenType.Embed, + accessToken: accessToken, + embedUrl: embedUrl, + id: embedReportId, + permissions: permissions, + settings: { + filterPaneEnabled: false, + navContentPaneEnabled: false, + + // Adding the extension command to the options menu + extensions: [ + { + command: { + name: "campaign", + title: "Start campaign", + icon: base64Icon, + selector: { + $schema: "http://powerbi.com/product/schema#visualSelector", + visualName: tableVisualName + }, + extend: { + visualOptionsMenu: { + title: "Start campaign", + menuLocation: models.MenuLocation.Top, + } + } + } + }, + ], + + // Hiding built-in commands on the options menu + commands: [ + { + spotlight: { + selector: { + visualName: tableVisualName + }, + displayOption: models.CommandDisplayOption.Hidden, + }, + exportData: { + selector: { + visualName: tableVisualName + }, + displayOption: models.CommandDisplayOption.Hidden, + }, + seeData: { + selector: { + visualName: tableVisualName + }, + displayOption: models.CommandDisplayOption.Hidden, + }, + } + ] + }, + }; + + // Get a reference to the embedded report HTML element + let embedContainer = $('#embedContainer')[0]; + + // Embed the report and display it within the div container + InsightToActionShowcaseState.report = powerbi.embed(embedContainer, config); + InsightToActionShowcaseState.report.on("rendered", function() { + setTooltipPosition(); + $('#startTooltip').addClass("showTooltip"); + + // Remove event handler, thus, the tooltip will appear only once + InsightToActionShowcaseState.report.off("rendered"); + }); + + // Report.on will add an event handler to commandTriggered event which prints to console window. + InsightToActionShowcaseState.report.on("commandTriggered", function(event) { + if (event.detail.command === "campaign") { + InsightToActionShowcaseState.report.getPages() + .then(function (pages) { + + // Retrieve active page. + let activePage = pages.find(function(page) { + return page.isActive + }); + + // Get page's visuals + activePage.getVisuals() + .then(function (visuals) { + + // Retrieve the wanted visual. + let visual = visuals.find(function(visual) { + return visual.name === tableVisualName; + }); + + // Exports visual data + visual.exportData(models.ExportDataType.Underlying).then(handleExportData); + }); + }); + } + }); + }); +} + +// Handles the export data API result +function handleExportData(result) { + + // Parse the recieved data from csv to 2d array + let resultData = parseData(result.data); + + // Filter the unwanted columns + InsightToActionShowcaseState.data = filterTable(["Latest purchase - Category", "Total spend", "Days since last purchase"], resultData); + + // Create a table from the 2d array + let table = createTable(InsightToActionShowcaseState.data) + + // Clear the div + $("#dialogTable").empty(); + + // Add the table to the dialog + $("#dialogTable").append(table) + + // Hide the tooltip + $('#startTooltip').removeClass("showTooltip"); + + // Show the dialog + $('#dialogMask').show(); + $('#distributionDialog').show(); + + // Shows dialog tooltip after a short delay + setTimeout(function() { + $('#dialogTooltip').addClass("showTooltip"); + }, dialogTooltipTimeout); +} + +// Parse the data from the API +function parseData(data) { + let result = []; + data.split("\n").forEach(function(row) { + if (row !== "") { + let rowArray = []; + row.split(",").forEach(function(cell) { + rowArray.push(cell); + }); + + result.push(rowArray); + } + }); + + return result; +} + +// Filter the table's data - removing the 'filterValues' columns +function filterTable(filterValues, table) { + for (let i = 0; i < filterValues.length; i++) { + valueIndex = table[0].findIndex(function(value) { return value === filterValues[i] }); + for (let j = 0; j < table.length; j++) { + table[j].splice(valueIndex, 1); + } + } + + return table; +} + +// Handles tooltip click action +function onTootipClicked(tooltipId) { + if (!InsightToActionShowcaseState.tooltipNextPressed && tooltipId === "startTooltip") { + let newText = document.createTextNode("Then, click `Start campaign` menu command."); + let startTooltipSubText = $('#startTooltip .showcaseTooltipSubText'); + const textOldHeight = startTooltipSubText[0].offsetHeight; + startTooltipSubText.empty(); + startTooltipSubText.append(newText); + startTooltipSubText[0].setAttribute("style", "height: " + textOldHeight + "px;"); + + let newTooltipNumber = document.createTextNode("2 of 2"); + $('#startTooltip .tooltipNumber').empty(); + $('#startTooltip .tooltipNumber').append(newTooltipNumber); + + let newBtnText = document.createTextNode("Got it"); + $('#startTooltip .btnShowcaseTooltip').empty(); + $('#startTooltip .btnShowcaseTooltip').append(newBtnText); + + InsightToActionShowcaseState.tooltipNextPressed = true; + } else { + $('#' + tooltipId).hide(); + } +} + +// Closes the dialog +function onCloseDialog(id) { + $('#dialogTooltip').hide(); + $('#dialogMask').hide(); + $('#' + id).hide(); +} + +// Open the send coupon/discount dialog +function onSendClicked(name) { + let headerText = document.createTextNode("Send " + name + " to distribution list"); + $('#sendDialog .dialogHeaderText').empty(); + $('#sendDialog .dialogHeaderText').append(headerText); + + const promotionToSend = name === "coupon" ? "30$ coupon" : "10% discount"; + let bodyText = "Hi , get your " + promotionToSend + " today!"; + $('#sendDialog textarea').val(bodyText); + + $('#dialogTooltip').hide(); + $('#distributionDialog').hide(); + $('#sendDialog').show(); +} + +// Closes the send dialog and shows the 'Sent' message +function onSendDialogSendClicked() { + $('#sendDialog').hide(); + $('#dialogMask').hide(); + $('#messageSent').addClass("show"); + + setTimeout(function() { + $('#messageSent').removeClass("show"); + }, sentMessageTimeout); +} + +// Build the HTML table from the data +function createTable(tableData) { + let table = document.createElement('table'); + let tableBody = document.createElement('tbody'); + let rowIndex = 0; + + // Set all checked to true, for check all table button + InsightToActionShowcaseState.allChecked = true; + + tableData.forEach(function(rowData) { + let row = document.createElement('tr'); + + // Add ✓ or checkbox + if (rowIndex === 0) { + let cell = document.createElement('th'); + cell.setAttribute("onclick","onCheckAllClicked();"); + cell.setAttribute("class", "checkAllBtn"); + cell.appendChild(document.createTextNode('✓')); + row.appendChild(cell); + } else { + let cell = document.createElement('td'); + let checkboxElement = document.createElement("input"); + checkboxElement.setAttribute("type", "checkbox"); + checkboxElement.setAttribute("name", "tableRowCheckbox"); + checkboxElement.setAttribute("id", "row" + rowIndex); + checkboxElement.checked = true; + cell.appendChild(checkboxElement); + row.appendChild(cell); + } + + let isNameCell = true; + rowData.forEach(function(cellData) { + let cell; + if (rowIndex !== 0) { + cell = document.createElement('td'); + if (isNameCell) { + cell.setAttribute("class", "nameCell"); + isNameCell = false; + } + } else { + cell = document.createElement('th'); + } + + cell.appendChild(document.createTextNode(cellData)); + row.appendChild(cell); + }); + + tableBody.appendChild(row); + rowIndex++; + }); + + table.appendChild(tableBody); + + return table; +} + +// Check/Uncheck all the customers on the table +function onCheckAllClicked() { + let checkboxes = document.getElementsByName("tableRowCheckbox"); + for (let i = 0; i < checkboxes.length; i++) { + checkboxes[i].checked = !InsightToActionShowcaseState.allChecked; + } + + InsightToActionShowcaseState.allChecked = !InsightToActionShowcaseState.allChecked; +} + +// Calculate and set the tooltip position +function setTooltipPosition() { + let startTooltip = document.getElementById("startTooltip"); + let embedContainer = document.getElementById('embedContainer'); + let textHeight = document.getElementById('showcases-text').offsetHeight; + let containerHeight = embedContainer.offsetWidth * 0.56; + + // Calculate the tooltip position relatively + const top = textHeight + 64 + ((embedContainer.offsetHeight - containerHeight) / 2) - startTooltip.offsetHeight + (0.05 * embedContainer.offsetHeight); + const left = (embedContainer.offsetWidth - 10) * 0.971 - 125; + startTooltip.setAttribute("style", "top: " + top + "px; left: " + left + "px;"); +} \ No newline at end of file diff --git a/demo/v2-demo/live_showcases/themes/showcase_themes.html b/demo/v2-demo/live_showcases/themes/showcase_themes.html new file mode 100644 index 00000000..941bef94 --- /dev/null +++ b/demo/v2-demo/live_showcases/themes/showcase_themes.html @@ -0,0 +1,43 @@ +
+

Personalize report design

+
+
+ You can personalize the colors and styling of your embedded analytics using the themes API.
+ Themes help define styling and colors so you can match them to your application or brand color palette, for example.
+ With the themes API, you can apply a custom theme during the report load or during a session.
+ In this showcase, we’ve provided a few example color palettes and styles so you can see how themes can be applied to user report views.
+
+ +
+ +
+
+
Data colors
+
+
+
+
+
Background
+
+
+
+
+
+
+
Embedded view
+
+
+
+
+
+ + \ No newline at end of file diff --git a/demo/v2-demo/live_showcases/themes/showcase_themes.js b/demo/v2-demo/live_showcases/themes/showcase_themes.js new file mode 100644 index 00000000..f1c204ce --- /dev/null +++ b/demo/v2-demo/live_showcases/themes/showcase_themes.js @@ -0,0 +1,252 @@ + + +let ThemesShowcaseState = { + themesArray: null, + themesReport: null, + dataColorSize: 16, + backgroundSize: 16, +}; + +// For report themes documentation please check https://docs.microsoft.com/en-us/power-bi/desktop-report-themes +const jsonThemes = [ + { + "name": "Apothecary", + "dataColors": ["#93A299", "#CF543F", "#B5AE53", "#848058", "#E8B54D", "#786C71", "#93A2A0", "#CF9A3F", "#8CB553", "#728458", "#D0E84D", "#786D6C"], + "background":"#FFFFFF", + "foreground": "#CF543F", + "tableAccent": "#93A299" + }, + { + "name": "Colorblind Safe", + "dataColors": ["#074650", "#009292", "#fe6db6", "#feb5da", "#480091", "#b66dff", "#b5dafe", "#6db6ff", "#914800", "#23fd23"], + "background":"#FFFFFF", + "foreground": "#074650", + "tableAccent": "#fe6db6" + }, + { + "name": "Valentine's Day", + "dataColors": ["#990011", "#cc1144", "#ee7799", "#eebbcc", "#cc4477", "#cc5555", "#882222", "#A30E33"], + "background":"#FFFFFF", + "foreground": "#ee7799", + "tableAccent": "#990011" + }, + { + "name": "Waveform", + "dataColors": ["#31B6FD", "#4584D3", "#5BD078", "#A5D028", "#F5C040", "#05E0DB", "#3153FD", "#4C45D3", "#5BD0B0", "#54D028", "#D0F540", "#057BE0"], + "background":"#FFFFFF", + "foreground": "#4584D3", + "tableAccent": "#31B6FD" + }, +]; + +const backgrounds = [ + { + "background": "#FFFFFF", + }, + { + "background": "#323130", + "foreground": "#FFFFFF", + "tableAccent": "#FFFFFF", + "visualStyles": { + "*":{ + "*":{ + "*":[{ + "fontFamily":"Segoe UI", + "color":{"solid":{"color":"#323130"}}, + "labelColor":{"solid":{"color":"#FFFFFF"}}, + "titleColor":{"solid":{"color":"#FFFFFF"}}, + }], + "labels":[{ + "color":{"solid":{"color":"#FFFFFF"}} + }], + "categoryLabels":[{ + "color":{"solid":{"color":"#FFFFFF"}} + }] + } + } + } + } +] + +// Embed the report +function embedThemesReport() { + + // Load sample report properties into session + return LoadThemesShowcaseReportIntoSession().then(function () { + + // Get models. models contains enums that can be used + const models = window['powerbi-client'].models; + + // Get embed application token from session + let accessToken = GetSession(SessionKeys.AccessToken); + + // Get embed URL from session + let embedUrl = GetSession(SessionKeys.EmbedUrl); + + // Get report Id from session + let embedReportId = GetSession(SessionKeys.EmbedId); + + // Use View permissions + let permissions = models.Permissions.View; + + // Embed configuration used to describe the what and how to embed + // This object is used when calling powerbi.embed + // This also includes settings and options such as filters + // You can find more information at https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details + let config= { + type: 'report', + tokenType: models.TokenType.Embed, + accessToken: accessToken, + embedUrl: embedUrl, + id: embedReportId, + permissions: permissions, + settings: { + filterPaneEnabled: false, + navContentPaneEnabled: false, + }, + + // Adding theme attribute to the config, will apply the theme on load + theme: {themeJson: jsonThemes[0]}, + }; + + // Get a reference to the embedded report HTML element + let embedContainer = $('#embedContainer')[0]; + + // Embed the report and display it within the div container + ThemesShowcaseState.themesReport = powerbi.embed(embedContainer, config); + + // Report.on will add an event handler for report loaded event + ThemesShowcaseState.themesReport.on("loaded", function() { + let themesList = $('#themesList'); + + // Set the first theme on the list as active + themesList.find("#theme0").attr('checked', true); + + // Displaying the themes list and the backgrounds list + themesList.show(); + $('#backgroundsList').show(); + $('#background0', '#backgroundsList').addClass("selected"); + }); + }); +} + +// Apply clicked theme and set it as the active theme on the list +function onThemeClicked(element) { + + // Set the clicked theme as active + $(element).attr('checked', true); + + applyTheme(); +} + +// Apply clicked background and set it as the active background on the list +function setThemeBackgroundActive(id) { + + // Set the clicked background as active + $('.themeBackgroundColor').removeClass("selected"); + $('#background' + id, '#backgroundsList').addClass("selected"); + + applyTheme(); +} + +function applyTheme() { + // Get active theme id + activeThemeId = Number($('input[name=theme]:checked', '#themesList')[0].getAttribute("id").slice(-1)); + activeBackgroundId = Number($('.selected', '#backgroundsList')[0].getAttribute("id").slice(-1)); + theme = {} + $.extend(theme, jsonThemes[activeThemeId], backgrounds[activeBackgroundId]); + + // Apply the theme + let report = ThemesShowcaseState.themesReport; + report.applyTheme({themeJson: theme}); +} + +// Create a themes list +function createThemesList() { + + // Build the themes list HTML code + let themesList = $('#themesList'); + + // Hide the div until the report loads + themesList.hide(); + + // Building the themes list + for (let i = 0; i < jsonThemes.length; i++) { + themesList.append(buildThemeElement(i)); + } +} + +// Create a backgrounds list +function createBackgroundsList() { + + // Build the backgrounds list HTML code + let backgroundsList = $('#backgroundsList'); + + // Hide the div until the report loads + backgroundsList.hide(); + + // Building the themes list + for (let i = 0; i < backgrounds.length; i++) { + backgroundsList.append(buildBackgroundElement(i)); + } +} + +// Build theme radio button HTML element +function buildThemeElement(id) { + let labelElement = document.createElement("label"); + labelElement.setAttribute("class", "showcaseRadioContainer themesRadioContainer"); + + let inputElement = document.createElement("input"); + inputElement.setAttribute("type", "radio"); + inputElement.setAttribute("name", "theme"); + inputElement.setAttribute("id", 'theme' + id); + inputElement.setAttribute("onclick", "onThemeClicked(this);"); + labelElement.appendChild(inputElement); + + let spanElement = document.createElement("span"); + spanElement.setAttribute("class", "showcaseRadioCheckmark"); + labelElement.appendChild(spanElement); + + let secondSpanElement = document.createElement("span"); + secondSpanElement.setAttribute("class", "radioTitle"); + let radioTitleElement = document.createTextNode(jsonThemes[id].name); + secondSpanElement.appendChild(radioTitleElement); + labelElement.appendChild(secondSpanElement); + + let colorsDivElement = document.createElement("div"); + colorsDivElement.setAttribute("class","themeColors"); + + // Calculate the max width for displaying data colors + const maxWidth = document.getElementById('themesDataColorsWrapper').offsetWidth - 48 /*padding*/; + const dataColors = jsonThemes[id].dataColors; + const singleDataColorWidth = ThemesShowcaseState.dataColorSize + 3 /*margin*/; + let currentWidth = 0; + for (let i = 0; i < dataColors.length; i++) { + + // Verify that the data colors will not overflow + if (currentWidth + singleDataColorWidth > maxWidth) + break; + + let dataColorElement = document.createElement("img"); + let url = "https://placehold.it/" + ThemesShowcaseState.dataColorSize + "/" + dataColors[i].substr(1) + "/000000?text=+"; + dataColorElement.setAttribute("src", url); + dataColorElement.setAttribute("class", "themeDataColor"); + colorsDivElement.appendChild(dataColorElement); + currentWidth += singleDataColorWidth; + } + + labelElement.appendChild(colorsDivElement); + + return labelElement; +} + +// Build background HTML element +function buildBackgroundElement(id) { + let backgroundElement = document.createElement("img"); + let url = "https://placehold.it/" + ThemesShowcaseState.backgroundSize + "/" + backgrounds[id].background.substr(1) + "/000000?text=+"; + backgroundElement.setAttribute("src", url); + backgroundElement.setAttribute("class", "themeBackgroundColor"); + backgroundElement.setAttribute("id", 'background' + id); + backgroundElement.setAttribute("onclick", "setThemeBackgroundActive(" + id + ");"); + return backgroundElement; +} diff --git a/demo/v2-demo/scripts/index.js b/demo/v2-demo/scripts/index.js index e5121fd1..fab9ebbc 100644 --- a/demo/v2-demo/scripts/index.js +++ b/demo/v2-demo/scripts/index.js @@ -67,8 +67,10 @@ function SetActiveStyle(id) } const ShowcasesHtmls = { - CustomLayout : "./live_showcases/custom_layout/showcase_custom_layout.html", - Bookmarks : "./live_showcases/bookmarks/showcase_bookmarks.html" + CustomLayout: "./live_showcases/custom_layout/showcase_custom_layout.html", + Bookmarks: "./live_showcases/bookmarks/showcase_bookmarks.html", + Themes: "./live_showcases/themes/showcase_themes.html", + InsightToAction: "./live_showcases/insight_to_action/showcase_insight_to_action.html", }; function OpenShowcase(showcaseType) { diff --git a/demo/v2-demo/scripts/session_utils.js b/demo/v2-demo/scripts/session_utils.js index 02aa9447..73766b2e 100644 --- a/demo/v2-demo/scripts/session_utils.js +++ b/demo/v2-demo/scripts/session_utils.js @@ -4,6 +4,8 @@ const dashboardUrl = 'https://powerbiplaygroundbe.azurewebsites.net/api/Dashboar const tileUrl = 'https://powerbiplaygroundbe.azurewebsites.net/api/Tiles/SampleTile'; const qnaUrl = 'https://powerbiplaygroundbe.azurewebsites.net/api/Datasets/SampleQna'; const layoutShowcaseReportUrl = 'https://powerbiplaygroundbe.azurewebsites.net/api/Reports/LayoutDemoReport'; +const insightToActionShowcaseReportUrl = 'https://powerbiplaygroundbe.azurewebsites.net/api/Reports/InsightToActionReport'; +const themesShowcaseReportUrl = 'https://powerbiplaygroundbe.azurewebsites.net/api/Reports/ThemesReport'; var LastReportSampleUrl = null; var ReportRefreshTokenTimer = 0; @@ -269,6 +271,16 @@ function LoadLayoutShowcaseReportIntoSession() { return FetchUrlIntoSession(layoutShowcaseReportUrl, false /* updateCurrentToken */); } +function LoadInsightToActionShowcaseReportIntoSession() { + SetSession(SessionKeys.EntityType, EntityType.Report); + return FetchUrlIntoSession(insightToActionShowcaseReportUrl, false /* updateCurrentToken */); +} + +function LoadThemesShowcaseReportIntoSession() { + SetSession(SessionKeys.EntityType, EntityType.Report); + return FetchUrlIntoSession(themesShowcaseReportUrl, false /* updateCurrentToken */); +} + function WarmStartSampleReportEmbed() { let embedUrl = GetParameterByName(SessionKeys.EmbedUrl); if (embedUrl) { diff --git a/demo/v2-demo/showcases.html b/demo/v2-demo/showcases.html index f51f1c5a..94b16d36 100644 --- a/demo/v2-demo/showcases.html +++ b/demo/v2-demo/showcases.html @@ -9,10 +9,9 @@

Interactive feature showcase

-
+
-
NEW
@@ -25,10 +24,9 @@

Dynamic report layout

-
+
-
NEW
@@ -40,5 +38,37 @@

Capture & share bookmarks

+ +
+
+ +
NEW
+
+
+
+

Personalize report design

+ Dynamically control the look & feel of your report with themes API. +
+
+ +
+
+
+ +
+
+ +
NEW
+
+
+
+

Insight to action

+ Let your users take actions driven straight from analytics, with minimal clicks! +
+
+ +
+
+
\ No newline at end of file diff --git a/demo/v2-demo/style/layout.css b/demo/v2-demo/style/layout.css index 44cc177d..2838d385 100644 --- a/demo/v2-demo/style/layout.css +++ b/demo/v2-demo/style/layout.css @@ -53,11 +53,16 @@ label { background: #F1F1F1; } +#showcasesContent { + position: relative; +} + #showcaseContent { display: table; padding: 32px 24px 24px 24px; width: 100%; background: #F1F1F1; + overflow: hidden; } #samples-step-wrapper { @@ -175,6 +180,7 @@ label { #showcase-embedded-view { background: #FFFFFF; height: calc(67vw*(9/16)*1.1); + position: relative; } #bookmark-embedded-view { @@ -182,18 +188,36 @@ label { height: calc(61vw*(9/16)*1.1); } -#visualsArea, #bookmarksArea { +#themes-embedded-view { + background: #FFFFFF; + height: calc(64vw*(9/16)*1.1); +} + + +#leftShowcaseWindow { min-width: 20vw; max-width: 20vw; display: table-cell; padding-right: 16px; } -#visualsWrapper, #bookmarksWrapper { +#showcaseItemsWrapper, #bookmarksWrapper { background: #FFFFFF; min-height: 350px; } +#themesDataColorsWrapper { + background: #FFFFFF; + min-height: 236px; + margin-bottom: 8px; +} + +#themesBackgroundWrapper { + background: #FFFFFF; + min-height: 64px; + padding: 22px 22px; +} + #bookmarksWrapper { min-height: 550px; } @@ -203,6 +227,30 @@ label { width: 100%; } +#insightToActionShowcaseEmbedArea { + width: calc(100% - 20vw); +} + +#showcasesSelectDiv { + max-width: 1250px; +} + +@media only screen and (max-width: 1280px) { + #distributionDialog { + width: 750px; + height: 450px; + } + + #dialogTable { + height: 303px; + } + + #dialogTooltip { + top: 195px; + } +} + + @media only screen and (max-width: 1050px) { .textAreaControl { margin-right: 20px; diff --git a/demo/v2-demo/style/style.css b/demo/v2-demo/style/style.css index 67d44e4b..4a847407 100644 --- a/demo/v2-demo/style/style.css +++ b/demo/v2-demo/style/style.css @@ -641,7 +641,7 @@ a:hover, a:visited, a:link, a:active cursor: default; } -.desktop-view iframe, .mobile-view iframe, #showcase-embedded-view iframe, #bookmark-embedded-view iframe, #share-bookmark iframe { +.desktop-view iframe, .mobile-view iframe, #showcase-embedded-view iframe, #bookmark-embedded-view iframe, #share-bookmark iframe, #themes-embedded-view iframe { border: none; } @@ -958,7 +958,7 @@ a:hover, a:visited, a:link, a:active opacity: 0.7; } -#visualsList, #bookmarksList { +#visualsList, #bookmarksList, #themesList { padding: 8px 0 8px 0; } @@ -1024,7 +1024,7 @@ a:hover, a:visited, a:link, a:active transform: rotate(45deg); } -.bookmarkContainer { +.showcaseRadioContainer { display: block; position: relative; padding-left: 26px; @@ -1035,13 +1035,17 @@ a:hover, a:visited, a:link, a:active padding: 8px 8px 8px 40px; } -.bookmarkContainer input { +.themesRadioContainer { + height: 50px; +} + +.showcaseRadioContainer input { position: absolute; opacity: 0; cursor: pointer; } -.bookmarkCheckmark { +.showcaseRadioCheckmark { position: absolute; top: 11px; left: 12px; @@ -1056,21 +1060,21 @@ a:hover, a:visited, a:link, a:active -webkit-transition: all 100ms ease; } -.bookmarkContainer input:checked ~ .bookmarkCheckmark { +.showcaseRadioContainer input:checked ~ .showcaseRadioCheckmark { border-color: #3E65FF; } -.bookmarkCheckmark:after { +.showcaseRadioCheckmark:after { content: ""; position: absolute; display: none; } -.bookmarkContainer input:checked ~ .bookmarkCheckmark:after { +.showcaseRadioContainer input:checked ~ .showcaseRadioCheckmark:after { display: block; } -.bookmarkContainer .bookmarkCheckmark:after { +.showcaseRadioContainer .showcaseRadioCheckmark:after { top: 3px; left: 3px; width: 8px; @@ -1111,7 +1115,7 @@ a:hover, a:visited, a:link, a:active z-index: 12; } -.dialogHeader { +#shareDialog .dialogHeader { height: 40px; } @@ -1153,7 +1157,7 @@ a:hover, a:visited, a:link, a:active background-color: #213BD1; } -.dialogBody { +#shareDialog .dialogBody { padding: 8px 24px 0px 24px; text-align: center; font-family: Segoe UI; @@ -1288,4 +1292,309 @@ a:hover, a:visited, a:link, a:active .twoColumnsIcon { min-width: 107px; -} \ No newline at end of file +} + +.themeDataColor { + margin-right: 3px; +} + +.themeBackgroundColor { + margin-right: 6px; + outline: 1px solid #000000; + cursor: pointer; + vertical-align: sub; +} + +.themeBackgroundColor.selected { + outline: 2px solid #F2C811; +} + +#startTooltip, #dialogTooltip { + opacity: 0; + transition: opacity 0.5s ease-in-out; + -webkit-transition: opacity 0.5s ease-in-out; + position: absolute; + background-color: #3b3a39; + width: 300px; + box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.25); + z-index: -1; + padding: 16px 24px; + top: 0px; + left: 0px +} + +#dialogTooltip { + top: 320px; + left: -12px; +} + +#startTooltip.showTooltip, #dialogTooltip.showTooltip { + opacity: 1; + z-index: 15; +} + +#startTooltip::after, #dialogTooltip::after { + content: " "; + position: absolute; + right: calc(50% - 10px); + top: 100%; + border-width: 10px; + border-style: solid; + border-color: #3b3a39 transparent transparent transparent; +} + +#startTooltip .tooltipNumber { + float: left; + margin-left: 16px; + line-height: 20px; + font-size: 14px; + padding: 6px 0px; + color: #FFFFFF; +} + +.btnCloseTooltip { + position: absolute; + right: 16px; + top: 8px; +} + +.btnCloseTooltip img { + height: 10px; + width: 10px; + cursor: pointer; +} + +.showcaseTooltipText { + font-weight: 600; + line-height: 28px; + font-size: 20px; + color: #FFFFFF; + margin-bottom: 8px; +} + +.showcaseTooltipSubText { + font-style: normal; + font-weight: normal; + line-height: 20px; + font-size: 14px; + color: #FFFFFF; +} + +.tooltipFooter { + margin-top: 52px; + height: 32px; +} + +.btnShowcaseTooltip { + height: 32px; + width: 84px; + text-align: center; + line-height: 30px; + font-weight: 600; + float: left; + cursor: pointer; + transition: background-color .2s; + user-select: none; + color: #000000; +} + +.yellowBtn { + background-color: #F2C811; + border: none !important; + border-radius: 2px; +} + +.yellowBtn:hover { + background-color: #ddb612; +} + +.whiteBtn { + background-color: #FFFFFF; + border-radius: 2px; +} + +.whiteBtn:hover { + background-color: #F4F4F4; +} + +#dialogMask { + position: absolute; + display: none; + top: 0; + bottom: 0; + left: 0; + right: 0; +} + +.insightToActionDialog { + display: none; + position: absolute; + top: 50%; + left: 50%; + background-color: #FFFFFF; + box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.25); + z-index: 12; + padding: 16px 24px; + transform: translate(-50%, -50%); +} + +#distributionDialog { + width: 952px; + height: 572px; +} + +#sendDialog { + width: 600px; + height: 400px; +} + +#distributionDialog .dialogHeader, #sendDialog .dialogHeader { + height: 48px; +} + +#distributionDialog .dialogFooter, #sendDialog .dialogFooter { + position: absolute; + bottom: 0px; + left: 0px; + right: 0px; + height: 64px; + padding: 16px 24px; +} + +#distributionDialog .dialogFooter { + border-top: solid; + border-width: 1px; + border-color: #EAEAEA; +} + +#dialogTable { + height: 425px; + color: #212121; + overflow-y: scroll; + padding-right: 10px; + margin-bottom: 5px; +} + +#dialogTable::-webkit-scrollbar-track +{ + border-radius: 10px; + background-color: transparent; +} + +#dialogTable::-webkit-scrollbar +{ + width: 6px; + height: 10px; + background-color: transparent; +} + +#dialogTable::-webkit-scrollbar-thumb +{ + border-radius: 10px; + background-color: #E1E1E1; +} + +.dialogHeaderText { + font-weight: 600; + line-height: 28px; + font-size: 20px; +} + +#btnCloseDistributionDialog { + float: right; + position: relative; + cursor: pointer; + margin-top: 2px; +} + +.insightToActionDialogBtn { + float: left; + width: 110px; + height: 32px; + text-align: center; + line-height: 30px; + font-weight: 600; + cursor: pointer; + transition: background-color .2s; + user-select: none; + border: solid; + border-width: 1px; + border-color: #6E6E6E; + margin-right: 8px; + color: #000000; +} + +.sendBtn { + float: right; +} + +.cancelBtn { + float: right; + margin-right: 0px; +} + +#dialogTable table { + border-collapse: collapse; + width: 100%; +} + +#dialogTable th, #dialogTable td { + padding: 8px; + text-align: left; + border-bottom: 1px solid #ddd; +} + +#dialogTable td { + font-size: 12px; + color: #666666; +} + +#dialogTable td.nameCell { + font-size: 14px; + color: #000000; +} + +.checkAllBtn { + user-select: none; +} + +.sendDialogField { + color: #000000; + font-weight: 500; + line-height: 20px; + font-size: 16px; + padding: 8px 0px; +} + +#sendDialog input[type=text], #sendDialog textarea { + width: 100%; + padding: 12px; + border: 1px solid #cccccc; + border-radius: 4px; + resize: none; +} + +#sendDialog textarea { + height: 130px; +} + +#messageSent { + transition: opacity 1.5s ease; + -webkit-transition: opacity 1.5s ease; + opacity: 0; + position: absolute; + z-index: -1; + left: calc(50% - 34px); + bottom: 8px; + width: 68px; + padding: 2px 6px; + border: 1px solid #aaaaaa; + background-color: #000000; + text-align: center; + color: #FFFFFF; +} + +#messageSent.show { + opacity: 1; + z-index: 5; +} diff --git a/dist/powerbi-client.d.ts b/dist/powerbi-client.d.ts index c8d667ac..05f9afdc 100644 --- a/dist/powerbi-client.d.ts +++ b/dist/powerbi-client.d.ts @@ -1,4 +1,4 @@ -/*! powerbi-client v2.6.8 | (c) 2016 Microsoft Corporation MIT */ +/*! powerbi-client v2.6.9 | (c) 2016 Microsoft Corporation MIT */ declare module "util" { /** * Raises a custom event with event data on the specified HTML element. diff --git a/dist/powerbi.js b/dist/powerbi.js index f299b4ea..6cba96bf 100644 --- a/dist/powerbi.js +++ b/dist/powerbi.js @@ -1,4 +1,4 @@ -/*! powerbi-client v2.6.8 | (c) 2016 Microsoft Corporation MIT */ +/*! powerbi-client v2.6.9 | (c) 2016 Microsoft Corporation MIT */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); @@ -5593,7 +5593,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ (function(module, exports) { var config = { - version: '2.6.8', + version: '2.6.9', type: 'js' }; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/dist/powerbi.min.js b/dist/powerbi.min.js index 150cadf8..f420c626 100644 --- a/dist/powerbi.min.js +++ b/dist/powerbi.min.js @@ -1,8 +1,8 @@ -/*! powerbi-client v2.6.8 | (c) 2016 Microsoft Corporation MIT */ +/*! powerbi-client v2.6.9 | (c) 2016 Microsoft Corporation MIT */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["powerbi-client"]=e():t["powerbi-client"]=e()}(this,function(){return function(t){function e(a){if(r[a])return r[a].exports;var i=r[a]={exports:{},id:a,loaded:!1};return t[a].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){var a=r(1);e.service=a;var i=r(15);e.factories=i;var o=r(4);e.models=o;var n=r(5);e.Report=n.Report;var l=r(11);e.Dashboard=l.Dashboard;var s=r(12);e.Tile=s.Tile;var d=r(2);e.Embed=d.Embed;var u=r(6);e.Page=u.Page;var p=r(13);e.Qna=p.Qna;var c=r(14);e.Visual=c.Visual;var f=r(7);e.VisualDescriptor=f.VisualDescriptor;var h=new a.Service(i.hpmFactory,i.wpmpFactory,i.routerFactory);window.powerbi=h},function(t,e,r){var a=r(2),i=r(5),o=r(10),n=r(11),l=r(12),s=r(6),d=r(13),u=r(14),p=r(3),c=function(){function t(e,r,a,i){var o=this;void 0===i&&(i={}),this.wpmp=r(i.wpmpName,i.logMessages),this.hpm=e(this.wpmp,null,i.version,i.type),this.router=a(this.wpmp),this.uniqueSessionId=p.generateUUID(),this.router.post("/reports/:uniqueId/events/:eventName",function(t,e){var r={type:"report",id:t.params.uniqueId,name:t.params.eventName,value:t.body};o.handleEvent(r)}),this.router.post("/reports/:uniqueId/pages/:pageName/events/:eventName",function(t,e){var r={type:"report",id:t.params.uniqueId,name:t.params.eventName,value:t.body};o.handleEvent(r)}),this.router.post("/reports/:uniqueId/pages/:pageName/visuals/:visualName/events/:eventName",function(t,e){var r={type:"report",id:t.params.uniqueId,name:t.params.eventName,value:t.body};o.handleEvent(r)}),this.router.post("/dashboards/:uniqueId/events/:eventName",function(t,e){var r={type:"dashboard",id:t.params.uniqueId,name:t.params.eventName,value:t.body};o.handleEvent(r)}),this.router.post("/tile/:uniqueId/events/:eventName",function(t,e){var r={type:"tile",id:t.params.uniqueId,name:t.params.eventName,value:t.body};o.handleEvent(r)}),this.router.post("/qna/:uniqueId/events/:eventName",function(t,e){var r={type:"qna",id:t.params.uniqueId,name:t.params.eventName,value:t.body};o.handleEvent(r)}),this.router.post("/ready/:uniqueId",function(t,e){var r={type:"report",id:t.params.uniqueId,name:"ready",value:t.body};o.handleEvent(r)}),this.embeds=[],this.config=p.assign({},t.defaultConfig,i),this.config.autoEmbedOnContentLoaded&&this.enableAutoEmbed()}return t.prototype.createReport=function(t,e){e.type="create";var r=t,a=new o.Create(this,r,e);return r.powerBiEmbed=a,this.addOrOverwriteEmbed(a,t),a},t.prototype.init=function(t,e){var r=this;void 0===e&&(e=void 0),t=t&&t instanceof HTMLElement?t:document.body;var i=Array.prototype.slice.call(t.querySelectorAll("["+a.Embed.embedUrlAttribute+"]"));return i.map(function(t){return r.embed(t,e)})},t.prototype.embed=function(t,e){return void 0===e&&(e={}),this.embedInternal(t,e)},t.prototype.load=function(t,e){return void 0===e&&(e={}),this.embedInternal(t,e,!0)},t.prototype.embedInternal=function(t,e,r){void 0===e&&(e={});var a,i=t;return a=i.powerBiEmbed?this.embedExisting(i,e,r):this.embedNew(i,e,r)},t.prototype.getNumberOfComponents=function(){return this.embeds?this.embeds.length:0},t.prototype.getSdkSessionId=function(){return this.uniqueSessionId},t.prototype.embedNew=function(e,r,o){var n=r.type||e.getAttribute(a.Embed.typeAttribute);if(!n)throw new Error("Attempted to embed using config "+JSON.stringify(r)+" on element "+e.outerHTML+", but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '"+a.Embed.typeAttribute+'="'+i.Report.type.toLowerCase()+"\"'.");r.type=n;var l=p.find(function(t){return n===t.type.toLowerCase()},t.components);if(!l)throw new Error("Attempted to embed component of type: "+n+" but did not find any matching component. Please verify the type you specified is intended.");var s=new l(this,e,r,o);return e.powerBiEmbed=s,this.addOrOverwriteEmbed(s,e),s},t.prototype.embedExisting=function(t,e,r){var a=p.find(function(e){return e.element===t},this.embeds);if(!a)throw new Error("Attempted to embed using config "+JSON.stringify(e)+" on element "+t.outerHTML+" which already has embedded comopnent associated, but could not find the existing comopnent in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element.");if(e.type&&"qna"===e.type.toLowerCase())return this.embedNew(t,e);if("string"==typeof e.type&&e.type!==a.config.type){if("report"===e.type&&"create"===a.config.type){var o=new i.Report(this,t,e,(!1),t.powerBiEmbed.iframe);return o.load(e),t.powerBiEmbed=o,this.addOrOverwriteEmbed(a,t),o}throw new Error("Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config "+JSON.stringify(e)+" on element "+t.outerHTML+", but the existing element contains an embed of type: "+this.config.type+" which does not match the new type: "+e.type)}return a.load(e,r),a},t.prototype.enableAutoEmbed=function(){var t=this;window.addEventListener("DOMContentLoaded",function(e){return t.init(document.body)},!1)},t.prototype.get=function(t){var e=t;if(!e.powerBiEmbed)throw new Error("You attempted to get an instance of powerbi component associated with element: "+t.outerHTML+" but there was no associated instance.");return e.powerBiEmbed},t.prototype.find=function(t){return p.find(function(e){return e.config.uniqueId===t},this.embeds)},t.prototype.addOrOverwriteEmbed=function(t,e){this.embeds=this.embeds.filter(function(t){return t.element.id!==e.id}),this.embeds.push(t)},t.prototype.reset=function(t){var e=t;if(e.powerBiEmbed){var r=e.powerBiEmbed;r.frontLoadHandler&&r.element.removeEventListener("ready",r.frontLoadHandler,!1),p.remove(function(t){return t===e.powerBiEmbed},this.embeds),delete e.powerBiEmbed;var a=t.querySelector("iframe");a&&(void 0!==a.remove?a.remove():a.parentElement.removeChild(a))}},t.prototype.handleTileEvents=function(t){"tile"===t.type&&this.handleEvent(t)},t.prototype.handleEvent=function(t){var e=p.find(function(e){return e.config.uniqueId===t.id},this.embeds);if(e){var r=t.value;if("pageChanged"===t.name){var a="newPage",i=r[a];if(!i)throw new Error("Page model not found at 'event.value."+a+"'.");r[a]=new s.Page(e,i.name,i.displayName,(!0))}p.raiseCustomEvent(e.element,t.name,r)}},t.prototype.preload=function(t,e){var r=document.createElement("iframe");r.setAttribute("style","display:none;"),r.setAttribute("src",t.embedUrl),r.setAttribute("scrolling","no"),r.setAttribute("allowfullscreen","false");var a=e;return a||(a=document.getElementsByTagName("body")[0]),a.appendChild(r),r.onload=function(){p.raiseCustomEvent(r,"preloaded",{})},r},t.components=[l.Tile,i.Report,n.Dashboard,d.Qna,u.Visual],t.defaultConfig={autoEmbedOnContentLoaded:!1,onError:function(){for(var t=[],e=0;e>=4,r.toString(16)})}function d(t,e,r){var a=t.indexOf("?")>0?"&":"?";return t+=a+e+"="+r}e.raiseCustomEvent=r,e.findIndex=a,e.find=i,e.remove=o,e.assign=n,e.createRandomString=l,e.generateUUID=s,e.addParamToUrl=d},function(t,e,r){/*! powerbi-models v1.1.0 | (c) 2016 Microsoft Corporation MIT */ !function(e,r){t.exports=r()}(this,function(){return function(t){function e(a){if(r[a])return r[a].exports;var i=r[a]={exports:{},id:a,loaded:!1};return t[a].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){function a(t){return l(t)&&!!t.keys}function i(t){return o(t)===Y.Basic&&!!t.keyValues}function o(t){if(t.filterType)return t.filterType;var e=t,r=t;return"string"==typeof e.operator&&Array.isArray(e.values)?Y.Basic:"string"==typeof r.logicalOperator&&Array.isArray(r.conditions)?Y.Advanced:Y.Unknown}function n(t){return void 0!==t.table&&void 0!==t.measure}function l(t){return void 0!==t.table&&void 0!==t.column}function s(t){return void 0!==t.table&&void 0!==t.hierarchy&&void 0!==t.hierarchyLevel}function d(t){var e=t.message;return e||(e=t.path+" is invalid. Not meeting "+t.keyword+" constraint"),{message:e}}function u(t){var r=e.Validators.visualSelectorValidator.validate(t);return r?r.map(d):void 0}function p(t){var r=e.Validators.slicerValidator.validate(t);return r?r.map(d):void 0}function c(t){var r=e.Validators.slicerStateValidator.validate(t);return r?r.map(d):void 0}function f(t){var r=e.Validators.playBookmarkRequestValidator.validate(t);return r?r.map(d):void 0}function h(t){var r=e.Validators.addBookmarkRequestValidator.validate(t);return r?r.map(d):void 0}function v(t){var r=e.Validators.applyBookmarkByNameRequestValidator.validate(t);return r?r.map(d):void 0}function y(t){var r=e.Validators.applyBookmarkStateRequestValidator.validate(t);return r?r.map(d):void 0}function m(t){var r=e.Validators.settingsValidator.validate(t);return r?r.map(d):void 0}function V(t){var r=e.Validators.customPageSizeValidator.validate(t);return r?r.map(d):void 0}function g(t){var r=e.Validators.extensionValidator.validate(t);return r?r.map(d):void 0}function w(t){var r=e.Validators.reportLoadValidator.validate(t);return r?r.map(d):void 0}function b(t){var r=e.Validators.reportCreateValidator.validate(t);return r?r.map(d):void 0}function O(t){var r=e.Validators.dashboardLoadValidator.validate(t);return r?r.map(d):void 0}function S(t){var r=e.Validators.tileLoadValidator.validate(t);return r?r.map(d):void 0}function T(t){var r=e.Validators.pageValidator.validate(t);return r?r.map(d):void 0}function E(t){var r=e.Validators.filtersValidator.validate(t);return r?r.map(d):void 0}function _(t){var r=e.Validators.saveAsParametersValidator.validate(t);return r?r.map(d):void 0}function P(t){var r=e.Validators.loadQnaValidator.validate(t);return r?r.map(d):void 0}function x(t){var r=e.Validators.qnaInterpretInputDataValidator.validate(t);return r?r.map(d):void 0}function k(t){var r=e.Validators.exportDataRequestValidator.validate(t);return r?r.map(d):void 0}function A(t){var r=e.Validators.visualHeaderValidator.validate(t);return r?r.map(d):void 0}function F(t){var r=e.Validators.visualSettingsValidator.validate(t);return r?r.map(d):void 0}function C(t){var r=e.Validators.commandsSettingsValidator.validate(t);return r?r.map(d):void 0}function R(t){var r=e.Validators.customThemeValidator.validate(t);return r?r.map(d):void 0}var q=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.Validators=r(1).Validators;var M;!function(t){t[t.Information=0]="Information",t[t.Verbose=1]="Verbose",t[t.Warning=2]="Warning",t[t.Error=3]="Error",t[t.ExpectedError=4]="ExpectedError",t[t.UnexpectedError=5]="UnexpectedError",t[t.Fatal=6]="Fatal"}(M=e.TraceType||(e.TraceType={}));var I;!function(t){t[t.Widescreen=0]="Widescreen",t[t.Standard=1]="Standard",t[t.Cortana=2]="Cortana",t[t.Letter=3]="Letter",t[t.Custom=4]="Custom"}(I=e.PageSizeType||(e.PageSizeType={}));var j;!function(t){t[t.FitToPage=0]="FitToPage",t[t.FitToWidth=1]="FitToWidth",t[t.ActualSize=2]="ActualSize"}(j=e.DisplayOption||(e.DisplayOption={}));var N;!function(t){t[t.Default=0]="Default",t[t.Transparent=1]="Transparent"}(N=e.BackgroundType||(e.BackgroundType={}));var L;!function(t){t[t.Visible=0]="Visible",t[t.Hidden=1]="Hidden"}(L=e.VisualContainerDisplayMode||(e.VisualContainerDisplayMode={}));var U;!function(t){t[t.Master=0]="Master",t[t.Custom=1]="Custom",t[t.MobilePortrait=2]="MobilePortrait",t[t.MobileLandscape=3]="MobileLandscape"}(U=e.LayoutType||(e.LayoutType={}));var D;!function(t){t[t.AlwaysVisible=0]="AlwaysVisible",t[t.HiddenInViewMode=1]="HiddenInViewMode"}(D=e.SectionVisibility||(e.SectionVisibility={}));var W;!function(t){t[t.Read=0]="Read",t[t.ReadWrite=1]="ReadWrite",t[t.Copy=2]="Copy",t[t.Create=4]="Create",t[t.All=7]="All"}(W=e.Permissions||(e.Permissions={}));var B;!function(t){t[t.View=0]="View",t[t.Edit=1]="Edit"}(B=e.ViewMode||(e.ViewMode={}));var H;!function(t){t[t.Aad=0]="Aad",t[t.Embed=1]="Embed"}(H=e.TokenType||(e.TokenType={}));var z;!function(t){t[t.Bottom=0]="Bottom",t[t.Top=1]="Top"}(z=e.MenuLocation||(e.MenuLocation={}));var J;!function(t){t[t.Report=0]="Report",t[t.Page=1]="Page",t[t.Visual=2]="Visual"}(J=e.FiltersLevel||(e.FiltersLevel={}));var Y;!function(t){t[t.Advanced=0]="Advanced",t[t.Basic=1]="Basic",t[t.Unknown=2]="Unknown",t[t.IncludeExclude=3]="IncludeExclude",t[t.RelativeDate=4]="RelativeDate",t[t.TopN=5]="TopN",t[t.Tuple=6]="Tuple"}(Y=e.FilterType||(e.FilterType={}));var Q;!function(t){t[t.Days=0]="Days",t[t.Weeks=1]="Weeks",t[t.CalendarWeeks=2]="CalendarWeeks",t[t.Months=3]="Months",t[t.CalendarMonths=4]="CalendarMonths",t[t.Years=5]="Years",t[t.CalendarYears=6]="CalendarYears"}(Q=e.RelativeDateFilterTimeUnit||(e.RelativeDateFilterTimeUnit={}));var G;!function(t){t[t.InLast=0]="InLast",t[t.InThis=1]="InThis",t[t.InNext=2]="InNext"}(G=e.RelativeDateOperators||(e.RelativeDateOperators={}));var $=function(){function t(t,e){this.target=t,this.filterType=e}return t.prototype.toJSON=function(){return{$schema:this.schemaUrl,target:this.target,filterType:this.filterType}},t}();e.Filter=$;var K=function(t){function e(r,a,i){var o=t.call(this,r,Y.Unknown)||this;return o.message=a,o.notSupportedTypeName=i,o.schemaUrl=e.schemaUrl,o}return q(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.message=this.message,e.notSupportedTypeName=this.notSupportedTypeName,e},e.schemaUrl="http://powerbi.com/product/schema#notSupported",e}($);e.NotSupportedFilter=K;var X=function(t){function e(r,a,i){var o=t.call(this,r,Y.IncludeExclude)||this;return o.values=i,o.isExclude=a,o.schemaUrl=e.schemaUrl,o}return q(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.isExclude=this.isExclude,e.values=this.values,e},e.schemaUrl="http://powerbi.com/product/schema#includeExclude",e}($);e.IncludeExcludeFilter=X;var Z=function(t){function e(r,a,i){var o=t.call(this,r,Y.TopN)||this;return o.operator=a,o.itemCount=i,o.schemaUrl=e.schemaUrl,o}return q(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.operator=this.operator,e.itemCount=this.itemCount,e},e.schemaUrl="http://powerbi.com/product/schema#topN",e}($);e.TopNFilter=Z;var tt=function(t){function e(r,a,i,o,n){var l=t.call(this,r,Y.RelativeDate)||this;return l.operator=a,l.timeUnitsCount=i,l.timeUnitType=o,l.includeToday=n,l.schemaUrl=e.schemaUrl,l}return q(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.operator=this.operator,e.timeUnitsCount=this.timeUnitsCount,e.timeUnitType=this.timeUnitType,e.includeToday=this.includeToday,e},e.schemaUrl="http://powerbi.com/product/schema#relativeDate",e}($);e.RelativeDateFilter=tt;var et=function(t){function e(r,a){for(var i=[],o=2;o0&&!i)throw new Error("You should pass the values to be filtered for each key. You passed: no values and "+n+" keys");if(0===n&&i&&i.length>0)throw new Error("You passed key values but your target object doesn't contain the keys to be filtered");for(var l=0;l2)throw new Error("AdvancedFilters may not have more than two conditions. You passed: "+i.length);if(1===l.length&&"And"!==a)throw new Error('Logical Operator must be "And" when there is only one condition provided');return n.conditions=l,n}return q(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.logicalOperator=this.logicalOperator,e.conditions=this.conditions,e},e.schemaUrl="http://powerbi.com/product/schema#advanced",e}($);e.AdvancedFilter=it,e.isFilterKeyColumnsTarget=a,e.isBasicFilterWithKeys=i,e.getFilterType=o,e.isMeasure=n,e.isColumn=l,e.isHierarchy=s;var ot;!function(t){t[t.Interactive=0]="Interactive",t[t.ResultOnly=1]="ResultOnly"}(ot=e.QnaMode||(e.QnaMode={}));var nt;!function(t){t[t.Summarized=0]="Summarized",t[t.Underlying=1]="Underlying"}(nt=e.ExportDataType||(e.ExportDataType={}));var lt;!function(t){t[t.Off=0]="Off",t[t.Presentation=1]="Presentation"}(lt=e.BookmarksPlayMode||(e.BookmarksPlayMode={})),e.CommonErrorCodes={TokenExpired:"TokenExpired",NotFound:"PowerBIEntityNotFound",InvalidParameters:"Invalid parameters",LoadReportFailed:"LoadReportFailed",NotAuthorized:"PowerBINotAuthorizedException",FailedToLoadModel:"ExplorationContainer_FailedToLoadModel_DefaultDetails"};var st=function(){function t(t){this.$schema=t}return t.prototype.toJSON=function(){return{$schema:this.$schema}},t}();e.Selector=st;var dt=function(t){function e(r){var a=t.call(this,e.schemaUrl)||this;return a.pageName=r,a}return q(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.pageName=this.pageName,e},e.schemaUrl="http://powerbi.com/product/schema#pageSelector",e}(st);e.PageSelector=dt;var ut=function(t){function e(r){var a=t.call(this,e.schemaUrl)||this;return a.visualName=r,a}return q(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.visualName=this.visualName,e},e.schemaUrl="http://powerbi.com/product/schema#visualSelector",e}(st);e.VisualSelector=ut;var pt=function(t){function e(e){var r=t.call(this,ut.schemaUrl)||this;return r.visualType=e,r}return q(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.visualType=this.visualType,e},e.schemaUrl="http://powerbi.com/product/schema#visualTypeSelector",e}(st);e.VisualTypeSelector=pt;var ct=function(t){function e(e){var r=t.call(this,ut.schemaUrl)||this;return r.target=e,r}return q(e,t),e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.target=this.target,e},e.schemaUrl="http://powerbi.com/product/schema#slicerTargetSelector",e}(st);e.SlicerTargetSelector=ct;var ft;!function(t){t[t.Enabled=0]="Enabled",t[t.Disabled=1]="Disabled",t[t.Hidden=2]="Hidden"}(ft=e.CommandDisplayOption||(e.CommandDisplayOption={})),e.validateVisualSelector=u,e.validateSlicer=p,e.validateSlicerState=c,e.validatePlayBookmarkRequest=f,e.validateAddBookmarkRequest=h,e.validateApplyBookmarkByNameRequest=v,e.validateApplyBookmarkStateRequest=y,e.validateSettings=m,e.validateCustomPageSize=V,e.validateExtension=g,e.validateReportLoad=w,e.validateCreateReport=b,e.validateDashboardLoad=O,e.validateTileLoad=S,e.validatePage=T,e.validateFilter=E,e.validateSaveAsParameters=_,e.validateLoadQnaConfiguration=P,e.validateQnaInterpretInputData=x,e.validateExportDataRequest=k,e.validateVisualHeader=A,e.validateVisualSettings=F,e.validateCommandsSettings=C,e.validateCustomTheme=R},function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0});var a=r(2),i=r(3),o=r(5),n=r(6),l=r(7),s=r(8),d=r(9),u=r(10),p=r(11),c=r(12),f=r(13),h=r(14),v=r(15),y=r(16),m=r(17),V=r(18),g=r(19),w=r(20),b=r(21),O=r(22),S=r(23),T=r(24);e.Validators={addBookmarkRequestValidator:new n.AddBookmarkRequestValidator,advancedFilterTypeValidator:new a.EnumValidator([0]),advancedFilterValidator:new l.AdvancedFilterValidator,anyArrayValidator:new a.ArrayValidator([new d.AnyOfValidator([new a.StringValidator,new a.NumberValidator,new a.BooleanValidator])]),anyFilterValidator:new d.AnyOfValidator([new l.BasicFilterValidator,new l.AdvancedFilterValidator,new l.IncludeExcludeFilterValidator,new l.NotSupportedFilterValidator,new l.RelativeDateFilterValidator,new l.TopNFilterValidator]),anyValueValidator:new d.AnyOfValidator([new a.StringValidator,new a.NumberValidator,new a.BooleanValidator]),applyBookmarkByNameRequestValidator:new n.ApplyBookmarkByNameRequestValidator,applyBookmarkStateRequestValidator:new n.ApplyBookmarkStateRequestValidator,applyBookmarkValidator:new d.AnyOfValidator([new n.ApplyBookmarkByNameRequestValidator,new n.ApplyBookmarkStateRequestValidator]),backgroundValidator:new a.EnumValidator([0,1]),basicFilterTypeValidator:new a.EnumValidator([1]),basicFilterValidator:new l.BasicFilterValidator,booleanArrayValidator:new a.BooleanArrayValidator,booleanValidator:new a.BooleanValidator,commandDisplayOptionValidator:new a.EnumValidator([0,1,2]),commandExtensionSelectorValidator:new d.AnyOfValidator([new w.VisualSelectorValidator,new w.VisualTypeSelectorValidator]),commandExtensionValidator:new i.CommandExtensionValidator,commandsSettingsArrayValidator:new a.ArrayValidator([new S.CommandsSettingsValidator]),commandsSettingsValidator:new S.CommandsSettingsValidator,conditionItemValidator:new l.ConditionItemValidator,customLayoutDisplayOptionValidator:new a.EnumValidator([0,1,2]),customLayoutValidator:new V.CustomLayoutValidator,customPageSizeValidator:new h.CustomPageSizeValidator,customThemeValidator:new T.CustomThemeValidator,dashboardLoadValidator:new c.DashboardLoadValidator,displayStateModeValidator:new a.EnumValidator([0,1]),displayStateValidator:new V.DisplayStateValidator,exportDataRequestValidator:new g.ExportDataRequestValidator,extensionArrayValidator:new a.ArrayValidator([new i.ExtensionValidator]),extensionPointsValidator:new i.ExtensionPointsValidator,extensionValidator:new i.ExtensionValidator,fieldRequiredValidator:new s.FieldRequiredValidator,filterColumnTargetValidator:new l.FilterColumnTargetValidator,filterConditionsValidator:new a.ArrayValidator([new l.ConditionItemValidator]),filterHierarchyTargetValidator:new l.FilterHierarchyTargetValidator,filterMeasureTargetValidator:new l.FilterMeasureTargetValidator,filterTargetValidator:new d.AnyOfValidator([new l.FilterColumnTargetValidator,new l.FilterHierarchyTargetValidator,new l.FilterMeasureTargetValidator]),filtersArrayValidator:new a.ArrayValidator([new d.AnyOfValidator([new l.BasicFilterValidator,new l.AdvancedFilterValidator,new l.RelativeDateFilterValidator])]),filtersValidator:new l.FilterValidator,includeExcludeFilterValidator:new l.IncludeExcludeFilterValidator,includeExludeFilterTypeValidator:new a.EnumValidator([3]),layoutTypeValidator:new a.EnumValidator([0,1,2,3]),loadQnaValidator:new v.LoadQnaValidator,menuExtensionValidator:new i.MenuExtensionValidator,menuLocationValidator:new a.EnumValidator([0,1]),notSupportedFilterTypeValidator:new a.EnumValidator([2]),notSupportedFilterValidator:new l.NotSupportedFilterValidator,numberArrayValidator:new a.NumberArrayValidator,numberValidator:new a.NumberValidator,pageLayoutValidator:new m.MapValidator([new a.StringValidator],[new V.VisualLayoutValidator]),pageSizeTypeValidator:new a.EnumValidator([0,1,2,3,4,5]),pageSizeValidator:new h.PageSizeValidator,pageValidator:new h.PageValidator,pageViewFieldValidator:new h.PageViewFieldValidator,pagesLayoutValidator:new m.MapValidator([new a.StringValidator],[new V.PageLayoutValidator]),permissionsValidator:new a.EnumValidator([0,1,2,4,7]),playBookmarkRequestValidator:new n.PlayBookmarkRequestValidator,qnaInterpretInputDataValidator:new v.QnaInterpretInputDataValidator,qnaSettingValidator:new v.QnaSettingsValidator,relativeDateFilterOperatorValidator:new a.EnumValidator([0,1,2]),relativeDateFilterTimeUnitTypeValidator:new a.EnumValidator([0,1,2,3,4,5,6]),relativeDateFilterTypeValidator:new a.EnumValidator([4]),relativeDateFilterValidator:new l.RelativeDateFilterValidator,reportCreateValidator:new p.ReportCreateValidator,reportLoadValidator:new u.ReportLoadValidator,saveAsParametersValidator:new y.SaveAsParametersValidator,settingsValidator:new o.SettingsValidator,singleCommandSettingsValidator:new S.SingleCommandSettingsValidator,slicerSelectorValidator:new d.AnyOfValidator([new w.VisualSelectorValidator,new w.SlicerTargetSelectorValidator]),slicerStateValidator:new b.SlicerStateValidator,slicerTargetValidator:new d.AnyOfValidator([new l.FilterColumnTargetValidator,new l.FilterHierarchyTargetValidator,new l.FilterMeasureTargetValidator,new l.FilterKeyColumnsTargetValidator,new l.FilterKeyHierarchyTargetValidator]),slicerValidator:new b.SlicerValidator,stringArrayValidator:new a.StringArrayValidator,stringValidator:new a.StringValidator,tileLoadValidator:new f.TileLoadValidator,tokenTypeValidator:new a.EnumValidator([0,1]),topNFilterTypeValidator:new a.EnumValidator([5]),topNFilterValidator:new l.TopNFilterValidator,viewModeValidator:new a.EnumValidator([0,1]),visualCommandSelectorValidator:new d.AnyOfValidator([new w.VisualSelectorValidator,new w.VisualTypeSelectorValidator]),visualHeaderSelectorValidator:new d.AnyOfValidator([new w.VisualSelectorValidator,new w.VisualTypeSelectorValidator]),visualHeaderSettingsValidator:new O.VisualHeaderSettingsValidator,visualHeaderValidator:new O.VisualHeaderValidator,visualHeadersValidator:new a.ArrayValidator([new O.VisualHeaderValidator]),visualLayoutValidator:new V.VisualLayoutValidator,visualSelectorValidator:new w.VisualSelectorValidator,visualSettingsValidator:new O.VisualSettingsValidator,visualTypeSelectorValidator:new w.VisualTypeSelectorValidator}},function(t,e){var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function a(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(){}return t.prototype.validate=function(t,e,r){return null==t?null:"object"!=typeof t||Array.isArray(t)?[{message:void 0!==r?r+" must be an object":"input must be an object",path:e,keyword:"type"}]:null},t}();e.ObjectValidator=a;var i=function(){function t(t){this.itemValidators=t}return t.prototype.validate=function(t,e,r){if(null==t)return null;if(!Array.isArray(t))return[{message:r+" property is invalid",path:(e?e+".":"")+r,keyword:"type"}];for(var a=0;a2&&"[]"===n.slice(l-2)&&(s=!0,n=n.slice(0,l-2),r[n]||(r[n]=[])),i=o[1]?w(o[1]):""),s?r[n].push(i):r[n]=i}return r},recognize:function(t){var e,r,a,i=[this.rootState],o={},n=!1;if(a=t.indexOf("?"),a!==-1){var l=t.substr(a+1,t.length);t=t.substr(0,a),o=this.parseQueryString(l)}for(t=decodeURI(t),"/"!==t.charAt(0)&&(t="/"+t),e=t.length,e>1&&"/"===t.charAt(e-1)&&(t=t.substr(0,e-1),n=!0),r=0;r