From 1b7bfd6511f7a5dc124a275ec249fa2ed9cb9eaf Mon Sep 17 00:00:00 2001 From: Moritz Ulrich Date: Tue, 14 Dec 2021 13:42:20 +0100 Subject: [PATCH] Graph: Use a smoother scale function The scaling is pretty much the same - it just gets rid of some stackiness caused by the `<` etc. conditions in previous code. --- src/main/frontend/handler/graph.cljs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/main/frontend/handler/graph.cljs b/src/main/frontend/handler/graph.cljs index 8b084e53a..ee9327273 100644 --- a/src/main/frontend/handler/graph.cljs +++ b/src/main/frontend/handler/graph.cljs @@ -40,13 +40,7 @@ (if dark? "orange" "green") color)] (let [n (get page-links p 1) - size-v (if (> n 2) - (js/Math.cbrt n) - n) - size-v (if (< size-v 1) - 1 - (int size-v)) - size (* size-v 8)] + size (int (* 8 (max 1.0 (js/Math.cbrt n))))] (cond-> {:id p :label p