@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,68 @@
|
|
|
1
|
+
import { type Component, type ComponentBase } from '@motifx/core';
|
|
2
|
+
import { DataGrid } from '../datagrid/DataGrid';
|
|
3
|
+
import type { GridColumn } from '../datagrid/grid-column';
|
|
4
|
+
import type { ChartModel, ModelPoint } from './chart-model';
|
|
5
|
+
import type { PlotView } from './plot-view';
|
|
6
|
+
/** A row of the table: what it sorts by, and the values it shows. Made by the chart, never the developer's. */
|
|
7
|
+
export interface TableRow {
|
|
8
|
+
id: number;
|
|
9
|
+
sort: unknown;
|
|
10
|
+
key: unknown;
|
|
11
|
+
points: (ModelPoint | null)[];
|
|
12
|
+
}
|
|
13
|
+
/** The columns and rows of the table for a model. */
|
|
14
|
+
export interface TableShape {
|
|
15
|
+
columns: GridColumn<TableRow>[];
|
|
16
|
+
rows: TableRow[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The chart's values as a table: what a reader who cannot see the marks, or wants the numbers, reads instead. It is the
|
|
20
|
+
* kit's DataGrid, so a hundred thousand rows scroll as easily as ten: only the rows in view are drawn, and a cell is
|
|
21
|
+
* formatted when it is.
|
|
22
|
+
*/
|
|
23
|
+
export declare class ChartTable {
|
|
24
|
+
host: Component<HTMLDivElement>;
|
|
25
|
+
grid: DataGrid<TableRow> | null;
|
|
26
|
+
shape: TableShape | null;
|
|
27
|
+
/** What the columns are, to tell a new table from new values in the same one. */
|
|
28
|
+
columnsKey: string;
|
|
29
|
+
source: {
|
|
30
|
+
rows: {
|
|
31
|
+
id: number;
|
|
32
|
+
sort: unknown;
|
|
33
|
+
key: unknown;
|
|
34
|
+
points: ({
|
|
35
|
+
series: number;
|
|
36
|
+
index: number;
|
|
37
|
+
key: unknown;
|
|
38
|
+
x: number;
|
|
39
|
+
y: number | null;
|
|
40
|
+
from: number;
|
|
41
|
+
to: number;
|
|
42
|
+
outer: boolean;
|
|
43
|
+
size: number | null;
|
|
44
|
+
low: number | null;
|
|
45
|
+
high: number | null;
|
|
46
|
+
open: number | null;
|
|
47
|
+
close: number | null;
|
|
48
|
+
kind: 'rise' | 'fall' | 'total' | null;
|
|
49
|
+
lane: number;
|
|
50
|
+
heat: number | null;
|
|
51
|
+
share: number | null;
|
|
52
|
+
off: boolean;
|
|
53
|
+
row: unknown;
|
|
54
|
+
px: number;
|
|
55
|
+
py: number;
|
|
56
|
+
} | null)[];
|
|
57
|
+
}[];
|
|
58
|
+
};
|
|
59
|
+
constructor(owner: ComponentBase);
|
|
60
|
+
get element(): HTMLDivElement;
|
|
61
|
+
draw(model: ChartModel, plot: PlotView, name: string, position: string): void;
|
|
62
|
+
/** The texts of the first rows, as the table shows them. */
|
|
63
|
+
texts(count?: number): string[][];
|
|
64
|
+
}
|
|
65
|
+
/** A cell as its column writes it. */
|
|
66
|
+
export declare function cellText(column: GridColumn<TableRow>, row: TableRow): string;
|
|
67
|
+
/** The table of a model: positions down, series across; the parts with their shares; a heat map as its grid. */
|
|
68
|
+
export declare function shapeOf(model: ChartModel, plot: PlotView, position: string): TableShape;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ChartPoint } from './chart-point';
|
|
2
|
+
import type { ChartTooltipContext } from './chart-tooltip-context';
|
|
3
|
+
/** A row of the tooltip. */
|
|
4
|
+
interface TooltipRow {
|
|
5
|
+
mark: string;
|
|
6
|
+
point: ChartPoint;
|
|
7
|
+
active: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* What a chart shows at the pointer. It is a reading aid only: the same values are in the table, and the keyboard
|
|
11
|
+
* reaches them too. Names are written as text, since they come from data.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ChartTooltip {
|
|
14
|
+
element: HTMLDivElement;
|
|
15
|
+
constructor(doc: Document);
|
|
16
|
+
hide(): void;
|
|
17
|
+
show(context: ChartTooltipContext, rows: readonly TooltipRow[], format: ((context: ChartTooltipContext) => string | Node) | undefined): void;
|
|
18
|
+
write(title: string, rows: readonly TooltipRow[]): void;
|
|
19
|
+
/** Beside the position, on the side with room, and always inside the plot. */
|
|
20
|
+
place(x: number, y: number, width: number, height: number, gap: number): void;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { TextPool } from '../../parts/chart/svg-parts';
|
|
2
|
+
import type { ModelPoint, ModelSeries, ModelSlot } from './chart-model';
|
|
3
|
+
import type { PlotInput, PlotView, Rect } from './plot-view';
|
|
4
|
+
/**
|
|
5
|
+
* One whole and its parts: the slices of a pie or a donut, or the stages of a funnel. Each part keeps the color of its
|
|
6
|
+
* row when others are hidden. A share is written on a part only where it fits; the legend names them.
|
|
7
|
+
*/
|
|
8
|
+
export declare class PartsPlot implements PlotView {
|
|
9
|
+
svg: SVGSVGElement;
|
|
10
|
+
marks: SVGGElement;
|
|
11
|
+
names: TextPool;
|
|
12
|
+
labels: TextPool;
|
|
13
|
+
center: TextPool;
|
|
14
|
+
active: SVGPathElement;
|
|
15
|
+
input: PlotInput | null;
|
|
16
|
+
box: Rect;
|
|
17
|
+
order: ModelSlot[];
|
|
18
|
+
/** Each part's angles, or its rectangle for a funnel. */
|
|
19
|
+
angles: Map<ModelPoint, [number, number]>;
|
|
20
|
+
rects: Map<ModelPoint, Rect>;
|
|
21
|
+
cx: number;
|
|
22
|
+
cy: number;
|
|
23
|
+
radius: number;
|
|
24
|
+
hole: number;
|
|
25
|
+
constructor(host: Element);
|
|
26
|
+
get whole(): ModelSeries | undefined;
|
|
27
|
+
xText(key: unknown): string;
|
|
28
|
+
valueText(point: ModelPoint): string;
|
|
29
|
+
markOfPoint(point: ModelPoint): string;
|
|
30
|
+
draw(input: PlotInput): void;
|
|
31
|
+
drawPie(series: ModelSeries): void;
|
|
32
|
+
drawFunnel(series: ModelSeries): void;
|
|
33
|
+
find(x: number, y: number): {
|
|
34
|
+
slot: ModelSlot;
|
|
35
|
+
point: ModelPoint | null;
|
|
36
|
+
} | null;
|
|
37
|
+
/** The part under the pointer comes forward: a slice moves out of the circle, a stage gets a frame. */
|
|
38
|
+
showActive(slot: ModelSlot | null, point: ModelPoint | null): void;
|
|
39
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { TextPool } from '../../parts/chart/svg-parts';
|
|
2
|
+
import type { ModelPoint, ModelSlot } from './chart-model';
|
|
3
|
+
import type { PlotInput, PlotView, Rect } from './plot-view';
|
|
4
|
+
/** Values around a center: a spoke for each category, rings for the values, and a shape for each series. */
|
|
5
|
+
export declare class RadarPlot implements PlotView {
|
|
6
|
+
svg: SVGSVGElement;
|
|
7
|
+
grid: SVGPathElement;
|
|
8
|
+
axis: SVGPathElement;
|
|
9
|
+
marks: SVGGElement;
|
|
10
|
+
ticks: TextPool;
|
|
11
|
+
names: TextPool;
|
|
12
|
+
cross: SVGPathElement;
|
|
13
|
+
activeDots: SVGPathElement;
|
|
14
|
+
input: PlotInput | null;
|
|
15
|
+
box: Rect;
|
|
16
|
+
order: ModelSlot[];
|
|
17
|
+
cx: number;
|
|
18
|
+
cy: number;
|
|
19
|
+
radius: number;
|
|
20
|
+
min: number;
|
|
21
|
+
max: number;
|
|
22
|
+
constructor(host: Element);
|
|
23
|
+
xText(key: unknown): string;
|
|
24
|
+
valueText(point: ModelPoint): string;
|
|
25
|
+
markOfPoint(point: ModelPoint): string;
|
|
26
|
+
angleOf(index: number): number;
|
|
27
|
+
at(index: number, value: number): [number, number];
|
|
28
|
+
draw(input: PlotInput): void;
|
|
29
|
+
find(x: number, y: number): {
|
|
30
|
+
slot: ModelSlot;
|
|
31
|
+
point: ModelPoint | null;
|
|
32
|
+
} | null;
|
|
33
|
+
showActive(slot: ModelSlot | null, point: ModelPoint | null, crosshair: boolean): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ChartFormat } from '../../parts/chart/chart-text';
|
|
2
|
+
import type { ChartAxisKind } from './chart-axis-kind';
|
|
3
|
+
/** An axis of the chart. */
|
|
4
|
+
export interface ChartAxis {
|
|
5
|
+
/** Default: `'auto'`. */
|
|
6
|
+
kind?: ChartAxisKind;
|
|
7
|
+
/** A title along the axis. */
|
|
8
|
+
title?: string;
|
|
9
|
+
/** The first value. Default: taken from the values. */
|
|
10
|
+
min?: number | Date;
|
|
11
|
+
/** The last value. Default: taken from the values. */
|
|
12
|
+
max?: number | Date;
|
|
13
|
+
/** How the values read. Default: the numbers and dates of the language. */
|
|
14
|
+
format?: ChartFormat;
|
|
15
|
+
/** About how many values it marks. Default: as many as fit. */
|
|
16
|
+
tickCount?: number;
|
|
17
|
+
/** Turns the labels by this many degrees, for long ones. Default: `0`. */
|
|
18
|
+
labelAngle?: number;
|
|
19
|
+
/** Runs the other way. Default: `false`. */
|
|
20
|
+
reversed?: boolean;
|
|
21
|
+
/** Shows the labels. Default: `true`. */
|
|
22
|
+
labels?: boolean;
|
|
23
|
+
/** Draws grid lines. Default: `true` on the value axis, and on a number axis along the bottom. */
|
|
24
|
+
grid?: boolean;
|
|
25
|
+
/** Draws the line of the axis. Default: `true` on the category axis. */
|
|
26
|
+
line?: boolean;
|
|
27
|
+
/** Shows only the latest stretch of positions: a time in milliseconds, a number, or a count of categories. For live data. */
|
|
28
|
+
span?: number;
|
|
29
|
+
/** Shows the axis: labels, line and title. Default: `true`. */
|
|
30
|
+
visible?: boolean;
|
|
31
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Chart } from './Chart';
|
|
2
|
+
import type { ChartExportOptions } from './chart-export-options';
|
|
3
|
+
/** The chart as an SVG element, with its title and its legend, ready to stand alone. */
|
|
4
|
+
export declare function chartImage(chart: Chart, options: ChartExportOptions): {
|
|
5
|
+
svg: SVGSVGElement;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
};
|
|
9
|
+
/** The chart as an SVG document. */
|
|
10
|
+
export declare function chartSvg(chart: Chart, options: ChartExportOptions): string;
|
|
11
|
+
/** The chart drawn on a canvas: the browser reads the SVG as an image first, which is not immediate. */
|
|
12
|
+
export declare function chartCanvas(chart: Chart, options: ChartExportOptions): Promise<HTMLCanvasElement>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ChartLegendPosition } from './chart-legend-position';
|
|
2
|
+
/** The legend. A chart of one series has none: its title names it. */
|
|
3
|
+
export interface ChartLegendOptions {
|
|
4
|
+
/** Default: `true` with two series or more. */
|
|
5
|
+
visible?: boolean;
|
|
6
|
+
/** Default: `'bottom'`. */
|
|
7
|
+
position?: ChartLegendPosition;
|
|
8
|
+
/** A click hides or shows a series. Default: `true`. */
|
|
9
|
+
toggle?: boolean;
|
|
10
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { TokenLengths } from "../../parts/chart/token-lengths";
|
|
2
|
+
/** Sizes a chart takes from its design language, in pixels, and the font of its axes. */
|
|
3
|
+
export interface ChartLook {
|
|
4
|
+
barWidth: number;
|
|
5
|
+
barRadius: number;
|
|
6
|
+
barGap: number;
|
|
7
|
+
markerSize: number;
|
|
8
|
+
bubbleMin: number;
|
|
9
|
+
bubbleMax: number;
|
|
10
|
+
hitSize: number;
|
|
11
|
+
cellRadius: number;
|
|
12
|
+
sliceLift: number;
|
|
13
|
+
donutHole: number;
|
|
14
|
+
tickGap: number;
|
|
15
|
+
tickPad: number;
|
|
16
|
+
font: string;
|
|
17
|
+
line: number;
|
|
18
|
+
}
|
|
19
|
+
/** What the chart's probes measure (see `TokenLengths`). */
|
|
20
|
+
export declare const LOOK_TOKENS: readonly string[];
|
|
21
|
+
/**
|
|
22
|
+
* The look as it stands on `root`. Tokens may be in `rem`: the probes turn each into pixels, which the geometry needs.
|
|
23
|
+
* The numbers here only stand where nothing is laid out, as in a test without a browser.
|
|
24
|
+
*/
|
|
25
|
+
export declare function readLook(root: HTMLElement, labels: Element, lengths: TokenLengths): ChartLook;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { ChartAxis } from './chart-axis';
|
|
2
|
+
import type { ChartAxisKind } from './chart-axis-kind';
|
|
3
|
+
import type { ChartField } from './chart-field';
|
|
4
|
+
import type { ChartSeries } from './chart-series';
|
|
5
|
+
import type { ChartSeriesType } from './chart-series-type';
|
|
6
|
+
import type { ChartStacked } from './chart-stacked';
|
|
7
|
+
/** A value of a series, placed: nothing here is the developer's object except `row`. */
|
|
8
|
+
export interface ModelPoint {
|
|
9
|
+
series: number;
|
|
10
|
+
index: number;
|
|
11
|
+
key: unknown;
|
|
12
|
+
/** Its position: a category's number, a number, or a moment. */
|
|
13
|
+
x: number;
|
|
14
|
+
/** The value as given; null when there is none. */
|
|
15
|
+
y: number | null;
|
|
16
|
+
/** Where it starts and ends on the value axis, once stacked. */
|
|
17
|
+
from: number;
|
|
18
|
+
to: number;
|
|
19
|
+
/** It is the far end of its stack. */
|
|
20
|
+
outer: boolean;
|
|
21
|
+
size: number | null;
|
|
22
|
+
/** The ends of a range, and the four prices of a candle. */
|
|
23
|
+
low: number | null;
|
|
24
|
+
high: number | null;
|
|
25
|
+
open: number | null;
|
|
26
|
+
close: number | null;
|
|
27
|
+
/** A step of a waterfall goes up or down, or is a total; a candle rises or falls. */
|
|
28
|
+
kind: 'rise' | 'fall' | 'total' | null;
|
|
29
|
+
/** The row of a heat map, and the value its color shows. */
|
|
30
|
+
lane: number;
|
|
31
|
+
heat: number | null;
|
|
32
|
+
/** Its share of the whole, for the parts of one. */
|
|
33
|
+
share: number | null;
|
|
34
|
+
/** A part the reader hid in the legend. */
|
|
35
|
+
off: boolean;
|
|
36
|
+
row: unknown;
|
|
37
|
+
/** Its place on the page, once drawn. */
|
|
38
|
+
px: number;
|
|
39
|
+
py: number;
|
|
40
|
+
}
|
|
41
|
+
/** A series, read. */
|
|
42
|
+
export interface ModelSeries {
|
|
43
|
+
source: ChartSeries;
|
|
44
|
+
index: number;
|
|
45
|
+
name: string;
|
|
46
|
+
type: ChartSeriesType;
|
|
47
|
+
/** Which of the eight colors, kept when others are hidden. */
|
|
48
|
+
slot: number;
|
|
49
|
+
/** It came round the colors once at least: a dash tells it from the first. */
|
|
50
|
+
wrapped: boolean;
|
|
51
|
+
shown: boolean;
|
|
52
|
+
/** What it stacks with; null alone. */
|
|
53
|
+
stack: string | null;
|
|
54
|
+
points: ModelPoint[];
|
|
55
|
+
}
|
|
56
|
+
/** The points at a position. */
|
|
57
|
+
export interface ModelSlot {
|
|
58
|
+
x: number;
|
|
59
|
+
key: unknown;
|
|
60
|
+
points: ModelPoint[];
|
|
61
|
+
at: number;
|
|
62
|
+
}
|
|
63
|
+
/** Which way a chart draws: on two axes, as the parts of a whole, or around a center. */
|
|
64
|
+
export type ChartFamily = 'cartesian' | 'parts' | 'radar';
|
|
65
|
+
/** What a chart draws. */
|
|
66
|
+
export interface ChartModel {
|
|
67
|
+
family: ChartFamily;
|
|
68
|
+
kind: Exclude<ChartAxisKind, 'auto'>;
|
|
69
|
+
categories: unknown[];
|
|
70
|
+
/** The rows of a heat map, top to bottom. */
|
|
71
|
+
lanes: unknown[];
|
|
72
|
+
series: ModelSeries[];
|
|
73
|
+
slots: ModelSlot[];
|
|
74
|
+
xMin: number;
|
|
75
|
+
xMax: number;
|
|
76
|
+
yMin: number;
|
|
77
|
+
yMax: number;
|
|
78
|
+
heatMin: number;
|
|
79
|
+
heatMax: number;
|
|
80
|
+
/** The whole the parts make, without the ones hidden. */
|
|
81
|
+
total: number;
|
|
82
|
+
/** There is at least one value to draw. */
|
|
83
|
+
any: boolean;
|
|
84
|
+
percent: boolean;
|
|
85
|
+
hasBars: boolean;
|
|
86
|
+
sizeMax: number;
|
|
87
|
+
sizeMin: number;
|
|
88
|
+
}
|
|
89
|
+
/** What a model is made from. */
|
|
90
|
+
export interface ModelInput {
|
|
91
|
+
rows: readonly unknown[];
|
|
92
|
+
series: readonly ChartSeries[];
|
|
93
|
+
xField: ChartField<any> | null;
|
|
94
|
+
xAxis: ChartAxis;
|
|
95
|
+
yAxis: ChartAxis;
|
|
96
|
+
stacked: ChartStacked;
|
|
97
|
+
/** Series the reader hid, by their place. */
|
|
98
|
+
hidden: ReadonlySet<number>;
|
|
99
|
+
/** Parts of a pie, donut or funnel the reader hid, by their row. */
|
|
100
|
+
hiddenParts?: ReadonlySet<number>;
|
|
101
|
+
}
|
|
102
|
+
/** The family a type belongs to. */
|
|
103
|
+
export declare function familyOf(type: ChartSeriesType): ChartFamily;
|
|
104
|
+
/** Reads the series into a model of its own: the rows are read and left as they are. */
|
|
105
|
+
export declare function buildModel(input: ModelInput): ChartModel;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Chart } from './Chart';
|
|
2
|
+
import type { ChartPoint } from './chart-point';
|
|
3
|
+
/** Data of `Chart.onPointClick` and `Chart.onPointFocused`. */
|
|
4
|
+
export interface ChartPointEventArgs<T = any> {
|
|
5
|
+
point: ChartPoint<T>;
|
|
6
|
+
/** What the reader did, when the reader did it. */
|
|
7
|
+
originalEvent: Event | null;
|
|
8
|
+
source: Chart<T>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** A value of the chart. */
|
|
2
|
+
export interface ChartPoint<T = any> {
|
|
3
|
+
/** The name of its series. */
|
|
4
|
+
series: string;
|
|
5
|
+
/** Its place in the `series` you gave. */
|
|
6
|
+
seriesIndex: number;
|
|
7
|
+
/** Its number in the series. */
|
|
8
|
+
index: number;
|
|
9
|
+
/** The position along the axis, as you gave it. */
|
|
10
|
+
x: unknown;
|
|
11
|
+
/** The value, as a number. */
|
|
12
|
+
y: number;
|
|
13
|
+
/** The position, as it reads. */
|
|
14
|
+
xText: string;
|
|
15
|
+
/** The value, as it reads. */
|
|
16
|
+
yText: string;
|
|
17
|
+
/** The size of a bubble. */
|
|
18
|
+
size: number | null;
|
|
19
|
+
/** Its share of the whole, for a part of a pie, a donut or a funnel. */
|
|
20
|
+
share: number | null;
|
|
21
|
+
/** The row you gave. */
|
|
22
|
+
row: T;
|
|
23
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { Bind, Event as MotifEvent } from '@motifx/core';
|
|
2
|
+
import type { data } from '@motifx-community/data';
|
|
3
|
+
import type { ControlProps } from '../../core/control';
|
|
4
|
+
import type { ChartAxis } from './chart-axis';
|
|
5
|
+
import type { ChartDataErrorEventArgs } from './chart-data-error-event-args';
|
|
6
|
+
import type { ChartField } from './chart-field';
|
|
7
|
+
import type { ChartLegendOptions } from './chart-legend-options';
|
|
8
|
+
import type { ChartPointEventArgs } from './chart-point-event-args';
|
|
9
|
+
import type { ChartPointSelection } from './chart-point-selection';
|
|
10
|
+
import type { ChartReference } from './chart-reference';
|
|
11
|
+
import type { ChartSelectionChangedEventArgs } from './chart-selection-changed-event-args';
|
|
12
|
+
import type { ChartZoomChangedEventArgs } from './chart-zoom-changed-event-args';
|
|
13
|
+
import type { ChartSeries } from './chart-series';
|
|
14
|
+
import type { ChartSeriesToggledEventArgs } from './chart-series-toggled-event-args';
|
|
15
|
+
import type { ChartStacked } from './chart-stacked';
|
|
16
|
+
import type { ChartTooltipOptions } from './chart-tooltip-options';
|
|
17
|
+
import type { ChartMode } from './chart-mode';
|
|
18
|
+
import type { ChartModeChangedEventArgs } from './chart-mode-changed-event-args';
|
|
19
|
+
type On<E> = Parameters<MotifEvent<E>>[0];
|
|
20
|
+
/** Props of a chart. */
|
|
21
|
+
export interface ChartProps<T = any> extends ControlProps {
|
|
22
|
+
/** The rows. They are read, never changed. After changing them in place, call `refresh()`. */
|
|
23
|
+
data?: Bind<readonly T[] | null>;
|
|
24
|
+
/** Rows from a data source of the data layer. */
|
|
25
|
+
dataSource?: Bind<data.DataSource<T, any> | null>;
|
|
26
|
+
/** The field of a row that holds its position along the axis. */
|
|
27
|
+
xField?: Bind<ChartField<T> | null>;
|
|
28
|
+
/** What to draw. */
|
|
29
|
+
series?: Bind<readonly ChartSeries<T>[]>;
|
|
30
|
+
/** Lays the chart on its side: categories down the page, values across. Default: `false`. */
|
|
31
|
+
horizontal?: Bind<boolean>;
|
|
32
|
+
/** Stacks the bars and areas, as they are or as shares of a hundred. Default: `false`. */
|
|
33
|
+
stacked?: Bind<ChartStacked>;
|
|
34
|
+
/** The title above the chart. */
|
|
35
|
+
title?: Bind<string>;
|
|
36
|
+
/** A line under the title. */
|
|
37
|
+
subtitle?: Bind<string>;
|
|
38
|
+
/** The accessible name. Default: the title. */
|
|
39
|
+
label?: Bind<string>;
|
|
40
|
+
/** The axis of positions: along the bottom, or down the side when `horizontal`. */
|
|
41
|
+
xAxis?: Bind<ChartAxis>;
|
|
42
|
+
/** The axis of values. */
|
|
43
|
+
yAxis?: Bind<ChartAxis>;
|
|
44
|
+
/** Default: on with two series or more. */
|
|
45
|
+
legend?: Bind<boolean | ChartLegendOptions>;
|
|
46
|
+
/** Default: on. */
|
|
47
|
+
tooltip?: Bind<boolean | ChartTooltipOptions<T>>;
|
|
48
|
+
/** A line that follows the pointer on lines and areas. Default: `true`. */
|
|
49
|
+
crosshair?: Bind<boolean>;
|
|
50
|
+
/** The height in pixels. Default: from the design language. */
|
|
51
|
+
height?: Bind<number | null>;
|
|
52
|
+
/** Draws the marks in as they first appear. Default: `true`. */
|
|
53
|
+
animation?: Bind<boolean>;
|
|
54
|
+
/** A button that switches between the chart and its table. Default: `true`. */
|
|
55
|
+
tableButton?: Bind<boolean>;
|
|
56
|
+
/** Shows the chart or its table. Follows `x-model`. Default: `'chart'`. */
|
|
57
|
+
mode?: Bind<ChartMode>;
|
|
58
|
+
/** The text when there is nothing to draw. Default: a kit string. */
|
|
59
|
+
emptyText?: Bind<string>;
|
|
60
|
+
/** Holds what is drawn, dimmed, while new values load. */
|
|
61
|
+
loading?: Bind<boolean>;
|
|
62
|
+
/** Zooms in on positions: drag across the plot, Ctrl and the wheel, or + and -. Default: `false`. */
|
|
63
|
+
zoom?: Bind<boolean>;
|
|
64
|
+
/** Lines and bands across the plot. */
|
|
65
|
+
references?: Bind<readonly ChartReference[]>;
|
|
66
|
+
/** Whether a click or Enter chooses values. Default: `'none'`. */
|
|
67
|
+
pointSelection?: Bind<ChartPointSelection>;
|
|
68
|
+
onPointClick?: On<ChartPointEventArgs<T>>;
|
|
69
|
+
onPointFocused?: On<ChartPointEventArgs<T>>;
|
|
70
|
+
onSeriesToggled?: On<ChartSeriesToggledEventArgs<T>>;
|
|
71
|
+
onModeChanged?: On<ChartModeChangedEventArgs<T>>;
|
|
72
|
+
onDataError?: On<ChartDataErrorEventArgs<T>>;
|
|
73
|
+
onZoomChanged?: On<ChartZoomChangedEventArgs<T>>;
|
|
74
|
+
onSelectionChanged?: On<ChartSelectionChangedEventArgs<T>>;
|
|
75
|
+
}
|
|
76
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** A line or a band across the plot, for a target, a limit or a period. */
|
|
2
|
+
export interface ChartReference {
|
|
3
|
+
/** The axis it marks a value of: `'y'` across the values, `'x'` at a position. Default: `'y'`. */
|
|
4
|
+
axis?: 'x' | 'y';
|
|
5
|
+
/** A line at this value or position. */
|
|
6
|
+
value?: unknown;
|
|
7
|
+
/** A band from one value or position to another. */
|
|
8
|
+
from?: unknown;
|
|
9
|
+
to?: unknown;
|
|
10
|
+
/** A short text at its end. */
|
|
11
|
+
label?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Chart } from './Chart';
|
|
2
|
+
import type { ChartPoint } from './chart-point';
|
|
3
|
+
/** Data of `Chart.onSelectionChanged`. */
|
|
4
|
+
export interface ChartSelectionChangedEventArgs<T = any> {
|
|
5
|
+
/** The values chosen now. */
|
|
6
|
+
points: ChartPoint<T>[];
|
|
7
|
+
source: Chart<T>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Chart } from './Chart';
|
|
2
|
+
import type { ChartSeries } from './chart-series';
|
|
3
|
+
/** Data of `Chart.onSeriesToggled`. */
|
|
4
|
+
export interface ChartSeriesToggledEventArgs<T = any> {
|
|
5
|
+
series: ChartSeries<T>;
|
|
6
|
+
visible: boolean;
|
|
7
|
+
/** The row of the part of a pie, a donut or a funnel that was hidden or shown. */
|
|
8
|
+
part?: number;
|
|
9
|
+
source: Chart<T>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a series draws its values. On two axes: `line`, `area`, `bar`, `scatter`, `bubble`, `rangeArea`, `rangeBar`,
|
|
3
|
+
* `candlestick`, `ohlc`, `waterfall` and `heatmap`. As the parts of one whole: `pie`, `donut` and `funnel`. Around a
|
|
4
|
+
* center: `radar`. A chart draws the family of its first series.
|
|
5
|
+
*/
|
|
6
|
+
export type ChartSeriesType = 'line' | 'area' | 'bar' | 'scatter' | 'bubble' | 'rangeArea' | 'rangeBar' | 'candlestick' | 'ohlc' | 'waterfall' | 'heatmap' | 'pie' | 'donut' | 'funnel' | 'radar';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ChartFormat } from '../../parts/chart/chart-text';
|
|
2
|
+
import type { ChartField } from './chart-field';
|
|
3
|
+
import type { ChartLabels } from './chart-labels';
|
|
4
|
+
import type { ChartSeriesType } from './chart-series-type';
|
|
5
|
+
/** A set of values on the chart. Every field is optional except `yField`. */
|
|
6
|
+
export interface ChartSeries<T = any> {
|
|
7
|
+
/** How it draws. Default: `'line'`. */
|
|
8
|
+
type?: ChartSeriesType;
|
|
9
|
+
/** The name in the legend, the tooltip and the table. Default: `yField` when it is a name. */
|
|
10
|
+
name?: string;
|
|
11
|
+
/** The field that holds the value. On a heat map, the row; on a range or a candle, leave it out. */
|
|
12
|
+
yField?: ChartField<T>;
|
|
13
|
+
/** The field of the position along the axis, for a series with its own. Default: the chart's `xField`. */
|
|
14
|
+
xField?: ChartField<T>;
|
|
15
|
+
/** The field that holds the size of a bubble. */
|
|
16
|
+
sizeField?: ChartField<T>;
|
|
17
|
+
/** The ends of a range (`rangeArea`, `rangeBar`), and the lowest and highest price of a candle. */
|
|
18
|
+
lowField?: ChartField<T>;
|
|
19
|
+
highField?: ChartField<T>;
|
|
20
|
+
/** The first and last price of a candle (`candlestick`, `ohlc`). */
|
|
21
|
+
openField?: ChartField<T>;
|
|
22
|
+
closeField?: ChartField<T>;
|
|
23
|
+
/** The value a heat map shows as a color. */
|
|
24
|
+
valueField?: ChartField<T>;
|
|
25
|
+
/** A row of a waterfall that shows the total so far instead of a change. */
|
|
26
|
+
totalField?: ChartField<T>;
|
|
27
|
+
/** The hole of a donut, as a share of its radius. Default: from the design language. */
|
|
28
|
+
innerRadius?: number;
|
|
29
|
+
/** Where the first slice of a pie or a donut starts, in degrees from the top, clockwise. Default: `0`. */
|
|
30
|
+
startAngle?: number;
|
|
31
|
+
/** Rows of its own. Default: the chart's rows. */
|
|
32
|
+
data?: readonly T[];
|
|
33
|
+
/** A color of your own. Default: the color of its place in `series`, which it keeps when others are hidden. */
|
|
34
|
+
color?: string;
|
|
35
|
+
/** Series of the same name stack on each other; `true` joins the chart's one stack. Default: the chart's `stacked`. */
|
|
36
|
+
stack?: string | boolean;
|
|
37
|
+
/** Draws the series. A series the reader hid in the legend stays hidden until shown there. Default: `true`. */
|
|
38
|
+
visible?: boolean;
|
|
39
|
+
/** Lists the series in the legend. Default: `true`. */
|
|
40
|
+
legend?: boolean;
|
|
41
|
+
/** Lists the series in the tooltip. Default: `true`. */
|
|
42
|
+
tooltip?: boolean;
|
|
43
|
+
/** Curves the line, never past the values it joins. Default: `false`. */
|
|
44
|
+
smooth?: boolean;
|
|
45
|
+
/** Draws corners: the value changes at the start, the middle or the end of the step. */
|
|
46
|
+
step?: 'start' | 'middle' | 'end';
|
|
47
|
+
/** Marks each value of a line. Default: `false`. */
|
|
48
|
+
markers?: boolean;
|
|
49
|
+
/** Which values carry a label. Default: `'none'`. */
|
|
50
|
+
labels?: ChartLabels;
|
|
51
|
+
/** What an empty value does to a line: it breaks it, the line joins past it, or it counts as zero. Default: `'break'`. */
|
|
52
|
+
gaps?: 'break' | 'connect' | 'zero';
|
|
53
|
+
/** How the values read in the tooltip, the labels and the table. Default: the value axis's `format`. */
|
|
54
|
+
format?: ChartFormat;
|
|
55
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ChartPoint } from './chart-point';
|
|
2
|
+
/** What a tooltip gets to show. */
|
|
3
|
+
export interface ChartTooltipContext<T = any> {
|
|
4
|
+
/** The position along the axis, as it reads. */
|
|
5
|
+
title: string;
|
|
6
|
+
/** The values there. */
|
|
7
|
+
points: readonly ChartPoint<T>[];
|
|
8
|
+
/** The value under the pointer, if any. */
|
|
9
|
+
point: ChartPoint<T> | null;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ChartTooltipContext } from './chart-tooltip-context';
|
|
2
|
+
/** The tooltip. */
|
|
3
|
+
export interface ChartTooltipOptions<T = any> {
|
|
4
|
+
/** Default: `true`. */
|
|
5
|
+
visible?: boolean;
|
|
6
|
+
/** Lists every series at that position, not only the one under the pointer. Default: `true`; a scatter chart: `false`. */
|
|
7
|
+
shared?: boolean;
|
|
8
|
+
/** Content of your own, as text or as an element. */
|
|
9
|
+
format?: (context: ChartTooltipContext<T>) => string | Node;
|
|
10
|
+
}
|