Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(editor): add a demo for comparing rendering approaches #1023

Merged
merged 2 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions editor/example/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export type ExampleGroup =
| 'Coordinated Multiple Views'
| 'Applications'
| 'Track Templates'
| 'Experimental'
| 'Doc'
| 'Unassigned';

Expand Down Expand Up @@ -75,6 +76,10 @@ export const ExampleGroups: {
name: 'Track Templates',
description: 'Built-in track templates that allow creating common tracks, like ideograms and gene annotations.'
},
{
name: 'Experimental',
description: 'Examples that include experimental features, such as performance improvements.'
},
{
name: 'Doc',
description: 'Examples used in the official documentation.'
Expand Down Expand Up @@ -412,6 +417,12 @@ export const editorExampleObj: {
spec: JsonExampleSpecs.EX_SPEC_ALIGNMENT_CHART,
image: THUMBNAILS.ALIGNMENT
},
PERF_ALIGNMENT: {
group: 'Experimental',
name: 'Performance Comparison: Stretching Tiles',
spec: JsonExampleSpecs.EX_SPEC_PERF_ALIGNMENT,
image: THUMBNAILS.PERF_ALIGNMENT
},
CORCES_ET_AL: {
group: 'Coordinated Multiple Views',
name: 'Corces et al. 2020',
Expand Down
2 changes: 2 additions & 0 deletions editor/example/json-spec/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { EX_SPEC_CYTOBANDS } from './ideograms';
import { EX_SPEC_PILEUP } from './pileup';
import { EX_SPEC_TEMPLATE } from './track-template';
import { EX_SPEC_MOUSE_EVENT } from './mouse-event';
import { EX_SPEC_PERF_ALIGNMENT } from './perf-alignment'
import { EX_SPEC_DEBUG } from './debug';

export const JsonExampleSpecs = {
Expand All @@ -42,6 +43,7 @@ export const JsonExampleSpecs = {
EX_SPEC_RESPONSIVE_TRACK_WISE_COMPARISON,
EX_SPEC_ALIGNMENT_CHART,
EX_SPEC_RESPONSIVE_ALIGNMENT_CHART,
EX_SPEC_PERF_ALIGNMENT,
EX_SPEC_MARK_DISPLACEMENT,
EX_SPEC_CIRCULAR_OVERVIEW_LINEAR_DETAIL,
EX_SPEC_SARS_COV_2,
Expand Down
24 changes: 24 additions & 0 deletions editor/example/json-spec/perf-alignment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import type { GoslingSpec } from "@gosling-lang/gosling-schema"
import { alignmentWithText } from "./responsive-alignment"

const commonProps = { width: 800, height: 250, xAxis: false, rowLegend: false, colorLegend: false };
export const EX_SPEC_PERF_ALIGNMENT: GoslingSpec = {
zoomLimits: [1, 396],
xDomain: { interval: [350, 396] },
assembly: 'unknown',
views: [
{
tracks: [{
...alignmentWithText(commonProps),
title: 'New Approach: Stretching Tiles',
experimental: { stretchGraphics: true },
}]
},
{
tracks: [{
...alignmentWithText(commonProps),
title: 'Original Approach'
}]
}
]
};
2 changes: 2 additions & 0 deletions editor/example/thumbnails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import MARK_DISPLACEMENT from './thumbnails/MARK_DISPLACEMENT.png';
import MATRIX_HFFC6 from './thumbnails/MATRIX_HFFC6.gif';
import MATRIX from './thumbnails/MATRIX.png';
import MOUSE_EVENT from './thumbnails/MOUSE_EVENT.png';
import PERF_ALIGNMENT from './thumbnails/PERF_ALIGNMENT.png';
import RESPONSIVE_COMPARATIVE_MATRICES from './thumbnails/RESPONSIVE_COMPARATIVE_MATRICES.gif';
import RESPONSIVE_IDEOGRAM from './thumbnails/RESPONSIVE_IDEOGRAM.gif';
import RESPONSIVE_MULTIVEC from './thumbnails/RESPONSIVE_MULTIVEC.gif';
Expand Down Expand Up @@ -48,6 +49,7 @@ export const THUMBNAILS = {
MATRIX_HFFC6,
MATRIX,
MOUSE_EVENT,
PERF_ALIGNMENT,
RESPONSIVE_COMPARATIVE_MATRICES,
RESPONSIVE_IDEOGRAM,
RESPONSIVE_MULTIVEC,
Expand Down
Binary file added editor/example/thumbnails/PERF_ALIGNMENT.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.