Skip to content

Commit ab684ac

Browse files
committed
Avoid redundant full-extent sampling scans
Copilot review pointed out that the previous fast path still scanned when the processed data count matched the raw count, even if the base-axis scale already contained the data extent. The extent check alone is enough to decide whether a visible-window count is needed. This preserves the scan for dataZoom none/empty narrow windows, while avoiding it for the fully visible or already-filtered cases whose data extent is inside the current axis extent. Constraint: dataZoom none/empty can keep raw count while the visible axis window is narrow Rejected: Keep raw-count equality as a scan trigger | it regresses the fully visible common path Confidence: high Scope-risk: narrow Directive: Use the base-axis extent relationship, not raw-count equality, to decide whether the count scan is necessary Tested: git diff --check -- src/processor/dataSample.ts; npm run lint -- --quiet src/processor/dataSample.ts; npm run checktype -- --pretty false; Chrome headless HTML regression screenshot Not-tested: Full visual regression suite
1 parent 53fb219 commit ab684ac

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/processor/dataSample.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,7 @@ export default function dataSample(seriesType: string): StageHandler {
131131
const baseDim = data.mapDimension(baseAxis.dim);
132132
let dataCount = count;
133133
if (baseDim != null) {
134-
const rawCount = seriesModel.getRawData().count();
135-
if (count >= rawCount || !dataExtentInAxisExtent(data, baseAxis, baseDim)) {
134+
if (!dataExtentInAxisExtent(data, baseAxis, baseDim)) {
136135
dataCount = countDataInAxisExtent(data, baseAxis, baseDim);
137136
}
138137
}

0 commit comments

Comments
 (0)