@reshape-biotech/design-system 1.2.5 → 1.2.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/README.md +3 -1
- package/dist/app.css +97 -97
- package/dist/components/activity/Activity.stories.svelte +104 -104
- package/dist/components/activity/Activity.svelte +112 -112
- package/dist/components/avatar/Avatar.stories.svelte +23 -23
- package/dist/components/avatar/Avatar.svelte +54 -54
- package/dist/components/banner/Banner.stories.svelte +105 -105
- package/dist/components/banner/Banner.svelte +42 -42
- package/dist/components/button/Button.stories.svelte +61 -61
- package/dist/components/button/Button.svelte +95 -95
- package/dist/components/card/Card.stories.svelte +112 -112
- package/dist/components/card/Card.svelte +18 -18
- package/dist/components/checkbox/Checkbox.stories.svelte +8 -8
- package/dist/components/checkbox/Checkbox.svelte +17 -17
- package/dist/components/collapsible/Collapsible.stories.svelte +26 -26
- package/dist/components/collapsible/components/collapsible-content.svelte +20 -20
- package/dist/components/collapsible/components/collapsible-trigger.svelte +12 -12
- package/dist/components/combobox/Combobox.stories.svelte +412 -412
- package/dist/components/combobox/components/combobox-add.svelte +8 -8
- package/dist/components/combobox/components/combobox-content.svelte +39 -39
- package/dist/components/combobox/components/combobox-indicator.svelte +1 -1
- package/dist/components/datepicker/DatePicker.stories.svelte +196 -196
- package/dist/components/datepicker/DatePicker.svelte +173 -173
- package/dist/components/divider/Divider.stories.svelte +7 -7
- package/dist/components/divider/Divider.svelte +9 -9
- package/dist/components/drawer/Drawer.stories.svelte +51 -51
- package/dist/components/drawer/Drawer.svelte +33 -33
- package/dist/components/drawer/DrawerLabel.svelte +10 -10
- package/dist/components/dropdown/Dropdown.stories.svelte +210 -210
- package/dist/components/dropdown/Dropdown.svelte +57 -57
- package/dist/components/dropdown/components/DropdownContent.svelte +16 -16
- package/dist/components/dropdown/components/DropdownMenu.svelte +10 -10
- package/dist/components/dropdown/components/DropdownTrigger.svelte +37 -37
- package/dist/components/dropdown/components/OutlinedButton.svelte +9 -9
- package/dist/components/empty-content/EmptyContent.stories.svelte +38 -38
- package/dist/components/empty-content/EmptyContent.svelte +12 -12
- package/dist/components/graphs/bar-chart/BarChart.stories.svelte +91 -91
- package/dist/components/graphs/bar-chart/BarChart.svelte +147 -147
- package/dist/components/graphs/bar-chart/StackedBarChart.stories.svelte +57 -57
- package/dist/components/graphs/bar-chart/StackedBarChart.svelte +198 -199
- package/dist/components/graphs/chart/Chart.stories.svelte +96 -96
- package/dist/components/graphs/chart/Chart.svelte +207 -207
- package/dist/components/graphs/line/LineChart.stories.svelte +138 -138
- package/dist/components/graphs/line/LineChart.svelte +140 -142
- package/dist/components/graphs/matrix/Matrix.stories.svelte +117 -117
- package/dist/components/graphs/matrix/Matrix.svelte +141 -141
- package/dist/components/graphs/multiline/MultiLineChart.stories.svelte +168 -168
- package/dist/components/graphs/multiline/MultiLineChart.svelte +236 -236
- package/dist/components/graphs/scatterplot/Scatterplot.stories.svelte +84 -84
- package/dist/components/graphs/scatterplot/Scatterplot.svelte +302 -302
- package/dist/components/graphs/utils/duration.d.ts +1 -0
- package/dist/components/graphs/utils/duration.js +33 -0
- package/dist/components/graphs/utils/tooltipFormatter.js +1 -1
- package/dist/components/icon-button/IconButton.stories.svelte +64 -64
- package/dist/components/icon-button/IconButton.svelte +88 -88
- package/dist/components/icons/AnalysisIcon.stories.svelte +18 -18
- package/dist/components/icons/AnalysisIcon.svelte +96 -96
- package/dist/components/icons/Icon.stories.svelte +111 -111
- package/dist/components/icons/Icon.svelte +17 -17
- package/dist/components/icons/PrincipalIcon.svelte +59 -59
- package/dist/components/icons/custom/Halo.svelte +31 -31
- package/dist/components/icons/custom/Well.svelte +27 -27
- package/dist/components/icons/index.d.ts +3 -2
- package/dist/components/icons/index.js +3 -1
- package/dist/components/image/Image.svelte +42 -42
- package/dist/components/input/Input.stories.svelte +55 -55
- package/dist/components/input/Input.svelte +121 -121
- package/dist/components/label/Label.stories.svelte +18 -18
- package/dist/components/label/Label.svelte +11 -11
- package/dist/components/list/List.stories.svelte +84 -84
- package/dist/components/list/List.svelte +20 -20
- package/dist/components/logo/Logo.stories.svelte +15 -15
- package/dist/components/logo/Logo.svelte +30 -30
- package/dist/components/manual-cfu-counter/ManualCFUCounter.stories.svelte +102 -102
- package/dist/components/manual-cfu-counter/ManualCFUCounter.svelte +557 -565
- package/dist/components/manual-cfu-counter/test/ManualCFUCounterTestWrapper.svelte +11 -11
- package/dist/components/markdown/Markdown.stories.svelte +10 -10
- package/dist/components/markdown/Markdown.svelte +6 -6
- package/dist/components/modal/Modal.stories.svelte +29 -29
- package/dist/components/modal/Modal.svelte +71 -71
- package/dist/components/multi-cfu-counter/MultiCFUCounter.stories.svelte +215 -0
- package/dist/components/multi-cfu-counter/MultiCFUCounter.stories.svelte.d.ts +3 -0
- package/dist/components/multi-cfu-counter/MultiCFUCounter.svelte +662 -0
- package/dist/components/multi-cfu-counter/MultiCFUCounter.svelte.d.ts +32 -0
- package/dist/components/multi-cfu-counter/index.d.ts +1 -0
- package/dist/components/multi-cfu-counter/index.js +1 -0
- package/dist/components/multi-cfu-counter/test/MultiCFUCounterTestWrapper.svelte +28 -0
- package/dist/components/multi-cfu-counter/test/MultiCFUCounterTestWrapper.svelte.d.ts +20 -0
- package/dist/components/notification-popup/NotificationPopup.stories.svelte +18 -18
- package/dist/components/notification-popup/NotificationPopup.svelte +26 -26
- package/dist/components/notifications/Notifications.stories.svelte +101 -101
- package/dist/components/notifications/Notifications.svelte +9 -9
- package/dist/components/pill/Pill.stories.svelte +8 -8
- package/dist/components/pill/Pill.svelte +27 -27
- package/dist/components/progress-circle/ProgressCircle.stories.svelte +8 -8
- package/dist/components/progress-circle/ProgressCircle.svelte +54 -54
- package/dist/components/required-status-indicator/RequiredStatusIndicator.stories.svelte +18 -18
- package/dist/components/required-status-indicator/RequiredStatusIndicator.svelte +14 -14
- package/dist/components/segmented-control-buttons/ControlButton.svelte +36 -36
- package/dist/components/segmented-control-buttons/SegmentedControlButtons.stories.svelte +35 -35
- package/dist/components/segmented-control-buttons/SegmentedControlButtons.svelte +13 -13
- package/dist/components/select/Select.stories.svelte +77 -77
- package/dist/components/select/Select.svelte +114 -114
- package/dist/components/select-new/Select.stories.svelte +188 -188
- package/dist/components/select-new/components/Group.svelte +17 -17
- package/dist/components/select-new/components/MultiSelectTrigger.svelte +57 -57
- package/dist/components/select-new/components/SelectContent.svelte +22 -22
- package/dist/components/select-new/components/SelectGroupHeading.svelte +10 -10
- package/dist/components/select-new/components/SelectItem.svelte +25 -25
- package/dist/components/select-new/components/SelectTrigger.svelte +38 -38
- package/dist/components/sjsf-wrappers/SjsfNumberInputWrapper.svelte +76 -76
- package/dist/components/sjsf-wrappers/SjsfNumberInputWrapper.svelte.d.ts +1 -1
- package/dist/components/sjsf-wrappers/SjsfTextInputWrapper.svelte +53 -53
- package/dist/components/sjsf-wrappers/SjsfTextInputWrapper.svelte.d.ts +1 -1
- package/dist/components/sjsf-wrappers/sjsfCustomTheme.js +1 -1
- package/dist/components/skeleton-loader/SkeletonLoader.stories.svelte +32 -32
- package/dist/components/skeleton-loader/SkeletonLoader.svelte +10 -10
- package/dist/components/skeleton-loader/StatcardSkeleton.svelte +9 -9
- package/dist/components/skeleton-loader/components/Skeleton.svelte +7 -7
- package/dist/components/skeleton-loader/components/SkeletonImage.svelte +12 -12
- package/dist/components/slider/Slider.stories.svelte +23 -23
- package/dist/components/slider/Slider.svelte +107 -107
- package/dist/components/spinner/Spinner.stories.svelte +8 -8
- package/dist/components/spinner/Spinner.svelte +18 -18
- package/dist/components/stat-card/StatCard.stories.svelte +26 -26
- package/dist/components/stat-card/StatCard.svelte +128 -128
- package/dist/components/status-badge/StatusBadge.stories.svelte +365 -365
- package/dist/components/status-badge/StatusBadge.svelte +54 -54
- package/dist/components/stepper/Stepper.stories.svelte +219 -219
- package/dist/components/stepper/components/stepper-root.svelte +12 -12
- package/dist/components/stepper/components/stepper-step.svelte +83 -83
- package/dist/components/table/Table.stories.svelte +87 -87
- package/dist/components/table/Table.svelte +32 -32
- package/dist/components/table/components/TBody.svelte +7 -7
- package/dist/components/table/components/THead.svelte +7 -7
- package/dist/components/table/components/Td.svelte +8 -8
- package/dist/components/table/components/Th.svelte +8 -8
- package/dist/components/table/components/Tr.svelte +11 -11
- package/dist/components/tabs/Tabs.stories.svelte +20 -20
- package/dist/components/tabs/Tabs.svelte +8 -8
- package/dist/components/tabs/components/Content.svelte +8 -8
- package/dist/components/tabs/components/Tab.svelte +14 -14
- package/dist/components/tabs/components/Tabs.svelte +7 -7
- package/dist/components/tag/Tag.stories.svelte +57 -57
- package/dist/components/tag/Tag.svelte +95 -95
- package/dist/components/textarea/Textarea.stories.svelte +70 -70
- package/dist/components/textarea/Textarea.svelte +76 -76
- package/dist/components/toast/Toast.stories.svelte +204 -204
- package/dist/components/toast/Toast.svelte +53 -53
- package/dist/components/toggle/Toggle.stories.svelte +9 -9
- package/dist/components/toggle/Toggle.svelte +53 -53
- package/dist/components/toggle-icon-button/ToggleIconButton.stories.svelte +152 -152
- package/dist/components/toggle-icon-button/ToggleIconButton.svelte +99 -99
- package/dist/components/tooltip/Tooltip.stories.svelte +105 -105
- package/dist/components/tooltip/Tooltip.svelte +26 -26
- package/dist/fonts/index.js +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +5 -1
- package/dist/notifications.d.ts +1 -4
- package/dist/notifications.js +1 -1
- package/dist/styles.d.ts +1 -0
- package/dist/styles.js +4 -0
- package/dist/tailwind-safelist.js +406 -398
- package/dist/tailwind.preset.d.ts +4 -0
- package/dist/tailwind.preset.js +10 -10
- package/dist/tokens/colors.d.ts +246 -0
- package/dist/tokens/colors.js +139 -0
- package/dist/tokens/index.d.ts +3 -0
- package/dist/tokens/index.js +5 -0
- package/dist/tokens/typography.d.ts +48 -0
- package/dist/tokens/typography.js +48 -0
- package/dist/tokens.d.ts +16 -252
- package/dist/tokens.js +33 -164
- package/dist/types/fonts.d.ts +2 -2
- package/package.json +398 -78
|
@@ -1,335 +1,335 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import { backgroundColor } from '../../../tokens';
|
|
3
|
+
import Icon from '../../icons/Icon.svelte';
|
|
4
|
+
import Chart, { type GenericChartProps } from '../chart/Chart.svelte';
|
|
5
|
+
import type {
|
|
6
|
+
EChartsOption,
|
|
7
|
+
SeriesOption,
|
|
8
|
+
CustomSeriesRenderItemAPI,
|
|
9
|
+
CustomSeriesRenderItemParams,
|
|
10
|
+
} from 'echarts';
|
|
11
|
+
import Tooltip from '../../tooltip/Tooltip.svelte';
|
|
12
|
+
import type { Snippet } from 'svelte';
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
export type DataPoint = { value: [number, number]; metadata: any; error_value?: number };
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
export type ScatterPlotEchartsEvent = echarts.ECElementEvent & {
|
|
17
|
+
data: DataPoint;
|
|
18
|
+
};
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
type LegendItem = {
|
|
21
|
+
label: string;
|
|
22
|
+
color: string;
|
|
23
|
+
type: 'point' | 'line' | 'area';
|
|
24
|
+
};
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
type ScatterPlotProps = {
|
|
27
|
+
data: DataPoint[];
|
|
28
|
+
lineData?: [[number, number], [number, number]];
|
|
29
|
+
showConfidenceBand?: boolean;
|
|
30
|
+
showLegend?: boolean;
|
|
31
|
+
legendItems?: LegendItem[];
|
|
32
|
+
children?: Snippet;
|
|
33
|
+
} & Omit<GenericChartProps, 'timeIndex'>;
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
35
|
+
const {
|
|
36
|
+
data,
|
|
37
|
+
xAxisName,
|
|
38
|
+
yAxisName,
|
|
39
|
+
loading = false,
|
|
40
|
+
showConfidenceBand = false,
|
|
41
|
+
onitemclick,
|
|
42
|
+
onmouseover,
|
|
43
|
+
onmouseout,
|
|
44
|
+
showLegend = false,
|
|
45
|
+
legendItems = [
|
|
46
|
+
{ label: 'Count', color: backgroundColor['blue-inverse'], type: 'point' },
|
|
47
|
+
{ label: 'Perfect agreement', color: backgroundColor['lilac-inverse'], type: 'line' },
|
|
48
|
+
],
|
|
49
|
+
children,
|
|
50
|
+
...props
|
|
51
|
+
}: ScatterPlotProps = $props();
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
53
|
+
const displayedLegendItems: LegendItem[] = $derived([
|
|
54
|
+
...legendItems,
|
|
55
|
+
...(showConfidenceBand
|
|
56
|
+
? [
|
|
57
|
+
{
|
|
58
|
+
label: 'Error margin',
|
|
59
|
+
color: backgroundColor.lilac,
|
|
60
|
+
type: 'area' as const,
|
|
61
|
+
},
|
|
62
|
+
]
|
|
63
|
+
: []),
|
|
64
|
+
]);
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
let chartComponent: any;
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
function handleClick(params: ScatterPlotEchartsEvent) {
|
|
69
|
+
onitemclick?.(params);
|
|
70
|
+
}
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
function handleMouseOver(params: ScatterPlotEchartsEvent) {
|
|
73
|
+
onmouseover?.(params);
|
|
74
|
+
}
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
function handleMouseOut() {
|
|
77
|
+
onmouseout?.();
|
|
78
|
+
}
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
80
|
+
// from https://echarts.apache.org/examples/en/editor.html?c=custom-error-bar
|
|
81
|
+
function renderErrorBarItem(
|
|
82
|
+
params: CustomSeriesRenderItemParams,
|
|
83
|
+
api: CustomSeriesRenderItemAPI
|
|
84
|
+
) {
|
|
85
|
+
const xValue = api.value(0) as number;
|
|
86
|
+
const yValue = api.value(1) as number;
|
|
87
|
+
const error = api.value(2) as number;
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
const highPoint = api.coord([xValue, yValue + error]);
|
|
90
|
+
const lowPoint = api.coord([xValue, yValue - error]);
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
if (!highPoint || !lowPoint) {
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
96
|
+
// calculate a dynamic width for the caps based on the x-axis scale
|
|
97
|
+
const sizeValue = api.size?.([1, 0]);
|
|
98
|
+
const baseWidth = Array.isArray(sizeValue) ? sizeValue[0] : 10;
|
|
99
|
+
const halfWidth = Math.min((baseWidth ?? 10) * 1.5, 3);
|
|
100
|
+
const style = {
|
|
101
|
+
stroke: api.visual('color') as string,
|
|
102
|
+
fill: undefined,
|
|
103
|
+
};
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
105
|
+
return {
|
|
106
|
+
type: 'group' as const,
|
|
107
|
+
children: [
|
|
108
|
+
{
|
|
109
|
+
type: 'line' as const,
|
|
110
|
+
transition: 'shape' as const,
|
|
111
|
+
shape: {
|
|
112
|
+
x1: highPoint[0] - halfWidth,
|
|
113
|
+
y1: highPoint[1],
|
|
114
|
+
x2: highPoint[0] + halfWidth,
|
|
115
|
+
y2: highPoint[1],
|
|
116
|
+
},
|
|
117
|
+
style,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
type: 'line' as const,
|
|
121
|
+
transition: 'shape' as const,
|
|
122
|
+
shape: {
|
|
123
|
+
x1: highPoint[0],
|
|
124
|
+
y1: highPoint[1],
|
|
125
|
+
x2: lowPoint[0],
|
|
126
|
+
y2: lowPoint[1],
|
|
127
|
+
},
|
|
128
|
+
style,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
type: 'line' as const,
|
|
132
|
+
transition: 'shape' as const,
|
|
133
|
+
shape: {
|
|
134
|
+
x1: lowPoint[0] - halfWidth,
|
|
135
|
+
y1: lowPoint[1],
|
|
136
|
+
x2: lowPoint[0] + halfWidth,
|
|
137
|
+
y2: lowPoint[1],
|
|
138
|
+
},
|
|
139
|
+
style,
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
const options = $derived(getChartOptions());
|
|
146
146
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
147
|
+
function getChartOptions(): EChartsOption {
|
|
148
|
+
const series: SeriesOption[] = [];
|
|
149
|
+
const errorBarData = data
|
|
150
|
+
.filter((d) => d.error_value != 0)
|
|
151
|
+
.map((d) => [...d.value, d.error_value]);
|
|
152
152
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
153
|
+
if (props.lineData && props.lineData.length > 0) {
|
|
154
|
+
const extendedLineData = [
|
|
155
|
+
props.lineData[0],
|
|
156
|
+
[
|
|
157
|
+
props.lineData[props.lineData.length - 1][0] + 10,
|
|
158
|
+
props.lineData[props.lineData.length - 1][1] + 10,
|
|
159
|
+
],
|
|
160
|
+
];
|
|
161
|
+
series.push({
|
|
162
|
+
type: 'line',
|
|
163
|
+
data: extendedLineData,
|
|
164
|
+
lineStyle: {
|
|
165
|
+
type: 'dashed',
|
|
166
|
+
color: backgroundColor['lilac-inverse'],
|
|
167
|
+
},
|
|
168
|
+
symbol: 'none',
|
|
169
|
+
emphasis: {
|
|
170
|
+
disabled: true,
|
|
171
|
+
},
|
|
172
|
+
silent: true,
|
|
173
|
+
zlevel: 0,
|
|
174
|
+
});
|
|
175
175
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
176
|
+
if (showConfidenceBand && props.lineData && props.lineData.length > 0) {
|
|
177
|
+
const lowerBandData = extendedLineData.map((point) => {
|
|
178
|
+
const yValue = point[1];
|
|
179
|
+
// 0-30 = ±3, 30+ = ±10%
|
|
180
|
+
return [point[0], yValue <= 30 ? yValue - 3 : yValue * 0.9];
|
|
181
|
+
});
|
|
182
182
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
183
|
+
const upperBandData = extendedLineData.map((point) => {
|
|
184
|
+
const yValue = point[1];
|
|
185
|
+
// 0-30 = ±3, 30+ = ±10%
|
|
186
|
+
return [point[0], yValue <= 30 ? yValue + 3 : yValue * 1.1];
|
|
187
|
+
});
|
|
188
188
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
189
|
+
series.push({
|
|
190
|
+
name: 'Confidence Band',
|
|
191
|
+
type: 'line',
|
|
192
|
+
data: [...upperBandData, ...lowerBandData.reverse()],
|
|
193
|
+
symbol: 'none',
|
|
194
|
+
areaStyle: {
|
|
195
|
+
color: backgroundColor.lilac,
|
|
196
|
+
opacity: 0.5,
|
|
197
|
+
},
|
|
198
|
+
lineStyle: {
|
|
199
|
+
opacity: 0,
|
|
200
|
+
},
|
|
201
|
+
tooltip: {
|
|
202
|
+
show: false,
|
|
203
|
+
},
|
|
204
|
+
emphasis: {
|
|
205
|
+
disabled: true,
|
|
206
|
+
},
|
|
207
|
+
silent: true,
|
|
208
|
+
zlevel: 0,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
212
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
213
|
+
series.push({
|
|
214
|
+
symbolSize: 8,
|
|
215
|
+
data,
|
|
216
|
+
type: 'scatter',
|
|
217
|
+
itemStyle: {
|
|
218
|
+
color: backgroundColor['blue-inverse'],
|
|
219
|
+
opacity: 0.8,
|
|
220
|
+
},
|
|
221
|
+
emphasis: {
|
|
222
|
+
itemStyle: {
|
|
223
|
+
color: backgroundColor['blue-inverse'],
|
|
224
|
+
opacity: 1,
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
animation: false,
|
|
228
|
+
zlevel: 1,
|
|
229
|
+
});
|
|
230
230
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
231
|
+
if (errorBarData.length > 0) {
|
|
232
|
+
series.push({
|
|
233
|
+
type: 'custom',
|
|
234
|
+
name: 'error',
|
|
235
|
+
silent: true,
|
|
236
|
+
itemStyle: {
|
|
237
|
+
borderWidth: 1.5,
|
|
238
|
+
color: backgroundColor['blue-inverse'],
|
|
239
|
+
},
|
|
240
|
+
renderItem: renderErrorBarItem,
|
|
241
|
+
data: errorBarData,
|
|
242
|
+
zlevel: 0,
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
245
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
246
|
+
return {
|
|
247
|
+
xAxis: {
|
|
248
|
+
type: 'value',
|
|
249
|
+
name: xAxisName,
|
|
250
|
+
max: props.lineData
|
|
251
|
+
? Math.ceil(props.lineData[props.lineData.length - 1][0] / 10) * 10
|
|
252
|
+
: undefined,
|
|
253
|
+
...props.xAxisOptions,
|
|
254
|
+
},
|
|
255
|
+
yAxis: {
|
|
256
|
+
type: 'value',
|
|
257
|
+
name: yAxisName,
|
|
258
|
+
min: 0,
|
|
259
|
+
max: props.lineData
|
|
260
|
+
? Math.ceil(props.lineData[props.lineData.length - 1][1] / 10) * 10
|
|
261
|
+
: undefined,
|
|
262
|
+
...props.yAxisOptions,
|
|
263
|
+
},
|
|
264
|
+
animation: false,
|
|
265
|
+
tooltip: { show: false },
|
|
266
|
+
series,
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
269
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
270
|
+
$effect(() => {
|
|
271
|
+
if (chartComponent && data) {
|
|
272
|
+
chartComponent.updateOptions(options);
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
275
|
</script>
|
|
276
276
|
|
|
277
277
|
{#snippet confBandTooltip()}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
278
|
+
<div class="flex flex-col text-left">
|
|
279
|
+
<div class="w-max">
|
|
280
|
+
±3 <span class="text-sm text-secondary-inverse">colonies if count</span> ≤30
|
|
281
|
+
</div>
|
|
282
|
+
<div>
|
|
283
|
+
±10% <span class="text-sm text-secondary-inverse">if count</span> >30
|
|
284
|
+
</div>
|
|
285
|
+
</div>
|
|
286
286
|
{/snippet}
|
|
287
287
|
|
|
288
288
|
<div class="relative h-full" role="presentation">
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
289
|
+
<Chart
|
|
290
|
+
bind:this={chartComponent}
|
|
291
|
+
{options}
|
|
292
|
+
renderer="svg"
|
|
293
|
+
onitemclick={(e) => handleClick(e as ScatterPlotEchartsEvent)}
|
|
294
|
+
onmouseover={(e) => handleMouseOver(e as ScatterPlotEchartsEvent)}
|
|
295
|
+
onmouseout={handleMouseOut}
|
|
296
|
+
{loading}
|
|
297
|
+
{xAxisName}
|
|
298
|
+
{yAxisName}
|
|
299
|
+
>
|
|
300
|
+
{@render children?.()}
|
|
301
|
+
</Chart>
|
|
302
|
+
{#if showLegend}
|
|
303
|
+
<div
|
|
304
|
+
class="absolute left-14 top-6 flex h-auto rounded-lg border bg-surface transition-all duration-200"
|
|
305
|
+
>
|
|
306
|
+
<div class="ml-1 flex flex-col justify-center p-2">
|
|
307
|
+
{#each displayedLegendItems as item}
|
|
308
|
+
<div class="flex items-center gap-2">
|
|
309
|
+
{#if item.type === 'point'}
|
|
310
|
+
<div class="h-2 w-2 rounded-full" style="background-color: {item.color}"></div>
|
|
311
|
+
{:else if item.type === 'line'}
|
|
312
|
+
<div
|
|
313
|
+
class="h-[1px] w-2 border border-dashed"
|
|
314
|
+
style="border-color: {item.color}"
|
|
315
|
+
></div>
|
|
316
|
+
{:else if item.type === 'area'}
|
|
317
|
+
<div class="h-2 w-2" style="background-color: {item.color}"></div>
|
|
318
|
+
{/if}
|
|
319
|
+
<span class="text-sm text-secondary">{item.label}</span>
|
|
320
|
+
{#if item.label === 'Error margin'}
|
|
321
|
+
<Tooltip placement="right">
|
|
322
|
+
{#snippet trigger()}
|
|
323
|
+
<Icon iconName="Info" color="icon-tertiary" />
|
|
324
|
+
{/snippet}
|
|
325
|
+
{#snippet content()}
|
|
326
|
+
{@render confBandTooltip()}
|
|
327
|
+
{/snippet}
|
|
328
|
+
</Tooltip>
|
|
329
|
+
{/if}
|
|
330
|
+
</div>
|
|
331
|
+
{/each}
|
|
332
|
+
</div>
|
|
333
|
+
</div>
|
|
334
|
+
{/if}
|
|
335
335
|
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formattedDurationCompact(seconds: number): string;
|