MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / setZoomRange

Method setZoomRange

src/worker/ChartGPUWorkerProxy.ts:1575–1606  ·  view source on GitHub ↗
(start: number, end: number)

Source from the content-addressed store, hash-verified

1573 }
1574
1575 setZoomRange(start: number, end: number): void {
1576 if (this.isDisposed) {
1577 return; // Silent no-op for disposed charts
1578 }
1579
1580 // Validate zoom range (percent space [0, 100])
1581 if (start < 0 || start > 100 || end < 0 || end > 100) {
1582 throw new ChartGPUWorkerError(
1583 `Invalid zoom range: [${start}, ${end}]. Values must be in [0, 100] (percent space).`,
1584 'INVALID_ARGUMENT',
1585 'setZoomRange',
1586 this.chartId
1587 );
1588 }
1589 if (start >= end) {
1590 throw new ChartGPUWorkerError(
1591 `Invalid zoom range: start (${start}) must be less than end (${end}).`,
1592 'INVALID_ARGUMENT',
1593 'setZoomRange',
1594 this.chartId
1595 );
1596 }
1597
1598 this.cachedZoomRange = { start, end };
1599
1600 this.sendMessage({
1601 type: 'setZoomRange',
1602 chartId: this.chartId,
1603 start,
1604 end,
1605 });
1606 }
1607
1608 /**
1609 * Gets the latest performance metrics from the worker.

Callers 1

createOverlaysMethod · 0.95

Calls 1

sendMessageMethod · 0.95

Tested by

no test coverage detected