@motifx-community/ui 0.1.0-beta.5 → 0.1.0-beta.7
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/CHANGELOG.md +101 -0
- package/README.md +7 -4
- package/dist/components/appbar/AppBar.d.ts +88 -0
- package/dist/components/appbar/app-bar-navigation-click-event-args.d.ts +9 -0
- package/dist/components/appbar/app-bar-navigation.d.ts +2 -0
- package/dist/components/appbar/app-bar-position.d.ts +2 -0
- package/dist/components/appbar/app-bar-props.d.ts +49 -0
- package/dist/components/appbar/app-bar-scroll-behavior.d.ts +2 -0
- package/dist/components/appbar/app-bar-title-align.d.ts +2 -0
- package/dist/components/appbar/app-bar-tone.d.ts +2 -0
- package/dist/components/appbar/index.d.ts +8 -0
- package/dist/components/barcode/Barcode.d.ts +62 -0
- package/dist/components/barcode/barcode-export-options.d.ts +9 -0
- package/dist/components/barcode/barcode-failed-event-args.d.ts +9 -0
- package/dist/components/barcode/barcode-props.d.ts +25 -0
- package/dist/components/barcode/index.d.ts +5 -0
- package/dist/components/bargauge/BarGauge.d.ts +120 -0
- package/dist/components/bargauge/bar-gauge-props.d.ts +38 -0
- package/dist/components/bargauge/index.d.ts +2 -0
- package/dist/components/bottomnavigation/BottomNavigation.d.ts +101 -0
- package/dist/components/bottomnavigation/bottom-navigation-item-click-event-args.d.ts +9 -0
- package/dist/components/bottomnavigation/bottom-navigation-item.d.ts +35 -0
- package/dist/components/bottomnavigation/bottom-navigation-label-mode.d.ts +2 -0
- package/dist/components/bottomnavigation/bottom-navigation-position.d.ts +2 -0
- package/dist/components/bottomnavigation/bottom-navigation-props.d.ts +31 -0
- package/dist/components/bottomnavigation/bottom-navigation-selecting-event-args.d.ts +5 -0
- package/dist/components/bottomnavigation/bottom-navigation-selection-changed-event-args.d.ts +11 -0
- package/dist/components/bottomnavigation/index.d.ts +8 -0
- package/dist/components/chart/Chart.d.ts +229 -0
- package/dist/components/chart/ChartLegend.d.ts +24 -0
- package/dist/components/chart/ChartPlot.d.ts +161 -0
- package/dist/components/chart/ChartTable.d.ts +68 -0
- package/dist/components/chart/ChartTooltip.d.ts +22 -0
- package/dist/components/chart/PartsPlot.d.ts +39 -0
- package/dist/components/chart/RadarPlot.d.ts +34 -0
- package/dist/components/chart/chart-axis-kind.d.ts +2 -0
- package/dist/components/chart/chart-axis.d.ts +31 -0
- package/dist/components/chart/chart-data-error-event-args.d.ts +7 -0
- package/dist/components/chart/chart-export-options.d.ts +7 -0
- package/dist/components/chart/chart-export.d.ts +12 -0
- package/dist/components/chart/chart-field.d.ts +2 -0
- package/dist/components/chart/chart-labels.d.ts +2 -0
- package/dist/components/chart/chart-legend-options.d.ts +10 -0
- package/dist/components/chart/chart-legend-position.d.ts +2 -0
- package/dist/components/chart/chart-look.d.ts +25 -0
- package/dist/components/chart/chart-mode-changed-event-args.d.ts +7 -0
- package/dist/components/chart/chart-mode.d.ts +2 -0
- package/dist/components/chart/chart-model.d.ts +105 -0
- package/dist/components/chart/chart-point-event-args.d.ts +9 -0
- package/dist/components/chart/chart-point-selection.d.ts +2 -0
- package/dist/components/chart/chart-point.d.ts +23 -0
- package/dist/components/chart/chart-props.d.ts +76 -0
- package/dist/components/chart/chart-reference.d.ts +12 -0
- package/dist/components/chart/chart-selection-changed-event-args.d.ts +8 -0
- package/dist/components/chart/chart-series-toggled-event-args.d.ts +10 -0
- package/dist/components/chart/chart-series-type.d.ts +6 -0
- package/dist/components/chart/chart-series.d.ts +55 -0
- package/dist/components/chart/chart-stacked.d.ts +2 -0
- package/dist/components/chart/chart-tooltip-context.d.ts +10 -0
- package/dist/components/chart/chart-tooltip-options.d.ts +10 -0
- package/dist/components/chart/chart-zoom-changed-event-args.d.ts +8 -0
- package/dist/components/chart/index.d.ts +21 -0
- package/dist/components/chart/legend-entry.d.ts +13 -0
- package/dist/components/chart/plot-text.d.ts +10 -0
- package/dist/components/chart/plot-view.d.ts +61 -0
- package/dist/components/datagrid/grid-lookup.d.ts +3 -3
- package/dist/components/datagrid/grid-settings.d.ts +3 -3
- package/dist/components/datagrid/model/GridData.d.ts +22 -3
- package/dist/components/datagrid/model/GridModel.d.ts +2 -0
- package/dist/components/gauge/Gauge.d.ts +179 -0
- package/dist/components/gauge/gauge-mark.d.ts +9 -0
- package/dist/components/gauge/gauge-marker.d.ts +2 -0
- package/dist/components/gauge/gauge-needle-shape.d.ts +2 -0
- package/dist/components/gauge/gauge-orientation.d.ts +2 -0
- package/dist/components/gauge/gauge-props.d.ts +58 -0
- package/dist/components/gauge/gauge-range.d.ts +11 -0
- package/dist/components/gauge/gauge-scale.d.ts +2 -0
- package/dist/components/gauge/gauge-shape.d.ts +43 -0
- package/dist/components/gauge/gauge-type.d.ts +2 -0
- package/dist/components/gauge/index.d.ts +9 -0
- package/dist/components/listbox/list-rows.d.ts +2 -0
- package/dist/components/otpinput/OtpInput.d.ts +73 -0
- package/dist/components/otpinput/index.d.ts +4 -0
- package/dist/components/otpinput/otp-charset.d.ts +2 -0
- package/dist/components/otpinput/otp-completed-event-args.d.ts +8 -0
- package/dist/components/otpinput/otp-input-props.d.ts +32 -0
- package/dist/components/qrcode/QRCode.d.ts +58 -0
- package/dist/components/qrcode/index.d.ts +5 -0
- package/dist/components/qrcode/qr-code-export-options.d.ts +9 -0
- package/dist/components/qrcode/qr-code-failed-event-args.d.ts +7 -0
- package/dist/components/qrcode/qr-code-props.d.ts +23 -0
- package/dist/components/signature/Signature.d.ts +100 -0
- package/dist/components/signature/index.d.ts +5 -0
- package/dist/components/signature/signature-draw.d.ts +15 -0
- package/dist/components/signature/signature-export-options.d.ts +11 -0
- package/dist/components/signature/signature-props.d.ts +30 -0
- package/dist/components/signature/signature-stroke-event-args.d.ts +9 -0
- package/dist/components/signature/signature-stroke.d.ts +11 -0
- package/dist/components/sparkline/Sparkline.d.ts +85 -0
- package/dist/components/sparkline/index.d.ts +4 -0
- package/dist/components/sparkline/sparkline-highlight.d.ts +2 -0
- package/dist/components/sparkline/sparkline-props.d.ts +34 -0
- package/dist/components/sparkline/sparkline-type.d.ts +2 -0
- package/dist/components/validationsummary/ValidationSummary.d.ts +1 -0
- package/dist/core/fonts-loaded.d.ts +2 -0
- package/dist/core/scroll-watch.d.ts +13 -0
- package/dist/core/ui-strings.d.ts +38 -0
- package/dist/generated/tokens.d.ts +3023 -863
- package/dist/index.d.ts +10 -0
- package/dist/index.js +55933 -47186
- package/dist/index.js.map +1 -1
- package/dist/locales/en.json +37 -1
- package/dist/locales/tr.json +37 -1
- package/dist/parts/chart/chart-paths.d.ts +30 -0
- package/dist/parts/chart/chart-scale.d.ts +13 -0
- package/dist/parts/chart/chart-text.d.ts +12 -0
- package/dist/parts/chart/nice-ticks.d.ts +6 -0
- package/dist/parts/chart/svg-parts.d.ts +12 -0
- package/dist/parts/chart/thin-out.d.ts +6 -0
- package/dist/parts/chart/time-ticks.d.ts +7 -0
- package/dist/parts/chart/token-lengths.d.ts +16 -0
- package/dist/parts/chart/value-motion.d.ts +16 -0
- package/dist/parts/code/barcode-encode.d.ts +23 -0
- package/dist/parts/code/code-image.d.ts +35 -0
- package/dist/parts/code/qr-encode.d.ts +10 -0
- package/dist/parts/data/DataItems.d.ts +2 -0
- package/dist/parts/data/KeyedItems.d.ts +1 -0
- package/dist/parts/field/Field.d.ts +2 -0
- package/dist/parts/list/OptionList.d.ts +6 -0
- package/dist/parts/list/item-source.d.ts +4 -0
- package/dist/styles.css +3043 -9
- package/dist/tokens/index.d.ts +3212 -967
- package/dist/tokens/index.js +3023 -863
- package/dist/tokens/index.js.map +1 -1
- package/dist/{tr-C5IXRzAH.js → tr-DhIFcH3c.js} +75 -3
- package/dist/{tr-C5IXRzAH.js.map → tr-DhIFcH3c.js.map} +1 -1
- package/docs/accordion.md +1 -1
- package/docs/actionsheet.md +1 -1
- package/docs/appbar.md +194 -0
- package/docs/avatar.md +1 -1
- package/docs/badge.md +1 -1
- package/docs/bar-gauge-angles.md +87 -0
- package/docs/bar-gauge-data.md +122 -0
- package/docs/bar-gauge-labels.md +78 -0
- package/docs/bar-gauge.md +98 -0
- package/docs/barcode.md +193 -0
- package/docs/bottomnavigation.md +258 -0
- package/docs/bottomsheet.md +1 -1
- package/docs/breadcrumb.md +1 -1
- package/docs/button.md +1 -1
- package/docs/buttongroup.md +1 -1
- package/docs/buttons.md +169 -0
- package/docs/calendar.md +1 -1
- package/docs/card.md +1 -1
- package/docs/chart-bars.md +142 -0
- package/docs/chart-candles.md +164 -0
- package/docs/chart-funnel.md +115 -0
- package/docs/chart-heatmap.md +93 -0
- package/docs/chart-lines.md +128 -0
- package/docs/chart-live.md +62 -0
- package/docs/chart-pie.md +125 -0
- package/docs/chart-radar.md +124 -0
- package/docs/chart-ranges.md +127 -0
- package/docs/chart-references.md +126 -0
- package/docs/chart-scatter.md +139 -0
- package/docs/chart-waterfall.md +111 -0
- package/docs/chart-zoom.md +95 -0
- package/docs/chart.md +427 -0
- package/docs/checkbox.md +1 -1
- package/docs/chip.md +1 -1
- package/docs/choice.md +151 -0
- package/docs/colorbox.md +1 -1
- package/docs/combobox.md +1 -1
- package/docs/control.md +1 -1
- package/docs/data.md +127 -0
- package/docs/datagrid-api.md +1 -1
- package/docs/datagrid-bands.md +1 -1
- package/docs/datagrid-drag-select.md +1 -1
- package/docs/datagrid-drag.md +1 -1
- package/docs/datagrid-editing.md +1 -1
- package/docs/datagrid-filtering.md +1 -1
- package/docs/datagrid-forms.md +1 -1
- package/docs/datagrid-grouping.md +62 -2
- package/docs/datagrid-layout.md +2 -2
- package/docs/datagrid-lookups.md +2 -2
- package/docs/datagrid-master-detail.md +1 -1
- package/docs/datagrid-scrolling.md +1 -1
- package/docs/datagrid-selection.md +1 -1
- package/docs/datagrid.md +1 -1
- package/docs/datebox.md +1 -1
- package/docs/daterangebox.md +1 -1
- package/docs/display.md +148 -0
- package/docs/draggable.md +1 -1
- package/docs/drawer.md +1 -1
- package/docs/dropdown.md +1 -1
- package/docs/editors.md +157 -0
- package/docs/feedback.md +138 -0
- package/docs/fileuploader.md +1 -1
- package/docs/filterbuilder.md +1 -1
- package/docs/formlayout.md +1 -1
- package/docs/foundations.md +79 -0
- package/docs/gallery.md +1 -1
- package/docs/gauge-base.md +78 -0
- package/docs/gauge-circular.md +101 -0
- package/docs/gauge-dashboards.md +134 -0
- package/docs/gauge-linear.md +84 -0
- package/docs/gauge-markers.md +135 -0
- package/docs/gauge-marks.md +108 -0
- package/docs/gauge-ranges.md +133 -0
- package/docs/gauge-scales.md +117 -0
- package/docs/gauge.md +152 -0
- package/docs/home.md +1 -1
- package/docs/keyboard.md +1 -1
- package/docs/language.md +1 -1
- package/docs/layout.md +1 -1
- package/docs/listbox.md +1 -1
- package/docs/loadpanel.md +1 -1
- package/docs/lookup.md +1 -1
- package/docs/menus.md +1 -1
- package/docs/multiview.md +1 -1
- package/docs/navigation.md +143 -0
- package/docs/numberbox.md +1 -1
- package/docs/otpinput.md +197 -0
- package/docs/pagination.md +1 -1
- package/docs/popover.md +1 -1
- package/docs/progress.md +1 -1
- package/docs/qrcode.md +179 -0
- package/docs/radiogroup.md +1 -1
- package/docs/rating.md +1 -1
- package/docs/resizable.md +1 -1
- package/docs/scheduler-agenda.md +1 -1
- package/docs/scheduler-big-data.md +1 -1
- package/docs/scheduler-editing.md +1 -1
- package/docs/scheduler-form.md +1 -1
- package/docs/scheduler-icalendar.md +1 -1
- package/docs/scheduler-mobile.md +1 -1
- package/docs/scheduler-recurrence.md +1 -1
- package/docs/scheduler-resources.md +1 -1
- package/docs/scheduler-timeline.md +1 -1
- package/docs/scheduler.md +1 -1
- package/docs/scrollview.md +1 -1
- package/docs/showcase-home.md +31 -0
- package/docs/showcase.md +1 -1
- package/docs/signature.md +208 -0
- package/docs/skeleton.md +1 -1
- package/docs/slider.md +1 -1
- package/docs/sortable.md +1 -1
- package/docs/sparkline.md +119 -0
- package/docs/speeddial.md +1 -1
- package/docs/splitter.md +1 -1
- package/docs/stepper.md +1 -1
- package/docs/switch.md +1 -1
- package/docs/tabdocs-dock.md +1 -1
- package/docs/tabdocs-drag.md +1 -1
- package/docs/tabdocs-menus.md +1 -1
- package/docs/tabdocs-mobile.md +1 -1
- package/docs/tabdocs-tabs.md +1 -1
- package/docs/tabdocs-windows.md +1 -1
- package/docs/tabdocs-workspace.md +1 -1
- package/docs/tabdocs.md +1 -1
- package/docs/tabs.md +1 -1
- package/docs/tagbox.md +1 -1
- package/docs/textarea.md +1 -1
- package/docs/textbox.md +1 -1
- package/docs/tileview.md +1 -1
- package/docs/timeline.md +1 -1
- package/docs/toast.md +1 -1
- package/docs/tokens.md +450 -1
- package/docs/toolbar.md +1 -1
- package/docs/tooltip.md +1 -1
- package/docs/treeview.md +1 -1
- package/docs/validationsummary.md +1 -1
- package/docs/window.md +1 -1
- package/docs/wizard.md +1 -1
- package/llms-full.txt +6725 -99
- package/llms.txt +50 -1
- package/package.json +5 -5
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Component, Emitter, type Bind, type ComponentBase, type Event as MotifEvent, type IBaseProp } from "@motifx/core";
|
|
2
|
+
import { Control } from "../../core/control";
|
|
3
|
+
import type { IconSource } from "../../core/icon-source";
|
|
4
|
+
import { Badge } from "../badge/Badge";
|
|
5
|
+
import type { BottomNavigationItem } from "./bottom-navigation-item";
|
|
6
|
+
import type { BottomNavigationItemClickEventArgs } from "./bottom-navigation-item-click-event-args";
|
|
7
|
+
import type { BottomNavigationLabelMode } from "./bottom-navigation-label-mode";
|
|
8
|
+
import type { BottomNavigationPosition } from "./bottom-navigation-position";
|
|
9
|
+
import type { BottomNavigationProps } from "./bottom-navigation-props";
|
|
10
|
+
import type { BottomNavigationSelectingEventArgs } from "./bottom-navigation-selecting-event-args";
|
|
11
|
+
import type { BottomNavigationSelectionChangedEventArgs } from "./bottom-navigation-selection-changed-event-args";
|
|
12
|
+
type Value = string | number;
|
|
13
|
+
interface Look {
|
|
14
|
+
item: BottomNavigationItem;
|
|
15
|
+
value: Value;
|
|
16
|
+
text: string;
|
|
17
|
+
glyph: string;
|
|
18
|
+
activeGlyph: string;
|
|
19
|
+
icon: IconSource | null;
|
|
20
|
+
activeIcon: IconSource | null;
|
|
21
|
+
href: string;
|
|
22
|
+
rel: string;
|
|
23
|
+
target: string;
|
|
24
|
+
badge: number | null;
|
|
25
|
+
dot: boolean;
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
visible: boolean;
|
|
28
|
+
}
|
|
29
|
+
interface ItemPart {
|
|
30
|
+
item: BottomNavigationItem;
|
|
31
|
+
host: Component<HTMLElement>;
|
|
32
|
+
iconHost: Component<HTMLSpanElement>;
|
|
33
|
+
glyph: Component<HTMLSpanElement>;
|
|
34
|
+
icon: ComponentBase | null;
|
|
35
|
+
iconSource: IconSource | null;
|
|
36
|
+
label: Component<HTMLSpanElement>;
|
|
37
|
+
badge: Badge | null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The destinations of an application at the bottom of the screen (`<nav>`), three to five of them, each an icon with a
|
|
41
|
+
* label. It is one Tab stop: the arrow keys, Home and End move between the items, and Enter or Space selects one. The
|
|
42
|
+
* selected item is marked for screen readers with `aria-current`. An item with `href` is a link, for routed pages. The
|
|
43
|
+
* bar keeps clear of the home indicator of a phone, and it can leave while scrolling down (`hideOnScroll`).
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* <BottomNavigation x-model={() => this.page} items={[
|
|
47
|
+
* { value: 'home', text: 'Home', glyph: 'star' },
|
|
48
|
+
* { value: 'inbox', text: 'Inbox', glyph: 'file', badge: () => this.unread },
|
|
49
|
+
* { value: 'me', text: 'Profile', glyph: 'person' },
|
|
50
|
+
* ]} />
|
|
51
|
+
*/
|
|
52
|
+
export declare class BottomNavigation extends Control<HTMLElement, BottomNavigationProps> {
|
|
53
|
+
selecting: Emitter<BottomNavigationSelectingEventArgs>;
|
|
54
|
+
selectionChanged: Emitter<BottomNavigationSelectionChangedEventArgs>;
|
|
55
|
+
itemClick: Emitter<BottomNavigationItemClickEventArgs>;
|
|
56
|
+
list: Component<HTMLDivElement>;
|
|
57
|
+
parts: ItemPart[];
|
|
58
|
+
looks: Look[];
|
|
59
|
+
stopItems: (() => void) | null;
|
|
60
|
+
stopScroll: (() => void) | null;
|
|
61
|
+
constructor(props?: IBaseProp<BottomNavigationProps>);
|
|
62
|
+
onMounted(): void;
|
|
63
|
+
get items(): readonly BottomNavigationItem[];
|
|
64
|
+
set items(value: Bind<readonly BottomNavigationItem[]>);
|
|
65
|
+
get value(): Value | null;
|
|
66
|
+
set value(value: Bind<Value | null>);
|
|
67
|
+
get label(): string;
|
|
68
|
+
set label(value: Bind<string>);
|
|
69
|
+
get labelMode(): BottomNavigationLabelMode;
|
|
70
|
+
set labelMode(value: Bind<BottomNavigationLabelMode>);
|
|
71
|
+
get position(): BottomNavigationPosition;
|
|
72
|
+
set position(value: Bind<BottomNavigationPosition>);
|
|
73
|
+
get hideOnScroll(): boolean;
|
|
74
|
+
set hideOnScroll(value: Bind<boolean>);
|
|
75
|
+
get scrollTarget(): HTMLElement | null;
|
|
76
|
+
set scrollTarget(value: Bind<HTMLElement | null>);
|
|
77
|
+
get onSelecting(): MotifEvent<BottomNavigationSelectingEventArgs>;
|
|
78
|
+
get onSelectionChanged(): MotifEvent<BottomNavigationSelectionChangedEventArgs>;
|
|
79
|
+
get onItemClick(): MotifEvent<BottomNavigationItemClickEventArgs>;
|
|
80
|
+
/** The selected item, or `null`. */
|
|
81
|
+
get selectedItem(): BottomNavigationItem | null;
|
|
82
|
+
/** Moves focus to the item Tab reaches. */
|
|
83
|
+
focus(): boolean;
|
|
84
|
+
renderItems(): void;
|
|
85
|
+
lookOf(item: BottomNavigationItem, index: number): Look;
|
|
86
|
+
drawItems(): void;
|
|
87
|
+
makeItem(look: Look): ItemPart;
|
|
88
|
+
drawBadge(p: ItemPart, look: Look): void;
|
|
89
|
+
drawIcon(p: ItemPart, look: Look, selected: boolean): void;
|
|
90
|
+
drawSelection(): void;
|
|
91
|
+
drawName(): void;
|
|
92
|
+
drawLook(): void;
|
|
93
|
+
followScroll(): void;
|
|
94
|
+
lookOfValue(value: Value | null): Look | null;
|
|
95
|
+
indexOfElement(target: EventTarget | null): number;
|
|
96
|
+
listClick(e: MouseEvent): void;
|
|
97
|
+
/** Selects `look` unless `onSelecting` refuses. Returns `false` when it was refused. */
|
|
98
|
+
select(look: Look, originalEvent: Event): boolean;
|
|
99
|
+
listKeyDown(e: KeyboardEvent): void;
|
|
100
|
+
}
|
|
101
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BottomNavigation } from "./BottomNavigation";
|
|
2
|
+
import type { BottomNavigationItem } from "./bottom-navigation-item";
|
|
3
|
+
/** Data of `BottomNavigation.onItemClick` and of an item's `click`. */
|
|
4
|
+
export interface BottomNavigationItemClickEventArgs {
|
|
5
|
+
item: BottomNavigationItem;
|
|
6
|
+
value: string | number;
|
|
7
|
+
originalEvent: Event;
|
|
8
|
+
source: BottomNavigation;
|
|
9
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Bind } from "@motifx/core";
|
|
2
|
+
import type { IconSource } from "../../core/icon-source";
|
|
3
|
+
import type { BottomNavigationItemClickEventArgs } from "./bottom-navigation-item-click-event-args";
|
|
4
|
+
/** One destination of `BottomNavigation.items`. Every field except `click` and `data` accepts a value or a function. */
|
|
5
|
+
export interface BottomNavigationItem {
|
|
6
|
+
/** What `value` is when this item is selected. The default is its position. */
|
|
7
|
+
value?: string | number;
|
|
8
|
+
text: Bind<string>;
|
|
9
|
+
/** The name of a glyph. */
|
|
10
|
+
glyph?: Bind<string>;
|
|
11
|
+
/** The glyph while selected, such as a filled one. The default is `glyph`. */
|
|
12
|
+
activeGlyph?: Bind<string>;
|
|
13
|
+
/** An image, an element or a component, used instead of `glyph`. */
|
|
14
|
+
icon?: Bind<IconSource | null | undefined>;
|
|
15
|
+
/** The icon while selected. The default is `icon`. */
|
|
16
|
+
activeIcon?: Bind<IconSource | null | undefined>;
|
|
17
|
+
/** Makes the item a link to this address. */
|
|
18
|
+
href?: Bind<string>;
|
|
19
|
+
/** The `rel` of the link, such as `'router'`. */
|
|
20
|
+
rel?: Bind<string>;
|
|
21
|
+
/** The `target` of the link. */
|
|
22
|
+
target?: Bind<string>;
|
|
23
|
+
/** A count in a badge on the icon. */
|
|
24
|
+
badge?: Bind<number | null>;
|
|
25
|
+
/** A dot on the icon instead of a count. The default is `false`. */
|
|
26
|
+
dot?: Bind<boolean>;
|
|
27
|
+
/** `false` dims the item, and it cannot be selected. The default is `true`. */
|
|
28
|
+
enabled?: Bind<boolean>;
|
|
29
|
+
/** `false` removes the item. The default is `true`. */
|
|
30
|
+
visible?: Bind<boolean>;
|
|
31
|
+
/** Occurs when the item is pressed. */
|
|
32
|
+
click?: (e: BottomNavigationItemClickEventArgs) => void;
|
|
33
|
+
/** A custom application value for the item. */
|
|
34
|
+
data?: unknown;
|
|
35
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Bind } from "@motifx/core";
|
|
2
|
+
import type { ControlProps } from "../../core/control";
|
|
3
|
+
import type { BottomNavigationItem } from "./bottom-navigation-item";
|
|
4
|
+
import type { BottomNavigationItemClickEventArgs } from "./bottom-navigation-item-click-event-args";
|
|
5
|
+
import type { BottomNavigationLabelMode } from "./bottom-navigation-label-mode";
|
|
6
|
+
import type { BottomNavigationPosition } from "./bottom-navigation-position";
|
|
7
|
+
import type { BottomNavigationSelectingEventArgs } from "./bottom-navigation-selecting-event-args";
|
|
8
|
+
import type { BottomNavigationSelectionChangedEventArgs } from "./bottom-navigation-selection-changed-event-args";
|
|
9
|
+
/** Props of `BottomNavigation`. Each prop is also a settable property, and a function is tracked. */
|
|
10
|
+
export interface BottomNavigationProps extends ControlProps {
|
|
11
|
+
/** The destinations, three to five of them. */
|
|
12
|
+
items?: Bind<readonly BottomNavigationItem[]>;
|
|
13
|
+
/** The `value` of the selected item. `x-model` provides two-way binding. */
|
|
14
|
+
value?: Bind<string | number | null>;
|
|
15
|
+
/** The accessible name of the bar. This is the same property as `text`. By default, it is a kit string. */
|
|
16
|
+
label?: Bind<string>;
|
|
17
|
+
/** The default is `'always'`. */
|
|
18
|
+
labelMode?: Bind<BottomNavigationLabelMode>;
|
|
19
|
+
/** The default is `'fixed'`. */
|
|
20
|
+
position?: Bind<BottomNavigationPosition>;
|
|
21
|
+
/** Moves the bar out of sight while scrolling down. The default is `false`. */
|
|
22
|
+
hideOnScroll?: Bind<boolean>;
|
|
23
|
+
/** What `hideOnScroll` watches. By default, the nearest ancestor that scrolls, else the page. */
|
|
24
|
+
scrollTarget?: Bind<HTMLElement | null>;
|
|
25
|
+
/** Occurs before the selection changes. Setting `cancel` keeps the current item. */
|
|
26
|
+
onSelecting?: (e: BottomNavigationSelectingEventArgs) => void;
|
|
27
|
+
/** Occurs after the selection changes. */
|
|
28
|
+
onSelectionChanged?: (e: BottomNavigationSelectionChangedEventArgs) => void;
|
|
29
|
+
/** Occurs when an item is pressed, after its own `click`. */
|
|
30
|
+
onItemClick?: (e: BottomNavigationItemClickEventArgs) => void;
|
|
31
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BottomNavigationSelectionChangedEventArgs } from "./bottom-navigation-selection-changed-event-args";
|
|
2
|
+
/** Data of `BottomNavigation.onSelecting`. Setting `cancel` keeps the current item, and a link is not followed. */
|
|
3
|
+
export interface BottomNavigationSelectingEventArgs extends BottomNavigationSelectionChangedEventArgs {
|
|
4
|
+
cancel: boolean;
|
|
5
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BottomNavigation } from "./BottomNavigation";
|
|
2
|
+
import type { BottomNavigationItem } from "./bottom-navigation-item";
|
|
3
|
+
/** Data of `BottomNavigation.onSelectionChanged`. */
|
|
4
|
+
export interface BottomNavigationSelectionChangedEventArgs {
|
|
5
|
+
value: string | number;
|
|
6
|
+
previous: string | number | null;
|
|
7
|
+
item: BottomNavigationItem;
|
|
8
|
+
previousItem: BottomNavigationItem | null;
|
|
9
|
+
originalEvent: Event;
|
|
10
|
+
source: BottomNavigation;
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { BottomNavigation } from "./BottomNavigation";
|
|
2
|
+
export type { BottomNavigationItem } from "./bottom-navigation-item";
|
|
3
|
+
export type { BottomNavigationItemClickEventArgs } from "./bottom-navigation-item-click-event-args";
|
|
4
|
+
export type { BottomNavigationLabelMode } from "./bottom-navigation-label-mode";
|
|
5
|
+
export type { BottomNavigationPosition } from "./bottom-navigation-position";
|
|
6
|
+
export type { BottomNavigationProps } from "./bottom-navigation-props";
|
|
7
|
+
export type { BottomNavigationSelectingEventArgs } from "./bottom-navigation-selecting-event-args";
|
|
8
|
+
export type { BottomNavigationSelectionChangedEventArgs } from "./bottom-navigation-selection-changed-event-args";
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { Emitter, type Bind, type Component, type Event as MotifEvent, type IBaseProp, type IDisposable } from "@motifx/core";
|
|
2
|
+
import type { data } from "@motifx-community/data";
|
|
3
|
+
import { Control } from "../../core/control";
|
|
4
|
+
import { ResizeWatch } from "../../core/resize-watch";
|
|
5
|
+
import { TokenLengths } from "../../parts/chart/token-lengths";
|
|
6
|
+
import { Button } from "../button/Button";
|
|
7
|
+
import type { ChartAxis } from "./chart-axis";
|
|
8
|
+
import type { ChartDataErrorEventArgs } from "./chart-data-error-event-args";
|
|
9
|
+
import type { ChartExportOptions } from "./chart-export-options";
|
|
10
|
+
import type { ChartField } from "./chart-field";
|
|
11
|
+
import type { ChartLegendOptions } from "./chart-legend-options";
|
|
12
|
+
import { type ChartLook } from "./chart-look";
|
|
13
|
+
import { type ChartFamily, type ChartModel, type ModelPoint, type ModelSlot } from "./chart-model";
|
|
14
|
+
import type { ChartPoint } from "./chart-point";
|
|
15
|
+
import type { ChartPointEventArgs } from "./chart-point-event-args";
|
|
16
|
+
import type { ChartPointSelection } from "./chart-point-selection";
|
|
17
|
+
import type { ChartReference } from "./chart-reference";
|
|
18
|
+
import type { ChartSelectionChangedEventArgs } from "./chart-selection-changed-event-args";
|
|
19
|
+
import type { ChartZoomChangedEventArgs } from "./chart-zoom-changed-event-args";
|
|
20
|
+
import type { ChartProps } from "./chart-props";
|
|
21
|
+
import type { ChartSeries } from "./chart-series";
|
|
22
|
+
import type { ChartSeriesToggledEventArgs } from "./chart-series-toggled-event-args";
|
|
23
|
+
import type { ChartStacked } from "./chart-stacked";
|
|
24
|
+
import type { ChartTooltipOptions } from "./chart-tooltip-options";
|
|
25
|
+
import type { ChartMode } from "./chart-mode";
|
|
26
|
+
import type { ChartModeChangedEventArgs } from "./chart-mode-changed-event-args";
|
|
27
|
+
import { ChartLegend } from "./ChartLegend";
|
|
28
|
+
import { ChartPlot } from "./ChartPlot";
|
|
29
|
+
import { ChartTable } from "./ChartTable";
|
|
30
|
+
import { ChartTooltip } from "./ChartTooltip";
|
|
31
|
+
import type { LegendEntry } from "./legend-entry";
|
|
32
|
+
import type { PlotView } from "./plot-view";
|
|
33
|
+
/**
|
|
34
|
+
* A chart of lines, areas, bars, dots and bubbles. Each series says how it draws, and they share one axis of values.
|
|
35
|
+
* Series keep their color when others are hidden. Every value is reachable without a pointer: the arrow keys walk the
|
|
36
|
+
* chart and a screen reader hears each value, and the chart turns into a table.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* <Chart title="Monthly sales" data={() => this.rows} xField="month" series={[{ yField: 'sales', type: 'bar' }]} />
|
|
40
|
+
*/
|
|
41
|
+
export declare class Chart<T = any> extends Control<HTMLDivElement, ChartProps<T>> {
|
|
42
|
+
pointClick: Emitter<ChartPointEventArgs<T>>;
|
|
43
|
+
pointFocused: Emitter<ChartPointEventArgs<T>>;
|
|
44
|
+
seriesToggled: Emitter<ChartSeriesToggledEventArgs<T>>;
|
|
45
|
+
modeChanged: Emitter<ChartModeChangedEventArgs<T>>;
|
|
46
|
+
dataError: Emitter<ChartDataErrorEventArgs<T>>;
|
|
47
|
+
zoomChanged: Emitter<ChartZoomChangedEventArgs<T>>;
|
|
48
|
+
selectionChanged: Emitter<ChartSelectionChangedEventArgs<T>>;
|
|
49
|
+
resetButton: Button;
|
|
50
|
+
zoomWindow: {
|
|
51
|
+
from: number;
|
|
52
|
+
to: number;
|
|
53
|
+
} | null;
|
|
54
|
+
selection: Set<string>;
|
|
55
|
+
press: {
|
|
56
|
+
at: number;
|
|
57
|
+
along: number;
|
|
58
|
+
moved: boolean;
|
|
59
|
+
} | null;
|
|
60
|
+
skipClick: boolean;
|
|
61
|
+
pendingActive: {
|
|
62
|
+
x: number;
|
|
63
|
+
series: number;
|
|
64
|
+
} | null;
|
|
65
|
+
lastSize: string;
|
|
66
|
+
head: Component<HTMLDivElement>;
|
|
67
|
+
titles: Component<HTMLDivElement>;
|
|
68
|
+
titleText: Component<HTMLDivElement>;
|
|
69
|
+
subtitleText: Component<HTMLDivElement>;
|
|
70
|
+
tools: Component<HTMLDivElement>;
|
|
71
|
+
modeButton: Button;
|
|
72
|
+
area: Component<HTMLDivElement>;
|
|
73
|
+
surface: Component<HTMLDivElement>;
|
|
74
|
+
message: Component<HTMLDivElement>;
|
|
75
|
+
status: Component<HTMLDivElement>;
|
|
76
|
+
plot: PlotView;
|
|
77
|
+
cartesian: ChartPlot;
|
|
78
|
+
plots: Map<ChartFamily, PlotView>;
|
|
79
|
+
hiddenParts: Set<number>;
|
|
80
|
+
legendEntries: LegendEntry[];
|
|
81
|
+
legendPart: ChartLegend;
|
|
82
|
+
tooltipPart: ChartTooltip;
|
|
83
|
+
tablePart: ChartTable;
|
|
84
|
+
model: ChartModel | null;
|
|
85
|
+
look: ChartLook | null;
|
|
86
|
+
hidden: Set<number>;
|
|
87
|
+
activeSlot: ModelSlot | null;
|
|
88
|
+
activePoint: ModelPoint | null;
|
|
89
|
+
queued: boolean;
|
|
90
|
+
placed: boolean;
|
|
91
|
+
drawnOnce: boolean;
|
|
92
|
+
watch: ResizeWatch | null;
|
|
93
|
+
stopLook: (() => void) | null;
|
|
94
|
+
stopFonts: (() => void) | null;
|
|
95
|
+
tokens: TokenLengths;
|
|
96
|
+
listening: IDisposable | null;
|
|
97
|
+
source: data.DataSource<T, any> | null;
|
|
98
|
+
failedWith: unknown;
|
|
99
|
+
constructor(props?: IBaseProp<ChartProps<T>>);
|
|
100
|
+
protected get focusElement(): HTMLElement;
|
|
101
|
+
onMounted(): void;
|
|
102
|
+
get data(): readonly T[] | null;
|
|
103
|
+
set data(value: Bind<readonly T[] | null>);
|
|
104
|
+
get dataSource(): data.DataSource<T, any> | null;
|
|
105
|
+
set dataSource(value: Bind<data.DataSource<T, any> | null>);
|
|
106
|
+
get xField(): ChartField<T> | null;
|
|
107
|
+
set xField(value: Bind<ChartField<T> | null>);
|
|
108
|
+
get series(): readonly ChartSeries<T>[];
|
|
109
|
+
set series(value: Bind<readonly ChartSeries<T>[]>);
|
|
110
|
+
get horizontal(): boolean;
|
|
111
|
+
set horizontal(value: Bind<boolean>);
|
|
112
|
+
get stacked(): ChartStacked;
|
|
113
|
+
set stacked(value: Bind<ChartStacked>);
|
|
114
|
+
get title(): string;
|
|
115
|
+
set title(value: Bind<string>);
|
|
116
|
+
get subtitle(): string;
|
|
117
|
+
set subtitle(value: Bind<string>);
|
|
118
|
+
get label(): string;
|
|
119
|
+
set label(value: Bind<string>);
|
|
120
|
+
get xAxis(): ChartAxis;
|
|
121
|
+
set xAxis(value: Bind<ChartAxis>);
|
|
122
|
+
get yAxis(): ChartAxis;
|
|
123
|
+
set yAxis(value: Bind<ChartAxis>);
|
|
124
|
+
get legend(): boolean | ChartLegendOptions;
|
|
125
|
+
set legend(value: Bind<boolean | ChartLegendOptions>);
|
|
126
|
+
get tooltip(): boolean | ChartTooltipOptions<T>;
|
|
127
|
+
set tooltip(value: Bind<boolean | ChartTooltipOptions<T>>);
|
|
128
|
+
get crosshair(): boolean;
|
|
129
|
+
set crosshair(value: Bind<boolean>);
|
|
130
|
+
get height(): number | null;
|
|
131
|
+
set height(value: Bind<number | null>);
|
|
132
|
+
get animation(): boolean;
|
|
133
|
+
set animation(value: Bind<boolean>);
|
|
134
|
+
get tableButton(): boolean;
|
|
135
|
+
set tableButton(value: Bind<boolean>);
|
|
136
|
+
get mode(): ChartMode;
|
|
137
|
+
set mode(value: Bind<ChartMode>);
|
|
138
|
+
get emptyText(): string;
|
|
139
|
+
set emptyText(value: Bind<string>);
|
|
140
|
+
get loading(): boolean;
|
|
141
|
+
set loading(value: Bind<boolean>);
|
|
142
|
+
get zoom(): boolean;
|
|
143
|
+
set zoom(value: Bind<boolean>);
|
|
144
|
+
get references(): readonly ChartReference[];
|
|
145
|
+
set references(value: Bind<readonly ChartReference[]>);
|
|
146
|
+
get pointSelection(): ChartPointSelection;
|
|
147
|
+
set pointSelection(value: Bind<ChartPointSelection>);
|
|
148
|
+
get onZoomChanged(): MotifEvent<ChartZoomChangedEventArgs<T>>;
|
|
149
|
+
get onSelectionChanged(): MotifEvent<ChartSelectionChangedEventArgs<T>>;
|
|
150
|
+
/** The values chosen now. */
|
|
151
|
+
get selectedPoints(): ChartPoint<T>[];
|
|
152
|
+
/** Chooses nothing. */
|
|
153
|
+
clearSelection(): void;
|
|
154
|
+
/** Shows the positions from one to another, given as in the rows: a category, a number or a date. */
|
|
155
|
+
zoomTo(from: unknown, to: unknown): void;
|
|
156
|
+
/** Shows every position again. */
|
|
157
|
+
resetZoom(): void;
|
|
158
|
+
get onPointClick(): MotifEvent<ChartPointEventArgs<T>>;
|
|
159
|
+
get onPointFocused(): MotifEvent<ChartPointEventArgs<T>>;
|
|
160
|
+
get onSeriesToggled(): MotifEvent<ChartSeriesToggledEventArgs<T>>;
|
|
161
|
+
get onModeChanged(): MotifEvent<ChartModeChangedEventArgs<T>>;
|
|
162
|
+
get onDataError(): MotifEvent<ChartDataErrorEventArgs<T>>;
|
|
163
|
+
/** Draws again from the rows and series as they are now, after they changed in place. */
|
|
164
|
+
refresh(): void;
|
|
165
|
+
/** Hides or shows a series, by its place in `series`. */
|
|
166
|
+
setSeriesVisible(index: number, visible: boolean): void;
|
|
167
|
+
/** Indicates whether a series is drawn, by its place in `series`. */
|
|
168
|
+
isSeriesVisible(index: number): boolean;
|
|
169
|
+
/** The chart as an SVG document, with its title and legend. */
|
|
170
|
+
toSVG(options?: ChartExportOptions): string;
|
|
171
|
+
/** The chart as a data URL, a PNG by default. It takes a moment, since the browser draws the image first. */
|
|
172
|
+
toDataURL(type?: string, options?: ChartExportOptions): Promise<string>;
|
|
173
|
+
/** The rows in use now: the data source's, or the ones given. */
|
|
174
|
+
get rows(): readonly T[];
|
|
175
|
+
get legendOptions(): ChartLegendOptions;
|
|
176
|
+
get tooltipOptions(): ChartTooltipOptions<T>;
|
|
177
|
+
get accessibleName(): string;
|
|
178
|
+
followSource(): void;
|
|
179
|
+
sourceChanged(): void;
|
|
180
|
+
again(): void;
|
|
181
|
+
draw(): void;
|
|
182
|
+
drawPlot(model: ChartModel, xAxis: ChartAxis, yAxis: ChartAxis, window: {
|
|
183
|
+
from: number;
|
|
184
|
+
to: number;
|
|
185
|
+
} | null): void;
|
|
186
|
+
drawTable(): void;
|
|
187
|
+
/** The plot of a family, made the first time it is needed; the others step aside. */
|
|
188
|
+
usePlot(family: ChartFamily): void;
|
|
189
|
+
/** What the legend lists: the parts of a whole, the colors of a heat map, or the series of the chart's family. */
|
|
190
|
+
entriesOf(model: ChartModel): LegendEntry[];
|
|
191
|
+
toggleEntry(id: string): void;
|
|
192
|
+
toggleSeries(index: number): void;
|
|
193
|
+
changeMode(mode: ChartMode): void;
|
|
194
|
+
pointOf(p: ModelPoint): ChartPoint<T>;
|
|
195
|
+
localPlace(e: MouseEvent): {
|
|
196
|
+
x: number;
|
|
197
|
+
y: number;
|
|
198
|
+
};
|
|
199
|
+
pointerMoved(e: PointerEvent): void;
|
|
200
|
+
plotClick(e: MouseEvent): void;
|
|
201
|
+
/** A click or Enter chooses a value, when the chart is asked to. */
|
|
202
|
+
choose(p: ModelPoint): void;
|
|
203
|
+
/** The positions in view: the zoomed part, or the latest stretch of live data, or null for all. */
|
|
204
|
+
windowOf(model: ChartModel): {
|
|
205
|
+
from: number;
|
|
206
|
+
to: number;
|
|
207
|
+
} | null;
|
|
208
|
+
/** The first and last position of the data. */
|
|
209
|
+
extent(model: ChartModel): [number, number];
|
|
210
|
+
setWindow(window: {
|
|
211
|
+
from: number;
|
|
212
|
+
to: number;
|
|
213
|
+
} | null): void;
|
|
214
|
+
/** Zooms in or out by `factor` around a position, keeping it where it is. */
|
|
215
|
+
zoomAround(center: number, factor: number): void;
|
|
216
|
+
/** Moves the zoomed part along by a share of its width. */
|
|
217
|
+
pan(share: number): void;
|
|
218
|
+
along(e: MouseEvent): number;
|
|
219
|
+
pressed(e: PointerEvent): void;
|
|
220
|
+
released(e: PointerEvent): void;
|
|
221
|
+
wheeled(e: WheelEvent): void;
|
|
222
|
+
setActive(slot: ModelSlot, point: ModelPoint | null, e: Event | null): void;
|
|
223
|
+
clearActive(): void;
|
|
224
|
+
showTooltip(slot: ModelSlot, point: ModelPoint | null): void;
|
|
225
|
+
placeTooltip(e: MouseEvent | null): void;
|
|
226
|
+
plotFocused(): void;
|
|
227
|
+
moveTo(slot: ModelSlot, point: ModelPoint): void;
|
|
228
|
+
plotKeyDown(e: KeyboardEvent): void;
|
|
229
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { LegendEntry } from './legend-entry';
|
|
2
|
+
interface LegendItem {
|
|
3
|
+
button: HTMLButtonElement;
|
|
4
|
+
key: HTMLSpanElement;
|
|
5
|
+
name: HTMLSpanElement;
|
|
6
|
+
id: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The legend: a key that mirrors the mark and a name for each entry, so identity never rests on color alone. An entry
|
|
10
|
+
* that can be hidden is a button; one Tab stop, and the arrow keys walk the legend.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ChartLegend {
|
|
13
|
+
element: HTMLDivElement;
|
|
14
|
+
items: LegendItem[];
|
|
15
|
+
toggled: (id: string) => void;
|
|
16
|
+
current: number;
|
|
17
|
+
constructor(doc: Document, toggled: (id: string) => void);
|
|
18
|
+
draw(entries: readonly LegendEntry[], toggle: boolean): void;
|
|
19
|
+
addItem(doc: Document): LegendItem;
|
|
20
|
+
drawStops(): void;
|
|
21
|
+
click(e: Event): void;
|
|
22
|
+
keyDown(e: KeyboardEvent): void;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { type Place } from '../../parts/chart/chart-paths';
|
|
2
|
+
import { type ChartScale } from '../../parts/chart/chart-scale';
|
|
3
|
+
import { TextPool } from '../../parts/chart/svg-parts';
|
|
4
|
+
import type { ChartModel, ModelPoint, ModelSeries, ModelSlot } from './chart-model';
|
|
5
|
+
import type { HeatClass, PlotInput, PlotView, Rect } from './plot-view';
|
|
6
|
+
export type { PlotInput } from './plot-view';
|
|
7
|
+
interface SeriesPart {
|
|
8
|
+
group: SVGGElement;
|
|
9
|
+
area: SVGPathElement;
|
|
10
|
+
bars: SVGPathElement;
|
|
11
|
+
rise: SVGPathElement;
|
|
12
|
+
fall: SVGPathElement;
|
|
13
|
+
cells: SVGGElement;
|
|
14
|
+
line: SVGPathElement;
|
|
15
|
+
dots: SVGPathElement;
|
|
16
|
+
}
|
|
17
|
+
interface Tick {
|
|
18
|
+
value: number;
|
|
19
|
+
text: string;
|
|
20
|
+
}
|
|
21
|
+
/** Where a value was, so that a change can move it from there. */
|
|
22
|
+
interface Was {
|
|
23
|
+
px: number;
|
|
24
|
+
py: number;
|
|
25
|
+
rect?: Rect;
|
|
26
|
+
}
|
|
27
|
+
/** The SVG of a chart: grid, marks, axes and what shows the value under the pointer. It reads a model and writes paths. */
|
|
28
|
+
export declare class ChartPlot implements PlotView {
|
|
29
|
+
svg: SVGSVGElement;
|
|
30
|
+
clip: SVGRectElement;
|
|
31
|
+
grid: SVGPathElement;
|
|
32
|
+
marks: SVGGElement;
|
|
33
|
+
axis: SVGPathElement;
|
|
34
|
+
xLabels: TextPool;
|
|
35
|
+
yLabels: TextPool;
|
|
36
|
+
titles: TextPool;
|
|
37
|
+
dataLabels: TextPool;
|
|
38
|
+
cross: SVGPathElement;
|
|
39
|
+
activeBar: SVGPathElement;
|
|
40
|
+
activeDots: SVGGElement;
|
|
41
|
+
parts: SeriesPart[];
|
|
42
|
+
input: PlotInput | null;
|
|
43
|
+
box: Rect;
|
|
44
|
+
bars: Map<ModelPoint, Rect>;
|
|
45
|
+
order: ModelSlot[];
|
|
46
|
+
xFormat: Intl.DateTimeFormatOptions | undefined;
|
|
47
|
+
/** The colors of a heat map, low to high, for its legend. */
|
|
48
|
+
heatClasses: HeatClass[];
|
|
49
|
+
refBands: SVGPathElement;
|
|
50
|
+
refLines: SVGPathElement;
|
|
51
|
+
refLabels: TextPool;
|
|
52
|
+
selectedMarks: SVGPathElement;
|
|
53
|
+
brush: SVGPathElement;
|
|
54
|
+
/** The model of the last drawing: where a change moves its values from. The chart may hand over the next one early, for its texts. */
|
|
55
|
+
drawn: ChartModel | null;
|
|
56
|
+
scales: {
|
|
57
|
+
position: ChartScale & {
|
|
58
|
+
size?: number;
|
|
59
|
+
};
|
|
60
|
+
value: ChartScale;
|
|
61
|
+
measure: (text: string) => number;
|
|
62
|
+
} | null;
|
|
63
|
+
frame: number;
|
|
64
|
+
constructor(host: Element);
|
|
65
|
+
/** The group whose style gives the font of the axis labels. */
|
|
66
|
+
get labelGroup(): SVGGElement;
|
|
67
|
+
/** The position of a slot, as it reads. */
|
|
68
|
+
xText(key: unknown, tick?: boolean): string;
|
|
69
|
+
/** A value of a series, as it reads. */
|
|
70
|
+
valueText(point: ModelPoint): string;
|
|
71
|
+
markOfPoint(point: ModelPoint): string;
|
|
72
|
+
draw(input: PlotInput): void;
|
|
73
|
+
/** Where each value of the drawing now is. */
|
|
74
|
+
snapshot(model: ChartModel): Map<string, Was>;
|
|
75
|
+
/** Moves the values that changed from where they were, over the design language's normal motion. */
|
|
76
|
+
tween(before: Map<string, Was>): boolean;
|
|
77
|
+
/** A position is in view: inside the zoomed part, or anywhere when nothing is zoomed. */
|
|
78
|
+
visible(x: number): boolean;
|
|
79
|
+
/** The value of the position axis at a place of the SVG: a category's number, a number or a moment. */
|
|
80
|
+
positionValueAt(x: number, y: number): number | null;
|
|
81
|
+
/** The band being dragged to zoom, or nothing. */
|
|
82
|
+
showBrush(from: number | null, to: number | null): void;
|
|
83
|
+
/** Lines and bands at the values and positions asked for, with their labels. */
|
|
84
|
+
drawReferences(position: ChartScale & {
|
|
85
|
+
size?: number;
|
|
86
|
+
}, value: ChartScale, measure: (text: string) => number): void;
|
|
87
|
+
/** A ring around each chosen value: a frame for a bar, a circle for a point. */
|
|
88
|
+
drawSelected(): void;
|
|
89
|
+
widestLabel(series: readonly ModelSeries[], measure: (text: string) => number): number;
|
|
90
|
+
valueRange(count: number): {
|
|
91
|
+
min: number;
|
|
92
|
+
max: number;
|
|
93
|
+
ticks: Tick[];
|
|
94
|
+
};
|
|
95
|
+
/** The range of the values in view, counted as the model counts the whole. */
|
|
96
|
+
valuesInView(): {
|
|
97
|
+
low: number;
|
|
98
|
+
high: number;
|
|
99
|
+
} | null;
|
|
100
|
+
positionTicks(length: number, measure: (text: string) => number): Tick[];
|
|
101
|
+
positionScale(box: Rect): ChartScale & {
|
|
102
|
+
size?: number;
|
|
103
|
+
};
|
|
104
|
+
placePoints(position: ChartScale, value: ChartScale): void;
|
|
105
|
+
barLayout(position: ChartScale & {
|
|
106
|
+
size?: number;
|
|
107
|
+
}): {
|
|
108
|
+
thick: number;
|
|
109
|
+
offset: Map<number, number>;
|
|
110
|
+
};
|
|
111
|
+
barRect(along: number, base: number, tip: number, thick: number, point: ModelPoint): Rect;
|
|
112
|
+
/** A cell of a heat map: its column's band, its row's band, a gap around it. */
|
|
113
|
+
cellRect(along: number, across: number, position: ChartScale & {
|
|
114
|
+
size?: number;
|
|
115
|
+
}, value: ChartScale): Rect;
|
|
116
|
+
/** Seven classes from low to high; across zero, two hues that meet in a neutral middle. */
|
|
117
|
+
classesOf(model: ChartModel): HeatClass[];
|
|
118
|
+
classIndex(value: number): number;
|
|
119
|
+
heatColor(value: number): string;
|
|
120
|
+
drawGrid(range: {
|
|
121
|
+
min: number;
|
|
122
|
+
max: number;
|
|
123
|
+
ticks: Tick[];
|
|
124
|
+
}, value: ChartScale, positions: Tick[], position: ChartScale): void;
|
|
125
|
+
drawLabels(valueTicks: Tick[], value: ChartScale, positions: Tick[], position: ChartScale & {
|
|
126
|
+
size?: number;
|
|
127
|
+
}, measure: (text: string) => number, on: {
|
|
128
|
+
xLabelsOn: boolean;
|
|
129
|
+
yLabelsOn: boolean;
|
|
130
|
+
}): void;
|
|
131
|
+
drawTitles(xTitle: string, yTitle: string): void;
|
|
132
|
+
partOf(s: ModelSeries): SeriesPart;
|
|
133
|
+
drawSeries(position: ChartScale, value: ChartScale, measure: (text: string) => number): void;
|
|
134
|
+
drawSeriesMarks(s: ModelSeries, part: SeriesPart, value: ChartScale): void;
|
|
135
|
+
/** One path for each color of a heat map. */
|
|
136
|
+
drawCells(group: SVGGElement, cells: Map<number, string>): void;
|
|
137
|
+
/** A candle: its body from the first price to the last, and its wick from the lowest to the highest. An OHLC bar: ticks for the first and the last. */
|
|
138
|
+
candlePath(p: ModelPoint, rect: Rect, value: ChartScale, ticks: boolean): string;
|
|
139
|
+
pathOf(s: ModelSeries, places: readonly Place[], sideways: boolean): string;
|
|
140
|
+
/** Stretches of a line between empty values, each thinned to what the width can show. */
|
|
141
|
+
runsOf(s: ModelSeries): ModelPoint[][];
|
|
142
|
+
endOf(p: ModelPoint, value: ChartScale): 'top' | 'bottom' | 'left' | 'right' | null;
|
|
143
|
+
bubbleRadius(p: ModelPoint): number;
|
|
144
|
+
drawDataLabels(s: ModelSeries, measure: (text: string) => number, taken: Rect[]): void;
|
|
145
|
+
/** The value in each cell of a heat map, where it fits. */
|
|
146
|
+
drawCellLabels(s: ModelSeries, measure: (text: string) => number): void;
|
|
147
|
+
/** The slot and value nearest to a place in the SVG, or null when nothing is near. */
|
|
148
|
+
find(x: number, y: number): {
|
|
149
|
+
slot: ModelSlot;
|
|
150
|
+
point: ModelPoint | null;
|
|
151
|
+
} | null;
|
|
152
|
+
nearestSlot(at: number): ModelSlot | null;
|
|
153
|
+
findDot(x: number, y: number): {
|
|
154
|
+
slot: ModelSlot;
|
|
155
|
+
point: ModelPoint;
|
|
156
|
+
} | null;
|
|
157
|
+
/** Shows a position and a value, or nothing. */
|
|
158
|
+
showActive(slot: ModelSlot | null, point: ModelPoint | null, crosshair: boolean): void;
|
|
159
|
+
}
|
|
160
|
+
/** The color of a series: its own, or the one of its place. */
|
|
161
|
+
export declare function markOf(s: ModelSeries): string;
|