How eurostat-map adapts to the room it has, and the rules the library follows so that it does.
src/core/layout-profile.js). window.innerWidth is only the fallback, when the container cannot be measured.min(795, container width), and the height follows the shape of
the map, not the height of the screen.'desktop' and 'compact'; every feature asks the same question
(isCompact(map)) instead of keeping its own breakpoint. The compact profile starts at a container width of
768 px.width(), height(), insetsButton(), legendButton() or
layout('desktop') is never overridden by the automatic profile.'auto' layout the map watches its container and
rebuilds when it crosses the breakpoint (or, without an explicit width(), when its width changes).touch-action: pan-y), a horizontal drag pans and two fingers pinch. A map must never trap the scroll of a page.| Setting | Default | Meaning |
|---|---|---|
layout() |
'auto' |
'auto', 'desktop' or 'compact'. |
legendCompactPosition() |
'below' |
'below' the map in the compact profile, or 'keep' where legend() puts them. |
insetsVisibilityBreakpoint() |
480 |
Container width at or below which insets start behind their button. |
legendVisibilityBreakpoint() |
480 |
Container width at or below which the legend starts behind its button (when legendButton is on). |
width() / height() |
container / auto | Explicit values are kept in every profile. |
The compact profile marks the map’s <svg> with the class em--compact, so CSS can follow it
(src/css/responsive.css). Tooltips are page elements and still follow the window with a media query.