/** * Maximum number of closePath operations to accumulate before flushing * the canvas path with stroke(). This prevents superlinear rasterization * costs when gap data produces thousands of single-point segments. */ export declare const PATH_BATCH_SIZE = 1000; /** * Maximum number of arc operations to accumulate in a scatter dot loop * before flushing with fill(). Same rationale as PATH_BATCH_SIZE. */ export declare const ARC_BATCH_SIZE = 1000; /** * Creates a lightweight path context wrapper that periodically flushes the * accumulated canvas path by calling `stroke() + beginPath()` after a * threshold number of `closePath()` calls. * * d3-shape calls `closePath()` for every single-point segment when gap data * produces alternating defined/undefined patterns. Accumulating tens of * thousands of sub-paths in one `beginPath()→stroke()` cycle causes * superlinear rasterization cost. This wrapper breaks that accumulation * into manageable batches. * * The wrapper only flushes on `closePath()` boundaries, which mark the end * of a complete sub-path — so no visual artifacts are produced. * * @param ctx - The real canvas rendering context (must have stroke styles set before use) * @param batchSize - Number of closePath calls before flushing */ export declare function createBatchedStrokeContext(ctx: CanvasRenderingContext2D, batchSize: number): CanvasRenderingContext2D;