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

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