Published
Edited
Jun 2, 2022
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
plco.api.ping()
Insert cell
plco.api.ping()
Insert cell
Insert cell
Insert cell
<div id="plotMan2"></div>
Insert cell
plco.plot.manhattan2("plotMan2", [
{ phenotype_id: 3080, ancestry: "european", sex: "female" },
{ phenotype_id: 3080, ancestry: "east_asian", sex: "female" }
])
Insert cell
Insert cell
Insert cell
Insert cell
Plotly = require("https://cdn.plot.ly/plotly-2.12.1.min.js")
Insert cell
Insert cell
Plotly.newPlot(DOM.element("div"), [
{
x: dt.traces[0].x,
y: dt.traces[0].y,
mode: "markers"
}
])
Insert cell
Insert cell
Insert cell
plco.plot.pca2("Plotpca2", [
{ phenotype_id: 3080, sex: "female", ancestry: "east_asian" },
{ phenotype_id: 3080, sex: "female", ancestry: "european" }
])
Insert cell
Insert cell
<div id="barPhenotype"></div>
Insert cell
plco.plot.barchart("barPhenotype", 3080)
Insert cell
one more parameter, indicating that the data, rather than the graphic plot, is the desired output will make this clearer:
Insert cell
barData = plco.plot.barchart("barPhenotype", 3080, true)
Insert cell
... for example, a table with the data for breast cancer might be generated as follows
Insert cell
Insert cell
viewof table = Inputs.table(breastData)
Insert cell
## Extending and/or correcting plots
One final illustration of the use of the SDK might be to extend or correct a Plot. For example, in the example above, the title is omiss about the phenotype. To fix that, the data extracted from the plot can be amended and amended plot can be regenerated:
Insert cell
<div id="amendedBarPlot"></div>
Insert cell
{
barData.layout.title =
"Number of partipicants by breast cancer disgnosis and sex";
Plotly.newPlot("amendedBarPlot", barData.traces, barData.layout);
return "title ammended";
}
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more