dDatabase () {
  if (database.length !== 0) {
    return loadDatabase(database)
  } else {
    return d3.json('database.json').then(loadDatabase)
  }
}

function loadDatabase (database) {
  return Promise.all(database.map(url => d3.json(url))).then(files => {
    nodes = [].concat.apply([], files.map(file => file.nodes))
    links = [].concat.apply([], files.map(file => file.links))

    // Remove invalid links
    const nodeMap = new Map(nodes.map(node => [node.id, node]))
    links = links.filter(l => nod