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

gosling-lang/gosling-api-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Languages

  • JavaScript 85.5%
  • CSS 7.3%
  • HTML 7.2%