Skip to content

Commit 9bf6c32

Browse files
committed
feat: density example (#1145)
1 parent 04170f4 commit 9bf6c32

File tree

5 files changed

+67
-1
lines changed

5 files changed

+67
-1
lines changed

editor/example/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,12 @@ export const editorExampleObj: {
440440
spec: JsonExampleSpecs.EX_SPEC_SPATIAL_COLOR,
441441
image: THUMBNAILS.SPATIAL_COLOR,
442442
},
443+
SPATIAL_LAYOUT_DENSITY: {
444+
group: 'Spatial Layout',
445+
name: 'Density',
446+
spec: JsonExampleSpecs.EX_SPEC_SPATIAL_DENSITY,
447+
image: THUMBNAILS.SPATIAL_DENSITY,
448+
},
443449
SPATIAL_LAYOUT_3D_YEAST_MODEL: {
444450
group: 'Spatial Layout',
445451
name: '3D Yeast Model (Nature 2010)',

editor/example/json-spec/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { EX_SPEC_TEMPLATE } from './track-template';
2626
import { EX_SPEC_MOUSE_EVENT } from './mouse-event';
2727
import { EX_SPEC_PERF_ALIGNMENT } from './perf-alignment';
2828
import { EX_SPEC_DEBUG } from './debug';
29-
import { EX_SPEC_SPATIAL_MINIMAL, EX_SPEC_SPATIAL_MULTIPLE_TRACKS, EX_SPEC_SPATIAL_COLOR } from './spatial-layout';
29+
import { EX_SPEC_SPATIAL_MINIMAL, EX_SPEC_SPATIAL_MULTIPLE_TRACKS, EX_SPEC_SPATIAL_COLOR, EX_SPEC_SPATIAL_DENSITY } from './spatial-layout';
3030
import { EX_SPEC_3D_YEAST_MODEL } from './3d-yeast-model';
3131

3232
export const JsonExampleSpecs = {
@@ -66,4 +66,5 @@ export const JsonExampleSpecs = {
6666
EX_SPEC_SPATIAL_MULTIPLE_TRACKS,
6767
EX_SPEC_3D_YEAST_MODEL,
6868
EX_SPEC_SPATIAL_COLOR,
69+
EX_SPEC_SPATIAL_DENSITY,
6970
};

editor/example/json-spec/spatial-layout.ts

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,63 @@ export const EX_SPEC_SPATIAL_COLOR: GoslingSpec = {
9898
]
9999
};
100100

101+
export const EX_SPEC_SPATIAL_DENSITY: GoslingSpec = {
102+
title: 'Density',
103+
subtitle: '',
104+
arrangement: "horizontal",
105+
views: [
106+
{
107+
layout: {
108+
type: 'spatial',
109+
model: {
110+
type: 'csv',
111+
url: 'https://raw.githubusercontent.com/dvdkouril/chromospace-sample-data/refs/heads/main/gosling-3d/stevens-2017/densities/Stevens-2017_GSM2219498_Cell_2_model_7_with-densities_r05.csv',
112+
xyz: ['x', 'y', 'z'],
113+
chromosome: 'chr',
114+
position: 'coord'
115+
}
116+
},
117+
tracks: [
118+
{
119+
color: {
120+
field: "densityVals",
121+
type: "quantitative",
122+
},
123+
width: 500,
124+
height: 500
125+
}
126+
]
127+
},
128+
{
129+
layout: {
130+
type: 'spatial',
131+
model: {
132+
type: 'csv',
133+
url: 'https://raw.githubusercontent.com/dvdkouril/chromospace-sample-data/refs/heads/main/gosling-3d/stevens-2017/densities/Stevens-2017_GSM2219498_Cell_2_model_7_with-densities_r05.csv',
134+
xyz: ['x', 'y', 'z'],
135+
chromosome: 'chr',
136+
position: 'coord'
137+
}
138+
},
139+
tracks: [
140+
{
141+
color: {
142+
field: "densityVals",
143+
type: "quantitative",
144+
},
145+
size: {
146+
field: "densityVals",
147+
type: "quantitative",
148+
range: [0.03, 0.002],
149+
},
150+
width: 500,
151+
height: 500
152+
}
153+
]
154+
},
155+
]
156+
};
157+
101158
export const EX_SPEC_SPATIAL_MULTIPLE_TRACKS: GoslingSpec = {
102159
title: 'Spatial Layout: multiple tracks in one view',
103160
views: [

editor/example/thumbnails.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import ISLANDVIEWER from './thumbnails/ISLANDVIEWER.png';
3333
import SPATIAL_MINIMAL from './thumbnails/SPATIAL_MINIMAL.png';
3434
import SPATIAL_YEAST from './thumbnails/SPATIAL_YEAST.png';
3535
import SPATIAL_COLOR from './thumbnails/SPATIAL_COLOR.png';
36+
import SPATIAL_DENSITY from './thumbnails/SPATIAL_DENSITY.png';
3637

3738
export const THUMBNAILS = {
3839
ALIGNMENT,
@@ -70,4 +71,5 @@ export const THUMBNAILS = {
7071
SPATIAL_MINIMAL,
7172
SPATIAL_YEAST,
7273
SPATIAL_COLOR,
74+
SPATIAL_DENSITY,
7375
};
160 KB
Loading

0 commit comments

Comments
 (0)