@weng-lab/genomebrowser 0.0.1 → 0.0.3
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 +115 -40
- package/dist/components/browser/browser.d.ts +9 -0
- package/dist/components/browser/gqltracks.d.ts +13 -0
- package/dist/components/browser/index.d.ts +2 -0
- package/dist/components/browser/menuWrapper.d.ts +16 -0
- package/dist/components/browser/selectRegion.d.ts +12 -0
- package/dist/components/browser/stacked.d.ts +8 -0
- package/dist/components/browser/stackedtracks.d.ts +8 -0
- package/dist/components/browser/svgWrapper.d.ts +8 -0
- package/dist/components/browser/types.d.ts +55 -0
- package/dist/components/browser/utils.d.ts +1 -0
- package/dist/components/clipPath/clipPath.d.ts +14 -0
- package/dist/components/context/browserContext.d.ts +113 -0
- package/dist/components/context/domainContext.d.ts +9 -0
- package/dist/components/context/providers.d.ts +21 -0
- package/dist/components/controls/custombigwig.d.ts +4 -0
- package/dist/components/controls/index.d.ts +6 -0
- package/dist/components/controls/inputregion.d.ts +4 -0
- package/dist/components/controls/shiftbutton.d.ts +4 -0
- package/dist/components/controls/types.d.ts +33 -0
- package/dist/components/controls/ucsc.d.ts +4 -0
- package/dist/components/controls/zoombutton.d.ts +4 -0
- package/dist/components/cytobands/centromere.d.ts +4 -0
- package/dist/components/cytobands/cytoband.d.ts +4 -0
- package/dist/components/cytobands/cytobands.d.ts +4 -0
- package/dist/components/cytobands/highlight.d.ts +4 -0
- package/dist/components/cytobands/index.d.ts +3 -0
- package/dist/components/cytobands/shorthighlight.d.ts +4 -0
- package/dist/components/cytobands/types.d.ts +61 -0
- package/dist/components/icons/error.d.ts +9 -0
- package/dist/components/icons/index.d.ts +3 -0
- package/dist/components/icons/settings.d.ts +3 -0
- package/dist/components/icons/spinner.d.ts +9 -0
- package/dist/components/icons/top.d.ts +2 -0
- package/dist/components/icons/types.d.ts +12 -0
- package/dist/components/magnification/index.d.ts +2 -0
- package/dist/components/magnification/magnification.d.ts +13 -0
- package/dist/components/menu/browserContextMenu.d.ts +10 -0
- package/dist/components/menu/contextMenu.d.ts +6 -0
- package/dist/components/menu/types.d.ts +22 -0
- package/dist/components/modal/forms/form.d.ts +3 -0
- package/dist/components/modal/forms/heightForm.d.ts +4 -0
- package/dist/components/modal/forms/rangeForm.d.ts +5 -0
- package/dist/components/modal/forms/transcriptForm.d.ts +4 -0
- package/dist/components/modal/forms/universalForm.d.ts +4 -0
- package/dist/components/modal/modal.d.ts +1 -0
- package/dist/components/modal/styles.d.ts +25 -0
- package/dist/components/tooltip/tooltip.d.ts +4 -0
- package/dist/components/tooltip/tooltipcontext.d.ts +4 -0
- package/dist/components/tooltip/types.d.ts +20 -0
- package/dist/components/tracks/bam/bam.d.ts +23 -0
- package/dist/components/tracks/bam/dense.d.ts +4 -0
- package/dist/components/tracks/bam/index.d.ts +4 -0
- package/dist/components/tracks/bam/squish.d.ts +9 -0
- package/dist/components/tracks/bam/types.d.ts +37 -0
- package/dist/components/tracks/bam/utils.d.ts +9 -0
- package/dist/components/tracks/bigbed/bigbed.d.ts +37 -0
- package/dist/components/tracks/bigbed/dense.d.ts +22 -0
- package/dist/components/tracks/bigbed/index.d.ts +4 -0
- package/dist/components/tracks/bigbed/squish.d.ts +27 -0
- package/dist/components/tracks/bigbed/tooltip.d.ts +4 -0
- package/dist/components/tracks/bigbed/types.d.ts +14 -0
- package/dist/components/tracks/bigbed/utils.d.ts +8 -0
- package/dist/components/tracks/bigwig/bigwig.d.ts +37 -0
- package/dist/components/tracks/bigwig/dense.d.ts +8 -0
- package/dist/components/tracks/bigwig/full.d.ts +8 -0
- package/dist/components/tracks/bigwig/index.d.ts +4 -0
- package/dist/components/tracks/bigwig/types.d.ts +34 -0
- package/dist/components/tracks/bigwig/utils.d.ts +50 -0
- package/dist/components/tracks/empty/empty.d.ts +4 -0
- package/dist/components/tracks/empty/index.d.ts +2 -0
- package/dist/components/tracks/empty/types.d.ts +11 -0
- package/dist/components/tracks/index.d.ts +9 -0
- package/dist/components/tracks/ld/graphqlldtrack.d.ts +4 -0
- package/dist/components/tracks/ld/index.d.ts +4 -0
- package/dist/components/tracks/ld/ldtrack.d.ts +4 -0
- package/dist/components/tracks/ld/queries.d.ts +3 -0
- package/dist/components/tracks/ld/types.d.ts +66 -0
- package/dist/components/tracks/ld/utils.d.ts +3 -0
- package/dist/components/tracks/link/index.d.ts +4 -0
- package/dist/components/tracks/link/linktrack.d.ts +9 -0
- package/dist/components/tracks/link/simplelinktrack.d.ts +9 -0
- package/dist/components/tracks/link/types.d.ts +38 -0
- package/dist/components/tracks/link/utils.d.ts +5 -0
- package/dist/components/tracks/manhattan/full.d.ts +25 -0
- package/dist/components/tracks/manhattan/index.d.ts +3 -0
- package/dist/components/tracks/manhattan/tooltip.d.ts +4 -0
- package/dist/components/tracks/manhattan/types.d.ts +14 -0
- package/dist/components/tracks/manhattan/utils.d.ts +8 -0
- package/dist/components/tracks/motif/dense.d.ts +4 -0
- package/dist/components/tracks/motif/index.d.ts +4 -0
- package/dist/components/tracks/motif/squish.d.ts +4 -0
- package/dist/components/tracks/motif/types.d.ts +32 -0
- package/dist/components/tracks/motif/utils.d.ts +9 -0
- package/dist/components/tracks/ruler/index.d.ts +5 -0
- package/dist/components/tracks/ruler/ruler.d.ts +9 -0
- package/dist/components/tracks/ruler/types.d.ts +7 -0
- package/dist/components/tracks/ruler/wrapped.d.ts +15 -0
- package/dist/components/tracks/trackset/bamtrack.d.ts +4 -0
- package/dist/components/tracks/trackset/customtrack.d.ts +1 -0
- package/dist/components/tracks/trackset/deducetype.d.ts +6 -0
- package/dist/components/tracks/trackset/graphqlset.d.ts +4 -0
- package/dist/components/tracks/trackset/index.d.ts +6 -0
- package/dist/components/tracks/trackset/motiftrack.d.ts +4 -0
- package/dist/components/tracks/trackset/queries.d.ts +2 -0
- package/dist/components/tracks/trackset/resttrackset.d.ts +4 -0
- package/dist/components/tracks/trackset/types.d.ts +107 -0
- package/dist/components/tracks/trackset/utils.d.ts +4 -0
- package/dist/components/tracks/transcripts/index.d.ts +4 -0
- package/dist/components/tracks/transcripts/pack.d.ts +8 -0
- package/dist/components/tracks/transcripts/queries.d.ts +3 -0
- package/dist/components/tracks/transcripts/squish.d.ts +9 -0
- package/dist/components/tracks/transcripts/transcript.d.ts +35 -0
- package/dist/components/tracks/transcripts/types.d.ts +74 -0
- package/dist/components/tracks/transcripts/utils.d.ts +38 -0
- package/dist/components/tracks/types.d.ts +71 -0
- package/dist/components/tracks/wrapped/dragTrack.d.ts +7 -0
- package/dist/components/tracks/wrapped/index.d.ts +3 -0
- package/dist/components/tracks/wrapped/ld/index.d.ts +3 -0
- package/dist/components/tracks/wrapped/ld/ldtrack.d.ts +4 -0
- package/dist/components/tracks/wrapped/ld/types.d.ts +3 -0
- package/dist/components/tracks/wrapped/margin.d.ts +5 -0
- package/dist/components/tracks/wrapped/motif/dense.d.ts +4 -0
- package/dist/components/tracks/wrapped/motif/index.d.ts +4 -0
- package/dist/components/tracks/wrapped/motif/squish.d.ts +4 -0
- package/dist/components/tracks/wrapped/motif/types.d.ts +4 -0
- package/dist/components/tracks/wrapped/swapTrack.d.ts +9 -0
- package/dist/components/tracks/wrapped/types.d.ts +42 -0
- package/dist/components/tracks/wrapped/wrapped.d.ts +10 -0
- package/dist/gbc.cjs.js +220 -0
- package/dist/gbc.es.js +13058 -0
- package/dist/gbc.umd.js +220 -0
- package/dist/hooks/useBrowserState.d.ts +2 -0
- package/dist/hooks/useInput.d.ts +5 -0
- package/dist/hooks/useModal.d.ts +10 -0
- package/dist/hooks/useTooltip.d.ts +6 -0
- package/dist/lib.d.ts +14 -0
- package/dist/pages/main.d.ts +1 -0
- package/dist/pages/trackExamples.d.ts +4 -0
- package/dist/utils/colors.d.ts +14 -0
- package/dist/utils/coordinates.d.ts +39 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/react.d.ts +2 -0
- package/dist/utils/svg.d.ts +2 -0
- package/dist/utils/types.d.ts +19 -0
- package/package.json +10 -6
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface TrackModalInfo {
|
|
2
|
+
trackId: string;
|
|
3
|
+
mouseX: number;
|
|
4
|
+
mouseY: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function useModal(): {
|
|
7
|
+
openModal: TrackModalInfo | null;
|
|
8
|
+
showModal: (trackId: string, mouseX: number, mouseY: number) => void;
|
|
9
|
+
closeModal: () => void;
|
|
10
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type MouseOverEvent<T> = (event: React.MouseEvent<SVGRectElement>, v: T) => void;
|
|
3
|
+
type MouseOutEvent = () => void;
|
|
4
|
+
type TooltipCallbacks<T> = [MouseOverEvent<T>, MouseOutEvent];
|
|
5
|
+
export declare function useTooltip<T extends object>(Tooltip: React.FC<T>, width: number, svgRef?: React.RefObject<SVGSVGElement>, onMouseOver?: MouseOverEvent<T>, onMouseOut?: MouseOutEvent): TooltipCallbacks<T>;
|
|
6
|
+
export {};
|
package/dist/lib.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { BigWig, DefaultBigWig } from './components/tracks/bigwig';
|
|
2
|
+
export type { BigWigProps, BigWigOptions } from './components/tracks/bigwig';
|
|
3
|
+
export { BigBed, DefaultBigBed } from './components/tracks/bigbed';
|
|
4
|
+
export type { BigBedProps, BigBedOptions } from './components/tracks/bigbed';
|
|
5
|
+
export { Transcript, DefaultTranscript } from './components/tracks/transcripts';
|
|
6
|
+
export type { TranscriptProps, TranscriptOptions } from './components/tracks/transcripts';
|
|
7
|
+
export { Bam, DefaultBam } from './components/tracks/bam';
|
|
8
|
+
export type { BamProps, BamOptions } from './components/tracks/bam';
|
|
9
|
+
export { useBrowserState } from './hooks/useBrowserState';
|
|
10
|
+
export { GenomeBrowser } from './components/browser';
|
|
11
|
+
export { type BrowserState, BrowserActionType } from './components/context/browserContext';
|
|
12
|
+
export { BigWigTrack, BigBedTrack, TranscriptTrack } from './components/tracks/types';
|
|
13
|
+
export type { TrackProps, BigBedTrackProps, BigWigTrackProps, TranscriptTrackProps } from './components/tracks/types';
|
|
14
|
+
export { DisplayMode } from './components/tracks/types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { BigBedTrackProps, BigWigTrackProps, TranscriptTrackProps } from '../components/tracks/types';
|
|
2
|
+
export declare const bigWigExample: BigWigTrackProps;
|
|
3
|
+
export declare const bigBedExample: BigBedTrackProps;
|
|
4
|
+
export declare const transcriptExample: TranscriptTrackProps;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const BLACK = 0;
|
|
2
|
+
export declare const WHITE = 255;
|
|
3
|
+
/**
|
|
4
|
+
* Convert a color to a ligher shade.
|
|
5
|
+
* @param color the original color as a hex string (e.g. #fff or ABCDEF)
|
|
6
|
+
* @param luminosity the fraction by which to change the brightness, from 0 to 1
|
|
7
|
+
*/
|
|
8
|
+
export declare function lighten(color: string, luminosity: number): string;
|
|
9
|
+
/**
|
|
10
|
+
* Validates a hex color and parses it to an integer.
|
|
11
|
+
* @param color the color as a hex string (e.g. #fff or ABCDEF)
|
|
12
|
+
*/
|
|
13
|
+
export declare function parseHex(color: string): number;
|
|
14
|
+
export declare function zeroPadHex(h: number): string;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Domain, YRange, Feature } from './types';
|
|
2
|
+
export declare function m(x: number, y: number): string;
|
|
3
|
+
export declare function l(x: number, y: number): string;
|
|
4
|
+
/**
|
|
5
|
+
* Creates a closure for mapping values into an X coordinate space.
|
|
6
|
+
* @param domain object with the start and end coordinates of the original values.
|
|
7
|
+
* @param width the maximum value of the output space.
|
|
8
|
+
*/
|
|
9
|
+
export declare function xtransform(domain: Domain, width: number): (i: number) => number;
|
|
10
|
+
/**
|
|
11
|
+
* Creates a linear scale for mapping values into a Y coordinate space.
|
|
12
|
+
* @param range object with the max and min coordinates of the original values.
|
|
13
|
+
* @param height the maximum value of the output space.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ytransform(range: YRange, height: number): (i: number) => number;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a linear scale for mapping values from one coordinate space to another.
|
|
18
|
+
* @param indomain the original domain.
|
|
19
|
+
* @param outdomain the output domain.
|
|
20
|
+
*/
|
|
21
|
+
export declare function linearTransform(inDomain: Domain, outDomain: Domain): (value: number) => number;
|
|
22
|
+
/**
|
|
23
|
+
* Creates a linear scale for mapping track input coordinates to an output x coordinate range. If the
|
|
24
|
+
* domain is not explicitly given it will be computed from the minima and maxima of the passed track data.
|
|
25
|
+
* @param domain object with the start and end coordinates to set, or null.
|
|
26
|
+
* @param data optional array of objects with start and end coordinates to compute the domain.
|
|
27
|
+
* @param width the maximum value of the output space.
|
|
28
|
+
*/
|
|
29
|
+
export declare function trackXTransform(domain: Domain, data: Domain[], width: number): (i: number) => number;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a linear scale for mapping track input coordinates to an output x coordinate range. If the
|
|
32
|
+
* domain is not explicitly given it will be computed from the minima and maxima of the passed track data.
|
|
33
|
+
* @param domain object with the start and end coordinates to set, or null.
|
|
34
|
+
* @param data optional array of objects with start and end coordinates to compute the domain.
|
|
35
|
+
* @param width the maximum value of the output space.
|
|
36
|
+
*/
|
|
37
|
+
export declare function trackYTransform(range: YRange, data: YRange[], height: number): (i: number) => number;
|
|
38
|
+
export declare function groupFeatures<T extends Feature>(features: T[], x: (value: number) => number, fontSize: number, margin?: number | undefined): T[][];
|
|
39
|
+
export declare function formatPoint(point?: number): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface Domain {
|
|
2
|
+
chromosome?: string;
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
}
|
|
6
|
+
export type YRange = {
|
|
7
|
+
min: number;
|
|
8
|
+
max: number;
|
|
9
|
+
};
|
|
10
|
+
export interface Feature {
|
|
11
|
+
coordinates: Domain;
|
|
12
|
+
name: string;
|
|
13
|
+
color?: string;
|
|
14
|
+
}
|
|
15
|
+
export type ValuedPoint = {
|
|
16
|
+
x: number;
|
|
17
|
+
min: number;
|
|
18
|
+
max: number;
|
|
19
|
+
};
|
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weng-lab/genomebrowser",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.3",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/weng-lab/genomebrowser.git"
|
|
8
8
|
},
|
|
9
9
|
"description": "UMMS Genome Browser",
|
|
10
10
|
"type": "module",
|
|
11
|
-
"types": "dist/index.d.ts",
|
|
12
11
|
"files": [
|
|
13
12
|
"dist"
|
|
14
13
|
],
|
|
@@ -18,9 +17,10 @@
|
|
|
18
17
|
".": {
|
|
19
18
|
"import": "./dist/gbc.es.js",
|
|
20
19
|
"require": "./dist/gbc.umd.js",
|
|
21
|
-
"types": "./dist/
|
|
20
|
+
"types": "./dist/lib.d.ts"
|
|
22
21
|
}
|
|
23
22
|
},
|
|
23
|
+
"types": "dist/lib.d.ts",
|
|
24
24
|
"scripts": {
|
|
25
25
|
"dev": "vite",
|
|
26
26
|
"build": "vite build",
|
|
@@ -28,15 +28,19 @@
|
|
|
28
28
|
"preview": "vite preview",
|
|
29
29
|
"storybook": "storybook dev -p 6006",
|
|
30
30
|
"build-storybook": "storybook build",
|
|
31
|
-
"chromatic": "npx chromatic --project-token
|
|
31
|
+
"chromatic": "npx chromatic --exit-zero-on-changes --project-token chpt_5e23c1d501d3b2b",
|
|
32
|
+
"verify": "yarn build && yarn build-storybook"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|
|
34
35
|
"react": "^18.3.1",
|
|
35
36
|
"react-dom": "^18.3.1"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
39
|
+
"@apollo/client": "^3.11.10",
|
|
38
40
|
"bigwig-reader": "^1.3.1",
|
|
41
|
+
"graphql": "^16.9.0",
|
|
39
42
|
"logots-react": "^0.2.0",
|
|
43
|
+
"react-colorful": "^5.6.1",
|
|
40
44
|
"react-draggable": "^4.4.6",
|
|
41
45
|
"use-deep-compare-effect": "^1.8.1"
|
|
42
46
|
},
|
|
@@ -55,7 +59,7 @@
|
|
|
55
59
|
"@types/react": "^18.3.3",
|
|
56
60
|
"@types/react-dom": "^18.3.0",
|
|
57
61
|
"@vitejs/plugin-react": "^4.3.1",
|
|
58
|
-
"chromatic": "^11.
|
|
62
|
+
"chromatic": "^11.15.0",
|
|
59
63
|
"eslint": "^9.9.0",
|
|
60
64
|
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
|
|
61
65
|
"eslint-plugin-react-refresh": "^0.4.9",
|
|
@@ -85,4 +89,4 @@
|
|
|
85
89
|
"url": "https://github.com/weng-lab/genomebrowser/issues"
|
|
86
90
|
},
|
|
87
91
|
"homepage": "https://github.com/weng-lab/genomebrowser#readme"
|
|
88
|
-
}
|
|
92
|
+
}
|