Published
Edited
Jan 18, 2022
4 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
d3 = require("d3-collection@latest")
Insert cell
math = require("mathjs")
Insert cell
lithiumkeys = getkeys(lithiumcsv).sort()
Insert cell
rhod = pgmkeys.slice(8, 11).sort()
Insert cell
pall = pgmkeys.slice(5, 8).sort()
Insert cell
plat = pgmkeys.slice(0, 4).sort()
Insert cell
pgmkeys = getkeys(pgmvalues)
Insert cell
pgmvalues = getvalues(pgmcsv)
Insert cell
Insert cell
Insert cell
Insert cell
niobiumcsv = FileAttachment("niobium-values.csv").csv()
Insert cell
tantalumkeys = getkeys(tantalumcsv).sort()
Insert cell
Insert cell
tantalumcsv = FileAttachment("tantalum-values.csv").csv()
Insert cell
tantalumvalues = getvalues(tantalumcsv)
Insert cell
lithiumvalues = getvalues(lithiumcsv)
Insert cell
lithiumcsv = FileAttachment("lithium-values@1.csv").csv()
Insert cell
Insert cell
cobaltcsv = FileAttachment("cobalt-values.csv").csv()
Insert cell
reecsv = FileAttachment("ree-values@2.csv").csv()
Insert cell
Insert cell
Insert cell
getvalues = (array) =>
array
.map((entry) =>
Object.entries(entry).reduce(
(obj, [key, value]) => ((obj[key] = parseFloat(value)), obj),
{}
)
)
.map((m) => {
m.year = m.Year.toString();
return m;
})
Insert cell
getkeys = (array) =>
Object.keys(array[0])
.slice(1)
.filter((f) => f != "year")
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