@elementar-rt/components 0.6.55
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/README.md +49 -0
- package/action-required/index.d.ts +13 -0
- package/alert/index.d.ts +51 -0
- package/announcement/index.d.ts +45 -0
- package/avatar/index.d.ts +67 -0
- package/block-loader/index.d.ts +21 -0
- package/block-state/index.d.ts +33 -0
- package/brand-colors/index.d.ts +27 -0
- package/breadcrumbs/index.d.ts +104 -0
- package/card-overlay/index.d.ts +20 -0
- package/carousel/index.d.ts +75 -0
- package/code-highlighter/index.d.ts +18 -0
- package/color-picker/index.d.ts +92 -0
- package/color-scheme/index.d.ts +44 -0
- package/command-bar/index.d.ts +28 -0
- package/comment-editor/index.d.ts +194 -0
- package/comparison-slider/index.d.ts +51 -0
- package/confirm/index.d.ts +35 -0
- package/content-fade/index.d.ts +17 -0
- package/cookie-popup/index.d.ts +41 -0
- package/core/index.d.ts +252 -0
- package/country-select/index.d.ts +76 -0
- package/crop/index.d.ts +59 -0
- package/currency-select/index.d.ts +78 -0
- package/dashboard/index.d.ts +48 -0
- package/data-view/index.d.ts +127 -0
- package/date-format-select/index.d.ts +56 -0
- package/divider/index.d.ts +13 -0
- package/drawer/index.d.ts +35 -0
- package/emoji-picker/index.d.ts +49 -0
- package/expand/index.d.ts +26 -0
- package/fesm2022/elementar-rt-components-action-required.mjs +30 -0
- package/fesm2022/elementar-rt-components-action-required.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-alert.mjs +139 -0
- package/fesm2022/elementar-rt-components-alert.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-announcement.mjs +73 -0
- package/fesm2022/elementar-rt-components-announcement.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-avatar.mjs +234 -0
- package/fesm2022/elementar-rt-components-avatar.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-block-loader.mjs +54 -0
- package/fesm2022/elementar-rt-components-block-loader.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-block-state.mjs +75 -0
- package/fesm2022/elementar-rt-components-block-state.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-brand-colors.mjs +78 -0
- package/fesm2022/elementar-rt-components-brand-colors.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-breadcrumbs.mjs +213 -0
- package/fesm2022/elementar-rt-components-breadcrumbs.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-card-overlay.mjs +55 -0
- package/fesm2022/elementar-rt-components-card-overlay.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-carousel.mjs +605 -0
- package/fesm2022/elementar-rt-components-carousel.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-code-highlighter.mjs +57 -0
- package/fesm2022/elementar-rt-components-code-highlighter.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-color-picker.mjs +708 -0
- package/fesm2022/elementar-rt-components-color-picker.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-color-scheme.mjs +106 -0
- package/fesm2022/elementar-rt-components-color-scheme.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-command-bar.mjs +59 -0
- package/fesm2022/elementar-rt-components-command-bar.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-comment-editor.mjs +1039 -0
- package/fesm2022/elementar-rt-components-comment-editor.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-comparison-slider.mjs +193 -0
- package/fesm2022/elementar-rt-components-comparison-slider.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-confirm.mjs +86 -0
- package/fesm2022/elementar-rt-components-confirm.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-content-fade.mjs +35 -0
- package/fesm2022/elementar-rt-components-content-fade.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-cookie-popup.mjs +109 -0
- package/fesm2022/elementar-rt-components-cookie-popup.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-core.mjs +837 -0
- package/fesm2022/elementar-rt-components-core.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-country-select.mjs +477 -0
- package/fesm2022/elementar-rt-components-country-select.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-crop.mjs +183 -0
- package/fesm2022/elementar-rt-components-crop.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-currency-select.mjs +384 -0
- package/fesm2022/elementar-rt-components-currency-select.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-dashboard.mjs +96 -0
- package/fesm2022/elementar-rt-components-dashboard.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-data-view.mjs +302 -0
- package/fesm2022/elementar-rt-components-data-view.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-date-format-select.mjs +136 -0
- package/fesm2022/elementar-rt-components-date-format-select.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-divider.mjs +31 -0
- package/fesm2022/elementar-rt-components-divider.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-drawer.mjs +131 -0
- package/fesm2022/elementar-rt-components-drawer.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-emoji-picker.mjs +249 -0
- package/fesm2022/elementar-rt-components-emoji-picker.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-expand.mjs +60 -0
- package/fesm2022/elementar-rt-components-expand.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-filter-builder.mjs +333 -0
- package/fesm2022/elementar-rt-components-filter-builder.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-autocomplete-many-field.component-AqEghjO_.mjs +123 -0
- package/fesm2022/elementar-rt-components-form-renderer-autocomplete-many-field.component-AqEghjO_.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-checkbox-field.component-CUKmZGFq.mjs +22 -0
- package/fesm2022/elementar-rt-components-form-renderer-checkbox-field.component-CUKmZGFq.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-datepicker-field.component-DihIRWMt.mjs +40 -0
- package/fesm2022/elementar-rt-components-form-renderer-datepicker-field.component-DihIRWMt.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-divider-content.component-CjlGcU3B.mjs +17 -0
- package/fesm2022/elementar-rt-components-form-renderer-divider-content.component-CjlGcU3B.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-image-content.component-0pL2Fk0H.mjs +17 -0
- package/fesm2022/elementar-rt-components-form-renderer-image-content.component-0pL2Fk0H.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-input-field.component-X2sKvj6J.mjs +33 -0
- package/fesm2022/elementar-rt-components-form-renderer-input-field.component-X2sKvj6J.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-radio-group-field.component-DWXZAA3F.mjs +38 -0
- package/fesm2022/elementar-rt-components-form-renderer-radio-group-field.component-DWXZAA3F.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-select-field.component-Cx9DZoD6.mjs +39 -0
- package/fesm2022/elementar-rt-components-form-renderer-select-field.component-Cx9DZoD6.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-text-content.component-BmFyUG06.mjs +24 -0
- package/fesm2022/elementar-rt-components-form-renderer-text-content.component-BmFyUG06.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-textarea-field.component-D9KmE049.mjs +37 -0
- package/fesm2022/elementar-rt-components-form-renderer-textarea-field.component-D9KmE049.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-timezone-field.component-BroP_Q4P.mjs +35 -0
- package/fesm2022/elementar-rt-components-form-renderer-timezone-field.component-BroP_Q4P.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer-toggle-field.component-nGbtVi1_.mjs +22 -0
- package/fesm2022/elementar-rt-components-form-renderer-toggle-field.component-nGbtVi1_.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-form-renderer.mjs +321 -0
- package/fesm2022/elementar-rt-components-form-renderer.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-gauge.mjs +50 -0
- package/fesm2022/elementar-rt-components-gauge.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-icon.mjs +62 -0
- package/fesm2022/elementar-rt-components-icon.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-image-resizer.mjs +159 -0
- package/fesm2022/elementar-rt-components-image-resizer.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-image-viewer.mjs +349 -0
- package/fesm2022/elementar-rt-components-image-viewer.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-incidents.mjs +259 -0
- package/fesm2022/elementar-rt-components-incidents.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-inline-text-edit.mjs +181 -0
- package/fesm2022/elementar-rt-components-inline-text-edit.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-input-mask.mjs +180 -0
- package/fesm2022/elementar-rt-components-input-mask.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-input-validator.mjs +24 -0
- package/fesm2022/elementar-rt-components-input-validator.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-kanban-board.mjs +156 -0
- package/fesm2022/elementar-rt-components-kanban-board.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-layout.mjs +188 -0
- package/fesm2022/elementar-rt-components-layout.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-logo.mjs +43 -0
- package/fesm2022/elementar-rt-components-logo.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-marquee.mjs +79 -0
- package/fesm2022/elementar-rt-components-marquee.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-micro-chart.mjs +950 -0
- package/fesm2022/elementar-rt-components-micro-chart.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-navigation.mjs +379 -0
- package/fesm2022/elementar-rt-components-navigation.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-notifications.mjs +190 -0
- package/fesm2022/elementar-rt-components-notifications.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-number-input.mjs +288 -0
- package/fesm2022/elementar-rt-components-number-input.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-overlay-scrollbar.mjs +455 -0
- package/fesm2022/elementar-rt-components-overlay-scrollbar.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-overlay.mjs +112 -0
- package/fesm2022/elementar-rt-components-overlay.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-page-loading-bar.mjs +79 -0
- package/fesm2022/elementar-rt-components-page-loading-bar.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-panel.mjs +105 -0
- package/fesm2022/elementar-rt-components-panel.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-password-strength.mjs +474 -0
- package/fesm2022/elementar-rt-components-password-strength.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-phone-input.mjs +637 -0
- package/fesm2022/elementar-rt-components-phone-input.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-pin-input.mjs +197 -0
- package/fesm2022/elementar-rt-components-pin-input.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-popover.mjs +262 -0
- package/fesm2022/elementar-rt-components-popover.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-radio-card.mjs +102 -0
- package/fesm2022/elementar-rt-components-radio-card.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-rail-nav.mjs +84 -0
- package/fesm2022/elementar-rt-components-rail-nav.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-resizable-container.mjs +69 -0
- package/fesm2022/elementar-rt-components-resizable-container.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-screen-loader.mjs +27 -0
- package/fesm2022/elementar-rt-components-screen-loader.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-scroll-spy.mjs +165 -0
- package/fesm2022/elementar-rt-components-scroll-spy.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-segmented.mjs +153 -0
- package/fesm2022/elementar-rt-components-segmented.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-side-panel.mjs +110 -0
- package/fesm2022/elementar-rt-components-side-panel.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-sidebar.mjs +423 -0
- package/fesm2022/elementar-rt-components-sidebar.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-signature-pad.mjs +452 -0
- package/fesm2022/elementar-rt-components-signature-pad.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-skeleton.mjs +56 -0
- package/fesm2022/elementar-rt-components-skeleton.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-splash-screen.mjs +91 -0
- package/fesm2022/elementar-rt-components-splash-screen.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-stepper.mjs +194 -0
- package/fesm2022/elementar-rt-components-stepper.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-suggestions.mjs +76 -0
- package/fesm2022/elementar-rt-components-suggestions.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-tab-panel.mjs +270 -0
- package/fesm2022/elementar-rt-components-tab-panel.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-text-editor.mjs +1025 -0
- package/fesm2022/elementar-rt-components-text-editor.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-thumbnail-maker.mjs +214 -0
- package/fesm2022/elementar-rt-components-thumbnail-maker.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-timeline.mjs +122 -0
- package/fesm2022/elementar-rt-components-timeline.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-timezone-select.mjs +351 -0
- package/fesm2022/elementar-rt-components-timezone-select.mjs.map +1 -0
- package/fesm2022/elementar-rt-components-upload.mjs +340 -0
- package/fesm2022/elementar-rt-components-upload.mjs.map +1 -0
- package/fesm2022/elementar-rt-components.mjs +6 -0
- package/fesm2022/elementar-rt-components.mjs.map +1 -0
- package/filter-builder/index.d.ts +107 -0
- package/form-renderer/index.d.ts +121 -0
- package/gauge/index.d.ts +21 -0
- package/icon/index.d.ts +17 -0
- package/image-resizer/index.d.ts +35 -0
- package/image-viewer/index.d.ts +63 -0
- package/incidents/index.d.ts +119 -0
- package/index.d.ts +2 -0
- package/inline-text-edit/index.d.ts +39 -0
- package/input-mask/index.d.ts +36 -0
- package/input-validator/index.d.ts +5 -0
- package/kanban-board/index.d.ts +68 -0
- package/layout/index.d.ts +75 -0
- package/logo/index.d.ts +21 -0
- package/marquee/index.d.ts +26 -0
- package/micro-chart/index.d.ts +193 -0
- package/navigation/index.d.ts +119 -0
- package/notifications/index.d.ts +84 -0
- package/number-input/index.d.ts +93 -0
- package/overlay/index.d.ts +12 -0
- package/overlay-scrollbar/index.d.ts +66 -0
- package/package.json +356 -0
- package/page-loading-bar/index.d.ts +20 -0
- package/panel/index.d.ts +43 -0
- package/password-strength/index.d.ts +109 -0
- package/phone-input/index.d.ts +94 -0
- package/pin-input/index.d.ts +48 -0
- package/popover/index.d.ts +75 -0
- package/radio-card/index.d.ts +37 -0
- package/rail-nav/index.d.ts +36 -0
- package/resizable-container/index.d.ts +21 -0
- package/screen-loader/index.d.ts +9 -0
- package/scroll-spy/index.d.ts +48 -0
- package/segmented/index.d.ts +54 -0
- package/side-panel/index.d.ts +42 -0
- package/sidebar/index.d.ts +143 -0
- package/signature-pad/index.d.ts +49 -0
- package/skeleton/index.d.ts +24 -0
- package/splash-screen/index.d.ts +31 -0
- package/stepper/index.d.ts +65 -0
- package/styles/_common.scss +776 -0
- package/styles/themes/cyan-orange.scss +41 -0
- package/styles/themes/default.scss +5 -0
- package/styles/themes/magenta-violet.scss +41 -0
- package/styles/themes/rose-red.scss +41 -0
- package/suggestions/index.d.ts +32 -0
- package/tab-panel/index.d.ts +96 -0
- package/text-editor/index.d.ts +191 -0
- package/thumbnail-maker/index.d.ts +35 -0
- package/timeline/index.d.ts +57 -0
- package/timezone-select/index.d.ts +72 -0
- package/upload/index.d.ts +134 -0
|
@@ -0,0 +1,950 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Renderer2, ViewContainerRef, Injector, DOCUMENT, PLATFORM_ID, DestroyRef, ElementRef, input, numberAttribute, booleanAttribute, effect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { isPlatformServer } from '@angular/common';
|
|
4
|
+
import { curveStep, curveBumpX, curveCatmullRom, curveLinear, select, scalePoint, min, max, scaleLinear, area, line, pointer, scaleBand, arc, pie, scaleOrdinal, schemeTableau10, interpolate } from 'd3';
|
|
5
|
+
import { fromEvent } from 'rxjs';
|
|
6
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
7
|
+
import { TemplatePortal } from '@angular/cdk/portal';
|
|
8
|
+
import { Overlay, OverlayConfig } from '@angular/cdk/overlay';
|
|
9
|
+
import { PositionManager } from '@elementar-rt/components/overlay';
|
|
10
|
+
|
|
11
|
+
class BaseChartTooltip {
|
|
12
|
+
_tooltipOrigin;
|
|
13
|
+
_tooltipPortal;
|
|
14
|
+
_overlayRef;
|
|
15
|
+
_renderer = inject(Renderer2);
|
|
16
|
+
_overlay = inject(Overlay);
|
|
17
|
+
_viewContainerRef = inject(ViewContainerRef);
|
|
18
|
+
_injector = inject(Injector);
|
|
19
|
+
_document = inject(DOCUMENT);
|
|
20
|
+
_createTooltipOrigin() {
|
|
21
|
+
let tooltipOrigin = this._document.querySelector('.emr-mchart-tooltip-origin');
|
|
22
|
+
if (!tooltipOrigin) {
|
|
23
|
+
tooltipOrigin = this._renderer.createElement('div');
|
|
24
|
+
tooltipOrigin.classList.add('emr-mchart-tooltip-origin');
|
|
25
|
+
this._renderer.appendChild(this._document.body, tooltipOrigin);
|
|
26
|
+
}
|
|
27
|
+
this._tooltipOrigin = tooltipOrigin;
|
|
28
|
+
this._renderer.setStyle(this._tooltipOrigin, 'width', '10px');
|
|
29
|
+
this._renderer.setStyle(this._tooltipOrigin, 'height', '10px');
|
|
30
|
+
this._renderer.setStyle(this._tooltipOrigin, 'z-index', '-1');
|
|
31
|
+
this._renderer.setStyle(this._tooltipOrigin, 'position', 'fixed');
|
|
32
|
+
this._renderer.setStyle(this._tooltipOrigin, 'opacity', '0');
|
|
33
|
+
}
|
|
34
|
+
_showTooltip(data) {
|
|
35
|
+
this._overlayRef?.detach();
|
|
36
|
+
this._overlayRef = this._overlay.create(this._getOverlayConfig());
|
|
37
|
+
this._overlayRef.attach(this._getContentPortal(data));
|
|
38
|
+
}
|
|
39
|
+
_hideTooltip() {
|
|
40
|
+
this._overlayRef?.detach();
|
|
41
|
+
}
|
|
42
|
+
_setTooltipPositionByEvent(e) {
|
|
43
|
+
this._renderer.setStyle(this._tooltipOrigin, 'left', (e.clientX + 10) + 'px');
|
|
44
|
+
this._renderer.setStyle(this._tooltipOrigin, 'top', (e.clientY - 4) + 'px');
|
|
45
|
+
}
|
|
46
|
+
_setTooltipVisible() {
|
|
47
|
+
this._renderer.addClass(this._tooltipOrigin, 'is-visible');
|
|
48
|
+
}
|
|
49
|
+
_setTooltipInVisible() {
|
|
50
|
+
this._renderer.removeClass(this._tooltipOrigin, 'is-visible');
|
|
51
|
+
}
|
|
52
|
+
_getContentPortal(data) {
|
|
53
|
+
this._tooltipPortal = new TemplatePortal(this.getTooltipTemplateRef(), this._viewContainerRef, {
|
|
54
|
+
'$implicit': {
|
|
55
|
+
...data
|
|
56
|
+
}
|
|
57
|
+
}, this._injector);
|
|
58
|
+
return this._tooltipPortal;
|
|
59
|
+
}
|
|
60
|
+
_getOverlayConfig() {
|
|
61
|
+
return new OverlayConfig({
|
|
62
|
+
panelClass: 'emr-mchart-tooltip-overlay',
|
|
63
|
+
positionStrategy: this._getOverlayPositionStrategy(),
|
|
64
|
+
scrollStrategy: this._overlay.scrollStrategies.reposition()
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
_getOverlayPositionStrategy() {
|
|
68
|
+
return this._overlay
|
|
69
|
+
.position()
|
|
70
|
+
.flexibleConnectedTo(this._tooltipOrigin)
|
|
71
|
+
.withFlexibleDimensions()
|
|
72
|
+
.withGrowAfterOpen()
|
|
73
|
+
.withPositions(this._getOverlayPositions());
|
|
74
|
+
}
|
|
75
|
+
_getOverlayPositions() {
|
|
76
|
+
return (new PositionManager()).build(this.getTooltipPosition());
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
let nextId$1 = 0;
|
|
81
|
+
class MchartLineComponent extends BaseChartTooltip {
|
|
82
|
+
_initialized = false;
|
|
83
|
+
_host;
|
|
84
|
+
_svg;
|
|
85
|
+
_dimensions;
|
|
86
|
+
_hostWidth = 0;
|
|
87
|
+
_hostHeight = 0;
|
|
88
|
+
_innerWidth = 0;
|
|
89
|
+
_innerHeight = 0;
|
|
90
|
+
_yScale;
|
|
91
|
+
_xScale;
|
|
92
|
+
_curveMap = {
|
|
93
|
+
'linear': curveLinear,
|
|
94
|
+
'catmullRom': curveCatmullRom,
|
|
95
|
+
'curveBumpX': curveBumpX,
|
|
96
|
+
'curveStep': curveStep
|
|
97
|
+
};
|
|
98
|
+
_resizeObserver;
|
|
99
|
+
_tooltipDot;
|
|
100
|
+
_area;
|
|
101
|
+
_line;
|
|
102
|
+
_platformId = inject(PLATFORM_ID);
|
|
103
|
+
_destroyRef = inject(DestroyRef);
|
|
104
|
+
_elementRef = inject(ElementRef);
|
|
105
|
+
data = input([], ...(ngDevMode ? [{ debugName: "data" }] : []));
|
|
106
|
+
labels = input([], ...(ngDevMode ? [{ debugName: "labels" }] : []));
|
|
107
|
+
strokeWidth = input(2, ...(ngDevMode ? [{ debugName: "strokeWidth", transform: numberAttribute }] : [{
|
|
108
|
+
transform: numberAttribute
|
|
109
|
+
}]));
|
|
110
|
+
showArea = input(false, ...(ngDevMode ? [{ debugName: "showArea", transform: booleanAttribute }] : [{
|
|
111
|
+
transform: booleanAttribute
|
|
112
|
+
}]));
|
|
113
|
+
showMarkers = input(false, ...(ngDevMode ? [{ debugName: "showMarkers", transform: booleanAttribute }] : [{
|
|
114
|
+
transform: booleanAttribute
|
|
115
|
+
}]));
|
|
116
|
+
responsive = input(false, ...(ngDevMode ? [{ debugName: "responsive", transform: booleanAttribute }] : [{
|
|
117
|
+
transform: booleanAttribute
|
|
118
|
+
}]));
|
|
119
|
+
fillAreaGradient = input(false, ...(ngDevMode ? [{ debugName: "fillAreaGradient", transform: booleanAttribute }] : [{
|
|
120
|
+
transform: booleanAttribute
|
|
121
|
+
}]));
|
|
122
|
+
curve = input('linear', ...(ngDevMode ? [{ debugName: "curve" }] : []));
|
|
123
|
+
xAccessor = input((d, i) => i, ...(ngDevMode ? [{ debugName: "xAccessor" }] : []));
|
|
124
|
+
yAccessor = input((d) => d, ...(ngDevMode ? [{ debugName: "yAccessor" }] : []));
|
|
125
|
+
compact = input(false, ...(ngDevMode ? [{ debugName: "compact", transform: booleanAttribute }] : [{
|
|
126
|
+
transform: booleanAttribute
|
|
127
|
+
}]));
|
|
128
|
+
markerDotSize = input(5, ...(ngDevMode ? [{ debugName: "markerDotSize", transform: numberAttribute }] : [{
|
|
129
|
+
transform: numberAttribute
|
|
130
|
+
}]));
|
|
131
|
+
tooltip = input(...(ngDevMode ? [undefined, { debugName: "tooltip" }] : []));
|
|
132
|
+
tooltipPosition = input('after-center', ...(ngDevMode ? [{ debugName: "tooltipPosition" }] : []));
|
|
133
|
+
get gradientId() {
|
|
134
|
+
return 'areaGradient' + this._gradientId;
|
|
135
|
+
}
|
|
136
|
+
_gradientId = nextId$1++;
|
|
137
|
+
constructor() {
|
|
138
|
+
super();
|
|
139
|
+
effect(() => {
|
|
140
|
+
if (!this._initialized) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
this._render();
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
ngAfterViewChecked() {
|
|
147
|
+
if (isPlatformServer(this._platformId)) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (!this._initialized) {
|
|
151
|
+
const element = this._elementRef.nativeElement;
|
|
152
|
+
this._dimensions = element.getBoundingClientRect();
|
|
153
|
+
if (this._dimensions.width !== 0 && this._dimensions.height !== 0) {
|
|
154
|
+
this._initialized = true;
|
|
155
|
+
this._render();
|
|
156
|
+
this._setupResizeObserver();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
ngOnDestroy() {
|
|
161
|
+
this._resizeObserver?.disconnect();
|
|
162
|
+
}
|
|
163
|
+
getTooltipPosition() {
|
|
164
|
+
return this.tooltipPosition();
|
|
165
|
+
}
|
|
166
|
+
getTooltipTemplateRef() {
|
|
167
|
+
return this.tooltip();
|
|
168
|
+
}
|
|
169
|
+
_render() {
|
|
170
|
+
this._setupContainers();
|
|
171
|
+
this._setupData();
|
|
172
|
+
}
|
|
173
|
+
_setupContainers() {
|
|
174
|
+
this._hostWidth = this._dimensions.width;
|
|
175
|
+
this._hostHeight = this._dimensions.height;
|
|
176
|
+
this._innerWidth = this._dimensions.width;
|
|
177
|
+
this._innerHeight = this._dimensions.height;
|
|
178
|
+
this._host = select(this._elementRef.nativeElement);
|
|
179
|
+
this._svg = this._host
|
|
180
|
+
.select('svg')
|
|
181
|
+
.attr('viewBox', `0 0 ${this._hostWidth} ${this._hostHeight}`);
|
|
182
|
+
if (this.tooltip()) {
|
|
183
|
+
this._tooltipDot = this._renderer.createElement('div');
|
|
184
|
+
this._renderer.setStyle(this._tooltipDot, 'width', '10px');
|
|
185
|
+
this._renderer.setStyle(this._tooltipDot, 'height', '10px');
|
|
186
|
+
this._renderer.setStyle(this._tooltipDot, 'z-index', '-1');
|
|
187
|
+
this._renderer.setStyle(this._tooltipDot, 'position', 'fixed');
|
|
188
|
+
this._renderer.setStyle(this._tooltipDot, 'opacity', '0');
|
|
189
|
+
this._renderer.appendChild(this._document.body, this._tooltipDot);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
_setupData(isUpdate = false) {
|
|
193
|
+
let markerDotSize = this.markerDotSize();
|
|
194
|
+
if (!this.showMarkers()) {
|
|
195
|
+
markerDotSize = this.strokeWidth();
|
|
196
|
+
}
|
|
197
|
+
const xAccessor = this.xAccessor();
|
|
198
|
+
const yAccessor = this.yAccessor();
|
|
199
|
+
const xDomain = this.data().map((d, i) => xAccessor(d, i));
|
|
200
|
+
if (!this._xScale) {
|
|
201
|
+
this._xScale = scalePoint().domain(xDomain);
|
|
202
|
+
}
|
|
203
|
+
this._xScale.range([markerDotSize, this._innerWidth - markerDotSize]);
|
|
204
|
+
const yDomain = [
|
|
205
|
+
this.compact() ? min(this.data().map(d => yAccessor(d))) : 0,
|
|
206
|
+
max(this.data().map(d => yAccessor(d)))
|
|
207
|
+
];
|
|
208
|
+
if (!this._yScale) {
|
|
209
|
+
this._yScale = scaleLinear()
|
|
210
|
+
.domain(yDomain);
|
|
211
|
+
}
|
|
212
|
+
this._yScale.range([this._innerHeight - markerDotSize, markerDotSize]);
|
|
213
|
+
if (this.showArea()) {
|
|
214
|
+
const areaGenerator = area()
|
|
215
|
+
.x((d, i) => this._xScale(xAccessor(d, i)))
|
|
216
|
+
.y1((d) => this._yScale(yAccessor(d)))
|
|
217
|
+
.y0(this._innerHeight - markerDotSize)
|
|
218
|
+
.curve(this._curveMap[this.curve()]);
|
|
219
|
+
if (!this._area) {
|
|
220
|
+
// add area
|
|
221
|
+
this._area = this._svg
|
|
222
|
+
.append('path')
|
|
223
|
+
.datum(this.data())
|
|
224
|
+
.attr('d', areaGenerator)
|
|
225
|
+
.attr('class', 'area');
|
|
226
|
+
if (this.fillAreaGradient()) {
|
|
227
|
+
this._area.attr('fill', `url(#${this.gradientId})`);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
this._area.attr('d', areaGenerator);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
const lineGenerator = line()
|
|
235
|
+
.x((d, i) => this._xScale(xAccessor(d, i)))
|
|
236
|
+
.y((d) => this._yScale(yAccessor(d)));
|
|
237
|
+
if (!this._line) {
|
|
238
|
+
// add line
|
|
239
|
+
this._line = this._svg
|
|
240
|
+
.append('path')
|
|
241
|
+
.datum(this.data())
|
|
242
|
+
.attr('d', lineGenerator.curve(this._curveMap[this.curve()]))
|
|
243
|
+
.attr('class', 'line')
|
|
244
|
+
.attr('stroke-width', this.strokeWidth());
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
this._line.attr('d', lineGenerator.curve(this._curveMap[this.curve()]));
|
|
248
|
+
}
|
|
249
|
+
if (isUpdate) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
if (this.showMarkers() || this.tooltip()) {
|
|
253
|
+
const markerLine = this._svg
|
|
254
|
+
.append('line')
|
|
255
|
+
.attr('x1', 0)
|
|
256
|
+
.attr('x2', 0)
|
|
257
|
+
.attr('y1', 0)
|
|
258
|
+
.attr('y2', this._innerHeight - markerDotSize)
|
|
259
|
+
.attr('opacity', 0)
|
|
260
|
+
.attr('class', 'marker-line');
|
|
261
|
+
const markerDot = this._svg
|
|
262
|
+
.append('circle')
|
|
263
|
+
.attr('cx', 0)
|
|
264
|
+
.attr('cy', 0)
|
|
265
|
+
.attr('r', markerDotSize)
|
|
266
|
+
.attr('opacity', 0)
|
|
267
|
+
.attr('class', 'marker-dot');
|
|
268
|
+
let x = 0;
|
|
269
|
+
let y = 0;
|
|
270
|
+
let label;
|
|
271
|
+
let value;
|
|
272
|
+
if (this.tooltip()) {
|
|
273
|
+
this._createTooltipOrigin();
|
|
274
|
+
}
|
|
275
|
+
fromEvent(this._document, 'mousemove')
|
|
276
|
+
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
277
|
+
.subscribe((e) => {
|
|
278
|
+
const target = e.target;
|
|
279
|
+
const oldXPosition = +markerDot.attr('cx');
|
|
280
|
+
const pointerCoords = pointer(e, this._svg.node());
|
|
281
|
+
const [posX, posY] = pointerCoords;
|
|
282
|
+
let visible = true;
|
|
283
|
+
if (posX < this.markerDotSize() || posY < this.markerDotSize() || posX > this._hostWidth || posY > this._hostHeight) {
|
|
284
|
+
visible = false;
|
|
285
|
+
this._overlayRef?.detach();
|
|
286
|
+
markerLine.attr('opacity', 0);
|
|
287
|
+
markerDot.attr('opacity', 0);
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
if (target.closest('.emr-mchart-line') ||
|
|
291
|
+
target.classList.contains('emr-mchart-tooltip-overlay') ||
|
|
292
|
+
target.closest('.emr-mchart-tooltip-overlay')) {
|
|
293
|
+
if (this.showMarkers()) {
|
|
294
|
+
markerLine.attr('opacity', 1);
|
|
295
|
+
markerDot.attr('opacity', 1);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
visible = false;
|
|
300
|
+
this._overlayRef?.detach();
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
const eachBand = this._xScale.step();
|
|
304
|
+
const index = Math.round((posX / eachBand));
|
|
305
|
+
const dataValue = this.data()[index];
|
|
306
|
+
label = this.labels()[index] ? this.labels()[index] : xAccessor(index, index);
|
|
307
|
+
value = yAccessor(dataValue);
|
|
308
|
+
x = this._xScale(xAccessor(index, index));
|
|
309
|
+
y = this._yScale(yAccessor(dataValue));
|
|
310
|
+
markerLine
|
|
311
|
+
.attr('x1', x)
|
|
312
|
+
.attr('x2', x);
|
|
313
|
+
markerDot
|
|
314
|
+
.attr('cx', x)
|
|
315
|
+
.attr('cy', y);
|
|
316
|
+
if (this.tooltip()) {
|
|
317
|
+
this._setTooltipPositionByEvent(e);
|
|
318
|
+
if (visible) {
|
|
319
|
+
this._setTooltipVisible();
|
|
320
|
+
if (!this._overlayRef?.hasAttached()) {
|
|
321
|
+
this._showTooltip({
|
|
322
|
+
label,
|
|
323
|
+
value
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
if (oldXPosition !== x) {
|
|
328
|
+
this._showTooltip({
|
|
329
|
+
label,
|
|
330
|
+
value
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
this._overlayRef.updatePosition();
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
else {
|
|
339
|
+
this._setTooltipInVisible();
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
_setupResizeObserver() {
|
|
346
|
+
if (!this.responsive()) {
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
this._resizeObserver = new ResizeObserver((entries) => {
|
|
350
|
+
if (this._hostWidth !== entries[0].contentRect.width || this._hostHeight !== entries[0].contentRect.height) {
|
|
351
|
+
this._hostWidth = entries[0].contentRect.width;
|
|
352
|
+
this._hostHeight = entries[0].contentRect.height;
|
|
353
|
+
this._innerWidth = entries[0].contentRect.width;
|
|
354
|
+
this._innerHeight = entries[0].contentRect.height;
|
|
355
|
+
this._svg
|
|
356
|
+
.attr("viewBox", `0 0 ${this._hostWidth} ${this._hostHeight}`);
|
|
357
|
+
this._setupData(true);
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
this._resizeObserver.observe(this._elementRef.nativeElement);
|
|
361
|
+
}
|
|
362
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: MchartLineComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
363
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: MchartLineComponent, isStandalone: true, selector: "emr-mchart-line", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, strokeWidth: { classPropertyName: "strokeWidth", publicName: "strokeWidth", isSignal: true, isRequired: false, transformFunction: null }, showArea: { classPropertyName: "showArea", publicName: "showArea", isSignal: true, isRequired: false, transformFunction: null }, showMarkers: { classPropertyName: "showMarkers", publicName: "showMarkers", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null }, fillAreaGradient: { classPropertyName: "fillAreaGradient", publicName: "fillAreaGradient", isSignal: true, isRequired: false, transformFunction: null }, curve: { classPropertyName: "curve", publicName: "curve", isSignal: true, isRequired: false, transformFunction: null }, xAccessor: { classPropertyName: "xAccessor", publicName: "xAccessor", isSignal: true, isRequired: false, transformFunction: null }, yAccessor: { classPropertyName: "yAccessor", publicName: "yAccessor", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, markerDotSize: { classPropertyName: "markerDotSize", publicName: "markerDotSize", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.fill-area-gradient": "fillAreaGradient()" }, classAttribute: "emr-mchart-line" }, exportAs: ["emrMchartLine"], usesInheritance: true, ngImport: i0, template: "<svg>\r\n @if (fillAreaGradient()) {\r\n <linearGradient [id]=\"gradientId\" x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\r\n <stop offset=\"0%\" class=\"lg-start-color\"/>\r\n <stop offset=\"100%\" class=\"lg-end-color\"/>\r\n </linearGradient>\r\n }\r\n</svg>\r\n", styles: [":host{--emr-mchart-line-line-bg: var(--color-primary);--emr-mchart-line-area-bg: var(--color-primary-200);--emr-mchart-line-marker-line-bg: var(--color-neutral);--emr-mchart-line-marker-dot-bg: var(--color-primary);--emr-mchart-line-area-gradient-start-color: var(--color-primary);--emr-mchart-line-area-gradient-end-color: var(--color-background);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host ::ng-deep .line{stroke:var(--emr-mchart-line-line-bg);fill:none;stroke-linejoin:round;stroke-linecap:round}:host ::ng-deep .area{stroke-width:0}:host ::ng-deep .marker-line{stroke:var(--emr-mchart-line-marker-line-bg);stroke-width:1;stroke-dasharray:3}:host ::ng-deep .marker-dot{fill:var(--emr-mchart-line-marker-dot-bg)}:host:not(.fill-area-gradient) ::ng-deep .area{fill:var(--emr-mchart-line-area-bg)}:host.fill-area-gradient .lg-start-color{stop-color:var(--emr-mchart-line-area-gradient-start-color)}:host.fill-area-gradient .lg-end-color{stop-color:var(--emr-mchart-line-area-gradient-end-color)}:host-context(html.dark){--emr-mchart-line-area-bg: var(--color-neutral-700);--emr-mchart-line-area-gradient-start-color: var(--color-neutral-700)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
364
|
+
}
|
|
365
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: MchartLineComponent, decorators: [{
|
|
366
|
+
type: Component,
|
|
367
|
+
args: [{ selector: 'emr-mchart-line', exportAs: 'emrMchartLine', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
368
|
+
'class': 'emr-mchart-line',
|
|
369
|
+
'[class.fill-area-gradient]': 'fillAreaGradient()',
|
|
370
|
+
}, template: "<svg>\r\n @if (fillAreaGradient()) {\r\n <linearGradient [id]=\"gradientId\" x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\r\n <stop offset=\"0%\" class=\"lg-start-color\"/>\r\n <stop offset=\"100%\" class=\"lg-end-color\"/>\r\n </linearGradient>\r\n }\r\n</svg>\r\n", styles: [":host{--emr-mchart-line-line-bg: var(--color-primary);--emr-mchart-line-area-bg: var(--color-primary-200);--emr-mchart-line-marker-line-bg: var(--color-neutral);--emr-mchart-line-marker-dot-bg: var(--color-primary);--emr-mchart-line-area-gradient-start-color: var(--color-primary);--emr-mchart-line-area-gradient-end-color: var(--color-background);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host ::ng-deep .line{stroke:var(--emr-mchart-line-line-bg);fill:none;stroke-linejoin:round;stroke-linecap:round}:host ::ng-deep .area{stroke-width:0}:host ::ng-deep .marker-line{stroke:var(--emr-mchart-line-marker-line-bg);stroke-width:1;stroke-dasharray:3}:host ::ng-deep .marker-dot{fill:var(--emr-mchart-line-marker-dot-bg)}:host:not(.fill-area-gradient) ::ng-deep .area{fill:var(--emr-mchart-line-area-bg)}:host.fill-area-gradient .lg-start-color{stop-color:var(--emr-mchart-line-area-gradient-start-color)}:host.fill-area-gradient .lg-end-color{stop-color:var(--emr-mchart-line-area-gradient-end-color)}:host-context(html.dark){--emr-mchart-line-area-bg: var(--color-neutral-700);--emr-mchart-line-area-gradient-start-color: var(--color-neutral-700)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"] }]
|
|
371
|
+
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], strokeWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "strokeWidth", required: false }] }], showArea: [{ type: i0.Input, args: [{ isSignal: true, alias: "showArea", required: false }] }], showMarkers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMarkers", required: false }] }], responsive: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsive", required: false }] }], fillAreaGradient: [{ type: i0.Input, args: [{ isSignal: true, alias: "fillAreaGradient", required: false }] }], curve: [{ type: i0.Input, args: [{ isSignal: true, alias: "curve", required: false }] }], xAccessor: [{ type: i0.Input, args: [{ isSignal: true, alias: "xAccessor", required: false }] }], yAccessor: [{ type: i0.Input, args: [{ isSignal: true, alias: "yAccessor", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], markerDotSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "markerDotSize", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPosition", required: false }] }] } });
|
|
372
|
+
|
|
373
|
+
let nextId = 0;
|
|
374
|
+
class MchartBarComponent extends BaseChartTooltip {
|
|
375
|
+
_initialized = false;
|
|
376
|
+
_host;
|
|
377
|
+
_svg;
|
|
378
|
+
_hlContainer;
|
|
379
|
+
_dataContainer;
|
|
380
|
+
_dimensions;
|
|
381
|
+
_innerWidth = 0;
|
|
382
|
+
_innerHeight = 0;
|
|
383
|
+
_hostWidth = 0;
|
|
384
|
+
_hostHeight = 0;
|
|
385
|
+
_xScale;
|
|
386
|
+
_yScale;
|
|
387
|
+
_resizeObserver;
|
|
388
|
+
_platformId = inject(PLATFORM_ID);
|
|
389
|
+
_elementRef = inject(ElementRef);
|
|
390
|
+
_destroyRef = inject(DestroyRef);
|
|
391
|
+
data = input([], ...(ngDevMode ? [{ debugName: "data" }] : []));
|
|
392
|
+
labels = input([], ...(ngDevMode ? [{ debugName: "labels" }] : []));
|
|
393
|
+
gap = input(0.2, ...(ngDevMode ? [{ debugName: "gap", transform: numberAttribute }] : [{
|
|
394
|
+
transform: numberAttribute
|
|
395
|
+
}]));
|
|
396
|
+
radius = input(0, ...(ngDevMode ? [{ debugName: "radius", transform: numberAttribute }] : [{
|
|
397
|
+
transform: numberAttribute
|
|
398
|
+
}]));
|
|
399
|
+
highlight = input(false, ...(ngDevMode ? [{ debugName: "highlight", transform: booleanAttribute }] : [{
|
|
400
|
+
transform: booleanAttribute
|
|
401
|
+
}]));
|
|
402
|
+
responsive = input(false, ...(ngDevMode ? [{ debugName: "responsive", transform: booleanAttribute }] : [{
|
|
403
|
+
transform: booleanAttribute
|
|
404
|
+
}]));
|
|
405
|
+
fillGradient = input(false, ...(ngDevMode ? [{ debugName: "fillGradient", transform: booleanAttribute }] : [{
|
|
406
|
+
transform: booleanAttribute
|
|
407
|
+
}]));
|
|
408
|
+
xAccessor = input((d, i) => i, ...(ngDevMode ? [{ debugName: "xAccessor" }] : []));
|
|
409
|
+
yAccessor = input((d) => d, ...(ngDevMode ? [{ debugName: "yAccessor" }] : []));
|
|
410
|
+
tooltip = input(...(ngDevMode ? [undefined, { debugName: "tooltip" }] : []));
|
|
411
|
+
tooltipPosition = input('after-center', ...(ngDevMode ? [{ debugName: "tooltipPosition" }] : []));
|
|
412
|
+
get gradientId() {
|
|
413
|
+
return 'areaGradient' + this._gradientId;
|
|
414
|
+
}
|
|
415
|
+
_gradientId = nextId++;
|
|
416
|
+
constructor() {
|
|
417
|
+
super();
|
|
418
|
+
effect(() => {
|
|
419
|
+
if (!this._initialized) {
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
this._render();
|
|
423
|
+
this._setupResizeObserver();
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
ngAfterViewChecked() {
|
|
427
|
+
if (isPlatformServer(this._platformId)) {
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
if (!this._initialized) {
|
|
431
|
+
const element = this._elementRef.nativeElement;
|
|
432
|
+
this._dimensions = element.getBoundingClientRect();
|
|
433
|
+
if (this._dimensions.width !== 0 && this._dimensions.height !== 0) {
|
|
434
|
+
this._initialized = true;
|
|
435
|
+
this._render();
|
|
436
|
+
this._setupResizeObserver();
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
ngOnDestroy() {
|
|
441
|
+
this._resizeObserver?.disconnect();
|
|
442
|
+
}
|
|
443
|
+
getTooltipPosition() {
|
|
444
|
+
return this.tooltipPosition();
|
|
445
|
+
}
|
|
446
|
+
getTooltipTemplateRef() {
|
|
447
|
+
return this.tooltip();
|
|
448
|
+
}
|
|
449
|
+
_render() {
|
|
450
|
+
this._init();
|
|
451
|
+
this._setupAxisScale();
|
|
452
|
+
this._setupData();
|
|
453
|
+
this._initTooltip();
|
|
454
|
+
}
|
|
455
|
+
_init() {
|
|
456
|
+
this._hostWidth = this._dimensions.width;
|
|
457
|
+
this._hostHeight = this._dimensions.height;
|
|
458
|
+
this._innerWidth = this._dimensions.width;
|
|
459
|
+
this._innerHeight = this._dimensions.height;
|
|
460
|
+
this._host = select(this._elementRef.nativeElement);
|
|
461
|
+
this._svg = this._host
|
|
462
|
+
.select('svg')
|
|
463
|
+
.attr('viewBox', `0 0 ${this._hostWidth} ${this._hostHeight}`);
|
|
464
|
+
}
|
|
465
|
+
_setupAxisScale() {
|
|
466
|
+
if (!this._xScale) {
|
|
467
|
+
this._xScale = scaleBand()
|
|
468
|
+
.paddingInner(this.gap())
|
|
469
|
+
.domain(this.data().map((d, i) => i.toString()));
|
|
470
|
+
}
|
|
471
|
+
this._xScale.range([0, this._innerWidth]);
|
|
472
|
+
if (!this._yScale) {
|
|
473
|
+
this._yScale = scaleLinear().domain([0, Math.max(...this.data())]);
|
|
474
|
+
}
|
|
475
|
+
this._yScale.range([this._innerHeight, 0]);
|
|
476
|
+
}
|
|
477
|
+
_setupData() {
|
|
478
|
+
if (this.highlight()) {
|
|
479
|
+
if (!this._hlContainer) {
|
|
480
|
+
this._hlContainer = this._svg.append('g')
|
|
481
|
+
.attr('class', 'hl-container')
|
|
482
|
+
.attr('transform', `translate(0,0)`);
|
|
483
|
+
this._hlContainer.selectAll('rect')
|
|
484
|
+
.data(this.data())
|
|
485
|
+
.enter()
|
|
486
|
+
.append('rect')
|
|
487
|
+
.attr('rx', this.radius())
|
|
488
|
+
.attr('x', (d, i) => this._xScale(i.toString()))
|
|
489
|
+
.attr('y', 0)
|
|
490
|
+
.attr('width', this._xScale.bandwidth())
|
|
491
|
+
.attr('height', this._innerHeight)
|
|
492
|
+
.attr('class', 'highlight');
|
|
493
|
+
}
|
|
494
|
+
else {
|
|
495
|
+
this._hlContainer.selectAll('rect')
|
|
496
|
+
.attr('x', (d, i) => this._xScale(i.toString()))
|
|
497
|
+
.attr('y', 0)
|
|
498
|
+
.attr('width', this._xScale.bandwidth())
|
|
499
|
+
.attr('height', this._innerHeight);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
if (!this._dataContainer) {
|
|
503
|
+
this._dataContainer = this._svg.append('g')
|
|
504
|
+
.attr('class', 'data-container')
|
|
505
|
+
.attr('transform', `translate(0,0)`);
|
|
506
|
+
const allBars = this._dataContainer.selectAll('rect')
|
|
507
|
+
.data(this.data())
|
|
508
|
+
.enter()
|
|
509
|
+
.append('rect')
|
|
510
|
+
.attr('rx', this.radius())
|
|
511
|
+
.attr('x', (d, i) => this._xScale(i.toString()))
|
|
512
|
+
.attr('y', (d) => this._yScale(d))
|
|
513
|
+
.attr('width', this._xScale.bandwidth())
|
|
514
|
+
.attr('height', (d) => this._innerHeight - this._yScale(d))
|
|
515
|
+
.attr('class', 'bar');
|
|
516
|
+
if (this.fillGradient()) {
|
|
517
|
+
allBars.attr('fill', `url(#${this.gradientId})`);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
else {
|
|
521
|
+
this._dataContainer.selectAll('rect')
|
|
522
|
+
.attr('x', (d, i) => this._xScale(i.toString()))
|
|
523
|
+
.attr('y', (d) => this._yScale(d))
|
|
524
|
+
.attr('width', this._xScale.bandwidth())
|
|
525
|
+
.attr('height', (d) => this._innerHeight - this._yScale(d));
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
_setupResizeObserver() {
|
|
529
|
+
if (!this.responsive()) {
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
this._resizeObserver?.disconnect();
|
|
533
|
+
this._resizeObserver = new ResizeObserver((entries) => {
|
|
534
|
+
if (this._hostWidth !== entries[0].contentRect.width || this._hostHeight !== entries[0].contentRect.height) {
|
|
535
|
+
this._hostWidth = entries[0].contentRect.width;
|
|
536
|
+
this._hostHeight = entries[0].contentRect.height;
|
|
537
|
+
this._innerWidth = entries[0].contentRect.width;
|
|
538
|
+
this._innerHeight = entries[0].contentRect.height;
|
|
539
|
+
this._svg.attr('viewBox', `0 0 ${this._hostWidth} ${this._hostHeight}`);
|
|
540
|
+
this._setupAxisScale();
|
|
541
|
+
this._setupData();
|
|
542
|
+
}
|
|
543
|
+
});
|
|
544
|
+
this._resizeObserver.observe(this._elementRef.nativeElement);
|
|
545
|
+
}
|
|
546
|
+
_initTooltip() {
|
|
547
|
+
if (!this.tooltip()) {
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
const xAccessor = this.xAccessor();
|
|
551
|
+
const yAccessor = this.yAccessor();
|
|
552
|
+
this._createTooltipOrigin();
|
|
553
|
+
let x = 0;
|
|
554
|
+
let y = 0;
|
|
555
|
+
let label;
|
|
556
|
+
let value;
|
|
557
|
+
let oldX;
|
|
558
|
+
fromEvent(this._document, 'mousemove')
|
|
559
|
+
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
560
|
+
.subscribe((e) => {
|
|
561
|
+
const target = e.target;
|
|
562
|
+
const pointerCoords = pointer(e, this._svg.node());
|
|
563
|
+
const [posX, posY] = pointerCoords;
|
|
564
|
+
let visible = true;
|
|
565
|
+
if (posX < 0 || posY < 0 || posX > this._hostWidth || posY > this._hostHeight) {
|
|
566
|
+
visible = false;
|
|
567
|
+
oldX = null;
|
|
568
|
+
this._overlayRef?.detach();
|
|
569
|
+
}
|
|
570
|
+
else {
|
|
571
|
+
if (!target.closest('.emr-mchart-line') ||
|
|
572
|
+
!target.classList.contains('emr-mchart-tooltip-overlay') ||
|
|
573
|
+
!target.closest('.emr-mchart-tooltip-overlay')) {
|
|
574
|
+
oldX = null;
|
|
575
|
+
this._overlayRef?.detach();
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
const eachBand = this._xScale.step();
|
|
579
|
+
const index = Math.floor(posX / eachBand);
|
|
580
|
+
const dataValue = this.data()[index];
|
|
581
|
+
label = this.labels()[index] ? this.labels()[index] : xAccessor(index, index);
|
|
582
|
+
value = yAccessor(dataValue);
|
|
583
|
+
x = this._xScale(xAccessor(index, index));
|
|
584
|
+
y = this._yScale(yAccessor(dataValue));
|
|
585
|
+
this._setTooltipPositionByEvent(e);
|
|
586
|
+
if (visible) {
|
|
587
|
+
this._setTooltipVisible();
|
|
588
|
+
if (!this._overlayRef?.hasAttached()) {
|
|
589
|
+
oldX = x;
|
|
590
|
+
this._showTooltip({
|
|
591
|
+
label,
|
|
592
|
+
value
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
else {
|
|
596
|
+
if (oldX !== x) {
|
|
597
|
+
oldX = x;
|
|
598
|
+
this._showTooltip({
|
|
599
|
+
label,
|
|
600
|
+
value
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
else {
|
|
604
|
+
this._overlayRef.updatePosition();
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
else {
|
|
609
|
+
oldX = x;
|
|
610
|
+
this._setTooltipInVisible();
|
|
611
|
+
}
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: MchartBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
615
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: MchartBarComponent, isStandalone: true, selector: "emr-mchart-bar", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, highlight: { classPropertyName: "highlight", publicName: "highlight", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null }, fillGradient: { classPropertyName: "fillGradient", publicName: "fillGradient", isSignal: true, isRequired: false, transformFunction: null }, xAccessor: { classPropertyName: "xAccessor", publicName: "xAccessor", isSignal: true, isRequired: false, transformFunction: null }, yAccessor: { classPropertyName: "yAccessor", publicName: "yAccessor", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.fill-gradient": "fillGradient()", "class.with-tooltip": "!!tooltip()" }, classAttribute: "emr-mchart-bar" }, exportAs: ["emrMchartBar"], usesInheritance: true, ngImport: i0, template: "<svg>\r\n <defs>\r\n @if (fillGradient()) {\r\n <linearGradient [id]=\"gradientId\" x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\r\n <stop offset=\"0%\" class=\"lg-start-color\"/>\r\n <stop offset=\"100%\" class=\"lg-end-color\"/>\r\n </linearGradient>\r\n }\r\n </defs>\r\n</svg>\r\n", styles: [":host{--emr-mchart-bar-bar-bg: var(--color-primary);--emr-mchart-bar-bar-gradient-start-color: var(--color-primary-500);--emr-mchart-bar-bar-gradient-end-color: var(--color-primary);--emr-mchart-bar-highlight-bg: var(--color-neutral-200);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host ::ng-deep .highlight{fill:var(--emr-mchart-bar-highlight-bg)}:host:not(.fill-gradient) ::ng-deep .bar{fill:var(--emr-mchart-bar-bar-bg)}:host.fill-gradient .lg-start-color{stop-color:var(--emr-mchart-bar-bar-gradient-start-color)}:host.fill-gradient .lg-end-color{stop-color:var(--emr-mchart-bar-bar-gradient-end-color)}:host.with-tooltip ::ng-deep .bar:hover{opacity:.85}:host-context(html.dark){--emr-mchart-bar-highlight-bg: var(--color-neutral-700)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
616
|
+
}
|
|
617
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: MchartBarComponent, decorators: [{
|
|
618
|
+
type: Component,
|
|
619
|
+
args: [{ selector: 'emr-mchart-bar', exportAs: 'emrMchartBar', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
620
|
+
'class': 'emr-mchart-bar',
|
|
621
|
+
'[class.fill-gradient]': 'fillGradient()',
|
|
622
|
+
'[class.with-tooltip]': '!!tooltip()',
|
|
623
|
+
}, template: "<svg>\r\n <defs>\r\n @if (fillGradient()) {\r\n <linearGradient [id]=\"gradientId\" x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\r\n <stop offset=\"0%\" class=\"lg-start-color\"/>\r\n <stop offset=\"100%\" class=\"lg-end-color\"/>\r\n </linearGradient>\r\n }\r\n </defs>\r\n</svg>\r\n", styles: [":host{--emr-mchart-bar-bar-bg: var(--color-primary);--emr-mchart-bar-bar-gradient-start-color: var(--color-primary-500);--emr-mchart-bar-bar-gradient-end-color: var(--color-primary);--emr-mchart-bar-highlight-bg: var(--color-neutral-200);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host ::ng-deep .highlight{fill:var(--emr-mchart-bar-highlight-bg)}:host:not(.fill-gradient) ::ng-deep .bar{fill:var(--emr-mchart-bar-bar-bg)}:host.fill-gradient .lg-start-color{stop-color:var(--emr-mchart-bar-bar-gradient-start-color)}:host.fill-gradient .lg-end-color{stop-color:var(--emr-mchart-bar-bar-gradient-end-color)}:host.with-tooltip ::ng-deep .bar:hover{opacity:.85}:host-context(html.dark){--emr-mchart-bar-highlight-bg: var(--color-neutral-700)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"] }]
|
|
624
|
+
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], gap: [{ type: i0.Input, args: [{ isSignal: true, alias: "gap", required: false }] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], highlight: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlight", required: false }] }], responsive: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsive", required: false }] }], fillGradient: [{ type: i0.Input, args: [{ isSignal: true, alias: "fillGradient", required: false }] }], xAccessor: [{ type: i0.Input, args: [{ isSignal: true, alias: "xAccessor", required: false }] }], yAccessor: [{ type: i0.Input, args: [{ isSignal: true, alias: "yAccessor", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPosition", required: false }] }] } });
|
|
625
|
+
|
|
626
|
+
class MchartPieComponent extends BaseChartTooltip {
|
|
627
|
+
_initialized = false;
|
|
628
|
+
_host;
|
|
629
|
+
_svg;
|
|
630
|
+
_dataContainer;
|
|
631
|
+
_legendContainer;
|
|
632
|
+
_dimensions;
|
|
633
|
+
_innerWidth = 0;
|
|
634
|
+
_innerHeight = 0;
|
|
635
|
+
_hostWidth = 0;
|
|
636
|
+
_hostHeight = 0;
|
|
637
|
+
_resizeObserver;
|
|
638
|
+
_platformId = inject(PLATFORM_ID);
|
|
639
|
+
_elementRef = inject(ElementRef);
|
|
640
|
+
_radius = 0;
|
|
641
|
+
_arcGenerator;
|
|
642
|
+
_pieGenerator;
|
|
643
|
+
_colorsGenerator;
|
|
644
|
+
_arcTweenGenerator;
|
|
645
|
+
_pieData;
|
|
646
|
+
data = input([], ...(ngDevMode ? [{ debugName: "data" }] : []));
|
|
647
|
+
labels = input([], ...(ngDevMode ? [{ debugName: "labels" }] : []));
|
|
648
|
+
valueAccessor = input((d) => d, ...(ngDevMode ? [{ debugName: "valueAccessor" }] : []));
|
|
649
|
+
dataItemStrokeWidth = input(1, ...(ngDevMode ? [{ debugName: "dataItemStrokeWidth", transform: numberAttribute }] : [{
|
|
650
|
+
transform: numberAttribute
|
|
651
|
+
}]));
|
|
652
|
+
legendContainerWidth = input(0, ...(ngDevMode ? [{ debugName: "legendContainerWidth", transform: numberAttribute }] : [{
|
|
653
|
+
transform: numberAttribute
|
|
654
|
+
}]));
|
|
655
|
+
showDataAnimation = input(false, ...(ngDevMode ? [{ debugName: "showDataAnimation", transform: booleanAttribute }] : [{
|
|
656
|
+
transform: booleanAttribute
|
|
657
|
+
}]));
|
|
658
|
+
showValueOnSlices = input(false, ...(ngDevMode ? [{ debugName: "showValueOnSlices", transform: booleanAttribute }] : [{
|
|
659
|
+
transform: booleanAttribute
|
|
660
|
+
}]));
|
|
661
|
+
showLegend = input(false, ...(ngDevMode ? [{ debugName: "showLegend", transform: booleanAttribute }] : [{
|
|
662
|
+
transform: booleanAttribute
|
|
663
|
+
}]));
|
|
664
|
+
legendOffset = input(30, ...(ngDevMode ? [{ debugName: "legendOffset", transform: numberAttribute }] : [{
|
|
665
|
+
transform: numberAttribute
|
|
666
|
+
}]));
|
|
667
|
+
legendItemHeight = input(30, ...(ngDevMode ? [{ debugName: "legendItemHeight", transform: numberAttribute }] : [{
|
|
668
|
+
transform: numberAttribute
|
|
669
|
+
}]));
|
|
670
|
+
legendItemSymbolSize = input(12, ...(ngDevMode ? [{ debugName: "legendItemSymbolSize", transform: numberAttribute }] : [{
|
|
671
|
+
transform: numberAttribute
|
|
672
|
+
}]));
|
|
673
|
+
legendItemFontSize = input(14, ...(ngDevMode ? [{ debugName: "legendItemFontSize", transform: numberAttribute }] : [{
|
|
674
|
+
transform: numberAttribute
|
|
675
|
+
}]));
|
|
676
|
+
legendItemSymbolBorderRadius = input(12, ...(ngDevMode ? [{ debugName: "legendItemSymbolBorderRadius", transform: numberAttribute }] : [{
|
|
677
|
+
transform: numberAttribute
|
|
678
|
+
}]));
|
|
679
|
+
valueFontSize = input(12, ...(ngDevMode ? [{ debugName: "valueFontSize", transform: numberAttribute }] : [{
|
|
680
|
+
transform: numberAttribute
|
|
681
|
+
}]));
|
|
682
|
+
tooltip = input(...(ngDevMode ? [undefined, { debugName: "tooltip" }] : []));
|
|
683
|
+
tooltipPosition = input('after-center', ...(ngDevMode ? [{ debugName: "tooltipPosition" }] : []));
|
|
684
|
+
getTooltipPosition() {
|
|
685
|
+
return this.tooltipPosition();
|
|
686
|
+
}
|
|
687
|
+
getTooltipTemplateRef() {
|
|
688
|
+
return this.tooltip();
|
|
689
|
+
}
|
|
690
|
+
ngAfterViewChecked() {
|
|
691
|
+
if (isPlatformServer(this._platformId)) {
|
|
692
|
+
return;
|
|
693
|
+
}
|
|
694
|
+
if (!this._initialized) {
|
|
695
|
+
const element = this._elementRef.nativeElement;
|
|
696
|
+
this._dimensions = element.getBoundingClientRect();
|
|
697
|
+
if (this._dimensions.width !== 0 && this._dimensions.height !== 0) {
|
|
698
|
+
this._initialized = true;
|
|
699
|
+
this._render();
|
|
700
|
+
this._setupResizeObserver();
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
ngOnChanges(changes) {
|
|
705
|
+
if (!this._initialized) {
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
708
|
+
if (changes['data'] && !changes['data'].firstChange) {
|
|
709
|
+
this._draw(true);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
ngOnDestroy() {
|
|
713
|
+
this._resizeObserver?.disconnect();
|
|
714
|
+
}
|
|
715
|
+
_render() {
|
|
716
|
+
this._initDimensions();
|
|
717
|
+
this._initContainers();
|
|
718
|
+
this._setGenerators();
|
|
719
|
+
this._setLegend();
|
|
720
|
+
this._draw();
|
|
721
|
+
this._initTooltip();
|
|
722
|
+
}
|
|
723
|
+
_initDimensions() {
|
|
724
|
+
const legendContainerWidth = this.showLegend() ? this.legendContainerWidth() : 0;
|
|
725
|
+
this._hostWidth = this._dimensions.width;
|
|
726
|
+
this._hostHeight = this._dimensions.height;
|
|
727
|
+
this._innerWidth = this._dimensions.width - legendContainerWidth - this.dataItemStrokeWidth() * 2;
|
|
728
|
+
this._innerHeight = this._dimensions.height - this.dataItemStrokeWidth() * 2;
|
|
729
|
+
this._host = select(this._elementRef.nativeElement);
|
|
730
|
+
this._svg = this._host
|
|
731
|
+
.select('svg')
|
|
732
|
+
.attr('viewBox', `0 0 ${this._hostWidth} ${this._hostHeight}`);
|
|
733
|
+
this._radius = Math.min(this._innerWidth, this._innerHeight) * .5;
|
|
734
|
+
}
|
|
735
|
+
_initContainers() {
|
|
736
|
+
this._dataContainer = this._svg
|
|
737
|
+
.append('g')
|
|
738
|
+
.attr('class', 'data-container')
|
|
739
|
+
.attr('transform', `translate(${this._radius},${this._innerHeight * .5})`);
|
|
740
|
+
if (this.showLegend()) {
|
|
741
|
+
this._legendContainer = this._svg
|
|
742
|
+
.append('g')
|
|
743
|
+
.attr('class', 'legend-container');
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
_setGenerators() {
|
|
747
|
+
const self = this;
|
|
748
|
+
this._arcGenerator = arc()
|
|
749
|
+
.innerRadius(0)
|
|
750
|
+
.outerRadius(this._radius);
|
|
751
|
+
this._pieGenerator = pie()
|
|
752
|
+
.value(this.valueAccessor());
|
|
753
|
+
this._colorsGenerator = scaleOrdinal(schemeTableau10)
|
|
754
|
+
.domain(this.data().map((d, i) => i.toString()));
|
|
755
|
+
this._arcTweenGenerator = function (d) {
|
|
756
|
+
// @ts-ignore
|
|
757
|
+
const _this = this;
|
|
758
|
+
const current = d;
|
|
759
|
+
const interpolateGenerator = interpolate(_this._previous, current);
|
|
760
|
+
_this._previous = current;
|
|
761
|
+
return (t) => {
|
|
762
|
+
return self._arcGenerator(interpolateGenerator(t));
|
|
763
|
+
};
|
|
764
|
+
};
|
|
765
|
+
}
|
|
766
|
+
_setLegend() {
|
|
767
|
+
if (!this.showLegend()) {
|
|
768
|
+
return;
|
|
769
|
+
}
|
|
770
|
+
this._legendContainer
|
|
771
|
+
.selectAll('g.legend-item')
|
|
772
|
+
.data(this.data())
|
|
773
|
+
.join('g')
|
|
774
|
+
.attr('class', 'legend-item')
|
|
775
|
+
.attr('data-index', (d, i) => i)
|
|
776
|
+
.attr('transform', (d, i) => `translate(0, ${i * this.legendItemHeight()})`)
|
|
777
|
+
.on('mouseenter', (event, d) => {
|
|
778
|
+
const target = event.target;
|
|
779
|
+
const index = +target.getAttribute('data-index');
|
|
780
|
+
this._dataContainer
|
|
781
|
+
.select(`path.data-item[data-index="${index}"]`)
|
|
782
|
+
.classed('active', true);
|
|
783
|
+
})
|
|
784
|
+
.on('mouseleave', (event, d) => {
|
|
785
|
+
const target = event.target;
|
|
786
|
+
const index = +target.getAttribute('data-index');
|
|
787
|
+
this._dataContainer
|
|
788
|
+
.select(`path.data-item[data-index="${index}"]`)
|
|
789
|
+
.classed('active', false);
|
|
790
|
+
});
|
|
791
|
+
this._legendContainer
|
|
792
|
+
.selectAll('g.legend-item')
|
|
793
|
+
.selectAll('text')
|
|
794
|
+
.data((d, i) => [i])
|
|
795
|
+
.join('text')
|
|
796
|
+
.attr('class', 'legend-item-text')
|
|
797
|
+
.attr('x', this.legendItemSymbolSize() * 2)
|
|
798
|
+
.attr('y', this.legendItemHeight() * .5)
|
|
799
|
+
.attr('font-size', this.legendItemFontSize())
|
|
800
|
+
.text((i) => this.labels()[i]);
|
|
801
|
+
this._legendContainer
|
|
802
|
+
.selectAll('g.legend-item')
|
|
803
|
+
.selectAll('rect')
|
|
804
|
+
.data((d, i) => [i])
|
|
805
|
+
.join('rect')
|
|
806
|
+
.attr('class', 'legend-item-symbol')
|
|
807
|
+
.attr('rx', this.legendItemSymbolBorderRadius())
|
|
808
|
+
.attr('width', this.legendItemSymbolSize())
|
|
809
|
+
.attr('height', this.legendItemSymbolSize())
|
|
810
|
+
.attr('fill', (i) => this._colorsGenerator(i))
|
|
811
|
+
.attr('y', this.legendItemFontSize() * .5 - 2);
|
|
812
|
+
const dimensions = this._legendContainer.node().getBBox();
|
|
813
|
+
this._legendContainer.attr('transform', `translate(${this._radius * 2 + this.legendOffset()},${this._innerHeight * .5 - .5 * dimensions.height})`);
|
|
814
|
+
}
|
|
815
|
+
_draw(isUpdate = false) {
|
|
816
|
+
if (isUpdate) {
|
|
817
|
+
this._colorsGenerator
|
|
818
|
+
.domain(this.data().map((d, i) => i.toString()));
|
|
819
|
+
}
|
|
820
|
+
this._pieData = this._pieGenerator(this.data());
|
|
821
|
+
this._dataContainer
|
|
822
|
+
.selectAll('g.data-item-group')
|
|
823
|
+
.data(this.data())
|
|
824
|
+
.join('g')
|
|
825
|
+
.attr('class', 'data-item-group')
|
|
826
|
+
.attr('data-index', (d, i) => i);
|
|
827
|
+
this._dataContainer
|
|
828
|
+
.selectAll('g.data-item-group')
|
|
829
|
+
.selectAll('path')
|
|
830
|
+
.data((d, i) => [this._pieData[i]])
|
|
831
|
+
.join('path')
|
|
832
|
+
.attr('class', 'data-item')
|
|
833
|
+
.attr('stroke-width', this.dataItemStrokeWidth())
|
|
834
|
+
.attr('d', (d) => this._arcGenerator(d))
|
|
835
|
+
.style('fill', (d) => this._colorsGenerator(d.index))
|
|
836
|
+
.attr('data-index', (d) => d.index)
|
|
837
|
+
.transition()
|
|
838
|
+
.duration(this.showDataAnimation() ? 1000 : 0)
|
|
839
|
+
.attrTween('d', this._arcTweenGenerator);
|
|
840
|
+
if (this.showValueOnSlices()) {
|
|
841
|
+
this._dataContainer
|
|
842
|
+
.selectAll('g.data-item-group')
|
|
843
|
+
.selectAll('text')
|
|
844
|
+
.data((d, i) => [this._pieData[i]])
|
|
845
|
+
.join('text')
|
|
846
|
+
.attr('class', 'value')
|
|
847
|
+
.attr('font-size', this.valueFontSize())
|
|
848
|
+
.attr('transform', (d) => {
|
|
849
|
+
const coordinates = this._arcGenerator.centroid(d);
|
|
850
|
+
return `translate(${coordinates[0]},${coordinates[1]})`;
|
|
851
|
+
})
|
|
852
|
+
.text((d) => d.data);
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
_setupResizeObserver() {
|
|
856
|
+
}
|
|
857
|
+
_initTooltip() {
|
|
858
|
+
if (!this.tooltip()) {
|
|
859
|
+
return;
|
|
860
|
+
}
|
|
861
|
+
let oldValue;
|
|
862
|
+
this._createTooltipOrigin();
|
|
863
|
+
this._dataContainer
|
|
864
|
+
.selectAll('g.data-item-group')
|
|
865
|
+
.data(this._pieData)
|
|
866
|
+
.on('mousemove', (event, d) => {
|
|
867
|
+
const target = event.target;
|
|
868
|
+
this._setTooltipPositionByEvent(event);
|
|
869
|
+
this._setTooltipVisible();
|
|
870
|
+
const index = +target.getAttribute('data-index');
|
|
871
|
+
const label = this.labels()[index] ? this.labels()[index] : null;
|
|
872
|
+
const color = this._colorsGenerator(index);
|
|
873
|
+
const value = d.data;
|
|
874
|
+
if (!this._overlayRef?.hasAttached()) {
|
|
875
|
+
this._showTooltip({
|
|
876
|
+
label,
|
|
877
|
+
color,
|
|
878
|
+
value
|
|
879
|
+
});
|
|
880
|
+
oldValue = value;
|
|
881
|
+
}
|
|
882
|
+
else {
|
|
883
|
+
if (oldValue !== d.data) {
|
|
884
|
+
this._showTooltip({
|
|
885
|
+
label,
|
|
886
|
+
color,
|
|
887
|
+
value
|
|
888
|
+
});
|
|
889
|
+
oldValue = value;
|
|
890
|
+
}
|
|
891
|
+
else {
|
|
892
|
+
this._overlayRef.updatePosition();
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
});
|
|
896
|
+
this._dataContainer
|
|
897
|
+
.on('mouseleave', (event) => {
|
|
898
|
+
this._setTooltipInVisible();
|
|
899
|
+
this._hideTooltip();
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: MchartPieComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
903
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.10", type: MchartPieComponent, isStandalone: true, selector: "emr-mchart-pie", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, valueAccessor: { classPropertyName: "valueAccessor", publicName: "valueAccessor", isSignal: true, isRequired: false, transformFunction: null }, dataItemStrokeWidth: { classPropertyName: "dataItemStrokeWidth", publicName: "dataItemStrokeWidth", isSignal: true, isRequired: false, transformFunction: null }, legendContainerWidth: { classPropertyName: "legendContainerWidth", publicName: "legendContainerWidth", isSignal: true, isRequired: false, transformFunction: null }, showDataAnimation: { classPropertyName: "showDataAnimation", publicName: "showDataAnimation", isSignal: true, isRequired: false, transformFunction: null }, showValueOnSlices: { classPropertyName: "showValueOnSlices", publicName: "showValueOnSlices", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, legendOffset: { classPropertyName: "legendOffset", publicName: "legendOffset", isSignal: true, isRequired: false, transformFunction: null }, legendItemHeight: { classPropertyName: "legendItemHeight", publicName: "legendItemHeight", isSignal: true, isRequired: false, transformFunction: null }, legendItemSymbolSize: { classPropertyName: "legendItemSymbolSize", publicName: "legendItemSymbolSize", isSignal: true, isRequired: false, transformFunction: null }, legendItemFontSize: { classPropertyName: "legendItemFontSize", publicName: "legendItemFontSize", isSignal: true, isRequired: false, transformFunction: null }, legendItemSymbolBorderRadius: { classPropertyName: "legendItemSymbolBorderRadius", publicName: "legendItemSymbolBorderRadius", isSignal: true, isRequired: false, transformFunction: null }, valueFontSize: { classPropertyName: "valueFontSize", publicName: "valueFontSize", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "emr-mchart-pie" }, exportAs: ["emrMchartPie"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<svg></svg>\r\n", styles: [":host{--emr-mchart-pie-stroke-color: var(--color-background);--emr-mchart-pie-legend-item-color: var(--color-neutral-900);--emr-mchart-pie-legend-item-hover-color: var(--color-primary);--emr-mchart-pie-value-color: var(--color-neutral-950);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host:has(.data-item.active) ::ng-deep .data-item:not(.active){opacity:.7;scale:.93;transition:scale .2s}:host ::ng-deep .data-item{stroke:var(--emr-mchart-pie-stroke-color)}:host ::ng-deep .value{text-anchor:middle;alignment-baseline:middle;fill:var(--emr-mchart-pie-value-color)}:host ::ng-deep .legend-item{cursor:pointer}:host ::ng-deep .legend-item:hover .legend-item-text{fill:var(--emr-mchart-pie-legend-item-hover-color)}:host ::ng-deep .legend-item-text{fill:var(--emr-mchart-pie-legend-item-color)}:host-context(html.dark){--emr-mchart-pie-legend-item-color: var(--color-neutral-200)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
904
|
+
}
|
|
905
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: MchartPieComponent, decorators: [{
|
|
906
|
+
type: Component,
|
|
907
|
+
args: [{ selector: 'emr-mchart-pie', exportAs: 'emrMchartPie', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
908
|
+
'class': 'emr-mchart-pie'
|
|
909
|
+
}, template: "<svg></svg>\r\n", styles: [":host{--emr-mchart-pie-stroke-color: var(--color-background);--emr-mchart-pie-legend-item-color: var(--color-neutral-900);--emr-mchart-pie-legend-item-hover-color: var(--color-primary);--emr-mchart-pie-value-color: var(--color-neutral-950);display:block;overflow:hidden}:host svg{width:100%;height:100%}:host:has(.data-item.active) ::ng-deep .data-item:not(.active){opacity:.7;scale:.93;transition:scale .2s}:host ::ng-deep .data-item{stroke:var(--emr-mchart-pie-stroke-color)}:host ::ng-deep .value{text-anchor:middle;alignment-baseline:middle;fill:var(--emr-mchart-pie-value-color)}:host ::ng-deep .legend-item{cursor:pointer}:host ::ng-deep .legend-item:hover .legend-item-text{fill:var(--emr-mchart-pie-legend-item-hover-color)}:host ::ng-deep .legend-item-text{fill:var(--emr-mchart-pie-legend-item-color)}:host-context(html.dark){--emr-mchart-pie-legend-item-color: var(--color-neutral-200)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"] }]
|
|
910
|
+
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], valueAccessor: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueAccessor", required: false }] }], dataItemStrokeWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataItemStrokeWidth", required: false }] }], legendContainerWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendContainerWidth", required: false }] }], showDataAnimation: [{ type: i0.Input, args: [{ isSignal: true, alias: "showDataAnimation", required: false }] }], showValueOnSlices: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValueOnSlices", required: false }] }], showLegend: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLegend", required: false }] }], legendOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendOffset", required: false }] }], legendItemHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendItemHeight", required: false }] }], legendItemSymbolSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendItemSymbolSize", required: false }] }], legendItemFontSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendItemFontSize", required: false }] }], legendItemSymbolBorderRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendItemSymbolBorderRadius", required: false }] }], valueFontSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFontSize", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPosition", required: false }] }] } });
|
|
911
|
+
|
|
912
|
+
class MchartTooltipComponent {
|
|
913
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: MchartTooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
914
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.10", type: MchartTooltipComponent, isStandalone: true, selector: "emr-mchart-tooltip", host: { classAttribute: "emr-mchart-tooltip" }, exportAs: ["emrMchartTooltip"], ngImport: i0, template: "<div class=\"title\">\r\n <ng-content select=\"emr-mchart-tooltip-title\"></ng-content>\r\n</div>\r\n<div class=\"body\">\r\n <ng-content select=\"emr-mchart-tooltip-body\"></ng-content>\r\n</div>\r\n<ng-content></ng-content>\r\n", styles: [":host{display:block;width:max-content;box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a;border-radius:.5rem;background:#fff;font-size:var(--text-xs);overflow:hidden}:host .title:empty{display:none}:host .body:empty{display:none}:host-context(html.dark){background:var(--color-tertiary-200);color:var(--color-neutral-800)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"] });
|
|
915
|
+
}
|
|
916
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: MchartTooltipComponent, decorators: [{
|
|
917
|
+
type: Component,
|
|
918
|
+
args: [{ selector: 'emr-mchart-tooltip', exportAs: 'emrMchartTooltip', host: {
|
|
919
|
+
'class': 'emr-mchart-tooltip'
|
|
920
|
+
}, template: "<div class=\"title\">\r\n <ng-content select=\"emr-mchart-tooltip-title\"></ng-content>\r\n</div>\r\n<div class=\"body\">\r\n <ng-content select=\"emr-mchart-tooltip-body\"></ng-content>\r\n</div>\r\n<ng-content></ng-content>\r\n", styles: [":host{display:block;width:max-content;box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a;border-radius:.5rem;background:#fff;font-size:var(--text-xs);overflow:hidden}:host .title:empty{display:none}:host .body:empty{display:none}:host-context(html.dark){background:var(--color-tertiary-200);color:var(--color-neutral-800)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"] }]
|
|
921
|
+
}] });
|
|
922
|
+
|
|
923
|
+
class MchartTooltipTitleComponent {
|
|
924
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: MchartTooltipTitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
925
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.10", type: MchartTooltipTitleComponent, isStandalone: true, selector: "emr-mchart-tooltip-title", host: { classAttribute: "emr-mchart-tooltip-title" }, exportAs: ["emrMchartTooltipTitle"], ngImport: i0, template: "<ng-content></ng-content>\r\n", styles: [":host{display:block;background:var(--color-neutral-200);padding:calc(var(--spacing) * 1.5) calc(var(--spacing) * 2);font-weight:500}:host-context(html.dark){background:var(--color-neutral-300);color:var(--color-neutral-900)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"] });
|
|
926
|
+
}
|
|
927
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: MchartTooltipTitleComponent, decorators: [{
|
|
928
|
+
type: Component,
|
|
929
|
+
args: [{ selector: 'emr-mchart-tooltip-title', exportAs: 'emrMchartTooltipTitle', host: {
|
|
930
|
+
'class': 'emr-mchart-tooltip-title'
|
|
931
|
+
}, template: "<ng-content></ng-content>\r\n", styles: [":host{display:block;background:var(--color-neutral-200);padding:calc(var(--spacing) * 1.5) calc(var(--spacing) * 2);font-weight:500}:host-context(html.dark){background:var(--color-neutral-300);color:var(--color-neutral-900)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"] }]
|
|
932
|
+
}] });
|
|
933
|
+
|
|
934
|
+
class MchartTooltipBodyComponent {
|
|
935
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: MchartTooltipBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
936
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.10", type: MchartTooltipBodyComponent, isStandalone: true, selector: "emr-mchart-tooltip-body", host: { classAttribute: "emr-mchart-tooltip-body" }, exportAs: ["emrMchartTooltipBody"], ngImport: i0, template: "<ng-content></ng-content>\r\n", styles: [":host{display:block;padding:calc(var(--spacing) * 1.5) calc(var(--spacing) * 2)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"] });
|
|
937
|
+
}
|
|
938
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: MchartTooltipBodyComponent, decorators: [{
|
|
939
|
+
type: Component,
|
|
940
|
+
args: [{ selector: 'emr-mchart-tooltip-body', exportAs: 'emrMchartTooltipBody', host: {
|
|
941
|
+
'class': 'emr-mchart-tooltip-body'
|
|
942
|
+
}, template: "<ng-content></ng-content>\r\n", styles: [":host{display:block;padding:calc(var(--spacing) * 1.5) calc(var(--spacing) * 2)}\n/*! tailwindcss v4.1.14 | MIT License | https://tailwindcss.com */\n"] }]
|
|
943
|
+
}] });
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* Generated bundle index. Do not edit.
|
|
947
|
+
*/
|
|
948
|
+
|
|
949
|
+
export { MchartBarComponent, MchartLineComponent, MchartPieComponent, MchartTooltipBodyComponent, MchartTooltipComponent, MchartTooltipTitleComponent };
|
|
950
|
+
//# sourceMappingURL=elementar-rt-components-micro-chart.mjs.map
|