diff --git a/web-ui/src/lib/Graph.svelte b/web-ui/src/lib/Graph.svelte index 9b0780bf18ebea0fe462749c6832d4df98767222_d2ViLXVpL3NyYy9saWIvR3JhcGguc3ZlbHRl..76645b00cd63dd3c89d8364b150c79305346a983_d2ViLXVpL3NyYy9saWIvR3JhcGguc3ZlbHRl 100644 --- a/web-ui/src/lib/Graph.svelte +++ b/web-ui/src/lib/Graph.svelte @@ -1,5 +1,4 @@ <script lang="ts"> import Chart from "chart.js/auto"; - import nodemap from "../../../mercurial-mapping.json"; import { onMount } from "svelte"; import { COLORS } from "../config.js"; @@ -4,6 +3,6 @@ import { onMount } from "svelte"; import { COLORS } from "../config.js"; - import { getNodeForResult, sortVersions } from "../utils"; + import { getNodeForResult, getRankForResult, sortVersions } from "../utils"; export let title: string; export let data; @@ -14,6 +13,9 @@ */ const groupResults = (results) => { return results.reduce((acc, result) => { + if (getRankForResult(result) == null) { + return acc; + } const dataEnvName = result["data-env-vars"]["name"]; const key = dataEnvName.slice(dataEnvName.split("-", 1)[0].length + 1) + @@ -38,8 +40,8 @@ ).entries()) { const graphData = []; const sorted = [...results].sort((a, b) => { - const nodeA = nodemap[getNodeForResult(a)]; - const nodeB = nodemap[getNodeForResult(b)]; + const nodeA = getRankForResult(a); + const nodeB = getRankForResult(b); return nodeA - nodeB; }); for (const result of sorted) { diff --git a/web-ui/src/utils.ts b/web-ui/src/utils.ts index 9b0780bf18ebea0fe462749c6832d4df98767222_d2ViLXVpL3NyYy91dGlscy50cw==..76645b00cd63dd3c89d8364b150c79305346a983_d2ViLXVpL3NyYy91dGlscy50cw== 100644 --- a/web-ui/src/utils.ts +++ b/web-ui/src/utils.ts @@ -54,4 +54,8 @@ export const getNodeForResult = (result) => { return result["bin-env-vars"]["hg"]["changeset"]["node"]; +}; + +export const getRankForResult = (result) => { + return result["bin-env-vars"]["hg"]["changeset"]["rank"]; }; \ No newline at end of file