Published
Edited
Jul 15, 2020
6 stars
Insert cell
Insert cell
d3.permute(["a", "b", "c", "d", "e"], [1, 2, 0, 4, 3])
Insert cell
d3.permute(["a", "b", "c", "d", "e"], [4, 3, 2, 1, 0])
Insert cell
Insert cell
{
const object = {yield: 27, variety: "Manchuria", year: 1931, site: "University Farm"};
const fields = ["site", "variety", "yield"];
return d3.permute(object, fields);
}
Insert cell
Insert cell
d3.permute("abcdefghijklmnopqrstuvwxyz", [0, 4, 8, 14, 20])
Insert cell
Insert cell
d3.permute("abcdefghijklmnopqrstuvwxyz", [3, 4, 0, 3, 1, 4, 4, 5])
Insert cell
Insert cell
d3.permute([..."🐵🙈🙉🙊"], [2])
Insert cell
Insert cell
Insert cell
{
const source = ["a", "b", "c", "d", "e"];
const keys = [1, 2, 0, 4, 3];
return keys.map(key => source[key]);
}
Insert cell
Insert cell
Insert cell
d3 = require("d3-array@2")
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