Draws one callout per matching element, repeating text for every match.
Callouts follow their targets during scrolling and layout changes, and
appear in screenshots and recordings until cleared with
pz_annotate_clear(). They belong to the current document and disappear
on navigation. A bubble is kept within the viewport even if this moves it
away from the requested side; text that cannot fit a tiny viewport is
clipped. A viewport resize does not rewrap an existing callout. A
callout hides while its target isn't rendered, is visibility: hidden
with no visible descendants, or is entirely clipped by an overflow
container. When the target is partly clipped, the leader
points at its visible part; the bubble itself is never clipped.
Usage
pz_annotate_callout(
ctx,
text,
...,
target = NULL,
side = NULL,
leader = TRUE,
label = NULL,
reveal = c("pop", "fade", "draw", "slide", "wipe", "none"),
id = NULL,
color = NULL,
fill = NULL,
text_color = NULL,
stroke_width = NULL,
distance = NULL,
font_family = NULL,
font_size = NULL
)Arguments
- ctx
A paparazzi context.
- text
One nonempty string of literal text (not HTML).
- ...
Checked empty; reserved for future use.
- target
A selector,
pz_loc()spec, or list of targets.NULLuses the current scope, ordocument.bodyat the root.- side
A side (
"top","right","bottom","left") or a diagonal corner such as"top right".NULLchooses the cardinal side with the most room when drawn. The chosen side stays fixed.- leader
The line between the bubble and the target.
TRUE(the default) draws a line with an arrow at the target, equal toc(start = "none", end = "arrow");FALSEdraws no line, leaving a tooltip-style bubble. A named character vector sets a decoration for each end:startis the bubble side,endis the target side, and an omitted name defaults to"none". Decoration values are"none","arrow"(a filled triangle),"dot", or"bar"(a perpendicular tick). The shaft stops at each decoration's base, and short leaders shrink the decorations.- label
Optional badge;
TRUEnumbers the matches, while one string or number repeats for each match.NULLomits the badge.- reveal
"pop"(the default),"fade","draw","slide","wipe", or"none". Animates only during an active, unpaused recording; clearing plays the reverse."draw"draws the leader's shaft, then shows its decorations.- id
Optional nonempty id. Reusing it replaces its annotations;
NULLgenerates a unique id, so calls accumulate annotations."spotlight"and"caption"are reserved for other types.- color
Accent color for the bubble border, leader line and decorations;
NULLuses the staged annotation color.- fill, text_color
CSS colors for the bubble background and text (and the callout's badge);
NULLuses the stagedfill/text_colorfrompz_stage_annotate(). Without a staged value, the fill follows the resolvedcolor, and paparazzi chooses black or white text for the higher WCAG contrast ratio against the fill. Automatic contrast blends translucent fills over white, so settext_colorexplicitly with a translucent fill on a dark page.pz_annotate()mark badges do not use these; they follow their mark'scolorunless overridden per call withlabel_fill/label_text_color.- stroke_width
Leader line width in CSS pixels, or
NULLfor the stagedstroke_widthfrompz_stage_annotate(). Decoration sizes scale with it. Shared withpz_annotate()marks.- distance
Bubble-to-target gap in CSS pixels, or
NULLfor the stageddistancefrompz_stage_annotate(). Without either, the gap is 24 with a leader and 8 without one.- font_family
CSS font family;
NULLuses the staged default. A font object staged withpz_stage_fonts()is also accepted and resolves to its family with a sans-serif fallback.- font_size
Font size in CSS pixels;
NULLuses the staged default.
