Published
Edited
Mar 21, 2020
Insert cell
Insert cell
usdIndicator = `$${indicatorValue}`
Insert cell
//Форматирование, чтобы избавиться от косяков джава скрипта
indicatorValue = parseFloat(currentValue.toFixed(4))
Insert cell
//Интерполяция промежуточных значений
currentValue = (1 - t) * b0 + t * b1
Insert cell
//Значение ревардов на позапрошлом блоке
b0 = 1
Insert cell
//значение равардов на прошлом блоке
b1 = 200
Insert cell
// 5000 - это время между блоками, то есть период на протяжении которого нам нужно просчитывать промежуточные знаения
t = logicClock / 5000
Insert cell
//просто таймер
logicClock = {
let i;
yield (i = 0);
while (true) yield Promises.delay(1, ++i);
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more