Zoom & Callouts
Highlight or magnify specific parts of your diagram with zoom-based callouts.
In visual explanations, clarity often comes down to where a reader is looking—and how much detail they see. But there's a tension: if you zoom into a detail, you often lose the larger context. If you stay zoomed out, small but crucial parts become unreadable.
Zoom callouts solve this tension. They let you show detailed local structure without abandoning the global view.
Overview
When you want to magnify or "zoom in" on a region within your diagram—without obscuring the rest—Neural Sketch’s Zoom Module provides a clean solution. Built on (TikZ)'s spy
library, it simplifies the creation of callout expansions and inset magnifications right inside your figures.
Use \nskZoom
to highlight interesting details, show close-ups of crucial nodes, or visually emphasize components of your design—without leaving your overarching context.
Motivation
In research figures, it’s often not enough to just say "look here." You want to pull your reader’s attention into the precise detail, while preserving the full diagram. Zoom callouts solve that, giving you both an expanded local view and a contextual global view.
Basic Usage
Where from
and to
anchors define your callout location (the area being magnified) and your zoomed position on the canvas.
Example:
This says: "Zoom into the region at (3,2), enlarge it by 2×, and place the result at (6,3)."
You get a callout lens at the original spot and a zoomed version nearby. A connecting line links them, by default styled clean and subtle.
Anatomy of a Callout
A zoom callout consists of:
- Source Region — where you're looking.
- Zoom Target — where the enlargement is placed.
- Lens Style — what shape surrounds the focus area.
- Connecting Path — how the two views are linked.
You control each with simple parameters:
Expressive Controls
The \nskZoom
macro exposes a set of highly composable options:
Key | Purpose |
---|---|
at | Coordinate or anchor to magnify |
to | Coordinate to place the magnified view |
type | Shape of lens: circle , rectangle , etc. |
magnification | Scale factor for enlargement |
size | Size of both lens and zoom box |
callout-style | Border, fill, and line style of the lens |
zoomed-style | Styling of the zoom box |
zoomed-fill | Fill color of the zoom box |
connecting-style | Style of the path between lens and zoom box |
connecting-path | Custom route between the two (e.g., curved) |
id | Assign a reference name to the zoom element |
Advanced Composition
Custom Paths
Not all callouts are best connected with a straight line. Use TikZ
route syntax to bend or arc your connectors:
This lets you route paths around content or emphasize relationships more elegantly.
Arbitrary Shapes
Callout lenses support any \nskBlock
supported shape:
This is especially useful when the underlying content isn’t circular in nature.
In practice
This code shows how you can locate the portion of the line between A
and B
, then produce a circular callout lens around it with callout-style={very thick}
, connect it with a dashed line, and finally display the enlarged version at (6,2)
. All while controlling fill, border, and magnification.
(Auto) Layering
This supports layering through our nsk
python
connector. Raster images, or tensor vectors/embedding are individually encoded and annotated, and separetely rendered in Neural Sketch.
If we disable the automatic layering:
Advanced Control
1. Custom Path Connection
If you need more than a straight line to connect the callout to the zoomed region, define connecting-path
:
This modifies the path logic that draws the line between the callout lens and the magnified node. You can use any valid TikZ route expression, e.g. to[out=angleA, in=angleB]
.
2. Arbitrary Shapes
The type
key can be any shape recognized by TikZ, such as circle
, rectangle
, or a custom shape like diamond
or rounded rectangle
. For rectangular shapes, corners can be further configured:
3. Integrating With Bridging or Arrows
Though typically not needed, you can combine bridging or arrowheads in the connecting path if desired:
4. Setting an Explicit id
Assign an ID if you need to reference this zoom object later:
Best Practices
- Use minimal fill for the lens so the main figure remains visible beneath.
- Keep
magnification
moderate (1.5x–3x) unless extreme detail is required. - Keep your connecting lines clean—avoid crossing other elements if possible.
- For very detailed callouts, consider using
zoomed-fill=white
or a mild tinted background to ensure the magnified content stands out.
Design Tips
- Be selective. Don’t zoom everything—highlight only what adds value.
- Keep lines clean. Avoid crossing over unrelated content.
- Use white or neutral fill in zoomed boxes to improve contrast.
- Match lens shape to the visual structure underneath.
If in doubt, simpler is better.
If you’re layering multiple zoom callouts, maintain consistent styling or color scheme. That helps readers quickly parse and compare multiple highlights.
Reference Table
Prop | Type | Default |
---|---|---|
id? | string | {} |
type? | token list | circle |
at? | token list | {} |
to? | token list | {} |
magnification? | number | 2 |
size? | dimension | 2cm |
callout-style? | token list | {} |
connecting-style? | token list | {} |
callout-border-color? | token list | nskMidGray |
zoomed-style? | token list | {} |
zoomed-fill? | token list | nskLightestGray |
connecting-path? | token list | {} |