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

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