mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-26 17:09:28 +08:00
refactor(panel): unify settings and bridge contracts, prune dead code, and rename trajectory metrics
- Share settings normalization and window-bridge protocol contracts across frontend and backend - Encapsulate trajectory cache accessors inside config.mjs and validate bundle imports/syntax before writing - Remove dead selectors, unused symbols, duplicate re-export imports, and unmounted account tab instantiation - Rename speed-metrics.mjs to trajectory-metrics.mjs and audit-fixes.test.mjs to cross-module-regressions.test.mjs
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
|
||||
import { h, patchAttr, patchClasses, patchStyleVar, patchText } from '../../core/domPatch.js';
|
||||
import {
|
||||
formatMetric,
|
||||
formatTokens,
|
||||
formatTokensPrecise,
|
||||
formatUsd,
|
||||
@@ -422,21 +421,6 @@ export function computePublicationFit(
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算样本点上的平滑回归拟合值序列(供单元测试与轻量调用直接读取)。
|
||||
*
|
||||
* @param {number[]} ys
|
||||
* @param {{ minVal?: number, maxVal?: number, xs?: number[] }} [bounds]
|
||||
* @returns {number[]}
|
||||
*/
|
||||
export function computeLoessFit(ys, { minVal = 0, maxVal = Infinity, xs = null } = {}) {
|
||||
const n = Array.isArray(ys) ? ys.length : 0;
|
||||
if (n === 0) return [];
|
||||
const xArr =
|
||||
Array.isArray(xs) && xs.length === n ? xs : Array.from({ length: n }, (_, idx) => idx);
|
||||
return computePublicationFit(xArr, ys, { minVal, maxVal }).sampleFits;
|
||||
}
|
||||
|
||||
/**
|
||||
* Heckbert 科学坐标轴刻度取整算法,生成科研图表风格的均匀整洁刻度。
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user