pan is the template {{pan}} of my web and the gadget that drives it. A picture much wider than tall is shown across the whole white area at a chosen height and browsed with the mouse: dragged sideways, zoomed with Ctrl+wheel, its frame made taller or shorter with a corner grip, a strip under it showing the whole picture with the part in view. A plot can also be given with its tiles, and is then drawn again from its own data at every zoom, so that it stays sharp however far one goes into it. Several pictures of the same proportions can share one box and be gone through with Alt+wheel, each showing the same spot or each keeping its own view.
It was made for the figures of the one-atom lasing work, the skeletons of the eigenvalues: plots 9000 pixels wide and 630 high, whose detail is all in the width. As an ordinary thumbnail such a figure shrinks to a grey thread across the page, and in a box with a scrollbar it can only be read at the one scale it was drawn at. The photographs of Panorama had the same problem in a milder form, and all fourteen of them use it now.
Written with Claude on 24 October (2026), and taken up again on 30 October (2026) and 31 October (2026), then on 7 November (2026) and 8 November (2026) in a version tried out apart, which came here with the series on 18 November (2026). Version 1.25. The call is Template:Pan, which keeps only a short help; the box is written by Module:Pan (1.13) with the styles of Template:Pan/styles.css; what moves it is MediaWiki:Gadget-pan.js (1.25) with MediaWiki:Gadget-pan.css (1.15), switched on for everyone in MediaWiki:Gadgets-definition.
{{pan|Skeleton-lin-wide60-w0.12-0OG5J.png}}
{{pan|Skeleton-lin-wide60-w0.12-0OG5J.png|half}}
{{pan|Skeleton-lin-wide60-w0.12-0OG5J.png|h=250px|caption=The skeleton, linear scale}}
{{pan|Skeleton-lin-wide60-w0.12-0OG5J.png|half|zoom=-7|tip=Fig. (0OG5J)}}
{{pan|Skeleton-all-wide203-wfull-noblack-lines-0QFxd.jpg|630px|zoom=-7|at=0.275}}
{{pan|Skeleton-all-lines-dots-0RSRn-overview.png|630px|tiles=Skeleton-all-lines-dots-0RSRn-tiles.zip|zoom=fit}}
{{pan|A.png;B.png;C.png|400px|at=0.14|names=first;second;third}}
{{pan|Skeleton-all-lines-dots-0RSRn-overview.png|630px|view=x=0.4 y=0.5 zoom=0.3 frame=630}}
| Parameter | Meaning |
|---|---|
1 |
the file name, with or without File:; or several, separated by ;, for a series gone through in the same box (see Series), all of the proportions of the first
|
h (or 2) |
the height: full (default, the file's own height, so one pixel of the picture per pixel of screen), half, third, quarter, a fraction such as 0.4, a size in pixels such as 300 or 300px, or fit to shrink the whole picture into the box with no scrolling (the same as [[File:x|full]])
|
caption (or 3) |
an optional caption under the box |
zoom |
the zoom it opens at, in Ctrl+wheel notches from the height given: zoom=-7 opens it seven notches out; zoom=fit opens on the whole picture across the box. The frame keeps the height given, so zooming back in fills it again
|
at |
the point the opening view centres, as a share of the picture's width from its left edge: at=0.454 or at=45.4% (default: the middle); the key 0 returns there
|
tip |
a <wz> tooltip on the picture (a <wz> written around {{pan}} would hold nothing: MediaWiki moves the box out of it)
|
tiles |
a tile archive (a .zip uploaded as a file) made by pantiles from the data of the plot: the plot is then drawn from it at every zoom, see Tiles below; several, separated by ;, for plots of one layout gone through in the same box
|
names |
the names of the pictures of a series, separated by ;, shown on its buttons (default: the words of their file names they do not all share, an AF tag only when nothing else is left)
|
view |
the view the box opens on, as Ctrl+click on its pin copies it: x=β¦ y=β¦ zoom=β¦ frame=β¦, and as the case may be stretch=, case=, show=, hide=1, lock=0; a reader's own pin wins over it
|
A notch of zoom= is Chrome's standard wheel step (100 in deltaY); a real wheel may step differently, so the opening view of zoom=-7 is not necessarily the one seven notches of one's own wheel give.
view=β¦ for the page to open on.at= gives, at the zoom zoom= asks for.The box runs the whole white area (778px), bleeding through the 20px page padding on both sides as full does; in a π/β€ post it reaches past the indent of the post's <blockquote> to the same edges. A picture narrower than that at the chosen height is centred and does not scroll. The height is asked of MediaWiki as xNpx, so the thumbnail is made at that size (with 1.5Γ and 2Γ versions for sharp screens), never larger than the file. It also works in the previews of the π/β€ composer, its edit box and its revise box.
{{fig}} knows it: {{fig|0OG5J}} lands on a picture shown by {{pan}}, whose tip= serves as its caption, and a Ctrl-click on the picture puts that reference in the clipboard (MediaWiki:Gadget-fig.js, since its version 1.2).
The first argument may name several pictures, separated by ;. The first is drawn as ever, and is what a reader without JavaScript sees; the others come to the gadget with it, and one shows at a time in the same box. Alt+wheel over the picture goes to the next or the previous one, one picture a notch, however fast the wheel is turned; β and β do the same while the pointer is over the picture (or the box has the focus), and so do the buttons at the left end of the strip under the box, which name them. The pictures must have the proportions of the first (to 1 %), so that the same view of each is the same spot: Module:Pan refuses another.
The lock after the buttons says what a flip keeps. Locked, as the box opens, the zoom and the position go over to the next picture: the same spot of each, to see what changes from one to the next. Free, each picture keeps its own view: the view of one is put by when leaving it and found again when coming back to it (a picture not yet seen opens where the last one was). The pin and view= keep the lock with the rest.
Each picture is fetched when first asked for, the thumbnail at the height of the page, the file itself once zoomed past it, and is swapped in only once it is decoded, the one shown staying until then: a fast wheel never flashes white, and goes past those not yet in. After the first flip, the others are fetched one after the other, the nearest first, so that going through them is then immediate. A series of plots drawn from their data is given as several tile archives instead (tiles=A.zip;B.zip, below), with the same buttons, keys and lock.
The skeletons of the eleven campaigns of the one-atom laser, from uijin to teisatsu10, all on the axes of uijin (pumps 0.15β42.91g, Ο Β±29.05g); all but uijin and nijin stop at 12.51g, hence the opening at at=0.14. Teisatsu10 looks nearly empty because almost all its certified lines lie on Ο = 0.
A picture runs out of detail as soon as it is enlarged: zoom into a plot and its dots and lines swell into blurred blobs, and a figure big enough to hold the detail is past what MediaWiki will make thumbnails of (12.5 megapixels). With tiles=, {{pan}} draws a plot from its data instead. The tool ~/bin/pantiles runs the script that makes the figure, unchanged, keeps what it plots (dots, lines, line collections, scatters, the lines across the whole axes), and draws it again for every level of a zoom pyramid, each level twice the scale of the one below, with the dots and lines kept at the size in pixels they have in the figure: zooming in spreads the data out instead of magnifying the ink, so each level is as sharp at its own scale as the figure is at its. Above the figure's own scale it can also bring in what would only clutter the whole view, such as the dots of the computed points along interpolated lines. Text, images and patches of the figure are not tiled.
The levels are cut into tiles of 512 pixels and packed with their index into one zip, uploaded as a file like any other (the sync to the online wiki carries it as it carries any upload). The gadget fetches only the tiles in view, at the level the zoom asks for, out of that one file with HTTP Range requests, so a reader who never zooms never loads the deep levels; this was checked here and online, where the second request for a piece is already served from the cache in front of the site. Until a tile is in, what is at hand from the levels around stands in for it. The axes are drawn over the plot by the gadget, with ticks chosen for the zoom: the pump axis along the bottom of the view, the other along its left edge, both staying at their edge as the plot scrolls, the titles in the corners. Zoom runs from the whole plot across the box to a quarter past the deepest level. The file given first stays the picture of readers without JavaScript and the one a click opens; pantiles scene makes it, the same figure under the 12.5 megapixels. If the archive cannot be read, the box stays a plain {{pan}}.
pantiles scene skeleton-TAG.npz -- python3 code/panorama.py full 1.6 203.41 figs/skeleton-TAG 9.24
pantiles build skeleton-TAG.npz skeleton-TAG-tiles.zip --deep 4 --points-from +2
{{pan|Skeleton-TAG-overview.png|630px|tiles=Skeleton-TAG-tiles.zip|zoom=fit}}
--deep N levels are drawn above the figure's own scale (each doubles it; 4 = 16Γ), --points-from +N shows the dots only from N levels above it, --grow lets dots and lines thicken a little with each level, --jobs N draws on N processes. The tiles are PNGs of 64 colours, which cannot be told from full colour and weigh about half of 256. The archive must keep under the wiki's upload limit of 100 MB.
For the skeleton 0RSRn (pumps from 0.15 to 42.91g, 1.27 million dots and 62,000 lines), the scene took 8.5 minutes, nearly all of it the figure's own script, and each tile 50 to 100 ms: --deep 3 made 6,255 tiles, 30.7 MB, in 65 s, and --deep 4 22,498 tiles, 74.2 MB, in 213 s on four processes. Each extra level multiplies the tiles by about 3.5 and the size by 2.4, so --deep 5 would pass the upload limit.
Past the levels drawn as pictures, an archive made with --vector N (pantiles 1.1 and after) also holds the plot's own coordinates, cut into the cells of the deepest drawn level; the gadget draws those levels itself on canvases, in the colours and pixel widths of the figure, some 500 times deeper than the figure. With them the vertical axis can be stretched alone, Ctrl+Shift+wheel (or * and /), for a structure a hair off the axis (a few thousandths of g in the skeleton), and squeezed down to a plot 16 pixels tall; 0 undoes it with the zoom. In the top right corner of the view, a square of the screen with how much of each axis its sides span, and the ratio of the two in the axes' own units.
An archive of pantiles 1.3 and after knows which of its groups are points and which are lines, and holds the pictures of the points alone: a switch at the left end of the strip then shows the points, the lines, or both, at every zoom. With --hideable '#202020=sign unknown' (1.4) it names a colour the reader may hide, and holds the pictures without it, which a toggle beside the switch uses. With --name (1.5) it names itself: several archives of one layout, tiles=A.zip;B.zip, are then gone through in the same box as a series of pictures is, with the switches carried over.
MediaWiki makes no thumbnail of a file over 12.5 megapixels, except a JPEG, which ImageMagick scales: a skeleton of 16382Γ16382 pixels, 23.5 MB at quality 90, gave its 630, 945 and 1260 pixel thumbnails in 2.8 s (Fig. 0PQpi). WebP is accepted as an upload, but its thumbnails are made as PNG and the limit applies to them. A picture too big for a PNG therefore goes up as a JPEG; past what a JPEG holds, tiles.
{{pan|β¦|400px|zoom=fit|tip=β¦}}.at=0.275 (October (2026)#Y-0QKOY).[[File:x|xNpx|link={{filepath:x}}]] inside a div.lw-pan that scrolls sideways and takes the focus, and hands the gadget the file's width and what zoom=, at= and tiles= asked for as data- attributes. A height given as a share needs the file's own height, which only Lua can read (one "expensive" call per picture). The link= to the file itself is what keeps FancyBox from catching the click.scrollbar-width, overscroll-behavior, ::-webkit-scrollbar and :focus-visible (the page will not save), so what hides the scrollbar is in the gadget's own CSS, which loads only with its scriptβand that is also what leaves the scrollbar to a reader without JavaScript..mw-body with top:auto, so no script needs to position it; the gadget only levels it with the foot of the picture.wikipage.content (that would rebuild MathJax at every keystroke), so a MutationObserver binds a box wherever one turns up.data-series, a JSON list of each picture's name, the URL of its thumbnail at the page's height ({{filepath:x|W}}, made when the page is parsed) and that of the file. A flip swaps the picture element itself for one already decoded, so the scroll and the size, the same for all, need no change.<wz> tag: the gadget calls its Tip() and UnTip() as the pointer comes and goes, never the browser's own title.The gadget's numbers; the module's are in brackets where it changed.
mouse=hover) was tried and dropped for the drag (module 1.2).<blockquote> of a π/β€ post.zoom=N asks for (module 1.6).zoom=fit; tip= (module 1.7).at= (module 1.8).tiles= and the tool pantiles (module 1.9).view= (module 1.12).{{pan|A;B;C}} and names=; the lock; Alt+wheel one flip a notch; every tooltip a wz tooltip; 1.13 to 1.24 brought here (module 1.13, styles 1.15).The help on Template:Pan, at its version 1.10, was moved here on 16 November (2026), the template keeping a short one (1.11).