Skip to content
Advertisement

Animate icon in GoJS

I have a graph with nodes that contains icons:

JavaScript

I would like to rotate statusIcon infinitly but only if statusIcon matchs a value.

I have looked how to add a css rule like this.

JavaScript

But I get an error

Trying to set undefined property “animation” on object: TextBlock

I suppose that only few css rules are accepted by gojs TextBlock.

How can I add animation to only a node sub element ?

Advertisement

Answer

I created a StackBlitz example here.

JavaScript

Animation is not a property like you used above. If you want to rotate, you should use AnimationTrigger and angle property for that.
I made a simple example to use GoJS animation, you can apply the codes from node template of TextBlock and the method to animate as you wish.

For more information, you can follow the description and the examples here.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement