Public
Edited
Jan 8, 2022
2 stars
Insert cell
# SV Oceans of Kinfolk Graph Demo

1. Data from Jennie Williams' Oceans of Kinfolk dataset https://voyages3-staging.crc.rice.edu/past/database/oceans-of-kinfolk, translated into a Redis Graph database https://github.com/JohnMulligan/voyages_graph
1. will make my data calls like this: https://observablehq.com/@cengique/api-data-example and return labeled nodes and edges
1. the labels will have to be pre-flattened because enslavers and enslaved will have differently-structured biographical data, and we don't want to deal with that in javascript -- and we should assign enslavers and enslaved different colors on the graph (and maybe subdivide enslavers based on roles -- the problem here being that some have multiple roles, so that makes for a lot of individuated groups)
1. we could also pre-calculate the maximum size of the nodes, as we want that non-linear -- some of the buyers are so outsized that they literally block the graph
1. and inputs like this: https://observablehq.com/@observablehq/interactivity-in-observable#range
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
data=FileAttachment("1835_1836@3.json").json()
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
Insert cell
Insert cell
edgecolor = {
const scale = d3.scaleOrdinal(d3.schemeCategory10);
return d => scale(d.group);
}
Insert cell
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