Public
Edited
Apr 5, 2023
1 star
Insert cell
Insert cell
Insert cell
// Kept on crashing my browser, so I disabled it
// chartClassif = {
// await visibility();
// return RadialTree(classif_A, { width: 800, height: 800, stroke: "#cccc" });
// }
Insert cell
classif_A = FileAttachment("classif_A_03-04-16_d3.json").json()
Insert cell
classif_B = FileAttachment("classif_B_03-04-16_d3.json").json()
Insert cell
Insert cell
chartLogs = {
await visibility();
return Treemap(logs_A, {
width: width,
height: width * 0.8,
padding: 0.5,
group: (d, n) => n.ancestors().reverse()[2]?.data?.value,
value: (d) => +d?.size,
label: (d, n) => [d.name, n.value].join("\n")
});
}
Insert cell
logs_A = FileAttachment("logs_A_03-02-01_d3.json").json()
Insert cell
logs_B = FileAttachment("logs_B_03-02-01_d3.json").json()
Insert cell
logs_C = FileAttachment("logs_C_03-02-01_d3.json").json()

Insert cell
logs_D = FileAttachment("logs_D_03-02-01_d3.json").json()
Insert cell
## PHYLOGENIES

The trees are small binary trees (60 leaf nodes.) Link length is often considered important by researchers using this data. No attributes. On the other hand the analysis can be very complex, and there are no good interactive tools available today for scientists to make hypotheses about the matching of those trees.
Application Domain Background and Specific Tasks

Insert cell
{
await visibility();
return RadialTree(phylo_B_IM);
}
Insert cell
phylo_A_ABC = FileAttachment("phylo_A_ABC_03-02-01_d3.json").json()
Insert cell
phylo_B_IM = FileAttachment("phylo_B_IM__03-02-01_d3.json").json()
Insert cell
Insert cell
Insert cell
Insert cell
usFederalBudgetAsMap = groupSelected
Insert cell
usFederalBudget = {
function convertToChildren(m, level = 0) {
if (Array.isArray(m)) return m;
return Array.from(m).map(([name, childrenm]) => ({
name,
type: groupBy[level],
children: convertToChildren(childrenm, level + 1)
}));
}
return {
name: "US Federal Budget ${year}",
type: `total`,
children: convertToChildren(groupSelected)
};
}
Insert cell
{
await visibility();
return Treemap(usFederalBudget, {
width: width,
height: width * 0.7,
padding: 1,
value: (d) => d?.size || d[year],
group: (d) => (groupBy.length ? d[groupBy[0]] : null),
label: (d, n) =>
[...groupBy.map((a) => d[a]), n.value / 10 ** 6].join("\n"),
minSize: 1
});
}
Insert cell
Insert cell
knowledgeChiBrowser
Insert cell

SpaceTree(knowledgeChiBrowser, {label: d=> d.data.content})
Insert cell
animalTaxonomy
Insert cell

SpaceTree(animalTaxonomy, {label: d=> d.data.content})
Insert cell
orgchart
Insert cell
SpaceTree(orgchart, {label: d=> d.data.content})
Insert cell
import {SpaceTree} from "@john-guerra/spacetree"
Insert cell
import {knowledgeChiBrowser, animalTaxonomy, orgchart} from "@john-guerra/spacetree-examples"
Insert cell
import {
viewof groupBy,
viewof year,
groupSelected
} from "@john-guerra/us-federal-budget-outlays"
Insert cell
import { Tree as RadialTree } from "@d3/radial-tree"
Insert cell
import { Treemap } from "@john-guerra/treemap-minsize"
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