# `Nanodrop.Mode`

Protocol for measurement modes (DNA, Protein, etc.).

Each mode defines how to extract metadata from a spectrum and
generate SVG overlays for visualization.

# `t`

```elixir
@type t() :: term()
```

All the types that implement this protocol.

# `absorbance_at`

```elixir
@spec absorbance_at(map(), float()) :: float()
```

Find the absorbance value at a specific wavelength.

If the spectrum has `:corrected_absorbance`, uses that. Otherwise uses `:absorbance`.

# `metadata`

Extract metadata from a spectrum for this mode.

Returns a map of key-value pairs. Keys starting with underscore
are considered private/internal (e.g., `_baseline`, `_corrected_absorbance`).

# `overlays`

Generate SVG overlay elements from metadata.

The context map contains:
- `:scale_x` - function to convert wavelength to x pixel
- `:scale_y` - function to convert absorbance to y pixel
- `:x_off`, `:y_off` - chart offsets
- `:width`, `:height` - chart dimensions

Returns an SVG string to be inserted into the graph.

# `safe_ratio`

```elixir
@spec safe_ratio(float(), float()) :: float() | nil
```

Safely compute a ratio, returning nil if denominator is zero or near-zero.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
