Public
Edited
Oct 21, 2021
2 stars
Insert cell
Insert cell
Insert cell
viewof genomeSpy = embed({
height: 200,
width: 400,

data: { values: data },

mark: { type: "point", clip: false },

encoding: {
x: {
field: "x",
type: "quantitative",
scale: {
// Let's give the scale a name
name: "x_scale",
// ... and make it zoomable
zoom: true
}
},
y: { field: "sin", type: "quantitative" }
}
})
Insert cell
Insert cell
Insert cell
Generators.observe((change) => {
const clicked = (event) => change(event);
genomeSpy.addEventListener("click", clicked);
change(undefined);
return () => genomeSpy.removeEventListener("click", clicked);
})
Insert cell
Insert cell
Insert cell
Generators.observe((change) => {
const scaleResolution = genomeSpy.getScaleResolutionByName("x_scale");
const domainChanged = (event) => change(event.scaleResolution.getDomain());
scaleResolution.addEventListener("domain", domainChanged);
change(scaleResolution.getDomain());
return () => scaleResolution.removeEventListener("domain", domainChanged);
})
Insert cell
Insert cell
Insert cell
import {embed, data } from "@tuner/genomespy"
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more