
時間重み付き指数移動平均 (TWEMA) スムージング (デフォルト)
y 値の数) を考慮します。これにより、特性の異なる複数の線を同時に表示する場合でも、一貫したスムージングを適用できます。
以下は、このアルゴリズムが内部的にどのように動作しているかを示すサンプルコードです。

ガウシアン平滑化

ランニング平均スムージング

指数移動平均 (EMA) スムージング
- サンプリング
- グルーピング
- 式
- 単調でない x 軸
- 時間ベースの x 軸

元のデータを非表示にする

線グラフでは、スムージングを使ってノイズの多いデータの傾向を確認できます。

y 値の数) を考慮します。これにより、特性の異なる複数の線を同時に表示する場合でも、一貫したスムージングを適用できます。
以下は、このアルゴリズムが内部的にどのように動作しているかを示すサンプルコードです。
const smoothingWeight = Math.min(Math.sqrt(smoothingParam || 0), 0.999);
let lastY = yValues.length > 0 ? 0 : NaN;
let debiasWeight = 0;
return yValues.map((yPoint, index) => {
const prevX = index > 0 ? index - 1 : 0;
// VIEWPORT_SCALE は結果をチャートのx軸の範囲にスケーリングする
const changeInX =
((xValues[index] - xValues[prevX]) / rangeOfX) * VIEWPORT_SCALE;
const smoothingWeightAdj = Math.pow(smoothingWeight, changeInX);
lastY = lastY * smoothingWeightAdj + yPoint;
debiasWeight = debiasWeight * smoothingWeightAdj + 1;
return lastY / debiasWeight;
});



data.forEach(d => {
const nextVal = d;
last = last * smoothingWeight + (1 - smoothingWeight) * nextVal;
numAccum++;
debiasWeight = 1.0 - Math.pow(smoothingWeight, numAccum);
smoothedData.push(last / debiasWeight);

