Skip to main content
Participant
April 19, 2020
Answered

Smooth transition in between values that are stored in a array

  • April 19, 2020
  • 1 reply
  • 379 views

Hey there, i loaded a json file that contains temperature values. 
I managed to display the changing values (every two seconds) on a textlayer. So far so good.

But, let's say i would like to add an illustration of a thermometer with a raising/falling indicator. When i parse the value and link it to the y-size property - the thermometer jumps from value to value. 
How would i go about to achieve a smooth transition from one value to the next…?

thank you

 

This topic has been closed for replies.
Correct answer Mylenium

You can use functions like linear() or ease() to interpolate values. could be as trivial as linear(time,timeA,timeB,valueA,valueB), though likely in your case you would have to write a for() loop that dynamically switches the values for every new segment.

 

Mylenium

1 reply

Mylenium
MyleniumCorrect answer
Legend
April 19, 2020

You can use functions like linear() or ease() to interpolate values. could be as trivial as linear(time,timeA,timeB,valueA,valueB), though likely in your case you would have to write a for() loop that dynamically switches the values for every new segment.

 

Mylenium

Participant
April 27, 2020

Thanks for the fast reply. I managed to get the values to move smoothly.