istory.pushState({}, '', q.length === 0 ? location.pathname : `?${q.join('&')}`)
}

function parseURL () {
  const q = new URL(document.location.href).searchParams

  title = q.get('t') || preset.title

  const e = q.get('e'); let i
  expand = e && !Number.isNaN(i = parseInt(e)) ? Math.min(Math.max(i, -1), 2) : preset.expand

  chronology = q.get('c') || preset.chronology

  const s = q.get('s')
  if (s) {
    const idset = new Set(nodes.map(node => node.id))
    selected = new Set(
      s.split(',')
     