ngwr 16.4.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/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-carousel-testing.mjs +4 -1
- package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
- package/fesm2022/ngwr-carousel.mjs +21 -2
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +48 -4
- 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 +47 -19
- 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 +35 -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-graph.mjs +81 -13
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ar.mjs +5 -0
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +5 -0
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +5 -0
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +5 -0
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +5 -0
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +5 -0
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +5 -0
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +5 -0
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +5 -0
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +5 -0
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +5 -0
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +5 -0
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +5 -0
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +5 -0
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +5 -0
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +5 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +5 -0
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +5 -0
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +5 -0
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +5 -0
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +5 -0
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +5 -0
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +20 -3
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +21 -2
- package/fesm2022/ngwr-overlay.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 +2 -0
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +2 -0
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +14 -9
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +49 -16
- package/fesm2022/ngwr-tree.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/i18n/ar.json +5 -0
- package/i18n/cs.json +5 -0
- package/i18n/de.json +5 -0
- package/i18n/en.json +5 -0
- package/i18n/es.json +5 -0
- package/i18n/fr.json +5 -0
- package/i18n/he.json +5 -0
- package/i18n/hi.json +5 -0
- package/i18n/id.json +5 -0
- package/i18n/it.json +5 -0
- package/i18n/ja.json +5 -0
- package/i18n/ko.json +5 -0
- package/i18n/nl.json +5 -0
- package/i18n/pl.json +5 -0
- package/i18n/pt.json +5 -0
- package/i18n/ru.json +5 -0
- package/i18n/sv.json +5 -0
- package/i18n/tr.json +5 -0
- package/i18n/uk.json +5 -0
- package/i18n/vi.json +5 -0
- package/i18n/zh-TW.json +5 -0
- package/i18n/zh.json +5 -0
- package/llms-full.txt +8 -8
- package/llms.txt +7 -3
- package/package.json +1 -1
- package/popconfirm/styles/_index.scss +6 -0
- package/popover/styles/_index.scss +24 -13
- package/schematics/use/symbol-map.json +1 -0
- package/skills/ngwr/references/catalog.md +1 -1
- package/tour/styles/_index.scss +6 -0
- package/types/ngwr-carousel-testing.d.ts +6 -4
- package/types/ngwr-carousel.d.ts +14 -3
- package/types/ngwr-cascader-testing.d.ts +4 -3
- package/types/ngwr-cascader.d.ts +27 -3
- 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 +17 -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 +29 -6
- package/types/ngwr-graph.d.ts +22 -6
- 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-table.d.ts +1 -1
- package/types/ngwr-tour.d.ts +21 -2
- package/types/ngwr-tree-testing.d.ts +1 -2
- package/types/ngwr-tree.d.ts +33 -2
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window.d.ts +14 -11
- package/window/styles/_index.scss +5 -10
|
@@ -1,25 +1,173 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { Component, LOCALE_ID, ViewEncapsulation, computed, inject, input, model, viewChild } from "@angular/core";
|
|
2
|
+
import { Component, DestroyRef, LOCALE_ID, ViewEncapsulation, afterNextRender, computed, inject, input, model, viewChild } from "@angular/core";
|
|
3
3
|
import { coerceBooleanProperty, coerceNumberProperty } from "@angular/cdk/coercion";
|
|
4
|
-
import {
|
|
4
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
5
|
+
import { wrCheckStyles } from "ngwr/utils";
|
|
5
6
|
import { useI18nText } from "ngwr/i18n";
|
|
6
7
|
import { WrChartLegend } from "ngwr/charts/chart-legend";
|
|
7
|
-
import { WrChartTable, useChartNumbers, wrChartAxis, wrChartColor, wrChartMarker, wrChartMarkerExtent, wrChartMarkerPath } from "ngwr/charts/core";
|
|
8
|
-
import { useChartTooltip } from "ngwr/popover";
|
|
8
|
+
import { WrChartState, WrChartTable, useChartHover, useChartNumbers, useChartSize, useChartState, wrChartAxis, wrChartColor, wrChartMarker, wrChartMarkerExtent, wrChartMarkerPath, wrChartNumberFormat, wrChartRound } from "ngwr/charts/core";
|
|
9
|
+
import { useChartTooltip, wrCoerceChartTooltip } from "ngwr/popover";
|
|
9
10
|
/**
|
|
10
11
|
* @license
|
|
11
12
|
*
|
|
12
13
|
* Use of this source code is governed by an MIT-style license that can be
|
|
13
14
|
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
14
15
|
*/
|
|
15
|
-
const
|
|
16
|
+
const MAX_SIDE = 256;
|
|
17
|
+
const cellOf = (percent, side) => Math.min(side - 1, Math.max(0, Math.floor(percent / 100 * side)));
|
|
18
|
+
function wrScatterIndex(points) {
|
|
19
|
+
const count = points.length;
|
|
20
|
+
const side = Math.min(MAX_SIDE, Math.max(1, Math.ceil(Math.sqrt(count))));
|
|
21
|
+
const lefts = new Float64Array(count);
|
|
22
|
+
const tops = new Float64Array(count);
|
|
23
|
+
const reaches = new Float64Array(count);
|
|
24
|
+
const cells = new Int32Array(count);
|
|
25
|
+
const starts = new Int32Array(side * side + 1);
|
|
26
|
+
let reach = 0;
|
|
27
|
+
for (let i = 0; i < count; i++) {
|
|
28
|
+
const point = points[i];
|
|
29
|
+
lefts[i] = point.left;
|
|
30
|
+
tops[i] = point.top;
|
|
31
|
+
reaches[i] = point.reach;
|
|
32
|
+
if (point.reach > reach) reach = point.reach;
|
|
33
|
+
const cell = cellOf(point.top, side) * side + cellOf(point.left, side);
|
|
34
|
+
cells[i] = cell;
|
|
35
|
+
starts[cell + 1]++;
|
|
36
|
+
}
|
|
37
|
+
for (let cell = 0; cell < side * side; cell++) starts[cell + 1] += starts[cell];
|
|
38
|
+
const items = new Int32Array(count);
|
|
39
|
+
const next = starts.slice(0, side * side);
|
|
40
|
+
for (let i = 0; i < count; i++) items[next[cells[i]]++] = i;
|
|
41
|
+
return {
|
|
42
|
+
columns: side,
|
|
43
|
+
rows: side,
|
|
44
|
+
starts,
|
|
45
|
+
items,
|
|
46
|
+
lefts,
|
|
47
|
+
tops,
|
|
48
|
+
reaches,
|
|
49
|
+
reach
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function wrScatterHit(index, left, top, width, height) {
|
|
53
|
+
if (!(width > 0) || !(height > 0) || index.items.length === 0) return null;
|
|
54
|
+
const { columns, rows, starts, items, lefts, tops, reaches } = index;
|
|
55
|
+
const acrossReach = index.reach / width * 100;
|
|
56
|
+
const downReach = index.reach / height * 100;
|
|
57
|
+
const firstColumn = cellOf(left - acrossReach, columns);
|
|
58
|
+
const lastColumn = cellOf(left + acrossReach, columns);
|
|
59
|
+
const firstRow = cellOf(top - downReach, rows);
|
|
60
|
+
const lastRow = cellOf(top + downReach, rows);
|
|
61
|
+
let best = null;
|
|
62
|
+
let nearest = Number.POSITIVE_INFINITY;
|
|
63
|
+
for (let row = firstRow; row <= lastRow; row++) for (let column = firstColumn; column <= lastColumn; column++) {
|
|
64
|
+
const cell = row * columns + column;
|
|
65
|
+
for (let k = starts[cell]; k < starts[cell + 1]; k++) {
|
|
66
|
+
const i = items[k];
|
|
67
|
+
const distance = Math.hypot((lefts[i] - left) / 100 * width, (tops[i] - top) / 100 * height);
|
|
68
|
+
if (distance > reaches[i]) continue;
|
|
69
|
+
if (distance < nearest || distance === nearest && best !== null && i < best) {
|
|
70
|
+
nearest = distance;
|
|
71
|
+
best = i;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return best;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* @license
|
|
79
|
+
*
|
|
80
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
81
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
82
|
+
*/
|
|
83
|
+
const CACHE_LIMIT = 4096;
|
|
84
|
+
const ARGUMENTS = {
|
|
85
|
+
M: 2,
|
|
86
|
+
L: 2,
|
|
87
|
+
A: 7,
|
|
88
|
+
Z: 0
|
|
89
|
+
};
|
|
90
|
+
const write = (value) => String(wrChartRound(value, 3));
|
|
91
|
+
function wrScatterRelativePath(d) {
|
|
92
|
+
const tokens = d.split(/\s+/).filter(Boolean);
|
|
93
|
+
let out = "";
|
|
94
|
+
let x = 0;
|
|
95
|
+
let y = 0;
|
|
96
|
+
for (let at = 0; at < tokens.length;) {
|
|
97
|
+
const command = tokens[at++];
|
|
98
|
+
const count = ARGUMENTS[command];
|
|
99
|
+
if (count === void 0) return "";
|
|
100
|
+
const values = tokens.slice(at, at + count).map(Number);
|
|
101
|
+
at += count;
|
|
102
|
+
if (command === "Z") {
|
|
103
|
+
out += "z";
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
const toX = values[count - 2];
|
|
107
|
+
const toY = values[count - 1];
|
|
108
|
+
const lead = command === "A" ? `${values.slice(0, 5).map(write).join(" ")} ` : "";
|
|
109
|
+
out += `${command.toLowerCase()}${lead}${write(toX - x)} ${write(toY - y)}`;
|
|
110
|
+
x = toX;
|
|
111
|
+
y = toY;
|
|
112
|
+
}
|
|
113
|
+
return out;
|
|
114
|
+
}
|
|
115
|
+
function wrScatterMarkerCache() {
|
|
116
|
+
const cache = /* @__PURE__ */ new Map();
|
|
117
|
+
return (shape, r) => {
|
|
118
|
+
const key = `${shape}:${r}`;
|
|
119
|
+
let marker = cache.get(key);
|
|
120
|
+
if (!marker) {
|
|
121
|
+
const d = wrChartMarkerPath(shape, r);
|
|
122
|
+
marker = {
|
|
123
|
+
d,
|
|
124
|
+
relative: wrScatterRelativePath(d),
|
|
125
|
+
extent: wrChartMarkerExtent(shape, r)
|
|
126
|
+
};
|
|
127
|
+
if (cache.size >= CACHE_LIMIT) cache.clear();
|
|
128
|
+
cache.set(key, marker);
|
|
129
|
+
}
|
|
130
|
+
return marker;
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
function wrScatterDensePath(points, width, height) {
|
|
134
|
+
let d = "";
|
|
135
|
+
for (const point of points) d += `M${wrChartRound(point.left / 100 * width, 1)} ${wrChartRound(point.top / 100 * height, 1)}${point.relative}`;
|
|
136
|
+
return d;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* @license
|
|
140
|
+
*
|
|
141
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
142
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
143
|
+
*/
|
|
144
|
+
const POINT_RADIUS = 3;
|
|
16
145
|
const MIN_RADIUS = 4;
|
|
17
146
|
const HIT_RADIUS = 16;
|
|
147
|
+
const HOVER_GROW = 1;
|
|
18
148
|
const HALO_GAP = 3;
|
|
19
|
-
const
|
|
149
|
+
const DENSE_FROM = 2e3;
|
|
150
|
+
const ASSUMED_WIDTH = 560;
|
|
151
|
+
const percent = (value) => wrChartRound(value, 3);
|
|
20
152
|
var WrScatterChart = class WrScatterChart {
|
|
21
153
|
constructor() {
|
|
22
154
|
if (typeof ngDevMode === "undefined" || ngDevMode) wrCheckStyles("charts/scatter-chart");
|
|
155
|
+
useChartHover({
|
|
156
|
+
enter: () => void 0,
|
|
157
|
+
leave: () => void 0
|
|
158
|
+
});
|
|
159
|
+
const destroyRef = inject(DestroyRef);
|
|
160
|
+
afterNextRender(() => {
|
|
161
|
+
const plot = this.plot().nativeElement;
|
|
162
|
+
const move = (event) => this.onPointerMove(event);
|
|
163
|
+
const leave = (event) => this.tip.leave(event);
|
|
164
|
+
plot.addEventListener("mousemove", move);
|
|
165
|
+
plot.addEventListener("mouseleave", leave);
|
|
166
|
+
destroyRef.onDestroy(() => {
|
|
167
|
+
plot.removeEventListener("mousemove", move);
|
|
168
|
+
plot.removeEventListener("mouseleave", leave);
|
|
169
|
+
});
|
|
170
|
+
});
|
|
23
171
|
}
|
|
24
172
|
series = input([], ...ngDevMode ? [{ debugName: "series" }] : /* istanbul ignore next */ []);
|
|
25
173
|
ariaLabel = input(null, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
@@ -32,7 +180,7 @@ var WrScatterChart = class WrScatterChart {
|
|
|
32
180
|
sizeName = useI18nText(this.sizeLabel, "scatterChart.size", "Size");
|
|
33
181
|
valueFormat = input(null, ...ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []);
|
|
34
182
|
numbers = useChartNumbers(this.valueFormat);
|
|
35
|
-
ordinals =
|
|
183
|
+
ordinals = wrChartNumberFormat(inject(LOCALE_ID));
|
|
36
184
|
height = input(240, {
|
|
37
185
|
...ngDevMode ? { debugName: "height" } : /* istanbul ignore next */ {},
|
|
38
186
|
transform: (v) => Math.max(80, coerceNumberProperty(v, 240))
|
|
@@ -41,10 +189,26 @@ var WrScatterChart = class WrScatterChart {
|
|
|
41
189
|
...ngDevMode ? { debugName: "showGrid" } : /* istanbul ignore next */ {},
|
|
42
190
|
transform: coerceBooleanProperty
|
|
43
191
|
});
|
|
44
|
-
|
|
192
|
+
showAxis = input(true, {
|
|
193
|
+
...ngDevMode ? { debugName: "showAxis" } : /* istanbul ignore next */ {},
|
|
194
|
+
transform: coerceBooleanProperty
|
|
195
|
+
});
|
|
196
|
+
showLegend = input("auto", {
|
|
45
197
|
...ngDevMode ? { debugName: "showLegend" } : /* istanbul ignore next */ {},
|
|
198
|
+
transform: (value) => value === "auto" ? "auto" : coerceBooleanProperty(value)
|
|
199
|
+
});
|
|
200
|
+
legendPosition = input("bottom", ...ngDevMode ? [{ debugName: "legendPosition" }] : /* istanbul ignore next */ []);
|
|
201
|
+
loading = input(false, {
|
|
202
|
+
...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
|
|
46
203
|
transform: coerceBooleanProperty
|
|
47
204
|
});
|
|
205
|
+
error = input(false, {
|
|
206
|
+
...ngDevMode ? { debugName: "error" } : /* istanbul ignore next */ {},
|
|
207
|
+
transform: coerceBooleanProperty
|
|
208
|
+
});
|
|
209
|
+
emptyLabel = input(null, ...ngDevMode ? [{ debugName: "emptyLabel" }] : /* istanbul ignore next */ []);
|
|
210
|
+
loadingLabel = input(null, ...ngDevMode ? [{ debugName: "loadingLabel" }] : /* istanbul ignore next */ []);
|
|
211
|
+
errorLabel = input(null, ...ngDevMode ? [{ debugName: "errorLabel" }] : /* istanbul ignore next */ []);
|
|
48
212
|
toggleableLegend = input(false, {
|
|
49
213
|
...ngDevMode ? { debugName: "toggleableLegend" } : /* istanbul ignore next */ {},
|
|
50
214
|
transform: coerceBooleanProperty
|
|
@@ -52,7 +216,7 @@ var WrScatterChart = class WrScatterChart {
|
|
|
52
216
|
hiddenSeries = model([], ...ngDevMode ? [{ debugName: "hiddenSeries" }] : /* istanbul ignore next */ []);
|
|
53
217
|
tooltip = input(true, {
|
|
54
218
|
...ngDevMode ? { debugName: "tooltip" } : /* istanbul ignore next */ {},
|
|
55
|
-
transform:
|
|
219
|
+
transform: wrCoerceChartTooltip
|
|
56
220
|
});
|
|
57
221
|
dataTable = input(false, {
|
|
58
222
|
...ngDevMode ? { debugName: "dataTable" } : /* istanbul ignore next */ {},
|
|
@@ -63,6 +227,9 @@ var WrScatterChart = class WrScatterChart {
|
|
|
63
227
|
transform: (v) => Math.max(MIN_RADIUS, coerceNumberProperty(v, 20))
|
|
64
228
|
});
|
|
65
229
|
svg = viewChild("svg", ...ngDevMode ? [{ debugName: "svg" }] : /* istanbul ignore next */ []);
|
|
230
|
+
plot = viewChild.required("plot", ...ngDevMode ? [{ debugName: "plot" }] : /* istanbul ignore next */ []);
|
|
231
|
+
drawingSize = useChartSize(this.svg);
|
|
232
|
+
markerOf = wrScatterMarkerCache();
|
|
66
233
|
resolvedSeries = computed(() => this.series().map((s, index) => ({
|
|
67
234
|
index,
|
|
68
235
|
label: s.label,
|
|
@@ -81,6 +248,29 @@ var WrScatterChart = class WrScatterChart {
|
|
|
81
248
|
color,
|
|
82
249
|
marker
|
|
83
250
|
})), ...ngDevMode ? [{ debugName: "legendItems" }] : /* istanbul ignore next */ []);
|
|
251
|
+
legendShown = computed(() => {
|
|
252
|
+
const show = this.showLegend();
|
|
253
|
+
const rows = this.legendItems().length;
|
|
254
|
+
if (show === false || rows === 0 || this.legendPosition() === "none") return false;
|
|
255
|
+
return show === true || rows > 1;
|
|
256
|
+
}, ...ngDevMode ? [{ debugName: "legendShown" }] : /* istanbul ignore next */ []);
|
|
257
|
+
legendFirst = computed(() => {
|
|
258
|
+
const position = this.legendPosition();
|
|
259
|
+
return position === "top" || position === "start";
|
|
260
|
+
}, ...ngDevMode ? [{ debugName: "legendFirst" }] : /* istanbul ignore next */ []);
|
|
261
|
+
legendSide = computed(() => {
|
|
262
|
+
const position = this.legendPosition();
|
|
263
|
+
return position === "start" || position === "end";
|
|
264
|
+
}, ...ngDevMode ? [{ debugName: "legendSide" }] : /* istanbul ignore next */ []);
|
|
265
|
+
empty = computed(() => this.resolvedSeries().every((s) => s.points.length === 0), ...ngDevMode ? [{ debugName: "empty" }] : /* istanbul ignore next */ []);
|
|
266
|
+
state = useChartState({
|
|
267
|
+
loading: this.loading,
|
|
268
|
+
error: this.error,
|
|
269
|
+
empty: this.empty,
|
|
270
|
+
emptyLabel: this.emptyLabel,
|
|
271
|
+
loadingLabel: this.loadingLabel,
|
|
272
|
+
errorLabel: this.errorLabel
|
|
273
|
+
});
|
|
84
274
|
visibleSeries = computed(() => {
|
|
85
275
|
const hidden = new Set(this.hiddenSeries());
|
|
86
276
|
return this.resolvedSeries().filter((s) => !hidden.has(s.index));
|
|
@@ -100,7 +290,7 @@ var WrScatterChart = class WrScatterChart {
|
|
|
100
290
|
const maxRadius = this.maxRadius();
|
|
101
291
|
return this.visibleSeries().flatMap((s) => s.points.map((p) => {
|
|
102
292
|
const r = p.size === null || maxSize === null ? POINT_RADIUS : Math.max(MIN_RADIUS, maxRadius * Math.sqrt(maxSize > 0 ? p.size / maxSize : 0));
|
|
103
|
-
const
|
|
293
|
+
const marker = this.markerOf(s.marker, r);
|
|
104
294
|
return {
|
|
105
295
|
key: `${s.index}:${p.n}`,
|
|
106
296
|
series: s.index,
|
|
@@ -115,11 +305,63 @@ var WrScatterChart = class WrScatterChart {
|
|
|
115
305
|
left: percent((p.x - x.min) / (x.max - x.min) * 100),
|
|
116
306
|
top: percent((y.max - p.y) / (y.max - y.min) * 100),
|
|
117
307
|
r,
|
|
118
|
-
d:
|
|
119
|
-
|
|
308
|
+
d: marker.d,
|
|
309
|
+
relative: marker.relative,
|
|
310
|
+
values: p.size === null ? `${p.x} ${p.y} ${r}` : `${p.x} ${p.y} ${r} ${p.size}`,
|
|
311
|
+
halo: this.markerOf(s.marker, r + HALO_GAP).extent
|
|
120
312
|
};
|
|
121
313
|
})).sort((a, b) => b.r - a.r);
|
|
122
314
|
}, ...ngDevMode ? [{ debugName: "points" }] : /* istanbul ignore next */ []);
|
|
315
|
+
dense = computed(() => this.points().length > DENSE_FROM, ...ngDevMode ? [{ debugName: "dense" }] : /* istanbul ignore next */ []);
|
|
316
|
+
runs = computed(() => {
|
|
317
|
+
if (this.dense()) return [];
|
|
318
|
+
const runs = [];
|
|
319
|
+
for (const point of this.points()) {
|
|
320
|
+
const last = runs[runs.length - 1];
|
|
321
|
+
if (last?.series === point.series) last.points.push(point);
|
|
322
|
+
else runs.push({
|
|
323
|
+
key: point.key,
|
|
324
|
+
series: point.series,
|
|
325
|
+
color: point.color,
|
|
326
|
+
marker: point.marker,
|
|
327
|
+
points: [point]
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
return runs;
|
|
331
|
+
}, ...ngDevMode ? [{ debugName: "runs" }] : /* istanbul ignore next */ []);
|
|
332
|
+
denseSize = computed(() => {
|
|
333
|
+
const { width, height } = this.drawingSize();
|
|
334
|
+
return width > 0 && height > 0 ? {
|
|
335
|
+
width,
|
|
336
|
+
height
|
|
337
|
+
} : {
|
|
338
|
+
width: ASSUMED_WIDTH,
|
|
339
|
+
height: this.height()
|
|
340
|
+
};
|
|
341
|
+
}, ...ngDevMode ? [{ debugName: "denseSize" }] : /* istanbul ignore next */ []);
|
|
342
|
+
denseBox = computed(() => `0 0 ${this.denseSize().width} ${this.denseSize().height}`, ...ngDevMode ? [{ debugName: "denseBox" }] : /* istanbul ignore next */ []);
|
|
343
|
+
densePaths = computed(() => {
|
|
344
|
+
if (!this.dense()) return [];
|
|
345
|
+
const { width, height } = this.denseSize();
|
|
346
|
+
const bySeries = /* @__PURE__ */ new Map();
|
|
347
|
+
for (const point of this.points()) {
|
|
348
|
+
const list = bySeries.get(point.series);
|
|
349
|
+
if (list) list.push(point);
|
|
350
|
+
else bySeries.set(point.series, [point]);
|
|
351
|
+
}
|
|
352
|
+
return [...bySeries.entries()].sort(([a], [b]) => a - b).map(([series, points]) => ({
|
|
353
|
+
series,
|
|
354
|
+
color: points[0].color,
|
|
355
|
+
marker: points[0].marker,
|
|
356
|
+
count: points.length,
|
|
357
|
+
d: wrScatterDensePath(points, width, height)
|
|
358
|
+
}));
|
|
359
|
+
}, ...ngDevMode ? [{ debugName: "densePaths" }] : /* istanbul ignore next */ []);
|
|
360
|
+
index = computed(() => wrScatterIndex(this.points().map(({ left, top, halo }) => ({
|
|
361
|
+
left,
|
|
362
|
+
top,
|
|
363
|
+
reach: Math.max(HIT_RADIUS, halo.radius)
|
|
364
|
+
}))), ...ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []);
|
|
123
365
|
reach = computed(() => {
|
|
124
366
|
let x = 0;
|
|
125
367
|
let y = 0;
|
|
@@ -128,8 +370,8 @@ var WrScatterChart = class WrScatterChart {
|
|
|
128
370
|
y = Math.max(y, halo.top, halo.bottom);
|
|
129
371
|
}
|
|
130
372
|
return {
|
|
131
|
-
x:
|
|
132
|
-
y:
|
|
373
|
+
x: wrChartRound(x, 3),
|
|
374
|
+
y: wrChartRound(Math.min(y, this.height() / 4), 3)
|
|
133
375
|
};
|
|
134
376
|
}, ...ngDevMode ? [{ debugName: "reach" }] : /* istanbul ignore next */ []);
|
|
135
377
|
yTicks = computed(() => {
|
|
@@ -137,7 +379,8 @@ var WrScatterChart = class WrScatterChart {
|
|
|
137
379
|
const labels = this.numbers.ticks(ticks, step, "y");
|
|
138
380
|
return ticks.map((value, i) => ({
|
|
139
381
|
label: labels[i],
|
|
140
|
-
top: percent((max - value) / (max - min) * 100)
|
|
382
|
+
top: percent((max - value) / (max - min) * 100),
|
|
383
|
+
zero: value === 0
|
|
141
384
|
}));
|
|
142
385
|
}, ...ngDevMode ? [{ debugName: "yTicks" }] : /* istanbul ignore next */ []);
|
|
143
386
|
xTicks = computed(() => {
|
|
@@ -156,7 +399,7 @@ var WrScatterChart = class WrScatterChart {
|
|
|
156
399
|
tip = useChartTooltip(this.tooltip, (index) => {
|
|
157
400
|
const point = this.points()[index];
|
|
158
401
|
const svg = this.svg()?.nativeElement;
|
|
159
|
-
if (!point || !svg) return null;
|
|
402
|
+
if (!point || !svg || this.state()) return null;
|
|
160
403
|
const box = svg.getBoundingClientRect();
|
|
161
404
|
const x = box.left + point.left / 100 * box.width;
|
|
162
405
|
const y = box.top + point.top / 100 * box.height;
|
|
@@ -188,11 +431,11 @@ var WrScatterChart = class WrScatterChart {
|
|
|
188
431
|
}, (x, y) => this.pointAt(x, y));
|
|
189
432
|
activePoint = computed(() => {
|
|
190
433
|
const index = this.tip.active();
|
|
191
|
-
return index === null ? null : this.points()[index] ?? null;
|
|
434
|
+
return index === null || this.state() ? null : this.points()[index] ?? null;
|
|
192
435
|
}, ...ngDevMode ? [{ debugName: "activePoint" }] : /* istanbul ignore next */ []);
|
|
193
436
|
haloPath = computed(() => {
|
|
194
437
|
const point = this.activePoint();
|
|
195
|
-
return point ?
|
|
438
|
+
return point ? this.markerOf(point.marker, point.r + HOVER_GROW).d : "";
|
|
196
439
|
}, ...ngDevMode ? [{ debugName: "haloPath" }] : /* istanbul ignore next */ []);
|
|
197
440
|
tableData = computed(() => {
|
|
198
441
|
const sized = this.sized();
|
|
@@ -218,26 +461,17 @@ var WrScatterChart = class WrScatterChart {
|
|
|
218
461
|
};
|
|
219
462
|
}, ...ngDevMode ? [{ debugName: "tableData" }] : /* istanbul ignore next */ []);
|
|
220
463
|
onPointerMove(event) {
|
|
221
|
-
if (!this.tooltip()) return;
|
|
464
|
+
if (!this.tooltip() || this.tip.active() !== null) return;
|
|
222
465
|
const index = this.pointAt(event.clientX, event.clientY);
|
|
223
466
|
if (index === null) this.tip.leave(event);
|
|
224
467
|
else this.tip.enter(index);
|
|
225
468
|
}
|
|
226
469
|
pointAt(clientX, clientY) {
|
|
227
470
|
const svg = this.svg()?.nativeElement;
|
|
228
|
-
if (!svg) return null;
|
|
471
|
+
if (!svg || this.state()) return null;
|
|
229
472
|
const box = svg.getBoundingClientRect();
|
|
230
473
|
if (box.width <= 0 || box.height <= 0) return null;
|
|
231
|
-
|
|
232
|
-
let nearest = Number.POSITIVE_INFINITY;
|
|
233
|
-
this.points().forEach((point, index) => {
|
|
234
|
-
const distance = Math.hypot(box.left + point.left / 100 * box.width - clientX, box.top + point.top / 100 * box.height - clientY);
|
|
235
|
-
if (distance <= Math.max(HIT_RADIUS, point.halo.radius) && distance < nearest) {
|
|
236
|
-
nearest = distance;
|
|
237
|
-
best = index;
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
return best;
|
|
474
|
+
return wrScatterHit(this.index(), (clientX - box.left) / box.width * 100, (clientY - box.top) / box.height * 100, box.width, box.height);
|
|
241
475
|
}
|
|
242
476
|
fit(read) {
|
|
243
477
|
let min = Number.POSITIVE_INFINITY;
|
|
@@ -320,6 +554,13 @@ var WrScatterChart = class WrScatterChart {
|
|
|
320
554
|
isRequired: false,
|
|
321
555
|
transformFunction: null
|
|
322
556
|
},
|
|
557
|
+
showAxis: {
|
|
558
|
+
classPropertyName: "showAxis",
|
|
559
|
+
publicName: "showAxis",
|
|
560
|
+
isSignal: true,
|
|
561
|
+
isRequired: false,
|
|
562
|
+
transformFunction: null
|
|
563
|
+
},
|
|
323
564
|
showLegend: {
|
|
324
565
|
classPropertyName: "showLegend",
|
|
325
566
|
publicName: "showLegend",
|
|
@@ -327,6 +568,48 @@ var WrScatterChart = class WrScatterChart {
|
|
|
327
568
|
isRequired: false,
|
|
328
569
|
transformFunction: null
|
|
329
570
|
},
|
|
571
|
+
legendPosition: {
|
|
572
|
+
classPropertyName: "legendPosition",
|
|
573
|
+
publicName: "legendPosition",
|
|
574
|
+
isSignal: true,
|
|
575
|
+
isRequired: false,
|
|
576
|
+
transformFunction: null
|
|
577
|
+
},
|
|
578
|
+
loading: {
|
|
579
|
+
classPropertyName: "loading",
|
|
580
|
+
publicName: "loading",
|
|
581
|
+
isSignal: true,
|
|
582
|
+
isRequired: false,
|
|
583
|
+
transformFunction: null
|
|
584
|
+
},
|
|
585
|
+
error: {
|
|
586
|
+
classPropertyName: "error",
|
|
587
|
+
publicName: "error",
|
|
588
|
+
isSignal: true,
|
|
589
|
+
isRequired: false,
|
|
590
|
+
transformFunction: null
|
|
591
|
+
},
|
|
592
|
+
emptyLabel: {
|
|
593
|
+
classPropertyName: "emptyLabel",
|
|
594
|
+
publicName: "emptyLabel",
|
|
595
|
+
isSignal: true,
|
|
596
|
+
isRequired: false,
|
|
597
|
+
transformFunction: null
|
|
598
|
+
},
|
|
599
|
+
loadingLabel: {
|
|
600
|
+
classPropertyName: "loadingLabel",
|
|
601
|
+
publicName: "loadingLabel",
|
|
602
|
+
isSignal: true,
|
|
603
|
+
isRequired: false,
|
|
604
|
+
transformFunction: null
|
|
605
|
+
},
|
|
606
|
+
errorLabel: {
|
|
607
|
+
classPropertyName: "errorLabel",
|
|
608
|
+
publicName: "errorLabel",
|
|
609
|
+
isSignal: true,
|
|
610
|
+
isRequired: false,
|
|
611
|
+
transformFunction: null
|
|
612
|
+
},
|
|
330
613
|
toggleableLegend: {
|
|
331
614
|
classPropertyName: "toggleableLegend",
|
|
332
615
|
publicName: "toggleableLegend",
|
|
@@ -366,11 +649,13 @@ var WrScatterChart = class WrScatterChart {
|
|
|
366
649
|
outputs: { hiddenSeries: "hiddenSeriesChange" },
|
|
367
650
|
host: {
|
|
368
651
|
properties: {
|
|
652
|
+
"class.wr-chart--legend-side": "legendShown() && legendSide()",
|
|
653
|
+
"class.wr-scatter-chart--axis": "showAxis()",
|
|
369
654
|
"class.wr-scatter-chart--bubbles": "sized()",
|
|
370
655
|
"style.--wr-scatter-chart-reach-x": "reach().x",
|
|
371
656
|
"style.--wr-scatter-chart-reach-y": "reach().y"
|
|
372
657
|
},
|
|
373
|
-
classAttribute: "wr-scatter-chart"
|
|
658
|
+
classAttribute: "wr-scatter-chart wr-chart--legend"
|
|
374
659
|
},
|
|
375
660
|
viewQueries: [{
|
|
376
661
|
propertyName: "svg",
|
|
@@ -378,27 +663,53 @@ var WrScatterChart = class WrScatterChart {
|
|
|
378
663
|
predicate: ["svg"],
|
|
379
664
|
descendants: true,
|
|
380
665
|
isSignal: true
|
|
381
|
-
}],
|
|
382
|
-
ngImport: i0,
|
|
383
|
-
template: "@let active = activePoint();\n@if (showLegend() && resolvedSeries().length > 0) {\n <!-- Every row keys its series by the series' own marker shape, the channel that tells\n the points apart where the colours do not. Rows are tracked by position, so two\n series that share a label are two rows. -->\n <ul\n wr-chart-legend\n class=\"wr-scatter-chart__legend\"\n [items]=\"legendItems()\"\n [toggleable]=\"toggleableLegend()\"\n [(hiddenSeries)]=\"hiddenSeries\"\n ></ul>\n}\n\n<!-- Two columns: the y tick labels at inline start and the drawing beside them, with the\n y axis' name above and the x tick labels and the x axis' name under the drawing\n only, so their percentages are the drawing's. -->\n<div class=\"wr-scatter-chart__body\">\n @if (yLabel()) {\n <div class=\"wr-scatter-chart__y-title\">{{ yLabel() }}</div>\n }\n\n @if (showGrid()) {\n <!-- HTML beside the drawing rather than `<text>` inside it, in flow, so the column is\n exactly as wide as the longest label; each one hands the stylesheet the y of its\n own gridline. Hidden, as the drawing is one image: its name is what is announced,\n and the values are the data table's. -->\n <div class=\"wr-scatter-chart__y-axis\" aria-hidden=\"true\">\n @for (tick of yTicks(); track $index) {\n <span class=\"wr-scatter-chart__y-tick\" [style.--wr-scatter-chart-y]=\"tick.top\">{{ tick.label }}</span>\n }\n </div>\n }\n\n <div\n class=\"wr-scatter-chart__plot\"\n role=\"img\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.height.px]=\"height()\"\n (mousemove)=\"onPointerMove($event)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n <!-- No viewBox: every position is a PERCENTAGE of the drawing, so nothing stretches.\n A viewBox with `preserveAspectRatio=\"none\"` would squash each marker with the\n drawing, a circle into an oval and a square into a bar, and a scatter's marker is\n its series' only channel besides colour. -->\n <!-- Hidden as well as presentational: `img` already makes it so, but every point is\n an `<svg>` of its own, and a tree that holds a node per point for thousands of\n them is work for nothing. -->\n <svg #svg class=\"wr-scatter-chart__svg\" aria-hidden=\"true\">\n @if (showGrid()) {\n @for (tick of yTicks(); track $index) {\n <line\n class=\"wr-scatter-chart__grid-line\"\n x1=\"0\"\n x2=\"100%\"\n [attr.y1]=\"`${tick.top}%`\"\n [attr.y2]=\"`${tick.top}%`\"\n />\n }\n @for (tick of xTicks(); track $index) {\n <line\n class=\"wr-scatter-chart__grid-line wr-scatter-chart__grid-line--x\"\n [attr.x1]=\"`${tick.left}%`\"\n [attr.x2]=\"`${tick.left}%`\"\n y1=\"0\"\n y2=\"100%\"\n />\n }\n }\n\n @for (p of points(); track p.key) {\n <!-- A nested `<svg>` placed by percentage, its marker drawn about its origin in\n px: an SVG's `x` and `y` take a percentage where a `transform` does not, so\n the marker sits on its point at any size and keeps its own. Its viewport is\n the drawing's whole box, painted nowhere, and `overflow` lets the marker\n reach outside it. -->\n <svg\n class=\"wr-scatter-chart__point\"\n [attr.x]=\"`${p.left}%`\"\n [attr.y]=\"`${p.top}%`\"\n overflow=\"visible\"\n [attr.data-series]=\"p.series\"\n [attr.data-x]=\"p.x\"\n [attr.data-y]=\"p.y\"\n [attr.data-size]=\"p.size\"\n [attr.data-radius]=\"p.r\"\n [attr.data-marker]=\"p.marker\"\n >\n <path class=\"wr-scatter-chart__marker\" [attr.d]=\"p.d\" [attr.fill]=\"p.color\" />\n </svg>\n }\n\n @if (active) {\n <!-- A ring of the point's own shape just outside it, so the reading is marked by\n outline as well as by the tooltip's arrow. -->\n <svg class=\"wr-scatter-chart__halo\" [attr.x]=\"`${active.left}%`\" [attr.y]=\"`${active.top}%`\" overflow=\"visible\">\n <path [attr.d]=\"haloPath()\" fill=\"none\" [attr.stroke]=\"active.color\" />\n </svg>\n }\n </svg>\n </div>\n\n @if (showGrid()) {\n <!-- The strip is as wide as the plot, and hands the stylesheet the distance between\n two ticks; each label hands it the x of its gridline, as a percentage of the\n drawing's width. -->\n <div class=\"wr-scatter-chart__x-axis\" aria-hidden=\"true\" [style.--wr-scatter-chart-x-slot]=\"xSlot()\">\n @for (tick of xTicks(); track $index) {\n <span class=\"wr-scatter-chart__x-tick\" [style.--wr-scatter-chart-x]=\"tick.left\">{{ tick.label }}</span>\n }\n </div>\n }\n\n @if (xLabel()) {\n <div class=\"wr-scatter-chart__x-title\">{{ xLabel() }}</div>\n }\n</div>\n\n@if (dataTable()) {\n <!-- The figures for a screen reader, beside the plot's `img` and never inside it:\n `img` makes everything it holds presentational. Clipped to nothing by its own\n stylesheet, so it takes no room and draws nothing. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n",
|
|
384
|
-
dependencies: [{
|
|
385
|
-
kind: "component",
|
|
386
|
-
type: WrChartLegend,
|
|
387
|
-
selector: "ul[wr-chart-legend]",
|
|
388
|
-
inputs: [
|
|
389
|
-
"items",
|
|
390
|
-
"toggleable",
|
|
391
|
-
"hiddenSeries",
|
|
392
|
-
"ariaLabel",
|
|
393
|
-
"hiddenLabel"
|
|
394
|
-
],
|
|
395
|
-
outputs: ["hiddenSeriesChange", "toggled"]
|
|
396
666
|
}, {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
667
|
+
propertyName: "plot",
|
|
668
|
+
first: true,
|
|
669
|
+
predicate: ["plot"],
|
|
670
|
+
descendants: true,
|
|
671
|
+
isSignal: true
|
|
401
672
|
}],
|
|
673
|
+
ngImport: i0,
|
|
674
|
+
template: "@let active = activePoint();\n@let shown = state();\n\n<!-- The legend, drawn before the body or after it so it is in the DOM where it is on\n screen: a toggleable legend's rows are tab stops, and their order follows it. Every\n row keys its series by the series' own marker shape, the channel that tells the\n points apart where the colours do not. Rows are tracked by position, so two series\n that share a label are two rows. -->\n<ng-template #legend>\n <ul\n wr-chart-legend\n class=\"wr-scatter-chart__legend\"\n [items]=\"legendItems()\"\n [position]=\"legendPosition()\"\n [toggleable]=\"toggleableLegend()\"\n [(hiddenSeries)]=\"hiddenSeries\"\n ></ul>\n</ng-template>\n\n@if (legendShown() && legendFirst()) {\n <ng-container [ngTemplateOutlet]=\"legend\" />\n}\n\n<!-- Three columns: the y axis' name turned along the axis, the y tick labels, and the\n drawing, with the x tick labels and the x axis' name under the drawing only, so\n their percentages are the drawing's. -->\n<div class=\"wr-scatter-chart__body\">\n @if (yLabel()) {\n <!-- Along its axis, beside the scale it names: set level above the plot it read as an\n entry of a legend placed there. -->\n <div class=\"wr-scatter-chart__y-title\">{{ yLabel() }}</div>\n }\n\n @if (showAxis()) {\n <!-- HTML beside the drawing rather than `<text>` inside it, in flow, so the column is\n exactly as wide as the longest label; each one hands the stylesheet the y of its\n own gridline. Hidden, as the drawing is one image: its name is what is announced,\n and the values are the data table's. -->\n <div class=\"wr-scatter-chart__y-axis\" aria-hidden=\"true\">\n @for (tick of yTicks(); track $index) {\n <span class=\"wr-scatter-chart__y-tick\" [style.--wr-scatter-chart-y]=\"tick.top\">{{ tick.label }}</span>\n }\n </div>\n }\n\n <!-- The pointer is heard on the plot by one native listener pair the component adds,\n and a point is found by position. -->\n <div\n #plot\n class=\"wr-scatter-chart__plot\"\n role=\"img\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.height.px]=\"height()\"\n >\n <!-- No viewBox: every position is a PERCENTAGE of the drawing, so nothing stretches.\n A viewBox with `preserveAspectRatio=\"none\"` would squash each marker with the\n drawing, a circle into an oval and a square into a bar, and a scatter's marker is\n its series' only channel besides colour. -->\n <!-- Hidden as well as presentational: `img` already makes it so, but every point is\n an `<svg>` of its own, and a tree that holds a node per point for thousands of\n them is work for nothing. -->\n <svg #svg class=\"wr-scatter-chart__svg\" aria-hidden=\"true\">\n @if (showGrid()) {\n @for (tick of yTicks(); track $index) {\n <!-- The line at zero takes the stronger `--wr-scatter-chart-zero-color`. -->\n <line\n class=\"wr-scatter-chart__grid-line\"\n [class.wr-scatter-chart__grid-line--zero]=\"tick.zero\"\n x1=\"0\"\n x2=\"100%\"\n [attr.y1]=\"`${tick.top}%`\"\n [attr.y2]=\"`${tick.top}%`\"\n />\n }\n @for (tick of xTicks(); track $index) {\n <!-- Painted `transparent` by default: a chart reads its values across. The\n lines stay so that `--wr-scatter-chart-grid-x-color` can draw them. -->\n <line\n class=\"wr-scatter-chart__grid-line wr-scatter-chart__grid-line--x\"\n [attr.x1]=\"`${tick.left}%`\"\n [attr.x2]=\"`${tick.left}%`\"\n y1=\"0\"\n y2=\"100%\"\n />\n }\n }\n\n @if (!shown) {\n @for (run of runs(); track run.key) {\n <!-- A stretch of one series' points, in drawing order. The group carries what\n they share: the fill, the shape, and `data-wr-series`, the series' row in\n the legend, which the shared hover dims by. -->\n <g\n class=\"wr-scatter-chart__series\"\n [attr.fill]=\"run.color\"\n [attr.data-wr-series]=\"run.series\"\n [attr.data-marker]=\"run.marker\"\n >\n @for (p of run.points; track p.key) {\n <!-- A nested `<svg>` placed by percentage, its marker drawn about its origin\n in px: an SVG's `x` and `y` take a percentage where a `transform` does\n not, so the marker sits on its point at any size and keeps its own. Its\n viewport is the drawing's whole box, painted nowhere, and `overflow`\n lets the marker reach outside it. `data-point` is the point's x, y and\n radius, and its size when it has one: what a test harness reads. -->\n <svg\n class=\"wr-scatter-chart__point\"\n [attr.x]=\"`${p.left}%`\"\n [attr.y]=\"`${p.top}%`\"\n overflow=\"visible\"\n [attr.data-point]=\"p.values\"\n >\n <path class=\"wr-scatter-chart__marker\" [attr.d]=\"p.d\" />\n </svg>\n }\n </g>\n }\n\n @if (dense()) {\n <!-- Too many points for a node each: every series is one path, a subpath per\n marker, in px of the drawing's measured size. The `viewBox` is that size, so\n nothing is scaled once it is measured; before that, and between a resize and\n the path written for it, the markers stretch with the box. -->\n <svg\n class=\"wr-scatter-chart__dense\"\n [attr.viewBox]=\"denseBox()\"\n preserveAspectRatio=\"none\"\n width=\"100%\"\n height=\"100%\"\n overflow=\"visible\"\n >\n @for (s of densePaths(); track s.series) {\n <path\n class=\"wr-scatter-chart__points wr-scatter-chart__marker\"\n vector-effect=\"non-scaling-stroke\"\n [attr.d]=\"s.d\"\n [attr.fill]=\"s.color\"\n [attr.data-wr-series]=\"s.series\"\n [attr.data-marker]=\"s.marker\"\n [attr.data-count]=\"s.count\"\n />\n }\n </svg>\n }\n }\n\n @if (active) {\n <!-- The point being read, drawn again over the rest: its own shape a little\n larger, solid, inside a ring of the surface. -->\n <svg class=\"wr-scatter-chart__halo\" [attr.x]=\"`${active.left}%`\" [attr.y]=\"`${active.top}%`\" overflow=\"visible\">\n <path [attr.d]=\"haloPath()\" [attr.fill]=\"active.color\" />\n </svg>\n }\n </svg>\n </div>\n\n @if (shown) {\n <!-- Empty, loading or failed: the message, over the grid and the axes the chart keeps.\n Beside the plot, in its grid cell, and not inside it: the plot is an `img`, which\n makes everything it holds presentational, and the message is a live region. -->\n <wr-chart-state [kind]=\"shown.kind\" [label]=\"shown.label\" />\n }\n\n @if (showAxis()) {\n <!-- The strip is as wide as the plot, and hands the stylesheet the distance between\n two ticks; each label hands it the x of its gridline, as a percentage of the\n drawing's width. -->\n <div class=\"wr-scatter-chart__x-axis\" aria-hidden=\"true\" [style.--wr-scatter-chart-x-slot]=\"xSlot()\">\n @for (tick of xTicks(); track $index) {\n <span class=\"wr-scatter-chart__x-tick\" [style.--wr-scatter-chart-x]=\"tick.left\">{{ tick.label }}</span>\n }\n </div>\n }\n\n @if (xLabel()) {\n <div class=\"wr-scatter-chart__x-title\">{{ xLabel() }}</div>\n }\n</div>\n\n@if (legendShown() && !legendFirst()) {\n <ng-container [ngTemplateOutlet]=\"legend\" />\n}\n\n@if (dataTable() && !shown) {\n <!-- The figures for a screen reader, beside the plot's `img` and never inside it:\n `img` makes everything it holds presentational. Clipped to nothing by its own\n stylesheet, so it takes no room and draws nothing. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n",
|
|
675
|
+
dependencies: [
|
|
676
|
+
{
|
|
677
|
+
kind: "directive",
|
|
678
|
+
type: NgTemplateOutlet,
|
|
679
|
+
selector: "[ngTemplateOutlet]",
|
|
680
|
+
inputs: [
|
|
681
|
+
"ngTemplateOutletContext",
|
|
682
|
+
"ngTemplateOutlet",
|
|
683
|
+
"ngTemplateOutletInjector"
|
|
684
|
+
]
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
kind: "component",
|
|
688
|
+
type: WrChartLegend,
|
|
689
|
+
selector: "ul[wr-chart-legend]",
|
|
690
|
+
inputs: [
|
|
691
|
+
"items",
|
|
692
|
+
"position",
|
|
693
|
+
"toggleable",
|
|
694
|
+
"hiddenSeries",
|
|
695
|
+
"ariaLabel",
|
|
696
|
+
"hiddenLabel"
|
|
697
|
+
],
|
|
698
|
+
outputs: ["hiddenSeriesChange", "toggled"]
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
kind: "component",
|
|
702
|
+
type: WrChartState,
|
|
703
|
+
selector: "wr-chart-state",
|
|
704
|
+
inputs: ["kind", "label"]
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
kind: "component",
|
|
708
|
+
type: WrChartTable,
|
|
709
|
+
selector: "wr-chart-table",
|
|
710
|
+
inputs: ["data"]
|
|
711
|
+
}
|
|
712
|
+
],
|
|
402
713
|
encapsulation: i0.ViewEncapsulation.None
|
|
403
714
|
});
|
|
404
715
|
};
|
|
@@ -413,13 +724,20 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
413
724
|
selector: "wr-scatter-chart",
|
|
414
725
|
encapsulation: ViewEncapsulation.None,
|
|
415
726
|
host: {
|
|
416
|
-
class: "wr-scatter-chart",
|
|
727
|
+
class: "wr-scatter-chart wr-chart--legend",
|
|
728
|
+
"[class.wr-chart--legend-side]": "legendShown() && legendSide()",
|
|
729
|
+
"[class.wr-scatter-chart--axis]": "showAxis()",
|
|
417
730
|
"[class.wr-scatter-chart--bubbles]": "sized()",
|
|
418
731
|
"[style.--wr-scatter-chart-reach-x]": "reach().x",
|
|
419
732
|
"[style.--wr-scatter-chart-reach-y]": "reach().y"
|
|
420
733
|
},
|
|
421
|
-
imports: [
|
|
422
|
-
|
|
734
|
+
imports: [
|
|
735
|
+
NgTemplateOutlet,
|
|
736
|
+
WrChartLegend,
|
|
737
|
+
WrChartState,
|
|
738
|
+
WrChartTable
|
|
739
|
+
],
|
|
740
|
+
template: "@let active = activePoint();\n@let shown = state();\n\n<!-- The legend, drawn before the body or after it so it is in the DOM where it is on\n screen: a toggleable legend's rows are tab stops, and their order follows it. Every\n row keys its series by the series' own marker shape, the channel that tells the\n points apart where the colours do not. Rows are tracked by position, so two series\n that share a label are two rows. -->\n<ng-template #legend>\n <ul\n wr-chart-legend\n class=\"wr-scatter-chart__legend\"\n [items]=\"legendItems()\"\n [position]=\"legendPosition()\"\n [toggleable]=\"toggleableLegend()\"\n [(hiddenSeries)]=\"hiddenSeries\"\n ></ul>\n</ng-template>\n\n@if (legendShown() && legendFirst()) {\n <ng-container [ngTemplateOutlet]=\"legend\" />\n}\n\n<!-- Three columns: the y axis' name turned along the axis, the y tick labels, and the\n drawing, with the x tick labels and the x axis' name under the drawing only, so\n their percentages are the drawing's. -->\n<div class=\"wr-scatter-chart__body\">\n @if (yLabel()) {\n <!-- Along its axis, beside the scale it names: set level above the plot it read as an\n entry of a legend placed there. -->\n <div class=\"wr-scatter-chart__y-title\">{{ yLabel() }}</div>\n }\n\n @if (showAxis()) {\n <!-- HTML beside the drawing rather than `<text>` inside it, in flow, so the column is\n exactly as wide as the longest label; each one hands the stylesheet the y of its\n own gridline. Hidden, as the drawing is one image: its name is what is announced,\n and the values are the data table's. -->\n <div class=\"wr-scatter-chart__y-axis\" aria-hidden=\"true\">\n @for (tick of yTicks(); track $index) {\n <span class=\"wr-scatter-chart__y-tick\" [style.--wr-scatter-chart-y]=\"tick.top\">{{ tick.label }}</span>\n }\n </div>\n }\n\n <!-- The pointer is heard on the plot by one native listener pair the component adds,\n and a point is found by position. -->\n <div\n #plot\n class=\"wr-scatter-chart__plot\"\n role=\"img\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.height.px]=\"height()\"\n >\n <!-- No viewBox: every position is a PERCENTAGE of the drawing, so nothing stretches.\n A viewBox with `preserveAspectRatio=\"none\"` would squash each marker with the\n drawing, a circle into an oval and a square into a bar, and a scatter's marker is\n its series' only channel besides colour. -->\n <!-- Hidden as well as presentational: `img` already makes it so, but every point is\n an `<svg>` of its own, and a tree that holds a node per point for thousands of\n them is work for nothing. -->\n <svg #svg class=\"wr-scatter-chart__svg\" aria-hidden=\"true\">\n @if (showGrid()) {\n @for (tick of yTicks(); track $index) {\n <!-- The line at zero takes the stronger `--wr-scatter-chart-zero-color`. -->\n <line\n class=\"wr-scatter-chart__grid-line\"\n [class.wr-scatter-chart__grid-line--zero]=\"tick.zero\"\n x1=\"0\"\n x2=\"100%\"\n [attr.y1]=\"`${tick.top}%`\"\n [attr.y2]=\"`${tick.top}%`\"\n />\n }\n @for (tick of xTicks(); track $index) {\n <!-- Painted `transparent` by default: a chart reads its values across. The\n lines stay so that `--wr-scatter-chart-grid-x-color` can draw them. -->\n <line\n class=\"wr-scatter-chart__grid-line wr-scatter-chart__grid-line--x\"\n [attr.x1]=\"`${tick.left}%`\"\n [attr.x2]=\"`${tick.left}%`\"\n y1=\"0\"\n y2=\"100%\"\n />\n }\n }\n\n @if (!shown) {\n @for (run of runs(); track run.key) {\n <!-- A stretch of one series' points, in drawing order. The group carries what\n they share: the fill, the shape, and `data-wr-series`, the series' row in\n the legend, which the shared hover dims by. -->\n <g\n class=\"wr-scatter-chart__series\"\n [attr.fill]=\"run.color\"\n [attr.data-wr-series]=\"run.series\"\n [attr.data-marker]=\"run.marker\"\n >\n @for (p of run.points; track p.key) {\n <!-- A nested `<svg>` placed by percentage, its marker drawn about its origin\n in px: an SVG's `x` and `y` take a percentage where a `transform` does\n not, so the marker sits on its point at any size and keeps its own. Its\n viewport is the drawing's whole box, painted nowhere, and `overflow`\n lets the marker reach outside it. `data-point` is the point's x, y and\n radius, and its size when it has one: what a test harness reads. -->\n <svg\n class=\"wr-scatter-chart__point\"\n [attr.x]=\"`${p.left}%`\"\n [attr.y]=\"`${p.top}%`\"\n overflow=\"visible\"\n [attr.data-point]=\"p.values\"\n >\n <path class=\"wr-scatter-chart__marker\" [attr.d]=\"p.d\" />\n </svg>\n }\n </g>\n }\n\n @if (dense()) {\n <!-- Too many points for a node each: every series is one path, a subpath per\n marker, in px of the drawing's measured size. The `viewBox` is that size, so\n nothing is scaled once it is measured; before that, and between a resize and\n the path written for it, the markers stretch with the box. -->\n <svg\n class=\"wr-scatter-chart__dense\"\n [attr.viewBox]=\"denseBox()\"\n preserveAspectRatio=\"none\"\n width=\"100%\"\n height=\"100%\"\n overflow=\"visible\"\n >\n @for (s of densePaths(); track s.series) {\n <path\n class=\"wr-scatter-chart__points wr-scatter-chart__marker\"\n vector-effect=\"non-scaling-stroke\"\n [attr.d]=\"s.d\"\n [attr.fill]=\"s.color\"\n [attr.data-wr-series]=\"s.series\"\n [attr.data-marker]=\"s.marker\"\n [attr.data-count]=\"s.count\"\n />\n }\n </svg>\n }\n }\n\n @if (active) {\n <!-- The point being read, drawn again over the rest: its own shape a little\n larger, solid, inside a ring of the surface. -->\n <svg class=\"wr-scatter-chart__halo\" [attr.x]=\"`${active.left}%`\" [attr.y]=\"`${active.top}%`\" overflow=\"visible\">\n <path [attr.d]=\"haloPath()\" [attr.fill]=\"active.color\" />\n </svg>\n }\n </svg>\n </div>\n\n @if (shown) {\n <!-- Empty, loading or failed: the message, over the grid and the axes the chart keeps.\n Beside the plot, in its grid cell, and not inside it: the plot is an `img`, which\n makes everything it holds presentational, and the message is a live region. -->\n <wr-chart-state [kind]=\"shown.kind\" [label]=\"shown.label\" />\n }\n\n @if (showAxis()) {\n <!-- The strip is as wide as the plot, and hands the stylesheet the distance between\n two ticks; each label hands it the x of its gridline, as a percentage of the\n drawing's width. -->\n <div class=\"wr-scatter-chart__x-axis\" aria-hidden=\"true\" [style.--wr-scatter-chart-x-slot]=\"xSlot()\">\n @for (tick of xTicks(); track $index) {\n <span class=\"wr-scatter-chart__x-tick\" [style.--wr-scatter-chart-x]=\"tick.left\">{{ tick.label }}</span>\n }\n </div>\n }\n\n @if (xLabel()) {\n <div class=\"wr-scatter-chart__x-title\">{{ xLabel() }}</div>\n }\n</div>\n\n@if (legendShown() && !legendFirst()) {\n <ng-container [ngTemplateOutlet]=\"legend\" />\n}\n\n@if (dataTable() && !shown) {\n <!-- The figures for a screen reader, beside the plot's `img` and never inside it:\n `img` makes everything it holds presentational. Clipped to nothing by its own\n stylesheet, so it takes no room and draws nothing. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n"
|
|
423
741
|
}]
|
|
424
742
|
}],
|
|
425
743
|
ctorParameters: () => [],
|
|
@@ -488,6 +806,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
488
806
|
required: false
|
|
489
807
|
}]
|
|
490
808
|
}],
|
|
809
|
+
showAxis: [{
|
|
810
|
+
type: i0.Input,
|
|
811
|
+
args: [{
|
|
812
|
+
isSignal: true,
|
|
813
|
+
alias: "showAxis",
|
|
814
|
+
required: false
|
|
815
|
+
}]
|
|
816
|
+
}],
|
|
491
817
|
showLegend: [{
|
|
492
818
|
type: i0.Input,
|
|
493
819
|
args: [{
|
|
@@ -496,6 +822,54 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
496
822
|
required: false
|
|
497
823
|
}]
|
|
498
824
|
}],
|
|
825
|
+
legendPosition: [{
|
|
826
|
+
type: i0.Input,
|
|
827
|
+
args: [{
|
|
828
|
+
isSignal: true,
|
|
829
|
+
alias: "legendPosition",
|
|
830
|
+
required: false
|
|
831
|
+
}]
|
|
832
|
+
}],
|
|
833
|
+
loading: [{
|
|
834
|
+
type: i0.Input,
|
|
835
|
+
args: [{
|
|
836
|
+
isSignal: true,
|
|
837
|
+
alias: "loading",
|
|
838
|
+
required: false
|
|
839
|
+
}]
|
|
840
|
+
}],
|
|
841
|
+
error: [{
|
|
842
|
+
type: i0.Input,
|
|
843
|
+
args: [{
|
|
844
|
+
isSignal: true,
|
|
845
|
+
alias: "error",
|
|
846
|
+
required: false
|
|
847
|
+
}]
|
|
848
|
+
}],
|
|
849
|
+
emptyLabel: [{
|
|
850
|
+
type: i0.Input,
|
|
851
|
+
args: [{
|
|
852
|
+
isSignal: true,
|
|
853
|
+
alias: "emptyLabel",
|
|
854
|
+
required: false
|
|
855
|
+
}]
|
|
856
|
+
}],
|
|
857
|
+
loadingLabel: [{
|
|
858
|
+
type: i0.Input,
|
|
859
|
+
args: [{
|
|
860
|
+
isSignal: true,
|
|
861
|
+
alias: "loadingLabel",
|
|
862
|
+
required: false
|
|
863
|
+
}]
|
|
864
|
+
}],
|
|
865
|
+
errorLabel: [{
|
|
866
|
+
type: i0.Input,
|
|
867
|
+
args: [{
|
|
868
|
+
isSignal: true,
|
|
869
|
+
alias: "errorLabel",
|
|
870
|
+
required: false
|
|
871
|
+
}]
|
|
872
|
+
}],
|
|
499
873
|
toggleableLegend: [{
|
|
500
874
|
type: i0.Input,
|
|
501
875
|
args: [{
|
|
@@ -542,6 +916,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
542
916
|
svg: [{
|
|
543
917
|
type: i0.ViewChild,
|
|
544
918
|
args: ["svg", { isSignal: true }]
|
|
919
|
+
}],
|
|
920
|
+
plot: [{
|
|
921
|
+
type: i0.ViewChild,
|
|
922
|
+
args: ["plot", { isSignal: true }]
|
|
545
923
|
}]
|
|
546
924
|
}
|
|
547
925
|
});
|