Skip to content

Commit d1ba628

Browse files
author
Matt Mazzola
committed
2.1.0
1 parent 5a8acda commit d1ba628

17 files changed

Lines changed: 370 additions & 46 deletions

dist/config.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! powerbi-client v2.0.0 | (c) 2016 Microsoft Corporation MIT */
1+
/*! powerbi-client v2.1.0 | (c) 2016 Microsoft Corporation MIT */
22
declare const config: {
33
version: string;
44
type: string;

dist/dashboard.d.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*! powerbi-client v2.1.0 | (c) 2016 Microsoft Corporation MIT */
2+
import * as service from './service';
3+
import * as embed from './embed';
4+
/**
5+
* A Dashboard node within a dashboard hierarchy
6+
*
7+
* @export
8+
* @interface IDashboardNode
9+
*/
10+
export interface IDashboardNode {
11+
iframe: HTMLIFrameElement;
12+
service: service.IService;
13+
config: embed.IInternalEmbedConfiguration;
14+
}
15+
/**
16+
* A Power BI Dashboard embed component
17+
*
18+
* @export
19+
* @class Dashboard
20+
* @extends {embed.Embed}
21+
* @implements {IDashboardNode}
22+
* @implements {IFilterable}
23+
*/
24+
export declare class Dashboard extends embed.Embed implements IDashboardNode {
25+
static allowedEvents: string[];
26+
static dashboardIdAttribute: string;
27+
static typeAttribute: string;
28+
static type: string;
29+
/**
30+
* Creates an instance of a Power BI Dashboard.
31+
*
32+
* @param {service.Service} service
33+
* @param {HTMLElement} element
34+
*/
35+
constructor(service: service.Service, element: HTMLElement, config: embed.IEmbedConfiguration);
36+
/**
37+
* This adds backwards compatibility for older config which used the dashboardId query param to specify dashboard id.
38+
* E.g. https://powerbi-df.analysis-df.windows.net/dashboardEmbedHost?dashboardId=e9363c62-edb6-4eac-92d3-2199c5ca2a9e
39+
*
40+
* By extracting the id we can ensure id is always explicitly provided as part of the load configuration.
41+
*
42+
* @static
43+
* @param {string} url
44+
* @returns {string}
45+
*/
46+
static findIdFromEmbedUrl(url: string): string;
47+
/**
48+
* Get dashboard id from first available location: options, attribute, embed url.
49+
*
50+
* @returns {string}
51+
*/
52+
getId(): string;
53+
}

dist/embed.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! powerbi-client v2.0.0 | (c) 2016 Microsoft Corporation MIT */
1+
/*! powerbi-client v2.1.0 | (c) 2016 Microsoft Corporation MIT */
22
import * as service from './service';
33
import * as models from 'powerbi-models';
44
declare global {

dist/factories.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! powerbi-client v2.0.0 | (c) 2016 Microsoft Corporation MIT */
1+
/*! powerbi-client v2.1.0 | (c) 2016 Microsoft Corporation MIT */
22
/**
33
* TODO: Need to find better place for these factory functions or refactor how we handle dependency injection
44
*/

dist/ifilterable.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! powerbi-client v2.0.0 | (c) 2016 Microsoft Corporation MIT */
1+
/*! powerbi-client v2.1.0 | (c) 2016 Microsoft Corporation MIT */
22
import * as models from 'powerbi-models';
33
/**
44
* Decorates embed components that support filters

dist/page.d.ts

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
/*! powerbi-client v2.0.0 | (c) 2016 Microsoft Corporation MIT */
1+
/*! powerbi-client v2.1.0 | (c) 2016 Microsoft Corporation MIT */
22
import { IFilterable } from './ifilterable';
33
import { IReportNode } from './report';
4+
import { Visual } from './visual';
45
import * as models from 'powerbi-models';
56
/**
67
* A Page node within a report hierarchy
@@ -58,6 +59,17 @@ export declare class Page implements IPageNode, IFilterable {
5859
* @returns {(Promise<models.IFilter[]>)}
5960
*/
6061
getFilters(): Promise<models.IFilter[]>;
62+
/**
63+
* Gets all the visuals on the page.
64+
*
65+
* ```javascript
66+
* page.getVisuals()
67+
* .then(visuals => { ... });
68+
* ```
69+
*
70+
* @returns {Promise<Visual[]>}
71+
*/
72+
getVisuals(): Promise<Visual[]>;
6173
/**
6274
* Removes all filters from this page of the report.
6375
*
@@ -90,4 +102,22 @@ export declare class Page implements IPageNode, IFilterable {
90102
* @returns {Promise<void>}
91103
*/
92104
setFilters(filters: models.IFilter[]): Promise<void>;
105+
/**
106+
* Creates a Visual object given a name for the visual.
107+
*
108+
* Normally you would get Visual objects by calling `page.getVisuals()` but in the case
109+
* that the visual name is known and you want to perform an action on a visual such as setting a filter
110+
* without having to retrieve it first you can create it directly.
111+
*
112+
* Note: Because you are creating the visual manually there is no guarantee that the visual actually exists in the report and the subsequence requests could fail.
113+
*
114+
* ```javascript
115+
* const visual = report.page('ReportSection1').visual('BarChart1');
116+
* visual.setFilters(filters);
117+
* ```
118+
*
119+
* @param {string} name
120+
* @returns {Visual}
121+
*/
122+
visual(name: string): Visual;
93123
}

dist/powerbi.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! powerbi-client v2.0.0 | (c) 2016 Microsoft Corporation MIT */
1+
/*! powerbi-client v2.1.0 | (c) 2016 Microsoft Corporation MIT */
22
import * as service from './service';
33
import * as factories from './factories';
44
import * as models from 'powerbi-models';
@@ -8,6 +8,7 @@ export { Report } from './report';
88
export { Tile } from './tile';
99
export { IEmbedConfiguration, Embed } from './embed';
1010
export { Page } from './page';
11+
export { Visual } from './visual';
1112
declare global {
1213
interface Window {
1314
powerbi: service.Service;

0 commit comments

Comments
 (0)