Public
Edited
Oct 2, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
reward = {
const url = 'https://raw.githubusercontent.com/thewakingsands/ffxiv-datamining-cn/master/GCSupplyDutyReward.csv'
return parseCSV(await (await fetch(url)).text())
}
Insert cell
function parseCSV(text) {
const lineend0 = text.indexOf('\n') // key,0,1 ...
const lineend1 = text.indexOf('\n', lineend0 + 1) // #, Name, ...
const lineend2 = text.indexOf('\n', lineend1 + 1) // int,str, ...
const lineend3 = text.indexOf('\n', lineend2 + 1) // 0, '', ... , some files don't start with 0
const idxes = text.slice(0, lineend0).split(',')
const labels = text.slice(lineend0 + 1, lineend1).split(',')
return d3.csvParseRows(text.slice(lineend3 + 1))
}
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