summaryrefslogtreecommitdiffstats
path: root/web_src/js/features/gitgraph.js
blob: c0006a2596c542ac1bad0780a4cc4c37354a005f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
export default async function initGitGraph() {
  const graphCanvas = document.getElementById('graph-canvas');
  if (!graphCanvas) return;

  const {default: gitGraph} = await import(/* webpackChunkName: "gitgraph" */'../vendor/gitgraph.js');

  const graphList = [];
  $('#graph-raw-list li span.node-relation').each(function () {
    graphList.push($(this).text());
  });

  gitGraph(graphCanvas, graphList);
}