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

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