getGraph({ view, matches, includeNeighboursOf }) {

    $tm.start('Assembling Graph');

    view =  new ViewAbstraction(view);
    matches = matches || utils.getMatches(view.getNodeFilter('compiled'));
    const neighScope = parseInt(view.getConfig('neighbourhood_scope'));
    const typeWL = view.getEdgeTypeFilter('whitelist');
    const toWL = utils.getArrayValuesAsHashmapKeys(matches);
    const edges = this.getEdgesForSet(matches, toWL, typeWL);

    let nodeIdWL;
    if (view.isEnabled('filter_nodes_by_edge_types')) {
      nodeIdWL = new Set();
      Object.values(edges)
        .forEach(edge => { nodeIdWL.add(edge.from); nodeIdWL.add(edge.to); });
    }

    const graph = {
      edges,
      nodes: this.selectNodesByReferences(matches, {
        view: view,
        outputType: 'hashmap'
      })
    };

    if (neighScope) {
      const neighboutMatches = includeNeighboursOf
        ? matches.filter(includeNeighboursOf)
        : matches;
      const neighbours = this.getNeighbours(neighboutMatches, {
        steps: neighScope,
        view: view,
        typeWL: typeWL,
        addProperties: {
          type: 'tmap:neighbour'
        }
      });

      // add neighbours (nodes and edges) to graph
      Object.assign(graph.nodes, neighbours.nodes);
      Object.assign(graph.edges, neighbours.edges);

      if (view && view.isEnabled('show_inter_neighbour_edges')) {
        const nodeTRefs = this.getTiddlersByIds(neighbours.nodes);
        // this time we need a whitelist based on the nodeTRefs
        const toWL = utils.getArrayValuesAsHashmapKeys(nodeTRefs);
        Object.assign(graph.edges, this.getEdgesForSet(nodeTRefs, toWL));
      }
    }

    if (nodeIdWL) {
      const nodesFilteredByEdges = utils.makeHashMap();
      Object.values(graph.nodes)
        .forEach(node => { if (nodeIdWL.has(node.id)) { nodesFilteredByEdges[node.id] = node; } })
      graph.nodes = nodesFilteredByEdges;
    }

    // this is pure maintainance!
    // removeObsoleteViewData(graph.nodes, view);

    // add styles to nodes
    this.attachStylesToNodes(graph.nodes, view);

    $tm.stop('Assembling Graph');

    $tm.logger('debug', 'Assembled graph:', graph);

    return graph;

  }
This function will assemble a graph object based on the supplied
node and edge filters. Optionally, a neighbourhood may be
merged into the graph neighbourhood.

@param {string|ViewAbstraction} [view] - The view in which
    the graph will be displayed.
    See {@link Adapter#getNeighbours}
@return {Object} An object of the form:
    {
      nodes: { *all nodes in the graph* },
      edges: { *all edges in the graph* },
    }
    Neighbours will be receive the 'tmap:neighbour' type.