@sisense/sdk-ui-angular 2.17.0 → 2.18.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/dist/esm2020/lib/components/charts/pivot-table.component.mjs +21 -3
- package/dist/esm2020/lib/components/widgets/pivot-table-widget.component.mjs +24 -3
- package/dist/esm2020/lib/components/widgets/widget.component.mjs +1 -1
- package/dist/esm2020/lib/decorators/decorators.module.mjs +2 -2
- package/dist/esm2020/lib/helpers/dashboard-props-preact-translator.mjs +1 -1
- package/dist/esm2020/lib/helpers/widget-props-preact-translator.mjs +5 -2
- package/dist/esm2020/lib/sdk-ui-core-exports.mjs +1 -1
- package/dist/esm2020/lib/services/dashboard.service.mjs +18 -6
- package/dist/esm2020/lib/services/widget.service.mjs +146 -6
- package/dist/esm2020/lib/types/chart-event-props.mjs +1 -1
- package/dist/esm2020/lib/types/data-point.mjs +1 -1
- package/dist/esm2020/lib/utilities/widget-model-translator.mjs +52 -1
- package/dist/esm2020/public-api.mjs +1 -1
- package/dist/esm2020/version.mjs +2 -2
- package/dist/fesm2015/sisense-sdk-ui-angular.mjs +1566 -1324
- package/dist/fesm2015/sisense-sdk-ui-angular.mjs.map +1 -1
- package/dist/fesm2020/sisense-sdk-ui-angular.mjs +1372 -1130
- package/dist/fesm2020/sisense-sdk-ui-angular.mjs.map +1 -1
- package/dist/lib/components/charts/pivot-table.component.d.ts +16 -3
- package/dist/lib/components/widgets/pivot-table-widget.component.d.ts +22 -3
- package/dist/lib/components/widgets/widget.component.d.ts +8 -4
- package/dist/lib/decorators/decorators.module.d.ts +1 -1
- package/dist/lib/helpers/dashboard-props-preact-translator.d.ts +1 -1
- package/dist/lib/helpers/widget-props-preact-translator.d.ts +1 -1
- package/dist/lib/sdk-ui-core-exports.d.ts +1 -1
- package/dist/lib/services/dashboard.service.d.ts +13 -5
- package/dist/lib/services/widget.service.d.ts +100 -2
- package/dist/lib/types/chart-event-props.d.ts +15 -1
- package/dist/lib/types/data-point.d.ts +13 -2
- package/dist/lib/utilities/widget-model-translator.d.ts +50 -1
- package/dist/package.json +1 -1
- package/dist/public-api.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Injectable, Optional, Inject,
|
|
3
|
-
import { DataObserver, CustomThemeProvider, CustomSisenseContextProvider, CustomWidgetsProviderAdapter, createClientApplication, TabberButtonsWidget, createWrapperElement, getDashboardModel, getDashboardModels, HookAdapter, useComposedDashboardInternal, createHookApiFacade, useGetFilterMembers, getHierarchyModels, executeQuery, executeQueryByWidgetId, executePivotQuery, useExecuteCsvQueryInternal, useExecuteCustomWidgetQueryInternal, getWidgetModel,
|
|
2
|
+
import { InjectionToken, Injectable, Optional, Inject, NgModule, EventEmitter, Component, ViewChild, Input, Output, createComponent } from '@angular/core';
|
|
3
|
+
import { DataObserver, CustomThemeProvider, CustomSisenseContextProvider, CustomWidgetsProviderAdapter, createClientApplication, getDefaultThemeSettings, getThemeSettingsByOid, ComponentAdapter, Chart, TabberButtonsWidget, createWrapperElement, getDashboardModel, getDashboardModels, HookAdapter, useComposedDashboardInternal, createHookApiFacade, useGetFilterMembers, getHierarchyModels, executeQuery, executeQueryByWidgetId, executePivotQuery, useExecuteCsvQueryInternal, useExecuteCustomWidgetQueryInternal, getWidgetModel, useJtdWidget, PivotTable, Table, ContextMenu, Dashboard, DashboardById, DrilldownBreadcrumbs, CriteriaFilterTile, DateRangeFilterTile, FilterTile, FiltersPanel, MemberFilterTile, RelativeDateFilterTile, ChartWidget, DrilldownWidget, createWrapperElementHandler, createComponentRenderer, PivotTableWidget, TableWidget, Widget, WidgetById, dashboardModelTranslator as dashboardModelTranslator$1, dashboardHelpers as dashboardHelpers$1, widgetModelTranslator as widgetModelTranslator$1 } from '@sisense/sdk-ui-preact';
|
|
4
4
|
export { boxWhiskerProcessResult, extractDimensionsAndMeasures } from '@sisense/sdk-ui-preact';
|
|
5
|
-
import { __awaiter,
|
|
5
|
+
import { __awaiter, __decorate, __rest } from 'tslib';
|
|
6
6
|
import { ReplaySubject, firstValueFrom, concat, of, BehaviorSubject, skip } from 'rxjs';
|
|
7
7
|
import merge from 'ts-deepmerge';
|
|
8
8
|
import { trackProductEvent } from '@sisense/sdk-tracking';
|
|
@@ -287,884 +287,622 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
287
287
|
}] }];
|
|
288
288
|
} });
|
|
289
289
|
|
|
290
|
-
var packageVersion = '2.
|
|
290
|
+
var packageVersion = '2.18.1';
|
|
291
291
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
* @internal
|
|
296
|
-
*/
|
|
297
|
-
class DynamicRenderer {
|
|
298
|
-
constructor(appRef, injector, envInjector) {
|
|
299
|
-
this.appRef = appRef;
|
|
300
|
-
this.injector = injector;
|
|
301
|
-
this.envInjector = envInjector;
|
|
302
|
-
}
|
|
303
|
-
renderComponent(component, props) {
|
|
304
|
-
const componentRef = createComponent(component, {
|
|
305
|
-
environmentInjector: this.envInjector,
|
|
306
|
-
elementInjector: this.injector,
|
|
307
|
-
});
|
|
308
|
-
// Apply props to the component instance
|
|
309
|
-
Object.assign(componentRef.instance, props);
|
|
310
|
-
// Attach the component to the application
|
|
311
|
-
this.appRef.attachView(componentRef.hostView);
|
|
312
|
-
// Get the DOM element
|
|
313
|
-
const domElem = componentRef.hostView.rootNodes[0];
|
|
314
|
-
// Create destroy function
|
|
315
|
-
const destroy = () => {
|
|
316
|
-
// Detach from application
|
|
317
|
-
this.appRef.detachView(componentRef.hostView);
|
|
318
|
-
// Destroy the component
|
|
319
|
-
componentRef.destroy();
|
|
320
|
-
};
|
|
321
|
-
return {
|
|
322
|
-
element: domElem,
|
|
323
|
-
componentRef,
|
|
324
|
-
destroy,
|
|
325
|
-
};
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
DynamicRenderer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DynamicRenderer, deps: [{ token: i0.ApplicationRef }, { token: i0.Injector }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
329
|
-
DynamicRenderer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DynamicRenderer, providedIn: 'root' });
|
|
330
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DynamicRenderer, decorators: [{
|
|
331
|
-
type: Injectable,
|
|
332
|
-
args: [{ providedIn: 'root' }]
|
|
333
|
-
}], ctorParameters: function () { return [{ type: i0.ApplicationRef }, { type: i0.Injector }, { type: i0.EnvironmentInjector }]; } });
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* Service for working with custom widgets.
|
|
337
|
-
*
|
|
338
|
-
* @group Dashboards
|
|
339
|
-
*/
|
|
340
|
-
class CustomWidgetsService {
|
|
341
|
-
constructor(
|
|
342
|
-
/** @internal */
|
|
343
|
-
dynamicRenderer) {
|
|
344
|
-
this.dynamicRenderer = dynamicRenderer;
|
|
345
|
-
this.customWidgetsMap$ = new BehaviorSubject(new Map([['tabber-buttons', TabberButtonsWidget]]));
|
|
346
|
-
}
|
|
347
|
-
/**
|
|
348
|
-
* Registers a new custom widget.
|
|
349
|
-
*
|
|
350
|
-
* @param customWidgetType - The unique identifier for the custom widget type.
|
|
351
|
-
* @param customWidget - The custom widget component class to register.
|
|
352
|
-
*/
|
|
353
|
-
registerCustomWidget(customWidgetType, customWidget) {
|
|
354
|
-
const customWidgetPreactComponent = (props) => {
|
|
355
|
-
const renderedComponent = this.dynamicRenderer.renderComponent(customWidget, props);
|
|
356
|
-
return createWrapperElement(renderedComponent.element, () => renderedComponent.destroy());
|
|
357
|
-
};
|
|
358
|
-
const customWidgetsMap = this.customWidgetsMap$.value;
|
|
359
|
-
if (!customWidgetsMap.has(customWidgetType)) {
|
|
360
|
-
customWidgetsMap.set(customWidgetType, customWidgetPreactComponent);
|
|
361
|
-
this.customWidgetsMap$.next(customWidgetsMap);
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
/**
|
|
365
|
-
* Checks if a custom widget is registered.
|
|
366
|
-
*
|
|
367
|
-
* @param customWidgetType - The type of the custom widget.
|
|
368
|
-
* @returns True if the custom widget is registered, false otherwise.
|
|
369
|
-
*/
|
|
370
|
-
hasCustomWidget(customWidgetType) {
|
|
371
|
-
return this.customWidgetsMap$.value.has(customWidgetType);
|
|
292
|
+
class DecoratorsModule {
|
|
293
|
+
constructor(sisenseContextService) {
|
|
294
|
+
DecoratorsModule.sisenseContextService = sisenseContextService;
|
|
372
295
|
}
|
|
373
296
|
}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
i0.ɵɵ
|
|
377
|
-
|
|
297
|
+
DecoratorsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DecoratorsModule, deps: [{ token: SisenseContextService }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
298
|
+
DecoratorsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: DecoratorsModule });
|
|
299
|
+
DecoratorsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DecoratorsModule });
|
|
300
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DecoratorsModule, decorators: [{
|
|
301
|
+
type: NgModule,
|
|
378
302
|
args: [{
|
|
379
|
-
|
|
303
|
+
declarations: [],
|
|
304
|
+
exports: [],
|
|
380
305
|
}]
|
|
381
|
-
}], ctorParameters: function () { return [{ type:
|
|
306
|
+
}], ctorParameters: function () { return [{ type: SisenseContextService }]; } });
|
|
382
307
|
|
|
383
|
-
function
|
|
384
|
-
const
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
: undefined, onDataPointContextMenu: dataPointContextMenu
|
|
391
|
-
? (...[point, nativeEvent]) => dataPointContextMenu({ point, nativeEvent })
|
|
392
|
-
: undefined, onDataPointsSelected: dataPointsSelect
|
|
393
|
-
? (...[points, nativeEvent]) => dataPointsSelect({ points, nativeEvent })
|
|
394
|
-
: undefined });
|
|
395
|
-
}
|
|
396
|
-
function translateFromPreactWidgetProps(widgetProps) {
|
|
397
|
-
const { onBeforeRender, onDataReady, onBeforeMenuOpen, onDataPointClick, onDataPointContextMenu, onDataPointsSelected } = widgetProps, commonWidgetProps = __rest(widgetProps, ["onBeforeRender", "onDataReady", "onBeforeMenuOpen", "onDataPointClick", "onDataPointContextMenu", "onDataPointsSelected"]);
|
|
398
|
-
return Object.assign(Object.assign({}, commonWidgetProps), { beforeRender: onBeforeRender, dataReady: onDataReady, beforeMenuOpen: onBeforeMenuOpen, dataPointClick: onDataPointClick
|
|
399
|
-
? ({ point, nativeEvent }) => onDataPointClick(point, nativeEvent)
|
|
400
|
-
: undefined, dataPointContextMenu: onDataPointContextMenu
|
|
401
|
-
? ({ point, nativeEvent }) => onDataPointContextMenu(point, nativeEvent)
|
|
402
|
-
: undefined, dataPointsSelect: onDataPointsSelected
|
|
403
|
-
? ({ points, nativeEvent }) => onDataPointsSelected(points, nativeEvent)
|
|
404
|
-
: undefined });
|
|
308
|
+
function Trackable(target, propertyKey, descriptor) {
|
|
309
|
+
const originalMethod = descriptor.value;
|
|
310
|
+
descriptor.value = function (...args) {
|
|
311
|
+
track('sdkAngularServiceMethodExecuted', propertyKey);
|
|
312
|
+
return originalMethod.apply(this, args);
|
|
313
|
+
};
|
|
314
|
+
return descriptor;
|
|
405
315
|
}
|
|
406
|
-
|
|
407
|
-
function
|
|
408
|
-
return
|
|
316
|
+
/** @internal */
|
|
317
|
+
function TrackableService(trackableMethods) {
|
|
318
|
+
return function (ServiceClass) {
|
|
319
|
+
trackableMethods.forEach((methodName) => {
|
|
320
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
321
|
+
const original = ServiceClass.prototype[methodName];
|
|
322
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
323
|
+
ServiceClass.prototype[methodName] = function (...params) {
|
|
324
|
+
track('sdkAngularServiceMethodExecuted', `${ServiceClass.name}.${methodName}`);
|
|
325
|
+
return original.apply(this, params);
|
|
326
|
+
};
|
|
327
|
+
});
|
|
328
|
+
};
|
|
409
329
|
}
|
|
410
|
-
function
|
|
411
|
-
|
|
330
|
+
function track(action, methodName) {
|
|
331
|
+
var _a, _b, _c;
|
|
332
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
333
|
+
try {
|
|
334
|
+
const app = yield DecoratorsModule.sisenseContextService.getApp();
|
|
335
|
+
const trackingEnabled = (_c = (_b = (_a = app.settings) === null || _a === void 0 ? void 0 : _a.trackingConfig) === null || _b === void 0 ? void 0 : _b.enabled) !== null && _c !== void 0 ? _c : true;
|
|
336
|
+
if (app === null || app === void 0 ? void 0 : app.httpClient) {
|
|
337
|
+
const payload = {
|
|
338
|
+
packageName: 'sdk-ui-angular',
|
|
339
|
+
packageVersion,
|
|
340
|
+
methodName,
|
|
341
|
+
};
|
|
342
|
+
void trackProductEvent(action, payload, app.httpClient, !trackingEnabled);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
catch (e) {
|
|
346
|
+
console.warn('tracking error', e);
|
|
347
|
+
}
|
|
348
|
+
});
|
|
412
349
|
}
|
|
413
350
|
|
|
414
351
|
/**
|
|
415
|
-
*
|
|
352
|
+
* Token used to inject {@link ThemeConfig} into your application
|
|
416
353
|
*
|
|
417
|
-
*
|
|
354
|
+
* @example
|
|
418
355
|
*
|
|
419
|
-
* @
|
|
420
|
-
*
|
|
356
|
+
* Example of injecting both {@link SisenseContextConfig} and {@link ThemeConfig} into your application:
|
|
357
|
+
*
|
|
358
|
+
* ```ts
|
|
359
|
+
* export const SISENSE_CONTEXT_CONFIG: SisenseContextConfig = {
|
|
360
|
+
* url: "<instance url>", // replace with the URL of your Sisense instance
|
|
361
|
+
* token: "<api token>", // replace with the API token of your user account
|
|
362
|
+
* defaultDataSource: DM.DataSource,
|
|
363
|
+
* };
|
|
364
|
+
*
|
|
365
|
+
* @NgModule({
|
|
366
|
+
* imports: [
|
|
367
|
+
* BrowserModule,
|
|
368
|
+
* SdkUiModule,
|
|
369
|
+
* ],
|
|
370
|
+
* declarations: [AppComponent],
|
|
371
|
+
* providers: [
|
|
372
|
+
* { provide: SISENSE_CONTEXT_CONFIG_TOKEN, useValue: SISENSE_CONTEXT_CONFIG },
|
|
373
|
+
* {
|
|
374
|
+
* provide: THEME_CONFIG_TOKEN,
|
|
375
|
+
* useValue: {
|
|
376
|
+
* // initial theme settings
|
|
377
|
+
* } as ThemeConfig,
|
|
378
|
+
* },
|
|
379
|
+
* ],
|
|
380
|
+
* bootstrap: [AppComponent],
|
|
381
|
+
* })
|
|
382
|
+
* ```
|
|
383
|
+
* @group Contexts
|
|
421
384
|
*/
|
|
422
|
-
|
|
423
|
-
|
|
385
|
+
const THEME_CONFIG_TOKEN = new InjectionToken('theme configuration');
|
|
386
|
+
/**
|
|
387
|
+
* Service for working with Sisense Fusion themes.
|
|
388
|
+
*
|
|
389
|
+
* If no theme service is used, the current Fusion theme is applied by default.
|
|
390
|
+
*
|
|
391
|
+
* @group Contexts
|
|
392
|
+
*/
|
|
393
|
+
let ThemeService = class ThemeService {
|
|
394
|
+
constructor(sisenseContextService, themeConfig) {
|
|
424
395
|
this.sisenseContextService = sisenseContextService;
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
396
|
+
this.initializationPromise = Promise.resolve();
|
|
397
|
+
this.themeSettings$ = new BehaviorSubject(getDefaultThemeSettings());
|
|
398
|
+
this.initializationPromise = this.initThemeSettings(themeConfig === null || themeConfig === void 0 ? void 0 : themeConfig.theme);
|
|
399
|
+
this.sisenseContextService
|
|
400
|
+
.getApp$()
|
|
401
|
+
// Skip current app value
|
|
402
|
+
.pipe(skip(1))
|
|
403
|
+
// Subscribe to new app values
|
|
404
|
+
.subscribe({
|
|
405
|
+
next: ({ app }) => {
|
|
406
|
+
if (app) {
|
|
407
|
+
this.initializationPromise = this.applyThemeSettings(app.settings.serverThemeSettings);
|
|
408
|
+
}
|
|
409
|
+
},
|
|
437
410
|
});
|
|
438
411
|
}
|
|
439
|
-
|
|
440
|
-
* Retrieves existing dashboard models from the Sisense instance.
|
|
441
|
-
*
|
|
442
|
-
* @param options - Advanced configuration options
|
|
443
|
-
* @returns Dashboard models array
|
|
444
|
-
*/
|
|
445
|
-
getDashboardModels(options) {
|
|
412
|
+
initThemeSettings(theme) {
|
|
446
413
|
return __awaiter(this, void 0, void 0, function* () {
|
|
447
414
|
const app = yield this.sisenseContextService.getApp();
|
|
448
|
-
|
|
415
|
+
// apply system theme settings first
|
|
416
|
+
yield this.applyThemeSettings(app.settings.serverThemeSettings);
|
|
417
|
+
if (theme) {
|
|
418
|
+
// Manually tracks theme update during initialization as execution of updateThemeSettings for consistency.
|
|
419
|
+
track('sdkAngularServiceMethodExecuted', 'ThemeService.updateThemeSettings');
|
|
420
|
+
yield this.applyThemeSettings(theme);
|
|
421
|
+
}
|
|
449
422
|
});
|
|
450
423
|
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
[id]="widget.id"
|
|
467
|
-
[widgetType]="widget.widgetType"
|
|
468
|
-
[chartType]="widget.chartType"
|
|
469
|
-
[customWidgetType]="widget.customWidgetType"
|
|
470
|
-
[dataSource]="widget.dataSource"
|
|
471
|
-
[dataOptions]="widget.dataOptions"
|
|
472
|
-
[filters]="widget.filters"
|
|
473
|
-
[highlights]="widget.highlights"
|
|
474
|
-
[styleOptions]="widget.styleOptions"
|
|
475
|
-
[drilldownOptions]="widget.drilldownOptions"
|
|
476
|
-
[title]="widget.title"
|
|
477
|
-
[description]="widget.description"
|
|
478
|
-
[beforeMenuOpen]="widget.beforeMenuOpen"
|
|
479
|
-
(dataPointClick)="widget.dataPointClick?.($event)"
|
|
480
|
-
(dataPointContextMenu)="widget.dataPointContextMenu?.($event)"
|
|
481
|
-
(dataPointsSelect)="widget.dataPointsSelect?.($event)"
|
|
482
|
-
/>
|
|
483
|
-
</div>
|
|
484
|
-
* ```
|
|
485
|
-
*
|
|
486
|
-
* ```ts
|
|
487
|
-
// Component behavior in example.component.ts
|
|
488
|
-
import { Component } from '@angular/core';
|
|
489
|
-
import { BehaviorSubject } from 'rxjs';
|
|
490
|
-
import { DashboardService, type DashboardProps } from '@sisense/sdk-ui-angular';
|
|
491
|
-
|
|
492
|
-
@Component({
|
|
493
|
-
selector: 'example',
|
|
494
|
-
templateUrl: './example.component.html',
|
|
495
|
-
styleUrls: ['./example.component.scss'],
|
|
496
|
-
})
|
|
497
|
-
export class ExampleComponent {
|
|
498
|
-
dashboard$: BehaviorSubject<DashboardProps> | undefined;
|
|
499
|
-
|
|
500
|
-
constructor(private dashboardService: DashboardService) {}
|
|
501
|
-
|
|
502
|
-
ngOnInit() {
|
|
503
|
-
const initialDashboard: DashboardProps = { ... };
|
|
504
|
-
const composedDashboard = this.dashboardService.createComposedDashboard(initialDashboard);
|
|
505
|
-
this.dashboard$ = composedDashboard.dashboard$;
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
trackByIndex = (index: number) => index;
|
|
509
|
-
|
|
510
|
-
getDashboardFilters = ({ filters }: DashboardProps) => Array.isArray(filters) ? filters : [];
|
|
511
|
-
}
|
|
512
|
-
* ```
|
|
513
|
-
* @param initialDashboard - Initial dashboard
|
|
514
|
-
* @param options - Configuration options
|
|
515
|
-
* @returns Reactive composed dashboard object and API methods for interacting with it
|
|
516
|
-
*/
|
|
517
|
-
createComposedDashboard(initialDashboard, options = {}) {
|
|
518
|
-
const hookAdapter = new HookAdapter((useComposedDashboardInternal), [createSisenseContextConnector(this.sisenseContextService)]);
|
|
519
|
-
const dashboard$ = new BehaviorSubject(initialDashboard);
|
|
520
|
-
hookAdapter.subscribe(({ dashboard }) => {
|
|
521
|
-
dashboard$.next(translateFromPreactDashboardProps(dashboard));
|
|
424
|
+
applyThemeSettings(theme) {
|
|
425
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
426
|
+
try {
|
|
427
|
+
const app = yield this.sisenseContextService.getApp();
|
|
428
|
+
const isThemeOid = typeof theme === 'string';
|
|
429
|
+
let userThemeSettings = theme;
|
|
430
|
+
if (isThemeOid) {
|
|
431
|
+
userThemeSettings = yield getThemeSettingsByOid(theme, app.httpClient);
|
|
432
|
+
}
|
|
433
|
+
const mergedThemeSettings = merge.withOptions({ mergeArrays: false }, this.themeSettings$.value, userThemeSettings);
|
|
434
|
+
this.themeSettings$.next(mergedThemeSettings);
|
|
435
|
+
}
|
|
436
|
+
catch (error) {
|
|
437
|
+
this.themeSettings$.error(error);
|
|
438
|
+
}
|
|
522
439
|
});
|
|
523
|
-
hookAdapter.run(translateToPreactDashboardProps(initialDashboard), options);
|
|
524
|
-
const setFilters = createHookApiFacade(hookAdapter, 'setFilters', true);
|
|
525
|
-
const setWidgetsLayout = createHookApiFacade(hookAdapter, 'setWidgetsLayout', true);
|
|
526
|
-
return {
|
|
527
|
-
dashboard$,
|
|
528
|
-
setFilters,
|
|
529
|
-
setWidgetsLayout,
|
|
530
|
-
};
|
|
531
440
|
}
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
DashboardService = __decorate([
|
|
536
|
-
TrackableService(['getDashboardModel', 'getDashboardModels'])
|
|
537
|
-
], DashboardService);
|
|
538
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DashboardService, decorators: [{
|
|
539
|
-
type: Injectable,
|
|
540
|
-
args: [{
|
|
541
|
-
providedIn: 'root',
|
|
542
|
-
}]
|
|
543
|
-
}], ctorParameters: function () { return [{ type: SisenseContextService }]; } });
|
|
544
|
-
|
|
545
|
-
/**
|
|
546
|
-
* Service for working with filter.
|
|
547
|
-
*
|
|
548
|
-
* @group Filters
|
|
549
|
-
*/
|
|
550
|
-
let FilterService = class FilterService {
|
|
551
|
-
constructor(sisenseContextService) {
|
|
552
|
-
this.sisenseContextService = sisenseContextService;
|
|
441
|
+
/** @internal */
|
|
442
|
+
getThemeSettings() {
|
|
443
|
+
return this.themeSettings$.asObservable();
|
|
553
444
|
}
|
|
554
|
-
|
|
555
|
-
* Retrieves members of the provided filter.
|
|
556
|
-
*
|
|
557
|
-
* Those members can be used to display a list of members in a third-party filter component such as Material UI Select.
|
|
558
|
-
*
|
|
559
|
-
* ## Example
|
|
560
|
-
*
|
|
561
|
-
* Retrieve selected members from a Filter on Country of the Sample ECommerce data model.
|
|
562
|
-
*
|
|
563
|
-
* ```ts
|
|
564
|
-
* try {
|
|
565
|
-
* const data = await filterService.getFilterMembers({
|
|
566
|
-
* filter: filterFactory.members(DM.Country.Country, ['United States', 'Canada'])
|
|
567
|
-
* });
|
|
568
|
-
*
|
|
569
|
-
* const { selectedMembers, allMembers, excludeMembers, enableMultiSelection } = data;
|
|
570
|
-
* console.log('selectedMembers', selectedMembers);
|
|
571
|
-
* } catch (error) {
|
|
572
|
-
* console.error('Error:', error);
|
|
573
|
-
* }
|
|
574
|
-
* ```
|
|
575
|
-
*
|
|
576
|
-
* @param params - Parameters for retrieving filter members
|
|
577
|
-
* @returns Promise that resolves to the filter members data
|
|
578
|
-
*/
|
|
579
|
-
getFilterMembers(params) {
|
|
445
|
+
updateThemeSettings(theme) {
|
|
580
446
|
return __awaiter(this, void 0, void 0, function* () {
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
]);
|
|
584
|
-
const resultPromise = new Promise((resolve, reject) => {
|
|
585
|
-
hookAdapter.subscribe((res) => {
|
|
586
|
-
const { isError, isSuccess, error } = res;
|
|
587
|
-
if (isError) {
|
|
588
|
-
reject(error);
|
|
589
|
-
}
|
|
590
|
-
else if (isSuccess) {
|
|
591
|
-
resolve(res.data);
|
|
592
|
-
}
|
|
593
|
-
});
|
|
594
|
-
});
|
|
595
|
-
hookAdapter.run(params);
|
|
596
|
-
return resultPromise.finally(() => {
|
|
597
|
-
hookAdapter.destroy();
|
|
598
|
-
});
|
|
447
|
+
yield this.initializationPromise;
|
|
448
|
+
yield this.applyThemeSettings(theme);
|
|
599
449
|
});
|
|
600
450
|
}
|
|
601
451
|
};
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
TrackableService(['
|
|
606
|
-
],
|
|
607
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type:
|
|
452
|
+
ThemeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ThemeService, deps: [{ token: SisenseContextService }, { token: THEME_CONFIG_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
453
|
+
ThemeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ThemeService, providedIn: 'root' });
|
|
454
|
+
ThemeService = __decorate([
|
|
455
|
+
TrackableService(['updateThemeSettings'])
|
|
456
|
+
], ThemeService);
|
|
457
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ThemeService, decorators: [{
|
|
608
458
|
type: Injectable,
|
|
609
459
|
args: [{
|
|
610
460
|
providedIn: 'root',
|
|
611
461
|
}]
|
|
612
|
-
}], ctorParameters: function () {
|
|
462
|
+
}], ctorParameters: function () {
|
|
463
|
+
return [{ type: SisenseContextService }, { type: undefined, decorators: [{
|
|
464
|
+
type: Optional
|
|
465
|
+
}, {
|
|
466
|
+
type: Inject,
|
|
467
|
+
args: [THEME_CONFIG_TOKEN]
|
|
468
|
+
}] }];
|
|
469
|
+
} });
|
|
613
470
|
|
|
614
471
|
/**
|
|
615
|
-
*
|
|
472
|
+
* An Angular component used for easily switching chart types or rendering multiple series of different chart types.
|
|
616
473
|
*
|
|
617
|
-
* @
|
|
618
|
-
*
|
|
474
|
+
* @example
|
|
475
|
+
* An example of using the `Chart` component to
|
|
476
|
+
* plot a column chart of the Sample Healthcare data source hosted in a Sisense instance:
|
|
477
|
+
*
|
|
478
|
+
* ```html
|
|
479
|
+
* <!--Component HTML template in .component.html-->
|
|
480
|
+
* <csdk-chart
|
|
481
|
+
* [chartType]="chart.chartType"
|
|
482
|
+
* [dataSet]="chart.dataSet"
|
|
483
|
+
* [dataOptions]="chart.dataOptions"
|
|
484
|
+
* [filters]="chart.filters"
|
|
485
|
+
* [styleOptions]="chart.styleOptions"
|
|
486
|
+
* />
|
|
487
|
+
* ```
|
|
488
|
+
*
|
|
489
|
+
* ```ts
|
|
490
|
+
* // Component behavior in .component.ts
|
|
491
|
+
* chart = {
|
|
492
|
+
* chartType: 'column' as ChartType,
|
|
493
|
+
* dataSet: DM.DataSource,
|
|
494
|
+
* dataOptions: {
|
|
495
|
+
* category: [DM.Admissions.Admission_Time.Months],
|
|
496
|
+
* value: [measureFactory.count(DM.Admissions.Patient_ID, 'Total Patients')],
|
|
497
|
+
* breakBy: [],
|
|
498
|
+
* },
|
|
499
|
+
* filters: [filterFactory.members(DM.Doctors.Specialty, ['Oncology', 'Cardiology'])],
|
|
500
|
+
* styleOptions: {
|
|
501
|
+
* width: 800,
|
|
502
|
+
* height: 500,
|
|
503
|
+
* xAxis: {
|
|
504
|
+
* title: {
|
|
505
|
+
* text: 'Months',
|
|
506
|
+
* enabled: true,
|
|
507
|
+
* },
|
|
508
|
+
* },
|
|
509
|
+
* yAxis: {
|
|
510
|
+
* title: {
|
|
511
|
+
* text: 'Total Patients',
|
|
512
|
+
* enabled: true,
|
|
513
|
+
* },
|
|
514
|
+
* },
|
|
515
|
+
* },
|
|
516
|
+
* };
|
|
517
|
+
* ```
|
|
518
|
+
*
|
|
519
|
+
* <img src="media://angular-chart-example.png" width="800px" />
|
|
520
|
+
* @shortDescription Common component for rendering charts of different types including table
|
|
521
|
+
* @group Charts
|
|
619
522
|
*/
|
|
620
|
-
|
|
621
|
-
constructor(sisenseContextService) {
|
|
622
|
-
this.sisenseContextService = sisenseContextService;
|
|
623
|
-
}
|
|
523
|
+
class ChartComponent {
|
|
624
524
|
/**
|
|
625
|
-
*
|
|
525
|
+
* Constructor for the `Chart` component.
|
|
626
526
|
*
|
|
627
|
-
* @param
|
|
628
|
-
* @
|
|
527
|
+
* @param sisenseContextService - Sisense context service
|
|
528
|
+
* @param themeService - Theme service
|
|
629
529
|
*/
|
|
630
|
-
|
|
631
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
632
|
-
const app = yield this.sisenseContextService.getApp();
|
|
633
|
-
return getHierarchyModels(app.httpClient, params, app.defaultDataSource);
|
|
634
|
-
});
|
|
635
|
-
}
|
|
636
|
-
};
|
|
637
|
-
HierarchyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HierarchyService, deps: [{ token: SisenseContextService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
638
|
-
HierarchyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HierarchyService, providedIn: 'root' });
|
|
639
|
-
HierarchyService = __decorate([
|
|
640
|
-
TrackableService(['getHierarchyModels'])
|
|
641
|
-
], HierarchyService);
|
|
642
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HierarchyService, decorators: [{
|
|
643
|
-
type: Injectable,
|
|
644
|
-
args: [{
|
|
645
|
-
providedIn: 'root',
|
|
646
|
-
}]
|
|
647
|
-
}], ctorParameters: function () { return [{ type: SisenseContextService }]; } });
|
|
648
|
-
|
|
649
|
-
/**
|
|
650
|
-
* Service for executing data queries.
|
|
651
|
-
*
|
|
652
|
-
* @group Queries
|
|
653
|
-
*/
|
|
654
|
-
let QueryService = class QueryService {
|
|
655
|
-
constructor(sisenseContextService) {
|
|
656
|
-
this.sisenseContextService = sisenseContextService;
|
|
657
|
-
}
|
|
530
|
+
constructor(
|
|
658
531
|
/**
|
|
659
|
-
*
|
|
660
|
-
* them to populate Compose SDK UI elements or third party UI elements.
|
|
661
|
-
*
|
|
662
|
-
* To learn how to populate third party UI elements with query results, see the
|
|
663
|
-
* [External Charts Guide](/guides/sdk/guides/charts/guide-external-charts.html#query)
|
|
532
|
+
* Sisense context service
|
|
664
533
|
*
|
|
665
|
-
* @
|
|
666
|
-
* @return Query result
|
|
534
|
+
* @category Constructor
|
|
667
535
|
*/
|
|
668
|
-
|
|
669
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
670
|
-
const { dataSource, dimensions, measures, filters, highlights, count, offset, ungroup, beforeQuery, } = params;
|
|
671
|
-
const app = yield this.sisenseContextService.getApp();
|
|
672
|
-
const { filters: filterList, relations: filterRelations } = getFilterListAndRelationsJaql(filters);
|
|
673
|
-
const data = yield executeQuery({
|
|
674
|
-
dataSource,
|
|
675
|
-
dimensions,
|
|
676
|
-
measures,
|
|
677
|
-
filters: filterList,
|
|
678
|
-
filterRelations,
|
|
679
|
-
highlights,
|
|
680
|
-
count,
|
|
681
|
-
offset,
|
|
682
|
-
ungroup,
|
|
683
|
-
}, app, { onBeforeQuery: beforeQuery });
|
|
684
|
-
return { data };
|
|
685
|
-
});
|
|
686
|
-
}
|
|
536
|
+
sisenseContextService,
|
|
687
537
|
/**
|
|
688
|
-
*
|
|
538
|
+
* Theme service
|
|
689
539
|
*
|
|
690
|
-
* @
|
|
691
|
-
* @returns Query result
|
|
540
|
+
* @category Constructor
|
|
692
541
|
*/
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
542
|
+
themeService) {
|
|
543
|
+
this.sisenseContextService = sisenseContextService;
|
|
544
|
+
this.themeService = themeService;
|
|
545
|
+
/**
|
|
546
|
+
* {@inheritDoc @sisense/sdk-ui!ChartProps.onDataPointClick}
|
|
547
|
+
*
|
|
548
|
+
* @category Callbacks
|
|
549
|
+
*/
|
|
550
|
+
this.dataPointClick = new EventEmitter();
|
|
551
|
+
/**
|
|
552
|
+
* {@inheritDoc @sisense/sdk-ui!ChartProps.onDataPointContextMenu}
|
|
553
|
+
*
|
|
554
|
+
* @category Callbacks
|
|
555
|
+
*/
|
|
556
|
+
this.dataPointContextMenu = new EventEmitter();
|
|
557
|
+
/**
|
|
558
|
+
* {@inheritDoc @sisense/sdk-ui!ChartProps.onDataPointsSelected}
|
|
559
|
+
*
|
|
560
|
+
* @category Callbacks
|
|
561
|
+
*/
|
|
562
|
+
this.dataPointsSelect = new EventEmitter();
|
|
563
|
+
this.componentAdapter = new ComponentAdapter(Chart, [
|
|
564
|
+
createSisenseContextConnector(this.sisenseContextService),
|
|
565
|
+
createThemeContextConnector(this.themeService),
|
|
566
|
+
]);
|
|
698
567
|
}
|
|
699
568
|
/**
|
|
700
|
-
*
|
|
701
|
-
*
|
|
702
|
-
* @param params - Pivot query parameters
|
|
703
|
-
* @return Pivot query result
|
|
569
|
+
* @internal
|
|
704
570
|
*/
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
const { dataSource, rows, columns, values, grandTotals, filters, highlights, count, offset, beforeQuery, } = params;
|
|
708
|
-
const { filters: filterList, relations: filterRelations } = getFilterListAndRelationsJaql(filters);
|
|
709
|
-
const app = yield this.sisenseContextService.getApp();
|
|
710
|
-
const data = yield executePivotQuery({
|
|
711
|
-
dataSource,
|
|
712
|
-
rows,
|
|
713
|
-
columns,
|
|
714
|
-
values,
|
|
715
|
-
grandTotals,
|
|
716
|
-
filters: filterList,
|
|
717
|
-
filterRelations,
|
|
718
|
-
highlights,
|
|
719
|
-
count,
|
|
720
|
-
offset,
|
|
721
|
-
}, app, { onBeforeQuery: beforeQuery });
|
|
722
|
-
return { data };
|
|
723
|
-
});
|
|
571
|
+
ngAfterViewInit() {
|
|
572
|
+
this.componentAdapter.render(this.preactRef.nativeElement, this.getPreactComponentProps());
|
|
724
573
|
}
|
|
725
574
|
/**
|
|
726
|
-
*
|
|
727
|
-
* Similar to {@link QueryService.executeQuery}, but returns the data in CSV format as text or as a stream.
|
|
728
|
-
*
|
|
729
|
-
* @param params - CSV query parameters
|
|
730
|
-
* @return CSV query result
|
|
575
|
+
* @internal
|
|
731
576
|
*/
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
});
|
|
577
|
+
ngOnChanges() {
|
|
578
|
+
if (this.preactRef) {
|
|
579
|
+
this.componentAdapter.render(this.preactRef.nativeElement, this.getPreactComponentProps());
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
getPreactComponentProps() {
|
|
583
|
+
var _a, _b;
|
|
584
|
+
return {
|
|
585
|
+
chartType: this.chartType,
|
|
586
|
+
dataSet: this.dataSet,
|
|
587
|
+
dataOptions: this.dataOptions,
|
|
588
|
+
filters: this.filters,
|
|
589
|
+
highlights: this.highlights,
|
|
590
|
+
styleOptions: this.styleOptions,
|
|
591
|
+
onBeforeRender: (_a = this.beforeRender) === null || _a === void 0 ? void 0 : _a.bind(this),
|
|
592
|
+
onDataReady: (_b = this.dataReady) === null || _b === void 0 ? void 0 : _b.bind(this),
|
|
593
|
+
onDataPointClick: (...[point, nativeEvent]) => this.dataPointClick.emit({ point, nativeEvent }),
|
|
594
|
+
onDataPointContextMenu: (...[point, nativeEvent]) => this.dataPointContextMenu.emit({ point, nativeEvent }),
|
|
595
|
+
onDataPointsSelected: (...[points, nativeEvent]) => this.dataPointsSelect.emit({ points, nativeEvent }),
|
|
596
|
+
};
|
|
753
597
|
}
|
|
754
598
|
/**
|
|
755
|
-
*
|
|
756
|
-
*
|
|
757
|
-
* This method takes custom widget props (dataSource, dataOptions, filters, etc.)
|
|
758
|
-
* and executes the appropriate data query
|
|
759
|
-
*
|
|
760
|
-
* @param params - Custom widget component props containing data source, data options, filters, etc.
|
|
761
|
-
* @returns Promise resolving to query result with formatted data
|
|
599
|
+
* @internal
|
|
762
600
|
*/
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
const hookAdapter = new HookAdapter(useExecuteCustomWidgetQueryInternal, [
|
|
766
|
-
createSisenseContextConnector(this.sisenseContextService),
|
|
767
|
-
]);
|
|
768
|
-
const resultPromise = new Promise((resolve, reject) => {
|
|
769
|
-
hookAdapter.subscribe((res) => {
|
|
770
|
-
const { data, isSuccess, isError, error } = res;
|
|
771
|
-
if (isSuccess) {
|
|
772
|
-
resolve({ data });
|
|
773
|
-
}
|
|
774
|
-
else if (isError) {
|
|
775
|
-
reject(error);
|
|
776
|
-
}
|
|
777
|
-
});
|
|
778
|
-
});
|
|
779
|
-
hookAdapter.run(params);
|
|
780
|
-
return resultPromise.finally(() => {
|
|
781
|
-
hookAdapter.destroy();
|
|
782
|
-
});
|
|
783
|
-
});
|
|
601
|
+
ngOnDestroy() {
|
|
602
|
+
this.componentAdapter.destroy();
|
|
784
603
|
}
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
604
|
+
}
|
|
605
|
+
ChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ChartComponent, deps: [{ token: SisenseContextService }, { token: ThemeService }], target: i0.ɵɵFactoryTarget.Component });
|
|
606
|
+
ChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ChartComponent, selector: "csdk-chart", inputs: { chartType: "chartType", dataSet: "dataSet", dataOptions: "dataOptions", filters: "filters", highlights: "highlights", styleOptions: "styleOptions", beforeRender: "beforeRender", dataReady: "dataReady" }, outputs: { dataPointClick: "dataPointClick", dataPointContextMenu: "dataPointContextMenu", dataPointsSelect: "dataPointsSelect" }, viewQueries: [{ propertyName: "preactRef", first: true, predicate: ["preact"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "\n <div #preact class=\"csdk-full-size-container\"></div>\n", isInline: true, styles: [".csdk-full-size-container{width:100%;height:100%}\n"] });
|
|
607
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ChartComponent, decorators: [{
|
|
608
|
+
type: Component,
|
|
609
|
+
args: [{ selector: 'csdk-chart', template: template, styles: [".csdk-full-size-container{width:100%;height:100%}\n"] }]
|
|
610
|
+
}], ctorParameters: function () { return [{ type: SisenseContextService }, { type: ThemeService }]; }, propDecorators: { preactRef: [{
|
|
611
|
+
type: ViewChild,
|
|
612
|
+
args: [rootId]
|
|
613
|
+
}], chartType: [{
|
|
614
|
+
type: Input
|
|
615
|
+
}], dataSet: [{
|
|
616
|
+
type: Input
|
|
617
|
+
}], dataOptions: [{
|
|
618
|
+
type: Input
|
|
619
|
+
}], filters: [{
|
|
620
|
+
type: Input
|
|
621
|
+
}], highlights: [{
|
|
622
|
+
type: Input
|
|
623
|
+
}], styleOptions: [{
|
|
624
|
+
type: Input
|
|
625
|
+
}], beforeRender: [{
|
|
626
|
+
type: Input
|
|
627
|
+
}], dataReady: [{
|
|
628
|
+
type: Input
|
|
629
|
+
}], dataPointClick: [{
|
|
630
|
+
type: Output
|
|
631
|
+
}], dataPointContextMenu: [{
|
|
632
|
+
type: Output
|
|
633
|
+
}], dataPointsSelect: [{
|
|
634
|
+
type: Output
|
|
635
|
+
}] } });
|
|
802
636
|
|
|
803
637
|
/**
|
|
804
|
-
*
|
|
638
|
+
* A component similar to a {@link LineChartComponent},
|
|
639
|
+
* but with filled in areas under each line and an option to display them as stacked.
|
|
805
640
|
*
|
|
806
|
-
* @
|
|
807
|
-
*
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
return getWidgetModel(app.httpClient, dashboardOid, widgetOid);
|
|
824
|
-
});
|
|
825
|
-
}
|
|
826
|
-
};
|
|
827
|
-
WidgetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WidgetService, deps: [{ token: SisenseContextService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
828
|
-
WidgetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WidgetService, providedIn: 'root' });
|
|
829
|
-
WidgetService = __decorate([
|
|
830
|
-
TrackableService(['getWidgetModel'])
|
|
831
|
-
], WidgetService);
|
|
832
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WidgetService, decorators: [{
|
|
833
|
-
type: Injectable,
|
|
834
|
-
args: [{
|
|
835
|
-
providedIn: 'root',
|
|
836
|
-
}]
|
|
837
|
-
}], ctorParameters: function () { return [{ type: SisenseContextService }]; } });
|
|
641
|
+
* @example
|
|
642
|
+
* ```html
|
|
643
|
+
* <csdk-area-chart
|
|
644
|
+
* [dataSet]="chart.dataSet"
|
|
645
|
+
* [dataOptions]="chart.dataOptions"
|
|
646
|
+
* [highlights]="filters"
|
|
647
|
+
* [beforeRender]="onBeforeRender"
|
|
648
|
+
* (dataPointClick)="logArguments($event)"
|
|
649
|
+
* (dataPointContextMenu)="logArguments($event)"
|
|
650
|
+
* (dataPointsSelect)="logArguments($event)"
|
|
651
|
+
* />
|
|
652
|
+
* ```
|
|
653
|
+
* ```ts
|
|
654
|
+
import { Component } from '@angular/core';
|
|
655
|
+
import { measureFactory, filterFactory, Filter } from '@sisense/sdk-data';
|
|
656
|
+
import * as DM from '../../assets/sample-healthcare-model';
|
|
657
|
+
import type { ChartType } from '@sisense/sdk-ui-angular';
|
|
838
658
|
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
659
|
+
@Component({
|
|
660
|
+
selector: 'app-analytics',
|
|
661
|
+
templateUrl: './analytics.component.html',
|
|
662
|
+
styleUrls: ['./analytics.component.scss'],
|
|
663
|
+
})
|
|
664
|
+
export class AnalyticsComponent {
|
|
665
|
+
DM = DM;
|
|
666
|
+
filters = [filterFactory.members(DM.Divisions.Divison_name, ['Cardiology', 'Neurology'])];
|
|
667
|
+
chart = {
|
|
668
|
+
chartType: 'column' as ChartType,
|
|
669
|
+
dataSet: DM.DataSource,
|
|
670
|
+
dataOptions: {
|
|
671
|
+
category: [DM.Divisions.Divison_name],
|
|
672
|
+
value: [measureFactory.sum(DM.Admissions.Cost_of_admission)],
|
|
673
|
+
breakBy: [],
|
|
674
|
+
},
|
|
675
|
+
};
|
|
676
|
+
|
|
677
|
+
onBeforeRender(options: any) {
|
|
678
|
+
console.log('beforeRender');
|
|
679
|
+
console.log(options);
|
|
680
|
+
return options;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
logArguments(...args: any[]) {
|
|
684
|
+
console.log(args);
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
* ```
|
|
688
|
+
* <img src="media://angular-area-chart-example.png" width="800px" />
|
|
689
|
+
* @group Charts
|
|
690
|
+
*/
|
|
691
|
+
class AreaChartComponent {
|
|
692
|
+
constructor() {
|
|
693
|
+
/**
|
|
694
|
+
* {@inheritDoc @sisense/sdk-ui!AreaChartProps.onDataPointClick}
|
|
695
|
+
*
|
|
696
|
+
* @category Callbacks
|
|
697
|
+
*/
|
|
698
|
+
this.dataPointClick = new EventEmitter();
|
|
699
|
+
/**
|
|
700
|
+
* {@inheritDoc @sisense/sdk-ui!AreaChartProps.onDataPointContextMenu}
|
|
701
|
+
*
|
|
702
|
+
* @category Callbacks
|
|
703
|
+
*/
|
|
704
|
+
this.dataPointContextMenu = new EventEmitter();
|
|
705
|
+
/**
|
|
706
|
+
* {@inheritDoc @sisense/sdk-ui!AreaChartProps.onDataPointsSelected}
|
|
707
|
+
*
|
|
708
|
+
* @category Callbacks
|
|
709
|
+
*/
|
|
710
|
+
this.dataPointsSelect = new EventEmitter();
|
|
711
|
+
/** @internal */
|
|
712
|
+
this.chartType = 'area';
|
|
842
713
|
}
|
|
843
714
|
}
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
715
|
+
AreaChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AreaChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
716
|
+
AreaChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AreaChartComponent, selector: "csdk-area-chart", inputs: { dataSet: "dataSet", dataOptions: "dataOptions", filters: "filters", highlights: "highlights", styleOptions: "styleOptions", beforeRender: "beforeRender", dataReady: "dataReady" }, outputs: { dataPointClick: "dataPointClick", dataPointContextMenu: "dataPointContextMenu", dataPointsSelect: "dataPointsSelect" }, ngImport: i0, template: `
|
|
717
|
+
<csdk-chart
|
|
718
|
+
[chartType]="chartType"
|
|
719
|
+
[dataSet]="dataSet"
|
|
720
|
+
[dataOptions]="dataOptions"
|
|
721
|
+
[filters]="filters"
|
|
722
|
+
[highlights]="highlights"
|
|
723
|
+
[styleOptions]="styleOptions"
|
|
724
|
+
[beforeRender]="beforeRender"
|
|
725
|
+
[dataReady]="dataReady"
|
|
726
|
+
(dataPointClick)="dataPointClick.emit($any($event))"
|
|
727
|
+
(dataPointContextMenu)="dataPointContextMenu.emit($any($event))"
|
|
728
|
+
(dataPointsSelect)="dataPointsSelect.emit($any($event))"
|
|
729
|
+
/>
|
|
730
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ChartComponent, selector: "csdk-chart", inputs: ["chartType", "dataSet", "dataOptions", "filters", "highlights", "styleOptions", "beforeRender", "dataReady"], outputs: ["dataPointClick", "dataPointContextMenu", "dataPointsSelect"] }] });
|
|
731
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AreaChartComponent, decorators: [{
|
|
732
|
+
type: Component,
|
|
849
733
|
args: [{
|
|
850
|
-
|
|
851
|
-
|
|
734
|
+
selector: 'csdk-area-chart',
|
|
735
|
+
template: `
|
|
736
|
+
<csdk-chart
|
|
737
|
+
[chartType]="chartType"
|
|
738
|
+
[dataSet]="dataSet"
|
|
739
|
+
[dataOptions]="dataOptions"
|
|
740
|
+
[filters]="filters"
|
|
741
|
+
[highlights]="highlights"
|
|
742
|
+
[styleOptions]="styleOptions"
|
|
743
|
+
[beforeRender]="beforeRender"
|
|
744
|
+
[dataReady]="dataReady"
|
|
745
|
+
(dataPointClick)="dataPointClick.emit($any($event))"
|
|
746
|
+
(dataPointContextMenu)="dataPointContextMenu.emit($any($event))"
|
|
747
|
+
(dataPointsSelect)="dataPointsSelect.emit($any($event))"
|
|
748
|
+
/>
|
|
749
|
+
`,
|
|
852
750
|
}]
|
|
853
|
-
}],
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
};
|
|
874
|
-
});
|
|
875
|
-
};
|
|
876
|
-
}
|
|
877
|
-
function track(action, methodName) {
|
|
878
|
-
var _a, _b, _c;
|
|
879
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
880
|
-
try {
|
|
881
|
-
const app = yield DecoratorsModule.sisenseContextService.getApp();
|
|
882
|
-
const trackingEnabled = (_c = (_b = (_a = app.settings) === null || _a === void 0 ? void 0 : _a.trackingConfig) === null || _b === void 0 ? void 0 : _b.enabled) !== null && _c !== void 0 ? _c : true;
|
|
883
|
-
if (app === null || app === void 0 ? void 0 : app.httpClient) {
|
|
884
|
-
const payload = {
|
|
885
|
-
packageName: 'sdk-ui-angular',
|
|
886
|
-
packageVersion,
|
|
887
|
-
methodName,
|
|
888
|
-
};
|
|
889
|
-
void trackProductEvent(action, payload, app.httpClient, !trackingEnabled);
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
catch (e) {
|
|
893
|
-
console.warn('tracking error', e);
|
|
894
|
-
}
|
|
895
|
-
});
|
|
896
|
-
}
|
|
751
|
+
}], propDecorators: { dataSet: [{
|
|
752
|
+
type: Input
|
|
753
|
+
}], dataOptions: [{
|
|
754
|
+
type: Input
|
|
755
|
+
}], filters: [{
|
|
756
|
+
type: Input
|
|
757
|
+
}], highlights: [{
|
|
758
|
+
type: Input
|
|
759
|
+
}], styleOptions: [{
|
|
760
|
+
type: Input
|
|
761
|
+
}], beforeRender: [{
|
|
762
|
+
type: Input
|
|
763
|
+
}], dataReady: [{
|
|
764
|
+
type: Input
|
|
765
|
+
}], dataPointClick: [{
|
|
766
|
+
type: Output
|
|
767
|
+
}], dataPointContextMenu: [{
|
|
768
|
+
type: Output
|
|
769
|
+
}], dataPointsSelect: [{
|
|
770
|
+
type: Output
|
|
771
|
+
}] } });
|
|
897
772
|
|
|
898
773
|
/**
|
|
899
|
-
*
|
|
774
|
+
* A component that displays a range of data over a given time period or across multiple categories.
|
|
775
|
+
* It is particularly useful for visualizing the minimum and maximum values in a dataset, along with
|
|
776
|
+
* the area between these values.
|
|
900
777
|
*
|
|
901
778
|
* @example
|
|
902
|
-
*
|
|
903
|
-
*
|
|
904
|
-
*
|
|
905
|
-
*
|
|
906
|
-
*
|
|
907
|
-
*
|
|
908
|
-
*
|
|
909
|
-
*
|
|
910
|
-
*
|
|
911
|
-
*
|
|
912
|
-
* @NgModule({
|
|
913
|
-
* imports: [
|
|
914
|
-
* BrowserModule,
|
|
915
|
-
* SdkUiModule,
|
|
916
|
-
* ],
|
|
917
|
-
* declarations: [AppComponent],
|
|
918
|
-
* providers: [
|
|
919
|
-
* { provide: SISENSE_CONTEXT_CONFIG_TOKEN, useValue: SISENSE_CONTEXT_CONFIG },
|
|
920
|
-
* {
|
|
921
|
-
* provide: THEME_CONFIG_TOKEN,
|
|
922
|
-
* useValue: {
|
|
923
|
-
* // initial theme settings
|
|
924
|
-
* } as ThemeConfig,
|
|
925
|
-
* },
|
|
926
|
-
* ],
|
|
927
|
-
* bootstrap: [AppComponent],
|
|
928
|
-
* })
|
|
779
|
+
* ```html
|
|
780
|
+
* <csdk-area-range-chart
|
|
781
|
+
* [dataSet]="chart.dataSet"
|
|
782
|
+
* [dataOptions]="chart.dataOptions"
|
|
783
|
+
* [highlights]="filters"
|
|
784
|
+
* [beforeRender]="onBeforeRender"
|
|
785
|
+
* (dataPointClick)="logArguments($event)"
|
|
786
|
+
* (dataPointContextMenu)="logArguments($event)"
|
|
787
|
+
* (dataPointsSelect)="logArguments($event)"
|
|
788
|
+
* />
|
|
929
789
|
* ```
|
|
930
|
-
* @group Contexts
|
|
931
|
-
*/
|
|
932
|
-
const THEME_CONFIG_TOKEN = new InjectionToken('theme configuration');
|
|
933
|
-
/**
|
|
934
|
-
* Service for working with Sisense Fusion themes.
|
|
935
|
-
*
|
|
936
|
-
* If no theme service is used, the current Fusion theme is applied by default.
|
|
937
|
-
*
|
|
938
|
-
* @group Contexts
|
|
939
|
-
*/
|
|
940
|
-
let ThemeService = class ThemeService {
|
|
941
|
-
constructor(sisenseContextService, themeConfig) {
|
|
942
|
-
this.sisenseContextService = sisenseContextService;
|
|
943
|
-
this.initializationPromise = Promise.resolve();
|
|
944
|
-
this.themeSettings$ = new BehaviorSubject(getDefaultThemeSettings());
|
|
945
|
-
this.initializationPromise = this.initThemeSettings(themeConfig === null || themeConfig === void 0 ? void 0 : themeConfig.theme);
|
|
946
|
-
this.sisenseContextService
|
|
947
|
-
.getApp$()
|
|
948
|
-
// Skip current app value
|
|
949
|
-
.pipe(skip(1))
|
|
950
|
-
// Subscribe to new app values
|
|
951
|
-
.subscribe({
|
|
952
|
-
next: ({ app }) => {
|
|
953
|
-
if (app) {
|
|
954
|
-
this.initializationPromise = this.applyThemeSettings(app.settings.serverThemeSettings);
|
|
955
|
-
}
|
|
956
|
-
},
|
|
957
|
-
});
|
|
958
|
-
}
|
|
959
|
-
initThemeSettings(theme) {
|
|
960
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
961
|
-
const app = yield this.sisenseContextService.getApp();
|
|
962
|
-
// apply system theme settings first
|
|
963
|
-
yield this.applyThemeSettings(app.settings.serverThemeSettings);
|
|
964
|
-
if (theme) {
|
|
965
|
-
// Manually tracks theme update during initialization as execution of updateThemeSettings for consistency.
|
|
966
|
-
track('sdkAngularServiceMethodExecuted', 'ThemeService.updateThemeSettings');
|
|
967
|
-
yield this.applyThemeSettings(theme);
|
|
968
|
-
}
|
|
969
|
-
});
|
|
970
|
-
}
|
|
971
|
-
applyThemeSettings(theme) {
|
|
972
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
973
|
-
try {
|
|
974
|
-
const app = yield this.sisenseContextService.getApp();
|
|
975
|
-
const isThemeOid = typeof theme === 'string';
|
|
976
|
-
let userThemeSettings = theme;
|
|
977
|
-
if (isThemeOid) {
|
|
978
|
-
userThemeSettings = yield getThemeSettingsByOid(theme, app.httpClient);
|
|
979
|
-
}
|
|
980
|
-
const mergedThemeSettings = merge.withOptions({ mergeArrays: false }, this.themeSettings$.value, userThemeSettings);
|
|
981
|
-
this.themeSettings$.next(mergedThemeSettings);
|
|
982
|
-
}
|
|
983
|
-
catch (error) {
|
|
984
|
-
this.themeSettings$.error(error);
|
|
985
|
-
}
|
|
986
|
-
});
|
|
987
|
-
}
|
|
988
|
-
/** @internal */
|
|
989
|
-
getThemeSettings() {
|
|
990
|
-
return this.themeSettings$.asObservable();
|
|
991
|
-
}
|
|
992
|
-
updateThemeSettings(theme) {
|
|
993
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
994
|
-
yield this.initializationPromise;
|
|
995
|
-
yield this.applyThemeSettings(theme);
|
|
996
|
-
});
|
|
997
|
-
}
|
|
998
|
-
};
|
|
999
|
-
ThemeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ThemeService, deps: [{ token: SisenseContextService }, { token: THEME_CONFIG_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1000
|
-
ThemeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ThemeService, providedIn: 'root' });
|
|
1001
|
-
ThemeService = __decorate([
|
|
1002
|
-
TrackableService(['updateThemeSettings'])
|
|
1003
|
-
], ThemeService);
|
|
1004
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ThemeService, decorators: [{
|
|
1005
|
-
type: Injectable,
|
|
1006
|
-
args: [{
|
|
1007
|
-
providedIn: 'root',
|
|
1008
|
-
}]
|
|
1009
|
-
}], ctorParameters: function () {
|
|
1010
|
-
return [{ type: SisenseContextService }, { type: undefined, decorators: [{
|
|
1011
|
-
type: Optional
|
|
1012
|
-
}, {
|
|
1013
|
-
type: Inject,
|
|
1014
|
-
args: [THEME_CONFIG_TOKEN]
|
|
1015
|
-
}] }];
|
|
1016
|
-
} });
|
|
1017
|
-
|
|
1018
|
-
/**
|
|
1019
|
-
* An Angular component used for easily switching chart types or rendering multiple series of different chart types.
|
|
1020
|
-
*
|
|
1021
|
-
* @example
|
|
1022
|
-
* An example of using the `Chart` component to
|
|
1023
|
-
* plot a column chart of the Sample Healthcare data source hosted in a Sisense instance:
|
|
1024
|
-
*
|
|
1025
|
-
* ```html
|
|
1026
|
-
* <!--Component HTML template in .component.html-->
|
|
1027
|
-
* <csdk-chart
|
|
1028
|
-
* [chartType]="chart.chartType"
|
|
1029
|
-
* [dataSet]="chart.dataSet"
|
|
1030
|
-
* [dataOptions]="chart.dataOptions"
|
|
1031
|
-
* [filters]="chart.filters"
|
|
1032
|
-
* [styleOptions]="chart.styleOptions"
|
|
1033
|
-
* />
|
|
1034
|
-
* ```
|
|
1035
|
-
*
|
|
1036
790
|
* ```ts
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
*
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
791
|
+
import { Component } from '@angular/core';
|
|
792
|
+
import { measureFactory, filterFactory, Filter } from '@sisense/sdk-data';
|
|
793
|
+
import * as DM from '../../assets/sample-healthcare-model';
|
|
794
|
+
import type { ChartType, RangeChartDataOptions } from '@sisense/sdk-ui-angular';
|
|
795
|
+
|
|
796
|
+
@Component({
|
|
797
|
+
selector: 'app-analytics',
|
|
798
|
+
templateUrl: './analytics.component.html',
|
|
799
|
+
styleUrls: ['./analytics.component.scss'],
|
|
800
|
+
})
|
|
801
|
+
export class AnalyticsComponent {
|
|
802
|
+
DM = DM;
|
|
803
|
+
filters = [filterFactory.members(DM.Divisions.Divison_name, ['Cardiology', 'Neurology'])];
|
|
804
|
+
chart = {
|
|
805
|
+
chartType: 'arearange' as ChartType,
|
|
806
|
+
dataSet: DM.DataSource,
|
|
807
|
+
dataOptions: {
|
|
808
|
+
category: [DM.Admissions.Admission_Time.Years],
|
|
809
|
+
value: [
|
|
810
|
+
{
|
|
811
|
+
title: 'Admission Cost Range',
|
|
812
|
+
upperBound: measureFactory.multiply(
|
|
813
|
+
measureFactory.sum(DM.Admissions.Cost_of_admission, 'Lower Admission'),
|
|
814
|
+
0.6,
|
|
815
|
+
),
|
|
816
|
+
lowerBound: measureFactory.multiply(
|
|
817
|
+
measureFactory.sum(DM.Admissions.Cost_of_admission, 'Upper Admission'),
|
|
818
|
+
1.4,
|
|
819
|
+
),
|
|
820
|
+
}
|
|
821
|
+
],
|
|
822
|
+
breakBy: [],
|
|
823
|
+
} as RangeChartDataOptions,
|
|
824
|
+
};
|
|
825
|
+
|
|
826
|
+
onBeforeRender(options: any) {
|
|
827
|
+
console.log('beforeRender');
|
|
828
|
+
console.log(options);
|
|
829
|
+
return options;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
logArguments(...args: any[]) {
|
|
833
|
+
console.log(args);
|
|
834
|
+
}
|
|
835
|
+
}
|
|
1064
836
|
* ```
|
|
1065
|
-
*
|
|
1066
|
-
* <img src="media://angular-chart-example.png" width="800px" />
|
|
1067
|
-
* @shortDescription Common component for rendering charts of different types including table
|
|
837
|
+
* <img src="media://angular-area-range-chart-example.png" width="800px" />
|
|
1068
838
|
* @group Charts
|
|
1069
839
|
*/
|
|
1070
|
-
class
|
|
1071
|
-
|
|
1072
|
-
* Constructor for the `Chart` component.
|
|
1073
|
-
*
|
|
1074
|
-
* @param sisenseContextService - Sisense context service
|
|
1075
|
-
* @param themeService - Theme service
|
|
1076
|
-
*/
|
|
1077
|
-
constructor(
|
|
1078
|
-
/**
|
|
1079
|
-
* Sisense context service
|
|
1080
|
-
*
|
|
1081
|
-
* @category Constructor
|
|
1082
|
-
*/
|
|
1083
|
-
sisenseContextService,
|
|
1084
|
-
/**
|
|
1085
|
-
* Theme service
|
|
1086
|
-
*
|
|
1087
|
-
* @category Constructor
|
|
1088
|
-
*/
|
|
1089
|
-
themeService) {
|
|
1090
|
-
this.sisenseContextService = sisenseContextService;
|
|
1091
|
-
this.themeService = themeService;
|
|
840
|
+
class AreaRangeChartComponent {
|
|
841
|
+
constructor() {
|
|
1092
842
|
/**
|
|
1093
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
843
|
+
* {@inheritDoc @sisense/sdk-ui!AreaRangeChartProps.onDataPointClick}
|
|
1094
844
|
*
|
|
1095
845
|
* @category Callbacks
|
|
1096
846
|
*/
|
|
1097
847
|
this.dataPointClick = new EventEmitter();
|
|
1098
848
|
/**
|
|
1099
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
849
|
+
* {@inheritDoc @sisense/sdk-ui!AreaRangeChartProps.onDataPointContextMenu}
|
|
1100
850
|
*
|
|
1101
851
|
* @category Callbacks
|
|
1102
852
|
*/
|
|
1103
853
|
this.dataPointContextMenu = new EventEmitter();
|
|
1104
854
|
/**
|
|
1105
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
855
|
+
* {@inheritDoc @sisense/sdk-ui!AreaRangeChartProps.onDataPointsSelected}
|
|
1106
856
|
*
|
|
1107
857
|
* @category Callbacks
|
|
1108
858
|
*/
|
|
1109
859
|
this.dataPointsSelect = new EventEmitter();
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
createThemeContextConnector(this.themeService),
|
|
1113
|
-
]);
|
|
1114
|
-
}
|
|
1115
|
-
/**
|
|
1116
|
-
* @internal
|
|
1117
|
-
*/
|
|
1118
|
-
ngAfterViewInit() {
|
|
1119
|
-
this.componentAdapter.render(this.preactRef.nativeElement, this.getPreactComponentProps());
|
|
1120
|
-
}
|
|
1121
|
-
/**
|
|
1122
|
-
* @internal
|
|
1123
|
-
*/
|
|
1124
|
-
ngOnChanges() {
|
|
1125
|
-
if (this.preactRef) {
|
|
1126
|
-
this.componentAdapter.render(this.preactRef.nativeElement, this.getPreactComponentProps());
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
getPreactComponentProps() {
|
|
1130
|
-
var _a, _b;
|
|
1131
|
-
return {
|
|
1132
|
-
chartType: this.chartType,
|
|
1133
|
-
dataSet: this.dataSet,
|
|
1134
|
-
dataOptions: this.dataOptions,
|
|
1135
|
-
filters: this.filters,
|
|
1136
|
-
highlights: this.highlights,
|
|
1137
|
-
styleOptions: this.styleOptions,
|
|
1138
|
-
onBeforeRender: (_a = this.beforeRender) === null || _a === void 0 ? void 0 : _a.bind(this),
|
|
1139
|
-
onDataReady: (_b = this.dataReady) === null || _b === void 0 ? void 0 : _b.bind(this),
|
|
1140
|
-
onDataPointClick: (...[point, nativeEvent]) => this.dataPointClick.emit({ point, nativeEvent }),
|
|
1141
|
-
onDataPointContextMenu: (...[point, nativeEvent]) => this.dataPointContextMenu.emit({ point, nativeEvent }),
|
|
1142
|
-
onDataPointsSelected: (...[points, nativeEvent]) => this.dataPointsSelect.emit({ points, nativeEvent }),
|
|
1143
|
-
};
|
|
1144
|
-
}
|
|
1145
|
-
/**
|
|
1146
|
-
* @internal
|
|
1147
|
-
*/
|
|
1148
|
-
ngOnDestroy() {
|
|
1149
|
-
this.componentAdapter.destroy();
|
|
860
|
+
/** @internal */
|
|
861
|
+
this.chartType = 'arearange';
|
|
1150
862
|
}
|
|
1151
863
|
}
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
864
|
+
AreaRangeChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AreaRangeChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
865
|
+
AreaRangeChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AreaRangeChartComponent, selector: "csdk-area-range-chart", inputs: { dataSet: "dataSet", dataOptions: "dataOptions", filters: "filters", highlights: "highlights", styleOptions: "styleOptions", beforeRender: "beforeRender", dataReady: "dataReady" }, outputs: { dataPointClick: "dataPointClick", dataPointContextMenu: "dataPointContextMenu", dataPointsSelect: "dataPointsSelect" }, ngImport: i0, template: `
|
|
866
|
+
<csdk-chart
|
|
867
|
+
[chartType]="chartType"
|
|
868
|
+
[dataSet]="dataSet"
|
|
869
|
+
[dataOptions]="dataOptions"
|
|
870
|
+
[filters]="filters"
|
|
871
|
+
[highlights]="highlights"
|
|
872
|
+
[styleOptions]="styleOptions"
|
|
873
|
+
[beforeRender]="beforeRender"
|
|
874
|
+
[dataReady]="dataReady"
|
|
875
|
+
(dataPointClick)="dataPointClick.emit($any($event))"
|
|
876
|
+
(dataPointContextMenu)="dataPointContextMenu.emit($any($event))"
|
|
877
|
+
(dataPointsSelect)="dataPointsSelect.emit($any($event))"
|
|
878
|
+
/>
|
|
879
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ChartComponent, selector: "csdk-chart", inputs: ["chartType", "dataSet", "dataOptions", "filters", "highlights", "styleOptions", "beforeRender", "dataReady"], outputs: ["dataPointClick", "dataPointContextMenu", "dataPointsSelect"] }] });
|
|
880
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AreaRangeChartComponent, decorators: [{
|
|
1155
881
|
type: Component,
|
|
1156
|
-
args: [{
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
882
|
+
args: [{
|
|
883
|
+
selector: 'csdk-area-range-chart',
|
|
884
|
+
template: `
|
|
885
|
+
<csdk-chart
|
|
886
|
+
[chartType]="chartType"
|
|
887
|
+
[dataSet]="dataSet"
|
|
888
|
+
[dataOptions]="dataOptions"
|
|
889
|
+
[filters]="filters"
|
|
890
|
+
[highlights]="highlights"
|
|
891
|
+
[styleOptions]="styleOptions"
|
|
892
|
+
[beforeRender]="beforeRender"
|
|
893
|
+
[dataReady]="dataReady"
|
|
894
|
+
(dataPointClick)="dataPointClick.emit($any($event))"
|
|
895
|
+
(dataPointContextMenu)="dataPointContextMenu.emit($any($event))"
|
|
896
|
+
(dataPointsSelect)="dataPointsSelect.emit($any($event))"
|
|
897
|
+
/>
|
|
898
|
+
`,
|
|
899
|
+
}]
|
|
900
|
+
}], propDecorators: { dataSet: [{
|
|
901
|
+
type: Input
|
|
902
|
+
}], dataOptions: [{
|
|
903
|
+
type: Input
|
|
904
|
+
}], filters: [{
|
|
905
|
+
type: Input
|
|
1168
906
|
}], highlights: [{
|
|
1169
907
|
type: Input
|
|
1170
908
|
}], styleOptions: [{
|
|
@@ -1182,26 +920,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1182
920
|
}] } });
|
|
1183
921
|
|
|
1184
922
|
/**
|
|
1185
|
-
*
|
|
1186
|
-
* but with filled in areas under each line and an option to display them as stacked.
|
|
923
|
+
* An Angular component that allows to visualize geographical data as polygons on a map.
|
|
1187
924
|
*
|
|
1188
925
|
* @example
|
|
1189
926
|
* ```html
|
|
1190
|
-
* <csdk-
|
|
1191
|
-
* [dataSet]="
|
|
1192
|
-
* [dataOptions]="
|
|
1193
|
-
* [
|
|
1194
|
-
* [beforeRender]="onBeforeRender"
|
|
927
|
+
* <csdk-areamap-chart
|
|
928
|
+
* [dataSet]="areamapChart.dataSet"
|
|
929
|
+
* [dataOptions]="areamapChart.dataOptions"
|
|
930
|
+
* [styleOptions]="areamapChart.styleOptions"
|
|
1195
931
|
* (dataPointClick)="logArguments($event)"
|
|
1196
|
-
* (dataPointContextMenu)="logArguments($event)"
|
|
1197
|
-
* (dataPointsSelect)="logArguments($event)"
|
|
1198
932
|
* />
|
|
1199
933
|
* ```
|
|
934
|
+
*
|
|
1200
935
|
* ```ts
|
|
1201
936
|
import { Component } from '@angular/core';
|
|
1202
|
-
import { measureFactory
|
|
1203
|
-
import * as DM from '../../assets/sample-
|
|
1204
|
-
import type { ChartType } from '@sisense/sdk-ui-angular';
|
|
937
|
+
import { measureFactory } from '@sisense/sdk-data';
|
|
938
|
+
import * as DM from '../../assets/sample-ecommerce';
|
|
1205
939
|
|
|
1206
940
|
@Component({
|
|
1207
941
|
selector: 'app-analytics',
|
|
@@ -1209,58 +943,39 @@ import type { ChartType } from '@sisense/sdk-ui-angular';
|
|
|
1209
943
|
styleUrls: ['./analytics.component.scss'],
|
|
1210
944
|
})
|
|
1211
945
|
export class AnalyticsComponent {
|
|
1212
|
-
|
|
1213
|
-
filters = [filterFactory.members(DM.Divisions.Divison_name, ['Cardiology', 'Neurology'])];
|
|
1214
|
-
chart = {
|
|
1215
|
-
chartType: 'column' as ChartType,
|
|
946
|
+
areamapChart = {
|
|
1216
947
|
dataSet: DM.DataSource,
|
|
1217
948
|
dataOptions: {
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
949
|
+
geo: [DM.Country.Country],
|
|
950
|
+
color: [measureFactory.sum(DM.Commerce.Revenue, 'Color by Revenue')],
|
|
951
|
+
} as AreamapChartDataOptions,
|
|
952
|
+
styleOptions: {
|
|
953
|
+
mapType: 'world',
|
|
954
|
+
} as AreamapStyleOptions,
|
|
1222
955
|
};
|
|
1223
956
|
|
|
1224
|
-
onBeforeRender(options: any) {
|
|
1225
|
-
console.log('beforeRender');
|
|
1226
|
-
console.log(options);
|
|
1227
|
-
return options;
|
|
1228
|
-
}
|
|
1229
|
-
|
|
1230
957
|
logArguments(...args: any[]) {
|
|
1231
958
|
console.log(args);
|
|
1232
959
|
}
|
|
1233
960
|
}
|
|
1234
961
|
* ```
|
|
1235
|
-
* <img src="media://angular-
|
|
962
|
+
* <img src="media://angular-areamap-chart-example.png" width="800px" />
|
|
1236
963
|
* @group Charts
|
|
1237
964
|
*/
|
|
1238
|
-
class
|
|
965
|
+
class AreamapChartComponent {
|
|
1239
966
|
constructor() {
|
|
1240
967
|
/**
|
|
1241
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
968
|
+
* {@inheritDoc @sisense/sdk-ui!AreamapChartProps.onDataPointClick}
|
|
1242
969
|
*
|
|
1243
970
|
* @category Callbacks
|
|
1244
971
|
*/
|
|
1245
972
|
this.dataPointClick = new EventEmitter();
|
|
1246
|
-
/**
|
|
1247
|
-
* {@inheritDoc @sisense/sdk-ui!AreaChartProps.onDataPointContextMenu}
|
|
1248
|
-
*
|
|
1249
|
-
* @category Callbacks
|
|
1250
|
-
*/
|
|
1251
|
-
this.dataPointContextMenu = new EventEmitter();
|
|
1252
|
-
/**
|
|
1253
|
-
* {@inheritDoc @sisense/sdk-ui!AreaChartProps.onDataPointsSelected}
|
|
1254
|
-
*
|
|
1255
|
-
* @category Callbacks
|
|
1256
|
-
*/
|
|
1257
|
-
this.dataPointsSelect = new EventEmitter();
|
|
1258
973
|
/** @internal */
|
|
1259
|
-
this.chartType = '
|
|
974
|
+
this.chartType = 'areamap';
|
|
1260
975
|
}
|
|
1261
976
|
}
|
|
1262
|
-
|
|
1263
|
-
|
|
977
|
+
AreamapChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AreamapChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
978
|
+
AreamapChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AreamapChartComponent, selector: "csdk-areamap-chart", inputs: { dataSet: "dataSet", dataOptions: "dataOptions", filters: "filters", highlights: "highlights", styleOptions: "styleOptions", dataReady: "dataReady" }, outputs: { dataPointClick: "dataPointClick" }, ngImport: i0, template: `
|
|
1264
979
|
<csdk-chart
|
|
1265
980
|
[chartType]="chartType"
|
|
1266
981
|
[dataSet]="dataSet"
|
|
@@ -1268,17 +983,14 @@ AreaChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", ver
|
|
|
1268
983
|
[filters]="filters"
|
|
1269
984
|
[highlights]="highlights"
|
|
1270
985
|
[styleOptions]="styleOptions"
|
|
1271
|
-
[beforeRender]="beforeRender"
|
|
1272
986
|
[dataReady]="dataReady"
|
|
1273
987
|
(dataPointClick)="dataPointClick.emit($any($event))"
|
|
1274
|
-
(dataPointContextMenu)="dataPointContextMenu.emit($any($event))"
|
|
1275
|
-
(dataPointsSelect)="dataPointsSelect.emit($any($event))"
|
|
1276
988
|
/>
|
|
1277
989
|
`, isInline: true, dependencies: [{ kind: "component", type: ChartComponent, selector: "csdk-chart", inputs: ["chartType", "dataSet", "dataOptions", "filters", "highlights", "styleOptions", "beforeRender", "dataReady"], outputs: ["dataPointClick", "dataPointContextMenu", "dataPointsSelect"] }] });
|
|
1278
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type:
|
|
990
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AreamapChartComponent, decorators: [{
|
|
1279
991
|
type: Component,
|
|
1280
992
|
args: [{
|
|
1281
|
-
selector: 'csdk-
|
|
993
|
+
selector: 'csdk-areamap-chart',
|
|
1282
994
|
template: `
|
|
1283
995
|
<csdk-chart
|
|
1284
996
|
[chartType]="chartType"
|
|
@@ -1287,11 +999,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1287
999
|
[filters]="filters"
|
|
1288
1000
|
[highlights]="highlights"
|
|
1289
1001
|
[styleOptions]="styleOptions"
|
|
1290
|
-
[beforeRender]="beforeRender"
|
|
1291
1002
|
[dataReady]="dataReady"
|
|
1292
1003
|
(dataPointClick)="dataPointClick.emit($any($event))"
|
|
1293
|
-
(dataPointContextMenu)="dataPointContextMenu.emit($any($event))"
|
|
1294
|
-
(dataPointsSelect)="dataPointsSelect.emit($any($event))"
|
|
1295
1004
|
/>
|
|
1296
1005
|
`,
|
|
1297
1006
|
}]
|
|
@@ -1305,26 +1014,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1305
1014
|
type: Input
|
|
1306
1015
|
}], styleOptions: [{
|
|
1307
1016
|
type: Input
|
|
1308
|
-
}], beforeRender: [{
|
|
1309
|
-
type: Input
|
|
1310
1017
|
}], dataReady: [{
|
|
1311
1018
|
type: Input
|
|
1312
1019
|
}], dataPointClick: [{
|
|
1313
1020
|
type: Output
|
|
1314
|
-
}], dataPointContextMenu: [{
|
|
1315
|
-
type: Output
|
|
1316
|
-
}], dataPointsSelect: [{
|
|
1317
|
-
type: Output
|
|
1318
1021
|
}] } });
|
|
1319
1022
|
|
|
1320
1023
|
/**
|
|
1321
|
-
* A component
|
|
1322
|
-
*
|
|
1323
|
-
* the area between these values.
|
|
1024
|
+
* A component representing categorical data with horizontal rectangular bars,
|
|
1025
|
+
* whose lengths are proportional to the values that they represent.
|
|
1324
1026
|
*
|
|
1325
1027
|
* @example
|
|
1326
1028
|
* ```html
|
|
1327
|
-
* <csdk-
|
|
1029
|
+
* <csdk-bar-chart
|
|
1328
1030
|
* [dataSet]="chart.dataSet"
|
|
1329
1031
|
* [dataOptions]="chart.dataOptions"
|
|
1330
1032
|
* [highlights]="filters"
|
|
@@ -1334,11 +1036,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1334
1036
|
* (dataPointsSelect)="logArguments($event)"
|
|
1335
1037
|
* />
|
|
1336
1038
|
* ```
|
|
1039
|
+
*
|
|
1337
1040
|
* ```ts
|
|
1338
1041
|
import { Component } from '@angular/core';
|
|
1339
|
-
import { measureFactory, filterFactory
|
|
1042
|
+
import { measureFactory, filterFactory } from '@sisense/sdk-data';
|
|
1340
1043
|
import * as DM from '../../assets/sample-healthcare-model';
|
|
1341
|
-
import type { ChartType
|
|
1044
|
+
import type { ChartType } from '@sisense/sdk-ui-angular';
|
|
1342
1045
|
|
|
1343
1046
|
@Component({
|
|
1344
1047
|
selector: 'app-analytics',
|
|
@@ -1349,25 +1052,13 @@ export class AnalyticsComponent {
|
|
|
1349
1052
|
DM = DM;
|
|
1350
1053
|
filters = [filterFactory.members(DM.Divisions.Divison_name, ['Cardiology', 'Neurology'])];
|
|
1351
1054
|
chart = {
|
|
1352
|
-
chartType: '
|
|
1055
|
+
chartType: 'column' as ChartType,
|
|
1353
1056
|
dataSet: DM.DataSource,
|
|
1354
1057
|
dataOptions: {
|
|
1355
|
-
category: [DM.
|
|
1356
|
-
value: [
|
|
1357
|
-
{
|
|
1358
|
-
title: 'Admission Cost Range',
|
|
1359
|
-
upperBound: measureFactory.multiply(
|
|
1360
|
-
measureFactory.sum(DM.Admissions.Cost_of_admission, 'Lower Admission'),
|
|
1361
|
-
0.6,
|
|
1362
|
-
),
|
|
1363
|
-
lowerBound: measureFactory.multiply(
|
|
1364
|
-
measureFactory.sum(DM.Admissions.Cost_of_admission, 'Upper Admission'),
|
|
1365
|
-
1.4,
|
|
1366
|
-
),
|
|
1367
|
-
}
|
|
1368
|
-
],
|
|
1058
|
+
category: [DM.Divisions.Divison_name],
|
|
1059
|
+
value: [measureFactory.sum(DM.Admissions.Cost_of_admission)],
|
|
1369
1060
|
breakBy: [],
|
|
1370
|
-
}
|
|
1061
|
+
},
|
|
1371
1062
|
};
|
|
1372
1063
|
|
|
1373
1064
|
onBeforeRender(options: any) {
|
|
@@ -1381,35 +1072,35 @@ export class AnalyticsComponent {
|
|
|
1381
1072
|
}
|
|
1382
1073
|
}
|
|
1383
1074
|
* ```
|
|
1384
|
-
* <img src="media://angular-
|
|
1075
|
+
* <img src="media://angular-bar-chart-example.png" width="800px" />
|
|
1385
1076
|
* @group Charts
|
|
1386
1077
|
*/
|
|
1387
|
-
class
|
|
1078
|
+
class BarChartComponent {
|
|
1388
1079
|
constructor() {
|
|
1389
1080
|
/**
|
|
1390
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
1081
|
+
* {@inheritDoc @sisense/sdk-ui!BarChartProps.onDataPointClick}
|
|
1391
1082
|
*
|
|
1392
1083
|
* @category Callbacks
|
|
1393
1084
|
*/
|
|
1394
1085
|
this.dataPointClick = new EventEmitter();
|
|
1395
1086
|
/**
|
|
1396
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
1087
|
+
* {@inheritDoc @sisense/sdk-ui!BarChartProps.onDataPointContextMenu}
|
|
1397
1088
|
*
|
|
1398
1089
|
* @category Callbacks
|
|
1399
1090
|
*/
|
|
1400
1091
|
this.dataPointContextMenu = new EventEmitter();
|
|
1401
1092
|
/**
|
|
1402
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
1093
|
+
* {@inheritDoc @sisense/sdk-ui!BarChartProps.onDataPointsSelected}
|
|
1403
1094
|
*
|
|
1404
1095
|
* @category Callbacks
|
|
1405
1096
|
*/
|
|
1406
1097
|
this.dataPointsSelect = new EventEmitter();
|
|
1407
1098
|
/** @internal */
|
|
1408
|
-
this.chartType = '
|
|
1099
|
+
this.chartType = 'bar';
|
|
1409
1100
|
}
|
|
1410
1101
|
}
|
|
1411
|
-
|
|
1412
|
-
|
|
1102
|
+
BarChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BarChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1103
|
+
BarChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: BarChartComponent, selector: "csdk-bar-chart", inputs: { dataSet: "dataSet", dataOptions: "dataOptions", filters: "filters", highlights: "highlights", styleOptions: "styleOptions", beforeRender: "beforeRender", dataReady: "dataReady" }, outputs: { dataPointClick: "dataPointClick", dataPointContextMenu: "dataPointContextMenu", dataPointsSelect: "dataPointsSelect" }, ngImport: i0, template: `
|
|
1413
1104
|
<csdk-chart
|
|
1414
1105
|
[chartType]="chartType"
|
|
1415
1106
|
[dataSet]="dataSet"
|
|
@@ -1424,10 +1115,10 @@ AreaRangeChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0"
|
|
|
1424
1115
|
(dataPointsSelect)="dataPointsSelect.emit($any($event))"
|
|
1425
1116
|
/>
|
|
1426
1117
|
`, isInline: true, dependencies: [{ kind: "component", type: ChartComponent, selector: "csdk-chart", inputs: ["chartType", "dataSet", "dataOptions", "filters", "highlights", "styleOptions", "beforeRender", "dataReady"], outputs: ["dataPointClick", "dataPointContextMenu", "dataPointsSelect"] }] });
|
|
1427
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type:
|
|
1118
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BarChartComponent, decorators: [{
|
|
1428
1119
|
type: Component,
|
|
1429
1120
|
args: [{
|
|
1430
|
-
selector: 'csdk-
|
|
1121
|
+
selector: 'csdk-bar-chart',
|
|
1431
1122
|
template: `
|
|
1432
1123
|
<csdk-chart
|
|
1433
1124
|
[chartType]="chartType"
|
|
@@ -1467,22 +1158,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1467
1158
|
}] } });
|
|
1468
1159
|
|
|
1469
1160
|
/**
|
|
1470
|
-
* An Angular component
|
|
1161
|
+
* An Angular component representing data in a way that visually describes the distribution
|
|
1162
|
+
* variability, and center of a data set along an axis.
|
|
1471
1163
|
*
|
|
1472
1164
|
* @example
|
|
1473
1165
|
* ```html
|
|
1474
|
-
* <csdk-
|
|
1475
|
-
* [dataSet]="
|
|
1476
|
-
* [dataOptions]="
|
|
1477
|
-
* [
|
|
1166
|
+
* <csdk-boxplot-chart
|
|
1167
|
+
* [dataSet]="boxplotChart.dataSet"
|
|
1168
|
+
* [dataOptions]="boxplotChart.dataOptions"
|
|
1169
|
+
* [highlights]="boxplotChart.highlights"
|
|
1170
|
+
* [beforeRender]="onBeforeRender"
|
|
1478
1171
|
* (dataPointClick)="logArguments($event)"
|
|
1172
|
+
* (dataPointContextMenu)="logArguments($event)"
|
|
1173
|
+
* (dataPointsSelect)="logArguments($event)"
|
|
1479
1174
|
* />
|
|
1480
1175
|
* ```
|
|
1481
1176
|
*
|
|
1482
1177
|
* ```ts
|
|
1483
1178
|
import { Component } from '@angular/core';
|
|
1484
|
-
import {
|
|
1485
|
-
import
|
|
1179
|
+
import { filterFactory } from '@sisense/sdk-data';
|
|
1180
|
+
import type { BoxplotChartDataOptions } from '@sisense/sdk-ui-angular';
|
|
1181
|
+
import * as DM from '../../assets/sample-healthcare-model';
|
|
1486
1182
|
|
|
1487
1183
|
@Component({
|
|
1488
1184
|
selector: 'app-analytics',
|
|
@@ -1490,15 +1186,15 @@ import * as DM from '../../assets/sample-ecommerce';
|
|
|
1490
1186
|
styleUrls: ['./analytics.component.scss'],
|
|
1491
1187
|
})
|
|
1492
1188
|
export class AnalyticsComponent {
|
|
1493
|
-
|
|
1189
|
+
boxplotChart = {
|
|
1494
1190
|
dataSet: DM.DataSource,
|
|
1495
1191
|
dataOptions: {
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1192
|
+
category: [DM.Divisions.Divison_name],
|
|
1193
|
+
value: [DM.Admissions.TimeofStay],
|
|
1194
|
+
boxType: 'iqr',
|
|
1195
|
+
outliersEnabled: true,
|
|
1196
|
+
} as BoxplotChartDataOptions,
|
|
1197
|
+
highlights: [filterFactory.members(DM.Divisions.Divison_name, ['Cardiology', 'Neurology'])],
|
|
1502
1198
|
};
|
|
1503
1199
|
|
|
1504
1200
|
logArguments(...args: any[]) {
|
|
@@ -1506,23 +1202,35 @@ export class AnalyticsComponent {
|
|
|
1506
1202
|
}
|
|
1507
1203
|
}
|
|
1508
1204
|
* ```
|
|
1509
|
-
* <img src="media://angular-
|
|
1205
|
+
* <img src="media://angular-boxplot-chart-example.png" width="800px" />
|
|
1510
1206
|
* @group Charts
|
|
1511
1207
|
*/
|
|
1512
|
-
class
|
|
1208
|
+
class BoxplotChartComponent {
|
|
1513
1209
|
constructor() {
|
|
1514
1210
|
/**
|
|
1515
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
1211
|
+
* {@inheritDoc @sisense/sdk-ui!BoxplotChartProps.onDataPointClick}
|
|
1516
1212
|
*
|
|
1517
1213
|
* @category Callbacks
|
|
1518
1214
|
*/
|
|
1519
1215
|
this.dataPointClick = new EventEmitter();
|
|
1216
|
+
/**
|
|
1217
|
+
* {@inheritDoc @sisense/sdk-ui!BoxplotChartProps.onDataPointContextMenu}
|
|
1218
|
+
*
|
|
1219
|
+
* @category Callbacks
|
|
1220
|
+
*/
|
|
1221
|
+
this.dataPointContextMenu = new EventEmitter();
|
|
1222
|
+
/**
|
|
1223
|
+
* {@inheritDoc @sisense/sdk-ui!BoxplotChartProps.onDataPointsSelected}
|
|
1224
|
+
*
|
|
1225
|
+
* @category Callbacks
|
|
1226
|
+
*/
|
|
1227
|
+
this.dataPointsSelect = new EventEmitter();
|
|
1520
1228
|
/** @internal */
|
|
1521
|
-
this.chartType = '
|
|
1229
|
+
this.chartType = 'boxplot';
|
|
1522
1230
|
}
|
|
1523
1231
|
}
|
|
1524
|
-
|
|
1525
|
-
|
|
1232
|
+
BoxplotChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BoxplotChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1233
|
+
BoxplotChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: BoxplotChartComponent, selector: "csdk-boxplot-chart", inputs: { dataSet: "dataSet", dataOptions: "dataOptions", filters: "filters", highlights: "highlights", styleOptions: "styleOptions", beforeRender: "beforeRender", dataReady: "dataReady" }, outputs: { dataPointClick: "dataPointClick", dataPointContextMenu: "dataPointContextMenu", dataPointsSelect: "dataPointsSelect" }, ngImport: i0, template: `
|
|
1526
1234
|
<csdk-chart
|
|
1527
1235
|
[chartType]="chartType"
|
|
1528
1236
|
[dataSet]="dataSet"
|
|
@@ -1530,14 +1238,17 @@ AreamapChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0",
|
|
|
1530
1238
|
[filters]="filters"
|
|
1531
1239
|
[highlights]="highlights"
|
|
1532
1240
|
[styleOptions]="styleOptions"
|
|
1241
|
+
[beforeRender]="beforeRender"
|
|
1533
1242
|
[dataReady]="dataReady"
|
|
1534
1243
|
(dataPointClick)="dataPointClick.emit($any($event))"
|
|
1244
|
+
(dataPointContextMenu)="dataPointContextMenu.emit($any($event))"
|
|
1245
|
+
(dataPointsSelect)="dataPointsSelect.emit($any($event))"
|
|
1535
1246
|
/>
|
|
1536
1247
|
`, isInline: true, dependencies: [{ kind: "component", type: ChartComponent, selector: "csdk-chart", inputs: ["chartType", "dataSet", "dataOptions", "filters", "highlights", "styleOptions", "beforeRender", "dataReady"], outputs: ["dataPointClick", "dataPointContextMenu", "dataPointsSelect"] }] });
|
|
1537
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type:
|
|
1248
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BoxplotChartComponent, decorators: [{
|
|
1538
1249
|
type: Component,
|
|
1539
1250
|
args: [{
|
|
1540
|
-
selector: 'csdk-
|
|
1251
|
+
selector: 'csdk-boxplot-chart',
|
|
1541
1252
|
template: `
|
|
1542
1253
|
<csdk-chart
|
|
1543
1254
|
[chartType]="chartType"
|
|
@@ -1546,8 +1257,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1546
1257
|
[filters]="filters"
|
|
1547
1258
|
[highlights]="highlights"
|
|
1548
1259
|
[styleOptions]="styleOptions"
|
|
1260
|
+
[beforeRender]="beforeRender"
|
|
1549
1261
|
[dataReady]="dataReady"
|
|
1550
1262
|
(dataPointClick)="dataPointClick.emit($any($event))"
|
|
1263
|
+
(dataPointContextMenu)="dataPointContextMenu.emit($any($event))"
|
|
1264
|
+
(dataPointsSelect)="dataPointsSelect.emit($any($event))"
|
|
1551
1265
|
/>
|
|
1552
1266
|
`,
|
|
1553
1267
|
}]
|
|
@@ -1561,34 +1275,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1561
1275
|
type: Input
|
|
1562
1276
|
}], styleOptions: [{
|
|
1563
1277
|
type: Input
|
|
1278
|
+
}], beforeRender: [{
|
|
1279
|
+
type: Input
|
|
1564
1280
|
}], dataReady: [{
|
|
1565
1281
|
type: Input
|
|
1566
1282
|
}], dataPointClick: [{
|
|
1567
1283
|
type: Output
|
|
1284
|
+
}], dataPointContextMenu: [{
|
|
1285
|
+
type: Output
|
|
1286
|
+
}], dataPointsSelect: [{
|
|
1287
|
+
type: Output
|
|
1568
1288
|
}] } });
|
|
1569
1289
|
|
|
1570
1290
|
/**
|
|
1571
|
-
* A component
|
|
1572
|
-
*
|
|
1291
|
+
* A component that visualizes values over days in a calendar-like view,
|
|
1292
|
+
* making it easy to identify daily patterns or anomalies
|
|
1573
1293
|
*
|
|
1574
1294
|
* @example
|
|
1575
1295
|
* ```html
|
|
1576
|
-
* <csdk-
|
|
1296
|
+
* <csdk-calendar-heatmap-chart
|
|
1577
1297
|
* [dataSet]="chart.dataSet"
|
|
1578
1298
|
* [dataOptions]="chart.dataOptions"
|
|
1579
|
-
* [highlights]="
|
|
1580
|
-
* [
|
|
1581
|
-
* (dataPointClick)="logArguments($event)"
|
|
1582
|
-
* (dataPointContextMenu)="logArguments($event)"
|
|
1583
|
-
* (dataPointsSelect)="logArguments($event)"
|
|
1299
|
+
* [highlights]="chart.highlights"
|
|
1300
|
+
* [styleOptions]="chart.styleOptions"
|
|
1584
1301
|
* />
|
|
1585
1302
|
* ```
|
|
1586
|
-
*
|
|
1587
1303
|
* ```ts
|
|
1588
1304
|
import { Component } from '@angular/core';
|
|
1589
1305
|
import { measureFactory, filterFactory } from '@sisense/sdk-data';
|
|
1590
|
-
import * as DM from '../../assets/sample-
|
|
1591
|
-
import type {
|
|
1306
|
+
import * as DM from '../../assets/sample-ecommerce';
|
|
1307
|
+
import type { CalendarHeatmapChartProps } from '@sisense/sdk-ui-angular';
|
|
1592
1308
|
|
|
1593
1309
|
@Component({
|
|
1594
1310
|
selector: 'app-analytics',
|
|
@@ -1597,57 +1313,54 @@ import type { ChartType } from '@sisense/sdk-ui-angular';
|
|
|
1597
1313
|
})
|
|
1598
1314
|
export class AnalyticsComponent {
|
|
1599
1315
|
DM = DM;
|
|
1600
|
-
filters = [filterFactory.members(DM.Divisions.Divison_name, ['Cardiology', 'Neurology'])];
|
|
1601
1316
|
chart = {
|
|
1602
|
-
chartType: 'column' as ChartType,
|
|
1603
1317
|
dataSet: DM.DataSource,
|
|
1604
1318
|
dataOptions: {
|
|
1605
|
-
|
|
1606
|
-
value:
|
|
1607
|
-
breakBy: [],
|
|
1319
|
+
date: DM.Commerce.Date.Days,
|
|
1320
|
+
value: measureFactory.sum(DM.Commerce.Cost),
|
|
1608
1321
|
},
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
}
|
|
1322
|
+
highlights: [
|
|
1323
|
+
filterFactory.dateRange(
|
|
1324
|
+
DM.Commerce.Date.Days,
|
|
1325
|
+
'2009-11-29',
|
|
1326
|
+
'2009-12-15'
|
|
1327
|
+
),
|
|
1328
|
+
],
|
|
1329
|
+
styleOptions: {
|
|
1330
|
+
viewType: 'quarter',
|
|
1331
|
+
},
|
|
1332
|
+
};
|
|
1620
1333
|
}
|
|
1621
1334
|
* ```
|
|
1622
|
-
* <img src="media://angular-
|
|
1335
|
+
* <img src="media://angular-calendar-heatmap-chart-example.png" width="800px" />
|
|
1623
1336
|
* @group Charts
|
|
1624
1337
|
*/
|
|
1625
|
-
class
|
|
1338
|
+
class CalendarHeatmapChartComponent {
|
|
1626
1339
|
constructor() {
|
|
1627
1340
|
/**
|
|
1628
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
1341
|
+
* {@inheritDoc @sisense/sdk-ui!CalendarHeatmapChartProps.onDataPointClick}
|
|
1629
1342
|
*
|
|
1630
1343
|
* @category Callbacks
|
|
1631
1344
|
*/
|
|
1632
1345
|
this.dataPointClick = new EventEmitter();
|
|
1633
1346
|
/**
|
|
1634
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
1347
|
+
* {@inheritDoc @sisense/sdk-ui!CalendarHeatmapChartProps.onDataPointContextMenu}
|
|
1635
1348
|
*
|
|
1636
1349
|
* @category Callbacks
|
|
1637
1350
|
*/
|
|
1638
1351
|
this.dataPointContextMenu = new EventEmitter();
|
|
1639
1352
|
/**
|
|
1640
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
1353
|
+
* {@inheritDoc @sisense/sdk-ui!CalendarHeatmapChartProps.onDataPointsSelected}
|
|
1641
1354
|
*
|
|
1642
1355
|
* @category Callbacks
|
|
1643
1356
|
*/
|
|
1644
1357
|
this.dataPointsSelect = new EventEmitter();
|
|
1645
1358
|
/** @internal */
|
|
1646
|
-
this.chartType = '
|
|
1359
|
+
this.chartType = 'calendar-heatmap';
|
|
1647
1360
|
}
|
|
1648
1361
|
}
|
|
1649
|
-
|
|
1650
|
-
|
|
1362
|
+
CalendarHeatmapChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CalendarHeatmapChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1363
|
+
CalendarHeatmapChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CalendarHeatmapChartComponent, selector: "csdk-calendar-heatmap-chart", inputs: { dataSet: "dataSet", dataOptions: "dataOptions", filters: "filters", highlights: "highlights", styleOptions: "styleOptions", beforeRender: "beforeRender", dataReady: "dataReady" }, outputs: { dataPointClick: "dataPointClick", dataPointContextMenu: "dataPointContextMenu", dataPointsSelect: "dataPointsSelect" }, ngImport: i0, template: `
|
|
1651
1364
|
<csdk-chart
|
|
1652
1365
|
[chartType]="chartType"
|
|
1653
1366
|
[dataSet]="dataSet"
|
|
@@ -1662,10 +1375,10 @@ BarChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", vers
|
|
|
1662
1375
|
(dataPointsSelect)="dataPointsSelect.emit($any($event))"
|
|
1663
1376
|
/>
|
|
1664
1377
|
`, isInline: true, dependencies: [{ kind: "component", type: ChartComponent, selector: "csdk-chart", inputs: ["chartType", "dataSet", "dataOptions", "filters", "highlights", "styleOptions", "beforeRender", "dataReady"], outputs: ["dataPointClick", "dataPointContextMenu", "dataPointsSelect"] }] });
|
|
1665
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type:
|
|
1378
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CalendarHeatmapChartComponent, decorators: [{
|
|
1666
1379
|
type: Component,
|
|
1667
1380
|
args: [{
|
|
1668
|
-
selector: 'csdk-
|
|
1381
|
+
selector: 'csdk-calendar-heatmap-chart',
|
|
1669
1382
|
template: `
|
|
1670
1383
|
<csdk-chart
|
|
1671
1384
|
[chartType]="chartType"
|
|
@@ -1705,27 +1418,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1705
1418
|
}] } });
|
|
1706
1419
|
|
|
1707
1420
|
/**
|
|
1708
|
-
*
|
|
1709
|
-
*
|
|
1421
|
+
* A component representing categorical data with vertical rectangular bars
|
|
1422
|
+
* whose heights are proportional to the values that they represent.
|
|
1710
1423
|
*
|
|
1711
1424
|
* @example
|
|
1712
1425
|
* ```html
|
|
1713
|
-
* <csdk-
|
|
1714
|
-
* [dataSet]="
|
|
1715
|
-
* [dataOptions]="
|
|
1716
|
-
* [highlights]="
|
|
1426
|
+
* <csdk-column-chart
|
|
1427
|
+
* [dataSet]="chart.dataSet"
|
|
1428
|
+
* [dataOptions]="chart.dataOptions"
|
|
1429
|
+
* [highlights]="filters"
|
|
1717
1430
|
* [beforeRender]="onBeforeRender"
|
|
1718
1431
|
* (dataPointClick)="logArguments($event)"
|
|
1719
1432
|
* (dataPointContextMenu)="logArguments($event)"
|
|
1720
1433
|
* (dataPointsSelect)="logArguments($event)"
|
|
1721
1434
|
* />
|
|
1722
1435
|
* ```
|
|
1723
|
-
*
|
|
1724
1436
|
* ```ts
|
|
1725
1437
|
import { Component } from '@angular/core';
|
|
1726
|
-
import { filterFactory } from '@sisense/sdk-data';
|
|
1727
|
-
import type { BoxplotChartDataOptions } from '@sisense/sdk-ui-angular';
|
|
1438
|
+
import { measureFactory, filterFactory } from '@sisense/sdk-data';
|
|
1728
1439
|
import * as DM from '../../assets/sample-healthcare-model';
|
|
1440
|
+
import type { ChartType } from '@sisense/sdk-ui-angular';
|
|
1729
1441
|
|
|
1730
1442
|
@Component({
|
|
1731
1443
|
selector: 'app-analytics',
|
|
@@ -1733,51 +1445,58 @@ import * as DM from '../../assets/sample-healthcare-model';
|
|
|
1733
1445
|
styleUrls: ['./analytics.component.scss'],
|
|
1734
1446
|
})
|
|
1735
1447
|
export class AnalyticsComponent {
|
|
1736
|
-
|
|
1448
|
+
DM = DM;
|
|
1449
|
+
filters = [filterFactory.members(DM.Divisions.Divison_name, ['Cardiology', 'Neurology'])];
|
|
1450
|
+
chart = {
|
|
1451
|
+
chartType: 'column' as ChartType,
|
|
1737
1452
|
dataSet: DM.DataSource,
|
|
1738
1453
|
dataOptions: {
|
|
1739
1454
|
category: [DM.Divisions.Divison_name],
|
|
1740
|
-
value: [DM.Admissions.
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
} as BoxplotChartDataOptions,
|
|
1744
|
-
highlights: [filterFactory.members(DM.Divisions.Divison_name, ['Cardiology', 'Neurology'])],
|
|
1455
|
+
value: [measureFactory.sum(DM.Admissions.Cost_of_admission)],
|
|
1456
|
+
breakBy: [],
|
|
1457
|
+
},
|
|
1745
1458
|
};
|
|
1746
1459
|
|
|
1460
|
+
onBeforeRender(options: any) {
|
|
1461
|
+
console.log('beforeRender');
|
|
1462
|
+
console.log(options);
|
|
1463
|
+
return options;
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1747
1466
|
logArguments(...args: any[]) {
|
|
1748
1467
|
console.log(args);
|
|
1749
1468
|
}
|
|
1750
1469
|
}
|
|
1751
1470
|
* ```
|
|
1752
|
-
* <img src="media://angular-
|
|
1471
|
+
* <img src="media://angular-column-chart-example.png" width="800px" />
|
|
1753
1472
|
* @group Charts
|
|
1754
1473
|
*/
|
|
1755
|
-
class
|
|
1474
|
+
class ColumnChartComponent {
|
|
1756
1475
|
constructor() {
|
|
1757
1476
|
/**
|
|
1758
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
1477
|
+
* {@inheritDoc @sisense/sdk-ui!ColumnChartProps.onDataPointClick}
|
|
1759
1478
|
*
|
|
1760
1479
|
* @category Callbacks
|
|
1761
1480
|
*/
|
|
1762
1481
|
this.dataPointClick = new EventEmitter();
|
|
1763
1482
|
/**
|
|
1764
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
1483
|
+
* {@inheritDoc @sisense/sdk-ui!ColumnChartProps.onDataPointContextMenu}
|
|
1765
1484
|
*
|
|
1766
1485
|
* @category Callbacks
|
|
1767
1486
|
*/
|
|
1768
1487
|
this.dataPointContextMenu = new EventEmitter();
|
|
1769
1488
|
/**
|
|
1770
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
1489
|
+
* {@inheritDoc @sisense/sdk-ui!ColumnChartProps.onDataPointsSelected}
|
|
1771
1490
|
*
|
|
1772
1491
|
* @category Callbacks
|
|
1773
1492
|
*/
|
|
1774
1493
|
this.dataPointsSelect = new EventEmitter();
|
|
1775
1494
|
/** @internal */
|
|
1776
|
-
this.chartType = '
|
|
1495
|
+
this.chartType = 'column';
|
|
1777
1496
|
}
|
|
1778
1497
|
}
|
|
1779
|
-
|
|
1780
|
-
|
|
1498
|
+
ColumnChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ColumnChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1499
|
+
ColumnChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ColumnChartComponent, selector: "csdk-column-chart", inputs: { dataSet: "dataSet", dataOptions: "dataOptions", filters: "filters", highlights: "highlights", styleOptions: "styleOptions", beforeRender: "beforeRender", dataReady: "dataReady" }, outputs: { dataPointClick: "dataPointClick", dataPointContextMenu: "dataPointContextMenu", dataPointsSelect: "dataPointsSelect" }, ngImport: i0, template: `
|
|
1781
1500
|
<csdk-chart
|
|
1782
1501
|
[chartType]="chartType"
|
|
1783
1502
|
[dataSet]="dataSet"
|
|
@@ -1792,10 +1511,10 @@ BoxplotChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0",
|
|
|
1792
1511
|
(dataPointsSelect)="dataPointsSelect.emit($any($event))"
|
|
1793
1512
|
/>
|
|
1794
1513
|
`, isInline: true, dependencies: [{ kind: "component", type: ChartComponent, selector: "csdk-chart", inputs: ["chartType", "dataSet", "dataOptions", "filters", "highlights", "styleOptions", "beforeRender", "dataReady"], outputs: ["dataPointClick", "dataPointContextMenu", "dataPointsSelect"] }] });
|
|
1795
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type:
|
|
1514
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ColumnChartComponent, decorators: [{
|
|
1796
1515
|
type: Component,
|
|
1797
1516
|
args: [{
|
|
1798
|
-
selector: 'csdk-
|
|
1517
|
+
selector: 'csdk-column-chart',
|
|
1799
1518
|
template: `
|
|
1800
1519
|
<csdk-chart
|
|
1801
1520
|
[chartType]="chartType"
|
|
@@ -1835,24 +1554,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1835
1554
|
}] } });
|
|
1836
1555
|
|
|
1837
1556
|
/**
|
|
1838
|
-
* A component
|
|
1839
|
-
* making it easy to identify daily patterns or anomalies
|
|
1557
|
+
* A component representing data progressively decreasing in size or quantity through a funnel shape.
|
|
1840
1558
|
*
|
|
1841
1559
|
* @example
|
|
1842
1560
|
* ```html
|
|
1843
|
-
* <csdk-
|
|
1561
|
+
* <csdk-funnel-chart
|
|
1844
1562
|
* [dataSet]="chart.dataSet"
|
|
1845
1563
|
* [dataOptions]="chart.dataOptions"
|
|
1846
|
-
* [highlights]="
|
|
1847
|
-
* [
|
|
1564
|
+
* [highlights]="filters"
|
|
1565
|
+
* [beforeRender]="onBeforeRender"
|
|
1566
|
+
* (dataPointClick)="logArguments($event)"
|
|
1567
|
+
* (dataPointContextMenu)="logArguments($event)"
|
|
1568
|
+
* (dataPointsSelect)="logArguments($event)"
|
|
1848
1569
|
* />
|
|
1849
1570
|
* ```
|
|
1850
1571
|
* ```ts
|
|
1851
1572
|
import { Component } from '@angular/core';
|
|
1852
|
-
import { measureFactory, filterFactory } from '@sisense/sdk-data';
|
|
1853
|
-
import * as DM from '../../assets/sample-
|
|
1854
|
-
import type {
|
|
1855
|
-
|
|
1573
|
+
import { measureFactory, filterFactory, Filter } from '@sisense/sdk-data';
|
|
1574
|
+
import * as DM from '../../assets/sample-healthcare-model';
|
|
1575
|
+
import type { ChartType } from '@sisense/sdk-ui-angular';
|
|
1856
1576
|
@Component({
|
|
1857
1577
|
selector: 'app-analytics',
|
|
1858
1578
|
templateUrl: './analytics.component.html',
|
|
@@ -1860,54 +1580,57 @@ import type { CalendarHeatmapChartProps } from '@sisense/sdk-ui-angular';
|
|
|
1860
1580
|
})
|
|
1861
1581
|
export class AnalyticsComponent {
|
|
1862
1582
|
DM = DM;
|
|
1583
|
+
filters = [filterFactory.members(DM.Divisions.Divison_name, ['Cardiology', 'Neurology'])];
|
|
1863
1584
|
chart = {
|
|
1585
|
+
chartType: 'column' as ChartType,
|
|
1864
1586
|
dataSet: DM.DataSource,
|
|
1865
1587
|
dataOptions: {
|
|
1866
|
-
|
|
1867
|
-
value: measureFactory.sum(DM.
|
|
1868
|
-
|
|
1869
|
-
highlights: [
|
|
1870
|
-
filterFactory.dateRange(
|
|
1871
|
-
DM.Commerce.Date.Days,
|
|
1872
|
-
'2009-11-29',
|
|
1873
|
-
'2009-12-15'
|
|
1874
|
-
),
|
|
1875
|
-
],
|
|
1876
|
-
styleOptions: {
|
|
1877
|
-
viewType: 'quarter',
|
|
1588
|
+
category: [DM.Divisions.Divison_name],
|
|
1589
|
+
value: [measureFactory.sum(DM.Admissions.Cost_of_admission)],
|
|
1590
|
+
breakBy: [],
|
|
1878
1591
|
},
|
|
1879
1592
|
};
|
|
1593
|
+
|
|
1594
|
+
onBeforeRender(options: any) {
|
|
1595
|
+
console.log('beforeRender');
|
|
1596
|
+
console.log(options);
|
|
1597
|
+
return options;
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
logArguments(...args: any[]) {
|
|
1601
|
+
console.log(args);
|
|
1602
|
+
}
|
|
1880
1603
|
}
|
|
1881
1604
|
* ```
|
|
1882
|
-
* <img src="media://angular-
|
|
1605
|
+
* <img src="media://angular-funnel-chart-example.png" width="800px" />
|
|
1883
1606
|
* @group Charts
|
|
1884
1607
|
*/
|
|
1885
|
-
class
|
|
1608
|
+
class FunnelChartComponent {
|
|
1886
1609
|
constructor() {
|
|
1887
1610
|
/**
|
|
1888
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
1611
|
+
* {@inheritDoc @sisense/sdk-ui!FunnelChartProps.onDataPointClick}
|
|
1889
1612
|
*
|
|
1890
1613
|
* @category Callbacks
|
|
1891
1614
|
*/
|
|
1892
1615
|
this.dataPointClick = new EventEmitter();
|
|
1893
1616
|
/**
|
|
1894
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
1617
|
+
* {@inheritDoc @sisense/sdk-ui!FunnelChartProps.onDataPointContextMenu}
|
|
1895
1618
|
*
|
|
1896
1619
|
* @category Callbacks
|
|
1897
1620
|
*/
|
|
1898
1621
|
this.dataPointContextMenu = new EventEmitter();
|
|
1899
1622
|
/**
|
|
1900
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
1623
|
+
* {@inheritDoc @sisense/sdk-ui!FunnelChartProps.onDataPointsSelected}
|
|
1901
1624
|
*
|
|
1902
1625
|
* @category Callbacks
|
|
1903
1626
|
*/
|
|
1904
1627
|
this.dataPointsSelect = new EventEmitter();
|
|
1905
1628
|
/** @internal */
|
|
1906
|
-
this.chartType = '
|
|
1629
|
+
this.chartType = 'funnel';
|
|
1907
1630
|
}
|
|
1908
1631
|
}
|
|
1909
|
-
|
|
1910
|
-
|
|
1632
|
+
FunnelChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FunnelChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1633
|
+
FunnelChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: FunnelChartComponent, selector: "csdk-funnel-chart", inputs: { dataSet: "dataSet", dataOptions: "dataOptions", filters: "filters", highlights: "highlights", styleOptions: "styleOptions", beforeRender: "beforeRender", dataReady: "dataReady" }, outputs: { dataPointClick: "dataPointClick", dataPointContextMenu: "dataPointContextMenu", dataPointsSelect: "dataPointsSelect" }, ngImport: i0, template: `
|
|
1911
1634
|
<csdk-chart
|
|
1912
1635
|
[chartType]="chartType"
|
|
1913
1636
|
[dataSet]="dataSet"
|
|
@@ -1922,10 +1645,10 @@ CalendarHeatmapChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "1
|
|
|
1922
1645
|
(dataPointsSelect)="dataPointsSelect.emit($any($event))"
|
|
1923
1646
|
/>
|
|
1924
1647
|
`, isInline: true, dependencies: [{ kind: "component", type: ChartComponent, selector: "csdk-chart", inputs: ["chartType", "dataSet", "dataOptions", "filters", "highlights", "styleOptions", "beforeRender", "dataReady"], outputs: ["dataPointClick", "dataPointContextMenu", "dataPointsSelect"] }] });
|
|
1925
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type:
|
|
1648
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FunnelChartComponent, decorators: [{
|
|
1926
1649
|
type: Component,
|
|
1927
1650
|
args: [{
|
|
1928
|
-
selector: 'csdk-
|
|
1651
|
+
selector: 'csdk-funnel-chart',
|
|
1929
1652
|
template: `
|
|
1930
1653
|
<csdk-chart
|
|
1931
1654
|
[chartType]="chartType"
|
|
@@ -1965,26 +1688,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1965
1688
|
}] } });
|
|
1966
1689
|
|
|
1967
1690
|
/**
|
|
1968
|
-
* A component
|
|
1969
|
-
* whose heights are proportional to the values that they represent.
|
|
1691
|
+
* A component that provides various options for displaying one or two numeric values as a number, gauge or ticker.
|
|
1970
1692
|
*
|
|
1971
1693
|
* @example
|
|
1972
1694
|
* ```html
|
|
1973
|
-
* <csdk-
|
|
1974
|
-
* [dataSet]="
|
|
1975
|
-
* [dataOptions]="
|
|
1976
|
-
* [
|
|
1977
|
-
* [
|
|
1978
|
-
* (dataPointClick)="logArguments($event)"
|
|
1979
|
-
* (dataPointContextMenu)="logArguments($event)"
|
|
1980
|
-
* (dataPointsSelect)="logArguments($event)"
|
|
1695
|
+
* <csdk-indicator-chart
|
|
1696
|
+
* [dataSet]="indicator.dataSet"
|
|
1697
|
+
* [dataOptions]="indicator.dataOptions"
|
|
1698
|
+
* [filters]="filters"
|
|
1699
|
+
* [styleOptions]="indicator.styleOptions"
|
|
1981
1700
|
* />
|
|
1982
1701
|
* ```
|
|
1983
1702
|
* ```ts
|
|
1984
1703
|
import { Component } from '@angular/core';
|
|
1985
1704
|
import { measureFactory, filterFactory } from '@sisense/sdk-data';
|
|
1986
1705
|
import * as DM from '../../assets/sample-healthcare-model';
|
|
1987
|
-
import type {
|
|
1706
|
+
import type { IndicatorStyleOptions } from '@sisense/sdk-ui-angular';
|
|
1988
1707
|
|
|
1989
1708
|
@Component({
|
|
1990
1709
|
selector: 'app-analytics',
|
|
@@ -1994,56 +1713,46 @@ import type { ChartType } from '@sisense/sdk-ui-angular';
|
|
|
1994
1713
|
export class AnalyticsComponent {
|
|
1995
1714
|
DM = DM;
|
|
1996
1715
|
filters = [filterFactory.members(DM.Divisions.Divison_name, ['Cardiology', 'Neurology'])];
|
|
1997
|
-
|
|
1998
|
-
chartType: 'column' as ChartType,
|
|
1716
|
+
indicator = {
|
|
1999
1717
|
dataSet: DM.DataSource,
|
|
2000
1718
|
dataOptions: {
|
|
2001
|
-
category: [DM.Divisions.Divison_name],
|
|
2002
1719
|
value: [measureFactory.sum(DM.Admissions.Cost_of_admission)],
|
|
2003
|
-
|
|
1720
|
+
secondary: [measureFactory.sum(DM.Admissions.Diagnosis_ID)],
|
|
2004
1721
|
},
|
|
1722
|
+
styleOptions: {
|
|
1723
|
+
indicatorComponents: {
|
|
1724
|
+
title: {
|
|
1725
|
+
shouldBeShown: true,
|
|
1726
|
+
text: 'Total Cost_of_admission',
|
|
1727
|
+
},
|
|
1728
|
+
secondaryTitle: {
|
|
1729
|
+
text: 'Total Diagnosis_ID',
|
|
1730
|
+
},
|
|
1731
|
+
ticks: {
|
|
1732
|
+
shouldBeShown: true,
|
|
1733
|
+
},
|
|
1734
|
+
labels: {
|
|
1735
|
+
shouldBeShown: true,
|
|
1736
|
+
},
|
|
1737
|
+
},
|
|
1738
|
+
subtype: 'indicator/gauge',
|
|
1739
|
+
skin: 2,
|
|
1740
|
+
} as IndicatorStyleOptions,
|
|
2005
1741
|
};
|
|
2006
1742
|
|
|
2007
|
-
onBeforeRender(options: any) {
|
|
2008
|
-
console.log('beforeRender');
|
|
2009
|
-
console.log(options);
|
|
2010
|
-
return options;
|
|
2011
|
-
}
|
|
2012
|
-
|
|
2013
|
-
logArguments(...args: any[]) {
|
|
2014
|
-
console.log(args);
|
|
2015
|
-
}
|
|
2016
1743
|
}
|
|
2017
1744
|
* ```
|
|
2018
|
-
* <img src="media://angular-
|
|
1745
|
+
* <img src="media://angular-indicator-chart-example.png" width="800px" />
|
|
2019
1746
|
* @group Charts
|
|
2020
1747
|
*/
|
|
2021
|
-
class
|
|
1748
|
+
class IndicatorChartComponent {
|
|
2022
1749
|
constructor() {
|
|
2023
|
-
/**
|
|
2024
|
-
* {@inheritDoc @sisense/sdk-ui!ColumnChartProps.onDataPointClick}
|
|
2025
|
-
*
|
|
2026
|
-
* @category Callbacks
|
|
2027
|
-
*/
|
|
2028
|
-
this.dataPointClick = new EventEmitter();
|
|
2029
|
-
/**
|
|
2030
|
-
* {@inheritDoc @sisense/sdk-ui!ColumnChartProps.onDataPointContextMenu}
|
|
2031
|
-
*
|
|
2032
|
-
* @category Callbacks
|
|
2033
|
-
*/
|
|
2034
|
-
this.dataPointContextMenu = new EventEmitter();
|
|
2035
|
-
/**
|
|
2036
|
-
* {@inheritDoc @sisense/sdk-ui!ColumnChartProps.onDataPointsSelected}
|
|
2037
|
-
*
|
|
2038
|
-
* @category Callbacks
|
|
2039
|
-
*/
|
|
2040
|
-
this.dataPointsSelect = new EventEmitter();
|
|
2041
1750
|
/** @internal */
|
|
2042
|
-
this.chartType = '
|
|
1751
|
+
this.chartType = 'indicator';
|
|
2043
1752
|
}
|
|
2044
1753
|
}
|
|
2045
|
-
|
|
2046
|
-
|
|
1754
|
+
IndicatorChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IndicatorChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1755
|
+
IndicatorChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: IndicatorChartComponent, selector: "csdk-indicator-chart", inputs: { dataSet: "dataSet", dataOptions: "dataOptions", filters: "filters", highlights: "highlights", styleOptions: "styleOptions", beforeRender: "beforeRender", dataReady: "dataReady" }, ngImport: i0, template: `
|
|
2047
1756
|
<csdk-chart
|
|
2048
1757
|
[chartType]="chartType"
|
|
2049
1758
|
[dataSet]="dataSet"
|
|
@@ -2053,15 +1762,12 @@ ColumnChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", v
|
|
|
2053
1762
|
[styleOptions]="styleOptions"
|
|
2054
1763
|
[beforeRender]="beforeRender"
|
|
2055
1764
|
[dataReady]="dataReady"
|
|
2056
|
-
(dataPointClick)="dataPointClick.emit($any($event))"
|
|
2057
|
-
(dataPointContextMenu)="dataPointContextMenu.emit($any($event))"
|
|
2058
|
-
(dataPointsSelect)="dataPointsSelect.emit($any($event))"
|
|
2059
1765
|
/>
|
|
2060
1766
|
`, isInline: true, dependencies: [{ kind: "component", type: ChartComponent, selector: "csdk-chart", inputs: ["chartType", "dataSet", "dataOptions", "filters", "highlights", "styleOptions", "beforeRender", "dataReady"], outputs: ["dataPointClick", "dataPointContextMenu", "dataPointsSelect"] }] });
|
|
2061
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type:
|
|
1767
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IndicatorChartComponent, decorators: [{
|
|
2062
1768
|
type: Component,
|
|
2063
1769
|
args: [{
|
|
2064
|
-
selector: 'csdk-
|
|
1770
|
+
selector: 'csdk-indicator-chart',
|
|
2065
1771
|
template: `
|
|
2066
1772
|
<csdk-chart
|
|
2067
1773
|
[chartType]="chartType"
|
|
@@ -2072,9 +1778,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2072
1778
|
[styleOptions]="styleOptions"
|
|
2073
1779
|
[beforeRender]="beforeRender"
|
|
2074
1780
|
[dataReady]="dataReady"
|
|
2075
|
-
(dataPointClick)="dataPointClick.emit($any($event))"
|
|
2076
|
-
(dataPointContextMenu)="dataPointContextMenu.emit($any($event))"
|
|
2077
|
-
(dataPointsSelect)="dataPointsSelect.emit($any($event))"
|
|
2078
1781
|
/>
|
|
2079
1782
|
`,
|
|
2080
1783
|
}]
|
|
@@ -2092,20 +1795,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2092
1795
|
type: Input
|
|
2093
1796
|
}], dataReady: [{
|
|
2094
1797
|
type: Input
|
|
2095
|
-
}], dataPointClick: [{
|
|
2096
|
-
type: Output
|
|
2097
|
-
}], dataPointContextMenu: [{
|
|
2098
|
-
type: Output
|
|
2099
|
-
}], dataPointsSelect: [{
|
|
2100
|
-
type: Output
|
|
2101
1798
|
}] } });
|
|
2102
1799
|
|
|
2103
1800
|
/**
|
|
2104
|
-
* A component
|
|
1801
|
+
* A component displaying data as a series of points connected by a line. Used to show trends or changes over time.
|
|
2105
1802
|
*
|
|
2106
1803
|
* @example
|
|
2107
1804
|
* ```html
|
|
2108
|
-
* <csdk-
|
|
1805
|
+
* <csdk-line-chart
|
|
2109
1806
|
* [dataSet]="chart.dataSet"
|
|
2110
1807
|
* [dataOptions]="chart.dataOptions"
|
|
2111
1808
|
* [highlights]="filters"
|
|
@@ -2149,35 +1846,35 @@ export class AnalyticsComponent {
|
|
|
2149
1846
|
}
|
|
2150
1847
|
}
|
|
2151
1848
|
* ```
|
|
2152
|
-
* <img src="media://angular-
|
|
1849
|
+
* <img src="media://angular-line-chart-example.png" width="800px" />
|
|
2153
1850
|
* @group Charts
|
|
2154
1851
|
*/
|
|
2155
|
-
class
|
|
1852
|
+
class LineChartComponent {
|
|
2156
1853
|
constructor() {
|
|
2157
1854
|
/**
|
|
2158
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
1855
|
+
* {@inheritDoc @sisense/sdk-ui!LineChartProps.onDataPointClick}
|
|
2159
1856
|
*
|
|
2160
1857
|
* @category Callbacks
|
|
2161
1858
|
*/
|
|
2162
1859
|
this.dataPointClick = new EventEmitter();
|
|
2163
1860
|
/**
|
|
2164
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
1861
|
+
* {@inheritDoc @sisense/sdk-ui!LineChartProps.onDataPointContextMenu}
|
|
2165
1862
|
*
|
|
2166
1863
|
* @category Callbacks
|
|
2167
1864
|
*/
|
|
2168
1865
|
this.dataPointContextMenu = new EventEmitter();
|
|
2169
1866
|
/**
|
|
2170
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
1867
|
+
* {@inheritDoc @sisense/sdk-ui!LineChartProps.onDataPointsSelected}
|
|
2171
1868
|
*
|
|
2172
1869
|
* @category Callbacks
|
|
2173
1870
|
*/
|
|
2174
1871
|
this.dataPointsSelect = new EventEmitter();
|
|
2175
1872
|
/** @internal */
|
|
2176
|
-
this.chartType = '
|
|
1873
|
+
this.chartType = 'line';
|
|
2177
1874
|
}
|
|
2178
1875
|
}
|
|
2179
|
-
|
|
2180
|
-
|
|
1876
|
+
LineChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LineChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1877
|
+
LineChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: LineChartComponent, selector: "csdk-line-chart", inputs: { dataSet: "dataSet", dataOptions: "dataOptions", filters: "filters", highlights: "highlights", styleOptions: "styleOptions", beforeRender: "beforeRender", dataReady: "dataReady" }, outputs: { dataPointClick: "dataPointClick", dataPointContextMenu: "dataPointContextMenu", dataPointsSelect: "dataPointsSelect" }, ngImport: i0, template: `
|
|
2181
1878
|
<csdk-chart
|
|
2182
1879
|
[chartType]="chartType"
|
|
2183
1880
|
[dataSet]="dataSet"
|
|
@@ -2192,10 +1889,10 @@ FunnelChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", v
|
|
|
2192
1889
|
(dataPointsSelect)="dataPointsSelect.emit($any($event))"
|
|
2193
1890
|
/>
|
|
2194
1891
|
`, isInline: true, dependencies: [{ kind: "component", type: ChartComponent, selector: "csdk-chart", inputs: ["chartType", "dataSet", "dataOptions", "filters", "highlights", "styleOptions", "beforeRender", "dataReady"], outputs: ["dataPointClick", "dataPointContextMenu", "dataPointsSelect"] }] });
|
|
2195
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type:
|
|
1892
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LineChartComponent, decorators: [{
|
|
2196
1893
|
type: Component,
|
|
2197
1894
|
args: [{
|
|
2198
|
-
selector: 'csdk-
|
|
1895
|
+
selector: 'csdk-line-chart',
|
|
2199
1896
|
template: `
|
|
2200
1897
|
<csdk-chart
|
|
2201
1898
|
[chartType]="chartType"
|
|
@@ -2235,121 +1932,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2235
1932
|
}] } });
|
|
2236
1933
|
|
|
2237
1934
|
/**
|
|
2238
|
-
* A component
|
|
2239
|
-
*
|
|
2240
|
-
* @example
|
|
2241
|
-
* ```html
|
|
2242
|
-
* <csdk-indicator-chart
|
|
2243
|
-
* [dataSet]="indicator.dataSet"
|
|
2244
|
-
* [dataOptions]="indicator.dataOptions"
|
|
2245
|
-
* [filters]="filters"
|
|
2246
|
-
* [styleOptions]="indicator.styleOptions"
|
|
2247
|
-
* />
|
|
2248
|
-
* ```
|
|
2249
|
-
* ```ts
|
|
2250
|
-
import { Component } from '@angular/core';
|
|
2251
|
-
import { measureFactory, filterFactory } from '@sisense/sdk-data';
|
|
2252
|
-
import * as DM from '../../assets/sample-healthcare-model';
|
|
2253
|
-
import type { IndicatorStyleOptions } from '@sisense/sdk-ui-angular';
|
|
2254
|
-
|
|
2255
|
-
@Component({
|
|
2256
|
-
selector: 'app-analytics',
|
|
2257
|
-
templateUrl: './analytics.component.html',
|
|
2258
|
-
styleUrls: ['./analytics.component.scss'],
|
|
2259
|
-
})
|
|
2260
|
-
export class AnalyticsComponent {
|
|
2261
|
-
DM = DM;
|
|
2262
|
-
filters = [filterFactory.members(DM.Divisions.Divison_name, ['Cardiology', 'Neurology'])];
|
|
2263
|
-
indicator = {
|
|
2264
|
-
dataSet: DM.DataSource,
|
|
2265
|
-
dataOptions: {
|
|
2266
|
-
value: [measureFactory.sum(DM.Admissions.Cost_of_admission)],
|
|
2267
|
-
secondary: [measureFactory.sum(DM.Admissions.Diagnosis_ID)],
|
|
2268
|
-
},
|
|
2269
|
-
styleOptions: {
|
|
2270
|
-
indicatorComponents: {
|
|
2271
|
-
title: {
|
|
2272
|
-
shouldBeShown: true,
|
|
2273
|
-
text: 'Total Cost_of_admission',
|
|
2274
|
-
},
|
|
2275
|
-
secondaryTitle: {
|
|
2276
|
-
text: 'Total Diagnosis_ID',
|
|
2277
|
-
},
|
|
2278
|
-
ticks: {
|
|
2279
|
-
shouldBeShown: true,
|
|
2280
|
-
},
|
|
2281
|
-
labels: {
|
|
2282
|
-
shouldBeShown: true,
|
|
2283
|
-
},
|
|
2284
|
-
},
|
|
2285
|
-
subtype: 'indicator/gauge',
|
|
2286
|
-
skin: 2,
|
|
2287
|
-
} as IndicatorStyleOptions,
|
|
2288
|
-
};
|
|
2289
|
-
|
|
2290
|
-
}
|
|
2291
|
-
* ```
|
|
2292
|
-
* <img src="media://angular-indicator-chart-example.png" width="800px" />
|
|
2293
|
-
* @group Charts
|
|
2294
|
-
*/
|
|
2295
|
-
class IndicatorChartComponent {
|
|
2296
|
-
constructor() {
|
|
2297
|
-
/** @internal */
|
|
2298
|
-
this.chartType = 'indicator';
|
|
2299
|
-
}
|
|
2300
|
-
}
|
|
2301
|
-
IndicatorChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IndicatorChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2302
|
-
IndicatorChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: IndicatorChartComponent, selector: "csdk-indicator-chart", inputs: { dataSet: "dataSet", dataOptions: "dataOptions", filters: "filters", highlights: "highlights", styleOptions: "styleOptions", beforeRender: "beforeRender", dataReady: "dataReady" }, ngImport: i0, template: `
|
|
2303
|
-
<csdk-chart
|
|
2304
|
-
[chartType]="chartType"
|
|
2305
|
-
[dataSet]="dataSet"
|
|
2306
|
-
[dataOptions]="dataOptions"
|
|
2307
|
-
[filters]="filters"
|
|
2308
|
-
[highlights]="highlights"
|
|
2309
|
-
[styleOptions]="styleOptions"
|
|
2310
|
-
[beforeRender]="beforeRender"
|
|
2311
|
-
[dataReady]="dataReady"
|
|
2312
|
-
/>
|
|
2313
|
-
`, isInline: true, dependencies: [{ kind: "component", type: ChartComponent, selector: "csdk-chart", inputs: ["chartType", "dataSet", "dataOptions", "filters", "highlights", "styleOptions", "beforeRender", "dataReady"], outputs: ["dataPointClick", "dataPointContextMenu", "dataPointsSelect"] }] });
|
|
2314
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IndicatorChartComponent, decorators: [{
|
|
2315
|
-
type: Component,
|
|
2316
|
-
args: [{
|
|
2317
|
-
selector: 'csdk-indicator-chart',
|
|
2318
|
-
template: `
|
|
2319
|
-
<csdk-chart
|
|
2320
|
-
[chartType]="chartType"
|
|
2321
|
-
[dataSet]="dataSet"
|
|
2322
|
-
[dataOptions]="dataOptions"
|
|
2323
|
-
[filters]="filters"
|
|
2324
|
-
[highlights]="highlights"
|
|
2325
|
-
[styleOptions]="styleOptions"
|
|
2326
|
-
[beforeRender]="beforeRender"
|
|
2327
|
-
[dataReady]="dataReady"
|
|
2328
|
-
/>
|
|
2329
|
-
`,
|
|
2330
|
-
}]
|
|
2331
|
-
}], propDecorators: { dataSet: [{
|
|
2332
|
-
type: Input
|
|
2333
|
-
}], dataOptions: [{
|
|
2334
|
-
type: Input
|
|
2335
|
-
}], filters: [{
|
|
2336
|
-
type: Input
|
|
2337
|
-
}], highlights: [{
|
|
2338
|
-
type: Input
|
|
2339
|
-
}], styleOptions: [{
|
|
2340
|
-
type: Input
|
|
2341
|
-
}], beforeRender: [{
|
|
2342
|
-
type: Input
|
|
2343
|
-
}], dataReady: [{
|
|
2344
|
-
type: Input
|
|
2345
|
-
}] } });
|
|
2346
|
-
|
|
2347
|
-
/**
|
|
2348
|
-
* A component displaying data as a series of points connected by a line. Used to show trends or changes over time.
|
|
1935
|
+
* A component representing data in a circular graph with the data shown as slices of a whole,
|
|
1936
|
+
* with each slice representing a proportion of the total.
|
|
2349
1937
|
*
|
|
2350
1938
|
* @example
|
|
2351
1939
|
* ```html
|
|
2352
|
-
* <csdk-
|
|
1940
|
+
* <csdk-pie-chart
|
|
2353
1941
|
* [dataSet]="chart.dataSet"
|
|
2354
1942
|
* [dataOptions]="chart.dataOptions"
|
|
2355
1943
|
* [highlights]="filters"
|
|
@@ -2361,9 +1949,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2361
1949
|
* ```
|
|
2362
1950
|
* ```ts
|
|
2363
1951
|
import { Component } from '@angular/core';
|
|
2364
|
-
import { measureFactory, filterFactory
|
|
1952
|
+
import { measureFactory, filterFactory } from '@sisense/sdk-data';
|
|
2365
1953
|
import * as DM from '../../assets/sample-healthcare-model';
|
|
2366
1954
|
import type { ChartType } from '@sisense/sdk-ui-angular';
|
|
1955
|
+
|
|
2367
1956
|
@Component({
|
|
2368
1957
|
selector: 'app-analytics',
|
|
2369
1958
|
templateUrl: './analytics.component.html',
|
|
@@ -2393,35 +1982,35 @@ export class AnalyticsComponent {
|
|
|
2393
1982
|
}
|
|
2394
1983
|
}
|
|
2395
1984
|
* ```
|
|
2396
|
-
* <img src="media://angular-
|
|
1985
|
+
* <img src="media://angular-pie-chart-example.png" width="800px" />
|
|
2397
1986
|
* @group Charts
|
|
2398
1987
|
*/
|
|
2399
|
-
class
|
|
1988
|
+
class PieChartComponent {
|
|
2400
1989
|
constructor() {
|
|
2401
1990
|
/**
|
|
2402
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
1991
|
+
* {@inheritDoc @sisense/sdk-ui!PieChartProps.onDataPointClick}
|
|
2403
1992
|
*
|
|
2404
1993
|
* @category Callbacks
|
|
2405
1994
|
*/
|
|
2406
1995
|
this.dataPointClick = new EventEmitter();
|
|
2407
1996
|
/**
|
|
2408
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
1997
|
+
* {@inheritDoc @sisense/sdk-ui!PieChartProps.onDataPointContextMenu}
|
|
2409
1998
|
*
|
|
2410
1999
|
* @category Callbacks
|
|
2411
2000
|
*/
|
|
2412
2001
|
this.dataPointContextMenu = new EventEmitter();
|
|
2413
2002
|
/**
|
|
2414
|
-
* {@inheritDoc @sisense/sdk-ui!
|
|
2003
|
+
* {@inheritDoc @sisense/sdk-ui!PieChartProps.onDataPointsSelected}
|
|
2415
2004
|
*
|
|
2416
2005
|
* @category Callbacks
|
|
2417
2006
|
*/
|
|
2418
2007
|
this.dataPointsSelect = new EventEmitter();
|
|
2419
2008
|
/** @internal */
|
|
2420
|
-
this.chartType = '
|
|
2009
|
+
this.chartType = 'pie';
|
|
2421
2010
|
}
|
|
2422
2011
|
}
|
|
2423
|
-
|
|
2424
|
-
|
|
2012
|
+
PieChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PieChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2013
|
+
PieChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PieChartComponent, selector: "csdk-pie-chart", inputs: { dataSet: "dataSet", dataOptions: "dataOptions", filters: "filters", highlights: "highlights", styleOptions: "styleOptions", beforeRender: "beforeRender", dataReady: "dataReady" }, outputs: { dataPointClick: "dataPointClick", dataPointContextMenu: "dataPointContextMenu", dataPointsSelect: "dataPointsSelect" }, ngImport: i0, template: `
|
|
2425
2014
|
<csdk-chart
|
|
2426
2015
|
[chartType]="chartType"
|
|
2427
2016
|
[dataSet]="dataSet"
|
|
@@ -2436,10 +2025,10 @@ LineChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", ver
|
|
|
2436
2025
|
(dataPointsSelect)="dataPointsSelect.emit($any($event))"
|
|
2437
2026
|
/>
|
|
2438
2027
|
`, isInline: true, dependencies: [{ kind: "component", type: ChartComponent, selector: "csdk-chart", inputs: ["chartType", "dataSet", "dataOptions", "filters", "highlights", "styleOptions", "beforeRender", "dataReady"], outputs: ["dataPointClick", "dataPointContextMenu", "dataPointsSelect"] }] });
|
|
2439
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type:
|
|
2028
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PieChartComponent, decorators: [{
|
|
2440
2029
|
type: Component,
|
|
2441
2030
|
args: [{
|
|
2442
|
-
selector: 'csdk-
|
|
2031
|
+
selector: 'csdk-pie-chart',
|
|
2443
2032
|
template: `
|
|
2444
2033
|
<csdk-chart
|
|
2445
2034
|
[chartType]="chartType"
|
|
@@ -2479,140 +2068,702 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2479
2068
|
}] } });
|
|
2480
2069
|
|
|
2481
2070
|
/**
|
|
2482
|
-
*
|
|
2483
|
-
*
|
|
2071
|
+
* Service for rendering components dynamically.
|
|
2072
|
+
*
|
|
2073
|
+
* @internal
|
|
2074
|
+
*/
|
|
2075
|
+
class DynamicRenderer {
|
|
2076
|
+
constructor(appRef, injector, envInjector) {
|
|
2077
|
+
this.appRef = appRef;
|
|
2078
|
+
this.injector = injector;
|
|
2079
|
+
this.envInjector = envInjector;
|
|
2080
|
+
}
|
|
2081
|
+
renderComponent(component, props) {
|
|
2082
|
+
const componentRef = createComponent(component, {
|
|
2083
|
+
environmentInjector: this.envInjector,
|
|
2084
|
+
elementInjector: this.injector,
|
|
2085
|
+
});
|
|
2086
|
+
// Apply props to the component instance
|
|
2087
|
+
Object.assign(componentRef.instance, props);
|
|
2088
|
+
// Attach the component to the application
|
|
2089
|
+
this.appRef.attachView(componentRef.hostView);
|
|
2090
|
+
// Get the DOM element
|
|
2091
|
+
const domElem = componentRef.hostView.rootNodes[0];
|
|
2092
|
+
// Create destroy function
|
|
2093
|
+
const destroy = () => {
|
|
2094
|
+
// Detach from application
|
|
2095
|
+
this.appRef.detachView(componentRef.hostView);
|
|
2096
|
+
// Destroy the component
|
|
2097
|
+
componentRef.destroy();
|
|
2098
|
+
};
|
|
2099
|
+
return {
|
|
2100
|
+
element: domElem,
|
|
2101
|
+
componentRef,
|
|
2102
|
+
destroy,
|
|
2103
|
+
};
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
DynamicRenderer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DynamicRenderer, deps: [{ token: i0.ApplicationRef }, { token: i0.Injector }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2107
|
+
DynamicRenderer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DynamicRenderer, providedIn: 'root' });
|
|
2108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DynamicRenderer, decorators: [{
|
|
2109
|
+
type: Injectable,
|
|
2110
|
+
args: [{ providedIn: 'root' }]
|
|
2111
|
+
}], ctorParameters: function () { return [{ type: i0.ApplicationRef }, { type: i0.Injector }, { type: i0.EnvironmentInjector }]; } });
|
|
2112
|
+
|
|
2113
|
+
/**
|
|
2114
|
+
* Service for working with custom widgets.
|
|
2115
|
+
*
|
|
2116
|
+
* @group Dashboards
|
|
2117
|
+
*/
|
|
2118
|
+
class CustomWidgetsService {
|
|
2119
|
+
constructor(
|
|
2120
|
+
/** @internal */
|
|
2121
|
+
dynamicRenderer) {
|
|
2122
|
+
this.dynamicRenderer = dynamicRenderer;
|
|
2123
|
+
this.customWidgetsMap$ = new BehaviorSubject(new Map([['tabber-buttons', TabberButtonsWidget]]));
|
|
2124
|
+
}
|
|
2125
|
+
/**
|
|
2126
|
+
* Registers a new custom widget.
|
|
2127
|
+
*
|
|
2128
|
+
* @param customWidgetType - The unique identifier for the custom widget type.
|
|
2129
|
+
* @param customWidget - The custom widget component class to register.
|
|
2130
|
+
*/
|
|
2131
|
+
registerCustomWidget(customWidgetType, customWidget) {
|
|
2132
|
+
const customWidgetPreactComponent = (props) => {
|
|
2133
|
+
const renderedComponent = this.dynamicRenderer.renderComponent(customWidget, props);
|
|
2134
|
+
return createWrapperElement(renderedComponent.element, () => renderedComponent.destroy());
|
|
2135
|
+
};
|
|
2136
|
+
const customWidgetsMap = this.customWidgetsMap$.value;
|
|
2137
|
+
if (!customWidgetsMap.has(customWidgetType)) {
|
|
2138
|
+
customWidgetsMap.set(customWidgetType, customWidgetPreactComponent);
|
|
2139
|
+
this.customWidgetsMap$.next(customWidgetsMap);
|
|
2140
|
+
}
|
|
2141
|
+
}
|
|
2142
|
+
/**
|
|
2143
|
+
* Checks if a custom widget is registered.
|
|
2144
|
+
*
|
|
2145
|
+
* @param customWidgetType - The type of the custom widget.
|
|
2146
|
+
* @returns True if the custom widget is registered, false otherwise.
|
|
2147
|
+
*/
|
|
2148
|
+
hasCustomWidget(customWidgetType) {
|
|
2149
|
+
return this.customWidgetsMap$.value.has(customWidgetType);
|
|
2150
|
+
}
|
|
2151
|
+
}
|
|
2152
|
+
CustomWidgetsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CustomWidgetsService, deps: [{ token: DynamicRenderer }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2153
|
+
CustomWidgetsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CustomWidgetsService, providedIn: 'root' });
|
|
2154
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CustomWidgetsService, decorators: [{
|
|
2155
|
+
type: Injectable,
|
|
2156
|
+
args: [{
|
|
2157
|
+
providedIn: 'root',
|
|
2158
|
+
}]
|
|
2159
|
+
}], ctorParameters: function () { return [{ type: DynamicRenderer }]; } });
|
|
2160
|
+
|
|
2161
|
+
function translateToPreactWidgetProps(widgetProps) {
|
|
2162
|
+
const { beforeRender, dataReady, beforeMenuOpen, dataPointClick, dataPointContextMenu, dataPointsSelect } = widgetProps, commonWidgetProps = __rest(widgetProps, ["beforeRender", "dataReady", "beforeMenuOpen", "dataPointClick", "dataPointContextMenu", "dataPointsSelect"]);
|
|
2163
|
+
return Object.assign(Object.assign({}, commonWidgetProps), { onBeforeRender: beforeRender, onDataReady: dataReady, onBeforeMenuOpen: beforeMenuOpen, onDataPointClick: dataPointClick
|
|
2164
|
+
? (...[point, nativeEvent]) => dataPointClick({
|
|
2165
|
+
point,
|
|
2166
|
+
nativeEvent,
|
|
2167
|
+
})
|
|
2168
|
+
: undefined, onDataPointContextMenu: dataPointContextMenu
|
|
2169
|
+
? (...[point, nativeEvent]) => dataPointContextMenu({
|
|
2170
|
+
point,
|
|
2171
|
+
nativeEvent,
|
|
2172
|
+
})
|
|
2173
|
+
: undefined, onDataPointsSelected: dataPointsSelect
|
|
2174
|
+
? (...[points, nativeEvent]) => dataPointsSelect({ points, nativeEvent })
|
|
2175
|
+
: undefined });
|
|
2176
|
+
}
|
|
2177
|
+
function translateFromPreactWidgetProps(widgetProps) {
|
|
2178
|
+
const { onBeforeRender, onDataReady, onBeforeMenuOpen, onDataPointClick, onDataPointContextMenu, onDataPointsSelected } = widgetProps, commonWidgetProps = __rest(widgetProps, ["onBeforeRender", "onDataReady", "onBeforeMenuOpen", "onDataPointClick", "onDataPointContextMenu", "onDataPointsSelected"]);
|
|
2179
|
+
return Object.assign(Object.assign({}, commonWidgetProps), { beforeRender: onBeforeRender, dataReady: onDataReady, beforeMenuOpen: onBeforeMenuOpen, dataPointClick: onDataPointClick
|
|
2180
|
+
? ({ point, nativeEvent }) => onDataPointClick(point, nativeEvent)
|
|
2181
|
+
: undefined, dataPointContextMenu: onDataPointContextMenu
|
|
2182
|
+
? ({ point, nativeEvent }) => onDataPointContextMenu(point, nativeEvent)
|
|
2183
|
+
: undefined, dataPointsSelect: onDataPointsSelected
|
|
2184
|
+
? ({ points, nativeEvent }) => onDataPointsSelected(points, nativeEvent)
|
|
2185
|
+
: undefined });
|
|
2186
|
+
}
|
|
2187
|
+
|
|
2188
|
+
function translateToPreactDashboardProps(dashboardProps) {
|
|
2189
|
+
return Object.assign(Object.assign({}, dashboardProps), { widgets: dashboardProps.widgets.map(translateToPreactWidgetProps) });
|
|
2190
|
+
}
|
|
2191
|
+
function translateFromPreactDashboardProps(dashboardProps) {
|
|
2192
|
+
return Object.assign(Object.assign({}, dashboardProps), { widgets: dashboardProps.widgets.map(translateFromPreactWidgetProps) });
|
|
2193
|
+
}
|
|
2194
|
+
|
|
2195
|
+
/**
|
|
2196
|
+
* Service for working with Sisense Fusion dashboards.
|
|
2197
|
+
*
|
|
2198
|
+
* **Note:** Dashboard and Widget extensions based on JS scripts and add-ons in Fusion – for example, Blox and Jump To Dashboard – are not supported.
|
|
2199
|
+
*
|
|
2200
|
+
* @group Fusion Assets
|
|
2201
|
+
* @fusionEmbed
|
|
2202
|
+
*/
|
|
2203
|
+
let DashboardService = class DashboardService {
|
|
2204
|
+
constructor(sisenseContextService) {
|
|
2205
|
+
this.sisenseContextService = sisenseContextService;
|
|
2206
|
+
}
|
|
2207
|
+
/**
|
|
2208
|
+
* Retrieves an existing dashboard model from the Sisense instance.
|
|
2209
|
+
*
|
|
2210
|
+
* @param dashboardOid - Identifier of the dashboard
|
|
2211
|
+
* @param options - Advanced configuration options
|
|
2212
|
+
* @returns Dashboard model
|
|
2213
|
+
*/
|
|
2214
|
+
getDashboardModel(dashboardOid, options) {
|
|
2215
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2216
|
+
const app = yield this.sisenseContextService.getApp();
|
|
2217
|
+
return getDashboardModel(app.httpClient, dashboardOid, options);
|
|
2218
|
+
});
|
|
2219
|
+
}
|
|
2220
|
+
/**
|
|
2221
|
+
* Retrieves existing dashboard models from the Sisense instance.
|
|
2222
|
+
*
|
|
2223
|
+
* @param options - Advanced configuration options
|
|
2224
|
+
* @returns Dashboard models array
|
|
2225
|
+
*/
|
|
2226
|
+
getDashboardModels(options) {
|
|
2227
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2228
|
+
const app = yield this.sisenseContextService.getApp();
|
|
2229
|
+
return getDashboardModels(app.httpClient, options);
|
|
2230
|
+
});
|
|
2231
|
+
}
|
|
2232
|
+
/**
|
|
2233
|
+
* Сomposes dashboard or separate dashboard elements into a coordinated dashboard
|
|
2234
|
+
* with cross filtering, and change detection.
|
|
2235
|
+
*
|
|
2236
|
+
* @example
|
|
2237
|
+
* An example of using the `createComposedDashboard` to construct a composed dashboard and render it:
|
|
2238
|
+
* ```html
|
|
2239
|
+
<!--Component HTML template in example.component.html-->
|
|
2240
|
+
<div *ngIf="dashboard$ | async as dashboard">
|
|
2241
|
+
<csdk-filter-tile
|
|
2242
|
+
*ngFor="let filter of getDashboardFilters(dashboard); trackBy: trackByIndex"
|
|
2243
|
+
[filter]="filter"
|
|
2244
|
+
/>
|
|
2245
|
+
<csdk-widget
|
|
2246
|
+
*ngFor="let widget of dashboard.widgets; trackBy: trackByIndex"
|
|
2247
|
+
[id]="widget.id"
|
|
2248
|
+
[widgetType]="widget.widgetType"
|
|
2249
|
+
[chartType]="widget.chartType"
|
|
2250
|
+
[customWidgetType]="widget.customWidgetType"
|
|
2251
|
+
[dataSource]="widget.dataSource"
|
|
2252
|
+
[dataOptions]="widget.dataOptions"
|
|
2253
|
+
[filters]="widget.filters"
|
|
2254
|
+
[highlights]="widget.highlights"
|
|
2255
|
+
[styleOptions]="widget.styleOptions"
|
|
2256
|
+
[drilldownOptions]="widget.drilldownOptions"
|
|
2257
|
+
[title]="widget.title"
|
|
2258
|
+
[description]="widget.description"
|
|
2259
|
+
[beforeMenuOpen]="widget.beforeMenuOpen"
|
|
2260
|
+
(dataPointClick)="widget.dataPointClick?.($event)"
|
|
2261
|
+
(dataPointContextMenu)="widget.dataPointContextMenu?.($event)"
|
|
2262
|
+
(dataPointsSelect)="widget.dataPointsSelect?.($event)"
|
|
2263
|
+
/>
|
|
2264
|
+
</div>
|
|
2265
|
+
* ```
|
|
2266
|
+
*
|
|
2267
|
+
* ```ts
|
|
2268
|
+
// Component behavior in example.component.ts
|
|
2269
|
+
import { Component, OnDestroy } from '@angular/core';
|
|
2270
|
+
import { BehaviorSubject } from 'rxjs';
|
|
2271
|
+
import { DashboardService, type DashboardProps } from '@sisense/sdk-ui-angular';
|
|
2272
|
+
|
|
2273
|
+
@Component({
|
|
2274
|
+
selector: 'example',
|
|
2275
|
+
templateUrl: './example.component.html',
|
|
2276
|
+
styleUrls: ['./example.component.scss'],
|
|
2277
|
+
})
|
|
2278
|
+
export class ExampleComponent implements OnDestroy {
|
|
2279
|
+
dashboard$: BehaviorSubject<DashboardProps> | undefined;
|
|
2280
|
+
private composedDashboard: ReturnType<DashboardService['createComposedDashboard']> | undefined;
|
|
2281
|
+
|
|
2282
|
+
constructor(private dashboardService: DashboardService) {}
|
|
2283
|
+
|
|
2284
|
+
ngOnInit() {
|
|
2285
|
+
const initialDashboard: DashboardProps = { ... };
|
|
2286
|
+
this.composedDashboard = this.dashboardService.createComposedDashboard(initialDashboard);
|
|
2287
|
+
this.dashboard$ = this.composedDashboard.dashboard$;
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
ngOnDestroy() {
|
|
2291
|
+
this.composedDashboard?.destroy();
|
|
2292
|
+
}
|
|
2293
|
+
|
|
2294
|
+
trackByIndex = (index: number) => index;
|
|
2295
|
+
|
|
2296
|
+
getDashboardFilters = ({ filters }: DashboardProps) => Array.isArray(filters) ? filters : [];
|
|
2297
|
+
}
|
|
2298
|
+
* ```
|
|
2299
|
+
* @param initialDashboard - Initial dashboard
|
|
2300
|
+
* @param options - Configuration options
|
|
2301
|
+
* @returns Reactive composed dashboard object and API methods for interacting with it.
|
|
2302
|
+
* The returned object includes a `destroy()` method that should be called when
|
|
2303
|
+
* the dashboard is no longer needed to prevent memory leaks (e.g., in `ngOnDestroy`).
|
|
2304
|
+
*/
|
|
2305
|
+
createComposedDashboard(initialDashboard, options = {}) {
|
|
2306
|
+
const hookAdapter = new HookAdapter((useComposedDashboardInternal), [createSisenseContextConnector(this.sisenseContextService)]);
|
|
2307
|
+
const dashboard$ = new BehaviorSubject(initialDashboard);
|
|
2308
|
+
hookAdapter.subscribe(({ dashboard }) => {
|
|
2309
|
+
dashboard$.next(translateFromPreactDashboardProps(dashboard));
|
|
2310
|
+
});
|
|
2311
|
+
hookAdapter.run(translateToPreactDashboardProps(initialDashboard), options);
|
|
2312
|
+
const setFilters = createHookApiFacade(hookAdapter, 'setFilters', true);
|
|
2313
|
+
const setWidgetsLayout = createHookApiFacade(hookAdapter, 'setWidgetsLayout', true);
|
|
2314
|
+
const destroy = () => {
|
|
2315
|
+
hookAdapter.destroy();
|
|
2316
|
+
dashboard$.complete();
|
|
2317
|
+
};
|
|
2318
|
+
return {
|
|
2319
|
+
dashboard$,
|
|
2320
|
+
setFilters,
|
|
2321
|
+
setWidgetsLayout,
|
|
2322
|
+
destroy,
|
|
2323
|
+
};
|
|
2324
|
+
}
|
|
2325
|
+
};
|
|
2326
|
+
DashboardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DashboardService, deps: [{ token: SisenseContextService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2327
|
+
DashboardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DashboardService, providedIn: 'root' });
|
|
2328
|
+
DashboardService = __decorate([
|
|
2329
|
+
TrackableService(['getDashboardModel', 'getDashboardModels'])
|
|
2330
|
+
], DashboardService);
|
|
2331
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DashboardService, decorators: [{
|
|
2332
|
+
type: Injectable,
|
|
2333
|
+
args: [{
|
|
2334
|
+
providedIn: 'root',
|
|
2335
|
+
}]
|
|
2336
|
+
}], ctorParameters: function () { return [{ type: SisenseContextService }]; } });
|
|
2337
|
+
|
|
2338
|
+
/**
|
|
2339
|
+
* Service for working with filter.
|
|
2340
|
+
*
|
|
2341
|
+
* @group Filters
|
|
2342
|
+
*/
|
|
2343
|
+
let FilterService = class FilterService {
|
|
2344
|
+
constructor(sisenseContextService) {
|
|
2345
|
+
this.sisenseContextService = sisenseContextService;
|
|
2346
|
+
}
|
|
2347
|
+
/**
|
|
2348
|
+
* Retrieves members of the provided filter.
|
|
2349
|
+
*
|
|
2350
|
+
* Those members can be used to display a list of members in a third-party filter component such as Material UI Select.
|
|
2351
|
+
*
|
|
2352
|
+
* ## Example
|
|
2353
|
+
*
|
|
2354
|
+
* Retrieve selected members from a Filter on Country of the Sample ECommerce data model.
|
|
2355
|
+
*
|
|
2356
|
+
* ```ts
|
|
2357
|
+
* try {
|
|
2358
|
+
* const data = await filterService.getFilterMembers({
|
|
2359
|
+
* filter: filterFactory.members(DM.Country.Country, ['United States', 'Canada'])
|
|
2360
|
+
* });
|
|
2361
|
+
*
|
|
2362
|
+
* const { selectedMembers, allMembers, excludeMembers, enableMultiSelection } = data;
|
|
2363
|
+
* console.log('selectedMembers', selectedMembers);
|
|
2364
|
+
* } catch (error) {
|
|
2365
|
+
* console.error('Error:', error);
|
|
2366
|
+
* }
|
|
2367
|
+
* ```
|
|
2368
|
+
*
|
|
2369
|
+
* @param params - Parameters for retrieving filter members
|
|
2370
|
+
* @returns Promise that resolves to the filter members data
|
|
2371
|
+
*/
|
|
2372
|
+
getFilterMembers(params) {
|
|
2373
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2374
|
+
const hookAdapter = new HookAdapter(useGetFilterMembers, [
|
|
2375
|
+
createSisenseContextConnector(this.sisenseContextService),
|
|
2376
|
+
]);
|
|
2377
|
+
const resultPromise = new Promise((resolve, reject) => {
|
|
2378
|
+
hookAdapter.subscribe((res) => {
|
|
2379
|
+
const { isError, isSuccess, error } = res;
|
|
2380
|
+
if (isError) {
|
|
2381
|
+
reject(error);
|
|
2382
|
+
}
|
|
2383
|
+
else if (isSuccess) {
|
|
2384
|
+
resolve(res.data);
|
|
2385
|
+
}
|
|
2386
|
+
});
|
|
2387
|
+
});
|
|
2388
|
+
hookAdapter.run(params);
|
|
2389
|
+
return resultPromise.finally(() => {
|
|
2390
|
+
hookAdapter.destroy();
|
|
2391
|
+
});
|
|
2392
|
+
});
|
|
2393
|
+
}
|
|
2394
|
+
};
|
|
2395
|
+
FilterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FilterService, deps: [{ token: SisenseContextService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2396
|
+
FilterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FilterService, providedIn: 'root' });
|
|
2397
|
+
FilterService = __decorate([
|
|
2398
|
+
TrackableService(['getFilterMembers'])
|
|
2399
|
+
], FilterService);
|
|
2400
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FilterService, decorators: [{
|
|
2401
|
+
type: Injectable,
|
|
2402
|
+
args: [{
|
|
2403
|
+
providedIn: 'root',
|
|
2404
|
+
}]
|
|
2405
|
+
}], ctorParameters: function () { return [{ type: SisenseContextService }]; } });
|
|
2406
|
+
|
|
2407
|
+
/**
|
|
2408
|
+
* Service for working with Sisense Fusion hierarchies.
|
|
2409
|
+
*
|
|
2410
|
+
* @group Fusion Assets
|
|
2411
|
+
* @fusionEmbed
|
|
2412
|
+
*/
|
|
2413
|
+
let HierarchyService = class HierarchyService {
|
|
2414
|
+
constructor(sisenseContextService) {
|
|
2415
|
+
this.sisenseContextService = sisenseContextService;
|
|
2416
|
+
}
|
|
2417
|
+
/**
|
|
2418
|
+
* Retrieves existing hierarchy models from the Sisense instance.
|
|
2419
|
+
*
|
|
2420
|
+
* @param params - Parameters to identify the target hierarchy models
|
|
2421
|
+
* @returns Hierarchy models array
|
|
2422
|
+
*/
|
|
2423
|
+
getHierarchyModels(params) {
|
|
2424
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2425
|
+
const app = yield this.sisenseContextService.getApp();
|
|
2426
|
+
return getHierarchyModels(app.httpClient, params, app.defaultDataSource);
|
|
2427
|
+
});
|
|
2428
|
+
}
|
|
2429
|
+
};
|
|
2430
|
+
HierarchyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HierarchyService, deps: [{ token: SisenseContextService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2431
|
+
HierarchyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HierarchyService, providedIn: 'root' });
|
|
2432
|
+
HierarchyService = __decorate([
|
|
2433
|
+
TrackableService(['getHierarchyModels'])
|
|
2434
|
+
], HierarchyService);
|
|
2435
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: HierarchyService, decorators: [{
|
|
2436
|
+
type: Injectable,
|
|
2437
|
+
args: [{
|
|
2438
|
+
providedIn: 'root',
|
|
2439
|
+
}]
|
|
2440
|
+
}], ctorParameters: function () { return [{ type: SisenseContextService }]; } });
|
|
2441
|
+
|
|
2442
|
+
/**
|
|
2443
|
+
* Service for executing data queries.
|
|
2444
|
+
*
|
|
2445
|
+
* @group Queries
|
|
2446
|
+
*/
|
|
2447
|
+
let QueryService = class QueryService {
|
|
2448
|
+
constructor(sisenseContextService) {
|
|
2449
|
+
this.sisenseContextService = sisenseContextService;
|
|
2450
|
+
}
|
|
2451
|
+
/**
|
|
2452
|
+
* Executes a data query. If you want to display the query results, you can use
|
|
2453
|
+
* them to populate Compose SDK UI elements or third party UI elements.
|
|
2454
|
+
*
|
|
2455
|
+
* To learn how to populate third party UI elements with query results, see the
|
|
2456
|
+
* [External Charts Guide](/guides/sdk/guides/charts/guide-external-charts.html#query)
|
|
2457
|
+
*
|
|
2458
|
+
* @param params - Query parameters
|
|
2459
|
+
* @return Query result
|
|
2460
|
+
*/
|
|
2461
|
+
executeQuery(params) {
|
|
2462
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2463
|
+
const { dataSource, dimensions, measures, filters, highlights, count, offset, ungroup, beforeQuery, } = params;
|
|
2464
|
+
const app = yield this.sisenseContextService.getApp();
|
|
2465
|
+
const { filters: filterList, relations: filterRelations } = getFilterListAndRelationsJaql(filters);
|
|
2466
|
+
const data = yield executeQuery({
|
|
2467
|
+
dataSource,
|
|
2468
|
+
dimensions,
|
|
2469
|
+
measures,
|
|
2470
|
+
filters: filterList,
|
|
2471
|
+
filterRelations,
|
|
2472
|
+
highlights,
|
|
2473
|
+
count,
|
|
2474
|
+
offset,
|
|
2475
|
+
ungroup,
|
|
2476
|
+
}, app, { onBeforeQuery: beforeQuery });
|
|
2477
|
+
return { data };
|
|
2478
|
+
});
|
|
2479
|
+
}
|
|
2480
|
+
/**
|
|
2481
|
+
* Executes a data query extracted from an existing widget in the Sisense instance.
|
|
2482
|
+
*
|
|
2483
|
+
* @param params - Parameters to identify the target widget
|
|
2484
|
+
* @returns Query result
|
|
2485
|
+
*/
|
|
2486
|
+
executeQueryByWidgetId(params) {
|
|
2487
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2488
|
+
const app = yield this.sisenseContextService.getApp();
|
|
2489
|
+
return executeQueryByWidgetId(Object.assign(Object.assign({}, params), { app, onBeforeQuery: params.beforeQuery }));
|
|
2490
|
+
});
|
|
2491
|
+
}
|
|
2492
|
+
/**
|
|
2493
|
+
* Executes a data query for a pivot table.
|
|
2494
|
+
*
|
|
2495
|
+
* @param params - Pivot query parameters
|
|
2496
|
+
* @return Pivot query result
|
|
2497
|
+
*/
|
|
2498
|
+
executePivotQuery(params) {
|
|
2499
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2500
|
+
const { dataSource, rows, columns, values, grandTotals, filters, highlights, count, offset, beforeQuery, } = params;
|
|
2501
|
+
const { filters: filterList, relations: filterRelations } = getFilterListAndRelationsJaql(filters);
|
|
2502
|
+
const app = yield this.sisenseContextService.getApp();
|
|
2503
|
+
const data = yield executePivotQuery({
|
|
2504
|
+
dataSource,
|
|
2505
|
+
rows,
|
|
2506
|
+
columns,
|
|
2507
|
+
values,
|
|
2508
|
+
grandTotals,
|
|
2509
|
+
filters: filterList,
|
|
2510
|
+
filterRelations,
|
|
2511
|
+
highlights,
|
|
2512
|
+
count,
|
|
2513
|
+
offset,
|
|
2514
|
+
}, app, { onBeforeQuery: beforeQuery });
|
|
2515
|
+
return { data };
|
|
2516
|
+
});
|
|
2517
|
+
}
|
|
2518
|
+
/**
|
|
2519
|
+
* Executes a CSV data query.
|
|
2520
|
+
* Similar to {@link QueryService.executeQuery}, but returns the data in CSV format as text or as a stream.
|
|
2521
|
+
*
|
|
2522
|
+
* @param params - CSV query parameters
|
|
2523
|
+
* @return CSV query result
|
|
2524
|
+
*/
|
|
2525
|
+
executeCsvQuery(params) {
|
|
2526
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2527
|
+
const hookAdapter = new HookAdapter(useExecuteCsvQueryInternal, [
|
|
2528
|
+
createSisenseContextConnector(this.sisenseContextService),
|
|
2529
|
+
]);
|
|
2530
|
+
const resultPromise = new Promise((resolve, reject) => {
|
|
2531
|
+
hookAdapter.subscribe((res) => {
|
|
2532
|
+
const { data, isSuccess, isError, error } = res;
|
|
2533
|
+
if (isSuccess) {
|
|
2534
|
+
resolve({ data });
|
|
2535
|
+
}
|
|
2536
|
+
else if (isError) {
|
|
2537
|
+
reject(error);
|
|
2538
|
+
}
|
|
2539
|
+
});
|
|
2540
|
+
});
|
|
2541
|
+
hookAdapter.run(params);
|
|
2542
|
+
return resultPromise.finally(() => {
|
|
2543
|
+
hookAdapter.destroy();
|
|
2544
|
+
});
|
|
2545
|
+
});
|
|
2546
|
+
}
|
|
2547
|
+
/**
|
|
2548
|
+
* Executes a data query from custom widget component props.
|
|
2549
|
+
*
|
|
2550
|
+
* This method takes custom widget props (dataSource, dataOptions, filters, etc.)
|
|
2551
|
+
* and executes the appropriate data query
|
|
2552
|
+
*
|
|
2553
|
+
* @param params - Custom widget component props containing data source, data options, filters, etc.
|
|
2554
|
+
* @returns Promise resolving to query result with formatted data
|
|
2555
|
+
*/
|
|
2556
|
+
executeCustomWidgetQuery(params) {
|
|
2557
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2558
|
+
const hookAdapter = new HookAdapter(useExecuteCustomWidgetQueryInternal, [
|
|
2559
|
+
createSisenseContextConnector(this.sisenseContextService),
|
|
2560
|
+
]);
|
|
2561
|
+
const resultPromise = new Promise((resolve, reject) => {
|
|
2562
|
+
hookAdapter.subscribe((res) => {
|
|
2563
|
+
const { data, isSuccess, isError, error } = res;
|
|
2564
|
+
if (isSuccess) {
|
|
2565
|
+
resolve({ data });
|
|
2566
|
+
}
|
|
2567
|
+
else if (isError) {
|
|
2568
|
+
reject(error);
|
|
2569
|
+
}
|
|
2570
|
+
});
|
|
2571
|
+
});
|
|
2572
|
+
hookAdapter.run(params);
|
|
2573
|
+
return resultPromise.finally(() => {
|
|
2574
|
+
hookAdapter.destroy();
|
|
2575
|
+
});
|
|
2576
|
+
});
|
|
2577
|
+
}
|
|
2578
|
+
};
|
|
2579
|
+
QueryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: QueryService, deps: [{ token: SisenseContextService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2580
|
+
QueryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: QueryService, providedIn: 'root' });
|
|
2581
|
+
QueryService = __decorate([
|
|
2582
|
+
TrackableService([
|
|
2583
|
+
'executeQuery',
|
|
2584
|
+
'executeQueryByWidgetId',
|
|
2585
|
+
'executePivotQuery',
|
|
2586
|
+
'executeCustomWidgetQuery',
|
|
2587
|
+
])
|
|
2588
|
+
], QueryService);
|
|
2589
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: QueryService, decorators: [{
|
|
2590
|
+
type: Injectable,
|
|
2591
|
+
args: [{
|
|
2592
|
+
providedIn: 'root',
|
|
2593
|
+
}]
|
|
2594
|
+
}], ctorParameters: function () { return [{ type: SisenseContextService }]; } });
|
|
2595
|
+
|
|
2596
|
+
/**
|
|
2597
|
+
* Service for working with Sisense Fusion widgets.
|
|
2484
2598
|
*
|
|
2485
|
-
* @
|
|
2486
|
-
*
|
|
2487
|
-
* <csdk-pie-chart
|
|
2488
|
-
* [dataSet]="chart.dataSet"
|
|
2489
|
-
* [dataOptions]="chart.dataOptions"
|
|
2490
|
-
* [highlights]="filters"
|
|
2491
|
-
* [beforeRender]="onBeforeRender"
|
|
2492
|
-
* (dataPointClick)="logArguments($event)"
|
|
2493
|
-
* (dataPointContextMenu)="logArguments($event)"
|
|
2494
|
-
* (dataPointsSelect)="logArguments($event)"
|
|
2495
|
-
* />
|
|
2496
|
-
* ```
|
|
2497
|
-
* ```ts
|
|
2498
|
-
import { Component } from '@angular/core';
|
|
2499
|
-
import { measureFactory, filterFactory } from '@sisense/sdk-data';
|
|
2500
|
-
import * as DM from '../../assets/sample-healthcare-model';
|
|
2501
|
-
import type { ChartType } from '@sisense/sdk-ui-angular';
|
|
2502
|
-
|
|
2503
|
-
@Component({
|
|
2504
|
-
selector: 'app-analytics',
|
|
2505
|
-
templateUrl: './analytics.component.html',
|
|
2506
|
-
styleUrls: ['./analytics.component.scss'],
|
|
2507
|
-
})
|
|
2508
|
-
export class AnalyticsComponent {
|
|
2509
|
-
DM = DM;
|
|
2510
|
-
filters = [filterFactory.members(DM.Divisions.Divison_name, ['Cardiology', 'Neurology'])];
|
|
2511
|
-
chart = {
|
|
2512
|
-
chartType: 'column' as ChartType,
|
|
2513
|
-
dataSet: DM.DataSource,
|
|
2514
|
-
dataOptions: {
|
|
2515
|
-
category: [DM.Divisions.Divison_name],
|
|
2516
|
-
value: [measureFactory.sum(DM.Admissions.Cost_of_admission)],
|
|
2517
|
-
breakBy: [],
|
|
2518
|
-
},
|
|
2519
|
-
};
|
|
2520
|
-
|
|
2521
|
-
onBeforeRender(options: any) {
|
|
2522
|
-
console.log('beforeRender');
|
|
2523
|
-
console.log(options);
|
|
2524
|
-
return options;
|
|
2525
|
-
}
|
|
2526
|
-
|
|
2527
|
-
logArguments(...args: any[]) {
|
|
2528
|
-
console.log(args);
|
|
2529
|
-
}
|
|
2530
|
-
}
|
|
2531
|
-
* ```
|
|
2532
|
-
* <img src="media://angular-pie-chart-example.png" width="800px" />
|
|
2533
|
-
* @group Charts
|
|
2599
|
+
* @group Fusion Assets
|
|
2600
|
+
* @fusionEmbed
|
|
2534
2601
|
*/
|
|
2535
|
-
class
|
|
2536
|
-
constructor() {
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
*
|
|
2540
|
-
* @category Callbacks
|
|
2541
|
-
*/
|
|
2542
|
-
this.dataPointClick = new EventEmitter();
|
|
2543
|
-
/**
|
|
2544
|
-
* {@inheritDoc @sisense/sdk-ui!PieChartProps.onDataPointContextMenu}
|
|
2545
|
-
*
|
|
2546
|
-
* @category Callbacks
|
|
2547
|
-
*/
|
|
2548
|
-
this.dataPointContextMenu = new EventEmitter();
|
|
2549
|
-
/**
|
|
2550
|
-
* {@inheritDoc @sisense/sdk-ui!PieChartProps.onDataPointsSelected}
|
|
2551
|
-
*
|
|
2552
|
-
* @category Callbacks
|
|
2553
|
-
*/
|
|
2554
|
-
this.dataPointsSelect = new EventEmitter();
|
|
2555
|
-
/** @internal */
|
|
2556
|
-
this.chartType = 'pie';
|
|
2602
|
+
let WidgetService = class WidgetService {
|
|
2603
|
+
constructor(sisenseContextService, themeService) {
|
|
2604
|
+
this.sisenseContextService = sisenseContextService;
|
|
2605
|
+
this.themeService = themeService;
|
|
2557
2606
|
}
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2607
|
+
/**
|
|
2608
|
+
* Retrieves an existing widget model from the Sisense instance.
|
|
2609
|
+
*
|
|
2610
|
+
* @param params - Parameters to identify the target widget
|
|
2611
|
+
* @returns Widget model
|
|
2612
|
+
*/
|
|
2613
|
+
getWidgetModel(params) {
|
|
2614
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2615
|
+
const { dashboardOid, widgetOid } = params;
|
|
2616
|
+
const app = yield this.sisenseContextService.getApp();
|
|
2617
|
+
return getWidgetModel(app.httpClient, dashboardOid, widgetOid);
|
|
2618
|
+
});
|
|
2619
|
+
}
|
|
2620
|
+
/**
|
|
2621
|
+
* Adds Jump To Dashboard (JTD) functionality to widget props.
|
|
2622
|
+
*
|
|
2623
|
+
* Jump To Dashboard (JTD) allows users to navigate from one dashboard to another when interacting with widgets,
|
|
2624
|
+
* such as clicking on chart data points or using context menus. This method is particularly useful when rendering
|
|
2625
|
+
* Widget components directly (not through a Dashboard component), but you still want JTD navigation functionality.
|
|
2626
|
+
*
|
|
2627
|
+
* For widgets that are part of a dashboard, consider using `applyJtdConfig` or `applyJtdConfigs` instead,
|
|
2628
|
+
* as they apply JTD configuration at the dashboard level rather than individual widget level.
|
|
2629
|
+
*
|
|
2630
|
+
* Note: dashboard-only 'includeDashboardFilters' is not supported and would just be ignored, since we do not have a dashboard in the current context.
|
|
2631
|
+
*
|
|
2632
|
+
* This method enhances the provided widget props with JTD navigation capabilities, including:
|
|
2633
|
+
* - Click and right-click event handlers for navigation
|
|
2634
|
+
* - Hyperlink styling for actionable pivot cells (when applicable)
|
|
2635
|
+
* - JTD icon display in widget headers
|
|
2636
|
+
* @example
|
|
2637
|
+
* ```TypeScript
|
|
2638
|
+
* import { Component, OnDestroy } from '@angular/core';
|
|
2639
|
+
* import {
|
|
2640
|
+
* WidgetService,
|
|
2641
|
+
* widgetModelTranslator,
|
|
2642
|
+
* type WidgetProps,
|
|
2643
|
+
* } from '@sisense/sdk-ui-angular';
|
|
2644
|
+
* import { BehaviorSubject } from 'rxjs';
|
|
2645
|
+
*
|
|
2646
|
+
* @Component({
|
|
2647
|
+
* selector: 'code-example',
|
|
2648
|
+
* template: `
|
|
2649
|
+
* <csdk-widget
|
|
2650
|
+
* *ngIf="widgetProps$ && (widgetProps$ | async) as widgetProps"
|
|
2651
|
+
* [id]="widgetProps.id"
|
|
2652
|
+
* [widgetType]="widgetProps.widgetType"
|
|
2653
|
+
* [chartType]="widgetProps.chartType"
|
|
2654
|
+
* [title]="widgetProps.title"
|
|
2655
|
+
* [dataSource]="widgetProps.dataSource"
|
|
2656
|
+
* [dataOptions]="widgetProps.dataOptions"
|
|
2657
|
+
* [filters]="widgetProps.filters"
|
|
2658
|
+
* [highlights]="widgetProps.highlights"
|
|
2659
|
+
* [styleOptions]="widgetProps.styleOptions"
|
|
2660
|
+
* [beforeMenuOpen]="widgetProps.beforeMenuOpen"
|
|
2661
|
+
* (dataPointClick)="widgetProps.dataPointClick?.($event)"
|
|
2662
|
+
* (dataPointContextMenu)="widgetProps.dataPointContextMenu?.($event)"
|
|
2663
|
+
* (dataPointsSelect)="widgetProps.dataPointsSelect?.($event)"
|
|
2664
|
+
* />
|
|
2665
|
+
* `,
|
|
2666
|
+
* })
|
|
2667
|
+
* export class CodeExample implements OnDestroy {
|
|
2668
|
+
* constructor(private widgetService: WidgetService) {}
|
|
2669
|
+
*
|
|
2670
|
+
* widgetProps$: BehaviorSubject<WidgetProps | null> | null = null;
|
|
2671
|
+
* private jtdDestroy: (() => void) | null = null;
|
|
2672
|
+
*
|
|
2673
|
+
* async ngOnInit(): Promise<void> {
|
|
2674
|
+
* const widget = await this.widgetService.getWidgetModel({
|
|
2675
|
+
* dashboardOid: '65a82171719e7f004018691c',
|
|
2676
|
+
* widgetOid: '65a82171719e7f004018691f',
|
|
2677
|
+
* });
|
|
2678
|
+
*
|
|
2679
|
+
* const baseProps = widget
|
|
2680
|
+
* ? widgetModelTranslator.toWidgetProps(widget)
|
|
2681
|
+
* : null;
|
|
2682
|
+
*
|
|
2683
|
+
* if (baseProps) {
|
|
2684
|
+
* const jtdConfig = {
|
|
2685
|
+
* targets: [{ id: 'target-dashboard-id', caption: 'Details' }],
|
|
2686
|
+
* interaction: { triggerMethod: 'rightclick' },
|
|
2687
|
+
* };
|
|
2688
|
+
* const jtdResult = this.widgetService.createJtdWidget(
|
|
2689
|
+
* baseProps,
|
|
2690
|
+
* jtdConfig,
|
|
2691
|
+
* );
|
|
2692
|
+
* this.widgetProps$ = jtdResult.widget$;
|
|
2693
|
+
* this.jtdDestroy = jtdResult.destroy;
|
|
2694
|
+
* }
|
|
2695
|
+
* }
|
|
2696
|
+
*
|
|
2697
|
+
* ngOnDestroy(): void {
|
|
2698
|
+
* this.jtdDestroy?.();
|
|
2699
|
+
* }
|
|
2700
|
+
* }
|
|
2701
|
+
* ```
|
|
2702
|
+
*
|
|
2703
|
+
* @param widgetProps - Base widget props to enhance with JTD functionality
|
|
2704
|
+
* @param jtdConfig - JTD configuration defining navigation targets and behavior
|
|
2705
|
+
* @returns Object containing:
|
|
2706
|
+
* - `widget$`: The observable that emits enhanced widget props with JTD handlers.
|
|
2707
|
+
* - `destroy`: Function to clean up resources. Call this when the component is destroyed.
|
|
2708
|
+
* @group Dashboards
|
|
2709
|
+
*/
|
|
2710
|
+
createJtdWidget(widgetProps, jtdConfig) {
|
|
2711
|
+
// Create BehaviorSubject initialized with base props (or null)
|
|
2712
|
+
const enhancedProps$ = new BehaviorSubject(widgetProps);
|
|
2713
|
+
if (!widgetProps) {
|
|
2714
|
+
return {
|
|
2715
|
+
widget$: enhancedProps$,
|
|
2716
|
+
destroy: () => {
|
|
2717
|
+
enhancedProps$.complete();
|
|
2718
|
+
},
|
|
2719
|
+
};
|
|
2720
|
+
}
|
|
2721
|
+
// Create HookAdapter with useJtdWidget hook and context connectors
|
|
2722
|
+
const hookAdapter = new HookAdapter(useJtdWidget, [
|
|
2723
|
+
createSisenseContextConnector(this.sisenseContextService),
|
|
2724
|
+
createThemeContextConnector(this.themeService),
|
|
2725
|
+
]);
|
|
2726
|
+
// Convert Angular props to preact props
|
|
2727
|
+
const preactProps = translateToPreactWidgetProps(widgetProps);
|
|
2728
|
+
// Subscribe to hook adapter results and capture the subscription
|
|
2729
|
+
const hookAdapterSubscription = hookAdapter.subscribe((enhancedPreactProps) => {
|
|
2730
|
+
if (enhancedPreactProps) {
|
|
2731
|
+
// Convert back to Angular props
|
|
2732
|
+
const angularProps = translateFromPreactWidgetProps(enhancedPreactProps);
|
|
2733
|
+
enhancedProps$.next(angularProps);
|
|
2734
|
+
}
|
|
2735
|
+
else {
|
|
2736
|
+
enhancedProps$.next(null);
|
|
2737
|
+
}
|
|
2738
|
+
});
|
|
2739
|
+
// Run the hook with widget props and JTD config
|
|
2740
|
+
// This will trigger the subscription above asynchronously when React contexts are ready
|
|
2741
|
+
hookAdapter.run(preactProps, jtdConfig);
|
|
2742
|
+
// Return the BehaviorSubject and destroy function for cleanup
|
|
2743
|
+
return {
|
|
2744
|
+
widget$: enhancedProps$,
|
|
2745
|
+
destroy: () => {
|
|
2746
|
+
// Unsubscribe from hook adapter
|
|
2747
|
+
hookAdapterSubscription.unsubscribe();
|
|
2748
|
+
// Destroy the hook adapter to clean up React components and contexts
|
|
2749
|
+
hookAdapter.destroy();
|
|
2750
|
+
// Complete the BehaviorSubject to release subscribers and avoid leaks
|
|
2751
|
+
enhancedProps$.complete();
|
|
2752
|
+
},
|
|
2753
|
+
};
|
|
2754
|
+
}
|
|
2755
|
+
};
|
|
2756
|
+
WidgetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WidgetService, deps: [{ token: SisenseContextService }, { token: ThemeService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2757
|
+
WidgetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WidgetService, providedIn: 'root' });
|
|
2758
|
+
WidgetService = __decorate([
|
|
2759
|
+
TrackableService(['getWidgetModel', 'createJtdWidget'])
|
|
2760
|
+
], WidgetService);
|
|
2761
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WidgetService, decorators: [{
|
|
2762
|
+
type: Injectable,
|
|
2577
2763
|
args: [{
|
|
2578
|
-
|
|
2579
|
-
template: `
|
|
2580
|
-
<csdk-chart
|
|
2581
|
-
[chartType]="chartType"
|
|
2582
|
-
[dataSet]="dataSet"
|
|
2583
|
-
[dataOptions]="dataOptions"
|
|
2584
|
-
[filters]="filters"
|
|
2585
|
-
[highlights]="highlights"
|
|
2586
|
-
[styleOptions]="styleOptions"
|
|
2587
|
-
[beforeRender]="beforeRender"
|
|
2588
|
-
[dataReady]="dataReady"
|
|
2589
|
-
(dataPointClick)="dataPointClick.emit($any($event))"
|
|
2590
|
-
(dataPointContextMenu)="dataPointContextMenu.emit($any($event))"
|
|
2591
|
-
(dataPointsSelect)="dataPointsSelect.emit($any($event))"
|
|
2592
|
-
/>
|
|
2593
|
-
`,
|
|
2764
|
+
providedIn: 'root',
|
|
2594
2765
|
}]
|
|
2595
|
-
}],
|
|
2596
|
-
type: Input
|
|
2597
|
-
}], dataOptions: [{
|
|
2598
|
-
type: Input
|
|
2599
|
-
}], filters: [{
|
|
2600
|
-
type: Input
|
|
2601
|
-
}], highlights: [{
|
|
2602
|
-
type: Input
|
|
2603
|
-
}], styleOptions: [{
|
|
2604
|
-
type: Input
|
|
2605
|
-
}], beforeRender: [{
|
|
2606
|
-
type: Input
|
|
2607
|
-
}], dataReady: [{
|
|
2608
|
-
type: Input
|
|
2609
|
-
}], dataPointClick: [{
|
|
2610
|
-
type: Output
|
|
2611
|
-
}], dataPointContextMenu: [{
|
|
2612
|
-
type: Output
|
|
2613
|
-
}], dataPointsSelect: [{
|
|
2614
|
-
type: Output
|
|
2615
|
-
}] } });
|
|
2766
|
+
}], ctorParameters: function () { return [{ type: SisenseContextService }, { type: ThemeService }]; } });
|
|
2616
2767
|
|
|
2617
2768
|
/**
|
|
2618
2769
|
* Pivot Table with and pagination.
|
|
@@ -2679,6 +2830,18 @@ class PivotTableComponent {
|
|
|
2679
2830
|
constructor(sisenseContextService, themeService) {
|
|
2680
2831
|
this.sisenseContextService = sisenseContextService;
|
|
2681
2832
|
this.themeService = themeService;
|
|
2833
|
+
/**
|
|
2834
|
+
* {@inheritDoc @sisense/sdk-ui!PivotTableProps.onDataPointClick}
|
|
2835
|
+
*
|
|
2836
|
+
* @category Callbacks
|
|
2837
|
+
*/
|
|
2838
|
+
this.dataPointClick = new EventEmitter();
|
|
2839
|
+
/**
|
|
2840
|
+
* {@inheritDoc @sisense/sdk-ui!PivotTableProps.onDataPointContextMenu}
|
|
2841
|
+
*
|
|
2842
|
+
* @category Callbacks
|
|
2843
|
+
*/
|
|
2844
|
+
this.dataPointContextMenu = new EventEmitter();
|
|
2682
2845
|
this.componentAdapter = new ComponentAdapter(PivotTable, [
|
|
2683
2846
|
createSisenseContextConnector(this.sisenseContextService),
|
|
2684
2847
|
createThemeContextConnector(this.themeService),
|
|
@@ -2701,6 +2864,8 @@ class PivotTableComponent {
|
|
|
2701
2864
|
filters: this.filters,
|
|
2702
2865
|
highlights: this.highlights,
|
|
2703
2866
|
styleOptions: this.styleOptions,
|
|
2867
|
+
onDataPointClick: (...[point, nativeEvent]) => this.dataPointClick.emit({ point, nativeEvent }),
|
|
2868
|
+
onDataPointContextMenu: (...[point, nativeEvent]) => this.dataPointContextMenu.emit({ point, nativeEvent }),
|
|
2704
2869
|
};
|
|
2705
2870
|
}
|
|
2706
2871
|
/** @internal */
|
|
@@ -2709,7 +2874,7 @@ class PivotTableComponent {
|
|
|
2709
2874
|
}
|
|
2710
2875
|
}
|
|
2711
2876
|
PivotTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PivotTableComponent, deps: [{ token: SisenseContextService }, { token: ThemeService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2712
|
-
PivotTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PivotTableComponent, selector: "csdk-pivot-table", inputs: { dataSet: "dataSet", dataOptions: "dataOptions", filters: "filters", highlights: "highlights", styleOptions: "styleOptions" }, viewQueries: [{ propertyName: "preactRef", first: true, predicate: ["preact"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "\n <div #preact class=\"csdk-full-size-container\"></div>\n", isInline: true, styles: [".csdk-full-size-container{width:100%;height:100%}\n"] });
|
|
2877
|
+
PivotTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PivotTableComponent, selector: "csdk-pivot-table", inputs: { dataSet: "dataSet", dataOptions: "dataOptions", filters: "filters", highlights: "highlights", styleOptions: "styleOptions" }, outputs: { dataPointClick: "dataPointClick", dataPointContextMenu: "dataPointContextMenu" }, viewQueries: [{ propertyName: "preactRef", first: true, predicate: ["preact"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "\n <div #preact class=\"csdk-full-size-container\"></div>\n", isInline: true, styles: [".csdk-full-size-container{width:100%;height:100%}\n"] });
|
|
2713
2878
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PivotTableComponent, decorators: [{
|
|
2714
2879
|
type: Component,
|
|
2715
2880
|
args: [{ selector: 'csdk-pivot-table', template: template, styles: [".csdk-full-size-container{width:100%;height:100%}\n"] }]
|
|
@@ -2726,6 +2891,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2726
2891
|
type: Input
|
|
2727
2892
|
}], styleOptions: [{
|
|
2728
2893
|
type: Input
|
|
2894
|
+
}], dataPointClick: [{
|
|
2895
|
+
type: Output
|
|
2896
|
+
}], dataPointContextMenu: [{
|
|
2897
|
+
type: Output
|
|
2729
2898
|
}] } });
|
|
2730
2899
|
|
|
2731
2900
|
/**
|
|
@@ -5183,6 +5352,18 @@ class PivotTableWidgetComponent {
|
|
|
5183
5352
|
constructor(sisenseContextService, themeService) {
|
|
5184
5353
|
this.sisenseContextService = sisenseContextService;
|
|
5185
5354
|
this.themeService = themeService;
|
|
5355
|
+
/**
|
|
5356
|
+
* {@inheritDoc @sisense/sdk-ui!PivotTableWidgetProps.onDataPointClick}
|
|
5357
|
+
*
|
|
5358
|
+
* @category Callbacks
|
|
5359
|
+
*/
|
|
5360
|
+
this.dataPointClick = new EventEmitter();
|
|
5361
|
+
/**
|
|
5362
|
+
* {@inheritDoc @sisense/sdk-ui!PivotTableWidgetProps.onDataPointContextMenu}
|
|
5363
|
+
*
|
|
5364
|
+
* @category Callbacks
|
|
5365
|
+
*/
|
|
5366
|
+
this.dataPointContextMenu = new EventEmitter();
|
|
5186
5367
|
this.componentAdapter = new ComponentAdapter(PivotTableWidget, [
|
|
5187
5368
|
createSisenseContextConnector(this.sisenseContextService),
|
|
5188
5369
|
createThemeContextConnector(this.themeService),
|
|
@@ -5205,8 +5386,11 @@ class PivotTableWidgetComponent {
|
|
|
5205
5386
|
filters: this.filters,
|
|
5206
5387
|
highlights: this.highlights,
|
|
5207
5388
|
styleOptions: this.styleOptions,
|
|
5389
|
+
drilldownOptions: this.drilldownOptions,
|
|
5208
5390
|
title: this.title,
|
|
5209
5391
|
description: this.description,
|
|
5392
|
+
onDataPointClick: (...[point, nativeEvent]) => this.dataPointClick.emit({ point, nativeEvent }),
|
|
5393
|
+
onDataPointContextMenu: (...[point, nativeEvent]) => this.dataPointContextMenu.emit({ point, nativeEvent }),
|
|
5210
5394
|
};
|
|
5211
5395
|
}
|
|
5212
5396
|
/** @internal */
|
|
@@ -5215,7 +5399,7 @@ class PivotTableWidgetComponent {
|
|
|
5215
5399
|
}
|
|
5216
5400
|
}
|
|
5217
5401
|
PivotTableWidgetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PivotTableWidgetComponent, deps: [{ token: SisenseContextService }, { token: ThemeService }], target: i0.ɵɵFactoryTarget.Component });
|
|
5218
|
-
PivotTableWidgetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PivotTableWidgetComponent, selector: "csdk-pivot-table-widget", inputs: { dataSource: "dataSource", dataOptions: "dataOptions", filters: "filters", highlights: "highlights", styleOptions: "styleOptions", title: "title", description: "description" }, viewQueries: [{ propertyName: "preactRef", first: true, predicate: ["preact"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "\n <div #preact class=\"csdk-full-size-container\"></div>\n", isInline: true, styles: [".csdk-full-size-container{width:100%;height:100%}\n"] });
|
|
5402
|
+
PivotTableWidgetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PivotTableWidgetComponent, selector: "csdk-pivot-table-widget", inputs: { dataSource: "dataSource", dataOptions: "dataOptions", filters: "filters", highlights: "highlights", styleOptions: "styleOptions", drilldownOptions: "drilldownOptions", title: "title", description: "description" }, outputs: { dataPointClick: "dataPointClick", dataPointContextMenu: "dataPointContextMenu" }, viewQueries: [{ propertyName: "preactRef", first: true, predicate: ["preact"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "\n <div #preact class=\"csdk-full-size-container\"></div>\n", isInline: true, styles: [".csdk-full-size-container{width:100%;height:100%}\n"] });
|
|
5219
5403
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PivotTableWidgetComponent, decorators: [{
|
|
5220
5404
|
type: Component,
|
|
5221
5405
|
args: [{ selector: 'csdk-pivot-table-widget', template: template, styles: [".csdk-full-size-container{width:100%;height:100%}\n"] }]
|
|
@@ -5232,10 +5416,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
5232
5416
|
type: Input
|
|
5233
5417
|
}], styleOptions: [{
|
|
5234
5418
|
type: Input
|
|
5419
|
+
}], drilldownOptions: [{
|
|
5420
|
+
type: Input
|
|
5235
5421
|
}], title: [{
|
|
5236
5422
|
type: Input
|
|
5237
5423
|
}], description: [{
|
|
5238
5424
|
type: Input
|
|
5425
|
+
}], dataPointClick: [{
|
|
5426
|
+
type: Output
|
|
5427
|
+
}], dataPointContextMenu: [{
|
|
5428
|
+
type: Output
|
|
5239
5429
|
}] } });
|
|
5240
5430
|
|
|
5241
5431
|
/**
|
|
@@ -6255,6 +6445,57 @@ const textWidgetProps = widgetModelTranslator.toTextWidgetProps(widgetModel);
|
|
|
6255
6445
|
function toTextWidgetProps(widgetModel) {
|
|
6256
6446
|
return widgetModelTranslator$1.toTextWidgetProps(widgetModel);
|
|
6257
6447
|
}
|
|
6448
|
+
/**
|
|
6449
|
+
* Translates {@link WidgetModel} to {@link WidgetProps}.
|
|
6450
|
+
*
|
|
6451
|
+
* @example
|
|
6452
|
+
* ```html
|
|
6453
|
+
* <csdk-widget
|
|
6454
|
+
* *ngIf="widgetProps"
|
|
6455
|
+
* [id]="widgetProps.id"
|
|
6456
|
+
* [widgetType]="widgetProps.widgetType"
|
|
6457
|
+
* [chartType]="widgetProps.chartType"
|
|
6458
|
+
* [dataSource]="widgetProps.dataSource"
|
|
6459
|
+
* [dataOptions]="widgetProps.dataOptions"
|
|
6460
|
+
* [filters]="widgetProps.filters"
|
|
6461
|
+
* [highlights]="widgetProps.highlights"
|
|
6462
|
+
* [styleOptions]="widgetProps.styleOptions"
|
|
6463
|
+
* [title]="widgetProps.title"
|
|
6464
|
+
* [description]="widgetProps.description"
|
|
6465
|
+
* />
|
|
6466
|
+
* ```
|
|
6467
|
+
*
|
|
6468
|
+
* ```ts
|
|
6469
|
+
* import { Component } from '@angular/core';
|
|
6470
|
+
* import {
|
|
6471
|
+
* type WidgetProps,
|
|
6472
|
+
* WidgetService,
|
|
6473
|
+
* widgetModelTranslator,
|
|
6474
|
+
* } from '@sisense/sdk-ui-angular';
|
|
6475
|
+
*
|
|
6476
|
+
* @Component({
|
|
6477
|
+
* selector: 'app-example',
|
|
6478
|
+
* templateUrl: './example.component.html',
|
|
6479
|
+
* styleUrls: ['./example.component.scss'],
|
|
6480
|
+
* })
|
|
6481
|
+
* export class ExampleComponent {
|
|
6482
|
+
* widgetProps: WidgetProps | null = null;
|
|
6483
|
+
*
|
|
6484
|
+
* constructor(private widgetService: WidgetService) {}
|
|
6485
|
+
*
|
|
6486
|
+
* async ngOnInit(): Promise<void> {
|
|
6487
|
+
* const widgetModel = await widgetService.getWidgetModel({
|
|
6488
|
+
* dashboardOid: 'your-dashboard-oid',
|
|
6489
|
+
* widgetOid: 'your-widget-oid'
|
|
6490
|
+
* });
|
|
6491
|
+
* this.widgetProps = widgetModelTranslator.toWidgetProps(widgetModel);
|
|
6492
|
+
* }
|
|
6493
|
+
* }
|
|
6494
|
+
* ```
|
|
6495
|
+
*/
|
|
6496
|
+
function toWidgetProps(widgetModel) {
|
|
6497
|
+
return widgetModelTranslator$1.toWidgetProps(widgetModel);
|
|
6498
|
+
}
|
|
6258
6499
|
|
|
6259
6500
|
var widgetModelTranslator = /*#__PURE__*/Object.freeze({
|
|
6260
6501
|
__proto__: null,
|
|
@@ -6265,7 +6506,8 @@ var widgetModelTranslator = /*#__PURE__*/Object.freeze({
|
|
|
6265
6506
|
toPivotTableProps: toPivotTableProps,
|
|
6266
6507
|
toPivotTableWidgetProps: toPivotTableWidgetProps,
|
|
6267
6508
|
toTableProps: toTableProps,
|
|
6268
|
-
toTextWidgetProps: toTextWidgetProps
|
|
6509
|
+
toTextWidgetProps: toTextWidgetProps,
|
|
6510
|
+
toWidgetProps: toWidgetProps
|
|
6269
6511
|
});
|
|
6270
6512
|
|
|
6271
6513
|
/**
|