@rtemis/draw 0.0.0-stage → 0.1.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/LICENSE.txt +30 -0
- package/README.md +50 -2
- package/dist/charts/a3/config.d.ts +97 -0
- package/dist/charts/a3/config.d.ts.map +1 -0
- package/dist/charts/a3/config.js +116 -0
- package/dist/charts/a3/config.js.map +1 -0
- package/dist/charts/a3/echarts.d.ts +6 -0
- package/dist/charts/a3/echarts.d.ts.map +1 -0
- package/dist/charts/a3/echarts.js +556 -0
- package/dist/charts/a3/echarts.js.map +1 -0
- package/dist/charts/a3/index.d.ts +4 -0
- package/dist/charts/a3/index.d.ts.map +1 -0
- package/dist/charts/a3/index.js +2 -0
- package/dist/charts/a3/index.js.map +1 -0
- package/dist/charts/a3/layout.d.ts +33 -0
- package/dist/charts/a3/layout.d.ts.map +1 -0
- package/dist/charts/a3/layout.js +192 -0
- package/dist/charts/a3/layout.js.map +1 -0
- package/dist/charts/a3/palette.d.ts +24 -0
- package/dist/charts/a3/palette.d.ts.map +1 -0
- package/dist/charts/a3/palette.js +129 -0
- package/dist/charts/a3/palette.js.map +1 -0
- package/dist/charts/a3/types.d.ts +164 -0
- package/dist/charts/a3/types.d.ts.map +1 -0
- package/dist/charts/a3/types.js +2 -0
- package/dist/charts/a3/types.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/rtemis-draw-builders.cjs +939 -0
- package/package.json +45 -4
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
import { createA3LayoutModel, resolveA3TitleMarginTop, resolveA3TitleTop } from "./layout.js";
|
|
2
|
+
import { paletteColorAt, resolveA3VisualizationTheme, withAlpha } from "./palette.js";
|
|
3
|
+
// Axis padding in layout coordinate units. Kept large enough to avoid
|
|
4
|
+
// clipping the boundary residue circles and the numeric position labels (which
|
|
5
|
+
// are drawn above the first row), but far smaller than a full coordinate unit —
|
|
6
|
+
// a full unit (the previous value) is ~3 residue spacings wide in x and ~2
|
|
7
|
+
// marker heights tall in y, which produced a large empty band above the first
|
|
8
|
+
// row and a lopsided left/right gap. Pixel-precise breathing room is instead
|
|
9
|
+
// controlled by the grid margins, which the caller can set directly.
|
|
10
|
+
const X_AXIS_PADDING = 0.2;
|
|
11
|
+
const Y_AXIS_PADDING_TOP = 0.7;
|
|
12
|
+
const Y_AXIS_PADDING_BOTTOM = 0.4;
|
|
13
|
+
const REGION_LEGEND_ICON = "path://M2 5 H22 V11 H2 Z";
|
|
14
|
+
const LEGEND_HEADING_REGIONS = "__legend_heading_regions__";
|
|
15
|
+
const LEGEND_HEADING_PTMS = "__legend_heading_ptms__";
|
|
16
|
+
const LEGEND_HEADING_PROCESSING = "__legend_heading_processing__";
|
|
17
|
+
// Fixed display order so a residue's tooltip groups its annotations the same
|
|
18
|
+
// way the legend rail does, regardless of which family populated first.
|
|
19
|
+
const ANNOTATION_FAMILY_ORDER = [
|
|
20
|
+
"Sites",
|
|
21
|
+
"Regions",
|
|
22
|
+
"PTMs",
|
|
23
|
+
"Processing",
|
|
24
|
+
"Variants",
|
|
25
|
+
];
|
|
26
|
+
/**
|
|
27
|
+
* Builds an Apache ECharts option object using the shared A3 layout geometry.
|
|
28
|
+
*/
|
|
29
|
+
export function createA3EChartsOption(input, options = {}) {
|
|
30
|
+
const model = createA3LayoutModel(input, options);
|
|
31
|
+
const theme = resolveA3VisualizationTheme(options.theme);
|
|
32
|
+
const markerSize = options.markerSize ?? 28;
|
|
33
|
+
const fontSize = options.fontSize ?? 18;
|
|
34
|
+
const lineWidth = options.lineWidth ?? 2;
|
|
35
|
+
const showMarkers = options.showMarkers ?? true;
|
|
36
|
+
const showLabels = options.showLabels ?? true;
|
|
37
|
+
const annotationGap = options.annotationGap ?? 16;
|
|
38
|
+
const ptmPlacement = options.ptmPlacement ?? "radial";
|
|
39
|
+
const markerColor = options.markerColor ?? "transparent";
|
|
40
|
+
const regionOpacity = clampOpacity(options.regionOpacity);
|
|
41
|
+
const legendRightInset = 16;
|
|
42
|
+
const legendRailWidth = 196;
|
|
43
|
+
const legendGap = options.legendGap ?? 90;
|
|
44
|
+
const positionLabelGap = options.positionLabelGap ?? 16;
|
|
45
|
+
const enableAnimation = options.enableAnimation ?? true;
|
|
46
|
+
const animationDuration = options.animationDuration ?? 220;
|
|
47
|
+
const animationDurationUpdate = options.animationDurationUpdate ?? 140;
|
|
48
|
+
const titleTop = resolveA3TitleTop(options);
|
|
49
|
+
const titleMarginTop = resolveA3TitleMarginTop(options);
|
|
50
|
+
const series = [];
|
|
51
|
+
// Per-residue annotation index: lets the large residue circle surface every
|
|
52
|
+
// annotation at that position in one tooltip, instead of forcing the user to
|
|
53
|
+
// hover the individual sub-marker symbols (which are only a few pixels wide).
|
|
54
|
+
const annotationsByPosition = new Map();
|
|
55
|
+
const addAnnotationHit = (position, hit) => {
|
|
56
|
+
const existing = annotationsByPosition.get(position);
|
|
57
|
+
if (existing) {
|
|
58
|
+
existing.push(hit);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
annotationsByPosition.set(position, [hit]);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const regionLegendEntries = [];
|
|
65
|
+
const siteLegendEntries = [];
|
|
66
|
+
const ptmLegendEntries = [];
|
|
67
|
+
const processingLegendEntries = [];
|
|
68
|
+
const labelColors = buildResidueLabelColors(model, options, theme);
|
|
69
|
+
if (showMarkers) {
|
|
70
|
+
series.push({
|
|
71
|
+
type: "line",
|
|
72
|
+
name: "Primary structure",
|
|
73
|
+
z: 10,
|
|
74
|
+
data: model.residues.map((residue) => ({
|
|
75
|
+
value: [residue.x, residue.y],
|
|
76
|
+
residue: residue.residue,
|
|
77
|
+
residueName: residue.residueName,
|
|
78
|
+
position: residue.position,
|
|
79
|
+
})),
|
|
80
|
+
tooltip: {
|
|
81
|
+
formatter: (params) => formatResidueTooltip(params.data?.position, params.data?.residueName, annotationsByPosition, theme),
|
|
82
|
+
},
|
|
83
|
+
showSymbol: true,
|
|
84
|
+
symbol: "circle",
|
|
85
|
+
symbolSize: markerSize,
|
|
86
|
+
lineStyle: {
|
|
87
|
+
color: theme.residueStrokeColor,
|
|
88
|
+
width: lineWidth,
|
|
89
|
+
},
|
|
90
|
+
itemStyle: {
|
|
91
|
+
color: markerColor,
|
|
92
|
+
borderColor: theme.residueStrokeColor,
|
|
93
|
+
borderWidth: 1,
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
// ── Regions ────────────────────────────────────────────────────────────────
|
|
98
|
+
// Each region entry has { index: [start, end][], type: string }
|
|
99
|
+
for (const [index, [name, entry]] of Object.entries(model.data.annotations.region).entries()) {
|
|
100
|
+
const color = paletteColorAt(theme.regionPalette, index);
|
|
101
|
+
const data = [];
|
|
102
|
+
for (const [start, end] of entry.index) {
|
|
103
|
+
for (let position = start; position <= end; position += 1) {
|
|
104
|
+
const residue = model.residues[position - 1];
|
|
105
|
+
if (residue !== undefined) {
|
|
106
|
+
data.push([residue.x, residue.y]);
|
|
107
|
+
addAnnotationHit(position, { family: "Regions", name, color });
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
data.push([null, null]);
|
|
111
|
+
}
|
|
112
|
+
series.push({
|
|
113
|
+
type: "line",
|
|
114
|
+
name,
|
|
115
|
+
z: 15,
|
|
116
|
+
// Purely visual: ignore pointer events so hovering the band falls through
|
|
117
|
+
// to the residue circle beneath, which renders the unified tooltip.
|
|
118
|
+
silent: true,
|
|
119
|
+
data,
|
|
120
|
+
connectNulls: false,
|
|
121
|
+
showSymbol: false,
|
|
122
|
+
itemStyle: {
|
|
123
|
+
color: withAlpha(color, regionOpacity),
|
|
124
|
+
},
|
|
125
|
+
lineStyle: {
|
|
126
|
+
color: withAlpha(color, regionOpacity),
|
|
127
|
+
width: markerSize,
|
|
128
|
+
cap: "round",
|
|
129
|
+
join: "round",
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
regionLegendEntries.push({
|
|
133
|
+
name,
|
|
134
|
+
icon: REGION_LEGEND_ICON,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
// ── Sites ──────────────────────────────────────────────────────────────────
|
|
138
|
+
// Each site entry has { index: number[], type: string }
|
|
139
|
+
for (const [index, [name, entry]] of Object.entries(model.data.annotations.site).entries()) {
|
|
140
|
+
const color = paletteColorAt(theme.sitePalette, index);
|
|
141
|
+
series.push({
|
|
142
|
+
type: "scatter",
|
|
143
|
+
name,
|
|
144
|
+
z: 20,
|
|
145
|
+
// See region note: silent so the residue circle owns the tooltip.
|
|
146
|
+
silent: true,
|
|
147
|
+
data: entry.index.flatMap((position) => {
|
|
148
|
+
const residue = model.residues[position - 1];
|
|
149
|
+
if (residue === undefined)
|
|
150
|
+
return [];
|
|
151
|
+
addAnnotationHit(position, { family: "Sites", name, color });
|
|
152
|
+
return [[residue.x, residue.y]];
|
|
153
|
+
}),
|
|
154
|
+
symbol: "circle",
|
|
155
|
+
symbolSize: markerSize,
|
|
156
|
+
itemStyle: {
|
|
157
|
+
color: "rgba(0, 0, 0, 0)",
|
|
158
|
+
borderColor: color,
|
|
159
|
+
borderWidth: 1.5,
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
// Built-in "circle" icon + per-item itemStyle gives a hollow ring that is
|
|
163
|
+
// CSP-safe (no data: URI) and respects the site color.
|
|
164
|
+
siteLegendEntries.push({
|
|
165
|
+
name,
|
|
166
|
+
icon: "circle",
|
|
167
|
+
itemStyle: {
|
|
168
|
+
color: "rgba(0,0,0,0)",
|
|
169
|
+
borderColor: color,
|
|
170
|
+
borderWidth: 2,
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
// ── PTMs ───────────────────────────────────────────────────────────────────
|
|
175
|
+
// Each PTM entry has { index: number[] | [number, number][], type: string }
|
|
176
|
+
// Extract positions from flex entries (handles both positions and ranges).
|
|
177
|
+
for (const [index, [name, entry]] of Object.entries(model.data.annotations.ptm).entries()) {
|
|
178
|
+
const color = paletteColorAt(theme.ptmPalette, index);
|
|
179
|
+
const positions = extractPositionsFromFlexEntry(entry);
|
|
180
|
+
const ptmSymbolSize = markerSize / 4.5;
|
|
181
|
+
const offset = resolvePtmPixelOffset(index, Math.max(Object.keys(model.data.annotations.ptm).length, 1), ptmPlacement, markerSize, ptmSymbolSize);
|
|
182
|
+
series.push({
|
|
183
|
+
type: "scatter",
|
|
184
|
+
name,
|
|
185
|
+
z: 30,
|
|
186
|
+
silent: true,
|
|
187
|
+
data: positions.flatMap((position) => {
|
|
188
|
+
const residue = model.residues[position - 1];
|
|
189
|
+
if (residue === undefined)
|
|
190
|
+
return [];
|
|
191
|
+
addAnnotationHit(position, { family: "PTMs", name, color });
|
|
192
|
+
return [[residue.x, residue.y]];
|
|
193
|
+
}),
|
|
194
|
+
symbol: "circle",
|
|
195
|
+
symbolSize: ptmSymbolSize,
|
|
196
|
+
symbolOffset: [offset.x, offset.y],
|
|
197
|
+
itemStyle: {
|
|
198
|
+
color,
|
|
199
|
+
opacity: 1,
|
|
200
|
+
},
|
|
201
|
+
});
|
|
202
|
+
// No custom icon: ECharts uses the series symbol (filled circle) coloured
|
|
203
|
+
// by the series-level itemStyle.color.
|
|
204
|
+
ptmLegendEntries.push({ name });
|
|
205
|
+
}
|
|
206
|
+
// ── Processing ─────────────────────────────────────────────────────────
|
|
207
|
+
// Each processing entry has { index: number[] | [number, number][], type: string }
|
|
208
|
+
for (const [index, [name, entry]] of Object.entries(model.data.annotations.processing).entries()) {
|
|
209
|
+
const color = paletteColorAt(theme.processingPalette, index);
|
|
210
|
+
const positions = extractPositionsFromFlexEntry(entry);
|
|
211
|
+
const offset = circularPixelOffset(index + 1, Math.max(Object.keys(model.data.annotations.processing).length, 1), annotationGap);
|
|
212
|
+
series.push({
|
|
213
|
+
type: "scatter",
|
|
214
|
+
name,
|
|
215
|
+
z: 31,
|
|
216
|
+
silent: true,
|
|
217
|
+
data: positions.flatMap((position) => {
|
|
218
|
+
const residue = model.residues[position - 1];
|
|
219
|
+
if (residue === undefined)
|
|
220
|
+
return [];
|
|
221
|
+
addAnnotationHit(position, { family: "Processing", name, color });
|
|
222
|
+
return [[residue.x, residue.y]];
|
|
223
|
+
}),
|
|
224
|
+
symbol: "triangle",
|
|
225
|
+
symbolRotate: 180,
|
|
226
|
+
symbolSize: markerSize / 4,
|
|
227
|
+
symbolOffset: [offset.x, offset.y],
|
|
228
|
+
itemStyle: {
|
|
229
|
+
color,
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
// No custom icon: ECharts uses the series symbol (triangle) for the legend icon.
|
|
233
|
+
processingLegendEntries.push({ name });
|
|
234
|
+
}
|
|
235
|
+
// One tooltip row per distinct label at a position, listing the sources of
|
|
236
|
+
// every record with that label, so per-source records of one change read once.
|
|
237
|
+
const variantSourcesByPosition = new Map();
|
|
238
|
+
for (const variant of model.data.annotations.variant) {
|
|
239
|
+
const labels = variantSourcesByPosition.get(variant.position) ?? new Map();
|
|
240
|
+
variantSourcesByPosition.set(variant.position, labels);
|
|
241
|
+
const label = describeVariant(variant);
|
|
242
|
+
const sources = labels.get(label) ?? new Set();
|
|
243
|
+
labels.set(label, sources);
|
|
244
|
+
for (const source of variantSources(variant))
|
|
245
|
+
sources.add(source);
|
|
246
|
+
}
|
|
247
|
+
for (const [position, labels] of variantSourcesByPosition) {
|
|
248
|
+
for (const [label, sources] of labels) {
|
|
249
|
+
addAnnotationHit(position, {
|
|
250
|
+
family: "Variants",
|
|
251
|
+
name: label,
|
|
252
|
+
color: theme.variantColor,
|
|
253
|
+
...(sources.size > 0 ? { detail: [...sources].join(", ") } : {}),
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
if (regionLegendEntries.length > 0) {
|
|
258
|
+
series.push(buildLegendHeadingSeries(LEGEND_HEADING_REGIONS));
|
|
259
|
+
}
|
|
260
|
+
if (ptmLegendEntries.length > 0) {
|
|
261
|
+
series.push(buildLegendHeadingSeries(LEGEND_HEADING_PTMS));
|
|
262
|
+
}
|
|
263
|
+
if (processingLegendEntries.length > 0) {
|
|
264
|
+
series.push(buildLegendHeadingSeries(LEGEND_HEADING_PROCESSING));
|
|
265
|
+
}
|
|
266
|
+
if (showLabels) {
|
|
267
|
+
series.push({
|
|
268
|
+
type: "scatter",
|
|
269
|
+
name: "Residue labels",
|
|
270
|
+
z: 40,
|
|
271
|
+
data: model.residues.map((residue, index) => ({
|
|
272
|
+
value: [residue.x, residue.y],
|
|
273
|
+
label: {
|
|
274
|
+
show: true,
|
|
275
|
+
formatter: residue.residue,
|
|
276
|
+
color: labelColors[index],
|
|
277
|
+
fontFamily: theme.annotationFontFamily,
|
|
278
|
+
fontSize,
|
|
279
|
+
},
|
|
280
|
+
})),
|
|
281
|
+
silent: true,
|
|
282
|
+
symbolSize: 0,
|
|
283
|
+
tooltip: {
|
|
284
|
+
show: false,
|
|
285
|
+
},
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
const positionEvery = options.positionEvery === undefined ? 10 : options.positionEvery;
|
|
289
|
+
if (positionEvery !== null && model.data.sequence.length > positionEvery) {
|
|
290
|
+
series.push({
|
|
291
|
+
type: "scatter",
|
|
292
|
+
name: "Position labels",
|
|
293
|
+
z: 41,
|
|
294
|
+
data: model.residues
|
|
295
|
+
.filter((residue) => residue.position % positionEvery === 0)
|
|
296
|
+
.map((residue) => ({
|
|
297
|
+
value: [residue.x, residue.y],
|
|
298
|
+
label: {
|
|
299
|
+
show: true,
|
|
300
|
+
position: "top",
|
|
301
|
+
distance: positionLabelGap,
|
|
302
|
+
formatter: String(residue.position),
|
|
303
|
+
color: theme.positionLabelColor,
|
|
304
|
+
fontFamily: theme.annotationFontFamily,
|
|
305
|
+
fontSize: Math.max(10, fontSize - 6),
|
|
306
|
+
},
|
|
307
|
+
})),
|
|
308
|
+
symbolSize: 0,
|
|
309
|
+
tooltip: {
|
|
310
|
+
show: false,
|
|
311
|
+
},
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
return Object.freeze({
|
|
315
|
+
backgroundColor: theme.backgroundColor,
|
|
316
|
+
animation: enableAnimation,
|
|
317
|
+
animationDuration,
|
|
318
|
+
animationDurationUpdate,
|
|
319
|
+
...(options.title
|
|
320
|
+
? {
|
|
321
|
+
title: {
|
|
322
|
+
text: options.title,
|
|
323
|
+
left: "5.5%",
|
|
324
|
+
top: titleTop,
|
|
325
|
+
textStyle: {
|
|
326
|
+
fontFamily: theme.legendFontFamily,
|
|
327
|
+
fontSize,
|
|
328
|
+
color: theme.legendColor,
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
}
|
|
332
|
+
: {}),
|
|
333
|
+
grid: {
|
|
334
|
+
left: 24,
|
|
335
|
+
right: legendRightInset + legendRailWidth + legendGap,
|
|
336
|
+
top: titleMarginTop,
|
|
337
|
+
bottom: 24,
|
|
338
|
+
containLabel: false,
|
|
339
|
+
},
|
|
340
|
+
xAxis: {
|
|
341
|
+
type: "value",
|
|
342
|
+
min: model.bounds.minX - X_AXIS_PADDING,
|
|
343
|
+
max: model.bounds.maxX + X_AXIS_PADDING,
|
|
344
|
+
show: false,
|
|
345
|
+
},
|
|
346
|
+
yAxis: {
|
|
347
|
+
type: "value",
|
|
348
|
+
min: model.bounds.minY - Y_AXIS_PADDING_TOP,
|
|
349
|
+
max: model.bounds.maxY + Y_AXIS_PADDING_BOTTOM,
|
|
350
|
+
inverse: true,
|
|
351
|
+
show: false,
|
|
352
|
+
scale: true,
|
|
353
|
+
},
|
|
354
|
+
legend: {
|
|
355
|
+
type: "plain",
|
|
356
|
+
orient: "vertical",
|
|
357
|
+
// Align the first legend item with the first sequence row. The y-axis
|
|
358
|
+
// spans [minY - paddingTop, maxY + paddingBottom] over a grid of height
|
|
359
|
+
// markerSize*(2*verticalSpan+1) px, so row 1's center sits
|
|
360
|
+
// paddingTop / (verticalSpan + paddingTop + paddingBottom) down.
|
|
361
|
+
top: (() => {
|
|
362
|
+
const vSpan = model.bounds.maxY - model.bounds.minY;
|
|
363
|
+
const gridH = markerSize * (2 * vSpan + 1);
|
|
364
|
+
const yRange = vSpan + Y_AXIS_PADDING_TOP + Y_AXIS_PADDING_BOTTOM;
|
|
365
|
+
return titleMarginTop + Math.round((gridH * Y_AXIS_PADDING_TOP) / yRange);
|
|
366
|
+
})(),
|
|
367
|
+
right: legendRightInset,
|
|
368
|
+
bottom: 24,
|
|
369
|
+
width: legendRailWidth,
|
|
370
|
+
data: buildLegendData(showMarkers, siteLegendEntries, regionLegendEntries, ptmLegendEntries, processingLegendEntries),
|
|
371
|
+
formatter: (name) => {
|
|
372
|
+
if (name === LEGEND_HEADING_REGIONS) {
|
|
373
|
+
return "{heading|Regions}";
|
|
374
|
+
}
|
|
375
|
+
if (name === LEGEND_HEADING_PTMS) {
|
|
376
|
+
return "{heading|PTMs}";
|
|
377
|
+
}
|
|
378
|
+
if (name === LEGEND_HEADING_PROCESSING) {
|
|
379
|
+
return "{heading|Processing}";
|
|
380
|
+
}
|
|
381
|
+
return name;
|
|
382
|
+
},
|
|
383
|
+
textStyle: {
|
|
384
|
+
color: theme.legendColor,
|
|
385
|
+
fontFamily: theme.legendFontFamily,
|
|
386
|
+
fontSize,
|
|
387
|
+
rich: {
|
|
388
|
+
heading: {
|
|
389
|
+
color: theme.legendColor,
|
|
390
|
+
fontFamily: theme.legendFontFamily,
|
|
391
|
+
fontSize: Math.max(12, fontSize - 1),
|
|
392
|
+
fontWeight: 600,
|
|
393
|
+
padding: [12, 0, 2, 0],
|
|
394
|
+
},
|
|
395
|
+
},
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
tooltip: {
|
|
399
|
+
trigger: "item",
|
|
400
|
+
confine: true,
|
|
401
|
+
},
|
|
402
|
+
series: Object.freeze(series),
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Extracts flat position array from a A3FlexData.
|
|
407
|
+
* A3FlexData.index can be number[] (positions) or [number, number][] (ranges).
|
|
408
|
+
* When ranges, expands each [start, end] into individual positions.
|
|
409
|
+
*/
|
|
410
|
+
function extractPositionsFromFlexEntry(entry) {
|
|
411
|
+
const index = entry.index;
|
|
412
|
+
if (index.length === 0)
|
|
413
|
+
return [];
|
|
414
|
+
// Check if first element is an array → ranges
|
|
415
|
+
if (Array.isArray(index[0])) {
|
|
416
|
+
const ranges = index;
|
|
417
|
+
const positions = [];
|
|
418
|
+
for (const [start, end] of ranges) {
|
|
419
|
+
for (let pos = start; pos <= end; pos++) {
|
|
420
|
+
positions.push(pos);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
return positions;
|
|
424
|
+
}
|
|
425
|
+
// Plain positions
|
|
426
|
+
return index;
|
|
427
|
+
}
|
|
428
|
+
function buildResidueLabelColors(model, options, theme) {
|
|
429
|
+
const diseaseVariants = new Set(options.diseaseVariants ?? []);
|
|
430
|
+
// Look for a site annotation matching "disease_associated_variant" (case-insensitive)
|
|
431
|
+
for (const [key, entry] of Object.entries(model.data.annotations.site)) {
|
|
432
|
+
if (key.toLowerCase().replace(/[-\s]/g, "_") === "disease_associated_variant") {
|
|
433
|
+
for (const position of entry.index) {
|
|
434
|
+
diseaseVariants.add(position);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
const variantPositions = new Set(model.data.annotations.variant.map((variant) => variant.position));
|
|
439
|
+
return model.residues.map((residue) => {
|
|
440
|
+
if (diseaseVariants.has(residue.position)) {
|
|
441
|
+
return theme.diseaseVariantColor;
|
|
442
|
+
}
|
|
443
|
+
if (variantPositions.has(residue.position)) {
|
|
444
|
+
return theme.variantColor;
|
|
445
|
+
}
|
|
446
|
+
return theme.labelColor;
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
function circularPixelOffset(index, count, gap) {
|
|
450
|
+
const angle = (2 * Math.PI * index) / count;
|
|
451
|
+
return Object.freeze({
|
|
452
|
+
x: Math.sin(angle) * gap,
|
|
453
|
+
y: Math.cos(angle) * gap,
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
function resolvePtmPixelOffset(index, count, placement, markerSize, ptmSymbolSize) {
|
|
457
|
+
const residueRadius = markerSize / 2;
|
|
458
|
+
const ptmRadius = ptmSymbolSize / 2;
|
|
459
|
+
const radialDistance = placement === "innerRadial"
|
|
460
|
+
? Math.max(0, residueRadius - ptmRadius)
|
|
461
|
+
: placement === "radial"
|
|
462
|
+
? residueRadius
|
|
463
|
+
: residueRadius + ptmRadius;
|
|
464
|
+
return circularPixelOffset(index + 1, count, radialDistance);
|
|
465
|
+
}
|
|
466
|
+
function clampOpacity(value, fallback = 0.35) {
|
|
467
|
+
if (value === undefined || Number.isNaN(value)) {
|
|
468
|
+
return fallback;
|
|
469
|
+
}
|
|
470
|
+
return Math.min(1, Math.max(0, value));
|
|
471
|
+
}
|
|
472
|
+
function buildLegendData(includePrimaryStructure, siteLegendEntries, regionLegendEntries, ptmLegendEntries, processingLegendEntries) {
|
|
473
|
+
const entries = [];
|
|
474
|
+
if (includePrimaryStructure) {
|
|
475
|
+
entries.push("Primary structure");
|
|
476
|
+
}
|
|
477
|
+
entries.push(...siteLegendEntries);
|
|
478
|
+
if (regionLegendEntries.length > 0) {
|
|
479
|
+
entries.push({ name: LEGEND_HEADING_REGIONS, icon: "none" });
|
|
480
|
+
entries.push(...regionLegendEntries);
|
|
481
|
+
}
|
|
482
|
+
if (ptmLegendEntries.length > 0) {
|
|
483
|
+
entries.push({ name: LEGEND_HEADING_PTMS, icon: "none" });
|
|
484
|
+
entries.push(...ptmLegendEntries);
|
|
485
|
+
}
|
|
486
|
+
if (processingLegendEntries.length > 0) {
|
|
487
|
+
entries.push({ name: LEGEND_HEADING_PROCESSING, icon: "none" });
|
|
488
|
+
entries.push(...processingLegendEntries);
|
|
489
|
+
}
|
|
490
|
+
return entries;
|
|
491
|
+
}
|
|
492
|
+
function escapeHtml(value) {
|
|
493
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
494
|
+
}
|
|
495
|
+
function describeVariant(variant) {
|
|
496
|
+
const wild = variant.from ?? variant.wild_type ?? variant.wildType ?? variant.ref;
|
|
497
|
+
const mutant = variant.to ?? variant.mutant ?? variant.alt ?? variant.variant;
|
|
498
|
+
if (wild !== undefined && variant.type === "deletion") {
|
|
499
|
+
return `${String(wild)}${variant.position}del`;
|
|
500
|
+
}
|
|
501
|
+
if (wild !== undefined && mutant !== undefined) {
|
|
502
|
+
return `${String(wild)}${variant.position}${String(mutant)}`;
|
|
503
|
+
}
|
|
504
|
+
return `Variant @ ${variant.position}`;
|
|
505
|
+
}
|
|
506
|
+
/** A variant's `source`, a string or a list of strings, as a list. */
|
|
507
|
+
function variantSources(variant) {
|
|
508
|
+
const { source } = variant;
|
|
509
|
+
if (typeof source === "string")
|
|
510
|
+
return [source];
|
|
511
|
+
if (Array.isArray(source)) {
|
|
512
|
+
return source.filter((s) => typeof s === "string");
|
|
513
|
+
}
|
|
514
|
+
return [];
|
|
515
|
+
}
|
|
516
|
+
function formatResidueTooltip(position, residueName, annotationsByPosition, theme) {
|
|
517
|
+
const name = escapeHtml(residueName ?? "");
|
|
518
|
+
const header = position === undefined
|
|
519
|
+
? name
|
|
520
|
+
: `<span style="opacity:0.6;font-weight:400">${position}</span> ${name}`;
|
|
521
|
+
const headerHtml = `<div style="font-weight:600">${header}</div>`;
|
|
522
|
+
const wrap = (inner) => `<div style="color:${theme.legendColor};font-family:${theme.legendFontFamily}">${inner}</div>`;
|
|
523
|
+
const hits = position === undefined ? undefined : annotationsByPosition.get(position);
|
|
524
|
+
if (!hits || hits.length === 0) {
|
|
525
|
+
return wrap(headerHtml);
|
|
526
|
+
}
|
|
527
|
+
const rows = [];
|
|
528
|
+
for (const family of ANNOTATION_FAMILY_ORDER) {
|
|
529
|
+
const familyHits = hits.filter((hit) => hit.family === family);
|
|
530
|
+
if (familyHits.length === 0) {
|
|
531
|
+
continue;
|
|
532
|
+
}
|
|
533
|
+
rows.push(`<div style="margin-top:4px;font-size:11px;opacity:0.6;text-transform:uppercase;letter-spacing:0.04em">${family}</div>`);
|
|
534
|
+
for (const hit of familyHits) {
|
|
535
|
+
rows.push(`<div style="display:flex;align-items:center;gap:6px">` +
|
|
536
|
+
`<span style="display:inline-block;width:8px;height:8px;border-radius:50%;background:${hit.color}"></span>` +
|
|
537
|
+
`<span>${escapeHtml(hit.name)}</span>` +
|
|
538
|
+
(hit.detail ? `<span style="opacity:0.6">${escapeHtml(hit.detail)}</span>` : "") +
|
|
539
|
+
`</div>`);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
return wrap(headerHtml + rows.join(""));
|
|
543
|
+
}
|
|
544
|
+
function buildLegendHeadingSeries(name) {
|
|
545
|
+
return {
|
|
546
|
+
type: "scatter",
|
|
547
|
+
name,
|
|
548
|
+
data: [],
|
|
549
|
+
symbolSize: 0,
|
|
550
|
+
silent: true,
|
|
551
|
+
tooltip: {
|
|
552
|
+
show: false,
|
|
553
|
+
},
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
//# sourceMappingURL=echarts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"echarts.js","sourceRoot":"","sources":["../../../src/charts/a3/echarts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,2BAA2B,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAStF,sEAAsE;AACtE,+EAA+E;AAC/E,gFAAgF;AAChF,2EAA2E;AAC3E,8EAA8E;AAC9E,6EAA6E;AAC7E,qEAAqE;AACrE,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAElC,MAAM,kBAAkB,GAAG,0BAA0B,CAAC;AACtD,MAAM,sBAA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AAW;gBAC3G,SAAS,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS;gBACtC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,6BAA6B,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;gBAChF,QAAQ,CACX,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,wBAAwB,CAAC,IAAY;IAC5C,OAAO;QACL,IAAI,EAAE,SAAS;QACf,IAAI;QACJ,IAAI,EAAE,EAAE;QACR,UAAU,EAAE,CAAC;QACb,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE;YACP,IAAI,EAAE,KAAK;SACZ;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { A3Appearance, A3ChartConfig, A3SurfaceHints } from "./config.ts";
|
|
2
|
+
export { A3_CHART_CONFIG_MEMBERS, a3SurfaceHints, buildA3Option } from "./config.ts";
|
|
3
|
+
export type { A3EChartsOption, A3PtmPlacement } from "./types.ts";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/charts/a3/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACrF,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/charts/a3/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { A3LayoutModel, A3VisualizationInput, A3VisualizationOptions } from "./types.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Creates shared residue geometry that can be rendered by visualization backends.
|
|
4
|
+
* Accepts validated A3Data (plain object from a3.toData()).
|
|
5
|
+
*/
|
|
6
|
+
export declare function createA3LayoutModel(input: A3VisualizationInput, options?: A3VisualizationOptions): A3LayoutModel;
|
|
7
|
+
/**
|
|
8
|
+
* Resolves the final chart height in pixels for a visualization. When the
|
|
9
|
+
* caller does not provide `options.height`, the value is derived from the
|
|
10
|
+
* layout bounds and marker size so row spacing stays visually balanced.
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolveA3VisualizationHeight(input: A3VisualizationInput, options?: A3VisualizationOptions): number;
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the vertical title inset in pixels.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveA3TitleTop(options?: A3VisualizationOptions): number;
|
|
17
|
+
/**
|
|
18
|
+
* Resolves the vertical space reserved for the title block.
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveA3TitleMarginTop(options?: A3VisualizationOptions): number;
|
|
21
|
+
/**
|
|
22
|
+
* Returns residue positions for the canonical wrapped sequence layout.
|
|
23
|
+
*/
|
|
24
|
+
export declare function createSequenceCoordinates(length: number, nPerRow: number): {
|
|
25
|
+
readonly xs: readonly number[];
|
|
26
|
+
readonly ys: readonly number[];
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Resolves chart height from an existing layout model. This is mainly useful
|
|
30
|
+
* for renderers that already built the model and want to avoid recomputing it.
|
|
31
|
+
*/
|
|
32
|
+
export declare function resolveA3VisualizationHeightFromModel(model: A3LayoutModel, options?: A3VisualizationOptions): number;
|
|
33
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/charts/a3/layout.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,aAAa,EAEb,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAuCpB;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,oBAAoB,EAC3B,OAAO,GAAE,sBAA2B,GACnC,aAAa,CAwBf;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,oBAAoB,EAC3B,OAAO,GAAE,sBAA2B,GACnC,MAAM,CAGR;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,sBAA2B,GAAG,MAAM,CAE9E;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,GAAE,sBAA2B,GAAG,MAAM,CAUpF;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd;IAAE,QAAQ,CAAC,EAAE,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAuCpE;AA4BD;;;GAGG;AACH,wBAAgB,qCAAqC,CACnD,KAAK,EAAE,aAAa,EACpB,OAAO,GAAE,sBAA2B,GACnC,MAAM,CAeR"}
|