From c4e2b110cdfc315f4900588a009c7312c2fb8a0b Mon Sep 17 00:00:00 2001 From: James Turk Date: Mon, 14 Oct 2024 01:47:07 -0500 Subject: [PATCH] ideaweb prototype --- ideaweb/graph.mjs | 9 +++++++ ideaweb/index.html | 22 ++++++++++++++---- ideaweb/modal.mjs | 58 ++++++++++++++++++++++++++++++---------------- time-left.html | 36 ++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+), 25 deletions(-) create mode 100644 time-left.html diff --git a/ideaweb/graph.mjs b/ideaweb/graph.mjs index 0e0afbc..a8ec878 100644 --- a/ideaweb/graph.mjs +++ b/ideaweb/graph.mjs @@ -34,4 +34,13 @@ export default class Graph { addLink(source, target) { this.links.push({ source, target }); } + + *search(q) { + const re = new RegExp(q, "i"); + for (let n of this.nodes) { + if (re.test(n.name)) { + yield n; + } + } + } } diff --git a/ideaweb/index.html b/ideaweb/index.html index 7863b5b..2ccd29a 100644 --- a/ideaweb/index.html +++ b/ideaweb/index.html @@ -6,8 +6,6 @@ + + +