diff options
Diffstat (limited to 'src/graph.js')
| -rw-r--r-- | src/graph.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/graph.js b/src/graph.js index 3a0e8a1..7381f49 100644 --- a/src/graph.js +++ b/src/graph.js @@ -2,6 +2,7 @@ import * as THREE from "three"; import ForceGraph3D from "3d-force-graph"; import SpriteText from "three-spritetext"; import { union } from "./utils/set_utils.js"; +import { randint, choice, pad } from "./utils/index.js"; const IMG_SCALE = 16; const MAIN_IMG_SCALE = 80; @@ -20,7 +21,7 @@ export default function buildGraph({ db, objects, handlers }) { db.page.forEach((item, index) => { const node = { - title: index + 1 + " " + item.title, + title: pad(index + 1) + " " + item.title, id: index, data: item, groups: [], @@ -210,6 +211,4 @@ export default function buildGraph({ db, objects, handlers }) { // stars(); } -const randint = (limit) => Math.floor(Math.random() * limit); -const choice = (list) => list[randint(list.length)]; const commonGroups = (a, b) => union(a.groups, b.groups); |
