Public
Edited
Dec 16, 2023
Insert cell
Insert cell
Plot.plot({
height: 180,
marks: [
Plot.text(
equipment.filter(
(d) =>
!d.type.includes("Clothing") &&
!d.type.includes("Camp") &&
d.type !== "Underwear"
),
Plot.stackY({ y: "rank" }, { x: "rarity", text: "name", fy: "type" })
)
],
width,
height: 3000,
x: {
domain: ["story", "common", "uncommon", "rare", "very rare", "legendary"]
}
})
Insert cell
equipment
Type Table, then Shift-Enter. Ctrl-space for more options.

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

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

Insert cell
equipment = parse(
(
await fetch(
`https://corsproxy.io?https://bg3.wiki/w/index.php?${new URLSearchParams({
title: "Special:CargoExport",
tables: "equipment",
fields:
`name description quote type proficiency enchantment rarity armour_class armour_class_bonus stealth_disadvantage weight_kg price special where_to_find legacy`
.split(/\s+/)
.join(","),
limit: 700,
format: "json"
})}`
)
).json()
)
Insert cell
spells = parse(
(
await fetch(
`https://corsproxy.io?https://bg3.wiki/w/index.php?${new URLSearchParams({
title: "Special:CargoExport",
tables: "spells",
fields:
`name description spell_level spell_school is_concentration is_ritual aoe aoe_size is_npc can_upcast has_attack_roll action_type spell_range classes damage_type damage_save is_healing condition_duration`
.split(/\s+/)
.join(","),
limit: 500,
format: "json"
})}`
)
).json()
)
Insert cell
weapons = parse(
(
await fetch(
`https://corsproxy.io?https://bg3.wiki/w/index.php?${new URLSearchParams({
title: "Special:CargoExport",
tables: "weapons",
fields:
`name legacy description quote category handedness melee_or_ranged type rarity enchantment damage damage_type versatile_damage extra_damage extra_damage_type extra_damage_2 extra_damage_2_type range_m finesse heavy light reach thrown cannot_dual_wield dippable weight_kg price weapon_actions special_weapon_actions special where_to_find legacy`
.split(/\s+/)
.join(","),
limit: 400,
format: "json"
})}`
)
).json()
)
Insert cell
parse = async (raw) => {
const parser = new DOMParser();
const decode = (s) =>
s
? isNaN(+s)
? parser.parseFromString(s, "text/html").documentElement.textContent
: +s
: null;
return (await raw).map((d) =>
Object.fromEntries(Object.entries(d).map(([k, v]) => [k, decode(v)]))
);
}
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