jbrowse-plugin-mafviewer 1.0.6 → 1.0.8
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 +17 -2
- package/dist/BigMafAdapter/BigMafAdapter.d.ts +17 -0
- package/dist/BigMafAdapter/BigMafAdapter.js +92 -0
- package/dist/BigMafAdapter/BigMafAdapter.js.map +1 -0
- package/dist/BigMafAdapter/configSchema.d.ts +21 -0
- package/dist/BigMafAdapter/configSchema.js +28 -0
- package/dist/BigMafAdapter/configSchema.js.map +1 -0
- package/dist/BigMafAdapter/index.d.ts +2 -0
- package/dist/BigMafAdapter/index.js +11 -0
- package/dist/BigMafAdapter/index.js.map +1 -0
- package/dist/LinearMafDisplay/components/ColorLegend.d.ts +8 -0
- package/dist/LinearMafDisplay/components/ColorLegend.js +15 -0
- package/dist/LinearMafDisplay/components/ColorLegend.js.map +1 -0
- package/dist/LinearMafDisplay/components/ReactComponent.d.ts +6 -0
- package/dist/LinearMafDisplay/components/ReactComponent.js +15 -0
- package/dist/LinearMafDisplay/components/ReactComponent.js.map +1 -0
- package/dist/LinearMafDisplay/components/RectBg.d.ts +9 -0
- package/dist/LinearMafDisplay/components/RectBg.js +7 -0
- package/dist/LinearMafDisplay/components/RectBg.js.map +1 -0
- package/dist/LinearMafDisplay/components/SetRowHeight.d.ts +11 -0
- package/dist/LinearMafDisplay/components/SetRowHeight.js +36 -0
- package/dist/LinearMafDisplay/components/SetRowHeight.js.map +1 -0
- package/dist/LinearMafDisplay/components/YScaleBars.d.ts +9 -0
- package/dist/LinearMafDisplay/components/YScaleBars.js +41 -0
- package/dist/LinearMafDisplay/components/YScaleBars.js.map +1 -0
- package/dist/LinearMafDisplay/configSchema.d.ts +34 -0
- package/dist/LinearMafDisplay/configSchema.js +15 -0
- package/dist/LinearMafDisplay/configSchema.js.map +1 -0
- package/dist/LinearMafDisplay/index.d.ts +2 -0
- package/dist/LinearMafDisplay/index.js +20 -0
- package/dist/LinearMafDisplay/index.js.map +1 -0
- package/dist/LinearMafDisplay/renderSvg.d.ts +4 -0
- package/dist/LinearMafDisplay/renderSvg.js +17 -0
- package/dist/LinearMafDisplay/renderSvg.js.map +1 -0
- package/dist/LinearMafDisplay/stateModel.d.ts +364 -0
- package/dist/LinearMafDisplay/stateModel.js +176 -0
- package/dist/LinearMafDisplay/stateModel.js.map +1 -0
- package/dist/LinearMafRenderer/LinearMafRenderer.d.ts +45 -0
- package/dist/LinearMafRenderer/LinearMafRenderer.js +181 -0
- package/dist/LinearMafRenderer/LinearMafRenderer.js.map +1 -0
- package/dist/LinearMafRenderer/components/ReactComponent.d.ts +6 -0
- package/dist/LinearMafRenderer/components/ReactComponent.js +8 -0
- package/dist/LinearMafRenderer/components/ReactComponent.js.map +1 -0
- package/dist/LinearMafRenderer/configSchema.d.ts +2 -0
- package/dist/LinearMafRenderer/configSchema.js +13 -0
- package/dist/LinearMafRenderer/configSchema.js.map +1 -0
- package/dist/LinearMafRenderer/index.d.ts +2 -0
- package/dist/LinearMafRenderer/index.js +12 -0
- package/dist/LinearMafRenderer/index.js.map +1 -0
- package/dist/LinearMafRenderer/util.d.ts +10 -0
- package/dist/LinearMafRenderer/util.js +16 -0
- package/dist/LinearMafRenderer/util.js.map +1 -0
- package/dist/MafAddTrackWorkflow/AddTrackWorkflow.d.ts +5 -0
- package/dist/MafAddTrackWorkflow/AddTrackWorkflow.js +111 -0
- package/dist/MafAddTrackWorkflow/AddTrackWorkflow.js.map +1 -0
- package/dist/MafAddTrackWorkflow/index.d.ts +2 -0
- package/dist/MafAddTrackWorkflow/index.js +12 -0
- package/dist/MafAddTrackWorkflow/index.js.map +1 -0
- package/dist/MafTabixAdapter/MafTabixAdapter.d.ts +17 -0
- package/dist/MafTabixAdapter/MafTabixAdapter.js +96 -0
- package/dist/MafTabixAdapter/MafTabixAdapter.js.map +1 -0
- package/dist/MafTabixAdapter/configSchema.d.ts +33 -0
- package/dist/MafTabixAdapter/configSchema.js +40 -0
- package/dist/MafTabixAdapter/configSchema.js.map +1 -0
- package/dist/MafTabixAdapter/index.d.ts +2 -0
- package/dist/MafTabixAdapter/index.js +11 -0
- package/dist/MafTabixAdapter/index.js.map +1 -0
- package/dist/MafTrack/configSchema.d.ts +79 -0
- package/dist/MafTrack/configSchema.js +15 -0
- package/dist/MafTrack/configSchema.js.map +1 -0
- package/dist/MafTrack/index.d.ts +2 -0
- package/dist/MafTrack/index.js +14 -0
- package/dist/MafTrack/index.js.map +1 -0
- package/dist/TaffyAdapter/TaffyAdapter.d.ts +16 -0
- package/dist/TaffyAdapter/TaffyAdapter.js +89 -0
- package/dist/TaffyAdapter/TaffyAdapter.js.map +1 -0
- package/dist/TaffyAdapter/configSchema.d.ts +31 -0
- package/dist/TaffyAdapter/configSchema.js +38 -0
- package/dist/TaffyAdapter/configSchema.js.map +1 -0
- package/dist/TaffyAdapter/index.d.ts +2 -0
- package/dist/TaffyAdapter/index.js +11 -0
- package/dist/TaffyAdapter/index.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/jbrowse-plugin-mafviewer.umd.production.min.js +4 -1
- package/dist/jbrowse-plugin-mafviewer.umd.production.min.js.map +7 -1
- package/package.json +21 -38
- package/src/BigMafAdapter/BigMafAdapter.ts +1 -2
- package/src/LinearMafDisplay/components/ColorLegend.tsx +2 -2
- package/src/LinearMafDisplay/components/SetRowHeight.tsx +9 -3
- package/src/LinearMafDisplay/components/YScaleBars.tsx +11 -3
- package/src/LinearMafDisplay/stateModel.ts +32 -2
- package/src/LinearMafRenderer/LinearMafRenderer.ts +38 -34
- package/src/LinearMafRenderer/util.ts +20 -0
- package/src/MafAddTrackWorkflow/AddTrackWorkflow.tsx +60 -22
- package/src/MafTabixAdapter/MafTabixAdapter.ts +2 -2
- package/src/TaffyAdapter/TaffyAdapter.ts +112 -0
- package/src/TaffyAdapter/configSchema.ts +44 -0
- package/src/TaffyAdapter/index.ts +15 -0
- package/src/index.ts +2 -0
- package/dist/jbrowse-plugin-mafviewer.umd.development.js +0 -1439
- package/dist/jbrowse-plugin-mafviewer.umd.development.js.map +0 -1
package/README.md
CHANGED
|
@@ -136,6 +136,21 @@ The MafTabix track is created according to
|
|
|
136
136
|
|
|
137
137
|
The samples array is either `string[]|{id:string,label:string,color?:string}[]`
|
|
138
138
|
|
|
139
|
+
## Creating MAF files as Cactus pangenome/HAL
|
|
140
|
+
|
|
141
|
+
You can create a MAF file from a Cactus pangenome graph using
|
|
142
|
+
ComparativeGenomeToolkit
|
|
143
|
+
|
|
144
|
+
This page discusses some examples
|
|
145
|
+
|
|
146
|
+
https://github.com/ComparativeGenomicsToolkit/cactus/blob/master/doc/progressive.md#maf-export
|
|
147
|
+
|
|
148
|
+
Thanks to Sam Talbot (https://github.com/SamCT) for initially creating the
|
|
149
|
+
Cactus -> JBrowse 2 MAF example
|
|
150
|
+
|
|
151
|
+
Please note that MAFViewer wants non-overlapping blocks, please check if this is
|
|
152
|
+
the case
|
|
153
|
+
|
|
139
154
|
## Prepare data
|
|
140
155
|
|
|
141
156
|
This is the same as the jbrowse 1 mafviewer plugin (currently the similar to
|
|
@@ -168,8 +183,8 @@ Start by converting the MAF into a pseudo-BED format using the maf2bed tool
|
|
|
168
183
|
```bash
|
|
169
184
|
# from https://github.com/cmdcolin/maf2bed
|
|
170
185
|
cargo install maf2bed
|
|
171
|
-
cat file.maf | maf2bed hg38 | bgzip > out.bed
|
|
172
|
-
tabix
|
|
186
|
+
cat file.maf | maf2bed hg38 | sort -k1,1 -k2,2n | bgzip > out.bed.gz
|
|
187
|
+
tabix out.bed.gz
|
|
173
188
|
```
|
|
174
189
|
|
|
175
190
|
The second argument to maf2bed is the genome version e.g. hg38 used for the main
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
+
import { Feature, Region } from '@jbrowse/core/util';
|
|
3
|
+
export default class BigMafAdapter extends BaseFeatureDataAdapter {
|
|
4
|
+
setupP?: Promise<{
|
|
5
|
+
adapter: BaseFeatureDataAdapter;
|
|
6
|
+
}>;
|
|
7
|
+
setup(): Promise<{
|
|
8
|
+
adapter: BaseFeatureDataAdapter;
|
|
9
|
+
}>;
|
|
10
|
+
setupPre(): Promise<{
|
|
11
|
+
adapter: BaseFeatureDataAdapter;
|
|
12
|
+
}>;
|
|
13
|
+
getRefNames(): Promise<string[]>;
|
|
14
|
+
getHeader(): Promise<unknown>;
|
|
15
|
+
getFeatures(query: Region): import("rxjs").Observable<Feature>;
|
|
16
|
+
freeResources(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
+
import { getSnapshot } from 'mobx-state-tree';
|
|
3
|
+
import { SimpleFeature } from '@jbrowse/core/util';
|
|
4
|
+
import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
5
|
+
import { firstValueFrom, toArray } from 'rxjs';
|
|
6
|
+
export default class BigMafAdapter extends BaseFeatureDataAdapter {
|
|
7
|
+
setupP;
|
|
8
|
+
async setup() {
|
|
9
|
+
if (!this.getSubAdapter) {
|
|
10
|
+
throw new Error('no getSubAdapter available');
|
|
11
|
+
}
|
|
12
|
+
const adapter = await this.getSubAdapter({
|
|
13
|
+
...getSnapshot(this.config),
|
|
14
|
+
type: 'BigBedAdapter',
|
|
15
|
+
});
|
|
16
|
+
return {
|
|
17
|
+
adapter: adapter.dataAdapter,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
async setupPre() {
|
|
21
|
+
if (!this.setupP) {
|
|
22
|
+
this.setupP = this.setup().catch((e) => {
|
|
23
|
+
this.setupP = undefined;
|
|
24
|
+
throw e;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return this.setupP;
|
|
28
|
+
}
|
|
29
|
+
async getRefNames() {
|
|
30
|
+
const { adapter } = await this.setup();
|
|
31
|
+
return adapter.getRefNames();
|
|
32
|
+
}
|
|
33
|
+
async getHeader() {
|
|
34
|
+
const { adapter } = await this.setup();
|
|
35
|
+
return adapter.getHeader();
|
|
36
|
+
}
|
|
37
|
+
getFeatures(query) {
|
|
38
|
+
return ObservableCreate(async (observer) => {
|
|
39
|
+
const { adapter } = await this.setup();
|
|
40
|
+
const features = await firstValueFrom(adapter.getFeatures(query).pipe(toArray()));
|
|
41
|
+
for (const feature of features) {
|
|
42
|
+
const maf = feature.get('mafBlock');
|
|
43
|
+
const blocks = maf.split(';');
|
|
44
|
+
let aln;
|
|
45
|
+
const alns = [];
|
|
46
|
+
const alignments = {};
|
|
47
|
+
const blocks2 = [];
|
|
48
|
+
for (const block of blocks) {
|
|
49
|
+
if (block.startsWith('s')) {
|
|
50
|
+
if (aln) {
|
|
51
|
+
alns.push(block.split(/ +/)[6]);
|
|
52
|
+
blocks2.push(block);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
aln = block.split(/ +/)[6];
|
|
56
|
+
alns.push(aln);
|
|
57
|
+
blocks2.push(block);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
for (let i = 0; i < blocks2.length; i++) {
|
|
62
|
+
const elt = blocks2[i];
|
|
63
|
+
const ad = elt.split(/ +/);
|
|
64
|
+
const y = ad[1].split('.');
|
|
65
|
+
const org = y[0];
|
|
66
|
+
const chr = y[1];
|
|
67
|
+
alignments[org] = {
|
|
68
|
+
chr: chr,
|
|
69
|
+
start: +ad[1],
|
|
70
|
+
srcSize: +ad[2],
|
|
71
|
+
strand: ad[3] === '+' ? 1 : -1,
|
|
72
|
+
unknown: +ad[4],
|
|
73
|
+
data: alns[i],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
observer.next(new SimpleFeature({
|
|
77
|
+
id: feature.id(),
|
|
78
|
+
data: {
|
|
79
|
+
start: feature.get('start'),
|
|
80
|
+
end: feature.get('end'),
|
|
81
|
+
refName: feature.get('refName'),
|
|
82
|
+
seq: alns[0],
|
|
83
|
+
alignments: alignments,
|
|
84
|
+
},
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
observer.complete();
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
freeResources() { }
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=BigMafAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BigMafAdapter.js","sourceRoot":"","sources":["../../src/BigMafAdapter/BigMafAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAA;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAmB,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAU9C,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,sBAAsB;IACxD,MAAM,CAA+C;IAE5D,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAA;QAC/C,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC;YACvC,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC;YAC3B,IAAI,EAAE,eAAe;SACtB,CAAC,CAAA;QACF,OAAO;YACL,OAAO,EAAE,OAAO,CAAC,WAAqC;SACvD,CAAA;IACH,CAAC;IACD,KAAK,CAAC,QAAQ;QACZ,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,CAAU,EAAE,EAAE;gBAC9C,IAAI,CA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EAAE,EAAE;oBAChB,IAAI,EAAE;wBACJ,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;wBAC3B,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;wBACvB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;wBAC/B,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;wBACZ,UAAU,EAAE,UAAU;qBACvB;iBACF,CAAC,CACH,CAAA;YACH,CAAC;YACD,QAAQ,CAAC,QAAQ,EAAE,CAAA;QACrB,CAAC,CAAC,CAAA;IACJ,CAAC;IACD,aAAa,KAAU,CAAC;CACzB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const configSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
+
/**
|
|
3
|
+
* #slot
|
|
4
|
+
*/
|
|
5
|
+
samples: {
|
|
6
|
+
type: string;
|
|
7
|
+
description: string;
|
|
8
|
+
defaultValue: never[];
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* #slot
|
|
12
|
+
*/
|
|
13
|
+
bigBedLocation: {
|
|
14
|
+
type: string;
|
|
15
|
+
defaultValue: {
|
|
16
|
+
uri: string;
|
|
17
|
+
locationType: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
21
|
+
export default configSchema;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
+
/**
|
|
3
|
+
* #config BigMafAdapter
|
|
4
|
+
* used to configure BigMaf adapter
|
|
5
|
+
*/
|
|
6
|
+
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
7
|
+
const configSchema = ConfigurationSchema('BigMafAdapter', {
|
|
8
|
+
/**
|
|
9
|
+
* #slot
|
|
10
|
+
*/
|
|
11
|
+
samples: {
|
|
12
|
+
type: 'frozen',
|
|
13
|
+
description: 'string[] or {id:string,label:string,color?:string}[]',
|
|
14
|
+
defaultValue: [],
|
|
15
|
+
},
|
|
16
|
+
/**
|
|
17
|
+
* #slot
|
|
18
|
+
*/
|
|
19
|
+
bigBedLocation: {
|
|
20
|
+
type: 'fileLocation',
|
|
21
|
+
defaultValue: {
|
|
22
|
+
uri: '/path/to/my.bb',
|
|
23
|
+
locationType: 'UriLocation',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
}, { explicitlyTyped: true });
|
|
27
|
+
export default configSchema;
|
|
28
|
+
//# sourceMappingURL=configSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/BigMafAdapter/configSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE;;;GAGG;AACH,SAAS,CAAC,KAAI,CAAC,CAAC,wDAAwD;AAExE,MAAM,YAAY,GAAG,mBAAmB,CACtC,eAAe,EACf;IACE;;OAEG;IACH,OAAO,EAAE;QACP,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,sDAAsD;QACnE,YAAY,EAAE,EAAE;KACjB;IACD;;OAEG;IACH,cAAc,EAAE;QACd,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE;YACZ,GAAG,EAAE,gBAAgB;YACrB,YAAY,EAAE,aAAa;SAC5B;KACF;CACF,EACD,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AdapterType } from '@jbrowse/core/pluggableElementTypes';
|
|
2
|
+
import configSchema from './configSchema';
|
|
3
|
+
import BigMafAdapter from './BigMafAdapter';
|
|
4
|
+
export default function BigMafAdapterF(pluginManager) {
|
|
5
|
+
return pluginManager.addAdapterType(() => new AdapterType({
|
|
6
|
+
name: 'BigMafAdapter',
|
|
7
|
+
AdapterClass: BigMafAdapter,
|
|
8
|
+
configSchema,
|
|
9
|
+
}));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/BigMafAdapter/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AACjE,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAE3C,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,aAA4B;IACjE,OAAO,aAAa,CAAC,cAAc,CACjC,GAAG,EAAE,CACH,IAAI,WAAW,CAAC;QACd,IAAI,EAAE,eAAe;QACrB,YAAY,EAAE,aAAa;QAC3B,YAAY;KACb,CAAC,CACL,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LinearMafDisplayModel } from '../stateModel';
|
|
3
|
+
declare const ColorLegend: ({ model, labelWidth, svgFontSize, }: {
|
|
4
|
+
model: LinearMafDisplayModel;
|
|
5
|
+
svgFontSize: number;
|
|
6
|
+
labelWidth: number;
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
|
+
export default ColorLegend;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { observer } from 'mobx-react';
|
|
3
|
+
import RectBg from './RectBg';
|
|
4
|
+
const ColorLegend = observer(function ({ model, labelWidth, svgFontSize, }) {
|
|
5
|
+
const { samples, rowHeight } = model;
|
|
6
|
+
const canDisplayLabel = rowHeight >= 10;
|
|
7
|
+
const boxHeight = Math.min(20, rowHeight);
|
|
8
|
+
return (React.createElement(React.Fragment, null,
|
|
9
|
+
samples.map((sample, idx) => (React.createElement(RectBg, { key: `${sample.id}-${idx}`, y: idx * rowHeight, x: 0, width: labelWidth + 5, height: boxHeight, color: sample.color }))),
|
|
10
|
+
canDisplayLabel
|
|
11
|
+
? samples.map((sample, idx) => (React.createElement("text", { key: `${sample.id}-${idx}`, y: idx * rowHeight + rowHeight / 2, dominantBaseline: "middle", x: 2, fontSize: svgFontSize }, sample.label)))
|
|
12
|
+
: null));
|
|
13
|
+
});
|
|
14
|
+
export default ColorLegend;
|
|
15
|
+
//# sourceMappingURL=ColorLegend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorLegend.js","sourceRoot":"","sources":["../../../src/LinearMafDisplay/components/ColorLegend.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAIrC,OAAO,MAAM,MAAM,UAAU,CAAA;AAE7B,MAAM,WAAW,GAAG,QAAQ,CAAC,UAAU,EACrC,KAAK,EACL,UAAU,EACV,WAAW,GAKZ;IACC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,KAAK,CAAA;IACpC,MAAM,eAAe,GAAG,SAAS,IAAI,EAAE,CAAA;IACvC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,CAAC,CAAA;IAEzC,OAAO,CACL;QACG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,CAC5B,oBAAC,MAAM,IACL,GAAG,EAAE,GAAG,MAAM,CAAC,EAAE,IAAI,GAAG,EAAE,EAC1B,CAAC,EAAE,GAAG,GAAG,SAAS,EAClB,CAAC,EAAE,CAAC,EACJ,KAAK,EAAE,UAAU,GAAG,CAAC,EACrB,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,MAAM,CAAC,KAAK,GACnB,CACH,CAAC;QACD,eAAe;YACd,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,CAC3B,8BACE,GAAG,EAAE,GAAG,MAAM,CAAC,EAAE,IAAI,GAAG,EAAE,EAC1B,CAAC,EAAE,GAAG,GAAG,SAAS,GAAG,SAAS,GAAG,CAAC,EAClC,gBAAgB,EAAC,QAAQ,EACzB,CAAC,EAAE,CAAC,EACJ,QAAQ,EAAE,WAAW,IAEpB,MAAM,CAAC,KAAK,CACR,CACR,CAAC;YACJ,CAAC,CAAC,IAAI,CACP,CACJ,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getEnv } from '@jbrowse/core/util';
|
|
3
|
+
import { observer } from 'mobx-react';
|
|
4
|
+
import YScaleBars from './YScaleBars';
|
|
5
|
+
const LinearMafDisplay = observer(function (props) {
|
|
6
|
+
const { model } = props;
|
|
7
|
+
const { pluginManager } = getEnv(model);
|
|
8
|
+
const LinearGenomePlugin = pluginManager.getPlugin('LinearGenomeViewPlugin');
|
|
9
|
+
const { BaseLinearDisplayComponent } = LinearGenomePlugin.exports;
|
|
10
|
+
return (React.createElement("div", null,
|
|
11
|
+
React.createElement(BaseLinearDisplayComponent, { ...props }),
|
|
12
|
+
React.createElement(YScaleBars, { model: model })));
|
|
13
|
+
});
|
|
14
|
+
export default LinearMafDisplay;
|
|
15
|
+
//# sourceMappingURL=ReactComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReactComponent.js","sourceRoot":"","sources":["../../../src/LinearMafDisplay/components/ReactComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,UAAU,MAAM,cAAc,CAAA;AAGrC,MAAM,gBAAgB,GAAG,QAAQ,CAAC,UAAU,KAE3C;IACC,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAA;IACvB,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;IAEvC,MAAM,kBAAkB,GAAG,aAAa,CAAC,SAAS,CAChD,wBAAwB,CAC+B,CAAA;IACzD,MAAM,EAAE,0BAA0B,EAAE,GAAG,kBAAkB,CAAC,OAAO,CAAA;IAEjE,OAAO,CACL;QACE,oBAAC,0BAA0B,OAAK,KAAK,GAAI;QACzC,oBAAC,UAAU,IAAC,KAAK,EAAE,KAAK,GAAI,CACxB,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,gBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RectBg.js","sourceRoot":"","sources":["../../../src/LinearMafDisplay/components/RectBg.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,MAAM,GAAG,CAAC,KAMf,EAAE,EAAE;IACH,MAAM,EAAE,KAAK,GAAG,sBAAsB,EAAE,GAAG,KAAK,CAAA;IAChD,OAAO,iCAAU,KAAK,EAAE,IAAI,EAAE,KAAK,GAAI,CAAA;AACzC,CAAC,CAAA;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const SetRowHeightDialog: (props: {
|
|
3
|
+
model: {
|
|
4
|
+
rowHeight?: number;
|
|
5
|
+
rowProportion?: number;
|
|
6
|
+
setRowHeight: (arg: number) => void;
|
|
7
|
+
setRowProportion: (arg: number) => void;
|
|
8
|
+
};
|
|
9
|
+
handleClose: () => void;
|
|
10
|
+
}) => React.JSX.Element;
|
|
11
|
+
export default SetRowHeightDialog;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { observer } from 'mobx-react';
|
|
3
|
+
import { Button, DialogActions, DialogContent, TextField, Typography, } from '@mui/material';
|
|
4
|
+
import { Dialog } from '@jbrowse/core/ui';
|
|
5
|
+
import { makeStyles } from 'tss-react/mui';
|
|
6
|
+
const useStyles = makeStyles()({
|
|
7
|
+
root: {
|
|
8
|
+
width: 500,
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
const SetRowHeightDialog = observer(function (props) {
|
|
12
|
+
const { model, handleClose } = props;
|
|
13
|
+
const { classes } = useStyles();
|
|
14
|
+
const [rowHeight, setRowHeight] = useState(`${model.rowHeight}`);
|
|
15
|
+
const [rowProportion, setRowProportion] = useState(`${model.rowProportion}`);
|
|
16
|
+
return (React.createElement(Dialog, { open: true, onClose: handleClose, title: "Filter options" },
|
|
17
|
+
React.createElement(DialogContent, { className: classes.root },
|
|
18
|
+
React.createElement(Typography, null, "Set row height and the proportion of the row height to use for drawing each row"),
|
|
19
|
+
React.createElement(TextField, { value: rowHeight, onChange: event => {
|
|
20
|
+
setRowHeight(event.target.value);
|
|
21
|
+
}, placeholder: "Enter row height" }),
|
|
22
|
+
React.createElement(TextField, { value: rowProportion, onChange: event => {
|
|
23
|
+
setRowProportion(event.target.value);
|
|
24
|
+
}, placeholder: "Enter row proportion" }),
|
|
25
|
+
React.createElement(DialogActions, null,
|
|
26
|
+
React.createElement(Button, { variant: "contained", color: "primary", type: "submit", autoFocus: true, onClick: () => {
|
|
27
|
+
model.setRowProportion(+rowProportion);
|
|
28
|
+
model.setRowHeight(+rowHeight);
|
|
29
|
+
handleClose();
|
|
30
|
+
} }, "Submit"),
|
|
31
|
+
React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
32
|
+
handleClose();
|
|
33
|
+
} }, "Cancel")))));
|
|
34
|
+
});
|
|
35
|
+
export default SetRowHeightDialog;
|
|
36
|
+
//# sourceMappingURL=SetRowHeight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SetRowHeight.js","sourceRoot":"","sources":["../../../src/LinearMafDisplay/components/SetRowHeight.tsx"],"names":[],"mappings":"AAAA,O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CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;gBACtC,CAAC,EACD,WAAW,EAAC,sBAAsB,GAClC;YACF,oBAAC,aAAa;gBACZ,oBAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,SAAS,EACf,IAAI,EAAC,QAAQ,EACb,SAAS,QACT,OAAO,EAAE,GAAG,EAAE;wBACZ,KAAK,CAAC,gBAAgB,CAAC,CAAC,aAAa,CAAC,CAAA;wBACtC,KAAK,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAA;wBAC9B,WAAW,EAAE,CAAA;oBACf,CAAC,aAGM;gBACT,oBAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,WAAW,EACjB,OAAO,EAAE,GAAG,EAAE;wBACZ,WAAW,EAAE,CAAA;oBACf,CAAC,aAGM,CACK,CACF,CACT,CACV,CAAA;AACH,CAAC,CAAC,CAAA;AACF,eAAe,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LinearMafDisplayModel } from '../stateModel';
|
|
3
|
+
export declare function max(arr: number[], init?: number): number;
|
|
4
|
+
export declare const YScaleBars: (props: {
|
|
5
|
+
model: LinearMafDisplayModel;
|
|
6
|
+
orientation?: string;
|
|
7
|
+
exportSVG?: boolean;
|
|
8
|
+
}) => React.JSX.Element;
|
|
9
|
+
export default YScaleBars;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { measureText, getContainingView } from '@jbrowse/core/util';
|
|
3
|
+
import { observer } from 'mobx-react';
|
|
4
|
+
import ColorLegend from './ColorLegend';
|
|
5
|
+
const Wrapper = observer(function ({ children, model, exportSVG, }) {
|
|
6
|
+
if (exportSVG) {
|
|
7
|
+
return React.createElement(React.Fragment, null, children);
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
const { rowHeight, samples } = model;
|
|
11
|
+
return (React.createElement("svg", { style: {
|
|
12
|
+
position: 'absolute',
|
|
13
|
+
top: 0,
|
|
14
|
+
left: 0,
|
|
15
|
+
pointerEvents: 'none',
|
|
16
|
+
height: samples.length * rowHeight,
|
|
17
|
+
width: getContainingView(model).width,
|
|
18
|
+
} }, children));
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
export function max(arr, init = Number.NEGATIVE_INFINITY) {
|
|
22
|
+
let max = init;
|
|
23
|
+
for (const entry of arr) {
|
|
24
|
+
max = Math.max(entry, max);
|
|
25
|
+
}
|
|
26
|
+
return max;
|
|
27
|
+
}
|
|
28
|
+
export const YScaleBars = observer(function (props) {
|
|
29
|
+
const { model } = props;
|
|
30
|
+
const { rowHeight, samples } = model;
|
|
31
|
+
const svgFontSize = Math.min(Math.max(rowHeight, 10), 14);
|
|
32
|
+
const canDisplayLabel = rowHeight >= 10;
|
|
33
|
+
const minWidth = 20;
|
|
34
|
+
const labelWidth = max(samples
|
|
35
|
+
.map(s => measureText(s.label, svgFontSize))
|
|
36
|
+
.map(width => (canDisplayLabel ? width : minWidth)));
|
|
37
|
+
return (React.createElement(Wrapper, { ...props },
|
|
38
|
+
React.createElement(ColorLegend, { model: model, labelWidth: labelWidth, svgFontSize: svgFontSize })));
|
|
39
|
+
});
|
|
40
|
+
export default YScaleBars;
|
|
41
|
+
//# sourceMappingURL=YScaleBars.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"YScaleBars.js","sourceRoot":"","sources":["../../../src/LinearMafDisplay/components/YScaleBars.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAIrC,OAAO,WAAW,MAAM,eAAe,CAAA;AAEvC,MAAM,OAAO,GAAG,QAAQ,CAAC,UAAU,EACjC,QAAQ,EACR,KA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C,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;SAC3C,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CACtD,CAAA;IAED,OAAO,CACL,oBAAC,OAAO,OAAK,KAAK;QAChB,oBAAC,WAAW,IACV,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,GACxB,CACM,CACX,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
+
export default function configSchemaF(pluginManager: PluginManager): import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
3
|
+
/**
|
|
4
|
+
* #slot
|
|
5
|
+
*/
|
|
6
|
+
renderer: import("mobx-state-tree").IAnyModelType;
|
|
7
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
8
|
+
maxFeatureScreenDensity: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
defaultValue: number;
|
|
12
|
+
};
|
|
13
|
+
fetchSizeLimit: {
|
|
14
|
+
type: string;
|
|
15
|
+
defaultValue: number;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
height: {
|
|
19
|
+
type: string;
|
|
20
|
+
defaultValue: number;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
mouseover: {
|
|
24
|
+
type: string;
|
|
25
|
+
description: string;
|
|
26
|
+
defaultValue: string;
|
|
27
|
+
contextVariable: string[];
|
|
28
|
+
};
|
|
29
|
+
jexlFilters: {
|
|
30
|
+
type: string;
|
|
31
|
+
description: string;
|
|
32
|
+
defaultValue: never[];
|
|
33
|
+
};
|
|
34
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
+
export default function configSchemaF(pluginManager) {
|
|
3
|
+
const LinearGenomePlugin = pluginManager.getPlugin('LinearGenomeViewPlugin');
|
|
4
|
+
const { baseLinearDisplayConfigSchema } = LinearGenomePlugin.exports;
|
|
5
|
+
return ConfigurationSchema('LinearMafDisplay', {
|
|
6
|
+
/**
|
|
7
|
+
* #slot
|
|
8
|
+
*/
|
|
9
|
+
renderer: pluginManager.pluggableConfigSchemaType('renderer'),
|
|
10
|
+
}, {
|
|
11
|
+
baseConfiguration: baseLinearDisplayConfigSchema,
|
|
12
|
+
explicitlyTyped: true,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=configSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/LinearMafDisplay/configSchema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,aAA4B;IAChE,MAAM,kBAAkB,GAAG,aAAa,CAAC,SAAS,CAChD,wBAAwB,CAC+B,CAAA;IACzD,MAAM,EAAE,6BAA6B,EAAE,GAAG,kBAAkB,CAAC,OAAO,CAAA;IACpE,OAAO,mBAAmB,CACxB,kBAAkB,EAClB;QACE;;WAEG;QACH,QAAQ,EAAE,aAAa,CAAC,yBAAyB,CAAC,UAAU,CAAC;KAC9D,EACD;QACE,iBAAiB,EAAE,6BAA6B;QAChD,eAAe,EAAE,IAAI;KACtB,CACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DisplayType } from '@jbrowse/core/pluggableElementTypes';
|
|
2
|
+
import configSchemaF from './configSchema';
|
|
3
|
+
import stateModelFactory from './stateModel';
|
|
4
|
+
import ReactComponent from './components/ReactComponent';
|
|
5
|
+
export default function LinearMafDisplayF(pluginManager) {
|
|
6
|
+
pluginManager.addDisplayType(() => {
|
|
7
|
+
const configSchema = configSchemaF(pluginManager);
|
|
8
|
+
const stateModel = stateModelFactory(configSchema, pluginManager);
|
|
9
|
+
return new DisplayType({
|
|
10
|
+
name: 'LinearMafDisplay',
|
|
11
|
+
configSchema,
|
|
12
|
+
stateModel,
|
|
13
|
+
ReactComponent,
|
|
14
|
+
viewType: 'LinearGenomeView',
|
|
15
|
+
trackType: 'MafTrack',
|
|
16
|
+
displayName: 'MAF display',
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/LinearMafDisplay/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AACjE,OAAO,aAAa,MAAM,gBAAgB,CAAA;AAC1C,OAAO,iBAAiB,MAAM,cAAc,CAAA;AAC5C,OAAO,cAAc,MAAM,6BAA6B,CAAA;AAExD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,aAA4B;IACpE,aAAa,CAAC,cAAc,CAAC,GAAG,EAAE;QAChC,MAAM,YAAY,GAAG,aAAa,CAAC,aAAa,CAAC,CAAA;QACjD,MAAM,UAAU,GAAG,iBAAiB,CAAC,YAAY,EAAE,aAAa,CAAC,CAAA;QACjE,OAAO,IAAI,WAAW,CAAC;YACrB,IAAI,EAAE,kBAAkB;YACxB,YAAY;YACZ,UAAU;YACV,cAAc;YACd,QAAQ,EAAE,kBAAkB;YAC5B,SAAS,EAAE,UAAU;YACrB,WAAW,EAAE,aAAa;SAC3B,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExportSvgDisplayOptions } from '@jbrowse/plugin-linear-genome-view';
|
|
3
|
+
import { LinearMafDisplayModel } from './stateModel';
|
|
4
|
+
export declare function renderSvg(self: LinearMafDisplayModel, opts: ExportSvgDisplayOptions, superRenderSvg: (opts: ExportSvgDisplayOptions) => Promise<React.ReactNode>): Promise<React.JSX.Element>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getContainingView } from '@jbrowse/core/util';
|
|
3
|
+
import YScaleBars from './components/YScaleBars';
|
|
4
|
+
export async function renderSvg(self, opts, superRenderSvg) {
|
|
5
|
+
const { height, id } = self;
|
|
6
|
+
const { offsetPx, width } = getContainingView(self);
|
|
7
|
+
const clipid = `mafclip-${id}`;
|
|
8
|
+
return (React.createElement(React.Fragment, null,
|
|
9
|
+
React.createElement("defs", null,
|
|
10
|
+
React.createElement("clipPath", { id: clipid },
|
|
11
|
+
React.createElement("rect", { x: 0, y: 0, width: width, height: height }))),
|
|
12
|
+
React.createElement("g", { clipPath: `url(#${clipid})` },
|
|
13
|
+
React.createElement("g", { id: "snpcov" }, await superRenderSvg(opts)),
|
|
14
|
+
React.createElement("g", { transform: `translate(${Math.max(-offsetPx, 0)})` },
|
|
15
|
+
React.createElement(YScaleBars, { model: self, orientation: "left", exportSVG: true })))));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=renderSvg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderSvg.js","sourceRoot":"","sources":["../../src/LinearMafDisplay/renderSvg.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAQtD,OAAO,UAAU,MAAM,yBAAyB,CAAA;AAEhD,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,IAA2B,EAC3B,IAA6B,EAC7B,cAA2E;IAE3E,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,IAAI,CAAA;IAC3B,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,iBAAiB,CAAC,IAAI,CAA0B,CAAA;IAC5E,MAAM,MAAM,GAAG,WAAW,EAAE,EAAE,CAAA;IAC9B,OAAO,CACL;QACE;YACE,kCAAU,EAAE,EAAE,MAAM;gBAClB,8BAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAI,CACzC,CACN;QACP,2BAAG,QAAQ,EAAE,QAAQ,MAAM,GAAG;YAC5B,2BAAG,EAAE,EAAC,QAAQ,IAAE,MAAM,cAAc,CAAC,IAAI,CAAC,CAAK;YAC/C,2BAAG,SAAS,EAAE,aAAa,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,GAAG;gBAClD,oBAAC,UAAU,IAAC,KAAK,EAAE,IAAI,EAAE,WAAW,EAAC,MAAM,EAAC,SAAS,SAAG,CACtD,CACF,CACH,CACJ,CAAA;AACH,CAAC"}
|