Pārlūkot izejas kodu

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.
Moritz Ulrich 3 gadi atpakaļ
vecāks
revīzija
1b7bfd6511
1 mainītis faili ar 1 papildinājumiem un 7 dzēšanām
  1. 1 7
      src/main/frontend/handler/graph.cljs

+ 1 - 7
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