Public
Edited
Oct 2, 2024
Insert cell
Insert cell
Insert cell
locales
Insert cell
Insert cell
Insert cell
selected
Insert cell
Insert cell
items = {
return await FileAttachment("items@1.json").json()
}
Insert cell
allItems_raw
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
en
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
en = {
return Array.from(l11n[locales[0]].entries()).map(it=>{
return {
key: it[0],
value: it[1]
}
})
}
Insert cell
Insert cell
Insert cell
fflate = require('fflate@0.7.4/umd/index.js')
Insert cell
Insert cell
Insert cell
Endpoint = {
const east = {
server: 'east',
get(){
return this.abc
}
}
return east
}
Insert cell
fetchMarket = async (server, items, options)=>{
const url = `https://universalis.app/api/v2/${server}/${Array.isArray(items) ? items.join(',') : items}`
const queries = {
...options,
}
const querystring = new URLSearchParams(queries).toString()
return await fetchJSON(`${url}?${querystring}`)
}
Insert cell
mutable error = ({
value: false,
message: '',
})
Insert cell
fetchJSON = async (url)=> {
return await fetch(url).then(res=>{
mutable error = spawnError(false)
return res.json()
}).catch(e=>{
mutable error = spawnError(true, `无法从地址获取数据: ${url}, Universalis 可能正在维护`)
throw e
})
}
Insert cell
spawnError = (value, message = '')=>{
return {
value,
message
}
}
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