@crysound/crychart 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/README.zh-CN.md +12 -2
- package/dist/crychart.cjs +7 -4
- package/dist/crychart.global.js +7 -4
- package/dist/crychart.js +7 -4
- package/dist/types/index.d.ts +1 -1
- package/docs/npm-usage.md +1 -1
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -6,12 +6,12 @@ CRYChart is a **frontend rendering library built by CRYSOUND for OpenTest**, wri
|
|
|
6
6
|
|
|
7
7
|
Designed for OpenTest's data visualization needs, CRYChart provides streaming data rendering, interactive axes, cursors, and 2D and 3D charts. It uses WebGL2 for rendering, with a Canvas fallback.
|
|
8
8
|
|
|
9
|
-
Version `1.0.
|
|
9
|
+
Version `1.0.3` keeps live charts visible while their container is resized.
|
|
10
10
|
|
|
11
11
|
## Install in an application
|
|
12
12
|
|
|
13
13
|
```powershell
|
|
14
|
-
pnpm add --save-exact @crysound/crychart@1.0.
|
|
14
|
+
pnpm add --save-exact @crysound/crychart@1.0.3 --registry=https://registry.npmjs.org/
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
Commit the application's lockfile and use `pnpm install --frozen-lockfile` for repeatable installs. See the [npm usage guide](docs/npm-usage.md) for package entry points and migration from the old `crychart` name.
|
|
@@ -57,11 +57,21 @@ The package provides ES modules, CommonJS, a browser script, and TypeScript decl
|
|
|
57
57
|
npm run typecheck
|
|
58
58
|
npm test
|
|
59
59
|
npm run test:opentest-contract
|
|
60
|
+
npm run test:coverage
|
|
61
|
+
npm run test:api
|
|
60
62
|
npm run build
|
|
61
63
|
npm run test:browser
|
|
62
64
|
npm run test:gallery
|
|
63
65
|
```
|
|
64
66
|
|
|
67
|
+
`npm run test:coverage` runs both unit tests and OpenTest API contracts. c8/V8 measures all `src/**/*.ts` except `.d.ts` files. Coverage runs execute source modules through tsx without bundling or tree shaking, so uncalled functions remain measurable. Examples, test infrastructure and UI automation are outside this coverage scope.
|
|
68
|
+
|
|
69
|
+
CI and `npm run verify` enforce at least 96% line and statement coverage, 87% branch coverage and 98% function coverage, configured in `.c8rc.json`. Thresholds use CI's Node 22/V8 baseline; coverage may differ across Node major versions. Reports are written to `codex_artifact/coverage/`: `index.html`, `lcov.info`, `coverage-final.json` and `coverage-summary.json`. CI uploads the `code-coverage` artifact for 14 days, including generated reports when tests or coverage thresholds fail.
|
|
70
|
+
|
|
71
|
+
The [public API test inventory](docs/api-test-map.md) and `docs/api-test-map.json` link entrypoints to functional scenarios and assertion expressions. Entries distinguish `mapped`, `missing`, `placeholder` and `type-only`; a mapping does not establish every parameter combination or certify browser behavior.
|
|
72
|
+
|
|
73
|
+
Run `npm run test:coverage` followed by `npm run test:api`. The API gate checks passing, current-source test results, declarations, scenario references and retained assertions. All non-placeholder callable APIs, public fields and constants require asserted scenarios, including inherited members, factories and constructor-assigned `engine` objects. `publicValues`, `mappedValues` and `unassertedValues` report total, mapped and missing public values; CI requires `unassertedValues` to be zero. New fields, constants and APIs need scenarios before the map can be updated, and updating cannot erase existing value coverage. After intentional API or test changes, run `npm run api:map:update` and review the diff. Placeholder explanations and partial implementation limits are in `docs/api-test-policy.json`. CI uploads the `api-test-map` artifact for 14 days.
|
|
74
|
+
|
|
65
75
|
Browser tests use an installed, visible Chrome browser. Data and API tests do not replace visual, interaction, or performance tests. Performance results apply only to the recorded data volume, plot area, device pixel ratio, and machine configuration.
|
|
66
76
|
|
|
67
77
|
## License
|
package/README.zh-CN.md
CHANGED
|
@@ -6,12 +6,12 @@ CRYChart 是 **CRYSOUND 为 OpenTest 定制的前端渲染库**,基于 TypeScr
|
|
|
6
6
|
|
|
7
7
|
CRYChart 面向 OpenTest 的数据可视化场景,提供流式数据绘制、交互坐标轴、游标、二维和三维图表。绘图使用 WebGL2,并提供 Canvas 回退。
|
|
8
8
|
|
|
9
|
-
`1.0.
|
|
9
|
+
`1.0.3` 修复了连续调整容器大小时实时图表变空白的问题。
|
|
10
10
|
|
|
11
11
|
## 在应用中安装
|
|
12
12
|
|
|
13
13
|
```powershell
|
|
14
|
-
pnpm add --save-exact @crysound/crychart@1.0.
|
|
14
|
+
pnpm add --save-exact @crysound/crychart@1.0.3 --registry=https://registry.npmjs.org/
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
提交应用的锁文件,后续执行 `pnpm install --frozen-lockfile`。包入口和旧 `crychart` 包名的迁移方式见 [npm 使用说明](docs/npm-usage.md)。
|
|
@@ -55,11 +55,21 @@ context.dispose()
|
|
|
55
55
|
npm run typecheck
|
|
56
56
|
npm test
|
|
57
57
|
npm run test:opentest-contract
|
|
58
|
+
npm run test:coverage
|
|
59
|
+
npm run test:api
|
|
58
60
|
npm run build
|
|
59
61
|
npm run test:browser
|
|
60
62
|
npm run test:gallery
|
|
61
63
|
```
|
|
62
64
|
|
|
65
|
+
`npm run test:coverage` 合并运行单元测试和 OpenTest 接口合同,用 c8/V8 统计全部 `src/**/*.ts`(不含 `.d.ts`)。覆盖率模式通过 tsx 直接执行源码,避免打包裁剪未调用函数;示例、测试驱动和 UI 自动化不计入该代码覆盖率。
|
|
66
|
+
|
|
67
|
+
CI 和 `npm run verify` 均要求行覆盖率和语句覆盖率至少 96%、分支至少 87%、函数至少 98%,任一不足即失败。门槛配置在 `.c8rc.json`,以 CI 的 Node 22/V8 统计口径为准;不同 Node 主版本的覆盖率可能不同。HTML 报告为 `codex_artifact/coverage/index.html`,同时生成 `lcov.info`、`coverage-final.json` 和 `coverage-summary.json`;CI 的 `code-coverage` 附件保留 14 天,测试或门槛失败时也会上传已生成的报告。
|
|
68
|
+
|
|
69
|
+
公开 API 到场景、断言的完整盘点见 [API 测试清单](docs/api-test-map.md),机器可读版本为 `docs/api-test-map.json`。清单区分 `mapped`(有可追溯调用/显式绑定和断言)、`missing`(尚未绑定有效场景)、`placeholder`(兼容占位或有意为空的钩子)、`type-only`(类型声明)。绑定一个场景不表示该 API 的全部参数组合均已验证,浏览器用例不借用单元测试结果认证。
|
|
70
|
+
|
|
71
|
+
先运行 `npm run test:coverage`,再运行 `npm run test:api`,后者会核验本轮测试实际通过、源码指纹未变化、API 签名和测试引用有效、原有断言未被移除。所有非占位的可调用接口、公开字段和常量均要求有断言场景,包括继承成员、工厂方法和构造函数中赋值的 `engine` 对象。`publicValues`、`mappedValues`、`unassertedValues` 分别统计公开值总数、有场景映射及缺失映射的数量;CI 要求 `unassertedValues` 为零。新增字段/常量和 API 必须补场景后才允许更新清单,已有值映射也不能被更新命令抹除。修改测试或公开签名后,运行 `npm run api:map:update` 并审核清单差异;占位及部分实现的限制在 `docs/api-test-policy.json`。CI 上传 `api-test-map` 附件,保留 14 天。
|
|
72
|
+
|
|
63
73
|
浏览器测试使用已安装的可见 Chrome。数据和接口测试不能替代图像、交互及性能测试。性能结果只适用于记录中的数据量、绘图区、设备像素比和机器配置。
|
|
64
74
|
|
|
65
75
|
## 许可协议
|
package/dist/crychart.cjs
CHANGED
|
@@ -4148,11 +4148,11 @@ var Axis = class {
|
|
|
4148
4148
|
return this.stopped;
|
|
4149
4149
|
}
|
|
4150
4150
|
setAutoFit(value) {
|
|
4151
|
-
if (value && this.scrollStrategy == null) this.scrollStrategy = "fitting";
|
|
4151
|
+
if (value && (this.scrollStrategy == null || this.scrollStrategy === false)) this.scrollStrategy = "fitting";
|
|
4152
4152
|
return this.setStopped(!value);
|
|
4153
4153
|
}
|
|
4154
4154
|
getAutoFit() {
|
|
4155
|
-
return !this.stopped && this.scrollStrategy != null;
|
|
4155
|
+
return !this.stopped && this.scrollStrategy != null && this.scrollStrategy !== false;
|
|
4156
4156
|
}
|
|
4157
4157
|
setScrollStrategy(value) {
|
|
4158
4158
|
this.cancelScrollAnimation();
|
|
@@ -20796,7 +20796,10 @@ var ChartXY = class {
|
|
|
20796
20796
|
this.resize();
|
|
20797
20797
|
this.attachInteractions();
|
|
20798
20798
|
if (typeof ResizeObserver !== "undefined") {
|
|
20799
|
-
this.observer = new ResizeObserver(() =>
|
|
20799
|
+
this.observer = new ResizeObserver(() => {
|
|
20800
|
+
this.resize();
|
|
20801
|
+
this.renderNow();
|
|
20802
|
+
});
|
|
20800
20803
|
this.observer.observe(container);
|
|
20801
20804
|
}
|
|
20802
20805
|
}
|
|
@@ -25139,7 +25142,7 @@ function cryChart(_options = {}) {
|
|
|
25139
25142
|
getChartCount: () => owned2.size
|
|
25140
25143
|
};
|
|
25141
25144
|
}
|
|
25142
|
-
var version = "1.0.
|
|
25145
|
+
var version = "1.0.3";
|
|
25143
25146
|
var Dashboard = class {
|
|
25144
25147
|
root;
|
|
25145
25148
|
cells = /* @__PURE__ */ new Map();
|
package/dist/crychart.global.js
CHANGED
|
@@ -4148,11 +4148,11 @@ var CRYChart = (() => {
|
|
|
4148
4148
|
return this.stopped;
|
|
4149
4149
|
}
|
|
4150
4150
|
setAutoFit(value) {
|
|
4151
|
-
if (value && this.scrollStrategy == null) this.scrollStrategy = "fitting";
|
|
4151
|
+
if (value && (this.scrollStrategy == null || this.scrollStrategy === false)) this.scrollStrategy = "fitting";
|
|
4152
4152
|
return this.setStopped(!value);
|
|
4153
4153
|
}
|
|
4154
4154
|
getAutoFit() {
|
|
4155
|
-
return !this.stopped && this.scrollStrategy != null;
|
|
4155
|
+
return !this.stopped && this.scrollStrategy != null && this.scrollStrategy !== false;
|
|
4156
4156
|
}
|
|
4157
4157
|
setScrollStrategy(value) {
|
|
4158
4158
|
this.cancelScrollAnimation();
|
|
@@ -20796,7 +20796,10 @@ void main() {
|
|
|
20796
20796
|
this.resize();
|
|
20797
20797
|
this.attachInteractions();
|
|
20798
20798
|
if (typeof ResizeObserver !== "undefined") {
|
|
20799
|
-
this.observer = new ResizeObserver(() =>
|
|
20799
|
+
this.observer = new ResizeObserver(() => {
|
|
20800
|
+
this.resize();
|
|
20801
|
+
this.renderNow();
|
|
20802
|
+
});
|
|
20800
20803
|
this.observer.observe(container);
|
|
20801
20804
|
}
|
|
20802
20805
|
}
|
|
@@ -25139,7 +25142,7 @@ ${sample.position[0].toFixed(4)}, ${sample.position[1].toFixed(4)}`, contains: (
|
|
|
25139
25142
|
getChartCount: () => owned2.size
|
|
25140
25143
|
};
|
|
25141
25144
|
}
|
|
25142
|
-
var version = "1.0.
|
|
25145
|
+
var version = "1.0.3";
|
|
25143
25146
|
var Dashboard = class {
|
|
25144
25147
|
root;
|
|
25145
25148
|
cells = /* @__PURE__ */ new Map();
|
package/dist/crychart.js
CHANGED
|
@@ -3964,11 +3964,11 @@ var Axis = class {
|
|
|
3964
3964
|
return this.stopped;
|
|
3965
3965
|
}
|
|
3966
3966
|
setAutoFit(value) {
|
|
3967
|
-
if (value && this.scrollStrategy == null) this.scrollStrategy = "fitting";
|
|
3967
|
+
if (value && (this.scrollStrategy == null || this.scrollStrategy === false)) this.scrollStrategy = "fitting";
|
|
3968
3968
|
return this.setStopped(!value);
|
|
3969
3969
|
}
|
|
3970
3970
|
getAutoFit() {
|
|
3971
|
-
return !this.stopped && this.scrollStrategy != null;
|
|
3971
|
+
return !this.stopped && this.scrollStrategy != null && this.scrollStrategy !== false;
|
|
3972
3972
|
}
|
|
3973
3973
|
setScrollStrategy(value) {
|
|
3974
3974
|
this.cancelScrollAnimation();
|
|
@@ -20612,7 +20612,10 @@ var ChartXY = class {
|
|
|
20612
20612
|
this.resize();
|
|
20613
20613
|
this.attachInteractions();
|
|
20614
20614
|
if (typeof ResizeObserver !== "undefined") {
|
|
20615
|
-
this.observer = new ResizeObserver(() =>
|
|
20615
|
+
this.observer = new ResizeObserver(() => {
|
|
20616
|
+
this.resize();
|
|
20617
|
+
this.renderNow();
|
|
20618
|
+
});
|
|
20616
20619
|
this.observer.observe(container);
|
|
20617
20620
|
}
|
|
20618
20621
|
}
|
|
@@ -24955,7 +24958,7 @@ function cryChart(_options = {}) {
|
|
|
24955
24958
|
getChartCount: () => owned2.size
|
|
24956
24959
|
};
|
|
24957
24960
|
}
|
|
24958
|
-
var version = "1.0.
|
|
24961
|
+
var version = "1.0.3";
|
|
24959
24962
|
var Dashboard = class {
|
|
24960
24963
|
root;
|
|
24961
24964
|
cells = /* @__PURE__ */ new Map();
|
package/dist/types/index.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export declare function cryChart(_options?: Record<string, unknown>): {
|
|
|
51
51
|
/** Live charts owned by this context; disposed charts are released immediately. */
|
|
52
52
|
getChartCount: () => number;
|
|
53
53
|
};
|
|
54
|
-
export declare const version = "1.0.
|
|
54
|
+
export declare const version = "1.0.3";
|
|
55
55
|
export declare class Dashboard {
|
|
56
56
|
readonly root: HTMLDivElement;
|
|
57
57
|
private cells;
|
package/docs/npm-usage.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crysound/crychart",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "CRYChart chart engine with streaming data, interactive axes and WebGL rendering",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/crychart.cjs",
|
|
@@ -35,18 +35,23 @@
|
|
|
35
35
|
"build": "node scripts/build.mjs",
|
|
36
36
|
"typecheck": "tsc --noEmit",
|
|
37
37
|
"test": "node scripts/test.mjs",
|
|
38
|
+
"test:coverage": "c8 node scripts/test.mjs --coverage",
|
|
39
|
+
"test:api": "node scripts/check-api-tests.mjs",
|
|
40
|
+
"api:map:update": "node scripts/check-api-tests.mjs --update",
|
|
38
41
|
"test:browser": "node scripts/browser-test.mjs",
|
|
39
42
|
"test:gallery": "node scripts/test-gallery.mjs",
|
|
40
43
|
"test:opentest-contract": "node scripts/test.mjs --opentest",
|
|
41
44
|
"benchmark": "node scripts/benchmark.mjs",
|
|
42
45
|
"dev": "node scripts/serve.mjs",
|
|
43
|
-
"verify": "npm run typecheck && npm test && npm run build && npm run test:browser && npm run test:gallery"
|
|
46
|
+
"verify": "npm run typecheck && npm run test:coverage && npm run test:api && npm run build && npm run test:browser && npm run test:gallery"
|
|
44
47
|
},
|
|
45
48
|
"devDependencies": {
|
|
46
49
|
"@types/node": "24.10.0",
|
|
50
|
+
"c8": "10.1.3",
|
|
47
51
|
"esbuild": "0.25.12",
|
|
48
52
|
"playwright": "1.58.2",
|
|
49
53
|
"prettier": "3.6.2",
|
|
54
|
+
"tsx": "4.20.6",
|
|
50
55
|
"typescript": "5.9.3"
|
|
51
56
|
},
|
|
52
57
|
"engines": {
|