Skip to content

Fill & series

The fill service powers the Alt+drag fill handle and the Ctrl+D fill-down command.

API

ts
import { FillService } from '@ezygrid/core';

const fill = new FillService();

fill.fillRange(sheet, sourceRect, targetRect); // target must contain source
fill.fill(sheet, 'down', rect, targetEnd);     // 'down' | 'up' | 'right' | 'left'

Series inference

SourceResult
Two or more numeric seedsArithmetic progression continuation (1, 3 → 5, 7, 9…)
Single numberCopy
Text ending in digitsIncrement the suffix (Item 1 → Item 2)
Anything elseCopy
FormulasTranslated by fill delta (relative refs shift)

Fill handle UX

  • Plain drag from the corner handle = extend the selection (no writes).
  • Alt (Option on macOS) + drag = autofill — writes values, series, or translated formulas into the destination and can overwrite its contents.
  • A floating A1 range label shows the target rectangle while dragging.
  • Escape cancels the gesture at any point.

All fills are atomic, undoable history entries.

Released under the MIT License.