Skip to content
This repository has been archived by the owner on Jul 4, 2022. It is now read-only.

Latest commit

 

History

History
45 lines (32 loc) · 1.18 KB

README.md

File metadata and controls

45 lines (32 loc) · 1.18 KB

Gosling API Example

This repository describes a way of using APIs of Gosling.js in a React application. You can try a demo to find out how APIs can be intergrated into external interactive components (e.g., buttons).

May-18-2021 09-49-11

API

This repository uses the following APIs:

// Navigate to a particular gene
gosRef.current.api.zoomToGene(
   "detail-view", // ID of a gosling view
   gene, // gene symbol (e.g., MYC)
   duration // duration of animated transition
);

// Navigate to a particular genomic location
gosRef.current.api.zoomTo(
   "overview", 
   pos, // e.g., "chr1" or "chr1:1-10000"
   duration
);

// Export PNG or PDF
gosRef.current.api.exportPNG();
gosRef.current.api.exportPDF();

// to be added more
// ...

Refer to src/App.js to see how APIs are used.

Development

Use the following commands to install all packages and run the application in your browser:

yarn
yarn start