Please see https://github.com/gosling-lang/gosling-react instead
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).
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.
Use the following commands to install all packages and run the application in your browser:
yarn
yarn start