# animated_map { #brdr.viz.animated_map }

```python
viz.animated_map(
    aligner_results,
    dict_thematic,
    dict_reference,
    xlim,
    ylim,
    interval,
    filename,
)
```

Create a synchronized animation of map changes and area statistics.

This function generates a side-by-side animation: the left panel shows the
geometric alignment on a map (zoomed to thematic data), while the right
panel plots the percentage of area change as a function of the
'relevant distance' parameter.

## Parameters {.doc-section .doc-section-parameters}

| Name            | Type             | Description                                                                | Default    |
|-----------------|------------------|----------------------------------------------------------------------------|------------|
| aligner_results | [dict](`dict`)   | A nested dictionary structured as `{theme_id: {rel_dist: ProcessResult}}`. | _required_ |
| dict_thematic   | [dict](`dict`)   | Dictionary containing the original thematic geometries.                    | _required_ |
| dict_reference  | [dict](`dict`)   | Dictionary containing the reference geometries used for alignment.         | _required_ |
| xlim            | [float](`float`) | The maximum value for the X-axis (relevant distance) in the trend plot.    | _required_ |
| ylim            | [float](`float`) | The maximum value for the Y-axis (% area change) in the trend plot.        | _required_ |
| interval        | [int](`int`)     | Delay between frames in milliseconds.                                      | _required_ |
| filename        | [str](`str`)     | The output path/name for the saved animation (e.g., 'analysis.gif').       | _required_ |

## Returns {.doc-section .doc-section-returns}

| Name   | Type   | Description                                                                         |
|--------|--------|-------------------------------------------------------------------------------------|
|        | None   | The function saves the animation to the specified `filename` and displays the plot. |

## Notes {.doc-section .doc-section-notes}

To prevent "stray lines" in the trend plot during animation loops, the
data tracking lists are cleared whenever the animation restarts at the
first distance frame.