Highlighted

Smooth transition in between values that are stored in a array

Community Beginner ,
Apr 18, 2020

Copy link to clipboard

Copied

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

 

Most Valuable Participant
Correct answer by Mylenium | Most Valuable Participant

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

Topics

Expressions

Views

46

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Smooth transition in between values that are stored in a array

Community Beginner ,
Apr 18, 2020

Copy link to clipboard

Copied

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

 

Most Valuable Participant
Correct answer by Mylenium | Most Valuable Participant

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

Topics

Expressions

Views

47

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Most Valuable Participant ,
Apr 18, 2020

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Community Beginner ,
Apr 27, 2020

Copy link to clipboard

Copied

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

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...