@tetrascience-npm/tetrascience-react-ui 0.3.0 → 0.4.0-beta.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +187 -6
- package/dist/cjs/index.js +304 -286
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/providers/athena.js +2 -0
- package/dist/cjs/providers/athena.js.map +1 -0
- package/dist/cjs/providers/databricks.js +2 -0
- package/dist/cjs/providers/databricks.js.map +1 -0
- package/dist/cjs/providers/exceptions-CYktpdqW.js +2 -0
- package/dist/cjs/providers/exceptions-CYktpdqW.js.map +1 -0
- package/dist/cjs/providers/snowflake.js +2 -0
- package/dist/cjs/providers/snowflake.js.map +1 -0
- package/dist/cjs/server.js +1 -1
- package/dist/esm/index.js +270 -252
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/providers/athena.js +2 -0
- package/dist/esm/providers/athena.js.map +1 -0
- package/dist/esm/providers/databricks.js +2 -0
- package/dist/esm/providers/databricks.js.map +1 -0
- package/dist/esm/providers/exceptions-C3uFWZB2.js +2 -0
- package/dist/esm/providers/exceptions-C3uFWZB2.js.map +1 -0
- package/dist/esm/providers/snowflake.js +2 -0
- package/dist/esm/providers/snowflake.js.map +1 -0
- package/dist/esm/server.js +1 -1
- package/dist/index.d.ts +1889 -112
- package/dist/providers/athena.d.ts +79 -0
- package/dist/providers/databricks.d.ts +43 -0
- package/dist/providers/snowflake.d.ts +40 -0
- package/dist/providers/types-Ck4uFaGp.d.ts +82 -0
- package/dist/server.d.ts +433 -2
- package/package.json +101 -24
- package/src/styles/README.md +0 -56
package/dist/index.d.ts
CHANGED
|
@@ -1,109 +1,1886 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
1
|
+
import React$1, { ClassAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { OnChange } from '@monaco-editor/react';
|
|
4
|
+
import { ExtraProps } from 'react-markdown';
|
|
5
|
+
import { SearchEqlRequest } from '@tetrascience-npm/ts-connectors-sdk';
|
|
6
|
+
|
|
7
|
+
type BadgeSize = "small" | "medium";
|
|
8
|
+
type BadgeVariant = "default" | "primary";
|
|
9
|
+
interface BadgeProps {
|
|
10
|
+
children: React$1.ReactNode;
|
|
11
|
+
size?: BadgeSize;
|
|
12
|
+
variant?: BadgeVariant;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
iconLeft?: React$1.ReactNode;
|
|
15
|
+
iconRight?: React$1.ReactNode;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
declare const Badge: React$1.FC<BadgeProps>;
|
|
19
|
+
|
|
20
|
+
type ButtonSize = "small" | "medium";
|
|
21
|
+
type ButtonVariant = "primary" | "secondary" | "tertiary";
|
|
22
|
+
interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
23
|
+
children: React$1.ReactNode;
|
|
24
|
+
variant?: ButtonVariant;
|
|
25
|
+
size?: ButtonSize;
|
|
26
|
+
loading?: boolean;
|
|
27
|
+
leftIcon?: React$1.ReactNode;
|
|
28
|
+
rightIcon?: React$1.ReactNode;
|
|
29
|
+
noPadding?: boolean;
|
|
30
|
+
fullWidth?: boolean;
|
|
31
|
+
ref?: React$1.Ref<HTMLButtonElement>;
|
|
32
|
+
}
|
|
33
|
+
declare const Button: ({ children, variant, size, loading, leftIcon, rightIcon, noPadding, fullWidth, disabled, ref, ...rest }: ButtonProps) => react_jsx_runtime.JSX.Element;
|
|
34
|
+
|
|
35
|
+
interface ButtonControlProps {
|
|
36
|
+
icon?: React$1.ReactNode;
|
|
37
|
+
selected?: boolean;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
onClick?: () => void;
|
|
40
|
+
}
|
|
41
|
+
declare const ButtonControl: React$1.FC<ButtonControlProps>;
|
|
42
|
+
|
|
43
|
+
type CardSize = "small" | "medium" | "large";
|
|
44
|
+
type CardVariant = "default" | "outlined" | "elevated";
|
|
45
|
+
interface CardProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
46
|
+
children: React$1.ReactNode;
|
|
47
|
+
title?: React$1.ReactNode;
|
|
48
|
+
size?: CardSize;
|
|
49
|
+
variant?: CardVariant;
|
|
50
|
+
className?: string;
|
|
51
|
+
fullWidth?: boolean;
|
|
52
|
+
ref?: React$1.Ref<HTMLDivElement>;
|
|
53
|
+
}
|
|
54
|
+
declare const Card: ({ children, title, size, variant, className, fullWidth, ref, ...rest }: CardProps) => react_jsx_runtime.JSX.Element;
|
|
55
|
+
|
|
56
|
+
interface CheckboxProps {
|
|
57
|
+
checked?: boolean;
|
|
58
|
+
onChange?: (checked: boolean) => void;
|
|
59
|
+
disabled?: boolean;
|
|
60
|
+
className?: string;
|
|
61
|
+
onClick?: (e: React$1.MouseEvent) => void;
|
|
62
|
+
label?: React$1.ReactNode;
|
|
63
|
+
noPadding?: boolean;
|
|
64
|
+
ref?: React$1.Ref<HTMLInputElement>;
|
|
65
|
+
}
|
|
66
|
+
declare const Checkbox: ({ checked, onChange, disabled, className, onClick, label, noPadding, ref, }: CheckboxProps) => react_jsx_runtime.JSX.Element;
|
|
67
|
+
|
|
68
|
+
interface CodeEditorProps {
|
|
69
|
+
value: string;
|
|
70
|
+
onChange: OnChange;
|
|
71
|
+
language?: string;
|
|
72
|
+
theme?: "light" | "dark";
|
|
73
|
+
height?: string | number;
|
|
74
|
+
width?: string | number;
|
|
75
|
+
options?: Record<string, unknown>;
|
|
76
|
+
label?: string;
|
|
77
|
+
onCopy?: (code: string) => void;
|
|
78
|
+
onLaunch?: (code: string) => void;
|
|
79
|
+
disabled?: boolean;
|
|
80
|
+
}
|
|
81
|
+
declare const CodeEditor: React$1.FC<CodeEditorProps>;
|
|
82
|
+
|
|
83
|
+
type DropdownSize = "xsmall" | "small";
|
|
84
|
+
interface DropdownOption {
|
|
85
|
+
value: string;
|
|
86
|
+
label: string;
|
|
87
|
+
disabled?: boolean;
|
|
88
|
+
}
|
|
89
|
+
interface DropdownProps {
|
|
90
|
+
options: DropdownOption[];
|
|
91
|
+
value?: string;
|
|
92
|
+
placeholder?: string;
|
|
93
|
+
disabled?: boolean;
|
|
94
|
+
error?: boolean;
|
|
95
|
+
size?: DropdownSize;
|
|
96
|
+
onChange?: (value: string) => void;
|
|
97
|
+
onOpen?: () => void;
|
|
98
|
+
onClose?: () => void;
|
|
99
|
+
width?: string;
|
|
100
|
+
menuWidth?: string;
|
|
101
|
+
}
|
|
102
|
+
declare const Dropdown: React$1.FC<DropdownProps>;
|
|
103
|
+
|
|
104
|
+
interface ErrorAlertProps {
|
|
105
|
+
/** The error object to display. Can be Error, AxiosError, string, or any other type. */
|
|
106
|
+
error: unknown;
|
|
107
|
+
/** Optional title for the error alert. Defaults to 'An Error Occurred'. */
|
|
108
|
+
title?: React$1.ReactNode;
|
|
109
|
+
/** Optional callback function when the alert is closed. */
|
|
110
|
+
onClose?: () => void;
|
|
111
|
+
/** Set to true to show technical details expanded by default. Defaults to false. */
|
|
112
|
+
showDetailsDefault?: boolean;
|
|
113
|
+
/** Custom message to show when error is null/undefined (optional, component renders nothing by default) */
|
|
114
|
+
noErrorContent?: React$1.ReactNode;
|
|
115
|
+
}
|
|
116
|
+
declare const ErrorAlert: React$1.FC<ErrorAlertProps>;
|
|
117
|
+
|
|
118
|
+
interface IconsProps {
|
|
119
|
+
fill?: string;
|
|
120
|
+
width?: string;
|
|
121
|
+
height?: string;
|
|
122
|
+
name: IconName;
|
|
123
|
+
}
|
|
124
|
+
interface IconProps {
|
|
125
|
+
fill?: string;
|
|
126
|
+
width?: string;
|
|
127
|
+
height?: string;
|
|
128
|
+
}
|
|
129
|
+
declare enum IconName {
|
|
130
|
+
BARS_3_BOTTOM_LEFT = "bars-3-bottom-left",
|
|
131
|
+
BUILDING = "building",
|
|
132
|
+
BULK_CHECK = "bulk-check",
|
|
133
|
+
CHECK = "check",
|
|
134
|
+
CHECK_CIRCLE = "check-circle",
|
|
135
|
+
CHECK_SQUARE = "check-square",
|
|
136
|
+
CHEVRON_DOWN = "chevron-down",
|
|
137
|
+
CLOSE = "close",
|
|
138
|
+
CODE = "code",
|
|
139
|
+
COMPUTER = "computer",
|
|
140
|
+
COPY = "copy",
|
|
141
|
+
CUBE = "cube",
|
|
142
|
+
DATABASE = "database",
|
|
143
|
+
EXCLAMATION_CIRCLE = "exclamation-circle",
|
|
144
|
+
EXCLAMATION_TRIANGLE = "exclamation-triangle",
|
|
145
|
+
GEAR = "gear",
|
|
146
|
+
GLobe = "globe",
|
|
147
|
+
HASHTAG = "hashtag",
|
|
148
|
+
HOME = "home",
|
|
149
|
+
INBOX = "inbox",
|
|
150
|
+
INFORMATION_CIRCLE = "information-circle",
|
|
151
|
+
INFORMATION_CIRCLE_MICRO = "information-circle-micro",
|
|
152
|
+
LAMP = "lamp",
|
|
153
|
+
LOCK_OPEN = "lock-open",
|
|
154
|
+
MINUS = "minus",
|
|
155
|
+
PAPER_PLANE = "paper-plane",
|
|
156
|
+
PENCIL = "pencil",
|
|
157
|
+
PIE_CHART = "pie-chart",
|
|
158
|
+
PIPELINE = "pipeline",
|
|
159
|
+
PLUS = "plus",
|
|
160
|
+
PROFILE = "profile",
|
|
161
|
+
QUESTION_CIRCLE = "question-circle",
|
|
162
|
+
ROCKET_LAUNCH = "rocket-launch",
|
|
163
|
+
SEARCH = "search",
|
|
164
|
+
SEARCH_DOCUMENT = "search-document",
|
|
165
|
+
SEARCH_SQL = "search-sql",
|
|
166
|
+
SITEMAP = "sitemap",
|
|
167
|
+
TETRASCIENCE_ICON = "tetrascience-icon",
|
|
168
|
+
TEXT = "text",
|
|
169
|
+
TRASH = "trash",
|
|
170
|
+
VIEWFINDER_CIRCLE = "viewfinder-circle"
|
|
171
|
+
}
|
|
172
|
+
declare const Icon: (props: IconsProps) => react_jsx_runtime.JSX.Element;
|
|
173
|
+
|
|
174
|
+
type InputSize = "xsmall" | "small";
|
|
175
|
+
interface InputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
176
|
+
size?: InputSize;
|
|
177
|
+
iconLeft?: React$1.ReactNode;
|
|
178
|
+
iconRight?: React$1.ReactNode;
|
|
179
|
+
error?: boolean;
|
|
180
|
+
disabled?: boolean;
|
|
181
|
+
ref?: React$1.Ref<HTMLInputElement>;
|
|
182
|
+
}
|
|
183
|
+
declare const Input: ({ size, iconLeft, iconRight, error, disabled, ref, ...rest }: InputProps) => react_jsx_runtime.JSX.Element;
|
|
184
|
+
|
|
185
|
+
interface LabelProps {
|
|
186
|
+
children: React$1.ReactNode;
|
|
187
|
+
infoText?: string;
|
|
188
|
+
className?: string;
|
|
189
|
+
}
|
|
190
|
+
declare const Label: React$1.FC<LabelProps>;
|
|
191
|
+
|
|
192
|
+
type CodeComponentProps = ClassAttributes<HTMLElement> & HTMLAttributes<HTMLElement> & ExtraProps & {
|
|
193
|
+
inline?: boolean;
|
|
194
|
+
};
|
|
195
|
+
type MarkdownDisplayProps = {
|
|
196
|
+
markdown: string;
|
|
197
|
+
codeRenderer?: (props: CodeComponentProps) => React$1.ReactElement;
|
|
198
|
+
};
|
|
199
|
+
declare const MarkdownDisplay: ({ markdown, codeRenderer }: MarkdownDisplayProps) => react_jsx_runtime.JSX.Element;
|
|
200
|
+
|
|
201
|
+
interface MenuItemProps {
|
|
202
|
+
label: string;
|
|
203
|
+
checked?: boolean;
|
|
204
|
+
showCheckbox?: boolean;
|
|
205
|
+
onClick?: () => void;
|
|
206
|
+
onCheckChange?: (checked: boolean) => void;
|
|
207
|
+
active?: boolean;
|
|
208
|
+
className?: string;
|
|
209
|
+
ref?: React$1.Ref<HTMLDivElement>;
|
|
210
|
+
}
|
|
211
|
+
declare const MenuItem: ({ label, checked, showCheckbox, onClick, onCheckChange, active, className, ref, }: MenuItemProps) => react_jsx_runtime.JSX.Element;
|
|
212
|
+
|
|
213
|
+
interface ModalProps {
|
|
214
|
+
isOpen: boolean;
|
|
215
|
+
onClose: () => void;
|
|
216
|
+
onCloseLabel?: string;
|
|
217
|
+
onConfirm: () => void;
|
|
218
|
+
onConfirmLabel?: string;
|
|
219
|
+
children: ReactNode;
|
|
220
|
+
width?: string;
|
|
221
|
+
className?: string;
|
|
222
|
+
hideActions?: boolean;
|
|
223
|
+
title?: string;
|
|
224
|
+
}
|
|
225
|
+
declare const Modal: ({ isOpen, onClose, onCloseLabel, onConfirm, onConfirmLabel, children, width, className, hideActions, title, }: ModalProps) => false | react_jsx_runtime.JSX.Element;
|
|
226
|
+
|
|
227
|
+
type PopConfirmPlacement = "top" | "left" | "right" | "bottom" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom";
|
|
228
|
+
interface PopConfirmProps {
|
|
229
|
+
title?: ReactNode;
|
|
230
|
+
description?: ReactNode;
|
|
231
|
+
onConfirm?: (e?: React$1.MouseEvent<HTMLElement>) => void;
|
|
232
|
+
onCancel?: (e?: React$1.MouseEvent<HTMLElement>) => void;
|
|
233
|
+
okText?: string;
|
|
234
|
+
cancelText?: string;
|
|
235
|
+
placement?: PopConfirmPlacement;
|
|
236
|
+
children: ReactNode;
|
|
237
|
+
className?: string;
|
|
238
|
+
okButtonProps?: React$1.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
239
|
+
cancelButtonProps?: React$1.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
240
|
+
}
|
|
241
|
+
declare const PopConfirm: React$1.FC<PopConfirmProps>;
|
|
242
|
+
|
|
243
|
+
interface SupportiveTextProps {
|
|
244
|
+
children: React$1.ReactNode;
|
|
245
|
+
showCheck?: boolean;
|
|
246
|
+
className?: string;
|
|
247
|
+
}
|
|
248
|
+
declare const SupportiveText: React$1.FC<SupportiveTextProps>;
|
|
249
|
+
|
|
250
|
+
type TabSize = "small" | "medium";
|
|
251
|
+
interface TabProps {
|
|
252
|
+
label: string;
|
|
253
|
+
active?: boolean;
|
|
254
|
+
disabled?: boolean;
|
|
255
|
+
size?: TabSize;
|
|
256
|
+
onClick?: () => void;
|
|
257
|
+
}
|
|
258
|
+
declare const Tab: React$1.FC<TabProps>;
|
|
259
|
+
|
|
260
|
+
interface TableCellProps extends React$1.TdHTMLAttributes<HTMLTableCellElement> {
|
|
261
|
+
children?: React$1.ReactNode;
|
|
262
|
+
align?: "left" | "center" | "right";
|
|
263
|
+
width?: string;
|
|
264
|
+
className?: string;
|
|
265
|
+
ref?: React$1.Ref<HTMLTableCellElement>;
|
|
266
|
+
}
|
|
267
|
+
declare const TableCell: ({ children, align, width, className, ref, ...props }: TableCellProps) => react_jsx_runtime.JSX.Element;
|
|
268
|
+
|
|
269
|
+
interface TableHeaderCellProps extends React$1.ThHTMLAttributes<HTMLTableCellElement> {
|
|
270
|
+
children?: React$1.ReactNode;
|
|
271
|
+
sortable?: boolean;
|
|
272
|
+
sortDirection?: "asc" | "desc" | null;
|
|
273
|
+
onSort?: () => void;
|
|
274
|
+
filterable?: boolean;
|
|
275
|
+
filterOptions?: DropdownOption[];
|
|
276
|
+
filterValue?: string;
|
|
277
|
+
onFilterChange?: (value: string) => void;
|
|
278
|
+
width?: string;
|
|
279
|
+
className?: string;
|
|
280
|
+
ref?: React$1.Ref<HTMLTableCellElement>;
|
|
281
|
+
}
|
|
282
|
+
declare const TableHeaderCell: ({ children, sortable, sortDirection, onSort, filterable, filterOptions, filterValue, onFilterChange, width, className, ref, ...props }: TableHeaderCellProps) => react_jsx_runtime.JSX.Element;
|
|
283
|
+
|
|
284
|
+
type TextareaSize = "xsmall" | "small";
|
|
285
|
+
interface TextareaProps extends Omit<React$1.TextareaHTMLAttributes<HTMLTextAreaElement>, "size"> {
|
|
286
|
+
size?: TextareaSize;
|
|
287
|
+
error?: boolean;
|
|
288
|
+
disabled?: boolean;
|
|
289
|
+
fullWidth?: boolean;
|
|
290
|
+
rows?: number;
|
|
291
|
+
ref?: React$1.Ref<HTMLTextAreaElement>;
|
|
292
|
+
}
|
|
293
|
+
declare const Textarea: ({ size, error, disabled, fullWidth, rows, ref, ...rest }: TextareaProps) => react_jsx_runtime.JSX.Element;
|
|
294
|
+
|
|
295
|
+
type ToastType = "info" | "success" | "warning" | "danger" | "default";
|
|
296
|
+
interface ToastProps {
|
|
297
|
+
type?: ToastType;
|
|
298
|
+
heading: string;
|
|
299
|
+
description?: string;
|
|
300
|
+
className?: string;
|
|
301
|
+
}
|
|
302
|
+
declare const Toast: React$1.FC<ToastProps>;
|
|
303
|
+
|
|
304
|
+
interface ToggleProps {
|
|
305
|
+
checked?: boolean;
|
|
306
|
+
onChange?: (checked: boolean) => void;
|
|
307
|
+
disabled?: boolean;
|
|
308
|
+
label?: string;
|
|
309
|
+
className?: string;
|
|
310
|
+
}
|
|
311
|
+
declare const Toggle: React$1.FC<ToggleProps>;
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* TDP Navigation Utilities
|
|
315
|
+
*
|
|
316
|
+
* Pure utility functions for constructing and navigating to TDP URLs.
|
|
317
|
+
* These work independently of React and can be used in any context.
|
|
318
|
+
*
|
|
319
|
+
* Data apps run inside iframes within TDP. These utilities help resolve
|
|
320
|
+
* the TDP base URL from the iframe context and construct navigation URLs.
|
|
321
|
+
*/
|
|
322
|
+
/**
|
|
323
|
+
* Extract the TDP base URL from `document.referrer`.
|
|
324
|
+
*
|
|
325
|
+
* In production, data apps run inside iframes within TDP. The browser
|
|
326
|
+
* provides `document.referrer` containing the parent TDP page URL.
|
|
327
|
+
* This function strips the known route path to get the base URL
|
|
328
|
+
* (origin + org slug path prefix).
|
|
329
|
+
*
|
|
330
|
+
* @example
|
|
331
|
+
* // referrer: "https://tetrascience-uat.com/my-org/data-workspace/abc"
|
|
332
|
+
* getTdpBaseUrlFromReferrer() // "https://tetrascience-uat.com/my-org"
|
|
333
|
+
*
|
|
334
|
+
* @returns The TDP base URL, or null if detection fails
|
|
335
|
+
*/
|
|
336
|
+
declare function getTdpBaseUrlFromReferrer(): string | null;
|
|
337
|
+
/**
|
|
338
|
+
* Construct a full TDP URL by joining a base URL with a path.
|
|
339
|
+
*
|
|
340
|
+
* @example
|
|
341
|
+
* buildTdpUrl("https://tetrascience.com/my-org", "/file/abc-123")
|
|
342
|
+
* // "https://tetrascience.com/my-org/file/abc-123"
|
|
343
|
+
*
|
|
344
|
+
* @param baseUrl - The TDP base URL (origin + optional org prefix)
|
|
345
|
+
* @param path - The TDP page path (e.g., "/file/abc-123")
|
|
346
|
+
* @returns The full TDP URL, or null if construction fails
|
|
347
|
+
*/
|
|
348
|
+
declare function buildTdpUrl(baseUrl: string, path: string): string | null;
|
|
349
|
+
interface TdpNavigationOptions {
|
|
350
|
+
/** Open in a new tab instead of navigating the parent TDP frame. Default: false */
|
|
351
|
+
newTab?: boolean;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Navigate to a TDP URL.
|
|
355
|
+
*
|
|
356
|
+
* - `{ newTab: true }` opens the URL in a new browser tab.
|
|
357
|
+
* - Default: sends a `postMessage` to the parent TDP frame (same-tab navigation
|
|
358
|
+
* when inside an iframe), or navigates the current window (standalone).
|
|
359
|
+
*
|
|
360
|
+
* @param url - Full TDP URL to navigate to
|
|
361
|
+
* @param options - Navigation options
|
|
362
|
+
*/
|
|
363
|
+
declare function navigateToTdpUrl(url: string, options?: TdpNavigationOptions): void;
|
|
364
|
+
/**
|
|
365
|
+
* Convenience helpers for constructing common TDP page paths.
|
|
366
|
+
* Returns path strings for use with `getTdpUrl()` or `buildTdpUrl()`.
|
|
367
|
+
*
|
|
368
|
+
* @example
|
|
369
|
+
* const { getTdpUrl } = useTdpNavigation();
|
|
370
|
+
* const url = getTdpUrl(tdpPaths.fileDetails("abc-123"));
|
|
371
|
+
*/
|
|
372
|
+
declare const tdpPaths: {
|
|
373
|
+
fileDetails: (fileId: string) => string;
|
|
374
|
+
pipelineEdit: (pipelineId: string) => string;
|
|
375
|
+
pipelineDetails: (pipelineId: string) => string;
|
|
376
|
+
search: (query?: string) => string;
|
|
377
|
+
dataWorkspace: () => string;
|
|
378
|
+
dataApps: () => string;
|
|
379
|
+
artifact: (type: string, namespace: string, slug: string) => string;
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
interface TdpNavigationContextValue {
|
|
383
|
+
/** The resolved TDP base URL (origin + org path prefix), or null if not resolved */
|
|
384
|
+
tdpBaseUrl: string | null;
|
|
385
|
+
/** Construct a full TDP URL from a path. Returns null if base URL is not resolved. */
|
|
386
|
+
getTdpUrl: (path: string) => string | null;
|
|
387
|
+
/** Navigate to a TDP page. */
|
|
388
|
+
navigateToTdp: (path: string, options?: TdpNavigationOptions) => void;
|
|
389
|
+
}
|
|
390
|
+
declare const TdpNavigationContext: React$1.Context<TdpNavigationContextValue | null>;
|
|
391
|
+
/**
|
|
392
|
+
* Access TDP navigation helpers from the nearest TdpNavigationProvider.
|
|
393
|
+
*
|
|
394
|
+
* @throws Error if used outside a TdpNavigationProvider
|
|
395
|
+
*
|
|
396
|
+
* @example
|
|
397
|
+
* ```tsx
|
|
398
|
+
* const { getTdpUrl, navigateToTdp } = useTdpNavigationContext();
|
|
399
|
+
* ```
|
|
400
|
+
*/
|
|
401
|
+
declare function useTdpNavigationContext(): TdpNavigationContextValue;
|
|
402
|
+
/** Props for the TdpNavigationProvider component */
|
|
403
|
+
interface TdpNavigationProviderProps {
|
|
404
|
+
/**
|
|
405
|
+
* Explicit TDP base URL override. Skips auto-detection when provided.
|
|
406
|
+
*/
|
|
407
|
+
tdpBaseUrl?: string;
|
|
408
|
+
children: React$1.ReactNode;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Provider that resolves the TDP base URL and exposes navigation helpers.
|
|
412
|
+
*
|
|
413
|
+
* Resolution order:
|
|
414
|
+
* 1. Explicit `tdpBaseUrl` prop (if provided)
|
|
415
|
+
* 2. `document.referrer` parsing (production iframe)
|
|
416
|
+
*
|
|
417
|
+
* @example
|
|
418
|
+
* ```tsx
|
|
419
|
+
* <TdpNavigationProvider tdpBaseUrl="https://tetrascience.com/my-org">
|
|
420
|
+
* <App />
|
|
421
|
+
* </TdpNavigationProvider>
|
|
422
|
+
* ```
|
|
423
|
+
*/
|
|
424
|
+
declare const TdpNavigationProvider: React$1.FC<TdpNavigationProviderProps>;
|
|
425
|
+
interface UseTdpNavigationOptions {
|
|
426
|
+
/** Explicit TDP base URL override */
|
|
427
|
+
tdpBaseUrl?: string;
|
|
428
|
+
}
|
|
429
|
+
interface UseTdpNavigationReturn {
|
|
430
|
+
/** The resolved TDP base URL, or null */
|
|
431
|
+
tdpBaseUrl: string | null;
|
|
432
|
+
/** Construct a full TDP URL from a path */
|
|
433
|
+
getTdpUrl: (path: string) => string | null;
|
|
434
|
+
/** Navigate to a TDP page */
|
|
435
|
+
navigateToTdp: (path: string, options?: TdpNavigationOptions) => void;
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Standalone hook for TDP navigation (no provider required).
|
|
439
|
+
*
|
|
440
|
+
* For simple use cases where you don't need a TdpNavigationProvider.
|
|
441
|
+
* If multiple components need navigation, prefer the provider approach.
|
|
442
|
+
*
|
|
443
|
+
* @example
|
|
444
|
+
* ```tsx
|
|
445
|
+
* function MyComponent() {
|
|
446
|
+
* const { getTdpUrl, navigateToTdp } = useTdpNavigation({
|
|
447
|
+
* tdpBaseUrl: "https://tetrascience.com/my-org",
|
|
448
|
+
* });
|
|
449
|
+
*
|
|
450
|
+
* return (
|
|
451
|
+
* <a href={getTdpUrl("/file/abc") ?? "#"} target="_blank" rel="noopener noreferrer">
|
|
452
|
+
* View File
|
|
453
|
+
* </a>
|
|
454
|
+
* );
|
|
455
|
+
* }
|
|
456
|
+
* ```
|
|
457
|
+
*/
|
|
458
|
+
declare function useTdpNavigation(options?: UseTdpNavigationOptions): UseTdpNavigationReturn;
|
|
459
|
+
/** Props for the TDPLink component */
|
|
460
|
+
interface TDPLinkProps extends Omit<React$1.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> {
|
|
461
|
+
/** TDP page path (e.g., "/file/abc-123" or use tdpPaths helpers) */
|
|
462
|
+
path: string;
|
|
463
|
+
/** Navigation behavior. Default: { newTab: true } */
|
|
464
|
+
navigationOptions?: TdpNavigationOptions;
|
|
465
|
+
children: React$1.ReactNode;
|
|
466
|
+
ref?: React$1.Ref<HTMLAnchorElement>;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* A link component that navigates to TDP pages.
|
|
470
|
+
*
|
|
471
|
+
* Renders a standard `<a>` tag with the correct href for right-click
|
|
472
|
+
* "Open in new tab" support, accessibility, and SEO.
|
|
473
|
+
*
|
|
474
|
+
* Must be used inside a `<TdpNavigationProvider>`.
|
|
475
|
+
*
|
|
476
|
+
* @example
|
|
477
|
+
* ```tsx
|
|
478
|
+
* import { TDPLink, tdpPaths } from '@tetrascience-npm/tetrascience-react-ui';
|
|
479
|
+
*
|
|
480
|
+
* <TDPLink path={tdpPaths.fileDetails("abc-123")}>
|
|
481
|
+
* View File Details
|
|
482
|
+
* </TDPLink>
|
|
483
|
+
*
|
|
484
|
+
* <TDPLink path="/search?q=test" navigationOptions={{ newTab: false }}>
|
|
485
|
+
* Search in TDP (same tab)
|
|
486
|
+
* </TDPLink>
|
|
487
|
+
* ```
|
|
488
|
+
*/
|
|
489
|
+
declare const TDPLink: React$1.FC<TDPLinkProps>;
|
|
490
|
+
|
|
491
|
+
type TooltipPlacement = "top" | "right" | "bottom" | "left";
|
|
492
|
+
interface TooltipProps {
|
|
493
|
+
content: ReactNode;
|
|
494
|
+
children: ReactNode;
|
|
495
|
+
placement?: TooltipPlacement;
|
|
496
|
+
className?: string;
|
|
497
|
+
delay?: number;
|
|
498
|
+
}
|
|
499
|
+
declare const Tooltip: React$1.FC<TooltipProps>;
|
|
500
|
+
|
|
501
|
+
interface UserProfileProps {
|
|
502
|
+
name: string;
|
|
503
|
+
avatar?: string;
|
|
504
|
+
}
|
|
505
|
+
interface AppHeaderProps {
|
|
506
|
+
hostname: string;
|
|
507
|
+
userProfile: UserProfileProps;
|
|
508
|
+
onHomeClick?: () => void;
|
|
509
|
+
onSettingsClick?: () => void;
|
|
510
|
+
onUserProfileClick?: () => void;
|
|
511
|
+
}
|
|
512
|
+
declare const AppHeader: React$1.FC<AppHeaderProps>;
|
|
513
|
+
|
|
514
|
+
interface AssistantModalProps {
|
|
515
|
+
open: boolean;
|
|
516
|
+
title: string;
|
|
517
|
+
prompt: string;
|
|
518
|
+
initialCode?: string;
|
|
519
|
+
userQuery?: string;
|
|
520
|
+
onUserQueryChange?: (value: string) => void;
|
|
521
|
+
onCopy: (code: string) => void;
|
|
522
|
+
onLaunch: (code: string) => void;
|
|
523
|
+
onSend: (input: string) => void;
|
|
524
|
+
onCancel: () => void;
|
|
525
|
+
}
|
|
526
|
+
declare const AssistantModal: React$1.FC<AssistantModalProps>;
|
|
527
|
+
|
|
528
|
+
interface ButtonControlItem extends ButtonControlProps {
|
|
529
|
+
id: string;
|
|
530
|
+
}
|
|
531
|
+
interface ButtonControlGroupProps {
|
|
532
|
+
controls: ButtonControlItem[];
|
|
533
|
+
selectedId?: string;
|
|
534
|
+
onChange?: (id: string) => void;
|
|
535
|
+
vertical?: boolean;
|
|
536
|
+
disabled?: boolean;
|
|
537
|
+
}
|
|
538
|
+
declare const ButtonControlGroup: React$1.FC<ButtonControlGroupProps>;
|
|
539
|
+
|
|
540
|
+
type CardSidebarStatus = "default" | "active" | "hover" | "disabled";
|
|
541
|
+
interface CardSidebarProps {
|
|
542
|
+
title: string;
|
|
543
|
+
description?: string;
|
|
544
|
+
buttonText?: string;
|
|
545
|
+
linkText?: string;
|
|
546
|
+
status?: CardSidebarStatus;
|
|
547
|
+
onButtonClick?: () => void;
|
|
548
|
+
onLinkClick?: () => void;
|
|
549
|
+
className?: string;
|
|
550
|
+
ref?: React$1.Ref<HTMLDivElement>;
|
|
551
|
+
}
|
|
552
|
+
declare const CardSidebar: ({ title, description, buttonText, linkText, status, onButtonClick, onLinkClick, className, ref, }: CardSidebarProps) => react_jsx_runtime.JSX.Element;
|
|
553
|
+
|
|
554
|
+
interface CodeScriptEditorButtonProps {
|
|
555
|
+
initialCode?: string;
|
|
556
|
+
onCodeSave?: (newCode: string) => void;
|
|
557
|
+
language?: string;
|
|
558
|
+
buttonText?: string;
|
|
559
|
+
modalTitle?: string;
|
|
560
|
+
buttonProps?: React.ComponentProps<typeof Button>;
|
|
561
|
+
modalProps?: Omit<React.ComponentProps<typeof Modal>, "isOpen" | "onConfirm" | "onClose">;
|
|
562
|
+
disabled?: boolean;
|
|
563
|
+
isEditMode?: boolean;
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Renders an 'Edit code' button that opens a modal with a Monaco code editor.
|
|
567
|
+
*/
|
|
568
|
+
declare const CodeScriptEditorButton: ({ initialCode, onCodeSave, language, buttonText, modalTitle, buttonProps, modalProps, disabled, }: CodeScriptEditorButtonProps) => react_jsx_runtime.JSX.Element;
|
|
569
|
+
|
|
570
|
+
interface FormFieldProps extends Omit<InputProps, "className"> {
|
|
571
|
+
label: string;
|
|
572
|
+
infoText?: string;
|
|
573
|
+
supportiveText?: string;
|
|
574
|
+
showSupportiveCheck?: boolean;
|
|
575
|
+
className?: string;
|
|
576
|
+
ref?: React$1.Ref<HTMLInputElement>;
|
|
577
|
+
}
|
|
578
|
+
declare const FormField: ({ label, infoText, supportiveText, showSupportiveCheck, className, ref, ...inputProps }: FormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
579
|
+
|
|
580
|
+
interface LaunchContentProps {
|
|
581
|
+
initialCode?: string;
|
|
582
|
+
onDeploy?: () => void;
|
|
583
|
+
versions?: string[];
|
|
584
|
+
currentVersion?: string;
|
|
585
|
+
onVersionChange?: (version: string) => void;
|
|
586
|
+
}
|
|
587
|
+
declare const LaunchContent: React$1.FC<LaunchContentProps>;
|
|
588
|
+
|
|
589
|
+
interface MenuItemData extends Omit<MenuItemProps, "onClick" | "onCheckChange"> {
|
|
590
|
+
id: string;
|
|
591
|
+
}
|
|
592
|
+
interface MenuProps {
|
|
593
|
+
title?: string;
|
|
594
|
+
items: MenuItemData[];
|
|
595
|
+
onItemClick?: (itemId: string) => void;
|
|
596
|
+
onItemCheckChange?: (itemId: string, checked: boolean) => void;
|
|
597
|
+
activeItemId?: string | null;
|
|
598
|
+
className?: string;
|
|
599
|
+
}
|
|
600
|
+
declare const Menu: React$1.FC<MenuProps>;
|
|
601
|
+
|
|
602
|
+
interface OrganizationInfo {
|
|
603
|
+
name: string;
|
|
604
|
+
subtext?: string;
|
|
605
|
+
logo?: React$1.ReactNode;
|
|
606
|
+
}
|
|
607
|
+
interface NavbarProps {
|
|
608
|
+
organization: OrganizationInfo;
|
|
609
|
+
}
|
|
610
|
+
declare const Navbar: React$1.FC<NavbarProps>;
|
|
611
|
+
|
|
612
|
+
interface ProtocolConfigurationProps {
|
|
613
|
+
className?: string;
|
|
614
|
+
}
|
|
615
|
+
declare const ProtocolConfiguration: React$1.FC<ProtocolConfigurationProps>;
|
|
616
|
+
|
|
617
|
+
interface ProtocolYamlCardProps {
|
|
618
|
+
title: string;
|
|
619
|
+
newVersionMode: boolean;
|
|
620
|
+
onToggleNewVersionMode: (checked: boolean) => void;
|
|
621
|
+
versionOptions: DropdownOption[];
|
|
622
|
+
selectedVersion: string;
|
|
623
|
+
onVersionChange: (value: string) => void;
|
|
624
|
+
onDeploy: () => void;
|
|
625
|
+
yaml: string;
|
|
626
|
+
onYamlChange: (value: string) => void;
|
|
627
|
+
}
|
|
628
|
+
declare const ProtocolYamlCard: React$1.FC<ProtocolYamlCardProps>;
|
|
629
|
+
|
|
630
|
+
interface PythonEditorModalProps {
|
|
631
|
+
open: boolean;
|
|
632
|
+
initialValue?: string;
|
|
633
|
+
title?: string;
|
|
634
|
+
onSave: (value: string) => void;
|
|
635
|
+
onCancel: () => void;
|
|
636
|
+
}
|
|
637
|
+
declare const PythonEditorModal: React$1.FC<PythonEditorModalProps>;
|
|
638
|
+
|
|
639
|
+
interface SelectFieldProps extends Omit<DropdownProps, "className"> {
|
|
640
|
+
label: string;
|
|
641
|
+
infoText?: string;
|
|
642
|
+
supportiveText?: string;
|
|
643
|
+
showSupportiveCheck?: boolean;
|
|
644
|
+
className?: string;
|
|
645
|
+
ref?: React$1.Ref<HTMLDivElement>;
|
|
646
|
+
}
|
|
647
|
+
declare const SelectField: ({ label, infoText, supportiveText, showSupportiveCheck, className, ref, ...dropdownProps }: SelectFieldProps) => react_jsx_runtime.JSX.Element;
|
|
648
|
+
|
|
649
|
+
interface SidebarItemProps {
|
|
650
|
+
icon: IconName;
|
|
651
|
+
label: string;
|
|
652
|
+
active?: boolean;
|
|
653
|
+
onClick?: () => void;
|
|
654
|
+
}
|
|
655
|
+
interface SidebarProps {
|
|
656
|
+
items: SidebarItemProps[];
|
|
657
|
+
activeItem?: string;
|
|
658
|
+
onItemClick?: (label: string) => void;
|
|
659
|
+
}
|
|
660
|
+
declare const Sidebar: React$1.FC<SidebarProps>;
|
|
661
|
+
|
|
662
|
+
interface TableColumn<T = any> {
|
|
663
|
+
key: string;
|
|
664
|
+
header: string;
|
|
665
|
+
sortable?: boolean;
|
|
666
|
+
filterable?: boolean;
|
|
667
|
+
filterOptions?: DropdownOption[];
|
|
668
|
+
width?: string;
|
|
669
|
+
align?: "left" | "center" | "right";
|
|
670
|
+
render?: (value: any, row: T, index: number) => React$1.ReactNode;
|
|
671
|
+
}
|
|
672
|
+
interface TableProps<T = any> {
|
|
673
|
+
columns: TableColumn<T>[];
|
|
674
|
+
data: T[];
|
|
675
|
+
pageSize?: number;
|
|
676
|
+
rowKey?: keyof T | ((row: T) => string | number);
|
|
677
|
+
selectable?: boolean;
|
|
678
|
+
onRowSelect?: (selectedRows: T[]) => void;
|
|
679
|
+
sortKey?: string;
|
|
680
|
+
sortDirection?: "asc" | "desc";
|
|
681
|
+
onSort?: (key: string, direction: "asc" | "desc") => void;
|
|
682
|
+
currentPage?: number;
|
|
683
|
+
onPageChange?: (page: number) => void;
|
|
684
|
+
totalItems?: number;
|
|
685
|
+
selectedRows?: T[];
|
|
686
|
+
className?: string;
|
|
687
|
+
}
|
|
688
|
+
declare function Table<T extends Record<string, any>>({ columns, data, pageSize, rowKey, selectable, onRowSelect, sortKey: controlledSortKey, sortDirection: controlledSortDirection, onSort: controlledOnSort, currentPage: controlledCurrentPage, onPageChange: controlledOnPageChange, totalItems, selectedRows: controlledSelectedRows, className, }: TableProps<T>): react_jsx_runtime.JSX.Element;
|
|
689
|
+
declare namespace Table {
|
|
690
|
+
var displayName: string;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
interface TabItem extends Omit<TabProps, "active" | "onClick"> {
|
|
694
|
+
id: string;
|
|
695
|
+
}
|
|
696
|
+
interface TabGroupProps {
|
|
697
|
+
tabs: TabItem[];
|
|
698
|
+
activeTab?: string;
|
|
699
|
+
onChange?: (tabId: string) => void;
|
|
700
|
+
disabled?: boolean;
|
|
701
|
+
size?: TabSize;
|
|
702
|
+
}
|
|
703
|
+
declare const TabGroup: React$1.FC<TabGroupProps>;
|
|
704
|
+
|
|
705
|
+
declare module "styled-components" {
|
|
706
|
+
interface DefaultTheme {
|
|
707
|
+
position: ToastPosition;
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
type ToastPosition = "top" | "bottom";
|
|
711
|
+
interface ToastContainerProps {
|
|
712
|
+
position: ToastPosition;
|
|
713
|
+
}
|
|
714
|
+
interface ToastManagerProps {
|
|
715
|
+
position?: ToastPosition;
|
|
716
|
+
}
|
|
717
|
+
declare const ToastManager: React$1.FC<ToastManagerProps>;
|
|
718
|
+
|
|
719
|
+
interface AppLayoutProps {
|
|
720
|
+
userProfile: {
|
|
721
|
+
name: string;
|
|
722
|
+
avatar?: string;
|
|
723
|
+
};
|
|
724
|
+
hostname: string;
|
|
725
|
+
organization: {
|
|
726
|
+
name: string;
|
|
727
|
+
subtext?: string;
|
|
728
|
+
logo?: React$1.ReactNode;
|
|
729
|
+
};
|
|
730
|
+
children?: React$1.ReactNode;
|
|
731
|
+
}
|
|
732
|
+
declare const AppLayout: React$1.FC<AppLayoutProps>;
|
|
733
|
+
|
|
734
|
+
interface AreaDataSeries {
|
|
735
|
+
x: number[];
|
|
736
|
+
y: number[];
|
|
737
|
+
name: string;
|
|
738
|
+
color: string;
|
|
739
|
+
fill?: "tozeroy" | "tonexty" | "toself";
|
|
740
|
+
}
|
|
741
|
+
type AreaGraphVariant = "normal" | "stacked";
|
|
742
|
+
interface AreaGraphProps {
|
|
743
|
+
dataSeries: AreaDataSeries[];
|
|
744
|
+
width?: number;
|
|
745
|
+
height?: number;
|
|
746
|
+
xRange?: [number, number];
|
|
747
|
+
yRange?: [number, number];
|
|
748
|
+
variant?: AreaGraphVariant;
|
|
749
|
+
xTitle?: string;
|
|
750
|
+
yTitle?: string;
|
|
751
|
+
title?: string;
|
|
752
|
+
}
|
|
753
|
+
declare const AreaGraph: React$1.FC<AreaGraphProps>;
|
|
754
|
+
|
|
755
|
+
interface BarDataSeries {
|
|
756
|
+
x: number[];
|
|
757
|
+
y: number[];
|
|
758
|
+
name: string;
|
|
759
|
+
color: string;
|
|
760
|
+
error_y?: {
|
|
761
|
+
type: "data";
|
|
762
|
+
array: number[];
|
|
763
|
+
visible: boolean;
|
|
764
|
+
};
|
|
765
|
+
}
|
|
766
|
+
type BarGraphVariant = "group" | "stack" | "overlay";
|
|
767
|
+
interface BarGraphProps {
|
|
768
|
+
dataSeries: BarDataSeries[];
|
|
769
|
+
width?: number;
|
|
770
|
+
height?: number;
|
|
771
|
+
xRange?: [number, number];
|
|
772
|
+
yRange?: [number, number];
|
|
773
|
+
variant?: BarGraphVariant;
|
|
774
|
+
xTitle?: string;
|
|
775
|
+
yTitle?: string;
|
|
776
|
+
title?: string;
|
|
777
|
+
barWidth?: number;
|
|
778
|
+
}
|
|
779
|
+
declare const BarGraph: React$1.FC<BarGraphProps>;
|
|
780
|
+
|
|
781
|
+
interface BoxDataSeries {
|
|
782
|
+
y: number[];
|
|
783
|
+
name: string;
|
|
784
|
+
color: string;
|
|
785
|
+
x?: string[] | number[];
|
|
786
|
+
boxpoints?: "all" | "outliers" | "suspectedoutliers" | false;
|
|
787
|
+
jitter?: number;
|
|
788
|
+
pointpos?: number;
|
|
789
|
+
}
|
|
790
|
+
interface BoxplotProps {
|
|
791
|
+
dataSeries: BoxDataSeries[];
|
|
792
|
+
width?: number;
|
|
793
|
+
height?: number;
|
|
794
|
+
xRange?: [number, number];
|
|
795
|
+
yRange?: [number, number];
|
|
796
|
+
xTitle?: string;
|
|
797
|
+
yTitle?: string;
|
|
798
|
+
title?: string;
|
|
799
|
+
showPoints?: boolean;
|
|
800
|
+
}
|
|
801
|
+
declare const Boxplot: React$1.FC<BoxplotProps>;
|
|
802
|
+
|
|
803
|
+
interface PeakData {
|
|
804
|
+
position: number;
|
|
805
|
+
base?: string;
|
|
806
|
+
peakA: number;
|
|
807
|
+
peakT: number;
|
|
808
|
+
peakG: number;
|
|
809
|
+
peakC: number;
|
|
810
|
+
}
|
|
811
|
+
interface ChromatogramProps {
|
|
812
|
+
data?: PeakData[];
|
|
813
|
+
width?: number;
|
|
814
|
+
height?: number;
|
|
815
|
+
positionInterval?: number;
|
|
816
|
+
colorA?: string;
|
|
817
|
+
colorT?: string;
|
|
818
|
+
colorG?: string;
|
|
819
|
+
colorC?: string;
|
|
820
|
+
}
|
|
821
|
+
declare const Chromatogram: React$1.FC<ChromatogramProps>;
|
|
822
|
+
|
|
823
|
+
/**
|
|
824
|
+
* Type definitions for ChromatogramChart component
|
|
825
|
+
*/
|
|
826
|
+
/**
|
|
827
|
+
* Data series for chromatogram visualization
|
|
828
|
+
*/
|
|
829
|
+
interface ChromatogramSeries {
|
|
830
|
+
/** Retention time values (x-axis) */
|
|
831
|
+
x: number[];
|
|
832
|
+
/** Signal intensity values (y-axis) */
|
|
833
|
+
y: number[];
|
|
834
|
+
/** Series label for legend */
|
|
835
|
+
name: string;
|
|
836
|
+
/** Optional color override (auto-assigned from CHART_COLORS if not provided) */
|
|
837
|
+
color?: string;
|
|
838
|
+
/** Optional metadata for the trace (displayed in tooltip on hover) */
|
|
839
|
+
metadata?: Record<string, unknown>;
|
|
840
|
+
}
|
|
841
|
+
/**
|
|
842
|
+
* Individual boundary marker type for a single boundary point
|
|
843
|
+
*/
|
|
844
|
+
type BoundaryMarkerType = "none" | "triangle" | "diamond";
|
|
845
|
+
/**
|
|
846
|
+
* Internal computed fields for peak annotations.
|
|
847
|
+
* These are populated by the component during processing.
|
|
848
|
+
* @internal
|
|
849
|
+
*/
|
|
850
|
+
interface PeakComputedFields {
|
|
851
|
+
/** Peak area calculated using trapezoidal integration */
|
|
852
|
+
area?: number;
|
|
853
|
+
/** Peak index in the data array */
|
|
854
|
+
index?: number;
|
|
855
|
+
/** Start index of peak boundary in the data array */
|
|
856
|
+
startIndex?: number;
|
|
857
|
+
/** End index of peak boundary in the data array */
|
|
858
|
+
endIndex?: number;
|
|
859
|
+
/** Peak width at half maximum */
|
|
860
|
+
widthAtHalfMax?: number;
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* Peak annotation for labeling peaks on the chromatogram.
|
|
864
|
+
* Used for both user-provided annotations and auto-detected peaks.
|
|
865
|
+
*/
|
|
866
|
+
interface PeakAnnotation {
|
|
867
|
+
/** Retention time of the peak (x-axis position) */
|
|
868
|
+
x: number;
|
|
869
|
+
/** Signal intensity at peak (y-axis position) */
|
|
870
|
+
y: number;
|
|
871
|
+
/** Label text (e.g., compound name). If not provided, auto-generated from computed area. */
|
|
872
|
+
text?: string;
|
|
873
|
+
/** Vertical arrow offset in pixels (negative = above peak, default: -30) */
|
|
874
|
+
ay?: number;
|
|
875
|
+
/** Horizontal arrow offset in pixels (default: 0) */
|
|
876
|
+
ax?: number;
|
|
877
|
+
/** Start retention time for peak boundary */
|
|
878
|
+
startX?: number;
|
|
879
|
+
/** End retention time for peak boundary */
|
|
880
|
+
endX?: number;
|
|
881
|
+
/** Marker style for start boundary (default: "triangle") */
|
|
882
|
+
startMarker?: BoundaryMarkerType;
|
|
883
|
+
/** Marker style for end boundary (default: "diamond") */
|
|
884
|
+
endMarker?: BoundaryMarkerType;
|
|
885
|
+
/**
|
|
886
|
+
* Internal computed fields populated by the component.
|
|
887
|
+
* @internal Do not set these directly - they are computed from startX/endX or auto-detection.
|
|
888
|
+
*/
|
|
889
|
+
_computed?: PeakComputedFields;
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* Baseline correction method
|
|
893
|
+
*/
|
|
894
|
+
type BaselineCorrectionMethod = "none" | "linear" | "rolling";
|
|
895
|
+
/**
|
|
896
|
+
* Global boundary marker style setting
|
|
897
|
+
* - "none": No boundary markers displayed
|
|
898
|
+
* - "enabled": Show boundary markers using per-peak settings (startMarker/endMarker) or defaults
|
|
899
|
+
*/
|
|
900
|
+
type BoundaryMarkerStyle = "none" | "enabled";
|
|
901
|
+
/**
|
|
902
|
+
* Peak detection algorithm options
|
|
903
|
+
*/
|
|
904
|
+
interface PeakDetectionOptions {
|
|
905
|
+
/** Minimum peak height threshold (absolute or relative to max, default: 0.05) */
|
|
906
|
+
minHeight?: number;
|
|
907
|
+
/** Minimum distance between peaks in data points (default: 5) */
|
|
908
|
+
minDistance?: number;
|
|
909
|
+
/** Prominence threshold - how much a peak stands out from neighbors (default: 0.02) */
|
|
910
|
+
prominence?: number;
|
|
911
|
+
/** Use relative threshold as percentage of max signal (default: true) */
|
|
912
|
+
relativeThreshold?: boolean;
|
|
913
|
+
}
|
|
914
|
+
/**
|
|
915
|
+
* Props for ChromatogramChart component
|
|
916
|
+
*/
|
|
917
|
+
interface ChromatogramChartProps {
|
|
918
|
+
/** Array of data series to display */
|
|
919
|
+
series: ChromatogramSeries[];
|
|
920
|
+
/** Chart width in pixels */
|
|
921
|
+
width?: number;
|
|
922
|
+
/** Chart height in pixels */
|
|
923
|
+
height?: number;
|
|
924
|
+
/** Chart title */
|
|
925
|
+
title?: string;
|
|
926
|
+
/** X-axis label */
|
|
927
|
+
xAxisTitle?: string;
|
|
928
|
+
/** Y-axis label */
|
|
929
|
+
yAxisTitle?: string;
|
|
930
|
+
/** Peak annotations to display */
|
|
931
|
+
annotations?: PeakAnnotation[];
|
|
932
|
+
/** Fixed x-axis range [min, max] */
|
|
933
|
+
xRange?: [number, number];
|
|
934
|
+
/** Fixed y-axis range [min, max] */
|
|
935
|
+
yRange?: [number, number];
|
|
936
|
+
/** Show legend (default: true) */
|
|
937
|
+
showLegend?: boolean;
|
|
938
|
+
/** Show vertical grid lines (default: true) */
|
|
939
|
+
showGridX?: boolean;
|
|
940
|
+
/** Show horizontal grid lines (default: true) */
|
|
941
|
+
showGridY?: boolean;
|
|
942
|
+
/** Show data point markers (default: false) */
|
|
943
|
+
showMarkers?: boolean;
|
|
944
|
+
/** Marker size when showMarkers is true (default: 4) */
|
|
945
|
+
markerSize?: number;
|
|
946
|
+
/** Show crosshairs on hover (default: false) */
|
|
947
|
+
showCrosshairs?: boolean;
|
|
948
|
+
/** Baseline correction method (default: "none") */
|
|
949
|
+
baselineCorrection?: BaselineCorrectionMethod;
|
|
950
|
+
/** Rolling baseline window size (default: 50) */
|
|
951
|
+
baselineWindowSize?: number;
|
|
952
|
+
/** Peak detection algorithm options - if provided, enables automatic peak detection */
|
|
953
|
+
peakDetectionOptions?: PeakDetectionOptions;
|
|
954
|
+
/** Show peak areas as annotations (default: false) */
|
|
955
|
+
showPeakAreas?: boolean;
|
|
956
|
+
/**
|
|
957
|
+
* Show peak boundary markers (default: "none").
|
|
958
|
+
* - "none": No boundary markers displayed
|
|
959
|
+
* - "enabled": Show boundary markers using per-peak startMarker/endMarker settings
|
|
960
|
+
*
|
|
961
|
+
* Per-peak marker defaults: startMarker="triangle", endMarker="diamond"
|
|
962
|
+
*/
|
|
963
|
+
boundaryMarkers?: BoundaryMarkerStyle;
|
|
964
|
+
/**
|
|
965
|
+
* Retention time threshold for grouping overlapping annotations (default: 0.4 minutes).
|
|
966
|
+
* Peaks closer than this threshold will have their annotations staggered to avoid overlap.
|
|
967
|
+
*/
|
|
968
|
+
annotationOverlapThreshold?: number;
|
|
969
|
+
/** Show export button in modebar (default: true) */
|
|
970
|
+
showExportButton?: boolean;
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
declare const ChromatogramChart: React$1.FC<ChromatogramChartProps>;
|
|
974
|
+
|
|
975
|
+
type MarkerSymbol$1 = "circle" | "square" | "diamond" | "triangle-up" | "triangle-down" | "star";
|
|
976
|
+
interface DotPlotDataSeries {
|
|
977
|
+
x: number[];
|
|
978
|
+
y: number[];
|
|
979
|
+
name: string;
|
|
980
|
+
color?: string;
|
|
981
|
+
symbol?: MarkerSymbol$1;
|
|
982
|
+
size?: number;
|
|
983
|
+
}
|
|
984
|
+
type DotPlotVariant = "default" | "stacked";
|
|
985
|
+
type DotPlotProps = {
|
|
986
|
+
dataSeries: DotPlotDataSeries | DotPlotDataSeries[];
|
|
987
|
+
width?: number;
|
|
988
|
+
height?: number;
|
|
989
|
+
title?: string;
|
|
990
|
+
xTitle?: string;
|
|
991
|
+
yTitle?: string;
|
|
992
|
+
variant?: DotPlotVariant;
|
|
993
|
+
markerSize?: number;
|
|
994
|
+
};
|
|
995
|
+
declare const DotPlot: React$1.FC<DotPlotProps>;
|
|
996
|
+
|
|
997
|
+
/**
|
|
998
|
+
* Props for the Heatmap component
|
|
999
|
+
* @deprecated Use PlateMap component instead. Heatmap is now a wrapper around PlateMap for backward compatibility.
|
|
1000
|
+
*/
|
|
1001
|
+
interface HeatmapProps {
|
|
1002
|
+
/** 2D array of numeric values */
|
|
1003
|
+
data?: number[][];
|
|
1004
|
+
/** Custom x-axis labels (column labels) */
|
|
1005
|
+
xLabels?: string[] | number[];
|
|
1006
|
+
/** Custom y-axis labels (row labels) */
|
|
1007
|
+
yLabels?: string[] | number[];
|
|
1008
|
+
/** Chart title */
|
|
1009
|
+
title?: string;
|
|
1010
|
+
/** X-axis title */
|
|
1011
|
+
xTitle?: string;
|
|
1012
|
+
/** Y-axis title */
|
|
1013
|
+
yTitle?: string;
|
|
1014
|
+
/** Color scale - string name or array of [position, color] pairs */
|
|
1015
|
+
colorscale?: string | Array<[number, string]>;
|
|
1016
|
+
/** Chart width in pixels */
|
|
1017
|
+
width?: number;
|
|
1018
|
+
/** Chart height in pixels */
|
|
1019
|
+
height?: number;
|
|
1020
|
+
/** Show color scale legend */
|
|
1021
|
+
showScale?: boolean;
|
|
1022
|
+
/** Number of decimal places for values */
|
|
1023
|
+
precision?: number;
|
|
1024
|
+
/** Minimum value for color scale */
|
|
1025
|
+
zmin?: number;
|
|
1026
|
+
/** Maximum value for color scale */
|
|
1027
|
+
zmax?: number;
|
|
1028
|
+
/** Value unit suffix */
|
|
1029
|
+
valueUnit?: string;
|
|
1030
|
+
}
|
|
1031
|
+
declare const Heatmap: React$1.FC<HeatmapProps>;
|
|
1032
|
+
|
|
1033
|
+
interface HistogramDataSeries {
|
|
1034
|
+
x: number[];
|
|
1035
|
+
name: string;
|
|
1036
|
+
color?: string;
|
|
1037
|
+
autobinx?: boolean;
|
|
1038
|
+
xbins?: {
|
|
1039
|
+
start: number;
|
|
1040
|
+
end: number;
|
|
1041
|
+
size: number;
|
|
1042
|
+
};
|
|
1043
|
+
opacity?: number;
|
|
1044
|
+
showDistributionLine?: boolean;
|
|
1045
|
+
lineWidth?: number;
|
|
1046
|
+
}
|
|
1047
|
+
type HistogramProps = {
|
|
1048
|
+
dataSeries: HistogramDataSeries | HistogramDataSeries[];
|
|
1049
|
+
width?: number;
|
|
1050
|
+
height?: number;
|
|
1051
|
+
title?: string;
|
|
1052
|
+
xTitle?: string;
|
|
1053
|
+
yTitle?: string;
|
|
1054
|
+
bargap?: number;
|
|
1055
|
+
showDistributionLine?: boolean;
|
|
1056
|
+
};
|
|
1057
|
+
declare const Histogram: React$1.FC<HistogramProps>;
|
|
1058
|
+
|
|
1059
|
+
/**
|
|
1060
|
+
* A single data point in the scatter plot
|
|
1061
|
+
*/
|
|
1062
|
+
interface ScatterPoint {
|
|
1063
|
+
/** Unique identifier for the point */
|
|
1064
|
+
id: string | number;
|
|
1065
|
+
/** X-axis value */
|
|
1066
|
+
x: number;
|
|
1067
|
+
/** Y-axis value */
|
|
1068
|
+
y: number;
|
|
1069
|
+
/** Optional label for the point */
|
|
1070
|
+
label?: string;
|
|
1071
|
+
/** Additional metadata for tooltips and styling */
|
|
1072
|
+
metadata?: Record<string, unknown>;
|
|
1073
|
+
}
|
|
1074
|
+
/**
|
|
1075
|
+
* Scale type for axes
|
|
1076
|
+
*/
|
|
1077
|
+
type ScaleType = "linear" | "log";
|
|
1078
|
+
/**
|
|
1079
|
+
* Marker shape for scatter points
|
|
1080
|
+
*/
|
|
1081
|
+
type MarkerShape = "circle" | "square" | "diamond" | "cross" | "x" | "triangle-up" | "triangle-down" | "star";
|
|
1082
|
+
/**
|
|
1083
|
+
* Selection mode for interactive selection
|
|
1084
|
+
*/
|
|
1085
|
+
type SelectionMode = "replace" | "add" | "remove" | "toggle";
|
|
1086
|
+
/**
|
|
1087
|
+
* Color mapping configuration
|
|
1088
|
+
*/
|
|
1089
|
+
interface ColorMapping {
|
|
1090
|
+
/** Type of mapping: data-driven or static */
|
|
1091
|
+
type: "static" | "continuous" | "categorical";
|
|
1092
|
+
/** Static color value (for type: "static") */
|
|
1093
|
+
value?: string;
|
|
1094
|
+
/** Data field to map (for type: "continuous" | "categorical") */
|
|
1095
|
+
field?: string;
|
|
1096
|
+
/** Color scale for continuous mapping */
|
|
1097
|
+
colorScale?: string | Array<[number, string]>;
|
|
1098
|
+
/** Discrete colors for categorical mapping */
|
|
1099
|
+
categoryColors?: Record<string, string>;
|
|
1100
|
+
/** Min/max values for continuous mapping (auto-calculated if not provided) */
|
|
1101
|
+
min?: number;
|
|
1102
|
+
max?: number;
|
|
1103
|
+
}
|
|
1104
|
+
/**
|
|
1105
|
+
* Shape mapping configuration
|
|
1106
|
+
*/
|
|
1107
|
+
interface ShapeMapping {
|
|
1108
|
+
/** Type of mapping: data-driven or static */
|
|
1109
|
+
type: "static" | "categorical";
|
|
1110
|
+
/** Static shape value (for type: "static") */
|
|
1111
|
+
value?: MarkerShape;
|
|
1112
|
+
/** Data field to map (for type: "categorical") */
|
|
1113
|
+
field?: string;
|
|
1114
|
+
/** Shape mapping for categorical values */
|
|
1115
|
+
categoryShapes?: Record<string, MarkerShape>;
|
|
1116
|
+
}
|
|
1117
|
+
/**
|
|
1118
|
+
* Size mapping configuration
|
|
1119
|
+
*/
|
|
1120
|
+
interface SizeMapping {
|
|
1121
|
+
/** Type of mapping: data-driven or static */
|
|
1122
|
+
type: "static" | "continuous" | "categorical";
|
|
1123
|
+
/** Static size value (for type: "static") */
|
|
1124
|
+
value?: number;
|
|
1125
|
+
/** Data field to map (for type: "continuous" | "categorical") */
|
|
1126
|
+
field?: string;
|
|
1127
|
+
/** Size range for continuous mapping */
|
|
1128
|
+
sizeRange?: [number, number];
|
|
1129
|
+
/** Discrete sizes for categorical mapping */
|
|
1130
|
+
categorySizes?: Record<string, number>;
|
|
1131
|
+
/** Min/max values for continuous mapping (auto-calculated if not provided) */
|
|
1132
|
+
min?: number;
|
|
1133
|
+
max?: number;
|
|
1134
|
+
}
|
|
1135
|
+
/**
|
|
1136
|
+
* Axis configuration
|
|
1137
|
+
*/
|
|
1138
|
+
interface AxisConfig {
|
|
1139
|
+
/** Axis label */
|
|
1140
|
+
title?: string;
|
|
1141
|
+
/** Scale type (linear or log) */
|
|
1142
|
+
scale?: ScaleType;
|
|
1143
|
+
/** Fixed axis range [min, max] */
|
|
1144
|
+
range?: [number, number];
|
|
1145
|
+
/** Auto-range with optional padding percentage (0-1) */
|
|
1146
|
+
autoRange?: boolean;
|
|
1147
|
+
/** Padding percentage for auto-range (default: 0.1 = 10%) */
|
|
1148
|
+
autoRangePadding?: number;
|
|
1149
|
+
}
|
|
1150
|
+
/**
|
|
1151
|
+
* Tooltip configuration
|
|
1152
|
+
*/
|
|
1153
|
+
interface TooltipConfig {
|
|
1154
|
+
/** Enable/disable tooltips */
|
|
1155
|
+
enabled?: boolean;
|
|
1156
|
+
/** Custom tooltip content function */
|
|
1157
|
+
content?: (point: ScatterPoint) => string;
|
|
1158
|
+
/** Fields to display in default tooltip */
|
|
1159
|
+
fields?: string[];
|
|
1160
|
+
}
|
|
1161
|
+
/**
|
|
1162
|
+
* Selection state
|
|
1163
|
+
*/
|
|
1164
|
+
interface SelectionState {
|
|
1165
|
+
/** Array of selected point IDs */
|
|
1166
|
+
selectedIds: Set<string | number>;
|
|
1167
|
+
}
|
|
1168
|
+
/**
|
|
1169
|
+
* Downsampling configuration for performance optimization
|
|
1170
|
+
*/
|
|
1171
|
+
interface DownsamplingConfig {
|
|
1172
|
+
/** Enable downsampling */
|
|
1173
|
+
enabled: boolean;
|
|
1174
|
+
/** Target number of points to display */
|
|
1175
|
+
maxPoints?: number;
|
|
1176
|
+
/** Downsampling strategy */
|
|
1177
|
+
strategy?: "lttb";
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
* Props for InteractiveScatter component
|
|
1181
|
+
*/
|
|
1182
|
+
interface InteractiveScatterProps {
|
|
1183
|
+
/**
|
|
1184
|
+
* Array of data points to plot
|
|
1185
|
+
*/
|
|
1186
|
+
data: ScatterPoint[];
|
|
1187
|
+
/**
|
|
1188
|
+
* Chart title
|
|
1189
|
+
*/
|
|
1190
|
+
title?: string;
|
|
1191
|
+
/**
|
|
1192
|
+
* X-axis configuration
|
|
1193
|
+
*/
|
|
1194
|
+
xAxis?: AxisConfig;
|
|
1195
|
+
/**
|
|
1196
|
+
* Y-axis configuration
|
|
1197
|
+
*/
|
|
1198
|
+
yAxis?: AxisConfig;
|
|
1199
|
+
/**
|
|
1200
|
+
* Color mapping configuration
|
|
1201
|
+
*/
|
|
1202
|
+
colorMapping?: ColorMapping;
|
|
1203
|
+
/**
|
|
1204
|
+
* Shape mapping configuration
|
|
1205
|
+
*/
|
|
1206
|
+
shapeMapping?: ShapeMapping;
|
|
1207
|
+
/**
|
|
1208
|
+
* Size mapping configuration
|
|
1209
|
+
*/
|
|
1210
|
+
sizeMapping?: SizeMapping;
|
|
1211
|
+
/**
|
|
1212
|
+
* Tooltip configuration
|
|
1213
|
+
*/
|
|
1214
|
+
tooltip?: TooltipConfig;
|
|
1215
|
+
/**
|
|
1216
|
+
* Enable click selection
|
|
1217
|
+
* @default true
|
|
1218
|
+
*/
|
|
1219
|
+
enableClickSelection?: boolean;
|
|
1220
|
+
/**
|
|
1221
|
+
* Enable box selection (drag to select rectangular region)
|
|
1222
|
+
* @default true
|
|
1223
|
+
*/
|
|
1224
|
+
enableBoxSelection?: boolean;
|
|
1225
|
+
/**
|
|
1226
|
+
* Enable lasso selection (freeform selection)
|
|
1227
|
+
* @default true
|
|
1228
|
+
*/
|
|
1229
|
+
enableLassoSelection?: boolean;
|
|
1230
|
+
/**
|
|
1231
|
+
* Controlled selection state.
|
|
1232
|
+
* If provided, component operates in controlled mode.
|
|
1233
|
+
*/
|
|
1234
|
+
selectedIds?: Set<string | number>;
|
|
1235
|
+
/**
|
|
1236
|
+
* Callback when selection changes
|
|
1237
|
+
*/
|
|
1238
|
+
onSelectionChange?: (selectedIds: Set<string | number>, mode: SelectionMode) => void;
|
|
1239
|
+
/**
|
|
1240
|
+
* Callback when a point is clicked
|
|
1241
|
+
*/
|
|
1242
|
+
onPointClick?: (point: ScatterPoint, event: MouseEvent) => void;
|
|
1243
|
+
/**
|
|
1244
|
+
* Downsampling configuration for large datasets
|
|
1245
|
+
*/
|
|
1246
|
+
downsampling?: DownsamplingConfig;
|
|
1247
|
+
/**
|
|
1248
|
+
* Chart width in pixels
|
|
1249
|
+
* @default 800
|
|
1250
|
+
*/
|
|
1251
|
+
width?: number;
|
|
1252
|
+
/**
|
|
1253
|
+
* Chart height in pixels
|
|
1254
|
+
* @default 600
|
|
1255
|
+
*/
|
|
1256
|
+
height?: number;
|
|
1257
|
+
/**
|
|
1258
|
+
* Show the continuous color-scale bar when using a continuous `colorMapping`.
|
|
1259
|
+
* Has no effect for categorical or static mappings.
|
|
1260
|
+
* @default true
|
|
1261
|
+
*/
|
|
1262
|
+
showColorBar?: boolean;
|
|
1263
|
+
/**
|
|
1264
|
+
* Custom CSS class name
|
|
1265
|
+
*/
|
|
1266
|
+
className?: string;
|
|
1267
|
+
}
|
|
1268
|
+
/**
|
|
1269
|
+
* Data format for selection propagation between components
|
|
1270
|
+
*/
|
|
1271
|
+
interface SelectionEvent {
|
|
1272
|
+
/** Array of selected point IDs */
|
|
1273
|
+
selectedIds: Set<string | number>;
|
|
1274
|
+
/** Selection mode used */
|
|
1275
|
+
mode: SelectionMode;
|
|
1276
|
+
/** Source component identifier (optional) */
|
|
1277
|
+
source?: string;
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
/**
|
|
1281
|
+
* InteractiveScatter component for visualizing scatter plot data with advanced interactions.
|
|
1282
|
+
*
|
|
1283
|
+
* **Features:**
|
|
1284
|
+
* - Data-driven and static styling (color, shape, size)
|
|
1285
|
+
* - Interactive selection (click, box, lasso)
|
|
1286
|
+
* - Keyboard modifiers for click-selection modes (Shift/Ctrl)
|
|
1287
|
+
* - Customizable tooltips with rich content support
|
|
1288
|
+
* - Axis customization (ranges, log/linear scales)
|
|
1289
|
+
* - Performance optimizations for large datasets
|
|
1290
|
+
* - Selection propagation via callbacks
|
|
1291
|
+
*
|
|
1292
|
+
* **Selection Modes (click selection only):**
|
|
1293
|
+
* - Default click: Replace selection
|
|
1294
|
+
* - Shift + click: Add to selection
|
|
1295
|
+
* - Ctrl/Cmd + click: Remove from selection
|
|
1296
|
+
* - Shift + Ctrl + click: Toggle selection
|
|
1297
|
+
*
|
|
1298
|
+
* Box/lasso selection always replaces the current selection because
|
|
1299
|
+
* Plotly does not expose the original keyboard event for drag operations.
|
|
1300
|
+
*/
|
|
1301
|
+
declare const InteractiveScatter: React$1.FC<InteractiveScatterProps>;
|
|
1302
|
+
|
|
1303
|
+
/**
|
|
1304
|
+
* Default color scale for continuous color mapping
|
|
1305
|
+
*/
|
|
1306
|
+
declare const DEFAULT_COLOR_SCALE: Array<[number, string]>;
|
|
1307
|
+
/**
|
|
1308
|
+
* Default category colors (cycle through these)
|
|
1309
|
+
*/
|
|
1310
|
+
declare const DEFAULT_CATEGORY_COLORS: string[];
|
|
1311
|
+
/**
|
|
1312
|
+
* Default sizes
|
|
1313
|
+
*/
|
|
1314
|
+
declare const DEFAULT_MARKER_SIZE = 8;
|
|
1315
|
+
declare const DEFAULT_SIZE_RANGE: [number, number];
|
|
1316
|
+
/**
|
|
1317
|
+
* Default downsampling configuration
|
|
1318
|
+
*/
|
|
1319
|
+
declare const DEFAULT_MAX_POINTS = 5000;
|
|
1320
|
+
/**
|
|
1321
|
+
* Constants for plot layout
|
|
1322
|
+
*/
|
|
1323
|
+
declare const PLOT_CONSTANTS: {
|
|
1324
|
+
MARGIN_LEFT: number;
|
|
1325
|
+
MARGIN_RIGHT: number;
|
|
1326
|
+
MARGIN_TOP: number;
|
|
1327
|
+
MARGIN_BOTTOM: number;
|
|
1328
|
+
TITLE_FONT_SIZE: number;
|
|
1329
|
+
AXIS_TITLE_FONT_SIZE: number;
|
|
1330
|
+
AXIS_TICK_FONT_SIZE: number;
|
|
1331
|
+
LEGEND_FONT_SIZE: number;
|
|
1332
|
+
FONT_FAMILY: string;
|
|
1333
|
+
GRID_WIDTH: number;
|
|
1334
|
+
AXIS_LINE_WIDTH: number;
|
|
1335
|
+
AUTO_RANGE_PADDING: number;
|
|
1336
|
+
};
|
|
1337
|
+
/**
|
|
1338
|
+
* Selection mode keyboard modifiers
|
|
1339
|
+
*/
|
|
1340
|
+
declare const SELECTION_MODIFIERS: {
|
|
1341
|
+
readonly ADD: "shiftKey";
|
|
1342
|
+
readonly REMOVE: "ctrlKey";
|
|
1343
|
+
readonly TOGGLE: "both";
|
|
1344
|
+
};
|
|
1345
|
+
|
|
1346
|
+
type MarkerSymbol = "circle" | "circle-open" | "circle-dot" | "circle-open-dot" | "square" | "square-open" | "square-dot" | "square-open-dot" | "diamond" | "diamond-open" | "diamond-dot" | "diamond-open-dot" | "cross" | "cross-open" | "cross-dot" | "cross-open-dot" | "x" | "x-open" | "x-dot" | "x-open-dot" | "triangle-up" | "triangle-up-open" | "triangle-up-dot" | "triangle-up-open-dot" | "triangle-down" | "triangle-down-open" | "triangle-down-dot" | "triangle-down-open-dot" | "triangle-left" | "triangle-left-open" | "triangle-left-dot" | "triangle-left-open-dot" | "triangle-right" | "triangle-right-open" | "triangle-right-dot" | "triangle-right-open-dot" | "triangle-ne" | "triangle-ne-open" | "triangle-ne-dot" | "triangle-ne-open-dot" | "triangle-se" | "triangle-se-open" | "triangle-se-dot" | "triangle-se-open-dot" | "triangle-sw" | "triangle-sw-open" | "triangle-sw-dot" | "triangle-sw-open-dot" | "triangle-nw" | "triangle-nw-open" | "triangle-nw-dot" | "triangle-nw-open-dot" | "pentagon" | "pentagon-open" | "pentagon-dot" | "pentagon-open-dot" | "hexagon" | "hexagon-open" | "hexagon-dot" | "hexagon-open-dot" | "hexagon2" | "hexagon2-open" | "hexagon2-dot" | "hexagon2-open-dot" | "octagon" | "octagon-open" | "octagon-dot" | "octagon-open-dot" | "star" | "star-open" | "star-dot" | "star-open-dot" | "hexagram" | "hexagram-open" | "hexagram-dot" | "hexagram-open-dot" | "star-triangle-up" | "star-triangle-up-open" | "star-triangle-up-dot" | "star-triangle-up-open-dot" | "star-triangle-down" | "star-triangle-down-open" | "star-triangle-down-dot" | "star-triangle-down-open-dot" | "star-square" | "star-square-open" | "star-square-dot" | "star-square-open-dot" | "star-diamond" | "star-diamond-open" | "star-diamond-dot" | "star-diamond-open-dot" | "diamond-tall" | "diamond-tall-open" | "diamond-tall-dot" | "diamond-tall-open-dot" | "diamond-wide" | "diamond-wide-open" | "diamond-wide-dot" | "diamond-wide-open-dot" | "hourglass" | "hourglass-open" | "bowtie" | "bowtie-open" | "circle-cross" | "circle-cross-open" | "circle-x" | "circle-x-open" | "square-cross" | "square-cross-open" | "square-x" | "square-x-open" | "diamond-cross" | "diamond-cross-open" | "diamond-x" | "diamond-x-open" | "cross-thin" | "cross-thin-open" | "x-thin" | "x-thin-open" | "asterisk" | "asterisk-open" | "hash" | "hash-open" | "hash-dot" | "hash-open-dot" | "y-up" | "y-up-open" | "y-down" | "y-down-open" | "y-left" | "y-left-open" | "y-right" | "y-right-open" | "line-ew" | "line-ew-open" | "line-ns" | "line-ns-open" | "line-ne" | "line-ne-open" | "line-nw" | "line-nw-open" | "arrow" | "arrow-open" | "arrow-wide" | "arrow-wide-open";
|
|
1347
|
+
interface LineDataSeries {
|
|
1348
|
+
x: number[];
|
|
1349
|
+
y: number[];
|
|
1350
|
+
name: string;
|
|
1351
|
+
color: string;
|
|
1352
|
+
symbol?: MarkerSymbol;
|
|
1353
|
+
error_y?: {
|
|
1354
|
+
type: "data";
|
|
1355
|
+
array: number[];
|
|
1356
|
+
visible: boolean;
|
|
1357
|
+
};
|
|
1358
|
+
}
|
|
1359
|
+
type LineGraphVariant = "lines" | "lines+markers" | "lines+markers+error_bars";
|
|
1360
|
+
type LineGraphProps = {
|
|
1361
|
+
dataSeries: LineDataSeries[];
|
|
1362
|
+
width?: number;
|
|
1363
|
+
height?: number;
|
|
1364
|
+
xRange?: [number, number];
|
|
1365
|
+
yRange?: [number, number];
|
|
1366
|
+
variant?: LineGraphVariant;
|
|
1367
|
+
xTitle?: string;
|
|
1368
|
+
yTitle?: string;
|
|
1369
|
+
title?: string;
|
|
1370
|
+
};
|
|
1371
|
+
declare const LineGraph: React$1.FC<LineGraphProps>;
|
|
1372
|
+
|
|
1373
|
+
interface MainProps {
|
|
1374
|
+
userProfile: {
|
|
1375
|
+
name: string;
|
|
1376
|
+
avatar?: string;
|
|
1377
|
+
};
|
|
1378
|
+
hostname: string;
|
|
1379
|
+
organization: {
|
|
1380
|
+
name: string;
|
|
1381
|
+
subtext?: string;
|
|
1382
|
+
logo?: React$1.ReactNode;
|
|
1383
|
+
};
|
|
1384
|
+
}
|
|
1385
|
+
declare const Main: React$1.FC<MainProps>;
|
|
1386
|
+
|
|
1387
|
+
interface PieDataSeries {
|
|
1388
|
+
labels: string[];
|
|
1389
|
+
values: number[];
|
|
1390
|
+
name: string;
|
|
1391
|
+
colors?: string[];
|
|
1392
|
+
}
|
|
1393
|
+
type PieTextInfo = "none" | "label" | "percent" | "value" | "label+percent" | "label+value" | "value+percent" | "label+value+percent";
|
|
1394
|
+
type PieChartProps = {
|
|
1395
|
+
dataSeries: PieDataSeries;
|
|
1396
|
+
width?: number;
|
|
1397
|
+
height?: number;
|
|
1398
|
+
title?: string;
|
|
1399
|
+
textInfo?: PieTextInfo;
|
|
1400
|
+
hole?: number;
|
|
1401
|
+
rotation?: number;
|
|
1402
|
+
};
|
|
1403
|
+
declare const PieChart: React$1.FC<PieChartProps>;
|
|
1404
|
+
|
|
1405
|
+
/**
|
|
1406
|
+
* Plate format string constants for standard microplate configurations.
|
|
1407
|
+
*/
|
|
1408
|
+
declare const PLATE_FORMAT_96: "96";
|
|
1409
|
+
declare const PLATE_FORMAT_384: "384";
|
|
1410
|
+
declare const PLATE_FORMAT_1536: "1536";
|
|
1411
|
+
declare const PLATE_FORMAT_CUSTOM: "custom";
|
|
1412
|
+
/**
|
|
1413
|
+
* Plate format presets for standard microplate configurations.
|
|
1414
|
+
* - `"96"`: 8 rows × 12 columns (wells A1-H12)
|
|
1415
|
+
* - `"384"`: 16 rows × 24 columns (wells A1-P24)
|
|
1416
|
+
* - `"1536"`: 32 rows × 48 columns (wells A1-AF48)
|
|
1417
|
+
* - `"custom"`: User-defined dimensions via `rows` and `columns` props
|
|
1418
|
+
*/
|
|
1419
|
+
type PlateFormat = typeof PLATE_FORMAT_96 | typeof PLATE_FORMAT_384 | typeof PLATE_FORMAT_1536 | typeof PLATE_FORMAT_CUSTOM;
|
|
1420
|
+
/**
|
|
1421
|
+
* Visualization mode for the plate map.
|
|
1422
|
+
* - `"heatmap"`: Displays quantitative values as a continuous color gradient.
|
|
1423
|
+
* Use for OD readings, fluorescence intensity, or other numeric measurements.
|
|
1424
|
+
* - `"categorical"`: Displays well types with discrete colors.
|
|
1425
|
+
* Use for showing sample types, control positions, or experimental conditions.
|
|
1426
|
+
*/
|
|
1427
|
+
type VisualizationMode = "heatmap" | "categorical";
|
|
1428
|
+
/**
|
|
1429
|
+
* Color scale definition for the heatmap visualization mode.
|
|
1430
|
+
*
|
|
1431
|
+
* Can be:
|
|
1432
|
+
* - A named Plotly colorscale (e.g., "Viridis", "Blues", "Hot")
|
|
1433
|
+
* - An array of [position, color] tuples where position is 0-1
|
|
1434
|
+
*
|
|
1435
|
+
* @example
|
|
1436
|
+
* // Named colorscale
|
|
1437
|
+
* colorScale="Viridis"
|
|
1438
|
+
*
|
|
1439
|
+
* @example
|
|
1440
|
+
* // Custom gradient
|
|
1441
|
+
* colorScale={[
|
|
1442
|
+
* [0, "#313695"], // Dark blue at min
|
|
1443
|
+
* [0.5, "#ffffbf"], // Yellow at midpoint
|
|
1444
|
+
* [1, "#a50026"], // Dark red at max
|
|
1445
|
+
* ]}
|
|
1446
|
+
*/
|
|
1447
|
+
type ColorScale = string | Array<[number, string]>;
|
|
1448
|
+
/**
|
|
1449
|
+
* Position for the legend display.
|
|
1450
|
+
* - `"right"`: Legend appears to the right of the plate (default)
|
|
1451
|
+
* - `"bottom"`: Legend appears below the plate
|
|
1452
|
+
* - `"left"`: Legend appears to the left of the plate
|
|
1453
|
+
* - `"top"`: Legend appears above the plate
|
|
1454
|
+
*/
|
|
1455
|
+
type LegendPosition = "right" | "bottom" | "left" | "top";
|
|
1456
|
+
/**
|
|
1457
|
+
* Well data for individual wells.
|
|
1458
|
+
*
|
|
1459
|
+
* @example
|
|
1460
|
+
* // Well with a single numeric value
|
|
1461
|
+
* { wellId: "A1", values: { "Fluorescence": 1500 } }
|
|
1462
|
+
*
|
|
1463
|
+
* @example
|
|
1464
|
+
* // Well with multiple values (creates multiple layers)
|
|
1465
|
+
* { wellId: "A1", values: { "Raw": 1500, "Normalized": 0.85, "Status": "positive" } }
|
|
1466
|
+
*
|
|
1467
|
+
* @example
|
|
1468
|
+
* // Well with tooltip-only data
|
|
1469
|
+
* { wellId: "A1", values: { "Value": 500 }, tooltipData: { compound: "Drug A", concentration: "10µM" } }
|
|
1470
|
+
*/
|
|
1471
|
+
interface WellData {
|
|
1472
|
+
/**
|
|
1473
|
+
* Well identifier in standard microplate notation.
|
|
1474
|
+
* - Single letter + number for 96/384-well: "A1", "H12", "P24"
|
|
1475
|
+
* - Double letter + number for 1536-well: "A1", "AA1", "AF48"
|
|
1476
|
+
* Case-insensitive ("a1" and "A1" are equivalent).
|
|
1477
|
+
*/
|
|
1478
|
+
wellId: string;
|
|
1479
|
+
/**
|
|
1480
|
+
* Named values for the well. Each key can become a visualization layer.
|
|
1481
|
+
*
|
|
1482
|
+
* - Numeric values: Displayed using heatmap visualization
|
|
1483
|
+
* - String values: Displayed using categorical visualization
|
|
1484
|
+
* - null: Empty/no data for that property
|
|
1485
|
+
*
|
|
1486
|
+
* All values are shown in the tooltip regardless of which layer is active.
|
|
1487
|
+
*
|
|
1488
|
+
* @example
|
|
1489
|
+
* // Well with multiple measurement values (numeric)
|
|
1490
|
+
* { wellId: "A1", values: { "Raw": 1500, "Normalized": 0.85, "Z-Score": 1.2 } }
|
|
1491
|
+
*
|
|
1492
|
+
* @example
|
|
1493
|
+
* // Well with categorical values (string)
|
|
1494
|
+
* { wellId: "A1", values: { "Status": "positive", "QC": "pass" } }
|
|
1495
|
+
*
|
|
1496
|
+
* @example
|
|
1497
|
+
* // Mixed numeric and categorical
|
|
1498
|
+
* { wellId: "A1", values: { "Fluorescence": 1500, "Status": "positive" } }
|
|
1499
|
+
*/
|
|
1500
|
+
values?: Record<string, string | number | null>;
|
|
1501
|
+
/**
|
|
1502
|
+
* Optional data for tooltip display only (not visualized as layers).
|
|
1503
|
+
* Keys become labels, values are displayed.
|
|
1504
|
+
*
|
|
1505
|
+
* @example
|
|
1506
|
+
* { tooltipData: { sampleId: "S001", compound: "Drug A", concentration: "10µM" } }
|
|
1507
|
+
*/
|
|
1508
|
+
tooltipData?: Record<string, unknown>;
|
|
1509
|
+
}
|
|
1510
|
+
/**
|
|
1511
|
+
* Configuration for auto-generated layers when using WellData with `values`.
|
|
1512
|
+
*
|
|
1513
|
+
* When wells have multiple values (via the `values` property), layers are
|
|
1514
|
+
* auto-generated from the unique keys. Use LayerConfig to customize the
|
|
1515
|
+
* display name, visualization mode, and color scale for each layer.
|
|
1516
|
+
*
|
|
1517
|
+
* @example
|
|
1518
|
+
* // Configure layers for wells with { values: { "Raw": 100, "Normalized": 0.5 } }
|
|
1519
|
+
* const layerConfigs: LayerConfig[] = [
|
|
1520
|
+
* { id: "Raw", name: "Raw Data", colorScale: "Blues" },
|
|
1521
|
+
* { id: "Normalized", name: "Normalized Values", valueMin: 0, valueMax: 1 },
|
|
1522
|
+
* ];
|
|
1523
|
+
*/
|
|
1524
|
+
interface LayerConfig {
|
|
1525
|
+
/** Layer ID (must match a key in WellData.values) */
|
|
1526
|
+
id: string;
|
|
1527
|
+
/** Display name for the layer (defaults to id if not provided) */
|
|
1528
|
+
name?: string;
|
|
1529
|
+
/** Visualization mode for this layer */
|
|
1530
|
+
visualizationMode?: VisualizationMode;
|
|
1531
|
+
/** Color scale for this layer (for heatmap mode) */
|
|
1532
|
+
colorScale?: ColorScale;
|
|
1533
|
+
/** Minimum value for color scaling */
|
|
1534
|
+
valueMin?: number;
|
|
1535
|
+
/** Maximum value for color scaling */
|
|
1536
|
+
valueMax?: number;
|
|
1537
|
+
/** Value unit suffix for tooltips and colorbar (e.g., "RFU", "%"). A space is automatically added before the unit. */
|
|
1538
|
+
valueUnit?: string;
|
|
1539
|
+
/**
|
|
1540
|
+
* Custom colors for categorical visualization mode.
|
|
1541
|
+
* Keys are category values (strings from `values`), values are hex colors.
|
|
1542
|
+
* Merged with DEFAULT_CATEGORY_COLORS.
|
|
1543
|
+
*/
|
|
1544
|
+
categoryColors?: Record<string, string>;
|
|
1545
|
+
}
|
|
1546
|
+
/**
|
|
1547
|
+
* Configuration for legend styling and positioning.
|
|
1548
|
+
*
|
|
1549
|
+
* @example
|
|
1550
|
+
* // Legend on the bottom with custom styling
|
|
1551
|
+
* legendConfig={{
|
|
1552
|
+
* position: "bottom",
|
|
1553
|
+
* fontSize: 14,
|
|
1554
|
+
* itemSpacing: 12,
|
|
1555
|
+
* swatchSize: 20,
|
|
1556
|
+
* }}
|
|
1557
|
+
*/
|
|
1558
|
+
interface LegendConfig {
|
|
1559
|
+
/**
|
|
1560
|
+
* Position of the legend relative to the plate.
|
|
1561
|
+
* @default "right"
|
|
1562
|
+
*/
|
|
1563
|
+
position?: LegendPosition;
|
|
1564
|
+
/**
|
|
1565
|
+
* Font size for legend labels in pixels.
|
|
1566
|
+
* @default 12
|
|
1567
|
+
*/
|
|
1568
|
+
fontSize?: number;
|
|
1569
|
+
/**
|
|
1570
|
+
* Spacing between legend items in pixels.
|
|
1571
|
+
* @default 4
|
|
1572
|
+
*/
|
|
1573
|
+
itemSpacing?: number;
|
|
1574
|
+
/**
|
|
1575
|
+
* Size of the color swatch in pixels.
|
|
1576
|
+
* @default 16
|
|
1577
|
+
*/
|
|
1578
|
+
swatchSize?: number;
|
|
1579
|
+
/**
|
|
1580
|
+
* Title to display above the legend.
|
|
1581
|
+
*/
|
|
1582
|
+
title?: string;
|
|
1583
|
+
}
|
|
1584
|
+
/**
|
|
1585
|
+
* A region to highlight on the plate (e.g., controls, sample areas, empty wells)
|
|
1586
|
+
*/
|
|
1587
|
+
interface PlateRegion {
|
|
1588
|
+
/** Unique identifier for the region */
|
|
1589
|
+
id: string;
|
|
1590
|
+
/** Display name for the region (shown in legend) */
|
|
1591
|
+
name: string;
|
|
1592
|
+
/**
|
|
1593
|
+
* Wells included in this region using range notation.
|
|
1594
|
+
* Format: "StartWell:EndWell" (e.g., "A1:B6" for a rectangular block from A1 to B6)
|
|
1595
|
+
*/
|
|
1596
|
+
wells: string;
|
|
1597
|
+
/** Border color for the region highlight */
|
|
1598
|
+
borderColor?: string;
|
|
1599
|
+
/** Border width in pixels (default: 2) */
|
|
1600
|
+
borderWidth?: number;
|
|
1601
|
+
/** Optional fill color with transparency (e.g., "rgba(255, 0, 0, 0.1)") */
|
|
1602
|
+
fillColor?: string;
|
|
1603
|
+
}
|
|
1604
|
+
/**
|
|
1605
|
+
* Props for PlateMap component
|
|
1606
|
+
*/
|
|
1607
|
+
interface PlateMapProps {
|
|
1608
|
+
/**
|
|
1609
|
+
* Well data array as WellData objects with wellId and values.
|
|
1610
|
+
*
|
|
1611
|
+
* If wells have multiple values (via `values` property), layers are
|
|
1612
|
+
* auto-generated for each unique key, enabling layer toggling.
|
|
1613
|
+
*/
|
|
1614
|
+
data?: WellData[];
|
|
1615
|
+
/**
|
|
1616
|
+
* Configuration for auto-generated layers when using WellData with `values`.
|
|
1617
|
+
* Use this to customize display names, colors, and ranges for each layer.
|
|
1618
|
+
* Only used when `data` contains wells with `values` property.
|
|
1619
|
+
*/
|
|
1620
|
+
layerConfigs?: LayerConfig[];
|
|
1621
|
+
/**
|
|
1622
|
+
* Initial layer ID to display when the component mounts.
|
|
1623
|
+
* If not provided, defaults to the first layer.
|
|
1624
|
+
*/
|
|
1625
|
+
initialLayerId?: string;
|
|
1626
|
+
/**
|
|
1627
|
+
* Optional callback notified when the active layer changes.
|
|
1628
|
+
* This is purely informational - the component manages layer state internally.
|
|
1629
|
+
* Use this for logging, analytics, or syncing with external state.
|
|
1630
|
+
*/
|
|
1631
|
+
onLayerChange?: (layerId: string) => void;
|
|
1632
|
+
/** Plate format preset (default: "96") */
|
|
1633
|
+
plateFormat?: PlateFormat;
|
|
1634
|
+
/** Number of rows for custom format (default: 8 for 96-well, 16 for 384-well) */
|
|
1635
|
+
rows?: number;
|
|
1636
|
+
/** Number of columns for custom format (default: 12 for 96-well, 24 for 384-well) */
|
|
1637
|
+
columns?: number;
|
|
1638
|
+
/**
|
|
1639
|
+
* Visualization mode (default: "heatmap")
|
|
1640
|
+
* - "heatmap": Display quantitative values with color gradient
|
|
1641
|
+
* - "categorical": Display well types with discrete colors
|
|
1642
|
+
*/
|
|
1643
|
+
visualizationMode?: VisualizationMode;
|
|
1644
|
+
/**
|
|
1645
|
+
* Custom colors for categorical visualization mode.
|
|
1646
|
+
* Keys are well types, values are hex colors.
|
|
1647
|
+
* Merged with DEFAULT_CATEGORY_COLORS.
|
|
1648
|
+
*/
|
|
1649
|
+
categoryColors?: Record<string, string>;
|
|
1650
|
+
/**
|
|
1651
|
+
* Regions to highlight on the plate (e.g., controls, sample areas, empty wells).
|
|
1652
|
+
* Each region can specify wells and styling for visual distinction.
|
|
1653
|
+
*/
|
|
1654
|
+
regions?: PlateRegion[];
|
|
1655
|
+
/** Chart title */
|
|
1656
|
+
title?: string;
|
|
1657
|
+
/** X-axis title (e.g., "Columns") */
|
|
1658
|
+
xTitle?: string;
|
|
1659
|
+
/** Y-axis title (e.g., "Rows") */
|
|
1660
|
+
yTitle?: string;
|
|
1661
|
+
/** Custom x-axis labels (overrides auto-generated column numbers) */
|
|
1662
|
+
xLabels?: string[] | number[];
|
|
1663
|
+
/** Custom y-axis labels (overrides auto-generated row letters) */
|
|
1664
|
+
yLabels?: string[] | number[];
|
|
1665
|
+
/** Color scale for the heatmap (only used in heatmap mode) */
|
|
1666
|
+
colorScale?: ColorScale;
|
|
1667
|
+
/** Minimum value for color scale (auto-calculated if not provided) */
|
|
1668
|
+
valueMin?: number;
|
|
1669
|
+
/** Maximum value for color scale (auto-calculated if not provided) */
|
|
1670
|
+
valueMax?: number;
|
|
1671
|
+
/** Color for empty/null wells (default: "#f0f0f0") */
|
|
1672
|
+
emptyWellColor?: string;
|
|
1673
|
+
/** Show color bar legend for heatmap mode (default: true) */
|
|
1674
|
+
showColorBar?: boolean;
|
|
1675
|
+
/** Show categorical legend for categorical mode (default: true) */
|
|
1676
|
+
showLegend?: boolean;
|
|
1677
|
+
/**
|
|
1678
|
+
* Configuration for legend positioning and styling.
|
|
1679
|
+
* Applies to both heatmap colorbar and categorical legend.
|
|
1680
|
+
*
|
|
1681
|
+
* @example
|
|
1682
|
+
* // Position legend at bottom with larger text
|
|
1683
|
+
* legendConfig={{ position: "bottom", fontSize: 14 }}
|
|
1684
|
+
*/
|
|
1685
|
+
legendConfig?: LegendConfig;
|
|
1686
|
+
/** Chart width in pixels (default: 800) */
|
|
1687
|
+
width?: number;
|
|
1688
|
+
/** Chart height in pixels (default: 500) */
|
|
1689
|
+
height?: number;
|
|
1690
|
+
/** Number of decimal places for values (default: 0) */
|
|
1691
|
+
precision?: number;
|
|
1692
|
+
/**
|
|
1693
|
+
* Marker shape for wells (default: "circle")
|
|
1694
|
+
* - "circle": Round markers, ideal for plate-based data
|
|
1695
|
+
* - "square": Square markers, ideal for generic heatmaps
|
|
1696
|
+
*/
|
|
1697
|
+
markerShape?: "circle" | "square";
|
|
1698
|
+
/**
|
|
1699
|
+
* Callback when a well/cell is clicked.
|
|
1700
|
+
* @param wellData - The full well data object including wellId, values, and tooltipData
|
|
1701
|
+
*/
|
|
1702
|
+
onWellClick?: (wellData: WellData) => void;
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
/**
|
|
1706
|
+
* PlateMap component for visualizing well plate data as a heatmap or categorical display.
|
|
1707
|
+
*
|
|
1708
|
+
* **Supported Plate Formats:**
|
|
1709
|
+
* - 96-well (8 rows × 12 columns, wells A1-H12)
|
|
1710
|
+
* - 384-well (16 rows × 24 columns, wells A1-P24)
|
|
1711
|
+
* - 1536-well (32 rows × 48 columns, wells A1-AF48)
|
|
1712
|
+
* - Custom dimensions with user-specified rows/columns
|
|
1713
|
+
*
|
|
1714
|
+
* **Visualization Modes:**
|
|
1715
|
+
* - `"heatmap"`: Continuous color gradient for quantitative values
|
|
1716
|
+
* - `"categorical"`: Discrete colors for well types (sample, control, empty)
|
|
1717
|
+
*
|
|
1718
|
+
* **Features:**
|
|
1719
|
+
* - Multiple data layers with independent visualization settings
|
|
1720
|
+
* - Control region highlighting with borders and fill colors
|
|
1721
|
+
* - Configurable color scales, tooltips, and click interactions
|
|
1722
|
+
* - Support for WellData arrays with multi-layer visualization
|
|
1723
|
+
*
|
|
1724
|
+
* **Data Format:**
|
|
1725
|
+
* - **WellData array**: `[{ wellId: "A1", values: { RFU: 100 }, tooltipData: {...} }, ...]`
|
|
1726
|
+
*
|
|
1727
|
+
*/
|
|
1728
|
+
declare const PlateMap: React$1.FC<PlateMapProps>;
|
|
1729
|
+
|
|
1730
|
+
interface ScatterDataPoint {
|
|
1731
|
+
x: number;
|
|
1732
|
+
y: number;
|
|
1733
|
+
additionalInfo?: Record<string, string | number>;
|
|
1734
|
+
}
|
|
1735
|
+
interface ScatterDataSeries {
|
|
1736
|
+
x: number[];
|
|
1737
|
+
y: number[];
|
|
1738
|
+
name: string;
|
|
1739
|
+
color: string;
|
|
1740
|
+
}
|
|
1741
|
+
interface ScatterGraphProps {
|
|
1742
|
+
dataSeries: ScatterDataSeries[];
|
|
1743
|
+
width?: number;
|
|
1744
|
+
height?: number;
|
|
1745
|
+
xRange?: [number, number];
|
|
1746
|
+
yRange?: [number, number];
|
|
1747
|
+
xTitle?: string;
|
|
1748
|
+
yTitle?: string;
|
|
1749
|
+
title?: string;
|
|
1750
|
+
}
|
|
1751
|
+
declare const ScatterGraph: React$1.FC<ScatterGraphProps>;
|
|
1752
|
+
|
|
1753
|
+
/** Transformed search result (flattened from Elasticsearch hit format) */
|
|
1754
|
+
interface SearchResult {
|
|
1755
|
+
id: string;
|
|
1756
|
+
_score?: number | null;
|
|
1757
|
+
[key: string]: any;
|
|
1758
|
+
}
|
|
1759
|
+
/** Configuration for a search filter */
|
|
1760
|
+
interface TdpSearchFilter {
|
|
1761
|
+
key: string;
|
|
1762
|
+
label: string;
|
|
1763
|
+
options: DropdownOption[];
|
|
1764
|
+
}
|
|
1765
|
+
/** Configuration for column display */
|
|
1766
|
+
interface TdpSearchColumn {
|
|
1767
|
+
key: string;
|
|
1768
|
+
header: string;
|
|
1769
|
+
sortable?: boolean;
|
|
1770
|
+
width?: string;
|
|
1771
|
+
align?: "left" | "center" | "right";
|
|
1772
|
+
render?: (value: any, row: SearchResult, index: number) => React$1.ReactNode;
|
|
1773
|
+
}
|
|
1774
|
+
/** Sort configuration */
|
|
1775
|
+
interface TdpSearchSort {
|
|
1776
|
+
field: string;
|
|
1777
|
+
order: "asc" | "desc";
|
|
1778
|
+
}
|
|
1779
|
+
/** Props passed to the renderSearchBar render prop */
|
|
1780
|
+
interface TdpSearchBarRenderProps {
|
|
1781
|
+
query: string;
|
|
1782
|
+
setQuery: (query: string) => void;
|
|
1783
|
+
onSearch: () => void;
|
|
1784
|
+
isLoading: boolean;
|
|
1785
|
+
placeholder: string;
|
|
1786
|
+
}
|
|
1787
|
+
/** Props passed to the renderFilters render prop */
|
|
1788
|
+
interface TdpFiltersRenderProps {
|
|
1789
|
+
filters: TdpSearchFilter[];
|
|
1790
|
+
filterValues: Record<string, string>;
|
|
1791
|
+
onFilterChange: (key: string, value: string) => void;
|
|
1792
|
+
}
|
|
1793
|
+
/** Props passed to the renderResults render prop */
|
|
1794
|
+
interface TdpResultsRenderProps {
|
|
1795
|
+
results: SearchResult[];
|
|
1796
|
+
total: number;
|
|
1797
|
+
currentPage: number;
|
|
1798
|
+
pageSize: number;
|
|
1799
|
+
columns: TdpSearchColumn[];
|
|
1800
|
+
onPageChange: (page: number) => void;
|
|
1801
|
+
sortKey: string | null;
|
|
1802
|
+
sortDirection: "asc" | "desc";
|
|
1803
|
+
onSort: (key: string, direction: "asc" | "desc") => void;
|
|
1804
|
+
}
|
|
1805
|
+
/** Search connection configuration */
|
|
1806
|
+
interface TdpSearchConfig {
|
|
1807
|
+
/**
|
|
1808
|
+
* When true, calls the TDP API directly from the browser
|
|
1809
|
+
* When false/omitted, proxies the request through your backend `apiEndpoint`
|
|
1810
|
+
*/
|
|
1811
|
+
standalone?: boolean;
|
|
1812
|
+
/** TDP API base URL (required when standalone is true) */
|
|
1813
|
+
baseUrl?: string;
|
|
1814
|
+
/** Backend API endpoint for search (used when standalone is false). Defaults to '/api/search' */
|
|
1815
|
+
apiEndpoint?: string;
|
|
1816
|
+
/** Common | authentication token */
|
|
1817
|
+
authToken?: string;
|
|
1818
|
+
/** Common | organization slug */
|
|
1819
|
+
orgSlug?: string;
|
|
1820
|
+
}
|
|
1821
|
+
/** Common props shared by both search modes */
|
|
1822
|
+
interface CommonTdpSearchProps {
|
|
1823
|
+
/** Default search term (default query) */
|
|
1824
|
+
defaultQuery?: string;
|
|
1825
|
+
/** Display fields/columns for the results table */
|
|
1826
|
+
columns: TdpSearchColumn[];
|
|
1827
|
+
/** UI filters displayed as dropdowns (for user selection) */
|
|
1828
|
+
filters?: TdpSearchFilter[];
|
|
1829
|
+
/** Default sort configuration (sort options) */
|
|
1830
|
+
defaultSort?: TdpSearchSort;
|
|
1831
|
+
/**
|
|
1832
|
+
* Additional search parameters to pass to the SDK's searchEql method.
|
|
1833
|
+
* Allows customization of expression, selectedPipelineIds, selectedSourceTypes, etc.
|
|
1834
|
+
*/
|
|
1835
|
+
advancedSearchParams?: Partial<Omit<SearchEqlRequest, "searchTerm" | "from" | "size" | "sort" | "order">>;
|
|
1836
|
+
/** Results per page. Defaults to 10 */
|
|
1837
|
+
pageSize?: number;
|
|
1838
|
+
/** Search input placeholder text */
|
|
1839
|
+
searchPlaceholder?: string;
|
|
1840
|
+
/** Custom CSS class */
|
|
1841
|
+
className?: string;
|
|
1842
|
+
/** Callback fired when search is executed with the query and results */
|
|
1843
|
+
onSearch?: (query: SearchEqlRequest, results: SearchResult[]) => void;
|
|
1844
|
+
/** Replace the entire search bar (input + button) */
|
|
1845
|
+
renderSearchBar?: (props: TdpSearchBarRenderProps) => React$1.ReactNode;
|
|
1846
|
+
/** Replace the filters row */
|
|
1847
|
+
renderFilters?: (props: TdpFiltersRenderProps) => React$1.ReactNode;
|
|
1848
|
+
/** Replace the results table (and pagination) */
|
|
1849
|
+
renderResults?: (props: TdpResultsRenderProps) => React$1.ReactNode;
|
|
1850
|
+
}
|
|
1851
|
+
type TdpSearchProps = CommonTdpSearchProps & TdpSearchConfig;
|
|
1852
|
+
type UseSearchConfig = {
|
|
1853
|
+
pageSize: number;
|
|
1854
|
+
} & TdpSearchConfig;
|
|
1855
|
+
interface UseSearchResult {
|
|
1856
|
+
results: SearchResult[];
|
|
1857
|
+
total: number;
|
|
1858
|
+
currentPage: number;
|
|
1859
|
+
isLoading: boolean;
|
|
1860
|
+
error: string | null;
|
|
1861
|
+
executeSearch: (searchRequest: Omit<SearchEqlRequest, "from" | "size">, page?: number) => Promise<SearchResult[]>;
|
|
1862
|
+
}
|
|
1863
|
+
|
|
1864
|
+
/**
|
|
1865
|
+
* TdpSearch Component
|
|
1866
|
+
*
|
|
1867
|
+
* A reusable search component for querying the TDP.
|
|
1868
|
+
*
|
|
1869
|
+
* @example
|
|
1870
|
+
* ```tsx
|
|
1871
|
+
* <TdpSearch
|
|
1872
|
+
* columns={[
|
|
1873
|
+
* { key: "id", header: "ID" },
|
|
1874
|
+
* { key: "filePath", header: "File Path", sortable: true }
|
|
1875
|
+
* ]}
|
|
1876
|
+
* defaultQuery="sample-data"
|
|
1877
|
+
* pageSize={20}
|
|
1878
|
+
* />
|
|
1879
|
+
* ```
|
|
1880
|
+
*/
|
|
1881
|
+
declare const TdpSearch: React$1.FC<TdpSearchProps>;
|
|
1882
|
+
|
|
1883
|
+
declare function useSearch(config: UseSearchConfig): UseSearchResult;
|
|
107
1884
|
|
|
108
1885
|
/**
|
|
109
1886
|
* Centralized color system for TetraScience UI
|
|
@@ -217,14 +1994,14 @@ declare const defaultTheme: Theme;
|
|
|
217
1994
|
|
|
218
1995
|
interface ThemeProviderProps {
|
|
219
1996
|
theme?: Theme;
|
|
220
|
-
children: React.ReactNode;
|
|
1997
|
+
children: React$1.ReactNode;
|
|
221
1998
|
}
|
|
222
1999
|
/**
|
|
223
2000
|
* ThemeProvider component that sets CSS custom properties for theming
|
|
224
2001
|
*
|
|
225
2002
|
* This provider merges the provided theme with the default theme and
|
|
226
|
-
* sets CSS variables on
|
|
227
|
-
* styled-components and SCSS styles.
|
|
2003
|
+
* sets CSS variables on a wrapper element, making them available to both
|
|
2004
|
+
* styled-components and SCSS styles within the provider's scope.
|
|
228
2005
|
*
|
|
229
2006
|
* @example
|
|
230
2007
|
* ```tsx
|
|
@@ -244,7 +2021,7 @@ interface ThemeProviderProps {
|
|
|
244
2021
|
* </ThemeProvider>
|
|
245
2022
|
* ```
|
|
246
2023
|
*/
|
|
247
|
-
declare const ThemeProvider: React.FC<ThemeProviderProps>;
|
|
2024
|
+
declare const ThemeProvider: React$1.FC<ThemeProviderProps>;
|
|
248
2025
|
|
|
249
|
-
export { CHART_COLORS, COLORS, ThemeProvider, defaultTheme };
|
|
250
|
-
export type { ColorToken, Theme, ThemeColors, ThemeProviderProps, ThemeRadius, ThemeSpacing };
|
|
2026
|
+
export { AppHeader, AppLayout, AreaGraph, AssistantModal, Badge, BarGraph, Boxplot, Button, ButtonControl, ButtonControlGroup, CHART_COLORS, COLORS, Card, CardSidebar, Checkbox, Chromatogram, ChromatogramChart, CodeEditor, CodeScriptEditorButton, DEFAULT_CATEGORY_COLORS, DEFAULT_COLOR_SCALE, DEFAULT_MARKER_SIZE, DEFAULT_MAX_POINTS, DEFAULT_SIZE_RANGE, DotPlot, Dropdown, ErrorAlert, FormField, Heatmap, Histogram, Icon, IconName, Input, InteractiveScatter, Label, LaunchContent, LineGraph, Main, MarkdownDisplay, Menu, MenuItem, Modal, Navbar, PLOT_CONSTANTS, PieChart, PlateMap, PopConfirm, ProtocolConfiguration, ProtocolYamlCard, PythonEditorModal, SELECTION_MODIFIERS, ScatterGraph, SelectField, Sidebar, SupportiveText, TDPLink, Tab, TabGroup, Table, TableCell, TableHeaderCell, TdpNavigationContext, TdpNavigationProvider, TdpSearch, Textarea, ThemeProvider, Toast, ToastManager, Toggle, Tooltip, buildTdpUrl, defaultTheme, getTdpBaseUrlFromReferrer, navigateToTdpUrl, tdpPaths, useSearch, useTdpNavigation, useTdpNavigationContext };
|
|
2027
|
+
export type { AppHeaderProps, AppLayoutProps, AreaDataSeries, AreaGraphProps, AreaGraphVariant, AssistantModalProps, AxisConfig, BadgeProps, BarDataSeries, BarGraphProps, BarGraphVariant, BaselineCorrectionMethod, BoundaryMarkerStyle, BoxDataSeries, BoxplotProps, ButtonControlGroupProps, ButtonControlProps, ButtonProps, CardProps, CardSidebarProps, CheckboxProps, ChromatogramChartProps, ChromatogramProps, ChromatogramSeries, CodeEditorProps, CodeScriptEditorButtonProps, ColorMapping, ColorScale, ColorToken, DotPlotDataSeries, DotPlotProps, DotPlotVariant, DownsamplingConfig, DropdownOption, DropdownProps, ErrorAlertProps, FormFieldProps, HeatmapProps, HistogramDataSeries, HistogramProps, IconProps, IconsProps, InputProps, InteractiveScatterProps, LabelProps, LaunchContentProps, LineDataSeries, LineGraphProps, LineGraphVariant, MainProps, MarkdownDisplayProps, MarkerShape, MarkerSymbol, MenuItemProps, MenuProps, ModalProps, NavbarProps, PeakAnnotation, PeakData, PeakDetectionOptions, PieChartProps, PieDataSeries, PieTextInfo, PlateFormat, PlateMapProps, PopConfirmProps, ProtocolConfigurationProps, ProtocolYamlCardProps, PythonEditorModalProps, ScaleType, ScatterDataPoint, ScatterDataSeries, ScatterGraphProps, ScatterPoint, SearchResult, SelectFieldProps, SelectionEvent, SelectionMode, SelectionState, ShapeMapping, SidebarProps, SizeMapping, SupportiveTextProps, TDPLinkProps, TabGroupProps, TabProps, TabSize, TableCellProps, TableColumn, TableHeaderCellProps, TableProps, TdpFiltersRenderProps, TdpNavigationContextValue, TdpNavigationOptions, TdpNavigationProviderProps, TdpResultsRenderProps, TdpSearchBarRenderProps, TdpSearchColumn, TdpSearchConfig, TdpSearchFilter, TdpSearchProps, TdpSearchSort, TextareaProps, Theme, ThemeColors, ThemeProviderProps, ThemeRadius, ThemeSpacing, ToastContainerProps, ToastManagerProps, ToastProps, ToastType, ToggleProps, TooltipConfig, TooltipProps, UseSearchConfig, UseSearchResult, UseTdpNavigationOptions, UseTdpNavigationReturn, WellData };
|