Skip to the content

Capsid menu

src/primitives/tick-gap.ts

11 lines and 1 functions in DrDustinEdwards/enarratio, at commit 4c5695a on 2026-10-24. This file on GitHub.

Functions

The functions of tick-gap.ts
FunctionLinesComplexityCoveredCRAPMutation
tickGap7 to 113100%OkCRAP 3Watch77.8%

Imports

It imports no other module of this repo. Imported by src/primitives/heat-strip.ts, src/primitives/uptime-strip.ts.

Source

/**
 * The space left between neighbouring ticks of a strip, in CSS pixels, from the width each
 * tick has. A tick of 3px or more keeps a 1px gap and one of 2px a half-pixel gap, so a
 * strip of many narrow periods still reads as separate periods instead of one solid bar;
 * narrower ticks touch, since a gap would leave nothing of the tick to see.
 */
export function tickGap(step: number): number {
  if (step >= 3) return 1;
  if (step >= 2) return 0.5;
  return 0;
}