powerbi-visuals-tools 3.3.2 → 3.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/.vscode/launch.json +52 -0
  2. package/Changelog.md +105 -16
  3. package/bin/pbiviz-new.js +3 -12
  4. package/bin/pbiviz-package.js +12 -8
  5. package/bin/pbiviz-start.js +25 -51
  6. package/bin/pbiviz.js +0 -1
  7. package/config.json +1 -1
  8. package/lib/CertificateTools.js +6 -8
  9. package/lib/TemplateFetcher.js +7 -29
  10. package/lib/VisualGenerator.js +5 -94
  11. package/lib/WebPackWrap.js +69 -75
  12. package/lib/utils.js +26 -0
  13. package/lib/webpack.config.js +9 -6
  14. package/package.json +14 -16
  15. package/templates/visuals/default/package.json +2 -2
  16. package/templates/visuals/rhtml/package.json +1 -1
  17. package/templates/visuals/rvisual/package.json +1 -1
  18. package/templates/visuals/slicer/package.json +2 -2
  19. package/templates/visuals/table/package.json +2 -2
  20. package/bin/pbiviz-update.js +0 -128
  21. package/lib/LessCompiler.js +0 -86
  22. package/lib/TypescriptCompiler.js +0 -243
  23. package/templates/visuals/.api/v1.0.0/PowerBI-visuals.d.ts +0 -1139
  24. package/templates/visuals/.api/v1.0.0/schema.capabilities.json +0 -758
  25. package/templates/visuals/.api/v1.0.0/schema.pbiviz.json +0 -95
  26. package/templates/visuals/.api/v1.1.0/PowerBI-visuals.d.ts +0 -1179
  27. package/templates/visuals/.api/v1.1.0/schema.capabilities.json +0 -828
  28. package/templates/visuals/.api/v1.1.0/schema.pbiviz.json +0 -95
  29. package/templates/visuals/.api/v1.10.0/PowerBI-visuals.d.ts +0 -1406
  30. package/templates/visuals/.api/v1.10.0/schema.capabilities.json +0 -1143
  31. package/templates/visuals/.api/v1.10.0/schema.dependencies.json +0 -38
  32. package/templates/visuals/.api/v1.10.0/schema.pbiviz.json +0 -103
  33. package/templates/visuals/.api/v1.10.0/schema.stringResources.json +0 -67
  34. package/templates/visuals/.api/v1.11.0/PowerBI-visuals.d.ts +0 -1406
  35. package/templates/visuals/.api/v1.11.0/schema.capabilities.json +0 -1143
  36. package/templates/visuals/.api/v1.11.0/schema.dependencies.json +0 -38
  37. package/templates/visuals/.api/v1.11.0/schema.pbiviz.json +0 -103
  38. package/templates/visuals/.api/v1.11.0/schema.stringResources.json +0 -67
  39. package/templates/visuals/.api/v1.12.0/PowerBI-visuals.d.ts +0 -1408
  40. package/templates/visuals/.api/v1.12.0/schema.capabilities.json +0 -1173
  41. package/templates/visuals/.api/v1.12.0/schema.dependencies.json +0 -38
  42. package/templates/visuals/.api/v1.12.0/schema.pbiviz.json +0 -103
  43. package/templates/visuals/.api/v1.12.0/schema.stringResources.json +0 -67
  44. package/templates/visuals/.api/v1.13.0/PowerBI-visuals.d.ts +0 -1450
  45. package/templates/visuals/.api/v1.13.0/schema.capabilities.json +0 -1181
  46. package/templates/visuals/.api/v1.13.0/schema.dependencies.json +0 -38
  47. package/templates/visuals/.api/v1.13.0/schema.pbiviz.json +0 -103
  48. package/templates/visuals/.api/v1.13.0/schema.stringResources.json +0 -67
  49. package/templates/visuals/.api/v1.2.0/PowerBI-visuals.d.ts +0 -1188
  50. package/templates/visuals/.api/v1.2.0/schema.capabilities.json +0 -951
  51. package/templates/visuals/.api/v1.2.0/schema.dependencies.json +0 -38
  52. package/templates/visuals/.api/v1.2.0/schema.pbiviz.json +0 -99
  53. package/templates/visuals/.api/v1.3.0/PowerBI-visuals.d.ts +0 -1293
  54. package/templates/visuals/.api/v1.3.0/schema.capabilities.json +0 -951
  55. package/templates/visuals/.api/v1.3.0/schema.dependencies.json +0 -38
  56. package/templates/visuals/.api/v1.3.0/schema.pbiviz.json +0 -95
  57. package/templates/visuals/.api/v1.4.0/PowerBI-visuals.d.ts +0 -1282
  58. package/templates/visuals/.api/v1.4.0/schema.capabilities.json +0 -951
  59. package/templates/visuals/.api/v1.4.0/schema.dependencies.json +0 -38
  60. package/templates/visuals/.api/v1.4.0/schema.pbiviz.json +0 -95
  61. package/templates/visuals/.api/v1.5.0/PowerBI-visuals.d.ts +0 -1205
  62. package/templates/visuals/.api/v1.5.0/schema.capabilities.json +0 -987
  63. package/templates/visuals/.api/v1.5.0/schema.dependencies.json +0 -38
  64. package/templates/visuals/.api/v1.5.0/schema.pbiviz.json +0 -95
  65. package/templates/visuals/.api/v1.6.0/PowerBI-visuals.d.ts +0 -1297
  66. package/templates/visuals/.api/v1.6.0/schema.capabilities.json +0 -1007
  67. package/templates/visuals/.api/v1.6.0/schema.dependencies.json +0 -38
  68. package/templates/visuals/.api/v1.6.0/schema.pbiviz.json +0 -103
  69. package/templates/visuals/.api/v1.6.0/schema.stringResources.json +0 -67
  70. package/templates/visuals/.api/v1.7.0/PowerBI-visuals.d.ts +0 -1381
  71. package/templates/visuals/.api/v1.7.0/schema.capabilities.json +0 -1007
  72. package/templates/visuals/.api/v1.7.0/schema.dependencies.json +0 -38
  73. package/templates/visuals/.api/v1.7.0/schema.pbiviz.json +0 -103
  74. package/templates/visuals/.api/v1.7.0/schema.stringResources.json +0 -67
  75. package/templates/visuals/.api/v1.8.0/PowerBI-visuals.d.ts +0 -1389
  76. package/templates/visuals/.api/v1.8.0/schema.capabilities.json +0 -1131
  77. package/templates/visuals/.api/v1.8.0/schema.dependencies.json +0 -38
  78. package/templates/visuals/.api/v1.8.0/schema.pbiviz.json +0 -103
  79. package/templates/visuals/.api/v1.8.0/schema.stringResources.json +0 -67
  80. package/templates/visuals/.api/v1.9.0/PowerBI-visuals.d.ts +0 -1391
  81. package/templates/visuals/.api/v1.9.0/schema.capabilities.json +0 -1131
  82. package/templates/visuals/.api/v1.9.0/schema.dependencies.json +0 -38
  83. package/templates/visuals/.api/v1.9.0/schema.pbiviz.json +0 -103
  84. package/templates/visuals/.api/v1.9.0/schema.stringResources.json +0 -67
  85. package/templates/visuals/.api/v2.0.0/PowerBI-visuals.d.ts +0 -1417
  86. package/templates/visuals/.api/v2.0.0/schema.capabilities.json +0 -1177
  87. package/templates/visuals/.api/v2.0.0/schema.dependencies.json +0 -38
  88. package/templates/visuals/.api/v2.0.0/schema.pbiviz.json +0 -103
  89. package/templates/visuals/.api/v2.0.0/schema.stringResources.json +0 -67
  90. package/templates/visuals/.api/v2.1.0/PowerBI-visuals.d.ts +0 -1417
  91. package/templates/visuals/.api/v2.1.0/schema.capabilities.json +0 -1177
  92. package/templates/visuals/.api/v2.1.0/schema.dependencies.json +0 -38
  93. package/templates/visuals/.api/v2.1.0/schema.pbiviz.json +0 -103
  94. package/templates/visuals/.api/v2.1.0/schema.stringResources.json +0 -67
  95. package/templates/visuals/.api/v2.2.0/PowerBI-visuals.d.ts +0 -1423
  96. package/templates/visuals/.api/v2.2.0/schema.capabilities.json +0 -1189
  97. package/templates/visuals/.api/v2.2.0/schema.dependencies.json +0 -38
  98. package/templates/visuals/.api/v2.2.0/schema.pbiviz.json +0 -103
  99. package/templates/visuals/.api/v2.2.0/schema.stringResources.json +0 -67
  100. package/templates/visuals/.api/v2.3.0/PowerBI-visuals.d.ts +0 -1480
  101. package/templates/visuals/.api/v2.3.0/schema.capabilities.json +0 -1193
  102. package/templates/visuals/.api/v2.3.0/schema.dependencies.json +0 -38
  103. package/templates/visuals/.api/v2.3.0/schema.pbiviz.json +0 -103
  104. package/templates/visuals/.api/v2.3.0/schema.stringResources.json +0 -67
  105. package/templates/visuals/.api/v2.5.0/PowerBI-visuals.d.ts +0 -1483
  106. package/templates/visuals/.api/v2.5.0/schema.capabilities.json +0 -1197
  107. package/templates/visuals/.api/v2.5.0/schema.dependencies.json +0 -38
  108. package/templates/visuals/.api/v2.5.0/schema.pbiviz.json +0 -103
  109. package/templates/visuals/.api/v2.5.0/schema.stringResources.json +0 -67
  110. package/templates/visuals/.api/v2.6.0/PowerBI-visuals.d.ts +0 -1485
  111. package/templates/visuals/.api/v2.6.0/schema.capabilities.json +0 -1323
  112. package/templates/visuals/.api/v2.6.0/schema.dependencies.json +0 -38
  113. package/templates/visuals/.api/v2.6.0/schema.pbiviz.json +0 -103
  114. package/templates/visuals/.api/v2.6.0/schema.stringResources.json +0 -67
  115. package/templates/visuals/default1/assets/icon.png +0 -0
  116. package/templates/visuals/default1/capabilities.json +0 -84
  117. package/templates/visuals/default1/package.json +0 -6
  118. package/templates/visuals/default1/pbiviz.json +0 -3
  119. package/templates/visuals/default1/src/settings.ts +0 -32
  120. package/templates/visuals/default1/src/visual.ts +0 -71
  121. package/templates/visuals/default1/style/visual.less +0 -9
  122. package/templates/visuals/default1/tsconfig.json +0 -16
@@ -1,1391 +0,0 @@
1
- declare namespace powerbi {
2
- enum VisualDataRoleKind {
3
- /** Indicates that the role should be bound to something that evaluates to a grouping of values. */
4
- Grouping = 0,
5
- /** Indicates that the role should be bound to something that evaluates to a single value in a scope. */
6
- Measure = 1,
7
- /** Indicates that the role can be bound to either Grouping or Measure. */
8
- GroupingOrMeasure = 2,
9
- }
10
- enum VisualDataChangeOperationKind {
11
- Create = 0,
12
- Append = 1,
13
- }
14
- enum VisualUpdateType {
15
- Data = 2,
16
- Resize = 4,
17
- ViewMode = 8,
18
- Style = 16,
19
- ResizeEnd = 32,
20
- All = 62,
21
- }
22
- enum VisualPermissions {
23
- }
24
- const enum CartesianRoleKind {
25
- X = 0,
26
- Y = 1,
27
- }
28
- const enum ViewMode {
29
- View = 0,
30
- Edit = 1,
31
- InFocusEdit = 2,
32
- }
33
- const enum EditMode {
34
- /** Default editing mode for the visual. */
35
- Default = 0,
36
- /** Indicates the user has asked the visual to display advanced editing controls. */
37
- Advanced = 1,
38
- }
39
- const enum AdvancedEditModeSupport {
40
- /** The visual doesn't support Advanced Edit mode. Do not display the 'Edit' button on this visual. */
41
- NotSupported = 0,
42
- /** The visual supports Advanced Edit mode, but doesn't require any further changes aside from setting EditMode=Advanced. */
43
- SupportedNoAction = 1,
44
- /** The visual supports Advanced Edit mode, and requires that the host pops out the visual when entering Advanced EditMode. */
45
- SupportedInFocus = 2,
46
- }
47
- const enum ResizeMode {
48
- Resizing = 1,
49
- Resized = 2,
50
- }
51
- const enum JoinPredicateBehavior {
52
- /** Prevent items in this role from acting as join predicates. */
53
- None = 0,
54
- }
55
- const enum PromiseResultType {
56
- Success = 0,
57
- Failure = 1,
58
- }
59
- /**
60
- * Defines actions to be taken by the visual in response to a selection.
61
- *
62
- * An undefined/null VisualInteractivityAction should be treated as Selection,
63
- * as that is the default action.
64
- */
65
- const enum VisualInteractivityAction {
66
- /** Normal selection behavior which should call onSelect */
67
- Selection = 0,
68
- /** No additional action or feedback from the visual is needed */
69
- None = 1,
70
- }
71
- /**
72
- * Defines various events Visuals can notify the host on.
73
- */
74
- const enum VisualEventType {
75
- /** Should be used at the beginning of a visual's rendering operation. */
76
- RenderStarted = 0,
77
- /** Should be used at the end of a visual's rendering operation. */
78
- RenderCompleted = 1,
79
- /** Should be used by visuals to trace information in PBI telemetry. */
80
- Trace = 2,
81
- /** Should be used by visuals to trace errors in PBI telemetry. */
82
- Error = 3,
83
- }
84
- const enum FilterAction {
85
- /** Merging filter into existing filters. */
86
- merge = 0,
87
- /** removing existing filter. */
88
- remove = 1,
89
- }
90
- }
91
- 
92
-
93
- declare module powerbi.visuals.plugins {
94
- /** This IVisualPlugin interface is only used by the CLI tools when compiling */
95
- export interface IVisualPlugin {
96
- /** The name of the plugin. Must match the property name in powerbi.visuals. */
97
- name: string;
98
-
99
- /** Function to call to create the visual. */
100
- create: (options?: extensibility.VisualConstructorOptions) => extensibility.IVisual;
101
-
102
- /** The class of the plugin. At the moment it is only used to have a way to indicate the class name that a custom visual has. */
103
- class: string;
104
-
105
- /** Check if a visual is custom */
106
- custom: boolean;
107
-
108
- /** The version of the api that this plugin should be run against */
109
- apiVersion: string;
110
-
111
- /** Human readable plugin name displayed to users */
112
- displayName: string;
113
-
114
- }
115
- }
116
-
117
- 
118
-
119
- declare module jsCommon {
120
- export interface IStringResourceProvider {
121
- get(id: string): string;
122
- getOptional(id: string): string;
123
- }
124
- }
125
- 
126
-
127
- declare module powerbi {
128
- /**
129
- * An interface to promise/deferred,
130
- * which abstracts away the underlying mechanism (e.g., Angular, jQuery, etc.).
131
- */
132
- export interface IPromiseFactory {
133
- /**
134
- * Creates a Deferred object which represents a task which will finish in the future.
135
- */
136
- defer<T>(): IDeferred<T>;
137
-
138
- /**
139
- * Creates a Deferred object which represents a task which will finish in the future.
140
- */
141
- defer<TSuccess, TError>(): IDeferred2<TSuccess, TError>;
142
-
143
- /**
144
- * Creates a promise that is resolved as rejected with the specified reason.
145
- * This api should be used to forward rejection in a chain of promises.
146
- * If you are dealing with the last promise in a promise chain, you don't need to worry about it.
147
- * When comparing deferreds/promises to the familiar behavior of try/catch/throw,
148
- * think of reject as the throw keyword in JavaScript.
149
- * This also means that if you "catch" an error via a promise error callback and you want
150
- * to forward the error to the promise derived from the current promise,
151
- * you have to "rethrow" the error by returning a rejection constructed via reject.
152
- *
153
- * @param reason Constant, message, exception or an object representing the rejection reason.
154
- */
155
- reject<TError>(reason?: TError): IPromise2<any, TError>;
156
-
157
- /**
158
- * Creates a promise that is resolved with the specified value.
159
- * This api should be used to forward rejection in a chain of promises.
160
- * If you are dealing with the last promise in a promise chain, you don't need to worry about it.
161
- *
162
- * @param value Object representing the promise result.
163
- */
164
- resolve<TSuccess>(value?: TSuccess): IPromise2<TSuccess, any>;
165
-
166
- /**
167
- * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved.
168
- * Rejects immediately if any of the promises fail
169
- */
170
- all(promises: IPromise2<any, any>[]): IPromise<any[]>;
171
-
172
- /**
173
- * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved.
174
- * Does not resolve until all promises finish (success or failure).
175
- */
176
- allSettled<T>(promises: IPromise2<any, any>[]): IPromise<IPromiseResult<T>[]>;
177
-
178
- /**
179
- * Wraps an object that might be a value or a then-able promise into a promise.
180
- * This is useful when you are dealing with an object that might or might not be a promise
181
- */
182
- when<T>(value: T | IPromise<T>): IPromise<T>;
183
- }
184
-
185
- /**
186
- * Represents an operation, to be completed (resolve/rejected) in the future.
187
- */
188
- export interface IPromise<T> extends IPromise2<T, T> {
189
- }
190
-
191
- /**
192
- * Represents an operation, to be completed (resolve/rejected) in the future.
193
- * Success and failure types can be set independently.
194
- */
195
- export interface IPromise2<TSuccess, TError> {
196
- /**
197
- * Regardless of when the promise was or will be resolved or rejected,
198
- * then calls one of the success or error callbacks asynchronously as soon as the result is available.
199
- * The callbacks are called with a single argument: the result or rejection reason.
200
- * Additionally, the notify callback may be called zero or more times to provide a progress indication,
201
- * before the promise is resolved or rejected.
202
- * This method returns a new promise which is resolved or rejected via
203
- * the return value of the successCallback, errorCallback.
204
- */
205
- then<TSuccessResult, TErrorResult>(successCallback: (promiseValue: TSuccess) => IPromise2<TSuccessResult, TErrorResult>, errorCallback?: (reason: TError) => TErrorResult): IPromise2<TSuccessResult, TErrorResult>;
206
-
207
- /**
208
- * Regardless of when the promise was or will be resolved or rejected,
209
- * then calls one of the success or error callbacks asynchronously as soon as the result is available.
210
- * The callbacks are called with a single argument: the result or rejection reason.
211
- * Additionally, the notify callback may be called zero or more times to provide a progress indication,
212
- * before the promise is resolved or rejected.
213
- * This method returns a new promise which is resolved or rejected via
214
- * the return value of the successCallback, errorCallback.
215
- */
216
- then<TSuccessResult, TErrorResult>(successCallback: (promiseValue: TSuccess) => TSuccessResult, errorCallback?: (reason: TError) => TErrorResult): IPromise2<TSuccessResult, TErrorResult>;
217
-
218
- /**
219
- * Shorthand for promise.then(null, errorCallback).
220
- */
221
- catch<TErrorResult>(onRejected: (reason: any) => IPromise2<TSuccess, TErrorResult>): IPromise2<TSuccess, TErrorResult>;
222
-
223
- /**
224
- * Shorthand for promise.then(null, errorCallback).
225
- */
226
- catch<TErrorResult>(onRejected: (reason: any) => TErrorResult): IPromise2<TSuccess, TErrorResult>;
227
-
228
- /**
229
- * Allows you to observe either the fulfillment or rejection of a promise,
230
- * but to do so without modifying the final value.
231
- * This is useful to release resources or do some clean-up that needs to be done
232
- * whether the promise was rejected or resolved.
233
- * See the full specification for more information.
234
- * Because finally is a reserved word in JavaScript and reserved keywords
235
- * are not supported as property names by ES3, you'll need to invoke
236
- * the method like promise['finally'](callback) to make your code IE8 and Android 2.x compatible.
237
- */
238
- finally<T, U>(finallyCallback: () => any): IPromise2<T, U>;
239
- }
240
-
241
- export interface IDeferred<T> extends IDeferred2<T, T> {
242
- }
243
-
244
- export interface IDeferred2<TSuccess, TError> {
245
- resolve(value: TSuccess): void;
246
- reject(reason?: TError): void;
247
- promise: IPromise2<TSuccess, TError>;
248
- }
249
-
250
- export interface RejectablePromise2<T, E> extends IPromise2<T, E> {
251
- reject(reason?: E): void;
252
- resolved(): boolean;
253
- rejected(): boolean;
254
- pending(): boolean;
255
- }
256
-
257
- export interface RejectablePromise<T> extends RejectablePromise2<T, T> {
258
- }
259
-
260
- export interface IResultCallback<T> {
261
- (result: T, done: boolean): void;
262
- }
263
-
264
- export interface IPromiseResult<T> {
265
- type: PromiseResultType;
266
- value: T;
267
- }
268
- }
269
-
270
-
271
- declare module powerbi.visuals {
272
- import Selector = data.Selector;
273
- import SelectorsByColumn = data.SelectorsByColumn;
274
-
275
- export interface ISelectionIdBuilder {
276
- withCategory(categoryColumn: DataViewCategoryColumn, index: number): this;
277
- withSeries(seriesColumn: DataViewValueColumns, valueColumn: DataViewValueColumn | DataViewValueColumnGroup): this;
278
- withMeasure(measureId: string): this;
279
- createSelectionId(): ISelectionId;
280
- }
281
-
282
- export interface ISelectionId {
283
- equals(other: ISelectionId): boolean;
284
- includes(other: ISelectionId, ignoreHighlight?: boolean): boolean;
285
- getKey(): string;
286
- getSelector(): Selector;
287
- getSelectorsByColumn(): SelectorsByColumn;
288
- hasIdentity(): boolean;
289
- }
290
- }
291
- 
292
-
293
- declare module powerbi {
294
- export const enum SortDirection {
295
- Ascending = 1,
296
- Descending = 2,
297
- }
298
- }
299
- 
300
-
301
- declare module powerbi {
302
- export interface QueryTransformTypeDescriptor {
303
- }
304
- }
305
- 
306
-
307
- declare module powerbi {
308
- /** Represents views of a data set. */
309
- export interface DataView {
310
- metadata: DataViewMetadata;
311
- categorical?: DataViewCategorical;
312
- single?: DataViewSingle;
313
- tree?: DataViewTree;
314
- table?: DataViewTable;
315
- matrix?: DataViewMatrix;
316
- scriptResult?: DataViewScriptResultData;
317
- }
318
-
319
- export interface DataViewMetadata {
320
- columns: DataViewMetadataColumn[];
321
-
322
- /** The metadata repetition objects. */
323
- objects?: DataViewObjects;
324
-
325
- /** When defined, describes whether the DataView contains just a segment of the complete data set. */
326
- segment?: DataViewSegmentMetadata;
327
-
328
- /** Describes the data reduction applied to this data set when limits are exceeded. */
329
- dataReduction?: DataViewReductionMetadata;
330
- }
331
-
332
- export interface DataViewMetadataColumn {
333
- /** The user-facing display name of the column. */
334
- displayName: string;
335
-
336
- /** The query name the source column in the query. */
337
- queryName?: string;
338
-
339
- /** The format string of the column. */
340
- format?: string; // TODO: Deprecate this, and populate format string through objects instead.
341
-
342
- /** Data type information for the column. */
343
- type?: ValueTypeDescriptor;
344
-
345
- /** Indicates that this column is a measure (aggregate) value. */
346
- isMeasure?: boolean;
347
-
348
- /** The position of the column in the select statement. */
349
- index?: number;
350
-
351
- /** The properties that this column provides to the visualization. */
352
- roles?: { [name: string]: boolean };
353
-
354
- /** The metadata repetition objects. */
355
- objects?: DataViewObjects;
356
-
357
- /** The name of the containing group. */
358
- groupName?: PrimitiveValue;
359
-
360
- /** The sort direction of this column. */
361
- sort?: SortDirection;
362
-
363
- /** The order sorts are applied. Lower values are applied first. Undefined indicates no sort was done on this column. */
364
- sortOrder?: number;
365
-
366
- /** The KPI metadata to use to convert a numeric status value into its visual representation. */
367
- kpi?: DataViewKpiColumnMetadata;
368
-
369
- /** Indicates that aggregates should not be computed across groups with different values of this column. */
370
- discourageAggregationAcrossGroups?: boolean;
371
-
372
- /** The aggregates computed for this column, if any. */
373
- aggregates?: DataViewColumnAggregates;
374
-
375
- /** The SQExpr this column represents. */
376
- expr?: data.ISQExpr;
377
-
378
- /**
379
- * The set of expressions that define the identity for instances of this grouping field.
380
- * This must be a subset of the items in the DataViewScopeIdentity in the grouped items result.
381
- * This property is undefined for measure fields, as well as for grouping fields in DSR generated prior to the CY16SU08 or SU09 timeframe.
382
- */
383
- identityExprs?: data.ISQExpr[];
384
-
385
- parameter?: DataViewParameterColumnMetadata;
386
- }
387
-
388
- export interface DataViewSegmentMetadata {
389
- }
390
-
391
- export interface DataViewReductionMetadata {
392
- categorical?: DataViewCategoricalReductionMetadata;
393
- }
394
-
395
- export interface DataViewCategoricalReductionMetadata {
396
- categories?: DataViewReductionAlgorithmMetadata;
397
- values?: DataViewReductionAlgorithmMetadata;
398
- metadata?: DataViewReductionAlgorithmMetadata;
399
- }
400
-
401
- export interface DataViewReductionAlgorithmMetadata {
402
- binnedLineSample?: {};
403
- }
404
-
405
- export interface DataViewColumnAggregates {
406
- subtotal?: PrimitiveValue;
407
- max?: PrimitiveValue;
408
- min?: PrimitiveValue;
409
- average?: PrimitiveValue;
410
- median?: PrimitiveValue;
411
- count?: number;
412
- percentiles?: DataViewColumnPercentileAggregate[];
413
-
414
- /** Represents a single value evaluation, similar to a total. */
415
- single?: PrimitiveValue;
416
-
417
- /** Client-computed maximum value for a column. */
418
- maxLocal?: PrimitiveValue;
419
-
420
- /** Client-computed maximum value for a column. */
421
- minLocal?: PrimitiveValue;
422
- }
423
-
424
- export interface DataViewColumnPercentileAggregate {
425
- exclusive?: boolean;
426
- k: number;
427
- value: PrimitiveValue;
428
- }
429
-
430
- export interface DataViewCategorical {
431
- categories?: DataViewCategoryColumn[];
432
- values?: DataViewValueColumns;
433
- }
434
-
435
- export interface DataViewCategoricalColumn {
436
- source: DataViewMetadataColumn;
437
-
438
- /** The data repetition objects. */
439
- objects?: DataViewObjects[];
440
- }
441
-
442
- export interface DataViewValueColumns extends Array<DataViewValueColumn> {
443
- /** Returns an array that groups the columns in this group together. */
444
- grouped(): DataViewValueColumnGroup[];
445
-
446
- /** The set of expressions that define the identity for instances of the value group. This must match items in the DataViewScopeIdentity in the grouped items result. */
447
- identityFields?: data.ISQExpr[];
448
-
449
- source?: DataViewMetadataColumn;
450
- }
451
-
452
- export interface DataViewValueColumnGroup {
453
- values: DataViewValueColumn[];
454
- identity?: DataViewScopeIdentity;
455
-
456
- /** The data repetition objects. */
457
- objects?: DataViewObjects;
458
-
459
- name?: PrimitiveValue;
460
- }
461
-
462
- export interface DataViewValueColumn extends DataViewCategoricalColumn {
463
- values: PrimitiveValue[];
464
- highlights?: PrimitiveValue[];
465
- identity?: DataViewScopeIdentity;
466
- }
467
-
468
- // NOTE: The following is needed for backwards compatibility and should be deprecated. Callers should use
469
- // DataViewMetadataColumn.aggregates instead.
470
- export interface DataViewValueColumn extends DataViewColumnAggregates {
471
- }
472
-
473
- export interface DataViewCategoryColumn extends DataViewCategoricalColumn {
474
- values: PrimitiveValue[];
475
- identity?: DataViewScopeIdentity[];
476
-
477
- /** The set of expressions that define the identity for instances of the category. This must match items in the DataViewScopeIdentity in the identity. */
478
- identityFields?: data.ISQExpr[];
479
- }
480
-
481
- export interface DataViewSingle {
482
- value: PrimitiveValue;
483
- }
484
-
485
- export interface DataViewTree {
486
- root: DataViewTreeNode;
487
- }
488
-
489
- export interface DataViewTreeNode {
490
- name?: PrimitiveValue;
491
-
492
- /**
493
- * When used under the context of DataView.tree, this value is one of the elements in the values property.
494
- *
495
- * When used under the context of DataView.matrix, this property is the value of the particular
496
- * group instance represented by this node (e.g. In a grouping on Year, a node can have value == 2016).
497
- *
498
- * DEPRECATED for usage under the context of DataView.matrix: This property is deprecated for objects
499
- * that conform to the DataViewMatrixNode interface (which extends DataViewTreeNode).
500
- * New visuals code should consume the new property levelValues on DataViewMatrixNode instead.
501
- * If this node represents a composite group node in matrix, this property will be undefined.
502
- */
503
- value?: PrimitiveValue;
504
-
505
- /**
506
- * This property contains all the values in this node.
507
- * The key of each of the key-value-pair in this dictionary is the position of the column in the
508
- * select statement to which the value belongs.
509
- */
510
- values?: { [id: number]: DataViewTreeNodeValue };
511
-
512
- children?: DataViewTreeNode[];
513
- identity?: DataViewScopeIdentity;
514
-
515
- /** The data repetition objects. */
516
- objects?: DataViewObjects;
517
-
518
- /** The set of expressions that define the identity for the child nodes. This must match items in the DataViewScopeIdentity of those nodes. */
519
- childIdentityFields?: data.ISQExpr[];
520
- }
521
-
522
- export interface DataViewTreeNodeValue {
523
- value?: PrimitiveValue;
524
- }
525
-
526
- export interface DataViewTreeNodeMeasureValue extends DataViewTreeNodeValue, DataViewColumnAggregates {
527
- highlight?: PrimitiveValue;
528
- }
529
-
530
- export interface DataViewTreeNodeGroupValue extends DataViewTreeNodeValue {
531
- count?: PrimitiveValue;
532
- }
533
-
534
- export interface DataViewTable {
535
- columns: DataViewMetadataColumn[];
536
-
537
- identity?: DataViewScopeIdentity[];
538
-
539
- /** The set of expressions that define the identity for rows of the table. This must match items in the DataViewScopeIdentity in the identity. */
540
- identityFields?: data.ISQExpr[];
541
-
542
- rows?: DataViewTableRow[];
543
-
544
- totals?: PrimitiveValue[];
545
- }
546
-
547
- export interface DataViewTableRow extends Array<PrimitiveValue> {
548
- /** The data repetition objects. */
549
- objects?: DataViewObjects[];
550
- }
551
-
552
- export interface DataViewMatrix {
553
- rows: DataViewHierarchy;
554
- columns: DataViewHierarchy;
555
-
556
- /**
557
- * The metadata columns of the measure values.
558
- * In visual DataView, this array is sorted in projection order.
559
- */
560
- valueSources: DataViewMetadataColumn[];
561
- }
562
-
563
- export interface DataViewMatrixNode extends DataViewTreeNode {
564
- /** Indicates the level this node is on. Zero indicates the outermost children (root node level is undefined). */
565
- level?: number;
566
-
567
- children?: DataViewMatrixNode[];
568
-
569
- /* If this DataViewMatrixNode represents the inner-most dimension of row groups (i.e. a leaf node), then this property will contain the values at the
570
- * matrix intersection under the group. The valueSourceIndex property will contain the position of the column in the select statement to which the
571
- * value belongs.
572
- *
573
- * When this DataViewMatrixNode is used under the context of DataView.matrix.columns, this property is not used.
574
- */
575
- values?: { [id: number]: DataViewMatrixNodeValue };
576
-
577
- /**
578
- * Indicates the source metadata index on the node's level. Its value is 0 if omitted.
579
- *
580
- * DEPRECATED: This property is deprecated and exists for backward-compatibility only.
581
- * New visuals code should consume the new property levelSourceIndex on DataViewMatrixGroupValue instead.
582
- */
583
- levelSourceIndex?: number;
584
-
585
- /**
586
- * The values of the particular group instance represented by this node.
587
- * This array property would contain more than one element in a composite group
588
- * (e.g. Year == 2016 and Month == 'January').
589
- */
590
- levelValues?: DataViewMatrixGroupValue[];
591
-
592
- /** Indicates whether or not the node is a subtotal node. Its value is false if omitted. */
593
- isSubtotal?: boolean;
594
- }
595
-
596
- /**
597
- * Represents a value at a particular level of a matrix's rows or columns hierarchy.
598
- * In the hierarchy level node is an instance of a composite group, this object will
599
- * be one of multiple values
600
- */
601
- export interface DataViewMatrixGroupValue extends DataViewTreeNodeValue {
602
- /**
603
- * Indicates the index of the corresponding column for this group level value
604
- * (held by DataViewHierarchyLevel.sources).
605
- *
606
- * @example
607
- * // For example, to get the source column metadata of each level value at a particular row hierarchy node:
608
- * let matrixRowsHierarchy: DataViewHierarchy = dataView.matrix.rows;
609
- * let targetRowsHierarchyNode = <DataViewMatrixNode>matrixRowsHierarchy.root.children[0];
610
- * // Use the DataViewMatrixNode.level property to get the corresponding DataViewHierarchyLevel...
611
- * let targetRowsHierarchyLevel: DataViewHierarchyLevel = matrixRows.levels[targetRowsHierarchyNode.level];
612
- * for (let levelValue in rowsRootNode.levelValues) {
613
- * // columnMetadata is the source column for the particular levelValue.value in this loop iteration
614
- * let columnMetadata: DataViewMetadataColumn =
615
- * targetRowsHierarchyLevel.sources[levelValue.levelSourceIndex];
616
- * }
617
- */
618
- levelSourceIndex: number;
619
- }
620
-
621
- /** Represents a value at the matrix intersection, used in the values property on DataViewMatrixNode (inherited from DataViewTreeNode). */
622
- export interface DataViewMatrixNodeValue extends DataViewTreeNodeValue {
623
- highlight?: PrimitiveValue;
624
-
625
- /** The data repetition objects. */
626
- objects?: DataViewObjects;
627
-
628
- /** Indicates the index of the corresponding measure (held by DataViewMatrix.valueSources). Its value is 0 if omitted. */
629
- valueSourceIndex?: number;
630
- }
631
-
632
- export interface DataViewHierarchy {
633
- root: DataViewMatrixNode;
634
- levels: DataViewHierarchyLevel[];
635
- }
636
-
637
- export interface DataViewHierarchyLevel {
638
- /**
639
- * The metadata columns of this hierarchy level.
640
- * In visual DataView, this array is sorted in projection order.
641
- */
642
- sources: DataViewMetadataColumn[];
643
- }
644
-
645
- export interface DataViewKpiColumnMetadata {
646
- graphic: string;
647
-
648
- // When false, five state KPIs are in: { -2, -1, 0, 1, 2 }.
649
- // When true, five state KPIs are in: { -1, -0.5, 0, 0.5, 1 }.
650
- normalizedFiveStateKpiRange?: boolean;
651
- }
652
-
653
- /** Indicates the column is a what-if parameter */
654
- export interface DataViewParameterColumnMetadata {
655
- }
656
-
657
- export interface DataViewScriptResultData {
658
- payloadBase64: string;
659
- }
660
-
661
- export interface ValueRange<T> {
662
- min?: T;
663
- max?: T;
664
- }
665
-
666
- /** Defines the acceptable values of a number. */
667
- export type NumberRange = ValueRange<number>;
668
-
669
- /** Defines the PrimitiveValue range. */
670
- export type PrimitiveValueRange = ValueRange<PrimitiveValue>;
671
- }
672
- 
673
-
674
- declare module powerbi {
675
- /** Represents evaluated, named, custom objects in a DataView. */
676
- export interface DataViewObjects {
677
- [name: string]: DataViewObject;
678
- }
679
-
680
- /** Represents an object (name-value pairs) in a DataView. */
681
- export interface DataViewObject {
682
- /** Map of property name to property value. */
683
- [propertyName: string]: DataViewPropertyValue;
684
-
685
- /** Instances of this object. When there are multiple instances with the same object name they will appear here. */
686
- $instances?: DataViewObjectMap;
687
- }
688
-
689
- export interface DataViewObjectWithId {
690
- id: string;
691
- object: DataViewObject;
692
- }
693
-
694
- export interface DataViewObjectPropertyIdentifier {
695
- objectName: string;
696
- propertyName: string;
697
- }
698
-
699
- export type DataViewObjectMap = { [id: string]: DataViewObject };
700
-
701
- export type DataViewPropertyValue = PrimitiveValue | StructuralObjectValue;
702
- }
703
- 
704
-
705
- declare module powerbi.data {
706
- /** Defines a match against all instances of given roles. */
707
- export interface DataViewRoleWildcard {
708
- kind: DataRepetitionKind.RoleWildcard;
709
- roles: string[];
710
- key: string;
711
- }
712
- }
713
- 
714
-
715
- declare module powerbi {
716
- /** Encapsulates the identity of a data scope in a DataView. */
717
- export interface DataViewScopeIdentity {
718
- kind: DataRepetitionKind.ScopeIdentity;
719
-
720
- /** Predicate expression that identifies the scope. */
721
- expr: data.ISQExpr;
722
-
723
- /** Key string that identifies the DataViewScopeIdentity to a string, which can be used for equality comparison. */
724
- key: string;
725
- }
726
- }
727
- 
728
-
729
- declare module powerbi.data {
730
- /** Defines a match against all instances of a given DataView scope. Does not match Subtotals. */
731
- export interface DataViewScopeWildcard {
732
- kind: DataRepetitionKind.ScopeWildcard;
733
- exprs: ISQExpr[];
734
- key: string;
735
- }
736
- }
737
- 
738
-
739
- declare module powerbi.data {
740
- import IStringResourceProvider = jsCommon.IStringResourceProvider;
741
-
742
- export type DisplayNameGetter = ((resourceProvider: IStringResourceProvider) => string) | string;
743
- }
744
- 
745
-
746
- declare module powerbi.data {
747
- /** Defines a selector for content, including data-, metadata, and user-defined repetition. */
748
- export interface Selector {
749
- /** Data-bound repetition selection. */
750
- data?: DataRepetitionSelector[];
751
-
752
- /** Metadata-bound repetition selection. Refers to a DataViewMetadataColumn queryName. */
753
- metadata?: string;
754
-
755
- /** User-defined repetition selection. */
756
- id?: string;
757
- }
758
-
759
- export type DataRepetitionSelector =
760
- DataViewScopeIdentity |
761
- DataViewScopeWildcard |
762
- DataViewRoleWildcard |
763
- DataViewScopeTotal;
764
-
765
- export interface SelectorsByColumn { }
766
- }
767
- 
768
-
769
- declare module powerbi.data {
770
- //intentionally blank interfaces since this is not part of the public API
771
-
772
- export interface ISemanticFilter { }
773
-
774
- export interface ISQExpr { }
775
-
776
- export interface ISQConstantExpr extends ISQExpr { }
777
-
778
- }
779
-
780
-
781
- declare namespace powerbi {
782
- /** Kind of the Data Repetition Selector */
783
-
784
- export const enum DataRepetitionKind {
785
- RoleWildcard = 0,
786
- ScopeIdentity = 1,
787
- ScopeTotal = 2,
788
- ScopeWildcard = 3,
789
- }
790
- }
791
-
792
-
793
- declare module powerbi.data {
794
- /** Defines a match against any Total within a given DataView scope. */
795
- export interface DataViewScopeTotal {
796
- kind: DataRepetitionKind.ScopeTotal;
797
-
798
- /* The exprs defining the scope that this Total has been evaluated for
799
- * It's an array to support expressing Total across a composite group
800
- * Example: If this represents Total sales of USA across States, the Exprs wil refer to "States"
801
- */
802
- exprs: ISQExpr[];
803
-
804
- key: string;
805
- }
806
- }
807
- 
808
-
809
- declare module powerbi {
810
- export interface DefaultValueDefinition {
811
- value: data.ISQConstantExpr;
812
- identityFieldsValues?: data.ISQConstantExpr[];
813
- }
814
-
815
- export interface DefaultValueTypeDescriptor {
816
- defaultValue: boolean;
817
- }
818
- }
819
-
820
-
821
- declare module powerbi {
822
- import DisplayNameGetter = powerbi.data.DisplayNameGetter;
823
-
824
- export type EnumMemberValue = string | number;
825
-
826
- export interface IEnumMember {
827
- value: EnumMemberValue;
828
- displayName: DisplayNameGetter;
829
- }
830
-
831
- /** Defines a custom enumeration data type, and its values. */
832
- export interface IEnumType {
833
- /** Gets the members of the enumeration, limited to the validMembers, if appropriate. */
834
- members(validMembers?: EnumMemberValue[]): IEnumMember[];
835
- }
836
-
837
- }
838
- 
839
-
840
- declare module powerbi {
841
- export interface Fill {
842
- solid?: {
843
- color?: string;
844
- };
845
- gradient?: {
846
- startColor?: string;
847
- endColor?: string;
848
- };
849
- pattern?: {
850
- patternKind?: string;
851
- color?: string;
852
- };
853
- }
854
-
855
- export interface FillTypeDescriptor {
856
- solid?: {
857
- color?: FillSolidColorTypeDescriptor;
858
- };
859
- gradient?: {
860
- startColor?: boolean;
861
- endColor?: boolean;
862
- };
863
- pattern?: {
864
- patternKind?: boolean;
865
- color?: boolean;
866
- };
867
- }
868
-
869
- export type FillSolidColorTypeDescriptor = boolean | FillSolidColorAdvancedTypeDescriptor;
870
-
871
- export interface FillSolidColorAdvancedTypeDescriptor {
872
- /** Indicates whether the color value may be nullable, and a 'no fill' option is appropriate. */
873
- nullable: boolean;
874
- }
875
- }
876
- 
877
-
878
- declare module powerbi {
879
- export interface FillRule extends FillRuleGeneric<string, number, string> {
880
- }
881
-
882
- export interface FillRuleTypeDescriptor {
883
- }
884
-
885
- export interface FillRuleGeneric<TColor, TValue, TStrategy> {
886
- linearGradient2?: LinearGradient2Generic<TColor, TValue, TStrategy>;
887
- linearGradient3?: LinearGradient3Generic<TColor, TValue, TStrategy>;
888
-
889
- // stepped2?
890
- // ...
891
- }
892
-
893
- export interface LinearGradient2Generic<TColor, TValue, TStrategy> {
894
- max: RuleColorStopGeneric<TColor, TValue>;
895
- min: RuleColorStopGeneric<TColor, TValue>;
896
- nullColoringStrategy?: NullColoringStrategyGeneric<TStrategy, TColor>;
897
- }
898
- export interface LinearGradient3Generic<TColor, TValue, TStrategy> {
899
- max: RuleColorStopGeneric<TColor, TValue>;
900
- mid: RuleColorStopGeneric<TColor, TValue>;
901
- min: RuleColorStopGeneric<TColor, TValue>;
902
- nullColoringStrategy?: NullColoringStrategyGeneric<TStrategy, TColor>;
903
- }
904
-
905
- export interface RuleColorStopGeneric<TColor, TValue> {
906
- color: TColor;
907
- value?: TValue;
908
- }
909
-
910
- export interface NullColoringStrategyGeneric<TStrategy, TColor> {
911
- strategy: TStrategy;
912
- /**
913
- * Only used if strategy is specificColor
914
- */
915
- color?: TColor;
916
- }
917
- }
918
- 
919
-
920
- declare module powerbi {
921
- export interface FilterTypeDescriptor {
922
- selfFilter?: boolean;
923
- }
924
- }
925
- 
926
-
927
- declare module powerbi {
928
- export type GeoJson = GeoJsonDefinitionGeneric<string>;
929
-
930
- export interface GeoJsonDefinitionGeneric<T> {
931
- type: T;
932
- name: T;
933
- content: T;
934
- }
935
-
936
- export interface GeoJsonTypeDescriptor { }
937
- }
938
- 
939
-
940
- declare module powerbi {
941
- export type ImageValue = ImageDefinitionGeneric<string>;
942
-
943
- export interface ImageDefinitionGeneric<T> {
944
- name: T;
945
- url: T;
946
- scaling?: T;
947
- }
948
-
949
- export interface ImageTypeDescriptor { }
950
-
951
- }
952
- 
953
-
954
- declare module powerbi {
955
- import ISQExpr = powerbi.data.ISQExpr;
956
-
957
- export type Paragraphs = Paragraph[];
958
-
959
- export interface Paragraph {
960
- horizontalTextAlignment?: string;
961
- textRuns: TextRun[];
962
- }
963
-
964
- export interface ParagraphsTypeDescriptor {
965
- }
966
-
967
- export interface TextRunStyle {
968
- fontFamily?: string;
969
- fontSize?: string;
970
- fontStyle?: string;
971
- fontWeight?: string;
972
- color?: string;
973
- textDecoration?: string;
974
- }
975
-
976
- export interface TextRun {
977
- textStyle?: TextRunStyle;
978
- url?: string;
979
- value: string;
980
- valueExpr?: ISQExpr;
981
- }
982
- }
983
- 
984
-
985
- declare module powerbi {
986
- import SemanticFilter = data.ISemanticFilter;
987
-
988
- /** Defines instances of structural types. */
989
- export type StructuralObjectValue =
990
- Fill |
991
- FillRule |
992
- SemanticFilter |
993
- DefaultValueDefinition |
994
- ImageValue |
995
- Paragraphs |
996
- GeoJson |
997
- DataBars;
998
-
999
- /** Describes a structural type in the client type system. Leaf properties should use ValueType. */
1000
- export interface StructuralTypeDescriptor {
1001
- fill?: FillTypeDescriptor;
1002
- fillRule?: FillRuleTypeDescriptor;
1003
- filter?: FilterTypeDescriptor;
1004
- expression?: DefaultValueTypeDescriptor;
1005
- image?: ImageTypeDescriptor;
1006
- paragraphs?: ParagraphsTypeDescriptor;
1007
- geoJson?: GeoJsonTypeDescriptor;
1008
- queryTransform?: QueryTransformTypeDescriptor;
1009
- dataBars?: DataBarsTypeDescriptor;
1010
-
1011
- //border?: BorderTypeDescriptor;
1012
- //etc.
1013
- }
1014
- }
1015
- 
1016
-
1017
- declare module powerbi {
1018
- /** Describes a data value type in the client type system. Can be used to get a concrete ValueType instance. */
1019
- export interface ValueTypeDescriptor {
1020
- // Simplified primitive types
1021
- readonly text?: boolean;
1022
- readonly numeric?: boolean;
1023
- readonly integer?: boolean;
1024
- readonly bool?: boolean;
1025
- readonly dateTime?: boolean;
1026
- readonly duration?: boolean;
1027
- readonly binary?: boolean;
1028
- readonly none?: boolean; //TODO: 5005022 remove none type when we introduce property categories.
1029
-
1030
- // Extended types
1031
- readonly temporal?: TemporalTypeDescriptor;
1032
- readonly geography?: GeographyTypeDescriptor;
1033
- readonly misc?: MiscellaneousTypeDescriptor;
1034
- readonly formatting?: FormattingTypeDescriptor;
1035
- /*readonly*/ enumeration?: IEnumType;
1036
- readonly scripting?: ScriptTypeDescriptor;
1037
- readonly operations?: OperationalTypeDescriptor;
1038
-
1039
- // variant types
1040
- readonly variant?: ValueTypeDescriptor[];
1041
- }
1042
-
1043
- export interface ScriptTypeDescriptor {
1044
- readonly source?: boolean;
1045
- }
1046
-
1047
- export interface TemporalTypeDescriptor {
1048
- readonly year?: boolean;
1049
- readonly quarter?: boolean;
1050
- readonly month?: boolean;
1051
- readonly day?: boolean;
1052
- readonly paddedDateTableDate?: boolean;
1053
- }
1054
-
1055
- export interface GeographyTypeDescriptor {
1056
- readonly address?: boolean;
1057
- readonly city?: boolean;
1058
- readonly continent?: boolean;
1059
- readonly country?: boolean;
1060
- readonly county?: boolean;
1061
- readonly region?: boolean;
1062
- readonly postalCode?: boolean;
1063
- readonly stateOrProvince?: boolean;
1064
- readonly place?: boolean;
1065
- readonly latitude?: boolean;
1066
- readonly longitude?: boolean;
1067
- }
1068
-
1069
- export interface MiscellaneousTypeDescriptor {
1070
- readonly image?: boolean;
1071
- readonly imageUrl?: boolean;
1072
- readonly webUrl?: boolean;
1073
- readonly barcode?: boolean;
1074
- }
1075
-
1076
- export interface FormattingTypeDescriptor {
1077
- readonly color?: boolean;
1078
- readonly formatString?: boolean;
1079
- readonly alignment?: boolean;
1080
- readonly labelDisplayUnits?: boolean;
1081
- readonly fontSize?: boolean;
1082
- readonly fontFamily?: boolean;
1083
- readonly labelDensity?: boolean;
1084
- readonly bubbleSize?: boolean;
1085
- readonly altText?: boolean;
1086
- }
1087
-
1088
- export interface OperationalTypeDescriptor {
1089
- readonly searchEnabled?: boolean;
1090
- }
1091
-
1092
- /** Describes instances of value type objects. */
1093
- export type PrimitiveValue = string | number | boolean | Date;
1094
- }
1095
- 
1096
-
1097
- declare module powerbi {
1098
-
1099
- export interface DataBars {
1100
- minValue?: number;
1101
- maxValue?: number;
1102
- positiveColor: Fill;
1103
- negativeColor: Fill;
1104
- axisColor: Fill;
1105
- reverseDirection: boolean;
1106
- hideText: boolean;
1107
- }
1108
-
1109
- export interface DataBarsTypeDescriptor {
1110
- }
1111
- }
1112
- 
1113
-
1114
- declare module powerbi {
1115
- export interface IViewport {
1116
- height: number;
1117
- width: number;
1118
- }
1119
-
1120
- export interface ScaledViewport extends IViewport{
1121
- scale: number;
1122
- }
1123
- }
1124
- 
1125
-
1126
- declare module powerbi {
1127
- import Selector = powerbi.data.Selector;
1128
-
1129
- export interface VisualObjectInstance {
1130
- /** The name of the object (as defined in VisualCapabilities). */
1131
- objectName: string;
1132
-
1133
- /** A display name for the object instance. */
1134
- displayName?: string;
1135
-
1136
- /** The set of property values for this object. Some of these properties may be defaults provided by the IVisual. */
1137
- properties: {
1138
- [propertyName: string]: DataViewPropertyValue;
1139
- };
1140
-
1141
- /** The selector that identifies this object. */
1142
- selector: Selector;
1143
-
1144
- /** (Optional) Defines the constrained set of valid values for a property. */
1145
- validValues?: {
1146
- [propertyName: string]: string[] | ValidationOptions;
1147
- };
1148
-
1149
- /** (Optional) VisualObjectInstanceEnumeration category index. */
1150
- containerIdx?: number;
1151
-
1152
- /** (Optional) Set the required type for particular properties that support variant types. */
1153
- propertyTypes?: {
1154
- [propertyName: string]: ValueTypeDescriptor;
1155
- };
1156
- }
1157
-
1158
- export type VisualObjectInstanceEnumeration = VisualObjectInstance[] | VisualObjectInstanceEnumerationObject;
1159
-
1160
- export interface ValidationOptions {
1161
- numberRange?: NumberRange;
1162
- }
1163
-
1164
- export interface VisualObjectInstanceEnumerationObject {
1165
- /** The visual object instances. */
1166
- instances: VisualObjectInstance[];
1167
-
1168
- /** Defines a set of containers for related object instances. */
1169
- containers?: VisualObjectInstanceContainer[];
1170
- }
1171
-
1172
- export interface VisualObjectInstanceContainer {
1173
- displayName: data.DisplayNameGetter;
1174
- }
1175
-
1176
- export interface VisualObjectInstancesToPersist {
1177
- /** Instances which should be merged with existing instances. */
1178
- merge?: VisualObjectInstance[];
1179
-
1180
- /** Instances which should replace existing instances. */
1181
- replace?: VisualObjectInstance[];
1182
-
1183
- /** Instances which should be deleted from the existing instances. */
1184
- remove?: VisualObjectInstance[];
1185
-
1186
- /** Instances which should be deleted from the existing objects. */
1187
- removeObject?: VisualObjectInstance[];
1188
- }
1189
-
1190
- export interface EnumerateVisualObjectInstancesOptions {
1191
- objectName: string;
1192
- }
1193
- }
1194
-
1195
-
1196
-
1197
- declare module powerbi {
1198
- import Selector = powerbi.data.Selector;
1199
-
1200
- export interface VisualObjectRepetition {
1201
- /** The selector that identifies the objects. */
1202
- selector: Selector;
1203
-
1204
- /** Used to group differernt repetitions into containers. That will be used as the container displayName in the PropertyPane */
1205
- containerName?: string;
1206
-
1207
- /** The set of repetition descriptors for this object. */
1208
- objects: {
1209
- [objectName: string]: DataViewRepetitionObjectDescriptor;
1210
- };
1211
- }
1212
-
1213
- export interface DataViewRepetitionObjectDescriptor {
1214
- /** Properties used for formatting (e.g., Conditional Formatting). */
1215
- formattingProperties?: string[];
1216
- }
1217
- }
1218
-
1219
- 
1220
-
1221
- declare module powerbi.extensibility {
1222
-
1223
- export interface IVisualPluginOptions {
1224
- transform?: IVisualDataViewTransform;
1225
- }
1226
-
1227
- export interface IVisualConstructor {
1228
- __transform__?: IVisualDataViewTransform;
1229
- }
1230
-
1231
- export interface IVisualDataViewTransform {
1232
- <T>(dataview: DataView[]): T;
1233
- }
1234
-
1235
- // These are the base interfaces. These should remain empty
1236
- // All visual versions should extend these for type compatability
1237
-
1238
- export interface IVisual { }
1239
-
1240
- export interface IVisualHost { }
1241
-
1242
- export interface VisualUpdateOptions { }
1243
-
1244
- export interface VisualConstructorOptions {
1245
- /** The loaded module, if any, defined by the IVisualPlugin.module. */
1246
- module?: any;
1247
- }
1248
- }
1249
-
1250
-
1251
-
1252
- declare module powerbi {
1253
- export interface IColorInfo extends IStyleInfo {
1254
- value: string;
1255
- }
1256
-
1257
- export interface IStyleInfo {
1258
- className?: string;
1259
- }
1260
- }
1261
-
1262
-
1263
- declare module powerbi.extensibility {
1264
- interface ISelectionManager {
1265
- select(selectionId: ISelectionId | ISelectionId[], multiSelect?: boolean): IPromise<ISelectionId[]>;
1266
- hasSelection(): boolean;
1267
- clear(): IPromise<{}>;
1268
- getSelectionIds(): ISelectionId[];
1269
- applySelectionFilter(): void;
1270
- }
1271
- }
1272
-
1273
-
1274
- declare module powerbi.extensibility {
1275
- export interface ISelectionId { }
1276
-
1277
- export interface ISelectionIdBuilder {
1278
- withCategory(categoryColumn: DataViewCategoryColumn, index: number): this;
1279
- withSeries(seriesColumn: DataViewValueColumns, valueColumn: DataViewValueColumn | DataViewValueColumnGroup): this;
1280
- withMeasure(measureId: string): this;
1281
- createSelectionId(): ISelectionId;
1282
- }
1283
- }
1284
-
1285
-
1286
- declare module powerbi.extensibility {
1287
- export interface IColorPalette {
1288
- getColor(key: string): IColorInfo;
1289
- }
1290
- }
1291
-
1292
-
1293
- declare module powerbi.extensibility {
1294
- interface VisualTooltipDataItem {
1295
- displayName: string;
1296
- value: string;
1297
- color?: string;
1298
- header?: string;
1299
- opacity?: string;
1300
- }
1301
-
1302
- interface TooltipMoveOptions {
1303
- coordinates: number[];
1304
- isTouchEvent: boolean;
1305
- dataItems?: VisualTooltipDataItem[];
1306
- identities: ISelectionId[];
1307
- }
1308
-
1309
- interface TooltipShowOptions extends TooltipMoveOptions {
1310
- dataItems: VisualTooltipDataItem[];
1311
- }
1312
-
1313
- interface TooltipHideOptions {
1314
- isTouchEvent: boolean;
1315
- immediately: boolean;
1316
- }
1317
-
1318
- interface ITooltipService {
1319
- enabled(): boolean;
1320
- show(options: TooltipShowOptions): void;
1321
- move(options: TooltipMoveOptions): void;
1322
- hide(options: TooltipHideOptions): void;
1323
- }
1324
- }
1325
- 
1326
-
1327
- declare module powerbi.extensibility {
1328
- interface ITelemetryService {
1329
- readonly instanceId: string;
1330
- trace(type: VisualEventType, payload?: string);
1331
- }
1332
- }
1333
-
1334
-
1335
- declare module powerbi.extensibility {
1336
- export function VisualPlugin (options: IVisualPluginOptions): ClassDecorator;
1337
- }
1338
-
1339
- declare module powerbi {
1340
- export interface IFilter { }
1341
- }
1342
-
1343
- /**
1344
- * Change Log Version 1.9.0
1345
- * Added launchUrl
1346
- */
1347
-
1348
- declare module powerbi.extensibility.visual {
1349
- /**
1350
- * Represents a visualization displayed within an application (PowerBI dashboards, ad-hoc reporting, etc.).
1351
- * This interface does not make assumptions about the underlying JS/HTML constructs the visual uses to render itself.
1352
- */
1353
- export interface IVisual extends extensibility.IVisual {
1354
- /** Notifies the IVisual of an update (data, viewmode, size change). */
1355
- update<T>(options: VisualUpdateOptions, viewModel?: T): void;
1356
-
1357
- /** Notifies the visual that it is being destroyed, and to do any cleanup necessary (such as unsubscribing event handlers). */
1358
- destroy?(): void;
1359
-
1360
- /** Gets the set of objects that the visual is currently displaying. */
1361
- enumerateObjectInstances?(options: EnumerateVisualObjectInstancesOptions): VisualObjectInstanceEnumeration;
1362
- }
1363
-
1364
- export interface IVisualHost extends extensibility.IVisualHost {
1365
- createSelectionIdBuilder: () => visuals.ISelectionIdBuilder;
1366
- createSelectionManager: () => ISelectionManager;
1367
- colorPalette: IColorPalette;
1368
- persistProperties: (changes: VisualObjectInstancesToPersist) => void;
1369
- applyJsonFilter: (filter: IFilter, objectName: string, propertyName: string, action: FilterAction) => void;
1370
- tooltipService: ITooltipService;
1371
- telemetry: ITelemetryService;
1372
- locale: string;
1373
- allowInteractions: boolean;
1374
- launchUrl: (url: string) => void;
1375
- instanceId: string;
1376
- refreshHostData: () => void;
1377
- }
1378
-
1379
- export interface VisualUpdateOptions extends extensibility.VisualUpdateOptions {
1380
- viewport: IViewport;
1381
- dataViews: DataView[];
1382
- type: VisualUpdateType;
1383
- viewMode?: ViewMode;
1384
- editMode?: EditMode;
1385
- }
1386
-
1387
- export interface VisualConstructorOptions extends extensibility.VisualConstructorOptions {
1388
- element: HTMLElement;
1389
- host: IVisualHost;
1390
- }
1391
- }