ngwr 16.3.0 → 16.5.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/carousel/styles/_index.scss +53 -1
- package/charts/bar-chart/styles/_index.scss +494 -305
- package/charts/boxplot-chart/styles/_index.scss +114 -48
- package/charts/bullet-chart/styles/_index.scss +113 -42
- package/charts/calendar-heatmap/styles/_index.scss +111 -20
- package/charts/candlestick-chart/styles/_index.scss +61 -26
- package/charts/chart-legend/styles/_index.scss +119 -1
- package/charts/core/styles/_index.scss +201 -5
- package/charts/donut-chart/styles/_index.scss +76 -21
- package/charts/funnel-chart/styles/_index.scss +66 -38
- package/charts/gauge/styles/_index.scss +12 -1
- package/charts/heatmap-chart/styles/_index.scss +90 -53
- package/charts/line-chart/styles/_index.scss +143 -139
- package/charts/meter-group/styles/_index.scss +87 -25
- package/charts/radar-chart/styles/_index.scss +82 -40
- package/charts/scatter-chart/styles/_index.scss +117 -44
- package/charts/sparkline/styles/_index.scss +7 -1
- package/charts/treemap-chart/styles/_index.scss +94 -42
- package/charts/waterfall-chart/styles/_index.scss +150 -87
- package/color-picker/styles/_index.scss +7 -3
- package/copy-value/styles/_index.scss +21 -2
- package/date-stamp/styles/_index.scss +2 -1
- package/dialog/styles/_index.scss +6 -0
- package/drawer/styles/_index.scss +5 -1
- package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-carousel-testing.mjs +27 -1
- package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
- package/fesm2022/ngwr-carousel.mjs +86 -4
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +56 -25
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart-testing.mjs +16 -14
- package/fesm2022/ngwr-charts-bar-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart.mjs +399 -141
- package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs +19 -5
- package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-boxplot-chart.mjs +250 -56
- package/fesm2022/ngwr-charts-boxplot-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bullet-chart.mjs +118 -18
- package/fesm2022/ngwr-charts-bullet-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs +266 -46
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
- package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs +21 -10
- package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-candlestick-chart.mjs +319 -72
- package/fesm2022/ngwr-charts-candlestick-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-chart-legend.mjs +211 -9
- package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
- package/fesm2022/ngwr-charts-core.mjs +299 -18
- package/fesm2022/ngwr-charts-core.mjs.map +1 -1
- package/fesm2022/ngwr-charts-donut-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-donut-chart.mjs +206 -27
- package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-funnel-chart-testing.mjs +4 -4
- package/fesm2022/ngwr-charts-funnel-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-funnel-chart.mjs +113 -10
- package/fesm2022/ngwr-charts-funnel-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-gauge-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-gauge.mjs +98 -12
- package/fesm2022/ngwr-charts-gauge.mjs.map +1 -1
- package/fesm2022/ngwr-charts-heatmap-chart.mjs +226 -31
- package/fesm2022/ngwr-charts-heatmap-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-line-chart-testing.mjs +16 -4
- package/fesm2022/ngwr-charts-line-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-line-chart.mjs +407 -172
- package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-meter-group-testing.mjs +4 -4
- package/fesm2022/ngwr-charts-meter-group-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-meter-group.mjs +223 -31
- package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-charts-radar-chart-testing.mjs +2 -1
- package/fesm2022/ngwr-charts-radar-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-radar-chart.mjs +255 -66
- package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-scatter-chart-testing.mjs +39 -18
- package/fesm2022/ngwr-charts-scatter-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-scatter-chart.mjs +431 -53
- package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-sparkline.mjs +19 -8
- package/fesm2022/ngwr-charts-sparkline.mjs.map +1 -1
- package/fesm2022/ngwr-charts-treemap-chart.mjs +253 -44
- package/fesm2022/ngwr-charts-treemap-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs +15 -7
- package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-waterfall-chart.mjs +151 -23
- package/fesm2022/ngwr-charts-waterfall-chart.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +44 -4
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +60 -17
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-copy-value-testing.mjs +5 -1
- package/fesm2022/ngwr-copy-value-testing.mjs.map +1 -1
- package/fesm2022/ngwr-copy-value.mjs +38 -2
- package/fesm2022/ngwr-copy-value.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +56 -8
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-dialog.mjs +13 -5
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +19 -3
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +49 -6
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +1 -0
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +7 -3
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-graph-testing.mjs +27 -0
- package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +643 -14
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ar.mjs +13 -4
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +13 -4
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +13 -4
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +13 -4
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +13 -4
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +13 -4
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +13 -4
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +13 -4
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +13 -4
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +13 -4
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +13 -4
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +13 -4
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +13 -4
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +13 -4
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +13 -4
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +13 -4
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +13 -4
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +13 -4
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +13 -4
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +13 -4
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +13 -4
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +13 -4
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +22 -5
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +2 -2
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +21 -2
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +1 -0
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm-testing.mjs +4 -1
- package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +41 -5
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +67 -12
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-schema-form.mjs +3 -0
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +100 -3
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-sortable-list.mjs +2 -2
- package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
- package/fesm2022/ngwr-table-testing.mjs +71 -3
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +173 -11
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tour-testing.mjs +13 -1
- package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +25 -16
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +52 -8
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-utils.mjs +64 -1
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-window.mjs +16 -9
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/graph/styles/_index.scss +87 -0
- package/i18n/ar.json +13 -4
- package/i18n/cs.json +13 -4
- package/i18n/de.json +13 -4
- package/i18n/en.json +13 -4
- package/i18n/es.json +13 -4
- package/i18n/fr.json +13 -4
- package/i18n/he.json +13 -4
- package/i18n/hi.json +13 -4
- package/i18n/id.json +13 -4
- package/i18n/it.json +13 -4
- package/i18n/ja.json +13 -4
- package/i18n/ko.json +13 -4
- package/i18n/nl.json +13 -4
- package/i18n/pl.json +13 -4
- package/i18n/pt.json +13 -4
- package/i18n/ru.json +13 -4
- package/i18n/sv.json +13 -4
- package/i18n/tr.json +13 -4
- package/i18n/uk.json +13 -4
- package/i18n/vi.json +13 -4
- package/i18n/zh-TW.json +13 -4
- package/i18n/zh.json +13 -4
- package/llms-full.txt +12 -12
- package/llms.txt +64 -27
- package/package.json +1 -1
- package/popconfirm/styles/_index.scss +6 -0
- package/popover/styles/_index.scss +24 -13
- package/schematics/collection.json +5 -0
- package/schematics/eject/index.js +158 -0
- package/schematics/eject/schema.js +8 -0
- package/schematics/eject/schema.json +24 -0
- package/schematics/eject/source.js +295 -0
- package/schematics/use/symbol-map.json +2 -0
- package/select/styles/_index.scss +13 -0
- package/skills/ngwr/SKILL.md +30 -3
- package/skills/ngwr/references/catalog.md +2 -2
- package/table/styles/_index.scss +24 -0
- package/theme/styles/_focus.scss +11 -1
- package/tour/styles/_index.scss +6 -0
- package/types/ngwr-carousel-testing.d.ts +29 -6
- package/types/ngwr-carousel.d.ts +52 -5
- package/types/ngwr-cascader-testing.d.ts +4 -3
- package/types/ngwr-cascader.d.ts +29 -7
- package/types/ngwr-charts-bar-chart-testing.d.ts +15 -13
- package/types/ngwr-charts-bar-chart.d.ts +220 -48
- package/types/ngwr-charts-boxplot-chart-testing.d.ts +9 -2
- package/types/ngwr-charts-boxplot-chart.d.ts +110 -19
- package/types/ngwr-charts-bullet-chart.d.ts +72 -12
- package/types/ngwr-charts-calendar-heatmap.d.ts +119 -15
- package/types/ngwr-charts-candlestick-chart-testing.d.ts +19 -9
- package/types/ngwr-charts-candlestick-chart.d.ts +195 -62
- package/types/ngwr-charts-chart-legend.d.ts +142 -5
- package/types/ngwr-charts-core.d.ts +259 -21
- package/types/ngwr-charts-donut-chart-testing.d.ts +11 -5
- package/types/ngwr-charts-donut-chart.d.ts +124 -16
- package/types/ngwr-charts-funnel-chart.d.ts +62 -6
- package/types/ngwr-charts-gauge-testing.d.ts +5 -1
- package/types/ngwr-charts-gauge.d.ts +72 -10
- package/types/ngwr-charts-heatmap-chart.d.ts +103 -20
- package/types/ngwr-charts-line-chart-testing.d.ts +16 -2
- package/types/ngwr-charts-line-chart.d.ts +215 -86
- package/types/ngwr-charts-meter-group.d.ts +96 -7
- package/types/ngwr-charts-radar-chart-testing.d.ts +14 -3
- package/types/ngwr-charts-radar-chart.d.ts +148 -28
- package/types/ngwr-charts-scatter-chart-testing.d.ts +22 -10
- package/types/ngwr-charts-scatter-chart.d.ts +188 -18
- package/types/ngwr-charts-sparkline.d.ts +26 -4
- package/types/ngwr-charts-treemap-chart.d.ts +121 -23
- package/types/ngwr-charts-waterfall-chart-testing.d.ts +8 -1
- package/types/ngwr-charts-waterfall-chart.d.ts +108 -21
- package/types/ngwr-color-picker.d.ts +27 -0
- package/types/ngwr-context-menu-testing.d.ts +10 -9
- package/types/ngwr-context-menu.d.ts +19 -0
- package/types/ngwr-copy-value.d.ts +8 -0
- package/types/ngwr-date-picker.d.ts +34 -2
- package/types/ngwr-dialog.d.ts +30 -10
- package/types/ngwr-drawer.d.ts +32 -1
- package/types/ngwr-dropdown-testing.d.ts +8 -5
- package/types/ngwr-dropdown.d.ts +31 -6
- package/types/ngwr-file-upload.d.ts +8 -2
- package/types/ngwr-graph-testing.d.ts +28 -0
- package/types/ngwr-graph.d.ts +263 -91
- package/types/ngwr-lightbox.d.ts +15 -0
- package/types/ngwr-overlay.d.ts +16 -1
- package/types/ngwr-popconfirm-testing.d.ts +11 -2
- package/types/ngwr-popconfirm.d.ts +28 -1
- package/types/ngwr-popover.d.ts +59 -9
- package/types/ngwr-select.d.ts +37 -0
- package/types/ngwr-table-testing.d.ts +52 -1
- package/types/ngwr-table.d.ts +102 -10
- package/types/ngwr-tour-testing.d.ts +10 -0
- package/types/ngwr-tour.d.ts +32 -4
- package/types/ngwr-tree-testing.d.ts +1 -2
- package/types/ngwr-tree.d.ts +35 -2
- package/types/ngwr-utils.d.ts +79 -1
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window.d.ts +14 -11
- package/window/styles/_index.scss +5 -10
package/fesm2022/ngwr-graph.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { Component, Directive, LOCALE_ID, TemplateRef, ViewEncapsulation, computed, contentChild, effect, inject, input, isDevMode, linkedSignal, output, signal } from "@angular/core";
|
|
3
|
-
import { NgTemplateOutlet } from "@angular/common";
|
|
2
|
+
import { Component, DestroyRef, Directive, LOCALE_ID, PLATFORM_ID, TemplateRef, ViewEncapsulation, afterNextRender, afterRenderEffect, booleanAttribute, computed, contentChild, effect, inject, input, isDevMode, linkedSignal, model, output, signal, untracked, viewChild } from "@angular/core";
|
|
3
|
+
import { NgTemplateOutlet, isPlatformBrowser } from "@angular/common";
|
|
4
4
|
import { wrCheckStyles, wrNumAttr } from "ngwr/utils";
|
|
5
5
|
import { WrI18n, useI18nFormatter, useI18nText } from "ngwr/i18n";
|
|
6
|
+
import { WrPlatform } from "ngwr/platform";
|
|
6
7
|
import { Directionality } from "@angular/cdk/bidi";
|
|
7
8
|
/**
|
|
8
9
|
* @license
|
|
@@ -554,10 +555,96 @@ var WrLayeredGraphLayout = class extends WrGraphLayout {
|
|
|
554
555
|
* Use of this source code is governed by an MIT-style license that can be
|
|
555
556
|
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
556
557
|
*/
|
|
558
|
+
const KEEP_VISIBLE = 48;
|
|
559
|
+
function clampAxis(offset, origin, extent, room) {
|
|
560
|
+
const keep = Math.min(KEEP_VISIBLE, extent, room);
|
|
561
|
+
const min = keep - extent - origin;
|
|
562
|
+
const max = room - keep - origin;
|
|
563
|
+
return Math.min(max, Math.max(min, offset));
|
|
564
|
+
}
|
|
565
|
+
function scrollAxis(offset, origin, extent, start, end, by) {
|
|
566
|
+
const from = origin + offset;
|
|
567
|
+
if (by > 0 && from < start) return offset + Math.min(by, start - from);
|
|
568
|
+
if (by < 0 && from + extent > end) return offset + Math.max(by, end - from - extent);
|
|
569
|
+
return offset;
|
|
570
|
+
}
|
|
571
|
+
const IDENTITY = {
|
|
572
|
+
x: 0,
|
|
573
|
+
y: 0,
|
|
574
|
+
k: 1
|
|
575
|
+
};
|
|
576
|
+
function roundZoom(value) {
|
|
577
|
+
return Math.round(value * 1e4) / 1e4;
|
|
578
|
+
}
|
|
579
|
+
function clampZoom(value, min, max) {
|
|
580
|
+
return roundZoom(Math.min(max, Math.max(min, Number.isFinite(value) && value > 0 ? value : 1)));
|
|
581
|
+
}
|
|
582
|
+
function zoomAround(from, k, px, py, frame) {
|
|
583
|
+
const ratio = k / from.k;
|
|
584
|
+
const dx = px - frame.originX;
|
|
585
|
+
const dy = py - frame.originY;
|
|
586
|
+
return {
|
|
587
|
+
k,
|
|
588
|
+
x: dx - (dx - from.x) * ratio,
|
|
589
|
+
y: dy - (dy - from.y) * ratio
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
function clampPan(at, frame, width, height) {
|
|
593
|
+
if (frame.width <= 0 || frame.height <= 0) return at;
|
|
594
|
+
return {
|
|
595
|
+
k: at.k,
|
|
596
|
+
x: clampAxis(at.x, frame.originX, width * at.k, frame.width),
|
|
597
|
+
y: clampAxis(at.y, frame.originY, height * at.k, frame.height)
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
function scrollPan(at, frame, insets, width, height, dx, dy) {
|
|
601
|
+
if (frame.width <= 0 || frame.height <= 0) return at;
|
|
602
|
+
return {
|
|
603
|
+
k: at.k,
|
|
604
|
+
x: scrollAxis(at.x, frame.originX, width * at.k, insets.left, frame.width - insets.right, dx),
|
|
605
|
+
y: scrollAxis(at.y, frame.originY, height * at.k, insets.top, frame.height - insets.bottom, dy)
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
function fitTransform(frame, insets, width, height, min, max) {
|
|
609
|
+
const roomX = Math.max(0, frame.width - insets.left - insets.right);
|
|
610
|
+
const roomY = Math.max(0, frame.height - insets.top - insets.bottom);
|
|
611
|
+
const k = clampZoom(Math.min(1, width > 0 ? roomX / width : 1, height > 0 ? roomY / height : 1), min, max);
|
|
612
|
+
return {
|
|
613
|
+
k,
|
|
614
|
+
x: insets.left + (roomX - width * k) / 2 - frame.originX,
|
|
615
|
+
y: insets.top + (roomY - height * k) / 2 - frame.originY
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* @license
|
|
620
|
+
*
|
|
621
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
622
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
623
|
+
*/
|
|
557
624
|
const DEFAULT_NODE_WIDTH = 160;
|
|
558
625
|
const DEFAULT_NODE_HEIGHT = 48;
|
|
559
626
|
const ARROW_SIZE = 6;
|
|
627
|
+
const DEFAULT_MIN_ZOOM = .25;
|
|
628
|
+
const DEFAULT_MAX_ZOOM = 4;
|
|
629
|
+
const ZOOM_STEP = 1.25;
|
|
630
|
+
const PAN_STEP = 40;
|
|
631
|
+
const DRAG_THRESHOLD = 3;
|
|
632
|
+
const WHEEL_RATE = .01;
|
|
633
|
+
const WHEEL_MAX = 24;
|
|
634
|
+
const WHEEL_LINE = 16;
|
|
635
|
+
const INTERACTIVE = "a[href], button, input, select, textarea, summary, [tabindex], [contenteditable], [draggable=\"true\"]";
|
|
560
636
|
let graphUid = 0;
|
|
637
|
+
const NO_FRAME = {
|
|
638
|
+
left: 0,
|
|
639
|
+
top: 0,
|
|
640
|
+
width: 0,
|
|
641
|
+
height: 0,
|
|
642
|
+
originX: 0,
|
|
643
|
+
originY: 0
|
|
644
|
+
};
|
|
645
|
+
function sameTransform(a, b) {
|
|
646
|
+
return a.x === b.x && a.y === b.y && a.k === b.k;
|
|
647
|
+
}
|
|
561
648
|
function isSize(value) {
|
|
562
649
|
return typeof value === "number" && Number.isFinite(value) && value > 0;
|
|
563
650
|
}
|
|
@@ -645,11 +732,36 @@ var WrGraph = class WrGraph {
|
|
|
645
732
|
transform: wrNumAttr(48)
|
|
646
733
|
});
|
|
647
734
|
ariaLabel = input(null, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
735
|
+
zoomable = input(false, {
|
|
736
|
+
...ngDevMode ? { debugName: "zoomable" } : /* istanbul ignore next */ {},
|
|
737
|
+
transform: booleanAttribute
|
|
738
|
+
});
|
|
739
|
+
wheelZoom = input(false, {
|
|
740
|
+
...ngDevMode ? { debugName: "wheelZoom" } : /* istanbul ignore next */ {},
|
|
741
|
+
transform: booleanAttribute
|
|
742
|
+
});
|
|
743
|
+
zoom = model(1, ...ngDevMode ? [{ debugName: "zoom" }] : /* istanbul ignore next */ []);
|
|
744
|
+
minZoom = input(DEFAULT_MIN_ZOOM, {
|
|
745
|
+
...ngDevMode ? { debugName: "minZoom" } : /* istanbul ignore next */ {},
|
|
746
|
+
transform: wrNumAttr(DEFAULT_MIN_ZOOM)
|
|
747
|
+
});
|
|
748
|
+
maxZoom = input(DEFAULT_MAX_ZOOM, {
|
|
749
|
+
...ngDevMode ? { debugName: "maxZoom" } : /* istanbul ignore next */ {},
|
|
750
|
+
transform: wrNumAttr(DEFAULT_MAX_ZOOM)
|
|
751
|
+
});
|
|
752
|
+
zoomInLabel = input(null, ...ngDevMode ? [{ debugName: "zoomInLabel" }] : /* istanbul ignore next */ []);
|
|
753
|
+
zoomOutLabel = input(null, ...ngDevMode ? [{ debugName: "zoomOutLabel" }] : /* istanbul ignore next */ []);
|
|
754
|
+
fitLabel = input(null, ...ngDevMode ? [{ debugName: "fitLabel" }] : /* istanbul ignore next */ []);
|
|
648
755
|
layoutError = output();
|
|
649
756
|
label = useI18nText(this.ariaLabel, "graph.label", "Graph");
|
|
650
757
|
parentsText = useI18nFormatter("graph.parents", "Parents: {{names}}.");
|
|
651
758
|
childrenText = useI18nFormatter("graph.children", "Children: {{names}}.");
|
|
759
|
+
zoomInText = useI18nText(this.zoomInLabel, "graph.zoomIn", "Zoom in");
|
|
760
|
+
zoomOutText = useI18nText(this.zoomOutLabel, "graph.zoomOut", "Zoom out");
|
|
761
|
+
fitText = useI18nText(this.fitLabel, "graph.fit", "Fit to view");
|
|
652
762
|
nodeTemplate = contentChild(WrGraphNodeTemplate, ...ngDevMode ? [{ debugName: "nodeTemplate" }] : /* istanbul ignore next */ []);
|
|
763
|
+
viewportRef = viewChild("viewport", ...ngDevMode ? [{ debugName: "viewportRef" }] : /* istanbul ignore next */ []);
|
|
764
|
+
stageRef = viewChild("stage", ...ngDevMode ? [{ debugName: "stageRef" }] : /* istanbul ignore next */ []);
|
|
653
765
|
markerId = `wr-graph-${graphUid++}-arrow`;
|
|
654
766
|
markerUrl = `url(#${this.markerId})`;
|
|
655
767
|
arrowSize = ARROW_SIZE;
|
|
@@ -657,6 +769,8 @@ var WrGraph = class WrGraph {
|
|
|
657
769
|
dir = inject(Directionality, { optional: true });
|
|
658
770
|
i18n = inject(WrI18n, { optional: true });
|
|
659
771
|
localeId = inject(LOCALE_ID);
|
|
772
|
+
isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
773
|
+
reducedMotion = inject(WrPlatform).prefersReducedMotion;
|
|
660
774
|
isRtl = computed(() => this.dir?.valueSignal() === "rtl", ...ngDevMode ? [{ debugName: "isRtl" }] : /* istanbul ignore next */ []);
|
|
661
775
|
locale = computed(() => this.i18n?.locale() ?? this.localeId, ...ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []);
|
|
662
776
|
defaultSize = computed(() => {
|
|
@@ -748,18 +862,25 @@ var WrGraph = class WrGraph {
|
|
|
748
862
|
const end = points[points.length - 1];
|
|
749
863
|
if (loop) {
|
|
750
864
|
const right = Math.max(...points.map((point) => point.x));
|
|
751
|
-
const
|
|
865
|
+
const head = Math.min(ARROW_SIZE, right - end.x);
|
|
866
|
+
const lead = Math.min(ARROW_SIZE, (right - end.x - head) / 2);
|
|
752
867
|
const outer = x(right);
|
|
753
|
-
|
|
868
|
+
const base = x(end.x + head);
|
|
869
|
+
return `M${at(start)} C${outer} ${px(start.y)} ${outer} ${px(end.y)} ${x(end.x + head + lead)} ${px(end.y)} L${base} ${px(end.y)}`;
|
|
754
870
|
}
|
|
755
871
|
const stretches = points.slice(1).map((to, i) => {
|
|
756
872
|
const from = points[i];
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
873
|
+
if (i < points.length - 2) {
|
|
874
|
+
const middle = px((from.y + to.y) / 2);
|
|
875
|
+
return `C${x(from.x)} ${middle} ${x(to.x)} ${middle} ${at(to)}`;
|
|
876
|
+
}
|
|
877
|
+
const run = Math.abs(to.y - from.y);
|
|
878
|
+
const head = Math.min(ARROW_SIZE, run);
|
|
879
|
+
const lead = Math.min(ARROW_SIZE, (run - head) / 2);
|
|
880
|
+
const back = to.y < from.y ? 1 : -1;
|
|
881
|
+
const toY = to.y + back * (head + lead);
|
|
760
882
|
const middle = px((from.y + toY) / 2);
|
|
761
|
-
|
|
762
|
-
return last ? `${bend} L${at(to)}` : bend;
|
|
883
|
+
return `C${x(from.x)} ${middle} ${x(to.x)} ${middle} ${x(to.x)} ${px(toY)} L${x(to.x)} ${px(to.y + back * head)}`;
|
|
763
884
|
});
|
|
764
885
|
return [`M${at(start)}`, ...stretches].join(" ");
|
|
765
886
|
};
|
|
@@ -780,6 +901,50 @@ var WrGraph = class WrGraph {
|
|
|
780
901
|
}))
|
|
781
902
|
};
|
|
782
903
|
}, ...ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []);
|
|
904
|
+
bounds = computed(() => {
|
|
905
|
+
const min = isSize(this.minZoom()) ? this.minZoom() : DEFAULT_MIN_ZOOM;
|
|
906
|
+
const max = isSize(this.maxZoom()) ? this.maxZoom() : DEFAULT_MAX_ZOOM;
|
|
907
|
+
return {
|
|
908
|
+
min,
|
|
909
|
+
max: Math.max(min, max)
|
|
910
|
+
};
|
|
911
|
+
}, ...ngDevMode ? [{ debugName: "bounds" }] : /* istanbul ignore next */ []);
|
|
912
|
+
at = signal(IDENTITY, ...ngDevMode ? [{ debugName: "at" }] : /* istanbul ignore next */ []);
|
|
913
|
+
pan = computed(() => {
|
|
914
|
+
const { x, y } = this.at();
|
|
915
|
+
return {
|
|
916
|
+
x,
|
|
917
|
+
y
|
|
918
|
+
};
|
|
919
|
+
}, {
|
|
920
|
+
...ngDevMode ? { debugName: "pan" } : /* istanbul ignore next */ {},
|
|
921
|
+
equal: (a, b) => a.x === b.x && a.y === b.y
|
|
922
|
+
});
|
|
923
|
+
size = computed(() => {
|
|
924
|
+
const { width, height } = this.view();
|
|
925
|
+
return {
|
|
926
|
+
width,
|
|
927
|
+
height
|
|
928
|
+
};
|
|
929
|
+
}, {
|
|
930
|
+
...ngDevMode ? { debugName: "size" } : /* istanbul ignore next */ {},
|
|
931
|
+
equal: (a, b) => a.width === b.width && a.height === b.height
|
|
932
|
+
});
|
|
933
|
+
stageTransform = computed(() => {
|
|
934
|
+
const at = this.at();
|
|
935
|
+
if (!this.zoomable() || sameTransform(at, IDENTITY)) return null;
|
|
936
|
+
return `translate(${px(at.x)}px, ${px(at.y)}px) scale(${at.k})`;
|
|
937
|
+
}, ...ngDevMode ? [{ debugName: "stageTransform" }] : /* istanbul ignore next */ []);
|
|
938
|
+
atMinZoom = computed(() => this.at().k <= this.bounds().min, ...ngDevMode ? [{ debugName: "atMinZoom" }] : /* istanbul ignore next */ []);
|
|
939
|
+
atMaxZoom = computed(() => this.at().k >= this.bounds().max, ...ngDevMode ? [{ debugName: "atMaxZoom" }] : /* istanbul ignore next */ []);
|
|
940
|
+
panning = signal(false, ...ngDevMode ? [{ debugName: "panning" }] : /* istanbul ignore next */ []);
|
|
941
|
+
animated = signal(false, ...ngDevMode ? [{ debugName: "animated" }] : /* istanbul ignore next */ []);
|
|
942
|
+
moved = false;
|
|
943
|
+
queued = null;
|
|
944
|
+
frameId = null;
|
|
945
|
+
pointers = /* @__PURE__ */ new Map();
|
|
946
|
+
dragging = false;
|
|
947
|
+
pinchFrom = null;
|
|
783
948
|
relations = computed(() => {
|
|
784
949
|
const { nodes } = this.placed();
|
|
785
950
|
const list = listFormat(this.locale());
|
|
@@ -835,6 +1000,64 @@ var WrGraph = class WrGraph {
|
|
|
835
1000
|
this.layoutError.emit(error);
|
|
836
1001
|
});
|
|
837
1002
|
});
|
|
1003
|
+
effect(() => {
|
|
1004
|
+
const zoom = this.zoom();
|
|
1005
|
+
const { min, max } = this.bounds();
|
|
1006
|
+
if (!this.zoomable()) return;
|
|
1007
|
+
untracked(() => {
|
|
1008
|
+
const from = this.current();
|
|
1009
|
+
const k = clampZoom(zoom, min, max);
|
|
1010
|
+
if (k !== from.k) {
|
|
1011
|
+
const frame = this.frame();
|
|
1012
|
+
this.moved = true;
|
|
1013
|
+
this.commit(this.bounded(zoomAround(from, k, frame.width / 2, frame.height / 2, frame), frame));
|
|
1014
|
+
} else if (k !== zoom) this.zoom.set(k);
|
|
1015
|
+
});
|
|
1016
|
+
});
|
|
1017
|
+
effect((onCleanup) => {
|
|
1018
|
+
const viewport = this.viewportRef()?.nativeElement;
|
|
1019
|
+
if (!this.isBrowser || !viewport || !this.zoomable()) return;
|
|
1020
|
+
const controller = new AbortController();
|
|
1021
|
+
const { signal: stop } = controller;
|
|
1022
|
+
viewport.addEventListener("wheel", (event) => this.onWheel(event), {
|
|
1023
|
+
signal: stop,
|
|
1024
|
+
passive: false
|
|
1025
|
+
});
|
|
1026
|
+
viewport.addEventListener("keydown", (event) => this.onKeydown(event), { signal: stop });
|
|
1027
|
+
viewport.addEventListener("pointerdown", (event) => this.onPointerDown(event, viewport), { signal: stop });
|
|
1028
|
+
viewport.addEventListener("pointermove", (event) => this.onPointerMove(event, viewport), { signal: stop });
|
|
1029
|
+
viewport.addEventListener("pointerup", (event) => this.onPointerEnd(event, viewport), { signal: stop });
|
|
1030
|
+
viewport.addEventListener("pointercancel", (event) => this.onPointerEnd(event, viewport), { signal: stop });
|
|
1031
|
+
if ("GestureEvent" in window) {
|
|
1032
|
+
const on = (type, handler) => viewport.addEventListener(type, (event) => handler(event), { signal: stop });
|
|
1033
|
+
on("gesturestart", (event) => this.onGestureStart(event));
|
|
1034
|
+
on("gesturechange", (event) => this.onGestureChange(event));
|
|
1035
|
+
on("gestureend", (event) => this.onGestureEnd(event));
|
|
1036
|
+
}
|
|
1037
|
+
onCleanup(() => {
|
|
1038
|
+
controller.abort();
|
|
1039
|
+
this.pointers.clear();
|
|
1040
|
+
this.dragging = false;
|
|
1041
|
+
this.pinchFrom = null;
|
|
1042
|
+
untracked(() => this.panning.set(false));
|
|
1043
|
+
});
|
|
1044
|
+
});
|
|
1045
|
+
afterRenderEffect(() => {
|
|
1046
|
+
this.size();
|
|
1047
|
+
if (!this.zoomable()) return;
|
|
1048
|
+
untracked(() => this.settle());
|
|
1049
|
+
});
|
|
1050
|
+
const destroyRef = inject(DestroyRef);
|
|
1051
|
+
afterNextRender(() => {
|
|
1052
|
+
const viewport = this.viewportRef()?.nativeElement;
|
|
1053
|
+
if (!viewport || typeof ResizeObserver === "undefined") return;
|
|
1054
|
+
const observer = new ResizeObserver(() => {
|
|
1055
|
+
if (this.zoomable()) this.settle();
|
|
1056
|
+
});
|
|
1057
|
+
observer.observe(viewport);
|
|
1058
|
+
destroyRef.onDestroy(() => observer.disconnect());
|
|
1059
|
+
});
|
|
1060
|
+
destroyRef.onDestroy(() => this.cancelFrame());
|
|
838
1061
|
if (isDevMode()) {
|
|
839
1062
|
effect(() => {
|
|
840
1063
|
const graph = this.prepared();
|
|
@@ -856,6 +1079,259 @@ var WrGraph = class WrGraph {
|
|
|
856
1079
|
});
|
|
857
1080
|
}
|
|
858
1081
|
}
|
|
1082
|
+
fit() {
|
|
1083
|
+
this.fitView(false);
|
|
1084
|
+
}
|
|
1085
|
+
resetView() {
|
|
1086
|
+
if (!this.zoomable()) return;
|
|
1087
|
+
this.moved = true;
|
|
1088
|
+
this.commit(IDENTITY);
|
|
1089
|
+
}
|
|
1090
|
+
zoomIn() {
|
|
1091
|
+
this.zoomBy(ZOOM_STEP);
|
|
1092
|
+
}
|
|
1093
|
+
zoomOut() {
|
|
1094
|
+
this.zoomBy(1 / ZOOM_STEP);
|
|
1095
|
+
}
|
|
1096
|
+
fitView(animate) {
|
|
1097
|
+
if (!this.zoomable()) return;
|
|
1098
|
+
this.moved = false;
|
|
1099
|
+
const fitted = this.fitted();
|
|
1100
|
+
if (fitted) this.commit(fitted, animate);
|
|
1101
|
+
}
|
|
1102
|
+
frame() {
|
|
1103
|
+
const viewport = this.viewportRef()?.nativeElement;
|
|
1104
|
+
const stage = this.stageRef()?.nativeElement;
|
|
1105
|
+
if (!this.isBrowser || !viewport || !stage) return NO_FRAME;
|
|
1106
|
+
const rect = viewport.getBoundingClientRect();
|
|
1107
|
+
return {
|
|
1108
|
+
left: rect.left,
|
|
1109
|
+
top: rect.top,
|
|
1110
|
+
width: rect.width,
|
|
1111
|
+
height: rect.height,
|
|
1112
|
+
originX: viewport.clientLeft + stage.offsetLeft,
|
|
1113
|
+
originY: viewport.clientTop + stage.offsetTop
|
|
1114
|
+
};
|
|
1115
|
+
}
|
|
1116
|
+
fitted() {
|
|
1117
|
+
const viewport = this.viewportRef()?.nativeElement;
|
|
1118
|
+
const frame = this.frame();
|
|
1119
|
+
const { width, height } = this.size();
|
|
1120
|
+
if (!viewport || !frame.width || !frame.height || !width || !height) return null;
|
|
1121
|
+
const { min, max } = this.bounds();
|
|
1122
|
+
return fitTransform(frame, this.insets(viewport), width, height, min, max);
|
|
1123
|
+
}
|
|
1124
|
+
insets(viewport) {
|
|
1125
|
+
const style = getComputedStyle(viewport);
|
|
1126
|
+
const inset = (value) => Number.parseFloat(value) || 0;
|
|
1127
|
+
return {
|
|
1128
|
+
top: inset(style.paddingTop),
|
|
1129
|
+
right: inset(style.paddingRight),
|
|
1130
|
+
bottom: inset(style.paddingBottom),
|
|
1131
|
+
left: inset(style.paddingLeft)
|
|
1132
|
+
};
|
|
1133
|
+
}
|
|
1134
|
+
settle() {
|
|
1135
|
+
if (!this.moved) {
|
|
1136
|
+
const fitted = this.fitted();
|
|
1137
|
+
if (fitted) this.commit(fitted);
|
|
1138
|
+
return;
|
|
1139
|
+
}
|
|
1140
|
+
this.commit(this.bounded(this.current(), this.frame()));
|
|
1141
|
+
}
|
|
1142
|
+
current() {
|
|
1143
|
+
return this.queued ?? this.at();
|
|
1144
|
+
}
|
|
1145
|
+
bounded(at, frame) {
|
|
1146
|
+
const { width, height } = this.size();
|
|
1147
|
+
return clampPan(at, frame, width, height);
|
|
1148
|
+
}
|
|
1149
|
+
commit(next, animate = false) {
|
|
1150
|
+
this.cancelFrame();
|
|
1151
|
+
if (sameTransform(next, this.at())) return;
|
|
1152
|
+
this.animated.set(animate && !this.reducedMotion());
|
|
1153
|
+
this.at.set(next);
|
|
1154
|
+
this.zoom.set(next.k);
|
|
1155
|
+
}
|
|
1156
|
+
schedule(next) {
|
|
1157
|
+
if (sameTransform(next, this.current())) return;
|
|
1158
|
+
this.moved = true;
|
|
1159
|
+
this.queued = next;
|
|
1160
|
+
this.frameId ??= requestAnimationFrame(() => {
|
|
1161
|
+
this.frameId = null;
|
|
1162
|
+
const queued = this.queued;
|
|
1163
|
+
if (queued) this.commit(queued);
|
|
1164
|
+
});
|
|
1165
|
+
}
|
|
1166
|
+
cancelFrame() {
|
|
1167
|
+
if (this.frameId !== null) cancelAnimationFrame(this.frameId);
|
|
1168
|
+
this.frameId = null;
|
|
1169
|
+
this.queued = null;
|
|
1170
|
+
}
|
|
1171
|
+
zoomBy(factor) {
|
|
1172
|
+
const frame = this.frame();
|
|
1173
|
+
const from = this.current();
|
|
1174
|
+
const { min, max } = this.bounds();
|
|
1175
|
+
const k = clampZoom(from.k * factor, min, max);
|
|
1176
|
+
if (k === from.k) return;
|
|
1177
|
+
this.moved = true;
|
|
1178
|
+
this.commit(this.bounded(zoomAround(from, k, frame.width / 2, frame.height / 2, frame), frame), true);
|
|
1179
|
+
}
|
|
1180
|
+
panBy(dx, dy) {
|
|
1181
|
+
const from = this.current();
|
|
1182
|
+
const next = this.bounded({
|
|
1183
|
+
k: from.k,
|
|
1184
|
+
x: from.x + dx,
|
|
1185
|
+
y: from.y + dy
|
|
1186
|
+
}, this.frame());
|
|
1187
|
+
if (sameTransform(next, from)) return;
|
|
1188
|
+
this.moved = true;
|
|
1189
|
+
this.commit(next, true);
|
|
1190
|
+
}
|
|
1191
|
+
onWheel(event) {
|
|
1192
|
+
if (!event.ctrlKey && !event.metaKey && !this.wheelZoom()) {
|
|
1193
|
+
this.onWheelPan(event);
|
|
1194
|
+
return;
|
|
1195
|
+
}
|
|
1196
|
+
event.preventDefault();
|
|
1197
|
+
const frame = this.frame();
|
|
1198
|
+
const unit = event.deltaMode === 1 ? WHEEL_LINE : event.deltaMode === 2 ? frame.height : 1;
|
|
1199
|
+
const delta = Math.min(WHEEL_MAX, Math.max(-24, event.deltaY * unit));
|
|
1200
|
+
const from = this.current();
|
|
1201
|
+
const { min, max } = this.bounds();
|
|
1202
|
+
const k = clampZoom(from.k * Math.exp(-delta * WHEEL_RATE), min, max);
|
|
1203
|
+
if (k === from.k) return;
|
|
1204
|
+
this.schedule(this.bounded(zoomAround(from, k, event.clientX - frame.left, event.clientY - frame.top, frame), frame));
|
|
1205
|
+
}
|
|
1206
|
+
onWheelPan(event) {
|
|
1207
|
+
const viewport = this.viewportRef()?.nativeElement;
|
|
1208
|
+
if (!viewport || !event.cancelable) return;
|
|
1209
|
+
const frame = this.frame();
|
|
1210
|
+
const sideways = event.shiftKey && event.deltaX === 0;
|
|
1211
|
+
const unit = (page) => event.deltaMode === 1 ? WHEEL_LINE : event.deltaMode === 2 ? page : 1;
|
|
1212
|
+
const dx = (sideways ? event.deltaY : event.deltaX) * unit(frame.width);
|
|
1213
|
+
const dy = (sideways ? 0 : event.deltaY) * unit(frame.height);
|
|
1214
|
+
const from = this.current();
|
|
1215
|
+
const { width, height } = this.size();
|
|
1216
|
+
const next = scrollPan(from, frame, this.insets(viewport), width, height, -dx, -dy);
|
|
1217
|
+
if (Math.abs(dx) > Math.abs(dy) ? next.x === from.x : next.y === from.y) return;
|
|
1218
|
+
event.preventDefault();
|
|
1219
|
+
this.schedule(next);
|
|
1220
|
+
}
|
|
1221
|
+
onGestureStart(event) {
|
|
1222
|
+
event.preventDefault();
|
|
1223
|
+
this.pinchFrom = this.pointers.size ? null : this.current().k;
|
|
1224
|
+
}
|
|
1225
|
+
onGestureChange(event) {
|
|
1226
|
+
event.preventDefault();
|
|
1227
|
+
if (this.pinchFrom === null || this.pointers.size || !isSize(event.scale)) return;
|
|
1228
|
+
const frame = this.frame();
|
|
1229
|
+
const from = this.current();
|
|
1230
|
+
const { min, max } = this.bounds();
|
|
1231
|
+
const k = clampZoom(this.pinchFrom * event.scale, min, max);
|
|
1232
|
+
if (k === from.k) return;
|
|
1233
|
+
this.schedule(this.bounded(zoomAround(from, k, event.clientX - frame.left, event.clientY - frame.top, frame), frame));
|
|
1234
|
+
}
|
|
1235
|
+
onGestureEnd(event) {
|
|
1236
|
+
event.preventDefault();
|
|
1237
|
+
this.pinchFrom = null;
|
|
1238
|
+
}
|
|
1239
|
+
onKeydown(event) {
|
|
1240
|
+
if (event.target !== event.currentTarget || event.ctrlKey || event.metaKey || event.altKey) return;
|
|
1241
|
+
switch (event.key) {
|
|
1242
|
+
case "+":
|
|
1243
|
+
case "=":
|
|
1244
|
+
this.zoomIn();
|
|
1245
|
+
break;
|
|
1246
|
+
case "-":
|
|
1247
|
+
case "_":
|
|
1248
|
+
this.zoomOut();
|
|
1249
|
+
break;
|
|
1250
|
+
case "0":
|
|
1251
|
+
this.fitView(true);
|
|
1252
|
+
break;
|
|
1253
|
+
case "ArrowLeft":
|
|
1254
|
+
this.panBy(PAN_STEP, 0);
|
|
1255
|
+
break;
|
|
1256
|
+
case "ArrowRight":
|
|
1257
|
+
this.panBy(-40, 0);
|
|
1258
|
+
break;
|
|
1259
|
+
case "ArrowUp":
|
|
1260
|
+
this.panBy(0, PAN_STEP);
|
|
1261
|
+
break;
|
|
1262
|
+
case "ArrowDown":
|
|
1263
|
+
this.panBy(0, -40);
|
|
1264
|
+
break;
|
|
1265
|
+
default: return;
|
|
1266
|
+
}
|
|
1267
|
+
event.preventDefault();
|
|
1268
|
+
}
|
|
1269
|
+
onPointerDown(event, viewport) {
|
|
1270
|
+
if (event.pointerType === "mouse" && event.button !== 0) return;
|
|
1271
|
+
const target = event.target instanceof Element ? event.target.closest(INTERACTIVE) : null;
|
|
1272
|
+
if (target && target !== viewport) return;
|
|
1273
|
+
this.pointers.set(event.pointerId, {
|
|
1274
|
+
x: event.clientX,
|
|
1275
|
+
y: event.clientY
|
|
1276
|
+
});
|
|
1277
|
+
if (this.pointers.size === 2) this.startDrag(viewport);
|
|
1278
|
+
else if (this.pointers.size > 2) this.pointers.delete(event.pointerId);
|
|
1279
|
+
}
|
|
1280
|
+
onPointerMove(event, viewport) {
|
|
1281
|
+
const last = this.pointers.get(event.pointerId);
|
|
1282
|
+
if (!last) return;
|
|
1283
|
+
if (event.pointerType === "mouse" && event.buttons === 0) {
|
|
1284
|
+
this.onPointerEnd(event, viewport);
|
|
1285
|
+
return;
|
|
1286
|
+
}
|
|
1287
|
+
const dx = event.clientX - last.x;
|
|
1288
|
+
const dy = event.clientY - last.y;
|
|
1289
|
+
if (!this.dragging) {
|
|
1290
|
+
if (Math.abs(dx) < DRAG_THRESHOLD && Math.abs(dy) < DRAG_THRESHOLD) return;
|
|
1291
|
+
this.startDrag(viewport);
|
|
1292
|
+
}
|
|
1293
|
+
const frame = this.frame();
|
|
1294
|
+
const from = this.current();
|
|
1295
|
+
const point = {
|
|
1296
|
+
x: event.clientX,
|
|
1297
|
+
y: event.clientY
|
|
1298
|
+
};
|
|
1299
|
+
const other = [...this.pointers].find(([id]) => id !== event.pointerId)?.[1];
|
|
1300
|
+
this.pointers.set(event.pointerId, point);
|
|
1301
|
+
if (!other) {
|
|
1302
|
+
this.schedule(this.bounded({
|
|
1303
|
+
k: from.k,
|
|
1304
|
+
x: from.x + dx,
|
|
1305
|
+
y: from.y + dy
|
|
1306
|
+
}, frame));
|
|
1307
|
+
return;
|
|
1308
|
+
}
|
|
1309
|
+
const before = Math.hypot(last.x - other.x, last.y - other.y);
|
|
1310
|
+
const after = Math.hypot(point.x - other.x, point.y - other.y);
|
|
1311
|
+
const { min, max } = this.bounds();
|
|
1312
|
+
const k = before > 0 ? clampZoom(from.k * after / before, min, max) : from.k;
|
|
1313
|
+
const midX = (last.x + other.x) / 2;
|
|
1314
|
+
const midY = (last.y + other.y) / 2;
|
|
1315
|
+
const zoomed = zoomAround(from, k, midX - frame.left, midY - frame.top, frame);
|
|
1316
|
+
this.schedule(this.bounded({
|
|
1317
|
+
k,
|
|
1318
|
+
x: zoomed.x + dx / 2,
|
|
1319
|
+
y: zoomed.y + dy / 2
|
|
1320
|
+
}, frame));
|
|
1321
|
+
}
|
|
1322
|
+
onPointerEnd(event, viewport) {
|
|
1323
|
+
if (!this.pointers.delete(event.pointerId)) return;
|
|
1324
|
+
if (this.dragging && viewport.hasPointerCapture?.(event.pointerId)) viewport.releasePointerCapture(event.pointerId);
|
|
1325
|
+
if (this.pointers.size) return;
|
|
1326
|
+
this.dragging = false;
|
|
1327
|
+
this.panning.set(false);
|
|
1328
|
+
}
|
|
1329
|
+
startDrag(viewport) {
|
|
1330
|
+
this.dragging = true;
|
|
1331
|
+
this.panning.set(true);
|
|
1332
|
+
this.animated.set(false);
|
|
1333
|
+
for (const id of this.pointers.keys()) viewport.setPointerCapture?.(id);
|
|
1334
|
+
}
|
|
859
1335
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
860
1336
|
minVersion: "12.0.0",
|
|
861
1337
|
version: "22.2.6",
|
|
@@ -905,11 +1381,74 @@ var WrGraph = class WrGraph {
|
|
|
905
1381
|
isSignal: true,
|
|
906
1382
|
isRequired: false,
|
|
907
1383
|
transformFunction: null
|
|
1384
|
+
},
|
|
1385
|
+
zoomable: {
|
|
1386
|
+
classPropertyName: "zoomable",
|
|
1387
|
+
publicName: "zoomable",
|
|
1388
|
+
isSignal: true,
|
|
1389
|
+
isRequired: false,
|
|
1390
|
+
transformFunction: null
|
|
1391
|
+
},
|
|
1392
|
+
wheelZoom: {
|
|
1393
|
+
classPropertyName: "wheelZoom",
|
|
1394
|
+
publicName: "wheelZoom",
|
|
1395
|
+
isSignal: true,
|
|
1396
|
+
isRequired: false,
|
|
1397
|
+
transformFunction: null
|
|
1398
|
+
},
|
|
1399
|
+
zoom: {
|
|
1400
|
+
classPropertyName: "zoom",
|
|
1401
|
+
publicName: "zoom",
|
|
1402
|
+
isSignal: true,
|
|
1403
|
+
isRequired: false,
|
|
1404
|
+
transformFunction: null
|
|
1405
|
+
},
|
|
1406
|
+
minZoom: {
|
|
1407
|
+
classPropertyName: "minZoom",
|
|
1408
|
+
publicName: "minZoom",
|
|
1409
|
+
isSignal: true,
|
|
1410
|
+
isRequired: false,
|
|
1411
|
+
transformFunction: null
|
|
1412
|
+
},
|
|
1413
|
+
maxZoom: {
|
|
1414
|
+
classPropertyName: "maxZoom",
|
|
1415
|
+
publicName: "maxZoom",
|
|
1416
|
+
isSignal: true,
|
|
1417
|
+
isRequired: false,
|
|
1418
|
+
transformFunction: null
|
|
1419
|
+
},
|
|
1420
|
+
zoomInLabel: {
|
|
1421
|
+
classPropertyName: "zoomInLabel",
|
|
1422
|
+
publicName: "zoomInLabel",
|
|
1423
|
+
isSignal: true,
|
|
1424
|
+
isRequired: false,
|
|
1425
|
+
transformFunction: null
|
|
1426
|
+
},
|
|
1427
|
+
zoomOutLabel: {
|
|
1428
|
+
classPropertyName: "zoomOutLabel",
|
|
1429
|
+
publicName: "zoomOutLabel",
|
|
1430
|
+
isSignal: true,
|
|
1431
|
+
isRequired: false,
|
|
1432
|
+
transformFunction: null
|
|
1433
|
+
},
|
|
1434
|
+
fitLabel: {
|
|
1435
|
+
classPropertyName: "fitLabel",
|
|
1436
|
+
publicName: "fitLabel",
|
|
1437
|
+
isSignal: true,
|
|
1438
|
+
isRequired: false,
|
|
1439
|
+
transformFunction: null
|
|
908
1440
|
}
|
|
909
1441
|
},
|
|
910
|
-
outputs: {
|
|
1442
|
+
outputs: {
|
|
1443
|
+
zoom: "zoomChange",
|
|
1444
|
+
layoutError: "layoutError"
|
|
1445
|
+
},
|
|
911
1446
|
host: {
|
|
912
|
-
properties: {
|
|
1447
|
+
properties: {
|
|
1448
|
+
"class.wr-graph--pending": "layoutPending()",
|
|
1449
|
+
"class.wr-graph--zoomable": "zoomable()",
|
|
1450
|
+
"class.wr-graph--panning": "panning()"
|
|
1451
|
+
},
|
|
913
1452
|
classAttribute: "wr-graph"
|
|
914
1453
|
},
|
|
915
1454
|
queries: [{
|
|
@@ -919,8 +1458,21 @@ var WrGraph = class WrGraph {
|
|
|
919
1458
|
descendants: true,
|
|
920
1459
|
isSignal: true
|
|
921
1460
|
}],
|
|
1461
|
+
viewQueries: [{
|
|
1462
|
+
propertyName: "viewportRef",
|
|
1463
|
+
first: true,
|
|
1464
|
+
predicate: ["viewport"],
|
|
1465
|
+
descendants: true,
|
|
1466
|
+
isSignal: true
|
|
1467
|
+
}, {
|
|
1468
|
+
propertyName: "stageRef",
|
|
1469
|
+
first: true,
|
|
1470
|
+
predicate: ["stage"],
|
|
1471
|
+
descendants: true,
|
|
1472
|
+
isSignal: true
|
|
1473
|
+
}],
|
|
922
1474
|
ngImport: i0,
|
|
923
|
-
template: "@let graph = view();\n<!-- The scroller is the one tab stop: a named group, so its label is allowed, and focusable so a keyboard can scroll it. -->\n<div\n class=\"wr-graph__viewport\"\n role=\"group\"\n tabindex=\"0\"\n [attr.aria-label]=\"label()\"\n [attr.aria-busy]=\"layoutPending() ? 'true' : null\"\n>\n <div
|
|
1475
|
+
template: "@let graph = view();\n<!-- The scroller is the one tab stop: a named group, so its label is allowed, and focusable so a keyboard can scroll it — or, when zoomable, zoom and pan it. -->\n<div\n #viewport\n class=\"wr-graph__viewport\"\n role=\"group\"\n tabindex=\"0\"\n [attr.aria-label]=\"label()\"\n [attr.aria-busy]=\"layoutPending() ? 'true' : null\"\n>\n <div\n #stage\n class=\"wr-graph__stage\"\n [class.wr-graph__stage--animated]=\"animated()\"\n [style.width.px]=\"graph.width\"\n [style.height.px]=\"graph.height\"\n [style.transform]=\"stageTransform()\"\n (transitionend)=\"animated.set(false)\"\n >\n <svg\n class=\"wr-graph__edges\"\n aria-hidden=\"true\"\n focusable=\"false\"\n [attr.width]=\"graph.width\"\n [attr.height]=\"graph.height\"\n >\n <defs>\n <!-- `refX` is the triangle's base: the line ends there and the arrowhead alone reaches the node. -->\n <marker\n [attr.id]=\"markerId\"\n viewBox=\"0 0 10 10\"\n refX=\"0\"\n refY=\"5\"\n markerUnits=\"userSpaceOnUse\"\n [attr.markerWidth]=\"arrowSize\"\n [attr.markerHeight]=\"arrowSize\"\n orient=\"auto\"\n >\n <polygon points=\"0,1 10,5 0,9\" />\n </marker>\n </defs>\n @for (edge of graph.edges; track edge.id) {\n <path\n class=\"wr-graph__edge\"\n [attr.d]=\"edge.d\"\n [attr.data-from]=\"edge.from\"\n [attr.data-to]=\"edge.to\"\n [attr.marker-end]=\"markerUrl\"\n />\n }\n </svg>\n <!-- Items are DIRECT children of the list: a wrapper carrying ARIA or a tabindex would break ownership. -->\n <div class=\"wr-graph__nodes\" [attr.role]=\"graph.nodes.length ? 'list' : null\">\n @for (entry of graph.nodes; track entry.node.id) {\n @let relation = relations().get(entry.node.id);\n <div\n class=\"wr-graph__node\"\n role=\"listitem\"\n [style.width.px]=\"entry.width\"\n [style.height.px]=\"entry.height\"\n [style.transform]=\"entry.transform\"\n >\n @if (nodeTemplate(); as custom) {\n <ng-container [ngTemplateOutlet]=\"custom.template\" [ngTemplateOutletContext]=\"{ $implicit: entry.node }\" />\n } @else {\n <div class=\"wr-graph__card\">{{ entry.node.label }}</div>\n }\n @if (relation) {\n <span class=\"wr-graph__sr-only\">{{ relation }}</span>\n }\n </div>\n }\n </div>\n </div>\n</div>\n<!-- After the viewport, never inside it: the buttons stay put while the drawing moves, and follow it in the tab order. -->\n@if (zoomable()) {\n <div class=\"wr-graph__controls\">\n <!-- `aria-disabled`, not `disabled`: a button that reached its bound under the keyboard keeps the focus. -->\n <button\n type=\"button\"\n class=\"wr-graph__control wr-graph__control--zoom-in\"\n [attr.aria-label]=\"zoomInText()\"\n [attr.aria-disabled]=\"atMaxZoom() ? 'true' : null\"\n (click)=\"zoomIn()\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path d=\"M5 12h14\" />\n <path d=\"M12 5v14\" />\n </svg>\n </button>\n <button\n type=\"button\"\n class=\"wr-graph__control wr-graph__control--zoom-out\"\n [attr.aria-label]=\"zoomOutText()\"\n [attr.aria-disabled]=\"atMinZoom() ? 'true' : null\"\n (click)=\"zoomOut()\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path d=\"M5 12h14\" />\n </svg>\n </button>\n <button\n type=\"button\"\n class=\"wr-graph__control wr-graph__control--fit\"\n [attr.aria-label]=\"fitText()\"\n (click)=\"fitView(true)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path d=\"M8 3H5a2 2 0 0 0-2 2v3\" />\n <path d=\"M21 8V5a2 2 0 0 0-2-2h-3\" />\n <path d=\"M3 16v3a2 2 0 0 0 2 2h3\" />\n <path d=\"M16 21h3a2 2 0 0 0 2-2v-3\" />\n </svg>\n </button>\n </div>\n}\n",
|
|
924
1476
|
dependencies: [{
|
|
925
1477
|
kind: "directive",
|
|
926
1478
|
type: NgTemplateOutlet,
|
|
@@ -947,9 +1499,11 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
947
1499
|
encapsulation: ViewEncapsulation.None,
|
|
948
1500
|
host: {
|
|
949
1501
|
class: "wr-graph",
|
|
950
|
-
"[class.wr-graph--pending]": "layoutPending()"
|
|
1502
|
+
"[class.wr-graph--pending]": "layoutPending()",
|
|
1503
|
+
"[class.wr-graph--zoomable]": "zoomable()",
|
|
1504
|
+
"[class.wr-graph--panning]": "panning()"
|
|
951
1505
|
},
|
|
952
|
-
template: "@let graph = view();\n<!-- The scroller is the one tab stop: a named group, so its label is allowed, and focusable so a keyboard can scroll it. -->\n<div\n class=\"wr-graph__viewport\"\n role=\"group\"\n tabindex=\"0\"\n [attr.aria-label]=\"label()\"\n [attr.aria-busy]=\"layoutPending() ? 'true' : null\"\n>\n <div
|
|
1506
|
+
template: "@let graph = view();\n<!-- The scroller is the one tab stop: a named group, so its label is allowed, and focusable so a keyboard can scroll it — or, when zoomable, zoom and pan it. -->\n<div\n #viewport\n class=\"wr-graph__viewport\"\n role=\"group\"\n tabindex=\"0\"\n [attr.aria-label]=\"label()\"\n [attr.aria-busy]=\"layoutPending() ? 'true' : null\"\n>\n <div\n #stage\n class=\"wr-graph__stage\"\n [class.wr-graph__stage--animated]=\"animated()\"\n [style.width.px]=\"graph.width\"\n [style.height.px]=\"graph.height\"\n [style.transform]=\"stageTransform()\"\n (transitionend)=\"animated.set(false)\"\n >\n <svg\n class=\"wr-graph__edges\"\n aria-hidden=\"true\"\n focusable=\"false\"\n [attr.width]=\"graph.width\"\n [attr.height]=\"graph.height\"\n >\n <defs>\n <!-- `refX` is the triangle's base: the line ends there and the arrowhead alone reaches the node. -->\n <marker\n [attr.id]=\"markerId\"\n viewBox=\"0 0 10 10\"\n refX=\"0\"\n refY=\"5\"\n markerUnits=\"userSpaceOnUse\"\n [attr.markerWidth]=\"arrowSize\"\n [attr.markerHeight]=\"arrowSize\"\n orient=\"auto\"\n >\n <polygon points=\"0,1 10,5 0,9\" />\n </marker>\n </defs>\n @for (edge of graph.edges; track edge.id) {\n <path\n class=\"wr-graph__edge\"\n [attr.d]=\"edge.d\"\n [attr.data-from]=\"edge.from\"\n [attr.data-to]=\"edge.to\"\n [attr.marker-end]=\"markerUrl\"\n />\n }\n </svg>\n <!-- Items are DIRECT children of the list: a wrapper carrying ARIA or a tabindex would break ownership. -->\n <div class=\"wr-graph__nodes\" [attr.role]=\"graph.nodes.length ? 'list' : null\">\n @for (entry of graph.nodes; track entry.node.id) {\n @let relation = relations().get(entry.node.id);\n <div\n class=\"wr-graph__node\"\n role=\"listitem\"\n [style.width.px]=\"entry.width\"\n [style.height.px]=\"entry.height\"\n [style.transform]=\"entry.transform\"\n >\n @if (nodeTemplate(); as custom) {\n <ng-container [ngTemplateOutlet]=\"custom.template\" [ngTemplateOutletContext]=\"{ $implicit: entry.node }\" />\n } @else {\n <div class=\"wr-graph__card\">{{ entry.node.label }}</div>\n }\n @if (relation) {\n <span class=\"wr-graph__sr-only\">{{ relation }}</span>\n }\n </div>\n }\n </div>\n </div>\n</div>\n<!-- After the viewport, never inside it: the buttons stay put while the drawing moves, and follow it in the tab order. -->\n@if (zoomable()) {\n <div class=\"wr-graph__controls\">\n <!-- `aria-disabled`, not `disabled`: a button that reached its bound under the keyboard keeps the focus. -->\n <button\n type=\"button\"\n class=\"wr-graph__control wr-graph__control--zoom-in\"\n [attr.aria-label]=\"zoomInText()\"\n [attr.aria-disabled]=\"atMaxZoom() ? 'true' : null\"\n (click)=\"zoomIn()\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path d=\"M5 12h14\" />\n <path d=\"M12 5v14\" />\n </svg>\n </button>\n <button\n type=\"button\"\n class=\"wr-graph__control wr-graph__control--zoom-out\"\n [attr.aria-label]=\"zoomOutText()\"\n [attr.aria-disabled]=\"atMinZoom() ? 'true' : null\"\n (click)=\"zoomOut()\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path d=\"M5 12h14\" />\n </svg>\n </button>\n <button\n type=\"button\"\n class=\"wr-graph__control wr-graph__control--fit\"\n [attr.aria-label]=\"fitText()\"\n (click)=\"fitView(true)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path d=\"M8 3H5a2 2 0 0 0-2 2v3\" />\n <path d=\"M21 8V5a2 2 0 0 0-2-2h-3\" />\n <path d=\"M3 16v3a2 2 0 0 0 2 2h3\" />\n <path d=\"M16 21h3a2 2 0 0 0 2-2v-3\" />\n </svg>\n </button>\n </div>\n}\n"
|
|
953
1507
|
}]
|
|
954
1508
|
}],
|
|
955
1509
|
ctorParameters: () => [],
|
|
@@ -994,6 +1548,73 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
994
1548
|
required: false
|
|
995
1549
|
}]
|
|
996
1550
|
}],
|
|
1551
|
+
zoomable: [{
|
|
1552
|
+
type: i0.Input,
|
|
1553
|
+
args: [{
|
|
1554
|
+
isSignal: true,
|
|
1555
|
+
alias: "zoomable",
|
|
1556
|
+
required: false
|
|
1557
|
+
}]
|
|
1558
|
+
}],
|
|
1559
|
+
wheelZoom: [{
|
|
1560
|
+
type: i0.Input,
|
|
1561
|
+
args: [{
|
|
1562
|
+
isSignal: true,
|
|
1563
|
+
alias: "wheelZoom",
|
|
1564
|
+
required: false
|
|
1565
|
+
}]
|
|
1566
|
+
}],
|
|
1567
|
+
zoom: [{
|
|
1568
|
+
type: i0.Input,
|
|
1569
|
+
args: [{
|
|
1570
|
+
isSignal: true,
|
|
1571
|
+
alias: "zoom",
|
|
1572
|
+
required: false
|
|
1573
|
+
}]
|
|
1574
|
+
}, {
|
|
1575
|
+
type: i0.Output,
|
|
1576
|
+
args: ["zoomChange"]
|
|
1577
|
+
}],
|
|
1578
|
+
minZoom: [{
|
|
1579
|
+
type: i0.Input,
|
|
1580
|
+
args: [{
|
|
1581
|
+
isSignal: true,
|
|
1582
|
+
alias: "minZoom",
|
|
1583
|
+
required: false
|
|
1584
|
+
}]
|
|
1585
|
+
}],
|
|
1586
|
+
maxZoom: [{
|
|
1587
|
+
type: i0.Input,
|
|
1588
|
+
args: [{
|
|
1589
|
+
isSignal: true,
|
|
1590
|
+
alias: "maxZoom",
|
|
1591
|
+
required: false
|
|
1592
|
+
}]
|
|
1593
|
+
}],
|
|
1594
|
+
zoomInLabel: [{
|
|
1595
|
+
type: i0.Input,
|
|
1596
|
+
args: [{
|
|
1597
|
+
isSignal: true,
|
|
1598
|
+
alias: "zoomInLabel",
|
|
1599
|
+
required: false
|
|
1600
|
+
}]
|
|
1601
|
+
}],
|
|
1602
|
+
zoomOutLabel: [{
|
|
1603
|
+
type: i0.Input,
|
|
1604
|
+
args: [{
|
|
1605
|
+
isSignal: true,
|
|
1606
|
+
alias: "zoomOutLabel",
|
|
1607
|
+
required: false
|
|
1608
|
+
}]
|
|
1609
|
+
}],
|
|
1610
|
+
fitLabel: [{
|
|
1611
|
+
type: i0.Input,
|
|
1612
|
+
args: [{
|
|
1613
|
+
isSignal: true,
|
|
1614
|
+
alias: "fitLabel",
|
|
1615
|
+
required: false
|
|
1616
|
+
}]
|
|
1617
|
+
}],
|
|
997
1618
|
layoutError: [{
|
|
998
1619
|
type: i0.Output,
|
|
999
1620
|
args: ["layoutError"]
|
|
@@ -1001,6 +1622,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1001
1622
|
nodeTemplate: [{
|
|
1002
1623
|
type: i0.ContentChild,
|
|
1003
1624
|
args: [i0.forwardRef(() => WrGraphNodeTemplate), { isSignal: true }]
|
|
1625
|
+
}],
|
|
1626
|
+
viewportRef: [{
|
|
1627
|
+
type: i0.ViewChild,
|
|
1628
|
+
args: ["viewport", { isSignal: true }]
|
|
1629
|
+
}],
|
|
1630
|
+
stageRef: [{
|
|
1631
|
+
type: i0.ViewChild,
|
|
1632
|
+
args: ["stage", { isSignal: true }]
|
|
1004
1633
|
}]
|
|
1005
1634
|
}
|
|
1006
1635
|
});
|