diff --git a/docs/reference-examples.json b/docs/reference-examples.json index 689cd8d..a3c9294 100644 --- a/docs/reference-examples.json +++ b/docs/reference-examples.json @@ -2,7 +2,7 @@ "schemaVersion": 2, "identity": { "name": "CRYChart", - "packageVersion": "1.0.1-opentest.30", + "packageVersion": "1.0.1-opentest.31", "entry": "examples/official/index.html" }, "count": 167, diff --git a/package-lock.json b/package-lock.json index 851d1df..59c2b34 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "crychart", - "version": "1.0.1-opentest.30", + "version": "1.0.1-opentest.31", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "crychart", - "version": "1.0.1-opentest.30", + "version": "1.0.1-opentest.31", "devDependencies": { "@types/node": "24.10.0", "esbuild": "0.25.12", diff --git a/package.json b/package.json index 7e0d905..21f8077 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "crychart", - "version": "1.0.1-opentest.30", + "version": "1.0.1-opentest.31", "description": "CRYChart chart engine with streaming data, interactive axes and WebGL rendering", "type": "module", "main": "./dist/crychart.cjs", diff --git a/src/axis.ts b/src/axis.ts index a51415e..ef625a1 100644 --- a/src/axis.ts +++ b/src/axis.ts @@ -660,7 +660,7 @@ export class Axis { /** Only the finite positive constant object maximum used by Preview is enforced. * Other restriction fields and callback enforcement retain their existing behavior. */ private supportedIntervalMax(): number | undefined { - if(this.type!=='linear'||this.chart.supportsAxisIntervalMaxRestrictions?.()!==true)return undefined; + if((this.type!=='linear'&&this.type!=='linear-highPrecision')||this.chart.supportsAxisIntervalMaxRestrictions?.()!==true)return undefined; const value=this.intervalRestriction; if(!value||typeof value!=='object'||Array.isArray(value))return undefined; const maximum=value.intervalMax; diff --git a/src/index.ts b/src/index.ts index 99e92a1..2005aa6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -79,7 +79,7 @@ export function cryChart(_options: Record = {}) { getChartCount: () => owned.size, }; } -export const version = "1.0.1-opentest.30"; +export const version = "1.0.1-opentest.31"; export class Dashboard { readonly root: HTMLDivElement; private cells = new Map(); diff --git a/tests/interval-max.test.ts b/tests/interval-max.test.ts index f4bb3bf..73c8fff 100644 --- a/tests/interval-max.test.ts +++ b/tests/interval-max.test.ts @@ -3,6 +3,20 @@ import assert from 'node:assert/strict'; import {ChartXY,Chart3D,Polar} from '../src/chart.js'; const fixture=()=>{const chart=new ChartXY(),axis=chart.getDefaultAxisX();axis.setScrollStrategy(undefined);return{chart,axis};}; +test('high precision waveform axes cap manual, fit and wheel ranges with preview enabled',()=>{ + const chart=new ChartXY({defaultAxisX:{type:'linear-highPrecision'}}),axis=chart.getDefaultAxisX(); + try{ + axis.setScrollStrategy(undefined).setIntervalRestrictions({intervalMax:15000}); + axis.setInterval({start:0,end:120000}); + assert.deepEqual(axis.getInterval(),{start:52500,end:67500}); + axis.setInterval({start:35000,end:45000}); + assert.equal(axis.limitIntervalZoomFactor(2),1.5); + const series=chart.addLineSeries();series.appendSamples({x:[0,120000],y:[1,2]}); + axis.fit();assert.ok(axis.getInterval().end-axis.getInterval().start<=15000); + axis.setIntervalRestrictions(undefined).setInterval({start:0,end:120000}); + assert.deepEqual(axis.getInterval(),{start:0,end:120000}); + }finally{chart.dispose();} +}); test('restriction setter is deferred; manual interval caps around the requested midpoint',()=>{ const {chart,axis}=fixture();try{ axis.setInterval({start:0,end:10000,stopAxisAfter:true});let changes=0;axis.on('intervalchange',()=>changes++);