@nebula.js/stardust 2.3.1 → 2.6.1
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.
- package/CHANGELOG.md +32 -0
- package/README.md +15 -0
- package/core/esm/dev.js +780 -287
- package/core/esm/dev.js.map +1 -1
- package/core/esm/index.js +3 -3
- package/core/esm/index.js.map +1 -1
- package/dist/stardust.dev.js +1295 -323
- package/dist/stardust.dev.js.map +1 -1
- package/dist/stardust.js +7 -7
- package/dist/stardust.js.map +1 -1
- package/package.json +19 -10
- package/types/index.d.ts +710 -0
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,710 @@
|
|
|
1
|
+
// File generated automatically by "@scriptappy/to-dts"; DO NOT EDIT.
|
|
2
|
+
/// <reference types="qlik-engineapi" />
|
|
3
|
+
/**
|
|
4
|
+
* Initiates a new `Embed` instance using the specified enigma `app`.
|
|
5
|
+
* @param app
|
|
6
|
+
* @param instanceConfig
|
|
7
|
+
*/
|
|
8
|
+
export function embed(app: EngineAPI.IApp, instanceConfig?: stardust.Configuration): stardust.Embed;
|
|
9
|
+
|
|
10
|
+
export namespace embed {
|
|
11
|
+
/**
|
|
12
|
+
* Creates a new `embed` scope bound to the specified `configuration`.
|
|
13
|
+
*
|
|
14
|
+
* The configuration is merged with all previous scopes.
|
|
15
|
+
* @param configuration The configuration object
|
|
16
|
+
*/
|
|
17
|
+
function createConfiguration(configuration: stardust.Configuration): typeof embed;
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Creates a stateful value.
|
|
23
|
+
* @param initialState The initial state.
|
|
24
|
+
*/
|
|
25
|
+
export function useState<S>(initialState: S | (()=>S)): [S, stardust.SetStateFn<S>];
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Triggers a callback function when a dependent value changes.
|
|
29
|
+
* @param effect The callback.
|
|
30
|
+
* @param deps The dependencies that should trigger the callback.
|
|
31
|
+
*/
|
|
32
|
+
export function useEffect(effect: stardust.EffectCallback, deps?: any[]): void;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Creates a stateful value when a dependent changes.
|
|
36
|
+
* @param factory The factory function.
|
|
37
|
+
* @param deps The dependencies.
|
|
38
|
+
*/
|
|
39
|
+
export function useMemo<T>(factory: ()=>T, deps: any[]): T;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Runs a callback function when a dependent changes.
|
|
43
|
+
* @param factory The factory function that calls the promise.
|
|
44
|
+
* @param deps The dependencies.
|
|
45
|
+
*/
|
|
46
|
+
export function usePromise<P>(factory: ()=>Promise<P>, deps?: any[]): [P, Error];
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Gets the HTMLElement this visualization is rendered into.
|
|
50
|
+
*/
|
|
51
|
+
export function useElement(): HTMLElement;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Gets the size of the HTMLElement the visualization is rendered into.
|
|
55
|
+
*/
|
|
56
|
+
export function useRect(): stardust.Rect;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Gets the layout of the generic object associated with this visualization.
|
|
60
|
+
*/
|
|
61
|
+
export function useLayout(): EngineAPI.IGenericObjectLayout;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Gets the layout of the generic object associated with this visualization.
|
|
65
|
+
*
|
|
66
|
+
* Unlike the regular layout, a _stale_ layout is not changed when a generic object enters
|
|
67
|
+
* the modal state. This is mostly notable in that `qSelectionInfo.qInSelections` in the layout is
|
|
68
|
+
* always `false`.
|
|
69
|
+
* The returned value from `useStaleLayout()` and `useLayout()` are identical when the object
|
|
70
|
+
* is not in a modal state.
|
|
71
|
+
*/
|
|
72
|
+
export function useStaleLayout(): EngineAPI.IGenericObjectLayout;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Gets the layout of the app associated with this visualization.
|
|
76
|
+
*/
|
|
77
|
+
export function useAppLayout(): EngineAPI.INxAppLayout;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Gets the generic object API of the generic object connected to this visualization.
|
|
81
|
+
*/
|
|
82
|
+
export function useModel(): EngineAPI.IGenericObject | undefined;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Gets the doc API.
|
|
86
|
+
*/
|
|
87
|
+
export function useApp(): EngineAPI.IApp | undefined;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Gets the global API.
|
|
91
|
+
*/
|
|
92
|
+
export function useGlobal(): EngineAPI.IGlobal | undefined;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Gets the object selections.
|
|
96
|
+
*/
|
|
97
|
+
export function useSelections(): stardust.ObjectSelections;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Gets the theme.
|
|
101
|
+
*/
|
|
102
|
+
export function useTheme(): stardust.Theme;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Gets the embed instance used.
|
|
106
|
+
*/
|
|
107
|
+
export function useEmbed(): stardust.Embed;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Gets the translator.
|
|
111
|
+
*/
|
|
112
|
+
export function useTranslator(): stardust.Translator;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Gets the device type. ('touch' or 'desktop')
|
|
116
|
+
*/
|
|
117
|
+
export function useDeviceType(): string;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Gets the array of plugins provided when rendering the visualization.
|
|
121
|
+
*/
|
|
122
|
+
export function usePlugins(): stardust.Plugin[];
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Registers a custom action.
|
|
126
|
+
* @param factory
|
|
127
|
+
* @param deps
|
|
128
|
+
*/
|
|
129
|
+
export function useAction<A>(factory: ()=>stardust.ActionDefinition<A>, deps?: any[]): A;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Gets the desired constraints that should be applied when rendering the visualization.
|
|
133
|
+
*
|
|
134
|
+
* The constraints are set on the embed configuration before the visualization is rendered
|
|
135
|
+
* and should respected by you when implementing the visualization.
|
|
136
|
+
*/
|
|
137
|
+
export function useConstraints(): stardust.Constraints;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Gets the options object provided when rendering the visualization.
|
|
141
|
+
*
|
|
142
|
+
* This is an empty object by default but enables customization of the visualization through this object.
|
|
143
|
+
* Options are different from setting properties on the generic object in that options
|
|
144
|
+
* are only temporary settings applied to the visualization when rendered.
|
|
145
|
+
*
|
|
146
|
+
* You have the responsibility to provide documentation of the options you support, if any.
|
|
147
|
+
*/
|
|
148
|
+
export function useOptions(): object;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Registers a callback that is called when a snapshot is taken.
|
|
152
|
+
* @param snapshotCallback
|
|
153
|
+
*/
|
|
154
|
+
export function onTakeSnapshot(snapshotCallback: ($: EngineAPI.IGenericObjectLayout)=>Promise<EngineAPI.IGenericObjectLayout>): void;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Gets render state instance.
|
|
158
|
+
*
|
|
159
|
+
* Used to update properties and get a new layout without triggering onInitialRender.
|
|
160
|
+
*/
|
|
161
|
+
export function useRenderState(): stardust.RenderState;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Gets the desired keyboard settings and status to applied when rendering the visualization.
|
|
165
|
+
* A visualization should in general only have tab stops if either `keyboard.enabled` is false or if active is true.
|
|
166
|
+
* This means that either Nebula isn't configured to handle keyboard input or the chart is currently focused.
|
|
167
|
+
* Enabling or disabling keyboardNavigation are set on the embed configuration and
|
|
168
|
+
* should be respected by the visualization.
|
|
169
|
+
*/
|
|
170
|
+
export function useKeyboard(): stardust.Keyboard;
|
|
171
|
+
|
|
172
|
+
declare namespace stardust {
|
|
173
|
+
interface Context {
|
|
174
|
+
disableCellPadding?: boolean;
|
|
175
|
+
keyboardNavigation?: boolean;
|
|
176
|
+
constraints?: {
|
|
177
|
+
active?: boolean;
|
|
178
|
+
passive?: boolean;
|
|
179
|
+
select?: boolean;
|
|
180
|
+
};
|
|
181
|
+
theme?: string;
|
|
182
|
+
language?: string;
|
|
183
|
+
deviceType?: string;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
interface Configuration {
|
|
187
|
+
context?: stardust.Context;
|
|
188
|
+
types?: stardust.TypeInfo[];
|
|
189
|
+
themes?: stardust.ThemeInfo[];
|
|
190
|
+
anything?: object;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
interface Galaxy {
|
|
194
|
+
translator: stardust.Translator;
|
|
195
|
+
flags: stardust.Flags;
|
|
196
|
+
deviceType: string;
|
|
197
|
+
anything: object;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
class Embed {
|
|
201
|
+
constructor();
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Renders a visualization into an HTMLElement.
|
|
205
|
+
* @param cfg The render configuration.
|
|
206
|
+
*/
|
|
207
|
+
render(cfg: stardust.CreateConfig | stardust.GetConfig): Promise<stardust.Viz>;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Updates the current context of this embed instance.
|
|
211
|
+
* Use this when you want to change some part of the current context, like theme.
|
|
212
|
+
* @param ctx The context to update.
|
|
213
|
+
*/
|
|
214
|
+
context(ctx: stardust.Context): Promise<undefined>;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Gets the app selections of this instance.
|
|
218
|
+
*/
|
|
219
|
+
selections(): Promise<stardust.AppSelections>;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Gets the listbox instance of the specified field
|
|
223
|
+
* @param fieldIdentifier Fieldname as a string or a Library dimension
|
|
224
|
+
*/
|
|
225
|
+
field(fieldIdentifier: string | stardust.LibraryField): Promise<stardust.FieldInstance>;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Gets a list of registered visualization types and versions
|
|
229
|
+
*/
|
|
230
|
+
getRegisteredTypes(): Object[];
|
|
231
|
+
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* A callback function which receives another function as input.
|
|
236
|
+
*/
|
|
237
|
+
type ReceiverFunction = ($: ()=>void)=>void;
|
|
238
|
+
|
|
239
|
+
class FieldInstance {
|
|
240
|
+
constructor();
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Mounts the field as a listbox into the provided HTMLElement.
|
|
244
|
+
* @param element
|
|
245
|
+
* @param options Settings for the embedded listbox
|
|
246
|
+
*/
|
|
247
|
+
mount(element: HTMLElement, options?: {
|
|
248
|
+
title?: string;
|
|
249
|
+
direction?: string;
|
|
250
|
+
listLayout?: string;
|
|
251
|
+
search?: boolean;
|
|
252
|
+
toolbar?: boolean;
|
|
253
|
+
checkboxes?: boolean;
|
|
254
|
+
rangeSelect?: boolean;
|
|
255
|
+
dense?: boolean;
|
|
256
|
+
stateName?: boolean;
|
|
257
|
+
properties?: object;
|
|
258
|
+
sessionModel?: object;
|
|
259
|
+
selectionsApi?: object;
|
|
260
|
+
update?: stardust.ReceiverFunction;
|
|
261
|
+
}): void;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Unmounts the field listbox from the DOM.
|
|
265
|
+
*/
|
|
266
|
+
unmount(): void;
|
|
267
|
+
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
type ThemeJSON = any;
|
|
271
|
+
|
|
272
|
+
interface ThemeInfo {
|
|
273
|
+
id: string;
|
|
274
|
+
/**
|
|
275
|
+
* A function that should return a Promise that resolves to a raw JSON theme.
|
|
276
|
+
*/
|
|
277
|
+
load(): Promise<stardust.ThemeJSON>;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* A controller to further modify a visualization after it has been rendered.
|
|
282
|
+
*/
|
|
283
|
+
class Viz {
|
|
284
|
+
constructor();
|
|
285
|
+
|
|
286
|
+
id: string;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Destroys the visualization and removes it from the the DOM.
|
|
290
|
+
*/
|
|
291
|
+
destroy(): void;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Converts the visualization to a different registered type
|
|
295
|
+
* @param newType Which registered type to convert to.
|
|
296
|
+
* @param forceUpdate Whether to run setProperties or not, defaults to true.
|
|
297
|
+
*/
|
|
298
|
+
convertTo(newType: string, forceUpdate?: boolean): Promise<object>;
|
|
299
|
+
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
interface Flags {
|
|
303
|
+
/**
|
|
304
|
+
* Checks whether the specified flag is enabled.
|
|
305
|
+
* @param flag The value flag to check.
|
|
306
|
+
*/
|
|
307
|
+
isEnabled(flag: string): boolean;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
class AppSelections {
|
|
311
|
+
constructor();
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Mounts the app selection UI into the provided HTMLElement.
|
|
315
|
+
* @param element
|
|
316
|
+
*/
|
|
317
|
+
mount(element: HTMLElement): void;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Unmounts the app selection UI from the DOM.
|
|
321
|
+
*/
|
|
322
|
+
unmount(): void;
|
|
323
|
+
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
class ObjectSelections {
|
|
327
|
+
constructor();
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* @param paths
|
|
331
|
+
*/
|
|
332
|
+
begin(paths: string[]): Promise<undefined>;
|
|
333
|
+
|
|
334
|
+
clear(): Promise<undefined>;
|
|
335
|
+
|
|
336
|
+
confirm(): Promise<undefined>;
|
|
337
|
+
|
|
338
|
+
cancel(): Promise<undefined>;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* @param s
|
|
342
|
+
*/
|
|
343
|
+
select(s: {
|
|
344
|
+
method: string;
|
|
345
|
+
params: any[];
|
|
346
|
+
}): Promise<boolean>;
|
|
347
|
+
|
|
348
|
+
canClear(): boolean;
|
|
349
|
+
|
|
350
|
+
canConfirm(): boolean;
|
|
351
|
+
|
|
352
|
+
canCancel(): boolean;
|
|
353
|
+
|
|
354
|
+
isActive(): boolean;
|
|
355
|
+
|
|
356
|
+
isModal(): boolean;
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* @param paths
|
|
360
|
+
*/
|
|
361
|
+
goModal(paths: string[]): Promise<undefined>;
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* @param accept
|
|
365
|
+
*/
|
|
366
|
+
noModal(accept?: boolean): Promise<undefined>;
|
|
367
|
+
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
type Field = string | EngineAPI.INxDimension | EngineAPI.INxMeasure | stardust.LibraryField;
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Rendering configuration for creating and rendering a new object
|
|
374
|
+
*/
|
|
375
|
+
interface CreateConfig extends stardust.BaseConfig{
|
|
376
|
+
type: string;
|
|
377
|
+
version?: string;
|
|
378
|
+
fields?: stardust.Field[];
|
|
379
|
+
properties?: EngineAPI.IGenericObjectProperties;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Basic rendering configuration for rendering an object
|
|
384
|
+
*/
|
|
385
|
+
interface BaseConfig {
|
|
386
|
+
element: HTMLElement;
|
|
387
|
+
options?: object;
|
|
388
|
+
plugins?: stardust.Plugin[];
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Rendering configuration for rendering an existing object
|
|
393
|
+
*/
|
|
394
|
+
interface GetConfig extends stardust.BaseConfig{
|
|
395
|
+
id: string;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
interface LibraryField {
|
|
399
|
+
qLibraryId: string;
|
|
400
|
+
type: "dimension" | "measure";
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* An object literal containing meta information about the plugin and a function containing the plugin implementation.
|
|
405
|
+
*/
|
|
406
|
+
interface Plugin {
|
|
407
|
+
info: {
|
|
408
|
+
name: string;
|
|
409
|
+
};
|
|
410
|
+
fn: ()=>void;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
interface LoadType {
|
|
414
|
+
(type: {
|
|
415
|
+
name: string;
|
|
416
|
+
version: string;
|
|
417
|
+
}): Promise<stardust.Visualization>;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
interface TypeInfo {
|
|
421
|
+
name: string;
|
|
422
|
+
version?: string;
|
|
423
|
+
load: stardust.LoadType;
|
|
424
|
+
meta?: object;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
type Range = {
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
type Segment = {
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
type getSegmentsFromRange = (label: string, range: stardust.Range, startIndex?: number)=>stardust.Segment[];
|
|
434
|
+
|
|
435
|
+
type MinMaxResult = {
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* Returns the min and max indices of elemNumbersOrdered which contains
|
|
440
|
+
* all numbers in elementNbrs.
|
|
441
|
+
*/
|
|
442
|
+
type getMinMax = (elementNbrs: number[], elemNumbersOrdered: number[])=>stardust.MinMaxResult;
|
|
443
|
+
|
|
444
|
+
interface ActionToolbarElement extends HTMLElement{
|
|
445
|
+
className: "njs-action-toolbar-popover";
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
interface ActionElement extends HTMLElement{
|
|
449
|
+
className: "njs-cell-action";
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
interface CellElement extends HTMLElement{
|
|
453
|
+
className: "njs-cell";
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
interface CellFooter extends HTMLElement{
|
|
457
|
+
className: "njs-cell-footer";
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
interface CellTitle extends HTMLElement{
|
|
461
|
+
className: "njs-cell-title";
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
interface CellSubTitle extends HTMLElement{
|
|
465
|
+
className: "njs-cell-sub-title";
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
interface VizElementAttributes extends NamedNodeMap{
|
|
469
|
+
"data-render-count": string;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
interface VizElement extends HTMLElement{
|
|
473
|
+
attributes: stardust.VizElementAttributes;
|
|
474
|
+
className: "njs-viz";
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* The entry point for defining a visualization.
|
|
479
|
+
*/
|
|
480
|
+
interface Visualization {
|
|
481
|
+
(galaxy: stardust.Galaxy): stardust.VisualizationDefinition;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
interface VisualizationDefinition {
|
|
485
|
+
qae: stardust.QAEDefinition;
|
|
486
|
+
component(): void;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
interface SetStateFn<S> {
|
|
490
|
+
(newState: S | (($: S)=>S)): void;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
type EffectCallback = ()=>void | (()=>void);
|
|
494
|
+
|
|
495
|
+
interface Rect {
|
|
496
|
+
top: number;
|
|
497
|
+
left: number;
|
|
498
|
+
width: number;
|
|
499
|
+
height: number;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
interface ActionDefinition<A> {
|
|
503
|
+
action: A;
|
|
504
|
+
hidden?: boolean;
|
|
505
|
+
disabled?: boolean;
|
|
506
|
+
icon?: {
|
|
507
|
+
viewBox?: string;
|
|
508
|
+
shapes: {
|
|
509
|
+
}[];
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
interface Constraints {
|
|
514
|
+
passive?: boolean;
|
|
515
|
+
active?: boolean;
|
|
516
|
+
select?: boolean;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
interface RenderState {
|
|
520
|
+
pending: any;
|
|
521
|
+
restore: any;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
interface Keyboard {
|
|
525
|
+
enabled: boolean;
|
|
526
|
+
active: boolean;
|
|
527
|
+
/**
|
|
528
|
+
* Function used by the visualization to tell Nebula to it wants to relinquish focus
|
|
529
|
+
*/
|
|
530
|
+
blur?(): void;
|
|
531
|
+
/**
|
|
532
|
+
* Function used by the visualization to tell Nebula to it wants focus
|
|
533
|
+
*/
|
|
534
|
+
focus?(): void;
|
|
535
|
+
/**
|
|
536
|
+
* Function used by the visualization to tell Nebula to focus the selection toolbar
|
|
537
|
+
*/
|
|
538
|
+
focusSelection?(): void;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* Imports properties for a chart with a hypercube.
|
|
543
|
+
*/
|
|
544
|
+
type importProperties = (args: {
|
|
545
|
+
exportFormat: stardust.ExportFormat;
|
|
546
|
+
initialProperties?: Object;
|
|
547
|
+
dataDefinition?: Object;
|
|
548
|
+
defaultPropertyValues?: Object;
|
|
549
|
+
hypercubePath: string;
|
|
550
|
+
})=>Object;
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Exports properties for a chart with a hypercube.
|
|
554
|
+
*/
|
|
555
|
+
type exportProperties = (args: {
|
|
556
|
+
propertyTree: Object;
|
|
557
|
+
hypercubePath: string;
|
|
558
|
+
})=>stardust.ExportFormat;
|
|
559
|
+
|
|
560
|
+
interface QAEDefinition {
|
|
561
|
+
properties?: EngineAPI.IGenericObjectProperties;
|
|
562
|
+
data?: {
|
|
563
|
+
targets: stardust.DataTarget[];
|
|
564
|
+
};
|
|
565
|
+
importProperties?: stardust.importProperties;
|
|
566
|
+
exportProperties?: stardust.exportProperties;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
interface DataTarget {
|
|
570
|
+
path: string;
|
|
571
|
+
dimensions?: stardust.FieldTarget<EngineAPI.INxDimension>;
|
|
572
|
+
measures?: stardust.FieldTarget<EngineAPI.INxMeasure>;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
type fieldTargetAddedCallback<T> = (field: T, properties: EngineAPI.IGenericObjectProperties)=>void;
|
|
576
|
+
|
|
577
|
+
type fieldTargetRemovedCallback<T> = (field: T, properties: EngineAPI.IGenericObjectProperties, index: number)=>void;
|
|
578
|
+
|
|
579
|
+
interface FieldTarget<T> {
|
|
580
|
+
min?(): number;
|
|
581
|
+
max?(): number;
|
|
582
|
+
added?: stardust.fieldTargetAddedCallback<T>;
|
|
583
|
+
removed?: stardust.fieldTargetRemovedCallback<T>;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
class Translator {
|
|
587
|
+
constructor();
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Registers a string in multiple locales
|
|
591
|
+
* @param item
|
|
592
|
+
*/
|
|
593
|
+
add(item: {
|
|
594
|
+
id: string;
|
|
595
|
+
locale: object;
|
|
596
|
+
}): void;
|
|
597
|
+
|
|
598
|
+
/**
|
|
599
|
+
* Translates a string for current locale.
|
|
600
|
+
* @param str ID of the registered string.
|
|
601
|
+
* @param args Values passed down for string interpolation.
|
|
602
|
+
*/
|
|
603
|
+
get(str: string, args?: string[]): string;
|
|
604
|
+
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
class Theme {
|
|
608
|
+
constructor();
|
|
609
|
+
|
|
610
|
+
getDataColorScales(): stardust.Theme.ScalePalette[];
|
|
611
|
+
|
|
612
|
+
getDataColorPalettes(): stardust.Theme.DataPalette[];
|
|
613
|
+
|
|
614
|
+
getDataColorPickerPalettes(): stardust.Theme.ColorPickerPalette[];
|
|
615
|
+
|
|
616
|
+
getDataColorSpecials(): stardust.Theme.DataColorSpecials;
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* Resolve a color object using the color picker palette from the provided JSON theme.
|
|
620
|
+
* @param c
|
|
621
|
+
*/
|
|
622
|
+
getColorPickerColor(c: {
|
|
623
|
+
index?: number;
|
|
624
|
+
color?: string;
|
|
625
|
+
}): string;
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* Get the best contrasting color against the specified `color`.
|
|
629
|
+
* This is typically used to find a suitable text color for a label placed on an arbitrarily colored background.
|
|
630
|
+
*
|
|
631
|
+
* The returned colors are derived from the theme.
|
|
632
|
+
* @param color A color to measure the contrast against
|
|
633
|
+
*/
|
|
634
|
+
getContrastingColorTo(color: string): string;
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* Get the value of a style attribute in the theme by searching in the theme's JSON structure.
|
|
638
|
+
* The search starts at the specified base path and continues upwards until the value is found.
|
|
639
|
+
* If possible it will get the attribute's value using the given path.
|
|
640
|
+
* @param basePath Base path in the theme's JSON structure to start the search in (specified as a name path separated by dots).
|
|
641
|
+
* @param path Expected path for the attribute (specified as a name path separated by dots).
|
|
642
|
+
* @param attribute Name of the style attribute.
|
|
643
|
+
*/
|
|
644
|
+
getStyle(basePath: string, path: string, attribute: string): string;
|
|
645
|
+
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
namespace Theme {
|
|
649
|
+
interface ScalePalette {
|
|
650
|
+
key: string;
|
|
651
|
+
type: "gradient" | "class-pyramid";
|
|
652
|
+
colors: string[] | (string[])[];
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
interface DataPalette {
|
|
656
|
+
key: string;
|
|
657
|
+
type: "pyramid" | "row";
|
|
658
|
+
colors: string[] | (string[])[];
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
interface ColorPickerPalette {
|
|
662
|
+
key: string;
|
|
663
|
+
colors: string[];
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
interface DataColorSpecials {
|
|
667
|
+
primary: string;
|
|
668
|
+
nil: string;
|
|
669
|
+
others: string;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* Used for exporting and importing properties between backend models. An object that exports to
|
|
676
|
+
* ExportFormat should put dimensions and measures inside one data group. If an object has two hypercubes,
|
|
677
|
+
* each of the cubes should export dimensions and measures in two separate data groups.
|
|
678
|
+
* An object that imports from this structure is responsible for putting the existing properties where they should be
|
|
679
|
+
* in the new model.
|
|
680
|
+
*/
|
|
681
|
+
interface ExportFormat {
|
|
682
|
+
data?: stardust.ExportDataDef[];
|
|
683
|
+
properties?: object;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
interface ExportDataDef {
|
|
687
|
+
dimensions: EngineAPI.INxDimension[];
|
|
688
|
+
measures: EngineAPI.INxMeasure[];
|
|
689
|
+
excludedDimensions: EngineAPI.INxDimension[];
|
|
690
|
+
excludedMeasures: EngineAPI.INxMeasure[];
|
|
691
|
+
interColumnSortOrder: number[];
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
interface ConversionType {
|
|
695
|
+
importProperties: stardust.importProperties;
|
|
696
|
+
exportProperties: stardust.exportProperties;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* Provides conversion functionality to extensions.
|
|
701
|
+
*/
|
|
702
|
+
interface Conversion {
|
|
703
|
+
hypercube: stardust.hyperCubeConversion;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
interface hyperCubeConversion {
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
}
|
|
710
|
+
|