plotomics
    Preparing search index...

    Function fitDomainTicks

    • Round ticks inside [lo, hi] for an axis or a colour bar lengthPx long: the most ticks, for up to maxCount intervals over the range, with at least minGapPx between neighbours. When even one interval puts them closer, only every k-th tick is kept, so no two labels touch. When that leaves one tick of a range with width, a pair of ticks takes its place if two labels fit: the first and last ticks of the coarsest step that puts them endGapPx from each other, a finer step bringing them nearer the ends of the range. Two labels alone need only to stay clear of each other (by default the pair asks minGapPx too), as for fitZeroTicks.

      Parameters

      • lo: number
      • hi: number
      • lengthPx: number
      • opts: { endGapPx?: number; maxCount?: number; minGapPx?: number } = {}

      Returns { step: number; ticks: number[] }