# `Visualize.Scale.Linear`
[🔗](https://github.com/dcoai/Visualize/blob/v0.8.3/lib/visualize/scale/linear.ex#L1)

A continuous linear scale that maps a numeric domain to a numeric range.

Linear scales are the most common scale type, useful for quantitative data.

# `t`

```elixir
@type t() :: %Visualize.Scale.Linear{
  clamp?: boolean(),
  domain: [number()],
  range: [number()]
}
```

# `apply`

```elixir
@spec apply(t(), number()) :: float()
```

Applies the scale to a value

# `bandwidth`

```elixir
@spec bandwidth(t()) :: 0
```

Returns `0`: a linear scale has no bandwidth

# `clamp`

```elixir
@spec clamp(t(), boolean()) :: t()
```

Enables or disables clamping

# `domain`

```elixir
@spec domain(t(), [number()]) :: t()
```

Sets the domain

# `invert`

```elixir
@spec invert(t(), number()) :: float()
```

Inverts the scale

# `new`

```elixir
@spec new() :: t()
```

Creates a new linear scale

# `nice`

```elixir
@spec nice(t()) :: t()
```

Extends domain to nice round values

# `padding`

```elixir
@spec padding(t(), number()) :: t()
```

Identity: a linear scale has no padding

# `range`

```elixir
@spec range(t(), [number()]) :: t()
```

Sets the range

# `ticks`

```elixir
@spec ticks(t(), integer()) :: [number()]
```

Generates tick values

---

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