Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/reference-examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/axis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function cryChart(_options: Record<string, unknown> = {}) {
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<any, HTMLDivElement>();
Expand Down
14 changes: 14 additions & 0 deletions tests/interval-max.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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++);
Expand Down
Loading