From 92d37a3c8da816648e6a1b27c5455013122faf6b Mon Sep 17 00:00:00 2001 From: Ivan Danyliuk Date: Fri, 26 Oct 2018 16:38:13 +0200 Subject: [PATCH] Rename animate_propagation.go --- animate_propagation.go => propagation.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) rename animate_propagation.go => propagation.go (91%) diff --git a/animate_propagation.go b/propagation.go similarity index 91% rename from animate_propagation.go rename to propagation.go index 30b6083..5e8fd4e 100644 --- a/animate_propagation.go +++ b/propagation.go @@ -8,8 +8,7 @@ import ( ) const ( - BlinkDecay = 200 * time.Millisecond // time for highlighted node/link to be active - AnimationSlowdown = 1 // slowdown factor for propagation animation + AnimationSlowdown = 1 // slowdown factor for propagation animation ) var ( @@ -54,7 +53,7 @@ func (w *WebGLScene) BlinkNode(id, percentage int) { node := w.nodes[id] node.Set("material", BlinkedNodeMaterials[percentage/10]) // choose material depending on percentage of propagation restore := func() { node.Object.Set("material", DefaultNodeMaterial) } - go time.AfterFunc(BlinkDecay, restore) + go time.AfterFunc(time.Duration(w.blink)*time.Millisecond, restore) } @@ -63,7 +62,7 @@ func (w *WebGLScene) BlinkEdge(id, percentage int) { edge := w.lines[id] edge.Set("material", BlinkedEdgeMaterials[percentage/10]) // choose material depending on percentage of propagation restore := func() { edge.Object.Set("material", DefaultEdgeMaterial) } - go time.AfterFunc(BlinkDecay, restore) + go time.AfterFunc(time.Duration(w.blink)*time.Millisecond, restore) } // NewBlinkedEdgeMaterials creates a new default material for the graph blinked edge lines.