@rivet-health/design-system 32.5.0 → 33.1.0
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/esm2020/lib/navigation/views/state.mjs +4 -4
- package/esm2020/lib/navigation/views/views/views.component.mjs +22 -7
- package/esm2020/lib/visualization/chart/chart.component.mjs +18 -9
- package/esm2020/lib/visualization/chart/chart.mjs +321 -16
- package/fesm2015/rivet-health-design-system.mjs +355 -27
- package/fesm2015/rivet-health-design-system.mjs.map +1 -1
- package/fesm2020/rivet-health-design-system.mjs +352 -27
- package/fesm2020/rivet-health-design-system.mjs.map +1 -1
- package/lib/navigation/views/views/views.component.d.ts +3 -0
- package/lib/visualization/chart/chart.component.d.ts +14 -1
- package/lib/visualization/chart/chart.d.ts +20 -3
- package/package.json +1 -1
|
@@ -4909,11 +4909,11 @@ var RivViews;
|
|
|
4909
4909
|
function getPermissionDescription(permission) {
|
|
4910
4910
|
switch (permission) {
|
|
4911
4911
|
case 'private':
|
|
4912
|
-
return 'Only
|
|
4912
|
+
return 'Private - Only available to you';
|
|
4913
4913
|
case 'shared':
|
|
4914
|
-
return 'Only visible to those with access';
|
|
4914
|
+
return 'Shared - Only visible to those with access';
|
|
4915
4915
|
case 'public':
|
|
4916
|
-
return 'Visible to everyone';
|
|
4916
|
+
return 'Public - Visible to everyone';
|
|
4917
4917
|
}
|
|
4918
4918
|
}
|
|
4919
4919
|
RivViews.getPermissionDescription = getPermissionDescription;
|
|
@@ -5424,12 +5424,25 @@ class ViewsComponent {
|
|
|
5424
5424
|
ngOnInit() {
|
|
5425
5425
|
this.showLinkCopiedToast = merge(this.manager.actions.pipe(filter(({ type }) => type === 'copyLinkToView'), map(() => true)), this.toastClosed.pipe(map(() => false)));
|
|
5426
5426
|
}
|
|
5427
|
+
getPermissionIcon(permission) {
|
|
5428
|
+
switch (permission) {
|
|
5429
|
+
case 'private':
|
|
5430
|
+
return 'Lock';
|
|
5431
|
+
case 'shared':
|
|
5432
|
+
return 'UserCheck';
|
|
5433
|
+
case 'public':
|
|
5434
|
+
return 'Users';
|
|
5435
|
+
}
|
|
5436
|
+
}
|
|
5437
|
+
getPermissionDescription(permission) {
|
|
5438
|
+
return RivViews.getPermissionDescription(permission);
|
|
5439
|
+
}
|
|
5427
5440
|
}
|
|
5428
5441
|
ViewsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ViewsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5429
|
-
ViewsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ViewsComponent, selector: "riv-views", inputs: { manager: "manager", sideSheetTopOffset: "sideSheetTopOffset" }, viewQueries: [{ propertyName: "overflowTrigger", first: true, predicate: ["overflowTrigger"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div\n (rivClientSize)=\"\n manager?.actions?.next({ type: 'setContainerWidth', width: $event.width })\n \"\n class=\"container\"\n>\n <ng-container *ngIf=\"manager?.state | async; let s\">\n <ng-container\n *ngFor=\"let view of s.displayedViews; let i = index; trackBy: trackById\"\n >\n <ng-container *ngIf=\"view.active; else inactiveTab\">\n <riv-view-menu\n [manager]=\"manager\"\n [view]=\"view\"\n [menuContext]=\"'tab'\"\n class=\"active-menu\"\n >\n <ng-template #menuTrigger>\n <div\n class=\"tab active\"\n [class.dragging]=\"draggedTabIndex === i\"\n [class.dragged-over-left]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex > i\n \"\n [class.dragged-over-right]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex < i\n \"\n [attr.draggable]=\"!view.system\"\n [attr.droppable]=\"!view.system\"\n (dragstart)=\"dragStart(i, view.title, view.system)\"\n (dragenter)=\"$event.preventDefault()\"\n (dragover)=\"$event.preventDefault(); dragOver(i, view.system)\"\n (drop)=\"drop(i, false)\"\n >\n <riv-icon\n class=\"tab-reorder\"\n [class.hidden-class]=\"view.system\"\n [name]=\"'Reorder'\"\n [size]=\"16\"\n ></riv-icon>\n <div rivTruncate>\n {{ view.title }}\n </div>\n </div>\n </ng-template>\n </riv-view-menu>\n </ng-container>\n <ng-template #inactiveTab>\n <button\n class=\"tab\"\n [class.dragging]=\"draggedTabIndex === i\"\n [class.dragged-over-left]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex > i\n \"\n [class.dragged-over-right]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex < i\n \"\n [attr.draggable]=\"!view.system\"\n [attr.droppable]=\"!view.system\"\n (dragstart)=\"dragStart(i, view.title, view.system)\"\n (dragenter)=\"$event.preventDefault()\"\n (dragover)=\"$event.preventDefault(); dragOver(i, view.system)\"\n (drop)=\"drop(i, false)\"\n (click)=\"\n manager?.actions?.next({\n type: 'setActiveView',\n id: view.id,\n source: 'tab'\n })\n \"\n >\n <riv-icon\n class=\"tab-reorder\"\n [class.hidden-class]=\"view.system\"\n [name]=\"'Reorder'\"\n [size]=\"16\"\n ></riv-icon>\n <span rivTruncate>\n {{ view.title }}\n </span>\n </button>\n </ng-template>\n </ng-container>\n <button\n *ngIf=\"s.allEnabledViews.length - s.displayedViews.length; let count\"\n class=\"tab overflow\"\n rivTruncate\n #overflowTrigger\n (click)=\"\n manager?.actions?.next({ type: 'setOverflowPickerOpen', open: true })\n \"\n >\n {{ count | rivNumber }} more\n </button>\n <ng-container *ngIf=\"s.overflow.pickerOpen\">\n <riv-callout\n *riv-overlay\n [anchor]=\"overflowTrigger?.nativeElement\"\n [isModal]=\"true\"\n [showCaret]=\"false\"\n [theme]=\"'light'\"\n [preferredPosition]=\"'bottom-left'\"\n (close)=\"\n manager?.actions?.next({ type: 'setOverflowPickerOpen', open: false })\n \"\n >\n <div class=\"overflow-callout\">\n <riv-search\n [value]=\"s.overflow.search\"\n (valueChange)=\"\n manager?.actions?.next({\n type: 'setOverflowSearchQuery',\n query: $event\n })\n \"\n ></riv-search>\n <div class=\"overflow-view-list\">\n <button\n *ngFor=\"let view of s.enabledViews; let i = index\"\n class=\"overflow-view\"\n [class.system]=\"view.system\"\n [class.dragging]=\"draggedTabIndex === i\"\n [class.dragged-over-top]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex > i\n \"\n [class.dragged-over-bottom]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex < i\n \"\n [attr.draggable]=\"!view.system\"\n [attr.droppable]=\"!view.system\"\n (dragstart)=\"dragStart(i, view.title, view.system)\"\n (dragenter)=\"$event.preventDefault()\"\n (dragover)=\"$event.preventDefault(); dragOver(i, view.system)\"\n (drop)=\"drop(i, true)\"\n (click)=\"\n manager?.actions?.next({\n type: 'setActiveView',\n id: view.id,\n source: 'overflow'\n });\n manager?.actions?.next({\n type: 'setOverflowPickerOpen',\n open: false\n })\n \"\n >\n <riv-icon\n *ngIf=\"!view.system\"\n class=\"overflow-reorder\"\n [name]=\"'Reorder'\"\n [size]=\"16\"\n ></riv-icon>\n <div class=\"overflow-title\" rivTruncate>\n <riv-highlight\n [indices]=\"view.titleHighlightIndices ?? []\"\n [text]=\"view.title\"\n ></riv-highlight>\n </div>\n <riv-view-menu\n [manager]=\"manager\"\n [view]=\"view\"\n [menuContext]=\"'overflow'\"\n ></riv-view-menu>\n </button>\n <riv-zero-state\n *ngIf=\"!s.enabledViews.length\"\n [message]=\"'No matching views.'\"\n ></riv-zero-state>\n </div>\n </div>\n </riv-callout>\n </ng-container>\n <div class=\"all-views-button-container\">\n <button\n rivButton\n [variant]=\"'ghost'\"\n [size]=\"'medium'\"\n (click)=\"showAllViews = true\"\n >\n All views\n </button>\n </div>\n </ng-container>\n</div>\n\n<riv-all-views-modal\n *ngIf=\"showAllViews\"\n [manager]=\"manager\"\n [topOffset]=\"sideSheetTopOffset\"\n (close)=\"showAllViews = false\"\n></riv-all-views-modal>\n\n<riv-toast *ngIf=\"showLinkCopiedToast | async\" (close)=\"toastClosed.next()\">\n Link to view copied to clipboard\n</riv-toast>\n", styles: [".container{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,calc(var(--base-grid-size) * 81));justify-content:start;border-bottom:var(--border-width) solid var(--border-light)}.tab{font:var(--input-medium);color:var(--type-light-low-contrast);background-color:var(--surface-light-1);border:var(--border-width) solid var(--border-light);border-bottom:none;border-top-left-radius:var(--border-radius-medium);border-top-right-radius:var(--border-radius-medium);padding:var(--size-small) var(--size-large) var(--size-small) 0;cursor:pointer;transition:background-color var(--medium-transition);display:flex;justify-content:flex-start;align-items:center;position:relative}.tab:hover{background-color:var(--surface-light-2)}.tab:active{background-color:var(--surface-light-3)}.tab:not(:first-child),.active-menu{margin-left:calc(var(--border-width) * -1)}.tab.active{color:var(--purp-80);background-color:var(--surface-light-0);border-bottom:var(--border-width) solid var(--surface-light-0);margin-bottom:calc(var(--border-width) * -1);z-index:1;width:100%;max-width:100%;height:100%;max-height:100%}.tab.active:active{border:var(--border-width) solid var(--purp-80)}.tab.dragging{cursor:grabbing}.tab.dragged-over-left:before,.tab.dragged-over-right:before{content:\"\";position:absolute;top:0;bottom:0;width:var(--size-xxsmall);background-color:var(--brand);box-shadow:0 0 var(--size-xxsmall) var(--brand)}.tab.dragged-over-left:before{left:0}.tab.dragged-over-right:before{right:0}.tab-reorder{color:var(--type-light-low-contrast);opacity:0;transition:opacity var(--short-transition);cursor:grab;margin:0 var(--size-xsmall)}.tab:hover .tab-reorder{opacity:1}.hidden-class{visibility:hidden}.active-menu{display:inline-flex;color:var(--type-light-link-hover);--size: calc(100% + calc(var(--border-width)));width:var(--size);max-width:var(--size);height:var(--size);max-height:var(--size);cursor:pointer;font:var(--input-medium)}.tab.overflow{padding-left:var(--size-large)}.all-views-button-container{padding:var(--size-xxsmall)}.overflow-callout{padding:var(--size-large);display:flex;flex-direction:column;gap:var(--size-medium);height:calc(var(--base-grid-size) * 120);max-height:50vh;width:calc(var(--base-grid-size) * 75);max-width:50vw}.overflow-view-list{display:flex;flex-direction:column;gap:var(--size-small);flex-grow:1;overflow-y:auto}.overflow-view{display:flex;align-items:center;gap:var(--size-small);cursor:pointer;border-radius:var(--border-radius-medium);transition:background-color var(--short-transition);position:relative}.overflow-view.system{padding-left:var(--size-small)}.overflow-view:hover{background-color:var(--surface-light-2)}.overflow-view.dragged-over-top:before,.overflow-view.dragged-over-bottom:before{content:\"\";position:absolute;left:0;right:0;height:var(--size-xxsmall);background-color:var(--brand);box-shadow:0 0 var(--size-xxsmall) var(--brand)}.overflow-view.dragged-over-top:before{top:0}.overflow-view.dragged-over-bottom:before{bottom:0}.overflow-reorder{color:var(--type-light-low-contrast);cursor:grab}.overflow-title{flex-grow:1;text-align:left}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AllViewsModalComponent, selector: "riv-all-views-modal", inputs: ["manager", "topOffset"], outputs: ["close"] }, { kind: "component", type: ButtonComponent, selector: "[rivButton]", inputs: ["locked", "disabled", "loading", "full", "size", "variant", "icon", "iconPosition", "current"] }, { kind: "component", type: CalloutComponent, selector: "riv-callout", inputs: ["anchor", "isModal", "preferredPosition", "allowedPositions", "fallbackDirection", "showCaret", "theme"], outputs: ["close"] }, { kind: "component", type: HighlightComponent, selector: "riv-highlight", inputs: ["text", "indices"] }, { kind: "component", type: IconComponent, selector: "riv-icon", inputs: ["name", "size", "customSize", "strokeWidth"] }, { kind: "directive", type: OverlayDirective, selector: "[riv-overlay]" }, { kind: "component", type: SearchComponent, selector: "riv-search", inputs: ["placeholder", "name", "labelTemplate"] }, { kind: "directive", type: SizeDirective, selector: "[rivClientSize]", outputs: ["rivClientSize"] }, { kind: "component", type: ToastComponent, selector: "riv-toast", inputs: ["variant", "icon"], outputs: ["close"] }, { kind: "component", type: TruncateComponent, selector: "[rivTruncate]", inputs: ["maxTooltipWidth"] }, { kind: "component", type: ViewMenuComponent, selector: "riv-view-menu", inputs: ["manager", "view", "menuContext"] }, { kind: "component", type: ZeroStateComponent, selector: "riv-zero-state", inputs: ["message", "title", "icon"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: NumberPipe, name: "rivNumber" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5442
|
+
ViewsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ViewsComponent, selector: "riv-views", inputs: { manager: "manager", sideSheetTopOffset: "sideSheetTopOffset" }, viewQueries: [{ propertyName: "overflowTrigger", first: true, predicate: ["overflowTrigger"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div\n (rivClientSize)=\"\n manager?.actions?.next({ type: 'setContainerWidth', width: $event.width })\n \"\n class=\"container\"\n>\n <ng-container *ngIf=\"manager?.state | async; let s\">\n <ng-container\n *ngFor=\"let view of s.displayedViews; let i = index; trackBy: trackById\"\n >\n <ng-container *ngIf=\"view.active; else inactiveTab\">\n <riv-view-menu\n [manager]=\"manager\"\n [view]=\"view\"\n [menuContext]=\"'tab'\"\n class=\"active-menu\"\n >\n <ng-template #menuTrigger>\n <div\n class=\"tab active\"\n [class.dragging]=\"draggedTabIndex === i\"\n [class.dragged-over-left]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex > i\n \"\n [class.dragged-over-right]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex < i\n \"\n [attr.draggable]=\"!view.system\"\n [attr.droppable]=\"!view.system\"\n (dragstart)=\"dragStart(i, view.title, view.system)\"\n (dragenter)=\"$event.preventDefault()\"\n (dragover)=\"$event.preventDefault(); dragOver(i, view.system)\"\n (drop)=\"drop(i, false)\"\n >\n <riv-icon\n class=\"tab-reorder\"\n [class.hidden-class]=\"view.system\"\n [name]=\"'Reorder'\"\n [size]=\"16\"\n ></riv-icon>\n <div rivTruncate>\n {{ view.title }}\n </div>\n <riv-icon\n class=\"permission-icon\"\n [name]=\"getPermissionIcon(view.permission)\"\n [size]=\"12\"\n [rivTooltip]=\"getPermissionDescription(view.permission)\"\n ></riv-icon>\n </div>\n </ng-template>\n </riv-view-menu>\n </ng-container>\n <ng-template #inactiveTab>\n <button\n class=\"tab\"\n [class.dragging]=\"draggedTabIndex === i\"\n [class.dragged-over-left]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex > i\n \"\n [class.dragged-over-right]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex < i\n \"\n [attr.draggable]=\"!view.system\"\n [attr.droppable]=\"!view.system\"\n (dragstart)=\"dragStart(i, view.title, view.system)\"\n (dragenter)=\"$event.preventDefault()\"\n (dragover)=\"$event.preventDefault(); dragOver(i, view.system)\"\n (drop)=\"drop(i, false)\"\n (click)=\"\n manager?.actions?.next({\n type: 'setActiveView',\n id: view.id,\n source: 'tab'\n })\n \"\n >\n <riv-icon\n class=\"tab-reorder\"\n [class.hidden-class]=\"view.system\"\n [name]=\"'Reorder'\"\n [size]=\"16\"\n ></riv-icon>\n <span rivTruncate>\n {{ view.title }}\n </span>\n </button>\n </ng-template>\n </ng-container>\n <button\n *ngIf=\"s.allEnabledViews.length - s.displayedViews.length; let count\"\n class=\"tab overflow\"\n rivTruncate\n #overflowTrigger\n (click)=\"\n manager?.actions?.next({ type: 'setOverflowPickerOpen', open: true })\n \"\n >\n {{ count | rivNumber }} more\n </button>\n <ng-container *ngIf=\"s.overflow.pickerOpen\">\n <riv-callout\n *riv-overlay\n [anchor]=\"overflowTrigger?.nativeElement\"\n [isModal]=\"true\"\n [showCaret]=\"false\"\n [theme]=\"'light'\"\n [preferredPosition]=\"'bottom-left'\"\n (close)=\"\n manager?.actions?.next({ type: 'setOverflowPickerOpen', open: false })\n \"\n >\n <div class=\"overflow-callout\">\n <riv-search\n [value]=\"s.overflow.search\"\n (valueChange)=\"\n manager?.actions?.next({\n type: 'setOverflowSearchQuery',\n query: $event\n })\n \"\n ></riv-search>\n <div class=\"overflow-view-list\">\n <button\n *ngFor=\"let view of s.enabledViews; let i = index\"\n class=\"overflow-view\"\n [class.system]=\"view.system\"\n [class.dragging]=\"draggedTabIndex === i\"\n [class.dragged-over-top]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex > i\n \"\n [class.dragged-over-bottom]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex < i\n \"\n [attr.draggable]=\"!view.system\"\n [attr.droppable]=\"!view.system\"\n (dragstart)=\"dragStart(i, view.title, view.system)\"\n (dragenter)=\"$event.preventDefault()\"\n (dragover)=\"$event.preventDefault(); dragOver(i, view.system)\"\n (drop)=\"drop(i, true)\"\n (click)=\"\n manager?.actions?.next({\n type: 'setActiveView',\n id: view.id,\n source: 'overflow'\n });\n manager?.actions?.next({\n type: 'setOverflowPickerOpen',\n open: false\n })\n \"\n >\n <riv-icon\n *ngIf=\"!view.system\"\n class=\"overflow-reorder\"\n [name]=\"'Reorder'\"\n [size]=\"16\"\n ></riv-icon>\n <div class=\"overflow-title\" rivTruncate>\n <riv-highlight\n [indices]=\"view.titleHighlightIndices ?? []\"\n [text]=\"view.title\"\n ></riv-highlight>\n </div>\n <riv-view-menu\n [manager]=\"manager\"\n [view]=\"view\"\n [menuContext]=\"'overflow'\"\n ></riv-view-menu>\n </button>\n <riv-zero-state\n *ngIf=\"!s.enabledViews.length\"\n [message]=\"'No matching views.'\"\n ></riv-zero-state>\n </div>\n </div>\n </riv-callout>\n </ng-container>\n <div class=\"all-views-button-container\">\n <button\n rivButton\n [variant]=\"'ghost'\"\n [size]=\"'medium'\"\n (click)=\"showAllViews = true\"\n >\n All views\n </button>\n </div>\n </ng-container>\n</div>\n\n<riv-all-views-modal\n *ngIf=\"showAllViews\"\n [manager]=\"manager\"\n [topOffset]=\"sideSheetTopOffset\"\n (close)=\"showAllViews = false\"\n></riv-all-views-modal>\n\n<riv-toast *ngIf=\"showLinkCopiedToast | async\" (close)=\"toastClosed.next()\">\n Link to view copied to clipboard\n</riv-toast>\n", styles: [".container{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,calc(var(--base-grid-size) * 81));justify-content:start;border-bottom:var(--border-width) solid var(--border-light)}.tab{font:var(--input-medium);color:var(--type-light-low-contrast);background-color:var(--surface-light-1);border:var(--border-width) solid var(--border-light);border-bottom:none;border-top-left-radius:var(--border-radius-medium);border-top-right-radius:var(--border-radius-medium);padding:var(--size-small) var(--size-large) var(--size-small) 0;cursor:pointer;transition:background-color var(--medium-transition);display:flex;justify-content:flex-start;align-items:center;position:relative}.tab:hover{background-color:var(--surface-light-2)}.tab:active{background-color:var(--surface-light-3)}.tab:not(:first-child),.active-menu{margin-left:calc(var(--border-width) * -1)}.tab.active{color:var(--purp-80);background-color:var(--surface-light-0);border-bottom:var(--border-width) solid var(--surface-light-0);margin-bottom:calc(var(--border-width) * -1);z-index:1;width:100%;max-width:100%;height:100%;max-height:100%}.tab.active:active{border:var(--border-width) solid var(--purp-80)}.tab.dragging{cursor:grabbing}.tab.dragged-over-left:before,.tab.dragged-over-right:before{content:\"\";position:absolute;top:0;bottom:0;width:var(--size-xxsmall);background-color:var(--brand);box-shadow:0 0 var(--size-xxsmall) var(--brand)}.tab.dragged-over-left:before{left:0}.tab.dragged-over-right:before{right:0}.tab-reorder{color:var(--type-light-low-contrast);opacity:0;transition:opacity var(--short-transition);cursor:grab;margin:0 var(--size-xsmall)}.tab:hover .tab-reorder{opacity:1}.hidden-class{visibility:hidden}.active-menu{display:inline-flex;color:var(--type-light-link-hover);--size: calc(100% + calc(var(--border-width)));width:var(--size);max-width:var(--size);height:var(--size);max-height:var(--size);cursor:pointer;font:var(--input-medium)}.tab.overflow{padding-left:var(--size-large)}.all-views-button-container{padding:var(--size-xxsmall)}.overflow-callout{padding:var(--size-large);display:flex;flex-direction:column;gap:var(--size-medium);height:calc(var(--base-grid-size) * 120);max-height:50vh;width:calc(var(--base-grid-size) * 75);max-width:50vw}.overflow-view-list{display:flex;flex-direction:column;gap:var(--size-small);flex-grow:1;overflow-y:auto}.overflow-view{display:flex;align-items:center;gap:var(--size-small);cursor:pointer;border-radius:var(--border-radius-medium);transition:background-color var(--short-transition);position:relative}.overflow-view.system{padding-left:var(--size-small)}.overflow-view:hover{background-color:var(--surface-light-2)}.overflow-view.dragged-over-top:before,.overflow-view.dragged-over-bottom:before{content:\"\";position:absolute;left:0;right:0;height:var(--size-xxsmall);background-color:var(--brand);box-shadow:0 0 var(--size-xxsmall) var(--brand)}.overflow-view.dragged-over-top:before{top:0}.overflow-view.dragged-over-bottom:before{bottom:0}.overflow-reorder{color:var(--type-light-low-contrast);cursor:grab}.overflow-title{flex-grow:1;text-align:left}.permission-icon{color:var(--type-light-low-contrast);margin-left:var(--size-xsmall);flex-shrink:0}.tab.active .permission-icon{color:var(--purp-80)}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AllViewsModalComponent, selector: "riv-all-views-modal", inputs: ["manager", "topOffset"], outputs: ["close"] }, { kind: "component", type: ButtonComponent, selector: "[rivButton]", inputs: ["locked", "disabled", "loading", "full", "size", "variant", "icon", "iconPosition", "current"] }, { kind: "component", type: CalloutComponent, selector: "riv-callout", inputs: ["anchor", "isModal", "preferredPosition", "allowedPositions", "fallbackDirection", "showCaret", "theme"], outputs: ["close"] }, { kind: "component", type: HighlightComponent, selector: "riv-highlight", inputs: ["text", "indices"] }, { kind: "component", type: IconComponent, selector: "riv-icon", inputs: ["name", "size", "customSize", "strokeWidth"] }, { kind: "directive", type: OverlayDirective, selector: "[riv-overlay]" }, { kind: "component", type: SearchComponent, selector: "riv-search", inputs: ["placeholder", "name", "labelTemplate"] }, { kind: "directive", type: SizeDirective, selector: "[rivClientSize]", outputs: ["rivClientSize"] }, { kind: "component", type: ToastComponent, selector: "riv-toast", inputs: ["variant", "icon"], outputs: ["close"] }, { kind: "directive", type: TooltipDirective, selector: "[rivTooltip]", inputs: ["rivTooltip", "rivTooltipTheme", "rivTooltipMaxWidth", "rivTooltipPreferredPosition", "rivTooltipCloseDelay", "rivTooltipOpenDelay"] }, { kind: "component", type: TruncateComponent, selector: "[rivTruncate]", inputs: ["maxTooltipWidth"] }, { kind: "component", type: ViewMenuComponent, selector: "riv-view-menu", inputs: ["manager", "view", "menuContext"] }, { kind: "component", type: ZeroStateComponent, selector: "riv-zero-state", inputs: ["message", "title", "icon"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: NumberPipe, name: "rivNumber" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5430
5443
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ViewsComponent, decorators: [{
|
|
5431
5444
|
type: Component,
|
|
5432
|
-
args: [{ selector: 'riv-views', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n (rivClientSize)=\"\n manager?.actions?.next({ type: 'setContainerWidth', width: $event.width })\n \"\n class=\"container\"\n>\n <ng-container *ngIf=\"manager?.state | async; let s\">\n <ng-container\n *ngFor=\"let view of s.displayedViews; let i = index; trackBy: trackById\"\n >\n <ng-container *ngIf=\"view.active; else inactiveTab\">\n <riv-view-menu\n [manager]=\"manager\"\n [view]=\"view\"\n [menuContext]=\"'tab'\"\n class=\"active-menu\"\n >\n <ng-template #menuTrigger>\n <div\n class=\"tab active\"\n [class.dragging]=\"draggedTabIndex === i\"\n [class.dragged-over-left]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex > i\n \"\n [class.dragged-over-right]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex < i\n \"\n [attr.draggable]=\"!view.system\"\n [attr.droppable]=\"!view.system\"\n (dragstart)=\"dragStart(i, view.title, view.system)\"\n (dragenter)=\"$event.preventDefault()\"\n (dragover)=\"$event.preventDefault(); dragOver(i, view.system)\"\n (drop)=\"drop(i, false)\"\n >\n <riv-icon\n class=\"tab-reorder\"\n [class.hidden-class]=\"view.system\"\n [name]=\"'Reorder'\"\n [size]=\"16\"\n ></riv-icon>\n <div rivTruncate>\n {{ view.title }}\n </div>\n </div>\n </ng-template>\n </riv-view-menu>\n </ng-container>\n <ng-template #inactiveTab>\n <button\n class=\"tab\"\n [class.dragging]=\"draggedTabIndex === i\"\n [class.dragged-over-left]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex > i\n \"\n [class.dragged-over-right]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex < i\n \"\n [attr.draggable]=\"!view.system\"\n [attr.droppable]=\"!view.system\"\n (dragstart)=\"dragStart(i, view.title, view.system)\"\n (dragenter)=\"$event.preventDefault()\"\n (dragover)=\"$event.preventDefault(); dragOver(i, view.system)\"\n (drop)=\"drop(i, false)\"\n (click)=\"\n manager?.actions?.next({\n type: 'setActiveView',\n id: view.id,\n source: 'tab'\n })\n \"\n >\n <riv-icon\n class=\"tab-reorder\"\n [class.hidden-class]=\"view.system\"\n [name]=\"'Reorder'\"\n [size]=\"16\"\n ></riv-icon>\n <span rivTruncate>\n {{ view.title }}\n </span>\n </button>\n </ng-template>\n </ng-container>\n <button\n *ngIf=\"s.allEnabledViews.length - s.displayedViews.length; let count\"\n class=\"tab overflow\"\n rivTruncate\n #overflowTrigger\n (click)=\"\n manager?.actions?.next({ type: 'setOverflowPickerOpen', open: true })\n \"\n >\n {{ count | rivNumber }} more\n </button>\n <ng-container *ngIf=\"s.overflow.pickerOpen\">\n <riv-callout\n *riv-overlay\n [anchor]=\"overflowTrigger?.nativeElement\"\n [isModal]=\"true\"\n [showCaret]=\"false\"\n [theme]=\"'light'\"\n [preferredPosition]=\"'bottom-left'\"\n (close)=\"\n manager?.actions?.next({ type: 'setOverflowPickerOpen', open: false })\n \"\n >\n <div class=\"overflow-callout\">\n <riv-search\n [value]=\"s.overflow.search\"\n (valueChange)=\"\n manager?.actions?.next({\n type: 'setOverflowSearchQuery',\n query: $event\n })\n \"\n ></riv-search>\n <div class=\"overflow-view-list\">\n <button\n *ngFor=\"let view of s.enabledViews; let i = index\"\n class=\"overflow-view\"\n [class.system]=\"view.system\"\n [class.dragging]=\"draggedTabIndex === i\"\n [class.dragged-over-top]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex > i\n \"\n [class.dragged-over-bottom]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex < i\n \"\n [attr.draggable]=\"!view.system\"\n [attr.droppable]=\"!view.system\"\n (dragstart)=\"dragStart(i, view.title, view.system)\"\n (dragenter)=\"$event.preventDefault()\"\n (dragover)=\"$event.preventDefault(); dragOver(i, view.system)\"\n (drop)=\"drop(i, true)\"\n (click)=\"\n manager?.actions?.next({\n type: 'setActiveView',\n id: view.id,\n source: 'overflow'\n });\n manager?.actions?.next({\n type: 'setOverflowPickerOpen',\n open: false\n })\n \"\n >\n <riv-icon\n *ngIf=\"!view.system\"\n class=\"overflow-reorder\"\n [name]=\"'Reorder'\"\n [size]=\"16\"\n ></riv-icon>\n <div class=\"overflow-title\" rivTruncate>\n <riv-highlight\n [indices]=\"view.titleHighlightIndices ?? []\"\n [text]=\"view.title\"\n ></riv-highlight>\n </div>\n <riv-view-menu\n [manager]=\"manager\"\n [view]=\"view\"\n [menuContext]=\"'overflow'\"\n ></riv-view-menu>\n </button>\n <riv-zero-state\n *ngIf=\"!s.enabledViews.length\"\n [message]=\"'No matching views.'\"\n ></riv-zero-state>\n </div>\n </div>\n </riv-callout>\n </ng-container>\n <div class=\"all-views-button-container\">\n <button\n rivButton\n [variant]=\"'ghost'\"\n [size]=\"'medium'\"\n (click)=\"showAllViews = true\"\n >\n All views\n </button>\n </div>\n </ng-container>\n</div>\n\n<riv-all-views-modal\n *ngIf=\"showAllViews\"\n [manager]=\"manager\"\n [topOffset]=\"sideSheetTopOffset\"\n (close)=\"showAllViews = false\"\n></riv-all-views-modal>\n\n<riv-toast *ngIf=\"showLinkCopiedToast | async\" (close)=\"toastClosed.next()\">\n Link to view copied to clipboard\n</riv-toast>\n", styles: [".container{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,calc(var(--base-grid-size) * 81));justify-content:start;border-bottom:var(--border-width) solid var(--border-light)}.tab{font:var(--input-medium);color:var(--type-light-low-contrast);background-color:var(--surface-light-1);border:var(--border-width) solid var(--border-light);border-bottom:none;border-top-left-radius:var(--border-radius-medium);border-top-right-radius:var(--border-radius-medium);padding:var(--size-small) var(--size-large) var(--size-small) 0;cursor:pointer;transition:background-color var(--medium-transition);display:flex;justify-content:flex-start;align-items:center;position:relative}.tab:hover{background-color:var(--surface-light-2)}.tab:active{background-color:var(--surface-light-3)}.tab:not(:first-child),.active-menu{margin-left:calc(var(--border-width) * -1)}.tab.active{color:var(--purp-80);background-color:var(--surface-light-0);border-bottom:var(--border-width) solid var(--surface-light-0);margin-bottom:calc(var(--border-width) * -1);z-index:1;width:100%;max-width:100%;height:100%;max-height:100%}.tab.active:active{border:var(--border-width) solid var(--purp-80)}.tab.dragging{cursor:grabbing}.tab.dragged-over-left:before,.tab.dragged-over-right:before{content:\"\";position:absolute;top:0;bottom:0;width:var(--size-xxsmall);background-color:var(--brand);box-shadow:0 0 var(--size-xxsmall) var(--brand)}.tab.dragged-over-left:before{left:0}.tab.dragged-over-right:before{right:0}.tab-reorder{color:var(--type-light-low-contrast);opacity:0;transition:opacity var(--short-transition);cursor:grab;margin:0 var(--size-xsmall)}.tab:hover .tab-reorder{opacity:1}.hidden-class{visibility:hidden}.active-menu{display:inline-flex;color:var(--type-light-link-hover);--size: calc(100% + calc(var(--border-width)));width:var(--size);max-width:var(--size);height:var(--size);max-height:var(--size);cursor:pointer;font:var(--input-medium)}.tab.overflow{padding-left:var(--size-large)}.all-views-button-container{padding:var(--size-xxsmall)}.overflow-callout{padding:var(--size-large);display:flex;flex-direction:column;gap:var(--size-medium);height:calc(var(--base-grid-size) * 120);max-height:50vh;width:calc(var(--base-grid-size) * 75);max-width:50vw}.overflow-view-list{display:flex;flex-direction:column;gap:var(--size-small);flex-grow:1;overflow-y:auto}.overflow-view{display:flex;align-items:center;gap:var(--size-small);cursor:pointer;border-radius:var(--border-radius-medium);transition:background-color var(--short-transition);position:relative}.overflow-view.system{padding-left:var(--size-small)}.overflow-view:hover{background-color:var(--surface-light-2)}.overflow-view.dragged-over-top:before,.overflow-view.dragged-over-bottom:before{content:\"\";position:absolute;left:0;right:0;height:var(--size-xxsmall);background-color:var(--brand);box-shadow:0 0 var(--size-xxsmall) var(--brand)}.overflow-view.dragged-over-top:before{top:0}.overflow-view.dragged-over-bottom:before{bottom:0}.overflow-reorder{color:var(--type-light-low-contrast);cursor:grab}.overflow-title{flex-grow:1;text-align:left}\n"] }]
|
|
5445
|
+
args: [{ selector: 'riv-views', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n (rivClientSize)=\"\n manager?.actions?.next({ type: 'setContainerWidth', width: $event.width })\n \"\n class=\"container\"\n>\n <ng-container *ngIf=\"manager?.state | async; let s\">\n <ng-container\n *ngFor=\"let view of s.displayedViews; let i = index; trackBy: trackById\"\n >\n <ng-container *ngIf=\"view.active; else inactiveTab\">\n <riv-view-menu\n [manager]=\"manager\"\n [view]=\"view\"\n [menuContext]=\"'tab'\"\n class=\"active-menu\"\n >\n <ng-template #menuTrigger>\n <div\n class=\"tab active\"\n [class.dragging]=\"draggedTabIndex === i\"\n [class.dragged-over-left]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex > i\n \"\n [class.dragged-over-right]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex < i\n \"\n [attr.draggable]=\"!view.system\"\n [attr.droppable]=\"!view.system\"\n (dragstart)=\"dragStart(i, view.title, view.system)\"\n (dragenter)=\"$event.preventDefault()\"\n (dragover)=\"$event.preventDefault(); dragOver(i, view.system)\"\n (drop)=\"drop(i, false)\"\n >\n <riv-icon\n class=\"tab-reorder\"\n [class.hidden-class]=\"view.system\"\n [name]=\"'Reorder'\"\n [size]=\"16\"\n ></riv-icon>\n <div rivTruncate>\n {{ view.title }}\n </div>\n <riv-icon\n class=\"permission-icon\"\n [name]=\"getPermissionIcon(view.permission)\"\n [size]=\"12\"\n [rivTooltip]=\"getPermissionDescription(view.permission)\"\n ></riv-icon>\n </div>\n </ng-template>\n </riv-view-menu>\n </ng-container>\n <ng-template #inactiveTab>\n <button\n class=\"tab\"\n [class.dragging]=\"draggedTabIndex === i\"\n [class.dragged-over-left]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex > i\n \"\n [class.dragged-over-right]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex < i\n \"\n [attr.draggable]=\"!view.system\"\n [attr.droppable]=\"!view.system\"\n (dragstart)=\"dragStart(i, view.title, view.system)\"\n (dragenter)=\"$event.preventDefault()\"\n (dragover)=\"$event.preventDefault(); dragOver(i, view.system)\"\n (drop)=\"drop(i, false)\"\n (click)=\"\n manager?.actions?.next({\n type: 'setActiveView',\n id: view.id,\n source: 'tab'\n })\n \"\n >\n <riv-icon\n class=\"tab-reorder\"\n [class.hidden-class]=\"view.system\"\n [name]=\"'Reorder'\"\n [size]=\"16\"\n ></riv-icon>\n <span rivTruncate>\n {{ view.title }}\n </span>\n </button>\n </ng-template>\n </ng-container>\n <button\n *ngIf=\"s.allEnabledViews.length - s.displayedViews.length; let count\"\n class=\"tab overflow\"\n rivTruncate\n #overflowTrigger\n (click)=\"\n manager?.actions?.next({ type: 'setOverflowPickerOpen', open: true })\n \"\n >\n {{ count | rivNumber }} more\n </button>\n <ng-container *ngIf=\"s.overflow.pickerOpen\">\n <riv-callout\n *riv-overlay\n [anchor]=\"overflowTrigger?.nativeElement\"\n [isModal]=\"true\"\n [showCaret]=\"false\"\n [theme]=\"'light'\"\n [preferredPosition]=\"'bottom-left'\"\n (close)=\"\n manager?.actions?.next({ type: 'setOverflowPickerOpen', open: false })\n \"\n >\n <div class=\"overflow-callout\">\n <riv-search\n [value]=\"s.overflow.search\"\n (valueChange)=\"\n manager?.actions?.next({\n type: 'setOverflowSearchQuery',\n query: $event\n })\n \"\n ></riv-search>\n <div class=\"overflow-view-list\">\n <button\n *ngFor=\"let view of s.enabledViews; let i = index\"\n class=\"overflow-view\"\n [class.system]=\"view.system\"\n [class.dragging]=\"draggedTabIndex === i\"\n [class.dragged-over-top]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex > i\n \"\n [class.dragged-over-bottom]=\"\n draggedOverTabIndex === i &&\n draggedTabIndex !== null &&\n draggedTabIndex < i\n \"\n [attr.draggable]=\"!view.system\"\n [attr.droppable]=\"!view.system\"\n (dragstart)=\"dragStart(i, view.title, view.system)\"\n (dragenter)=\"$event.preventDefault()\"\n (dragover)=\"$event.preventDefault(); dragOver(i, view.system)\"\n (drop)=\"drop(i, true)\"\n (click)=\"\n manager?.actions?.next({\n type: 'setActiveView',\n id: view.id,\n source: 'overflow'\n });\n manager?.actions?.next({\n type: 'setOverflowPickerOpen',\n open: false\n })\n \"\n >\n <riv-icon\n *ngIf=\"!view.system\"\n class=\"overflow-reorder\"\n [name]=\"'Reorder'\"\n [size]=\"16\"\n ></riv-icon>\n <div class=\"overflow-title\" rivTruncate>\n <riv-highlight\n [indices]=\"view.titleHighlightIndices ?? []\"\n [text]=\"view.title\"\n ></riv-highlight>\n </div>\n <riv-view-menu\n [manager]=\"manager\"\n [view]=\"view\"\n [menuContext]=\"'overflow'\"\n ></riv-view-menu>\n </button>\n <riv-zero-state\n *ngIf=\"!s.enabledViews.length\"\n [message]=\"'No matching views.'\"\n ></riv-zero-state>\n </div>\n </div>\n </riv-callout>\n </ng-container>\n <div class=\"all-views-button-container\">\n <button\n rivButton\n [variant]=\"'ghost'\"\n [size]=\"'medium'\"\n (click)=\"showAllViews = true\"\n >\n All views\n </button>\n </div>\n </ng-container>\n</div>\n\n<riv-all-views-modal\n *ngIf=\"showAllViews\"\n [manager]=\"manager\"\n [topOffset]=\"sideSheetTopOffset\"\n (close)=\"showAllViews = false\"\n></riv-all-views-modal>\n\n<riv-toast *ngIf=\"showLinkCopiedToast | async\" (close)=\"toastClosed.next()\">\n Link to view copied to clipboard\n</riv-toast>\n", styles: [".container{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,calc(var(--base-grid-size) * 81));justify-content:start;border-bottom:var(--border-width) solid var(--border-light)}.tab{font:var(--input-medium);color:var(--type-light-low-contrast);background-color:var(--surface-light-1);border:var(--border-width) solid var(--border-light);border-bottom:none;border-top-left-radius:var(--border-radius-medium);border-top-right-radius:var(--border-radius-medium);padding:var(--size-small) var(--size-large) var(--size-small) 0;cursor:pointer;transition:background-color var(--medium-transition);display:flex;justify-content:flex-start;align-items:center;position:relative}.tab:hover{background-color:var(--surface-light-2)}.tab:active{background-color:var(--surface-light-3)}.tab:not(:first-child),.active-menu{margin-left:calc(var(--border-width) * -1)}.tab.active{color:var(--purp-80);background-color:var(--surface-light-0);border-bottom:var(--border-width) solid var(--surface-light-0);margin-bottom:calc(var(--border-width) * -1);z-index:1;width:100%;max-width:100%;height:100%;max-height:100%}.tab.active:active{border:var(--border-width) solid var(--purp-80)}.tab.dragging{cursor:grabbing}.tab.dragged-over-left:before,.tab.dragged-over-right:before{content:\"\";position:absolute;top:0;bottom:0;width:var(--size-xxsmall);background-color:var(--brand);box-shadow:0 0 var(--size-xxsmall) var(--brand)}.tab.dragged-over-left:before{left:0}.tab.dragged-over-right:before{right:0}.tab-reorder{color:var(--type-light-low-contrast);opacity:0;transition:opacity var(--short-transition);cursor:grab;margin:0 var(--size-xsmall)}.tab:hover .tab-reorder{opacity:1}.hidden-class{visibility:hidden}.active-menu{display:inline-flex;color:var(--type-light-link-hover);--size: calc(100% + calc(var(--border-width)));width:var(--size);max-width:var(--size);height:var(--size);max-height:var(--size);cursor:pointer;font:var(--input-medium)}.tab.overflow{padding-left:var(--size-large)}.all-views-button-container{padding:var(--size-xxsmall)}.overflow-callout{padding:var(--size-large);display:flex;flex-direction:column;gap:var(--size-medium);height:calc(var(--base-grid-size) * 120);max-height:50vh;width:calc(var(--base-grid-size) * 75);max-width:50vw}.overflow-view-list{display:flex;flex-direction:column;gap:var(--size-small);flex-grow:1;overflow-y:auto}.overflow-view{display:flex;align-items:center;gap:var(--size-small);cursor:pointer;border-radius:var(--border-radius-medium);transition:background-color var(--short-transition);position:relative}.overflow-view.system{padding-left:var(--size-small)}.overflow-view:hover{background-color:var(--surface-light-2)}.overflow-view.dragged-over-top:before,.overflow-view.dragged-over-bottom:before{content:\"\";position:absolute;left:0;right:0;height:var(--size-xxsmall);background-color:var(--brand);box-shadow:0 0 var(--size-xxsmall) var(--brand)}.overflow-view.dragged-over-top:before{top:0}.overflow-view.dragged-over-bottom:before{bottom:0}.overflow-reorder{color:var(--type-light-low-contrast);cursor:grab}.overflow-title{flex-grow:1;text-align:left}.permission-icon{color:var(--type-light-low-contrast);margin-left:var(--size-xsmall);flex-shrink:0}.tab.active .permission-icon{color:var(--purp-80)}\n"] }]
|
|
5433
5446
|
}], propDecorators: { manager: [{
|
|
5434
5447
|
type: Input
|
|
5435
5448
|
}], sideSheetTopOffset: [{
|
|
@@ -7609,11 +7622,22 @@ var Chart;
|
|
|
7609
7622
|
? areas(config, data, dimensions)
|
|
7610
7623
|
: config.type == 'donut'
|
|
7611
7624
|
? arcs(config, data, dimensions)
|
|
7612
|
-
:
|
|
7625
|
+
: config.type == 'horizontal-bar'
|
|
7626
|
+
? horizontalBars(config, data, dimensions)
|
|
7627
|
+
: config.type == 'bar'
|
|
7628
|
+
? bars(config, data, dimensions)
|
|
7629
|
+
: emptyChart;
|
|
7613
7630
|
}
|
|
7614
7631
|
Chart.chart = chart;
|
|
7615
7632
|
function lines(config, allData, dimensions) {
|
|
7616
|
-
const { data, visibleIndices } = hide(allData);
|
|
7633
|
+
const { data: hiddenData, visibleIndices } = hide(allData);
|
|
7634
|
+
if (hiddenData.type == 'labeled') {
|
|
7635
|
+
// eslint-disable-next-line no-console
|
|
7636
|
+
console.warn("Heads up! Labeled series aren't currently supported for line charts");
|
|
7637
|
+
return emptyChart;
|
|
7638
|
+
}
|
|
7639
|
+
//This assignment makes typescript recognize the actual type (TimeseriesData)
|
|
7640
|
+
const data = hiddenData;
|
|
7617
7641
|
const xScale = scaleUtc(timeseriesDomain(data), xRange(dimensions));
|
|
7618
7642
|
const format = (date) => formatedDate(config.dateFormat || 'day', date);
|
|
7619
7643
|
//Dont use auto magic when dealing with 1,2,3,4 data points
|
|
@@ -7681,12 +7705,20 @@ var Chart;
|
|
|
7681
7705
|
bars: [],
|
|
7682
7706
|
areas: [],
|
|
7683
7707
|
arcs: [],
|
|
7708
|
+
horizontalBars: [],
|
|
7684
7709
|
};
|
|
7685
7710
|
}
|
|
7686
7711
|
Chart.lines = lines;
|
|
7687
7712
|
function areas(config, allData, dimensions) {
|
|
7688
7713
|
const { data: unstackedData, visibleIndices } = hide(allData);
|
|
7689
|
-
const
|
|
7714
|
+
const stackedData = stack(unstackedData);
|
|
7715
|
+
if (stackedData.type == 'labeled') {
|
|
7716
|
+
// eslint-disable-next-line no-console
|
|
7717
|
+
console.warn("Heads up! Labeled series aren't currently supported for area charts");
|
|
7718
|
+
return emptyChart;
|
|
7719
|
+
}
|
|
7720
|
+
//This assignment makes typescript recognize the actual type (TimeseriesData)
|
|
7721
|
+
const data = stackedData;
|
|
7690
7722
|
const xScale = scaleUtc(timeseriesDomain(data), xRange(dimensions));
|
|
7691
7723
|
const format = (date) => formatedDate(config.dateFormat || 'day', date);
|
|
7692
7724
|
const xTicks = xScale.ticks(Math.min(5, data.x.length)).map(tick => ({
|
|
@@ -7714,8 +7746,7 @@ var Chart;
|
|
|
7714
7746
|
}
|
|
7715
7747
|
const yIndex = visibleIndices[visibleYIndex];
|
|
7716
7748
|
const ys = data.ys.map(y => yScale(y.values[xIndex]));
|
|
7717
|
-
const
|
|
7718
|
-
const anchor = new DOMRect(pos.rect.x + x, pos.rect.y + ys[visibleYIndex], padding, 0);
|
|
7749
|
+
const anchor = new DOMRect(pos.rect.x + x, pos.rect.y + ys[visibleYIndex], SMALL_PADDING, 0);
|
|
7719
7750
|
return {
|
|
7720
7751
|
x,
|
|
7721
7752
|
xIndex,
|
|
@@ -7748,12 +7779,20 @@ var Chart;
|
|
|
7748
7779
|
hover,
|
|
7749
7780
|
bars: [],
|
|
7750
7781
|
arcs: [],
|
|
7782
|
+
horizontalBars: [],
|
|
7751
7783
|
};
|
|
7752
7784
|
}
|
|
7753
7785
|
Chart.areas = areas;
|
|
7754
7786
|
function bars(config, allData, dimensions) {
|
|
7755
7787
|
const { data: unstackedData, visibleIndices } = hide(allData);
|
|
7756
|
-
const
|
|
7788
|
+
const possiblyStackedData = config.groupingType == 'clustered' ? unstackedData : stack(unstackedData);
|
|
7789
|
+
if (possiblyStackedData.type == 'labeled') {
|
|
7790
|
+
// eslint-disable-next-line no-console
|
|
7791
|
+
console.warn("Heads up! Labeled series aren't currently supported for vertical bar charts");
|
|
7792
|
+
return emptyChart;
|
|
7793
|
+
}
|
|
7794
|
+
//This assignment makes typescript recognize the actual type (TimeseriesData)
|
|
7795
|
+
const data = possiblyStackedData;
|
|
7757
7796
|
const { range: xRange, binSize } = barXRange(dimensions, data);
|
|
7758
7797
|
const halfBinSize = binSize / 2;
|
|
7759
7798
|
const xScale = scaleUtc(timeseriesDomain(data), xRange);
|
|
@@ -7763,7 +7802,8 @@ var Chart;
|
|
|
7763
7802
|
label: format(tick),
|
|
7764
7803
|
}));
|
|
7765
7804
|
const { pipe, fullPipe } = getPipes(config.valueType);
|
|
7766
|
-
const
|
|
7805
|
+
const yRangeVal = yRange(dimensions);
|
|
7806
|
+
const yScale = scaleLinear(yDomain(data), yRangeVal);
|
|
7767
7807
|
const yTicks = yScale.ticks(5).map(tick => ({
|
|
7768
7808
|
y: yScale(tick),
|
|
7769
7809
|
label: pipe.transform(tick),
|
|
@@ -7771,13 +7811,23 @@ var Chart;
|
|
|
7771
7811
|
const colors = visibleIndices.map(i => config.colors[i % config.colors.length]);
|
|
7772
7812
|
const bars = data.ys.map((y, yIndex) => y.values.map((value, index) => {
|
|
7773
7813
|
const yValue = yScale(value);
|
|
7814
|
+
let xValue = xScale(data.x[index]) - halfBinSize;
|
|
7815
|
+
let width = binSize;
|
|
7816
|
+
let height = (yIndex == 0
|
|
7817
|
+
? yScale(0)
|
|
7818
|
+
: yScale(data.ys[yIndex - 1].values[index])) - yValue;
|
|
7819
|
+
if (config.groupingType == 'clustered') {
|
|
7820
|
+
width =
|
|
7821
|
+
(binSize - (data.ys.length - 1) * SMALL_PADDING) / data.ys.length;
|
|
7822
|
+
height = Math.max(...yRangeVal) - yValue;
|
|
7823
|
+
const offset = yIndex * (width + SMALL_PADDING);
|
|
7824
|
+
xValue = xValue + offset;
|
|
7825
|
+
}
|
|
7774
7826
|
return {
|
|
7775
|
-
x:
|
|
7827
|
+
x: xValue,
|
|
7776
7828
|
y: yValue,
|
|
7777
|
-
width
|
|
7778
|
-
height
|
|
7779
|
-
? yScale(0)
|
|
7780
|
-
: yScale(data.ys[yIndex - 1].values[index])) - yValue,
|
|
7829
|
+
width,
|
|
7830
|
+
height,
|
|
7781
7831
|
};
|
|
7782
7832
|
}));
|
|
7783
7833
|
function hover(pos) {
|
|
@@ -7787,14 +7837,20 @@ var Chart;
|
|
|
7787
7837
|
let visibleYIndex = data.ys
|
|
7788
7838
|
.map(y => y.values[xIndex])
|
|
7789
7839
|
.findIndex(y => y > yValue);
|
|
7840
|
+
if (config.groupingType == 'clustered') {
|
|
7841
|
+
visibleYIndex = findSubIndex(x, pos.x, binSize, data.ys.length);
|
|
7842
|
+
}
|
|
7790
7843
|
if (visibleYIndex == -1) {
|
|
7791
7844
|
visibleYIndex = data.ys.length - 1;
|
|
7792
7845
|
}
|
|
7793
7846
|
const yIndex = visibleIndices[visibleYIndex];
|
|
7794
7847
|
const ys = data.ys.map(y => yScale(y.values[xIndex]));
|
|
7795
|
-
|
|
7796
|
-
|
|
7797
|
-
|
|
7848
|
+
let anchorHeight = (visibleYIndex == 0 ? yScale(0) : ys[visibleYIndex - 1]) -
|
|
7849
|
+
ys[visibleYIndex];
|
|
7850
|
+
if (config.groupingType == 'clustered') {
|
|
7851
|
+
anchorHeight = Math.max(...yRangeVal) - ys[visibleYIndex];
|
|
7852
|
+
}
|
|
7853
|
+
const anchor = new DOMRect(pos.rect.x + bars[visibleYIndex][xIndex].x - SMALL_PADDING, pos.rect.y + ys[visibleYIndex], bars[visibleYIndex][xIndex].width + SMALL_PADDING * 2, anchorHeight);
|
|
7798
7854
|
return {
|
|
7799
7855
|
x,
|
|
7800
7856
|
xIndex,
|
|
@@ -7827,9 +7883,185 @@ var Chart;
|
|
|
7827
7883
|
areas: [],
|
|
7828
7884
|
hover,
|
|
7829
7885
|
arcs: [],
|
|
7886
|
+
horizontalBars: [],
|
|
7830
7887
|
};
|
|
7831
7888
|
}
|
|
7832
7889
|
Chart.bars = bars;
|
|
7890
|
+
function horizontalBars(config, allData, dimensions) {
|
|
7891
|
+
//Some of this stuff gets confusing, because x and y are essentially inverted here
|
|
7892
|
+
// So, if you see a situation where a variable is named 'y', but referencing
|
|
7893
|
+
// 'x' (or vice versa), that's why
|
|
7894
|
+
const { data: unstackedData, visibleIndices } = hide(allData);
|
|
7895
|
+
const data = config.groupingType == 'clustered' ? unstackedData : stack(unstackedData);
|
|
7896
|
+
const { range: yRange } = barYRange(dimensions, data);
|
|
7897
|
+
let yScale = data.type == 'labeled'
|
|
7898
|
+
? scaleLinear(indexDomain(data), yRange)
|
|
7899
|
+
: scaleUtc(timeseriesDomain(data), yRange);
|
|
7900
|
+
const dateFormat = (date) => formatedDate(config.dateFormat || 'day', date);
|
|
7901
|
+
const { pipe, fullPipe } = getPipes(config.valueType);
|
|
7902
|
+
const yTicks = yScale.ticks(data.x.length - 1).map(tick => ({
|
|
7903
|
+
y: yScale(tick),
|
|
7904
|
+
label: isNumber(tick)
|
|
7905
|
+
? data.type == 'labeled'
|
|
7906
|
+
? data.x[tick]
|
|
7907
|
+
: '-'
|
|
7908
|
+
: dateFormat(tick),
|
|
7909
|
+
}));
|
|
7910
|
+
const xScale = scaleLinear(yDomain(data), xRangeHorizontal(dimensions, data));
|
|
7911
|
+
const xTicks = xScale.ticks(5).map(tick => ({
|
|
7912
|
+
x: xScale(tick),
|
|
7913
|
+
label: pipe.transform(tick),
|
|
7914
|
+
}));
|
|
7915
|
+
const colors = visibleIndices.map(i => config.colors[i % config.colors.length]);
|
|
7916
|
+
const simplifiedHorizontalBars = [];
|
|
7917
|
+
const horizontalBars = data.ys.map((y, yIndex) => {
|
|
7918
|
+
const subSimpHorBars = [];
|
|
7919
|
+
const retVal = y.values.map((value, index) => {
|
|
7920
|
+
let xValue = yIndex == 0 ? xScale(0) : xScale(data.ys[yIndex - 1].values[index]);
|
|
7921
|
+
let width = xScale(value) - xValue;
|
|
7922
|
+
let yValue = yScale(data.type == 'labeled' ? index : data.x[index]) -
|
|
7923
|
+
HORIZONTAL_BAR_HEIGHT * 1.5;
|
|
7924
|
+
if (config.groupingType == 'clustered') {
|
|
7925
|
+
xValue = xScale(0);
|
|
7926
|
+
width = xScale(value) - xValue;
|
|
7927
|
+
const centerIndex = data.ys.length / 2 - 0.5;
|
|
7928
|
+
const offset = (yIndex - centerIndex) * (HORIZONTAL_BAR_HEIGHT + SMALL_PADDING);
|
|
7929
|
+
yValue = yValue + offset;
|
|
7930
|
+
}
|
|
7931
|
+
const r = 4;
|
|
7932
|
+
subSimpHorBars.push({
|
|
7933
|
+
xPos: xValue,
|
|
7934
|
+
yPos: yValue,
|
|
7935
|
+
width,
|
|
7936
|
+
});
|
|
7937
|
+
if (data.ys.length == 1 || config.groupingType == 'clustered') {
|
|
7938
|
+
//Both-sides rounding variation
|
|
7939
|
+
const pathD = `
|
|
7940
|
+
M ${xValue + r},${yValue}
|
|
7941
|
+
h ${width - r * 2}
|
|
7942
|
+
q${r},0 ${r},${r}
|
|
7943
|
+
v ${HORIZONTAL_BAR_HEIGHT - r * 2}
|
|
7944
|
+
q0,${r} -${r},${r}
|
|
7945
|
+
h ${-(width - r * 2)}
|
|
7946
|
+
q-${r},0 -${r},-${r}
|
|
7947
|
+
v -${HORIZONTAL_BAR_HEIGHT - r * 2}
|
|
7948
|
+
q0,-${r} ${r},-${r}
|
|
7949
|
+
Z
|
|
7950
|
+
`;
|
|
7951
|
+
return pathD;
|
|
7952
|
+
}
|
|
7953
|
+
if (yIndex == 0) {
|
|
7954
|
+
//Left-side rounding variation
|
|
7955
|
+
const pathD = `
|
|
7956
|
+
M ${xValue + r},${yValue}
|
|
7957
|
+
h ${width - r}
|
|
7958
|
+
v ${HORIZONTAL_BAR_HEIGHT}
|
|
7959
|
+
h ${-(width - r)}
|
|
7960
|
+
q-${r},0 -${r},-${r}
|
|
7961
|
+
v -${HORIZONTAL_BAR_HEIGHT - r * 2}
|
|
7962
|
+
q0,-${r} ${r},-${r}
|
|
7963
|
+
Z
|
|
7964
|
+
`;
|
|
7965
|
+
return pathD;
|
|
7966
|
+
}
|
|
7967
|
+
if (yIndex == data.ys.length - 1) {
|
|
7968
|
+
//Right-side rounding variation
|
|
7969
|
+
const pathD = `
|
|
7970
|
+
M ${xValue},${yValue}
|
|
7971
|
+
h ${width - r}
|
|
7972
|
+
q${r},0 ${r},${r}
|
|
7973
|
+
v ${HORIZONTAL_BAR_HEIGHT - r * 2}
|
|
7974
|
+
q0,${r} -${r},${r}
|
|
7975
|
+
h ${-(width - r)}
|
|
7976
|
+
Z
|
|
7977
|
+
`;
|
|
7978
|
+
return pathD;
|
|
7979
|
+
}
|
|
7980
|
+
//No-rounding variation
|
|
7981
|
+
const pathD = `
|
|
7982
|
+
M ${xValue},${yValue}
|
|
7983
|
+
h ${width}
|
|
7984
|
+
v ${HORIZONTAL_BAR_HEIGHT}
|
|
7985
|
+
h ${-width}
|
|
7986
|
+
v -${HORIZONTAL_BAR_HEIGHT}
|
|
7987
|
+
Z
|
|
7988
|
+
`;
|
|
7989
|
+
return pathD;
|
|
7990
|
+
});
|
|
7991
|
+
simplifiedHorizontalBars.push(subSimpHorBars);
|
|
7992
|
+
return retVal;
|
|
7993
|
+
});
|
|
7994
|
+
function hover(pos) {
|
|
7995
|
+
let xIndex = 0;
|
|
7996
|
+
let x = 0;
|
|
7997
|
+
let visibleYIndex = 0;
|
|
7998
|
+
if (checkYScaleType(yScale, data.type) && data.type != 'labeled') {
|
|
7999
|
+
xIndex = findNearestIndex(data.x, yScale.invert(pos.y).getTime());
|
|
8000
|
+
x = yScale(data.x[xIndex]) - SMALL_PADDING;
|
|
8001
|
+
const yValue = xScale.invert(pos.x);
|
|
8002
|
+
visibleYIndex = data.ys
|
|
8003
|
+
.map(y => y.values[xIndex])
|
|
8004
|
+
.findIndex(y => y > yValue);
|
|
8005
|
+
}
|
|
8006
|
+
else if (!checkYScaleType(yScale, data.type) &&
|
|
8007
|
+
data.type == 'labeled') {
|
|
8008
|
+
xIndex = findNearestIndexString(data.x, yScale.invert(pos.y));
|
|
8009
|
+
x = yScale(xIndex) - SMALL_PADDING;
|
|
8010
|
+
const yValue = xScale.invert(pos.x);
|
|
8011
|
+
visibleYIndex = data.ys
|
|
8012
|
+
.map(y => y.values[xIndex])
|
|
8013
|
+
.findIndex(y => y > yValue);
|
|
8014
|
+
}
|
|
8015
|
+
const ys = data.ys.map(y => xScale(y.values[xIndex]));
|
|
8016
|
+
if (config.groupingType == 'clustered') {
|
|
8017
|
+
visibleYIndex = findSubIndexHorizontal(x, pos.y, data.ys.length);
|
|
8018
|
+
}
|
|
8019
|
+
if (visibleYIndex == -1) {
|
|
8020
|
+
visibleYIndex = data.ys.length - 1;
|
|
8021
|
+
}
|
|
8022
|
+
const yIndex = visibleIndices[visibleYIndex];
|
|
8023
|
+
const anchor = new DOMRect(pos.rect.x +
|
|
8024
|
+
simplifiedHorizontalBars[visibleYIndex][xIndex].xPos -
|
|
8025
|
+
SMALL_PADDING, pos.rect.y + simplifiedHorizontalBars[visibleYIndex][xIndex].yPos, simplifiedHorizontalBars[visibleYIndex][xIndex].width +
|
|
8026
|
+
SMALL_PADDING * 2, HORIZONTAL_BAR_HEIGHT);
|
|
8027
|
+
return {
|
|
8028
|
+
x,
|
|
8029
|
+
xIndex,
|
|
8030
|
+
ys,
|
|
8031
|
+
yIndex,
|
|
8032
|
+
visibleYIndex,
|
|
8033
|
+
tooltip: {
|
|
8034
|
+
anchor,
|
|
8035
|
+
date: data.type == 'labeled'
|
|
8036
|
+
? unstackedData.x[xIndex].toString()
|
|
8037
|
+
: utcFormat('%B %d, %Y')(new Date(unstackedData.x[xIndex])),
|
|
8038
|
+
metrics: unstackedData.ys
|
|
8039
|
+
.map((y, index) => {
|
|
8040
|
+
var _a;
|
|
8041
|
+
return ({
|
|
8042
|
+
color: colors[index % colors.length],
|
|
8043
|
+
label: y.label,
|
|
8044
|
+
value: (_a = fullPipe.transform(y.values[xIndex])) !== null && _a !== void 0 ? _a : '-',
|
|
8045
|
+
});
|
|
8046
|
+
})
|
|
8047
|
+
.filter((_, i) => config.groupedTooltip || i == visibleYIndex),
|
|
8048
|
+
},
|
|
8049
|
+
};
|
|
8050
|
+
}
|
|
8051
|
+
return {
|
|
8052
|
+
xTicks: xTicks,
|
|
8053
|
+
yTicks: yTicks,
|
|
8054
|
+
hover,
|
|
8055
|
+
colors,
|
|
8056
|
+
bars: [],
|
|
8057
|
+
lines: [],
|
|
8058
|
+
circles: [],
|
|
8059
|
+
areas: [],
|
|
8060
|
+
arcs: [],
|
|
8061
|
+
horizontalBars,
|
|
8062
|
+
};
|
|
8063
|
+
}
|
|
8064
|
+
Chart.horizontalBars = horizontalBars;
|
|
7833
8065
|
function arcs(config, allData, dimensions) {
|
|
7834
8066
|
const { data: unstackedData, visibleIndices } = hide(allData);
|
|
7835
8067
|
const colors = visibleIndices.map(i => config.colors[i % config.colors.length]);
|
|
@@ -7854,13 +8086,19 @@ var Chart;
|
|
|
7854
8086
|
bars: [],
|
|
7855
8087
|
colors,
|
|
7856
8088
|
arcs,
|
|
8089
|
+
horizontalBars: [],
|
|
7857
8090
|
};
|
|
7858
8091
|
}
|
|
7859
8092
|
Chart.arcs = arcs;
|
|
7860
8093
|
const LEFT_PADDING = 48;
|
|
8094
|
+
const LEFT_PADDING_DATE = 64;
|
|
8095
|
+
Chart.LEFT_PADDING_LABEL_MAX = 192;
|
|
7861
8096
|
const RIGHT_PADDING = 24;
|
|
7862
8097
|
const TOP_PADDING = 16;
|
|
7863
8098
|
const BOTTOM_PADDING = 24;
|
|
8099
|
+
const SMALL_PADDING = 8;
|
|
8100
|
+
const HORIZONTAL_BAR_HEIGHT = 8;
|
|
8101
|
+
const WIDTH_PER_LETTER = 6.5;
|
|
7864
8102
|
Chart.defaultConfig = {
|
|
7865
8103
|
type: 'line',
|
|
7866
8104
|
groupedTooltip: true,
|
|
@@ -7885,9 +8123,23 @@ var Chart;
|
|
|
7885
8123
|
displayValue: '',
|
|
7886
8124
|
},
|
|
7887
8125
|
};
|
|
8126
|
+
const emptyChart = {
|
|
8127
|
+
xTicks: [],
|
|
8128
|
+
yTicks: [],
|
|
8129
|
+
colors: [],
|
|
8130
|
+
lines: [],
|
|
8131
|
+
circles: [],
|
|
8132
|
+
areas: [],
|
|
8133
|
+
bars: [],
|
|
8134
|
+
arcs: [],
|
|
8135
|
+
horizontalBars: [],
|
|
8136
|
+
};
|
|
7888
8137
|
function timeseriesDomain(data) {
|
|
7889
8138
|
return [Math.min(...data.x), Math.max(...data.x)];
|
|
7890
8139
|
}
|
|
8140
|
+
function indexDomain(data) {
|
|
8141
|
+
return [0, data.x.length - 1];
|
|
8142
|
+
}
|
|
7891
8143
|
function yDomain(data) {
|
|
7892
8144
|
const max = Math.max(...data.ys.map(y => Math.max(...y.values)));
|
|
7893
8145
|
return [0, max == 0 ? 1 : max];
|
|
@@ -7895,6 +8147,20 @@ var Chart;
|
|
|
7895
8147
|
function xRange(dimensions) {
|
|
7896
8148
|
return [LEFT_PADDING, dimensions.width - RIGHT_PADDING];
|
|
7897
8149
|
}
|
|
8150
|
+
function xRangeHorizontal(dimensions, data) {
|
|
8151
|
+
let leftPaddingMax = data.type == 'labeled' ? Chart.LEFT_PADDING_LABEL_MAX : LEFT_PADDING_DATE;
|
|
8152
|
+
let leftPaddingCalculated = leftPaddingMax;
|
|
8153
|
+
if (data.type == 'labeled') {
|
|
8154
|
+
const maxLabelSize = Math.max(...data.x.map(x => x.length));
|
|
8155
|
+
leftPaddingCalculated = Math.min(leftPaddingMax, maxLabelSize * WIDTH_PER_LETTER);
|
|
8156
|
+
}
|
|
8157
|
+
//Space between label and chart
|
|
8158
|
+
leftPaddingCalculated = leftPaddingCalculated + SMALL_PADDING;
|
|
8159
|
+
return [
|
|
8160
|
+
Math.max(leftPaddingCalculated, LEFT_PADDING),
|
|
8161
|
+
dimensions.width - RIGHT_PADDING,
|
|
8162
|
+
];
|
|
8163
|
+
}
|
|
7898
8164
|
function barXRange(dimensions, data) {
|
|
7899
8165
|
const left = LEFT_PADDING;
|
|
7900
8166
|
const right = dimensions.width - RIGHT_PADDING;
|
|
@@ -7904,6 +8170,15 @@ var Chart;
|
|
|
7904
8170
|
const range = [left + halfBinSize, right - halfBinSize];
|
|
7905
8171
|
return { binSize: Math.min(binSize * 0.7, 80), range };
|
|
7906
8172
|
}
|
|
8173
|
+
function barYRange(dimensions, data) {
|
|
8174
|
+
const top = dimensions.height - TOP_PADDING;
|
|
8175
|
+
const bottom = BOTTOM_PADDING;
|
|
8176
|
+
const height = top - bottom;
|
|
8177
|
+
const binSize = height / (data.x.length || 1);
|
|
8178
|
+
const halfBinSize = binSize / 2;
|
|
8179
|
+
const range = [bottom + halfBinSize, top - halfBinSize];
|
|
8180
|
+
return { range };
|
|
8181
|
+
}
|
|
7907
8182
|
function yRange(dimensions) {
|
|
7908
8183
|
return [dimensions.height - BOTTOM_PADDING, TOP_PADDING];
|
|
7909
8184
|
}
|
|
@@ -7914,6 +8189,45 @@ var Chart;
|
|
|
7914
8189
|
: nearestIndex;
|
|
7915
8190
|
}, 0);
|
|
7916
8191
|
}
|
|
8192
|
+
function findNearestIndexString(values, input) {
|
|
8193
|
+
const numValues = values.map((_, i) => i);
|
|
8194
|
+
return numValues.reduce((nearestIndex, value, index) => {
|
|
8195
|
+
return Math.abs(value - input) < Math.abs(numValues[nearestIndex] - input)
|
|
8196
|
+
? index
|
|
8197
|
+
: nearestIndex;
|
|
8198
|
+
}, 0);
|
|
8199
|
+
}
|
|
8200
|
+
function findSubIndex(value, input, binSize, subBinCount) {
|
|
8201
|
+
const subBinSize = (binSize - (subBinCount - 1 * SMALL_PADDING)) / subBinCount;
|
|
8202
|
+
const centerIndex = subBinCount / 2 - 0.5;
|
|
8203
|
+
let closestIndex = 0;
|
|
8204
|
+
let closenessVal = -1;
|
|
8205
|
+
for (let i = 0; i < subBinCount; i++) {
|
|
8206
|
+
const offset = (i - centerIndex) * (subBinSize + SMALL_PADDING);
|
|
8207
|
+
const subBinPos = value + offset;
|
|
8208
|
+
const distance = Math.abs(input - subBinPos);
|
|
8209
|
+
if (closenessVal < 0 || closenessVal > distance) {
|
|
8210
|
+
closestIndex = i;
|
|
8211
|
+
closenessVal = distance;
|
|
8212
|
+
}
|
|
8213
|
+
}
|
|
8214
|
+
return closestIndex;
|
|
8215
|
+
}
|
|
8216
|
+
function findSubIndexHorizontal(value, input, subBinCount) {
|
|
8217
|
+
const centerIndex = subBinCount / 2 - 0.5;
|
|
8218
|
+
let closestIndex = 0;
|
|
8219
|
+
let closenessVal = -1;
|
|
8220
|
+
for (let i = 0; i < subBinCount; i++) {
|
|
8221
|
+
const offset = (i - centerIndex) * (HORIZONTAL_BAR_HEIGHT + SMALL_PADDING);
|
|
8222
|
+
const subBinPos = value + offset;
|
|
8223
|
+
const distance = Math.abs(input - subBinPos);
|
|
8224
|
+
if (closenessVal < 0 || closenessVal > distance) {
|
|
8225
|
+
closestIndex = i;
|
|
8226
|
+
closenessVal = distance;
|
|
8227
|
+
}
|
|
8228
|
+
}
|
|
8229
|
+
return closestIndex;
|
|
8230
|
+
}
|
|
7917
8231
|
// stack returns a new data where each set of yValues is stacked
|
|
7918
8232
|
// on top of the previous.
|
|
7919
8233
|
function stack(data) {
|
|
@@ -7999,6 +8313,12 @@ var Chart;
|
|
|
7999
8313
|
return donutData;
|
|
8000
8314
|
}
|
|
8001
8315
|
Chart.convertChartDataToDonutData = convertChartDataToDonutData;
|
|
8316
|
+
function checkYScaleType(input, dataType) {
|
|
8317
|
+
if (dataType == 'labeled') {
|
|
8318
|
+
return false;
|
|
8319
|
+
}
|
|
8320
|
+
return true;
|
|
8321
|
+
}
|
|
8002
8322
|
})(Chart || (Chart = {}));
|
|
8003
8323
|
|
|
8004
8324
|
class LegendItemComponent {
|
|
@@ -8047,10 +8367,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
8047
8367
|
|
|
8048
8368
|
class ChartComponent {
|
|
8049
8369
|
constructor() {
|
|
8050
|
-
this.
|
|
8370
|
+
this.height$ = new BehaviorSubject(300);
|
|
8051
8371
|
this.width$ = new BehaviorSubject(0);
|
|
8052
8372
|
this.config$ = new BehaviorSubject(Chart.defaultConfig);
|
|
8053
8373
|
this.data$ = new BehaviorSubject({
|
|
8374
|
+
type: 'timeseries',
|
|
8054
8375
|
x: [],
|
|
8055
8376
|
ys: [],
|
|
8056
8377
|
});
|
|
@@ -8074,12 +8395,12 @@ class ChartComponent {
|
|
|
8074
8395
|
// if toggled, flip the hidden boolean
|
|
8075
8396
|
hidden: toggledLegends[y.label] ? !y.hidden : y.hidden }))) });
|
|
8076
8397
|
const viewBox = config.type == 'donut'
|
|
8077
|
-
? `${-this.
|
|
8078
|
-
${this.
|
|
8079
|
-
: `0 0 ${width} ${this.
|
|
8398
|
+
? `${-this.height / 2} ${-this.height / 2}
|
|
8399
|
+
${this.height} ${this.height}`
|
|
8400
|
+
: `0 0 ${width} ${this.height}`;
|
|
8080
8401
|
return Object.assign({ viewBox, data: hiddenData }, Chart.chart(config, hiddenData, {
|
|
8081
8402
|
width: width,
|
|
8082
|
-
height: this.
|
|
8403
|
+
height: this.height,
|
|
8083
8404
|
}));
|
|
8084
8405
|
}));
|
|
8085
8406
|
this.empty$ = this.data$.pipe(map(d => (d.x.length == 0 && this.config.type != 'donut') || d.ys.length == 0));
|
|
@@ -8090,6 +8411,7 @@ class ChartComponent {
|
|
|
8090
8411
|
this.moreTextWidth = 50;
|
|
8091
8412
|
this.baseLegendItemWidth = 40;
|
|
8092
8413
|
this.widthPerLetter = 6.5;
|
|
8414
|
+
this.leftLabelMaxSize = Chart.LEFT_PADDING_LABEL_MAX;
|
|
8093
8415
|
this.firstHiddenLegendItemIndex$ = combineLatest([
|
|
8094
8416
|
this.width$,
|
|
8095
8417
|
this.config$,
|
|
@@ -8110,6 +8432,12 @@ class ChartComponent {
|
|
|
8110
8432
|
return data.ys.length;
|
|
8111
8433
|
}));
|
|
8112
8434
|
}
|
|
8435
|
+
set height(w) {
|
|
8436
|
+
this.height$.next(w);
|
|
8437
|
+
}
|
|
8438
|
+
get height() {
|
|
8439
|
+
return this.height$.value;
|
|
8440
|
+
}
|
|
8113
8441
|
set width(w) {
|
|
8114
8442
|
this.width$.next(w);
|
|
8115
8443
|
}
|
|
@@ -8173,10 +8501,10 @@ class ChartComponent {
|
|
|
8173
8501
|
}
|
|
8174
8502
|
}
|
|
8175
8503
|
ChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8176
|
-
ChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ChartComponent, selector: "riv-chart", inputs: { config: "config", data: "data" }, outputs: { chartClicked: "chartClicked" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }, { propertyName: "moreTextContainer", first: true, predicate: ["moreTextContainer"], descendants: true }], ngImport: i0, template: "<div\n class=\"container\"\n (rivClientSize)=\"width = $event.width\"\n *ngIf=\"(empty$ | async) === false; else zeroState\"\n>\n <ng-container *ngIf=\"drawData$ | async; let d\">\n <div\n (mousemove)=\"mousemove($event, d.hover)\"\n (mouseleave)=\"mouseleave($event)\"\n (click)=\"click()\"\n #container\n class=\"sub-container\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n [attr.viewBox]=\"d.viewBox\"\n width=\"100%\"\n [attr.height]=\"HEIGHT\"\n >\n <g *ngFor=\"let tick of d.xTicks\" text-anchor=\"middle\">\n <line\n class=\"tick-line\"\n [attr.x1]=\"tick.x\"\n [attr.x2]=\"tick.x\"\n y1=\"0\"\n [attr.y2]=\"HEIGHT - 16\"\n ></line>\n <text class=\"tick-label\" [attr.x]=\"tick.x\" [attr.y]=\"HEIGHT - 4\">\n {{ tick.label }}\n </text>\n </g>\n <g *ngFor=\"let tick of d.yTicks\">\n <line\n class=\"tick-line\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\"\n x1=\"0\"\n [attr.x2]=\"width\"\n ></line>\n <text class=\"tick-label\" [attr.y]=\"tick.y - 4\" [attr.x]=\"0\">\n {{ tick.label }}\n </text>\n </g>\n <g *ngIf=\"!!hover\">\n <line\n class=\"tick-line\"\n [attr.x1]=\"hover.x\"\n [attr.x2]=\"hover.x\"\n y1=\"0\"\n [attr.y2]=\"HEIGHT - 16\"\n stroke-width=\"2\"\n stroke-dasharray=\"4\"\n />\n </g>\n <g *ngFor=\"let bar of d.bars; let i = index\">\n <rect\n *ngFor=\"let rect of bar\"\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n [attr.fill]=\"varColor(d.colors, i)\"\n ></rect>\n </g>\n <g *ngFor=\"let line of d.lines; let i = index\">\n <path\n [attr.d]=\"line\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n fill=\"none\"\n stroke-width=\"2\"\n ></path>\n </g>\n <g *ngFor=\"let lineSinglePointFallback of d.circles; let i = index\">\n <circle\n class=\"marker\"\n [attr.cx]=\"lineSinglePointFallback.cx\"\n [attr.cy]=\"lineSinglePointFallback.cy\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </g>\n <g *ngFor=\"let line of d.lines; let i = index\">\n <circle\n class=\"marker\"\n *ngIf=\"\n !!hover && (config.groupedTooltip || i === hover.visibleYIndex)\n \"\n [attr.cx]=\"hover.x\"\n [attr.cy]=\"hover.ys[i]\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </g>\n <g *ngFor=\"let area of d.areas; let i = index\">\n <path [attr.d]=\"area\" [attr.fill]=\"varColor(d.colors, i)\"></path>\n </g>\n <g *ngFor=\"let area of d.areas; let i = index\">\n <circle\n class=\"marker\"\n *ngIf=\"\n !!hover && (config.groupedTooltip || i === hover.visibleYIndex)\n \"\n [attr.cx]=\"hover.x\"\n [attr.cy]=\"hover.ys[i]\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </g>\n <path\n *ngFor=\"let path of d.arcs; let i = index\"\n [attr.d]=\"path\"\n [attr.fill]=\"varColor(d.colors, i)\"\n ></path>\n </svg>\n <div *ngIf=\"config.type === 'donut'\" class=\"donut-display\">\n <div class=\"donut-value\" [ngClass]=\"config.donutDisplayInfo.size\">\n {{ config.donutDisplayInfo.displayValue }}\n </div>\n <div class=\"donut-label\">\n {{ config.donutDisplayInfo.displayLabel }}\n </div>\n </div>\n <ng-container *ngIf=\"!!hover && hover.tooltip\">\n <riv-callout\n *riv-overlay\n [anchor]=\"hover.tooltip.anchor\"\n [isModal]=\"false\"\n [preferredPosition]=\"'center-right'\"\n [theme]=\"'light'\"\n >\n <div class=\"callout-content\">\n <div *ngIf=\"hover.tooltip.date\" class=\"callout-row\">\n {{ hover.tooltip.date }}\n </div>\n <div\n class=\"callout-row\"\n *ngFor=\"let metric of hover.tooltip.metrics\"\n >\n <span class=\"series-label\">\n <riv-legend-item [colorToken]=\"metric.color\"></riv-legend-item>\n <span>{{ metric.label }}</span>\n </span>\n <span>{{ metric.value }}</span>\n </div>\n </div>\n </riv-callout>\n </ng-container>\n </div>\n <legend>\n <ng-container *ngIf=\"firstHiddenLegendItemIndex$ | async; let fi\">\n <ng-container *ngFor=\"let item of d.data.ys; let i = index\">\n <riv-legend-item\n *ngIf=\"i < fi\"\n [label]=\"item.label\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [clickable]=\"config.allowLegendToggle\"\n [colorToken]=\"config.colors[i % config.colors.length]\"\n (itemClick)=\"toggleLegend(item.label)\"\n ></riv-legend-item>\n </ng-container>\n <div\n #moreTextContainer\n class=\"more-text-container\"\n (mouseover)=\"mouseoverLegend()\"\n (mouseleave)=\"mouseleaveLegend()\"\n (click)=\"moreClick()\"\n *ngIf=\"fi < d.data.ys.length\"\n >\n <span rivLink class=\"more-text\">\n +\n {{ d.data.ys.length - fi }} more\n </span>\n </div>\n <ng-container *ngIf=\"showMoreTooltip || lockShowMoreTooltip\">\n <riv-callout\n *riv-overlay\n [anchor]=\"moreTextContainer?.nativeElement\"\n [isModal]=\"lockShowMoreTooltip\"\n (close)=\"lockShowMoreTooltip = false\"\n [preferredPosition]=\"'bottom-right'\"\n [theme]=\"'light'\"\n [showCaret]=\"false\"\n >\n <div class=\"legend-tooltip\">\n <ng-container *ngFor=\"let item of d.data.ys; let i = index\">\n <riv-legend-item\n *ngIf=\"i >= fi\"\n [label]=\"item.label\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [clickable]=\"config.allowLegendToggle\"\n [colorToken]=\"config.colors[i % config.colors.length]\"\n (itemClick)=\"toggleLegend(item.label)\"\n ></riv-legend-item>\n </ng-container>\n </div>\n </riv-callout>\n </ng-container>\n </ng-container>\n </legend>\n </ng-container>\n</div>\n\n<ng-template #zeroState>\n <riv-zero-state [message]=\"config.zeroStateMessage\"></riv-zero-state>\n</ng-template>\n", styles: [".container{-webkit-user-select:none;user-select:none;position:relative;display:flex;flex-direction:column;gap:var(--size-small)}.tick-line{stroke:var(--gray-20)}.tick-label{font-size:var(--type-1-font-size);line-height:var(--type-1-line-height-0);fill:var(--type-light-low-contrast)}.marker{fill:var(--surface-light-0)}.callout-content{pointer-events:none;padding:var(--size-medium) var(--size-xlarge);display:flex;flex-direction:column}.callout-row{white-space:nowrap;display:flex;padding:var(--size-medium) 0;gap:var(--size-medium);align-items:center;font-size:var(--type-1-font-size);line-height:var(--type-1-line-height-0)}.callout-row:not(:last-child){border-bottom:var(--border-width) solid var(--border-light)}.series-label{flex-grow:1;font-weight:var(--font-weight-heavy);display:flex;align-items:center;gap:var(--size-small)}legend{display:flex;flex-wrap:wrap;gap:var(--size-large);justify-content:flex-start;align-items:baseline;width:100%}.more-text-container{width:calc(var(--base-grid-size) * 15);height:var(--size-large)}.more-text{font-size:var(--type-1-font-size);top:calc(var(--base-grid-size) * -1);position:relative}.legend-tooltip{padding:var(--size-medium) var(--size-xlarge);display:flex;flex-direction:column;overflow-y:scroll;max-height:clamp(0px,60vh,600px)}.legend-tooltip>riv-legend-item{white-space:nowrap;display:flex;padding:var(--size-medium) 0;gap:var(--size-medium);align-items:center;line-height:var(--type-1-line-height-0)}.sub-container{display:grid;grid-template-rows:1fr;grid-template-columns:1fr;justify-items:center;align-items:center}svg{grid-row:1 / 1;grid-column:1 / 1}.donut-display{grid-row:1 / 1;grid-column:1 / 1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--size-small)}.donut-label{font-size:var(--type-1-font-size);line-height:var(--type-1-line-height-0);color:var(--type-light-low-contrast)}.donut-value,.donut-label{text-shadow:0 0 var(--size-small) var(--surface-light-0),0 0 var(--size-xsmall) var(--surface-light-0)}.donut-value.xsmall{font:var(--stat-xsmall)}.donut-value.small{font:var(--stat-small)}.donut-value.medium{font:var(--stat-medium)}.donut-value.large{font:var(--stat-large)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CalloutComponent, selector: "riv-callout", inputs: ["anchor", "isModal", "preferredPosition", "allowedPositions", "fallbackDirection", "showCaret", "theme"], outputs: ["close"] }, { kind: "component", type: LegendItemComponent, selector: "riv-legend-item", inputs: ["label", "colorToken", "style", "visibility", "iconTooltip", "clickable", "showCheckWhenClickable"], outputs: ["itemClick"] }, { kind: "component", type: LinkComponent, selector: "[rivLink]", inputs: ["disabled", "locked", "theme", "variant"] }, { kind: "directive", type: OverlayDirective, selector: "[riv-overlay]" }, { kind: "directive", type: SizeDirective, selector: "[rivClientSize]", outputs: ["rivClientSize"] }, { kind: "component", type: ZeroStateComponent, selector: "riv-zero-state", inputs: ["message", "title", "icon"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8504
|
+
ChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ChartComponent, selector: "riv-chart", inputs: { config: "config", data: "data" }, outputs: { chartClicked: "chartClicked" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }, { propertyName: "moreTextContainer", first: true, predicate: ["moreTextContainer"], descendants: true }], ngImport: i0, template: "<div\n class=\"container\"\n (rivClientSize)=\"width = $event.width\"\n *ngIf=\"(empty$ | async) === false; else zeroState\"\n>\n <ng-container *ngIf=\"drawData$ | async; let d\">\n <div\n (mousemove)=\"mousemove($event, d.hover)\"\n (mouseleave)=\"mouseleave($event)\"\n (click)=\"click()\"\n #container\n class=\"sub-container\"\n >\n <svg:svg\n xmlns=\"http://www.w3.org/2000/svg\"\n [attr.viewBox]=\"d.viewBox\"\n width=\"100%\"\n [attr.height]=\"height\"\n >\n <ng-container *ngIf=\"!(config.type === 'horizontal-bar')\">\n <g *ngFor=\"let tick of d.xTicks\" text-anchor=\"middle\">\n <line\n class=\"tick-line\"\n [attr.x1]=\"tick.x\"\n [attr.x2]=\"tick.x\"\n y1=\"0\"\n [attr.y2]=\"height - 16\"\n ></line>\n <text class=\"tick-label\" [attr.x]=\"tick.x\" [attr.y]=\"height - 4\">\n {{ tick.label }}\n </text>\n </g>\n </ng-container>\n <ng-container *ngIf=\"config.type === 'horizontal-bar'\">\n <g *ngFor=\"let tick of d.xTicks\" text-anchor=\"left\">\n <text class=\"tick-label\" [attr.x]=\"tick.x\" [attr.y]=\"12\">\n {{ tick.label }}\n </text>\n <line\n class=\"tick-line\"\n [attr.x1]=\"tick.x\"\n [attr.x2]=\"tick.x\"\n y1=\"0\"\n [attr.y2]=\"height - 16\"\n ></line>\n </g>\n </ng-container>\n <g *ngFor=\"let tick of d.yTicks\">\n <line\n *ngIf=\"!(config.type === 'horizontal-bar')\"\n class=\"tick-line\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\"\n x1=\"0\"\n [attr.x2]=\"width\"\n ></line>\n <text\n rivSVGTextTruncate\n [text]=\"tick.label\"\n [width]=\"leftLabelMaxSize\"\n class=\"tick-label\"\n [attr.y]=\"tick.y - 4\"\n [attr.x]=\"0\"\n >\n {{ tick.label }}\n </text>\n </g>\n <g *ngIf=\"!!hover && !(config.type === 'horizontal-bar')\">\n <line\n class=\"tick-line\"\n [attr.x1]=\"hover.x\"\n [attr.x2]=\"hover.x\"\n y1=\"0\"\n [attr.y2]=\"height - 16\"\n stroke-width=\"2\"\n stroke-dasharray=\"4\"\n />\n </g>\n <g *ngFor=\"let bar of d.bars; let i = index\">\n <rect\n *ngFor=\"let rect of bar\"\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n [attr.fill]=\"varColor(d.colors, i)\"\n ></rect>\n </g>\n <g *ngFor=\"let bar of d.horizontalBars; let i = index\">\n <path\n *ngFor=\"let indBar of bar\"\n [attr.d]=\"indBar\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n [attr.fill]=\"varColor(d.colors, i)\"\n stroke-width=\"2\"\n />\n </g>\n <g *ngFor=\"let line of d.lines; let i = index\">\n <path\n [attr.d]=\"line\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n fill=\"none\"\n stroke-width=\"2\"\n ></path>\n </g>\n <g *ngFor=\"let lineSinglePointFallback of d.circles; let i = index\">\n <circle\n class=\"marker\"\n [attr.cx]=\"lineSinglePointFallback.cx\"\n [attr.cy]=\"lineSinglePointFallback.cy\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </g>\n <g *ngFor=\"let line of d.lines; let i = index\">\n <circle\n class=\"marker\"\n *ngIf=\"\n !!hover && (config.groupedTooltip || i === hover.visibleYIndex)\n \"\n [attr.cx]=\"hover.x\"\n [attr.cy]=\"hover.ys[i]\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </g>\n <g *ngFor=\"let area of d.areas; let i = index\">\n <path [attr.d]=\"area\" [attr.fill]=\"varColor(d.colors, i)\"></path>\n </g>\n <g *ngFor=\"let area of d.areas; let i = index\">\n <circle\n class=\"marker\"\n *ngIf=\"\n !!hover && (config.groupedTooltip || i === hover.visibleYIndex)\n \"\n [attr.cx]=\"hover.x\"\n [attr.cy]=\"hover.ys[i]\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </g>\n <path\n *ngFor=\"let path of d.arcs; let i = index\"\n [attr.d]=\"path\"\n [attr.fill]=\"varColor(d.colors, i)\"\n ></path>\n </svg:svg>\n <div *ngIf=\"config.type === 'donut'\" class=\"donut-display\">\n <div class=\"donut-value\" [ngClass]=\"config.donutDisplayInfo.size\">\n {{ config.donutDisplayInfo.displayValue }}\n </div>\n <div class=\"donut-label\">\n {{ config.donutDisplayInfo.displayLabel }}\n </div>\n </div>\n <ng-container *ngIf=\"!!hover && hover.tooltip\">\n <riv-callout\n *riv-overlay\n [anchor]=\"hover.tooltip.anchor\"\n [isModal]=\"false\"\n [preferredPosition]=\"'center-right'\"\n [theme]=\"'light'\"\n >\n <div class=\"callout-content\">\n <div *ngIf=\"hover.tooltip.date\" class=\"callout-row\">\n {{ hover.tooltip.date }}\n </div>\n <div\n class=\"callout-row\"\n *ngFor=\"let metric of hover.tooltip.metrics\"\n >\n <span class=\"series-label\">\n <riv-legend-item [colorToken]=\"metric.color\"></riv-legend-item>\n <span>{{ metric.label }}</span>\n </span>\n <span>{{ metric.value }}</span>\n </div>\n </div>\n </riv-callout>\n </ng-container>\n </div>\n <legend>\n <ng-container *ngIf=\"firstHiddenLegendItemIndex$ | async; let fi\">\n <ng-container *ngFor=\"let item of d.data.ys; let i = index\">\n <riv-legend-item\n *ngIf=\"i < fi\"\n [label]=\"item.label\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [clickable]=\"config.allowLegendToggle\"\n [colorToken]=\"config.colors[i % config.colors.length]\"\n (itemClick)=\"toggleLegend(item.label)\"\n ></riv-legend-item>\n </ng-container>\n <div\n #moreTextContainer\n class=\"more-text-container\"\n (mouseover)=\"mouseoverLegend()\"\n (mouseleave)=\"mouseleaveLegend()\"\n (click)=\"moreClick()\"\n *ngIf=\"fi < d.data.ys.length\"\n >\n <span rivLink class=\"more-text\">\n +\n {{ d.data.ys.length - fi }} more\n </span>\n </div>\n <ng-container *ngIf=\"showMoreTooltip || lockShowMoreTooltip\">\n <riv-callout\n *riv-overlay\n [anchor]=\"moreTextContainer?.nativeElement\"\n [isModal]=\"lockShowMoreTooltip\"\n (close)=\"lockShowMoreTooltip = false\"\n [preferredPosition]=\"'bottom-right'\"\n [theme]=\"'light'\"\n [showCaret]=\"false\"\n >\n <div class=\"legend-tooltip\">\n <ng-container *ngFor=\"let item of d.data.ys; let i = index\">\n <riv-legend-item\n *ngIf=\"i >= fi\"\n [label]=\"item.label\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [clickable]=\"config.allowLegendToggle\"\n [colorToken]=\"config.colors[i % config.colors.length]\"\n (itemClick)=\"toggleLegend(item.label)\"\n ></riv-legend-item>\n </ng-container>\n </div>\n </riv-callout>\n </ng-container>\n </ng-container>\n </legend>\n </ng-container>\n</div>\n\n<ng-template #zeroState>\n <riv-zero-state [message]=\"config.zeroStateMessage\"></riv-zero-state>\n</ng-template>\n", styles: [".container{-webkit-user-select:none;user-select:none;position:relative;display:flex;flex-direction:column;gap:var(--size-small)}.tick-line{stroke:var(--gray-20)}.tick-label{font-size:var(--type-1-font-size);line-height:var(--type-1-line-height-0);fill:var(--type-light-low-contrast)}.marker{fill:var(--surface-light-0)}.callout-content{pointer-events:none;padding:var(--size-medium) var(--size-xlarge);display:flex;flex-direction:column}.callout-row{white-space:nowrap;display:flex;padding:var(--size-medium) 0;gap:var(--size-medium);align-items:center;font-size:var(--type-1-font-size);line-height:var(--type-1-line-height-0)}.callout-row:not(:last-child){border-bottom:var(--border-width) solid var(--border-light)}.series-label{flex-grow:1;font-weight:var(--font-weight-heavy);display:flex;align-items:center;gap:var(--size-small)}legend{display:flex;flex-wrap:wrap;gap:var(--size-large);justify-content:flex-start;align-items:baseline;width:100%}.more-text-container{width:calc(var(--base-grid-size) * 15);height:var(--size-large)}.more-text{font-size:var(--type-1-font-size);top:calc(var(--base-grid-size) * -1);position:relative}.legend-tooltip{padding:var(--size-medium) var(--size-xlarge);display:flex;flex-direction:column;overflow-y:scroll;max-height:clamp(0px,60vh,600px)}.legend-tooltip>riv-legend-item{white-space:nowrap;display:flex;padding:var(--size-medium) 0;gap:var(--size-medium);align-items:center;line-height:var(--type-1-line-height-0)}.sub-container{display:grid;grid-template-rows:1fr;grid-template-columns:1fr;justify-items:center;align-items:center}svg{grid-row:1 / 1;grid-column:1 / 1}.donut-display{grid-row:1 / 1;grid-column:1 / 1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--size-small)}.donut-label{font-size:var(--type-1-font-size);line-height:var(--type-1-line-height-0);color:var(--type-light-low-contrast)}.donut-value,.donut-label{text-shadow:0 0 var(--size-small) var(--surface-light-0),0 0 var(--size-xsmall) var(--surface-light-0)}.donut-value.xsmall{font:var(--stat-xsmall)}.donut-value.small{font:var(--stat-small)}.donut-value.medium{font:var(--stat-medium)}.donut-value.large{font:var(--stat-large)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CalloutComponent, selector: "riv-callout", inputs: ["anchor", "isModal", "preferredPosition", "allowedPositions", "fallbackDirection", "showCaret", "theme"], outputs: ["close"] }, { kind: "component", type: LegendItemComponent, selector: "riv-legend-item", inputs: ["label", "colorToken", "style", "visibility", "iconTooltip", "clickable", "showCheckWhenClickable"], outputs: ["itemClick"] }, { kind: "component", type: LinkComponent, selector: "[rivLink]", inputs: ["disabled", "locked", "theme", "variant"] }, { kind: "directive", type: OverlayDirective, selector: "[riv-overlay]" }, { kind: "directive", type: SizeDirective, selector: "[rivClientSize]", outputs: ["rivClientSize"] }, { kind: "directive", type: SVGTextTruncateDirective, selector: "svg text[rivSVGTextTruncate]", inputs: ["text", "width"] }, { kind: "component", type: ZeroStateComponent, selector: "riv-zero-state", inputs: ["message", "title", "icon"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8177
8505
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChartComponent, decorators: [{
|
|
8178
8506
|
type: Component,
|
|
8179
|
-
args: [{ selector: 'riv-chart', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"container\"\n (rivClientSize)=\"width = $event.width\"\n *ngIf=\"(empty$ | async) === false; else zeroState\"\n>\n <ng-container *ngIf=\"drawData$ | async; let d\">\n <div\n (mousemove)=\"mousemove($event, d.hover)\"\n (mouseleave)=\"mouseleave($event)\"\n (click)=\"click()\"\n #container\n class=\"sub-container\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n [attr.viewBox]=\"d.viewBox\"\n width=\"100%\"\n [attr.height]=\"HEIGHT\"\n >\n <g *ngFor=\"let tick of d.xTicks\" text-anchor=\"middle\">\n <line\n class=\"tick-line\"\n [attr.x1]=\"tick.x\"\n [attr.x2]=\"tick.x\"\n y1=\"0\"\n [attr.y2]=\"HEIGHT - 16\"\n ></line>\n <text class=\"tick-label\" [attr.x]=\"tick.x\" [attr.y]=\"HEIGHT - 4\">\n {{ tick.label }}\n </text>\n </g>\n <g *ngFor=\"let tick of d.yTicks\">\n <line\n class=\"tick-line\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\"\n x1=\"0\"\n [attr.x2]=\"width\"\n ></line>\n <text class=\"tick-label\" [attr.y]=\"tick.y - 4\" [attr.x]=\"0\">\n {{ tick.label }}\n </text>\n </g>\n <g *ngIf=\"!!hover\">\n <line\n class=\"tick-line\"\n [attr.x1]=\"hover.x\"\n [attr.x2]=\"hover.x\"\n y1=\"0\"\n [attr.y2]=\"HEIGHT - 16\"\n stroke-width=\"2\"\n stroke-dasharray=\"4\"\n />\n </g>\n <g *ngFor=\"let bar of d.bars; let i = index\">\n <rect\n *ngFor=\"let rect of bar\"\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n [attr.fill]=\"varColor(d.colors, i)\"\n ></rect>\n </g>\n <g *ngFor=\"let line of d.lines; let i = index\">\n <path\n [attr.d]=\"line\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n fill=\"none\"\n stroke-width=\"2\"\n ></path>\n </g>\n <g *ngFor=\"let lineSinglePointFallback of d.circles; let i = index\">\n <circle\n class=\"marker\"\n [attr.cx]=\"lineSinglePointFallback.cx\"\n [attr.cy]=\"lineSinglePointFallback.cy\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </g>\n <g *ngFor=\"let line of d.lines; let i = index\">\n <circle\n class=\"marker\"\n *ngIf=\"\n !!hover && (config.groupedTooltip || i === hover.visibleYIndex)\n \"\n [attr.cx]=\"hover.x\"\n [attr.cy]=\"hover.ys[i]\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </g>\n <g *ngFor=\"let area of d.areas; let i = index\">\n <path [attr.d]=\"area\" [attr.fill]=\"varColor(d.colors, i)\"></path>\n </g>\n <g *ngFor=\"let area of d.areas; let i = index\">\n <circle\n class=\"marker\"\n *ngIf=\"\n !!hover && (config.groupedTooltip || i === hover.visibleYIndex)\n \"\n [attr.cx]=\"hover.x\"\n [attr.cy]=\"hover.ys[i]\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </g>\n <path\n *ngFor=\"let path of d.arcs; let i = index\"\n [attr.d]=\"path\"\n [attr.fill]=\"varColor(d.colors, i)\"\n ></path>\n </svg>\n <div *ngIf=\"config.type === 'donut'\" class=\"donut-display\">\n <div class=\"donut-value\" [ngClass]=\"config.donutDisplayInfo.size\">\n {{ config.donutDisplayInfo.displayValue }}\n </div>\n <div class=\"donut-label\">\n {{ config.donutDisplayInfo.displayLabel }}\n </div>\n </div>\n <ng-container *ngIf=\"!!hover && hover.tooltip\">\n <riv-callout\n *riv-overlay\n [anchor]=\"hover.tooltip.anchor\"\n [isModal]=\"false\"\n [preferredPosition]=\"'center-right'\"\n [theme]=\"'light'\"\n >\n <div class=\"callout-content\">\n <div *ngIf=\"hover.tooltip.date\" class=\"callout-row\">\n {{ hover.tooltip.date }}\n </div>\n <div\n class=\"callout-row\"\n *ngFor=\"let metric of hover.tooltip.metrics\"\n >\n <span class=\"series-label\">\n <riv-legend-item [colorToken]=\"metric.color\"></riv-legend-item>\n <span>{{ metric.label }}</span>\n </span>\n <span>{{ metric.value }}</span>\n </div>\n </div>\n </riv-callout>\n </ng-container>\n </div>\n <legend>\n <ng-container *ngIf=\"firstHiddenLegendItemIndex$ | async; let fi\">\n <ng-container *ngFor=\"let item of d.data.ys; let i = index\">\n <riv-legend-item\n *ngIf=\"i < fi\"\n [label]=\"item.label\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [clickable]=\"config.allowLegendToggle\"\n [colorToken]=\"config.colors[i % config.colors.length]\"\n (itemClick)=\"toggleLegend(item.label)\"\n ></riv-legend-item>\n </ng-container>\n <div\n #moreTextContainer\n class=\"more-text-container\"\n (mouseover)=\"mouseoverLegend()\"\n (mouseleave)=\"mouseleaveLegend()\"\n (click)=\"moreClick()\"\n *ngIf=\"fi < d.data.ys.length\"\n >\n <span rivLink class=\"more-text\">\n +\n {{ d.data.ys.length - fi }} more\n </span>\n </div>\n <ng-container *ngIf=\"showMoreTooltip || lockShowMoreTooltip\">\n <riv-callout\n *riv-overlay\n [anchor]=\"moreTextContainer?.nativeElement\"\n [isModal]=\"lockShowMoreTooltip\"\n (close)=\"lockShowMoreTooltip = false\"\n [preferredPosition]=\"'bottom-right'\"\n [theme]=\"'light'\"\n [showCaret]=\"false\"\n >\n <div class=\"legend-tooltip\">\n <ng-container *ngFor=\"let item of d.data.ys; let i = index\">\n <riv-legend-item\n *ngIf=\"i >= fi\"\n [label]=\"item.label\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [clickable]=\"config.allowLegendToggle\"\n [colorToken]=\"config.colors[i % config.colors.length]\"\n (itemClick)=\"toggleLegend(item.label)\"\n ></riv-legend-item>\n </ng-container>\n </div>\n </riv-callout>\n </ng-container>\n </ng-container>\n </legend>\n </ng-container>\n</div>\n\n<ng-template #zeroState>\n <riv-zero-state [message]=\"config.zeroStateMessage\"></riv-zero-state>\n</ng-template>\n", styles: [".container{-webkit-user-select:none;user-select:none;position:relative;display:flex;flex-direction:column;gap:var(--size-small)}.tick-line{stroke:var(--gray-20)}.tick-label{font-size:var(--type-1-font-size);line-height:var(--type-1-line-height-0);fill:var(--type-light-low-contrast)}.marker{fill:var(--surface-light-0)}.callout-content{pointer-events:none;padding:var(--size-medium) var(--size-xlarge);display:flex;flex-direction:column}.callout-row{white-space:nowrap;display:flex;padding:var(--size-medium) 0;gap:var(--size-medium);align-items:center;font-size:var(--type-1-font-size);line-height:var(--type-1-line-height-0)}.callout-row:not(:last-child){border-bottom:var(--border-width) solid var(--border-light)}.series-label{flex-grow:1;font-weight:var(--font-weight-heavy);display:flex;align-items:center;gap:var(--size-small)}legend{display:flex;flex-wrap:wrap;gap:var(--size-large);justify-content:flex-start;align-items:baseline;width:100%}.more-text-container{width:calc(var(--base-grid-size) * 15);height:var(--size-large)}.more-text{font-size:var(--type-1-font-size);top:calc(var(--base-grid-size) * -1);position:relative}.legend-tooltip{padding:var(--size-medium) var(--size-xlarge);display:flex;flex-direction:column;overflow-y:scroll;max-height:clamp(0px,60vh,600px)}.legend-tooltip>riv-legend-item{white-space:nowrap;display:flex;padding:var(--size-medium) 0;gap:var(--size-medium);align-items:center;line-height:var(--type-1-line-height-0)}.sub-container{display:grid;grid-template-rows:1fr;grid-template-columns:1fr;justify-items:center;align-items:center}svg{grid-row:1 / 1;grid-column:1 / 1}.donut-display{grid-row:1 / 1;grid-column:1 / 1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--size-small)}.donut-label{font-size:var(--type-1-font-size);line-height:var(--type-1-line-height-0);color:var(--type-light-low-contrast)}.donut-value,.donut-label{text-shadow:0 0 var(--size-small) var(--surface-light-0),0 0 var(--size-xsmall) var(--surface-light-0)}.donut-value.xsmall{font:var(--stat-xsmall)}.donut-value.small{font:var(--stat-small)}.donut-value.medium{font:var(--stat-medium)}.donut-value.large{font:var(--stat-large)}\n"] }]
|
|
8507
|
+
args: [{ selector: 'riv-chart', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"container\"\n (rivClientSize)=\"width = $event.width\"\n *ngIf=\"(empty$ | async) === false; else zeroState\"\n>\n <ng-container *ngIf=\"drawData$ | async; let d\">\n <div\n (mousemove)=\"mousemove($event, d.hover)\"\n (mouseleave)=\"mouseleave($event)\"\n (click)=\"click()\"\n #container\n class=\"sub-container\"\n >\n <svg:svg\n xmlns=\"http://www.w3.org/2000/svg\"\n [attr.viewBox]=\"d.viewBox\"\n width=\"100%\"\n [attr.height]=\"height\"\n >\n <ng-container *ngIf=\"!(config.type === 'horizontal-bar')\">\n <g *ngFor=\"let tick of d.xTicks\" text-anchor=\"middle\">\n <line\n class=\"tick-line\"\n [attr.x1]=\"tick.x\"\n [attr.x2]=\"tick.x\"\n y1=\"0\"\n [attr.y2]=\"height - 16\"\n ></line>\n <text class=\"tick-label\" [attr.x]=\"tick.x\" [attr.y]=\"height - 4\">\n {{ tick.label }}\n </text>\n </g>\n </ng-container>\n <ng-container *ngIf=\"config.type === 'horizontal-bar'\">\n <g *ngFor=\"let tick of d.xTicks\" text-anchor=\"left\">\n <text class=\"tick-label\" [attr.x]=\"tick.x\" [attr.y]=\"12\">\n {{ tick.label }}\n </text>\n <line\n class=\"tick-line\"\n [attr.x1]=\"tick.x\"\n [attr.x2]=\"tick.x\"\n y1=\"0\"\n [attr.y2]=\"height - 16\"\n ></line>\n </g>\n </ng-container>\n <g *ngFor=\"let tick of d.yTicks\">\n <line\n *ngIf=\"!(config.type === 'horizontal-bar')\"\n class=\"tick-line\"\n [attr.y1]=\"tick.y\"\n [attr.y2]=\"tick.y\"\n x1=\"0\"\n [attr.x2]=\"width\"\n ></line>\n <text\n rivSVGTextTruncate\n [text]=\"tick.label\"\n [width]=\"leftLabelMaxSize\"\n class=\"tick-label\"\n [attr.y]=\"tick.y - 4\"\n [attr.x]=\"0\"\n >\n {{ tick.label }}\n </text>\n </g>\n <g *ngIf=\"!!hover && !(config.type === 'horizontal-bar')\">\n <line\n class=\"tick-line\"\n [attr.x1]=\"hover.x\"\n [attr.x2]=\"hover.x\"\n y1=\"0\"\n [attr.y2]=\"height - 16\"\n stroke-width=\"2\"\n stroke-dasharray=\"4\"\n />\n </g>\n <g *ngFor=\"let bar of d.bars; let i = index\">\n <rect\n *ngFor=\"let rect of bar\"\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n [attr.fill]=\"varColor(d.colors, i)\"\n ></rect>\n </g>\n <g *ngFor=\"let bar of d.horizontalBars; let i = index\">\n <path\n *ngFor=\"let indBar of bar\"\n [attr.d]=\"indBar\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n [attr.fill]=\"varColor(d.colors, i)\"\n stroke-width=\"2\"\n />\n </g>\n <g *ngFor=\"let line of d.lines; let i = index\">\n <path\n [attr.d]=\"line\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n fill=\"none\"\n stroke-width=\"2\"\n ></path>\n </g>\n <g *ngFor=\"let lineSinglePointFallback of d.circles; let i = index\">\n <circle\n class=\"marker\"\n [attr.cx]=\"lineSinglePointFallback.cx\"\n [attr.cy]=\"lineSinglePointFallback.cy\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </g>\n <g *ngFor=\"let line of d.lines; let i = index\">\n <circle\n class=\"marker\"\n *ngIf=\"\n !!hover && (config.groupedTooltip || i === hover.visibleYIndex)\n \"\n [attr.cx]=\"hover.x\"\n [attr.cy]=\"hover.ys[i]\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </g>\n <g *ngFor=\"let area of d.areas; let i = index\">\n <path [attr.d]=\"area\" [attr.fill]=\"varColor(d.colors, i)\"></path>\n </g>\n <g *ngFor=\"let area of d.areas; let i = index\">\n <circle\n class=\"marker\"\n *ngIf=\"\n !!hover && (config.groupedTooltip || i === hover.visibleYIndex)\n \"\n [attr.cx]=\"hover.x\"\n [attr.cy]=\"hover.ys[i]\"\n r=\"3.5\"\n stroke-width=\"2\"\n [attr.stroke]=\"varColor(d.colors, i)\"\n ></circle>\n </g>\n <path\n *ngFor=\"let path of d.arcs; let i = index\"\n [attr.d]=\"path\"\n [attr.fill]=\"varColor(d.colors, i)\"\n ></path>\n </svg:svg>\n <div *ngIf=\"config.type === 'donut'\" class=\"donut-display\">\n <div class=\"donut-value\" [ngClass]=\"config.donutDisplayInfo.size\">\n {{ config.donutDisplayInfo.displayValue }}\n </div>\n <div class=\"donut-label\">\n {{ config.donutDisplayInfo.displayLabel }}\n </div>\n </div>\n <ng-container *ngIf=\"!!hover && hover.tooltip\">\n <riv-callout\n *riv-overlay\n [anchor]=\"hover.tooltip.anchor\"\n [isModal]=\"false\"\n [preferredPosition]=\"'center-right'\"\n [theme]=\"'light'\"\n >\n <div class=\"callout-content\">\n <div *ngIf=\"hover.tooltip.date\" class=\"callout-row\">\n {{ hover.tooltip.date }}\n </div>\n <div\n class=\"callout-row\"\n *ngFor=\"let metric of hover.tooltip.metrics\"\n >\n <span class=\"series-label\">\n <riv-legend-item [colorToken]=\"metric.color\"></riv-legend-item>\n <span>{{ metric.label }}</span>\n </span>\n <span>{{ metric.value }}</span>\n </div>\n </div>\n </riv-callout>\n </ng-container>\n </div>\n <legend>\n <ng-container *ngIf=\"firstHiddenLegendItemIndex$ | async; let fi\">\n <ng-container *ngFor=\"let item of d.data.ys; let i = index\">\n <riv-legend-item\n *ngIf=\"i < fi\"\n [label]=\"item.label\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [clickable]=\"config.allowLegendToggle\"\n [colorToken]=\"config.colors[i % config.colors.length]\"\n (itemClick)=\"toggleLegend(item.label)\"\n ></riv-legend-item>\n </ng-container>\n <div\n #moreTextContainer\n class=\"more-text-container\"\n (mouseover)=\"mouseoverLegend()\"\n (mouseleave)=\"mouseleaveLegend()\"\n (click)=\"moreClick()\"\n *ngIf=\"fi < d.data.ys.length\"\n >\n <span rivLink class=\"more-text\">\n +\n {{ d.data.ys.length - fi }} more\n </span>\n </div>\n <ng-container *ngIf=\"showMoreTooltip || lockShowMoreTooltip\">\n <riv-callout\n *riv-overlay\n [anchor]=\"moreTextContainer?.nativeElement\"\n [isModal]=\"lockShowMoreTooltip\"\n (close)=\"lockShowMoreTooltip = false\"\n [preferredPosition]=\"'bottom-right'\"\n [theme]=\"'light'\"\n [showCaret]=\"false\"\n >\n <div class=\"legend-tooltip\">\n <ng-container *ngFor=\"let item of d.data.ys; let i = index\">\n <riv-legend-item\n *ngIf=\"i >= fi\"\n [label]=\"item.label\"\n [visibility]=\"item.hidden ? 'hidden' : 'visible'\"\n [clickable]=\"config.allowLegendToggle\"\n [colorToken]=\"config.colors[i % config.colors.length]\"\n (itemClick)=\"toggleLegend(item.label)\"\n ></riv-legend-item>\n </ng-container>\n </div>\n </riv-callout>\n </ng-container>\n </ng-container>\n </legend>\n </ng-container>\n</div>\n\n<ng-template #zeroState>\n <riv-zero-state [message]=\"config.zeroStateMessage\"></riv-zero-state>\n</ng-template>\n", styles: [".container{-webkit-user-select:none;user-select:none;position:relative;display:flex;flex-direction:column;gap:var(--size-small)}.tick-line{stroke:var(--gray-20)}.tick-label{font-size:var(--type-1-font-size);line-height:var(--type-1-line-height-0);fill:var(--type-light-low-contrast)}.marker{fill:var(--surface-light-0)}.callout-content{pointer-events:none;padding:var(--size-medium) var(--size-xlarge);display:flex;flex-direction:column}.callout-row{white-space:nowrap;display:flex;padding:var(--size-medium) 0;gap:var(--size-medium);align-items:center;font-size:var(--type-1-font-size);line-height:var(--type-1-line-height-0)}.callout-row:not(:last-child){border-bottom:var(--border-width) solid var(--border-light)}.series-label{flex-grow:1;font-weight:var(--font-weight-heavy);display:flex;align-items:center;gap:var(--size-small)}legend{display:flex;flex-wrap:wrap;gap:var(--size-large);justify-content:flex-start;align-items:baseline;width:100%}.more-text-container{width:calc(var(--base-grid-size) * 15);height:var(--size-large)}.more-text{font-size:var(--type-1-font-size);top:calc(var(--base-grid-size) * -1);position:relative}.legend-tooltip{padding:var(--size-medium) var(--size-xlarge);display:flex;flex-direction:column;overflow-y:scroll;max-height:clamp(0px,60vh,600px)}.legend-tooltip>riv-legend-item{white-space:nowrap;display:flex;padding:var(--size-medium) 0;gap:var(--size-medium);align-items:center;line-height:var(--type-1-line-height-0)}.sub-container{display:grid;grid-template-rows:1fr;grid-template-columns:1fr;justify-items:center;align-items:center}svg{grid-row:1 / 1;grid-column:1 / 1}.donut-display{grid-row:1 / 1;grid-column:1 / 1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--size-small)}.donut-label{font-size:var(--type-1-font-size);line-height:var(--type-1-line-height-0);color:var(--type-light-low-contrast)}.donut-value,.donut-label{text-shadow:0 0 var(--size-small) var(--surface-light-0),0 0 var(--size-xsmall) var(--surface-light-0)}.donut-value.xsmall{font:var(--stat-xsmall)}.donut-value.small{font:var(--stat-small)}.donut-value.medium{font:var(--stat-medium)}.donut-value.large{font:var(--stat-large)}\n"] }]
|
|
8180
8508
|
}], propDecorators: { container: [{
|
|
8181
8509
|
type: ViewChild,
|
|
8182
8510
|
args: ['container']
|