@jbrowse/plugin-arc 2.6.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 +201 -0
- package/dist/ArcRenderer/ArcRenderer.d.ts +3 -0
- package/dist/ArcRenderer/ArcRenderer.js +10 -0
- package/dist/ArcRenderer/ArcRenderer.js.map +1 -0
- package/dist/ArcRenderer/ArcRendering.d.ts +4 -0
- package/dist/ArcRenderer/ArcRendering.js +62 -0
- package/dist/ArcRenderer/ArcRendering.js.map +1 -0
- package/dist/ArcRenderer/configSchema.d.ts +48 -0
- package/dist/ArcRenderer/configSchema.js +56 -0
- package/dist/ArcRenderer/configSchema.js.map +1 -0
- package/dist/ArcRenderer/index.d.ts +3 -0
- package/dist/ArcRenderer/index.js +17 -0
- package/dist/ArcRenderer/index.js.map +1 -0
- package/dist/LinearArcDisplay/configSchema.d.ts +32 -0
- package/dist/LinearArcDisplay/configSchema.js +25 -0
- package/dist/LinearArcDisplay/configSchema.js.map +1 -0
- package/dist/LinearArcDisplay/index.d.ts +3 -0
- package/dist/LinearArcDisplay/index.js +21 -0
- package/dist/LinearArcDisplay/index.js.map +1 -0
- package/dist/LinearArcDisplay/model.d.ts +303 -0
- package/dist/LinearArcDisplay/model.js +36 -0
- package/dist/LinearArcDisplay/model.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/esm/ArcRenderer/ArcRenderer.d.ts +3 -0
- package/esm/ArcRenderer/ArcRenderer.js +4 -0
- package/esm/ArcRenderer/ArcRenderer.js.map +1 -0
- package/esm/ArcRenderer/ArcRendering.d.ts +4 -0
- package/esm/ArcRenderer/ArcRendering.js +57 -0
- package/esm/ArcRenderer/ArcRendering.js.map +1 -0
- package/esm/ArcRenderer/configSchema.d.ts +48 -0
- package/esm/ArcRenderer/configSchema.js +54 -0
- package/esm/ArcRenderer/configSchema.js.map +1 -0
- package/esm/ArcRenderer/index.d.ts +3 -0
- package/esm/ArcRenderer/index.js +12 -0
- package/esm/ArcRenderer/index.js.map +1 -0
- package/esm/LinearArcDisplay/configSchema.d.ts +32 -0
- package/esm/LinearArcDisplay/configSchema.js +21 -0
- package/esm/LinearArcDisplay/configSchema.js.map +1 -0
- package/esm/LinearArcDisplay/index.d.ts +3 -0
- package/esm/LinearArcDisplay/index.js +19 -0
- package/esm/LinearArcDisplay/index.js.map +1 -0
- package/esm/LinearArcDisplay/model.d.ts +303 -0
- package/esm/LinearArcDisplay/model.js +32 -0
- package/esm/LinearArcDisplay/model.js.map +1 -0
- package/esm/index.d.ts +6 -0
- package/esm/index.js +17 -0
- package/esm/index.js.map +1 -0
- package/package.json +61 -0
- package/src/ArcRenderer/ArcRenderer.ts +3 -0
- package/src/ArcRenderer/ArcRendering.test.tsx +45 -0
- package/src/ArcRenderer/ArcRendering.tsx +131 -0
- package/src/ArcRenderer/__snapshots__/ArcRendering.test.tsx.snap +40 -0
- package/src/ArcRenderer/configSchema.ts +60 -0
- package/src/ArcRenderer/index.ts +17 -0
- package/src/LinearArcDisplay/configSchema.ts +29 -0
- package/src/LinearArcDisplay/index.ts +21 -0
- package/src/LinearArcDisplay/model.ts +40 -0
- package/src/declare.d.ts +1 -0
- package/src/index.ts +20 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DisplayType } from '@jbrowse/core/pluggableElementTypes';
|
|
2
|
+
import { BaseLinearDisplayComponent } from '@jbrowse/plugin-linear-genome-view';
|
|
3
|
+
import { configSchemaFactory } from './configSchema';
|
|
4
|
+
import { stateModelFactory } from './model';
|
|
5
|
+
export default (pluginManager) => {
|
|
6
|
+
pluginManager.addDisplayType(() => {
|
|
7
|
+
const configSchema = configSchemaFactory(pluginManager);
|
|
8
|
+
return new DisplayType({
|
|
9
|
+
name: 'LinearArcDisplay',
|
|
10
|
+
displayName: 'Arc display',
|
|
11
|
+
configSchema,
|
|
12
|
+
stateModel: stateModelFactory(configSchema),
|
|
13
|
+
trackType: 'FeatureTrack',
|
|
14
|
+
viewType: 'LinearGenomeView',
|
|
15
|
+
ReactComponent: BaseLinearDisplayComponent,
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/LinearArcDisplay/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAA;AAE/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAE3C,eAAe,CAAC,aAA4B,EAAE,EAAE;IAC9C,aAAa,CAAC,cAAc,CAAC,GAAG,EAAE;QAChC,MAAM,YAAY,GAAG,mBAAmB,CAAC,aAAa,CAAC,CAAA;QACvD,OAAO,IAAI,WAAW,CAAC;YACrB,IAAI,EAAE,kBAAkB;YACxB,WAAW,EAAE,aAAa;YAC1B,YAAY;YACZ,UAAU,EAAE,iBAAiB,CAAC,YAAY,CAAC;YAC3C,SAAS,EAAE,cAAc;YACzB,QAAQ,EAAE,kBAAkB;YAC5B,cAAc,EAAE,0BAA0B;SAC3C,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
|
|
3
|
+
export declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): import("mobx-state-tree").IModelType<{
|
|
4
|
+
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
5
|
+
type: import("mobx-state-tree").ISimpleType<string>;
|
|
6
|
+
rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
7
|
+
} & {
|
|
8
|
+
heightPreConfig: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
9
|
+
} & {
|
|
10
|
+
userBpPerPxLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
11
|
+
userByteSizeLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
12
|
+
} & {
|
|
13
|
+
blockState: import("mobx-state-tree").IMapType<import("mobx-state-tree").IModelType<{
|
|
14
|
+
key: import("mobx-state-tree").ISimpleType<string>;
|
|
15
|
+
region: import("mobx-state-tree").IModelType<{
|
|
16
|
+
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
17
|
+
start: import("mobx-state-tree").ISimpleType<number>;
|
|
18
|
+
end: import("mobx-state-tree").ISimpleType<number>;
|
|
19
|
+
reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
20
|
+
} & {
|
|
21
|
+
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
22
|
+
}, {
|
|
23
|
+
setRefName(newRefName: string): void;
|
|
24
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
25
|
+
reloadFlag: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
26
|
+
isLeftEndOfDisplayedRegion: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
27
|
+
isRightEndOfDisplayedRegion: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
28
|
+
}, {
|
|
29
|
+
renderInProgress: AbortController | undefined;
|
|
30
|
+
filled: boolean;
|
|
31
|
+
reactElement: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
32
|
+
features: Map<string, import("@jbrowse/core/util").Feature> | undefined;
|
|
33
|
+
layout: any;
|
|
34
|
+
status: string;
|
|
35
|
+
error: unknown;
|
|
36
|
+
message: string | undefined;
|
|
37
|
+
maxHeightReached: boolean;
|
|
38
|
+
ReactComponent: ({ model, }: {
|
|
39
|
+
model: any;
|
|
40
|
+
}) => any;
|
|
41
|
+
renderProps: any;
|
|
42
|
+
} & {
|
|
43
|
+
doReload(): void;
|
|
44
|
+
afterAttach(): void;
|
|
45
|
+
setStatus(message: string): void;
|
|
46
|
+
setLoading(abortController: AbortController): void;
|
|
47
|
+
setMessage(messageText: string): void;
|
|
48
|
+
setRendered(props: {
|
|
49
|
+
reactElement: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
50
|
+
features: Map<string, import("@jbrowse/core/util").Feature>;
|
|
51
|
+
layout: any;
|
|
52
|
+
maxHeightReached: boolean;
|
|
53
|
+
renderProps: any;
|
|
54
|
+
} | undefined): void;
|
|
55
|
+
setError(error: unknown): void;
|
|
56
|
+
reload(): void;
|
|
57
|
+
beforeDestroy(): void;
|
|
58
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
59
|
+
configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
60
|
+
maxFeatureScreenDensity: {
|
|
61
|
+
type: string;
|
|
62
|
+
description: string;
|
|
63
|
+
defaultValue: number;
|
|
64
|
+
};
|
|
65
|
+
fetchSizeLimit: {
|
|
66
|
+
type: string;
|
|
67
|
+
defaultValue: number;
|
|
68
|
+
description: string;
|
|
69
|
+
};
|
|
70
|
+
height: {
|
|
71
|
+
type: string;
|
|
72
|
+
defaultValue: number;
|
|
73
|
+
description: string;
|
|
74
|
+
};
|
|
75
|
+
mouseover: {
|
|
76
|
+
type: string;
|
|
77
|
+
description: string;
|
|
78
|
+
defaultValue: string;
|
|
79
|
+
contextVariable: string[];
|
|
80
|
+
};
|
|
81
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
|
|
82
|
+
} & {
|
|
83
|
+
type: import("mobx-state-tree").ISimpleType<"LinearArcDisplay">;
|
|
84
|
+
configuration: AnyConfigurationSchemaType;
|
|
85
|
+
}, {
|
|
86
|
+
rendererTypeName: string;
|
|
87
|
+
error: unknown;
|
|
88
|
+
message: string | undefined;
|
|
89
|
+
} & {
|
|
90
|
+
readonly RenderingComponent: import("react").FC<{
|
|
91
|
+
model: {
|
|
92
|
+
id: string;
|
|
93
|
+
type: string;
|
|
94
|
+
rpcDriverName: string | undefined;
|
|
95
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
96
|
+
rendererTypeName: string;
|
|
97
|
+
error: unknown;
|
|
98
|
+
message: string | undefined;
|
|
99
|
+
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
100
|
+
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
101
|
+
type: import("mobx-state-tree").ISimpleType<string>;
|
|
102
|
+
rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
103
|
+
}, {
|
|
104
|
+
rendererTypeName: string;
|
|
105
|
+
error: unknown;
|
|
106
|
+
message: string | undefined;
|
|
107
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
108
|
+
onHorizontalScroll?: Function | undefined;
|
|
109
|
+
blockState?: Record<string, any> | undefined;
|
|
110
|
+
}>;
|
|
111
|
+
readonly DisplayBlurb: import("react").FC<{
|
|
112
|
+
model: {
|
|
113
|
+
id: string;
|
|
114
|
+
type: string;
|
|
115
|
+
rpcDriverName: string | undefined;
|
|
116
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
117
|
+
rendererTypeName: string;
|
|
118
|
+
error: unknown;
|
|
119
|
+
message: string | undefined;
|
|
120
|
+
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
121
|
+
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
122
|
+
type: import("mobx-state-tree").ISimpleType<string>;
|
|
123
|
+
rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
124
|
+
}, {
|
|
125
|
+
rendererTypeName: string;
|
|
126
|
+
error: unknown;
|
|
127
|
+
message: string | undefined;
|
|
128
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
129
|
+
}> | null;
|
|
130
|
+
readonly adapterConfig: any;
|
|
131
|
+
readonly parentTrack: any;
|
|
132
|
+
renderProps(): any;
|
|
133
|
+
readonly rendererType: import("@jbrowse/core/pluggableElementTypes").RendererType;
|
|
134
|
+
readonly DisplayMessageComponent: import("react").FC<any> | undefined;
|
|
135
|
+
trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
136
|
+
readonly viewMenuActions: import("@jbrowse/core/ui").MenuItem[];
|
|
137
|
+
regionCannotBeRendered(): null;
|
|
138
|
+
} & {
|
|
139
|
+
setMessage(arg?: string | undefined): void;
|
|
140
|
+
setError(error?: unknown): void;
|
|
141
|
+
setRpcDriverName(rpcDriverName: string): void;
|
|
142
|
+
reload(): void;
|
|
143
|
+
} & {
|
|
144
|
+
scrollTop: number;
|
|
145
|
+
} & {
|
|
146
|
+
readonly height: number;
|
|
147
|
+
} & {
|
|
148
|
+
setScrollTop(scrollTop: number): void;
|
|
149
|
+
setHeight(displayHeight: number): number;
|
|
150
|
+
resizeHeight(distance: number): number;
|
|
151
|
+
} & {
|
|
152
|
+
featureDensityStatsP: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats> | undefined;
|
|
153
|
+
featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined;
|
|
154
|
+
currStatsBpPerPx: number;
|
|
155
|
+
} & {
|
|
156
|
+
readonly currentBytesRequested: number;
|
|
157
|
+
readonly currentFeatureScreenDensity: number;
|
|
158
|
+
readonly maxFeatureScreenDensity: any;
|
|
159
|
+
readonly featureDensityStatsReady: boolean;
|
|
160
|
+
readonly maxAllowableBytes: number;
|
|
161
|
+
} & {
|
|
162
|
+
afterAttach(): void;
|
|
163
|
+
} & {
|
|
164
|
+
setCurrStatsBpPerPx(n: number): void;
|
|
165
|
+
setFeatureDensityStatsLimit(stats?: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined): void;
|
|
166
|
+
getFeatureDensityStats(): Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats>;
|
|
167
|
+
setFeatureDensityStatsP(arg: any): void;
|
|
168
|
+
setFeatureDensityStats(featureDensityStats?: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined): void;
|
|
169
|
+
clearFeatureDensityStats(): void;
|
|
170
|
+
} & {
|
|
171
|
+
readonly regionTooLarge: boolean;
|
|
172
|
+
readonly regionTooLargeReason: string;
|
|
173
|
+
} & {
|
|
174
|
+
regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
|
|
175
|
+
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react").JSX.Element | null;
|
|
176
|
+
} & {
|
|
177
|
+
featureIdUnderMouse: string | undefined;
|
|
178
|
+
contextMenuFeature: import("@jbrowse/core/util").Feature | undefined;
|
|
179
|
+
} & {
|
|
180
|
+
readonly blockType: "dynamicBlocks" | "staticBlocks";
|
|
181
|
+
readonly blockDefinitions: import("@jbrowse/core/util/blockTypes").BlockSet;
|
|
182
|
+
} & {
|
|
183
|
+
readonly renderDelay: number;
|
|
184
|
+
readonly TooltipComponent: import("react").FC<any>;
|
|
185
|
+
readonly selectedFeatureId: string | undefined;
|
|
186
|
+
readonly DisplayMessageComponent: import("react").FC<any> | undefined;
|
|
187
|
+
} & {
|
|
188
|
+
readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util").Feature>;
|
|
189
|
+
readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
|
|
190
|
+
getFeatureOverlapping(blockKey: string, x: number, y: number): string | undefined;
|
|
191
|
+
getFeatureByID(blockKey: string, id: string): [number, number, number, number] | undefined;
|
|
192
|
+
searchFeatureByID(id: string): [number, number, number, number] | undefined;
|
|
193
|
+
} & {
|
|
194
|
+
addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
|
|
195
|
+
deleteBlock(key: string): void;
|
|
196
|
+
selectFeature(feature: import("@jbrowse/core/util").Feature): void;
|
|
197
|
+
clearFeatureSelection(): void;
|
|
198
|
+
setFeatureIdUnderMouse(feature?: string | undefined): void;
|
|
199
|
+
setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature | undefined): void;
|
|
200
|
+
} & {
|
|
201
|
+
reload(): Promise<void>;
|
|
202
|
+
} & {
|
|
203
|
+
trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
204
|
+
contextMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
205
|
+
renderProps(): any;
|
|
206
|
+
} & {
|
|
207
|
+
renderSvg(opts: import("@jbrowse/plugin-linear-genome-view").ExportSvgDisplayOptions): Promise<import("react").JSX.Element>;
|
|
208
|
+
afterAttach(): void;
|
|
209
|
+
} & {
|
|
210
|
+
readonly blockType: string;
|
|
211
|
+
readonly renderDelay: number;
|
|
212
|
+
renderProps(): any;
|
|
213
|
+
readonly rendererTypeName: any;
|
|
214
|
+
}, {
|
|
215
|
+
type: string;
|
|
216
|
+
} & Partial<import("mobx-state-tree/dist/internal").ExtractCFromProps<{
|
|
217
|
+
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
218
|
+
type: import("mobx-state-tree").ISimpleType<string>;
|
|
219
|
+
rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
220
|
+
} & {
|
|
221
|
+
heightPreConfig: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
222
|
+
} & {
|
|
223
|
+
userBpPerPxLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
224
|
+
userByteSizeLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
225
|
+
} & {
|
|
226
|
+
blockState: import("mobx-state-tree").IMapType<import("mobx-state-tree").IModelType<{
|
|
227
|
+
key: import("mobx-state-tree").ISimpleType<string>;
|
|
228
|
+
region: import("mobx-state-tree").IModelType<{
|
|
229
|
+
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
230
|
+
start: import("mobx-state-tree").ISimpleType<number>;
|
|
231
|
+
end: import("mobx-state-tree").ISimpleType<number>;
|
|
232
|
+
reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
233
|
+
} & {
|
|
234
|
+
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
235
|
+
}, {
|
|
236
|
+
setRefName(newRefName: string): void;
|
|
237
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
238
|
+
reloadFlag: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
239
|
+
isLeftEndOfDisplayedRegion: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
240
|
+
isRightEndOfDisplayedRegion: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
241
|
+
}, {
|
|
242
|
+
renderInProgress: AbortController | undefined;
|
|
243
|
+
filled: boolean;
|
|
244
|
+
reactElement: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
245
|
+
features: Map<string, import("@jbrowse/core/util").Feature> | undefined;
|
|
246
|
+
layout: any;
|
|
247
|
+
status: string;
|
|
248
|
+
error: unknown;
|
|
249
|
+
message: string | undefined;
|
|
250
|
+
maxHeightReached: boolean;
|
|
251
|
+
ReactComponent: ({ model, }: {
|
|
252
|
+
model: any;
|
|
253
|
+
}) => any;
|
|
254
|
+
renderProps: any;
|
|
255
|
+
} & {
|
|
256
|
+
doReload(): void;
|
|
257
|
+
afterAttach(): void;
|
|
258
|
+
setStatus(message: string): void;
|
|
259
|
+
setLoading(abortController: AbortController): void;
|
|
260
|
+
setMessage(messageText: string): void;
|
|
261
|
+
setRendered(props: {
|
|
262
|
+
reactElement: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
263
|
+
features: Map<string, import("@jbrowse/core/util").Feature>;
|
|
264
|
+
layout: any;
|
|
265
|
+
maxHeightReached: boolean;
|
|
266
|
+
renderProps: any;
|
|
267
|
+
} | undefined): void;
|
|
268
|
+
setError(error: unknown): void;
|
|
269
|
+
reload(): void;
|
|
270
|
+
beforeDestroy(): void;
|
|
271
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
272
|
+
configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
273
|
+
maxFeatureScreenDensity: {
|
|
274
|
+
type: string;
|
|
275
|
+
description: string;
|
|
276
|
+
defaultValue: number;
|
|
277
|
+
};
|
|
278
|
+
fetchSizeLimit: {
|
|
279
|
+
type: string;
|
|
280
|
+
defaultValue: number;
|
|
281
|
+
description: string;
|
|
282
|
+
};
|
|
283
|
+
height: {
|
|
284
|
+
type: string;
|
|
285
|
+
defaultValue: number;
|
|
286
|
+
description: string;
|
|
287
|
+
};
|
|
288
|
+
mouseover: {
|
|
289
|
+
type: string;
|
|
290
|
+
description: string;
|
|
291
|
+
defaultValue: string;
|
|
292
|
+
contextVariable: string[];
|
|
293
|
+
};
|
|
294
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
|
|
295
|
+
}>> & import("mobx-state-tree/dist/internal").NonEmptyObject & import("mobx-state-tree")._NotCustomized, {
|
|
296
|
+
type: string;
|
|
297
|
+
id: string;
|
|
298
|
+
configuration: import("mobx-state-tree").ModelSnapshotType<Record<string, any>>;
|
|
299
|
+
rpcDriverName: string | undefined;
|
|
300
|
+
heightPreConfig: number | undefined;
|
|
301
|
+
userBpPerPxLimit: number | undefined;
|
|
302
|
+
userByteSizeLimit: number | undefined;
|
|
303
|
+
} & import("mobx-state-tree")._NotCustomized>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ConfigurationReference, } from '@jbrowse/core/configuration';
|
|
2
|
+
import { types } from 'mobx-state-tree';
|
|
3
|
+
import { BaseLinearDisplay } from '@jbrowse/plugin-linear-genome-view';
|
|
4
|
+
export function stateModelFactory(configSchema) {
|
|
5
|
+
return types
|
|
6
|
+
.compose('LinearArcDisplay', BaseLinearDisplay, types.model({
|
|
7
|
+
type: types.literal('LinearArcDisplay'),
|
|
8
|
+
configuration: ConfigurationReference(configSchema),
|
|
9
|
+
}))
|
|
10
|
+
.views(self => {
|
|
11
|
+
const { renderProps: superRenderProps } = self;
|
|
12
|
+
return {
|
|
13
|
+
get blockType() {
|
|
14
|
+
return 'staticBlocks';
|
|
15
|
+
},
|
|
16
|
+
get renderDelay() {
|
|
17
|
+
return 500;
|
|
18
|
+
},
|
|
19
|
+
renderProps() {
|
|
20
|
+
return {
|
|
21
|
+
...superRenderProps(),
|
|
22
|
+
rpcDriverName: self.rpcDriverName,
|
|
23
|
+
config: self.configuration.renderer,
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
get rendererTypeName() {
|
|
27
|
+
return self.configuration.renderer.type;
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/LinearArcDisplay/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,sBAAsB,GACvB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAEtE,MAAM,UAAU,iBAAiB,CAAC,YAAwC;IACxE,OAAO,KAAK;SACT,OAAO,CACN,kBAAkB,EAClB,iBAAiB,EACjB,KAAK,CAAC,KAAK,CAAC;QACV,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC;QACvC,aAAa,EAAE,sBAAsB,CAAC,YAAY,CAAC;KACpD,CAAC,CACH;SAEA,KAAK,CAAC,IAAI,CAAC,EAAE;QACZ,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAA;QAC9C,OAAO;YACL,IAAI,SAAS;gBACX,OAAO,cAAc,CAAA;YACvB,CAAC;YACD,IAAI,WAAW;gBACb,OAAO,GAAG,CAAA;YACZ,CAAC;YACD,WAAW;gBACT,OAAO;oBACL,GAAG,gBAAgB,EAAE;oBACrB,aAAa,EAAE,IAAI,CAAC,aAAa;oBACjC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ;iBACpC,CAAA;YACH,CAAC;YACD,IAAI,gBAAgB;gBAClB,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAA;YACzC,CAAC;SACF,CAAA;IACH,CAAC,CAAC,CAAA;AACN,CAAC"}
|
package/esm/index.d.ts
ADDED
package/esm/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Plugin from '@jbrowse/core/Plugin';
|
|
2
|
+
import LinearArcDisplayF from './LinearArcDisplay';
|
|
3
|
+
import ArcRendererF from './ArcRenderer';
|
|
4
|
+
export default class ArcPlugin extends Plugin {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.name = 'ArcRenderer';
|
|
8
|
+
}
|
|
9
|
+
install(pluginManager) {
|
|
10
|
+
ArcRendererF(pluginManager);
|
|
11
|
+
LinearArcDisplayF(pluginManager);
|
|
12
|
+
pluginManager.jexl.addFunction('logThickness', (feature, attributeName) => {
|
|
13
|
+
return Math.log(feature.get(attributeName) + 1);
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,sBAAsB,CAAA;AAEzC,OAAO,iBAAiB,MAAM,oBAAoB,CAAA;AAClD,OAAO,YAAY,MAAM,eAAe,CAAA;AAGxC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,MAAM;IAA7C;;QACE,SAAI,GAAG,aAAa,CAAA;IAYtB,CAAC;IAXC,OAAO,CAAC,aAA4B;QAClC,YAAY,CAAC,aAAa,CAAC,CAAA;QAC3B,iBAAiB,CAAC,aAAa,CAAC,CAAA;QAEhC,aAAa,CAAC,IAAI,CAAC,WAAW,CAC5B,cAAc,EACd,CAAC,OAAgB,EAAE,aAAqB,EAAE,EAAE;YAC1C,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAA;QACjD,CAAC,CACF,CAAA;IACH,CAAC;CACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jbrowse/plugin-arc",
|
|
3
|
+
"version": "2.6.1",
|
|
4
|
+
"description": "JBrowse 2 arc adapters, tracks, etc.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"jbrowse",
|
|
7
|
+
"jbrowse2"
|
|
8
|
+
],
|
|
9
|
+
"license": "Apache-2.0",
|
|
10
|
+
"homepage": "https://jbrowse.org",
|
|
11
|
+
"bugs": "https://github.com/GMOD/jbrowse-components/issues",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/GMOD/jbrowse-components.git",
|
|
15
|
+
"directory": "plugins/arc"
|
|
16
|
+
},
|
|
17
|
+
"author": "JBrowse Team",
|
|
18
|
+
"distMain": "dist/index.js",
|
|
19
|
+
"srcMain": "src/index.ts",
|
|
20
|
+
"main": "dist/index.js",
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"src",
|
|
24
|
+
"esm"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "npm-run-all build:*",
|
|
28
|
+
"test": "cd ../..; jest plugins/arc",
|
|
29
|
+
"prepublishOnly": "yarn test",
|
|
30
|
+
"prepack": "yarn build && yarn useDist",
|
|
31
|
+
"postpack": "yarn useSrc",
|
|
32
|
+
"useDist": "node ../../scripts/useDist.js",
|
|
33
|
+
"useSrc": "node ../../scripts/useSrc.js",
|
|
34
|
+
"prebuild": "npm run clean",
|
|
35
|
+
"build:esm": "tsc --build tsconfig.build.esm.json",
|
|
36
|
+
"build:es5": "tsc --build tsconfig.build.es5.json",
|
|
37
|
+
"clean": "rimraf dist esm *.tsbuildinfo"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"react-svg-tooltip": "^0.0.11"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"@jbrowse/core": "^2.0.0",
|
|
44
|
+
"@jbrowse/plugin-linear-genome-view": "^2.0.0",
|
|
45
|
+
"@jbrowse/plugin-wiggle": "^2.0.0",
|
|
46
|
+
"@mui/material": "^5.0.0",
|
|
47
|
+
"mobx": "^6.0.0",
|
|
48
|
+
"mobx-react": "^7.0.0",
|
|
49
|
+
"mobx-state-tree": "^5.0.0",
|
|
50
|
+
"react": ">=16.8.0",
|
|
51
|
+
"react-dom": ">=16.8.0",
|
|
52
|
+
"rxjs": "^7.0.0"
|
|
53
|
+
},
|
|
54
|
+
"distModule": "esm/index.js",
|
|
55
|
+
"srcModule": "src/index.ts",
|
|
56
|
+
"module": "esm/index.js",
|
|
57
|
+
"publishConfig": {
|
|
58
|
+
"access": "public"
|
|
59
|
+
},
|
|
60
|
+
"gitHead": "1cbe7ba097fb2d2763c776e5e429e4670cdd583c"
|
|
61
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import SimpleFeature from '@jbrowse/core/util/simpleFeature'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { render } from '@testing-library/react'
|
|
4
|
+
import Rendering from './ArcRendering'
|
|
5
|
+
|
|
6
|
+
test('no features', () => {
|
|
7
|
+
const { container } = render(
|
|
8
|
+
<Rendering
|
|
9
|
+
width={500}
|
|
10
|
+
height={500}
|
|
11
|
+
regions={[{ refName: 'zonk', start: 0, end: 300 }]}
|
|
12
|
+
blockKey={1}
|
|
13
|
+
config={{}}
|
|
14
|
+
bpPerPx={3}
|
|
15
|
+
displayModel={{}}
|
|
16
|
+
features={new Map()}
|
|
17
|
+
/>,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
expect(container.firstChild).toMatchSnapshot()
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
test('one feature', () => {
|
|
24
|
+
const { container } = render(
|
|
25
|
+
<Rendering
|
|
26
|
+
width={500}
|
|
27
|
+
height={500}
|
|
28
|
+
regions={[{ refName: 'zonk', start: 0, end: 1000 }]}
|
|
29
|
+
blockKey={1}
|
|
30
|
+
features={
|
|
31
|
+
new Map([
|
|
32
|
+
[
|
|
33
|
+
'one',
|
|
34
|
+
new SimpleFeature({ uniqueId: 'one', score: 10, start: 1, end: 3 }),
|
|
35
|
+
],
|
|
36
|
+
])
|
|
37
|
+
}
|
|
38
|
+
config={{ type: 'DummyRenderer' }}
|
|
39
|
+
bpPerPx={3}
|
|
40
|
+
displayModel={{}}
|
|
41
|
+
/>,
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
expect(container.firstChild).toMatchSnapshot()
|
|
45
|
+
})
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { readConfObject } from '@jbrowse/core/configuration'
|
|
3
|
+
import { bpSpanPx, measureText } from '@jbrowse/core/util'
|
|
4
|
+
import { observer } from 'mobx-react'
|
|
5
|
+
import { Tooltip } from 'react-svg-tooltip'
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
|
+
function ArcRendering(props: any) {
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
+
const onClick = (event: any, id: any) => {
|
|
11
|
+
const { onFeatureClick: handler } = props
|
|
12
|
+
if (!handler) {
|
|
13
|
+
return undefined
|
|
14
|
+
}
|
|
15
|
+
return handler(event, id)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const {
|
|
19
|
+
features,
|
|
20
|
+
config,
|
|
21
|
+
regions,
|
|
22
|
+
blockKey,
|
|
23
|
+
bpPerPx,
|
|
24
|
+
displayModel: { selectedFeatureId },
|
|
25
|
+
} = props
|
|
26
|
+
const [region] = regions
|
|
27
|
+
const arcsRendered = []
|
|
28
|
+
|
|
29
|
+
for (const feature of features.values()) {
|
|
30
|
+
const [left, right] = bpSpanPx(
|
|
31
|
+
feature.get('start'),
|
|
32
|
+
feature.get('end'),
|
|
33
|
+
region,
|
|
34
|
+
bpPerPx,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
const featureId = feature.id()
|
|
38
|
+
const id = blockKey + '-' + featureId
|
|
39
|
+
let stroke = readConfObject(config, 'color', { feature })
|
|
40
|
+
let textStroke = 'black'
|
|
41
|
+
if (
|
|
42
|
+
selectedFeatureId &&
|
|
43
|
+
String(selectedFeatureId) === String(feature.id())
|
|
44
|
+
) {
|
|
45
|
+
stroke = textStroke = 'red'
|
|
46
|
+
}
|
|
47
|
+
const label = readConfObject(config, 'label', { feature })
|
|
48
|
+
const caption = readConfObject(config, 'caption', { feature })
|
|
49
|
+
const strokeWidth = readConfObject(config, 'thickness', { feature }) || 1
|
|
50
|
+
const height = readConfObject(config, 'height', { feature }) || 100
|
|
51
|
+
const ref = React.createRef<SVGPathElement>()
|
|
52
|
+
const tooltipWidth = 20 + measureText(caption?.toString())
|
|
53
|
+
|
|
54
|
+
const t = 0.5
|
|
55
|
+
// formula: https://en.wikipedia.org/wiki/B%C3%A9zier_curve#Cubic_B%C3%A9zier_curves
|
|
56
|
+
const textYCoord =
|
|
57
|
+
(1 - t) * (1 - t) * (1 - t) * 0 +
|
|
58
|
+
3 * ((1 - t) * (1 - t)) * (t * height) +
|
|
59
|
+
3 * (1 - t) * (t * t) * height +
|
|
60
|
+
t * t * t * 0
|
|
61
|
+
|
|
62
|
+
arcsRendered.push(
|
|
63
|
+
<g key={id} onClick={e => onClick(e, featureId)}>
|
|
64
|
+
<path
|
|
65
|
+
id={id}
|
|
66
|
+
d={`M ${left} 0 C ${left} ${height}, ${right} ${height}, ${right} 0`}
|
|
67
|
+
stroke={stroke}
|
|
68
|
+
strokeWidth={strokeWidth}
|
|
69
|
+
fill="transparent"
|
|
70
|
+
onClick={e => onClick(e, featureId)}
|
|
71
|
+
ref={ref}
|
|
72
|
+
pointerEvents="stroke"
|
|
73
|
+
/>
|
|
74
|
+
<Tooltip triggerRef={ref}>
|
|
75
|
+
<rect
|
|
76
|
+
x={12}
|
|
77
|
+
y={0}
|
|
78
|
+
width={tooltipWidth}
|
|
79
|
+
height={20}
|
|
80
|
+
rx={5}
|
|
81
|
+
ry={5}
|
|
82
|
+
fill="black"
|
|
83
|
+
fillOpacity="50%"
|
|
84
|
+
/>
|
|
85
|
+
<text
|
|
86
|
+
x={22}
|
|
87
|
+
y={14}
|
|
88
|
+
fontSize={10}
|
|
89
|
+
fill="white"
|
|
90
|
+
textLength={tooltipWidth - 20}
|
|
91
|
+
>
|
|
92
|
+
{caption}
|
|
93
|
+
</text>
|
|
94
|
+
</Tooltip>
|
|
95
|
+
<text
|
|
96
|
+
x={left + (right - left) / 2}
|
|
97
|
+
y={textYCoord + 3}
|
|
98
|
+
style={{ stroke: 'white', strokeWidth: '0.6em' }}
|
|
99
|
+
>
|
|
100
|
+
{label}
|
|
101
|
+
</text>
|
|
102
|
+
<text
|
|
103
|
+
x={left + (right - left) / 2}
|
|
104
|
+
y={textYCoord + 3}
|
|
105
|
+
style={{ stroke: textStroke }}
|
|
106
|
+
>
|
|
107
|
+
{label}
|
|
108
|
+
</text>
|
|
109
|
+
</g>,
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const width = (region.end - region.start) / bpPerPx
|
|
114
|
+
const height = 500
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<svg
|
|
118
|
+
className="ArcRendering"
|
|
119
|
+
width={width}
|
|
120
|
+
height={height}
|
|
121
|
+
style={{
|
|
122
|
+
outline: 'none',
|
|
123
|
+
position: 'relative',
|
|
124
|
+
}}
|
|
125
|
+
>
|
|
126
|
+
{arcsRendered}
|
|
127
|
+
</svg>
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export default observer(ArcRendering)
|