Rename animate_propagation.go

This commit is contained in:
Ivan Danyliuk 2018-10-26 16:38:13 +02:00
parent dcbbe1c4b6
commit 92d37a3c8d
No known key found for this signature in database
GPG Key ID: 97ED33CE024E1DBF

View File

@ -8,7 +8,6 @@ import (
) )
const ( 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
) )
@ -54,7 +53,7 @@ func (w *WebGLScene) BlinkNode(id, percentage int) {
node := w.nodes[id] node := w.nodes[id]
node.Set("material", BlinkedNodeMaterials[percentage/10]) // choose material depending on percentage of propagation node.Set("material", BlinkedNodeMaterials[percentage/10]) // choose material depending on percentage of propagation
restore := func() { node.Object.Set("material", DefaultNodeMaterial) } 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 := w.lines[id]
edge.Set("material", BlinkedEdgeMaterials[percentage/10]) // choose material depending on percentage of propagation edge.Set("material", BlinkedEdgeMaterials[percentage/10]) // choose material depending on percentage of propagation
restore := func() { edge.Object.Set("material", DefaultEdgeMaterial) } 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. // NewBlinkedEdgeMaterials creates a new default material for the graph blinked edge lines.