Skip to content

Commit c5b0a1a

Browse files
committed
title, subtitle (#1761)
* title, subtitle * better JSDoc links (scoped to this PR) * make the figure creation logic more readable (hopefully)
1 parent 3260b15 commit c5b0a1a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+960
-58
lines changed

docs/.vitepress/theme/custom.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,23 @@
3131
z-index: 1;
3232
}
3333

34+
.vp-doc .plot-figure {
35+
margin: 16px 0;
36+
}
37+
38+
.vp-doc .plot-figure h2,
39+
.vp-doc .plot-figure h3 {
40+
all: unset;
41+
display: block;
42+
}
43+
44+
.vp-doc .plot-figure h2 {
45+
line-height: 28px;
46+
font-size: 20px;
47+
font-weight: 600;
48+
letter-spacing: -0.01em;
49+
}
50+
3451
.vp-doc .plot a:hover {
3552
text-decoration: initial;
3653
}

docs/components/PlotRender.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,10 @@ export default {
212212
}
213213
if (typeof document !== "undefined") {
214214
const plot = Plot[method](options);
215-
const replace = (el) => el.firstChild.replaceWith(plot);
215+
const replace = (el) => {
216+
while (el.lastChild) el.lastChild.remove();
217+
el.append(plot);
218+
};
216219
return withDirectives(h("span", [toHyperScript(plot)]), [[{mounted: replace, updated: replace}]]);
217220
}
218221
return h("span", [Plot[method]({...options, document: new Document()}).toHyperScript()]);

docs/features/plots.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,15 +248,19 @@ When using facets, set the *fx* and *fy* scales’ **round** option to false if
248248

249249
## Other options
250250

251-
If a **caption** is specified, Plot.plot wraps the generated SVG element in an HTML figure element with a figcaption, returning the figure. To specify an HTML caption, the caption can be specified as an HTML element, say using the [`html` tagged template literal](http://github.com/observablehq/htl); otherwise, the specified string represents text that will be escaped as needed.
251+
By default, [plot](#plot) returns an SVG element; however, if the plot includes a title, subtitle, [legend](./legends.md), or caption, plot wraps the SVG element with an HTML figure element. You can also force Plot to generate a figure element by setting the **figure** option <VersionBadge pr="1761" /> to true.
252+
253+
The **title** & **subtitle** options <VersionBadge pr="1761" /> and the **caption** option accept either a string or an HTML element. If given an HTML element, say using the [`html` tagged template literal](http://github.com/observablehq/htl), the title and subtitle are used as-is while the caption is wrapped in a figcaption element; otherwise, the specified text will be escaped and wrapped in an h2, h3, or figcaption, respectively.
252254

253255
:::plot https://observablehq.com/@observablehq/plot-caption
254256
```js
255257
Plot.plot({
256-
caption: "Figure 1. A chart with a caption.",
258+
title: "For charts, an informative title",
259+
subtitle: "Subtitle to follow with additional context",
260+
caption: "Figure 1. A chart with a title, subtitle, and caption.",
257261
marks: [
258262
Plot.frame(),
259-
Plot.text(["Hello, world!"], {frameAnchor: "middle"})
263+
Plot.text(["Titles, subtitles, captions, and annotations assist inter­pretation by telling the reader what’s interesting. Don’t make the reader work to find what you already know."], {lineWidth: 30, frameAnchor: "middle"})
260264
]
261265
})
262266
```

src/plot.d.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,42 @@ export interface PlotOptions extends ScaleDefaults {
107107
*/
108108
className?: string;
109109

110+
/**
111+
* The figure title. If present, Plot wraps the generated SVG element in an
112+
* HTML figure element with the title in a h2 element, returning the figure.
113+
* To specify an HTML title, consider using the [`html` tagged template
114+
* literal][1]; otherwise, the specified string represents text that will be
115+
* escaped as needed.
116+
*
117+
* ```js
118+
* Plot.plot({
119+
* title: html`<h2 class="figure">This is a <i>fancy</i> title`,
120+
* marks: …
121+
* })
122+
* ```
123+
*
124+
* [1]: https://github.com/observablehq/htl
125+
*/
126+
title?: string | Node | null;
127+
128+
/**
129+
* The figure subtitle. If present, Plot wraps the generated SVG element in an
130+
* HTML figure element with the subtitle in a h3 element, returning the
131+
* figure. To specify an HTML subtitle, consider using the [`html` tagged
132+
* template literal][1]; otherwise, the specified string represents text that
133+
* will be escaped as needed.
134+
*
135+
* ```js
136+
* Plot.plot({
137+
* subtitle: html`<em>This is a <tt>fancy</tt> subtitle`,
138+
* marks: …
139+
* })
140+
* ```
141+
*
142+
* [1]: https://github.com/observablehq/htl
143+
*/
144+
subtitle?: string | Node | null;
145+
110146
/**
111147
* The figure caption. If present, Plot wraps the generated SVG element in an
112148
* HTML figure element with a figcaption, returning the figure. To specify an
@@ -125,6 +161,14 @@ export interface PlotOptions extends ScaleDefaults {
125161
*/
126162
caption?: string | Node | null;
127163

164+
/**
165+
* Whether to wrap the generated SVG element with an HTML figure element. By
166+
* default, this is determined by the presence of non-chart elements such as
167+
* legends, title, subtitle, and caption; if false, these non-chart element
168+
* options are ignored.
169+
*/
170+
figure?: boolean;
171+
128172
/**
129173
* The [aria-label attribute][1] on the SVG root.
130174
*

src/plot.js

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {initializer} from "./transforms/basic.js";
2020
import {consumeWarnings, warn} from "./warnings.js";
2121

2222
export function plot(options = {}) {
23-
const {facet, style, caption, ariaLabel, ariaDescription} = options;
23+
const {facet, style, title, subtitle, caption, ariaLabel, ariaDescription} = options;
2424

2525
// className for inline styles
2626
const className = maybeClassName(options.className);
@@ -320,18 +320,17 @@ export function plot(options = {}) {
320320
}
321321
}
322322

323-
// Wrap the plot in a figure with a caption, if desired.
323+
// Wrap the plot in a figure, if needed.
324324
const legends = createLegends(scaleDescriptors, context, options);
325-
if (caption != null || legends.length > 0) {
325+
const {figure: figured = title != null || subtitle != null || caption != null || legends.length > 0} = options;
326+
if (figured) {
326327
figure = document.createElement("figure");
327-
figure.style.maxWidth = "initial";
328-
for (const legend of legends) figure.appendChild(legend);
329-
figure.appendChild(svg);
330-
if (caption != null) {
331-
const figcaption = document.createElement("figcaption");
332-
figcaption.appendChild(caption?.ownerDocument ? caption : document.createTextNode(caption));
333-
figure.appendChild(figcaption);
334-
}
328+
figure.className = `${className}-figure`;
329+
figure.style.maxWidth = "initial"; // avoid Observable default style
330+
if (title != null) figure.append(createTitleElement(document, title, "h2"));
331+
if (subtitle != null) figure.append(createTitleElement(document, subtitle, "h3"));
332+
figure.append(...legends, svg);
333+
if (caption != null) figure.append(createFigcaption(document, caption));
335334
}
336335

337336
figure.scale = exposeScales(scaleDescriptors);
@@ -354,6 +353,19 @@ export function plot(options = {}) {
354353
return figure;
355354
}
356355

356+
function createTitleElement(document, contents, tag) {
357+
if (contents.ownerDocument) return contents;
358+
const e = document.createElement(tag);
359+
e.append(document.createTextNode(contents));
360+
return e;
361+
}
362+
363+
function createFigcaption(document, caption) {
364+
const e = document.createElement("figcaption");
365+
e.append(caption.ownerDocument ? caption : document.createTextNode(caption));
366+
return e;
367+
}
368+
357369
function plotThis({marks = [], ...options} = {}) {
358370
return plot({...options, marks: [...marks, this]});
359371
}

test/output/athletesSortNationality.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure style="max-width: initial;">
1+
<figure class="plot-d6a7b5-figure" style="max-width: initial;">
22
<div class="plot-swatches plot-swatches-wrap">
33
<style>
44
.plot-swatches {

test/output/athletesSortNullLimit.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure style="max-width: initial;">
1+
<figure class="plot-d6a7b5-figure" style="max-width: initial;">
22
<div class="plot-swatches plot-swatches-wrap">
33
<style>
44
.plot-swatches {

test/output/bigintOrdinal.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure style="max-width: initial;"><svg class="plot-ramp" font-family="system-ui, sans-serif" font-size="10" width="240" height="50" viewBox="0 0 240 50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1+
<figure class="plot-d6a7b5-figure" style="max-width: initial;"><svg class="plot-ramp" font-family="system-ui, sans-serif" font-size="10" width="240" height="50" viewBox="0 0 240 50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
22
<style>
33
.plot-ramp {
44
display: block;

test/output/caltrain.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure style="max-width: initial;">
1+
<figure class="plot-d6a7b5-figure" style="max-width: initial;">
22
<div class="plot-swatches plot-swatches-wrap">
33
<style>
44
.plot-swatches {

test/output/carsHexbin.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure style="max-width: initial;"><svg class="plot-ramp" font-family="system-ui, sans-serif" font-size="10" width="240" height="50" viewBox="0 0 240 50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1+
<figure class="plot-d6a7b5-figure" style="max-width: initial;"><svg class="plot-ramp" font-family="system-ui, sans-serif" font-size="10" width="240" height="50" viewBox="0 0 240 50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
22
<style>
33
.plot-ramp {
44
display: block;

test/output/carsJitter.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure style="max-width: initial;"><svg class="plot-ramp" font-family="system-ui, sans-serif" font-size="10" width="240" height="50" viewBox="0 0 240 50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1+
<figure class="plot-d6a7b5-figure" style="max-width: initial;"><svg class="plot-ramp" font-family="system-ui, sans-serif" font-size="10" width="240" height="50" viewBox="0 0 240 50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
22
<style>
33
.plot-ramp {
44
display: block;

test/output/colorPiecewiseLinearDomain.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure style="max-width: initial;"><svg class="plot-ramp" font-family="system-ui, sans-serif" font-size="10" width="240" height="50" viewBox="0 0 240 50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1+
<figure class="plot-d6a7b5-figure" style="max-width: initial;"><svg class="plot-ramp" font-family="system-ui, sans-serif" font-size="10" width="240" height="50" viewBox="0 0 240 50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
22
<style>
33
.plot-ramp {
44
display: block;

test/output/colorPiecewiseLinearDomainReverse.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure style="max-width: initial;"><svg class="plot-ramp" font-family="system-ui, sans-serif" font-size="10" width="240" height="50" viewBox="0 0 240 50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1+
<figure class="plot-d6a7b5-figure" style="max-width: initial;"><svg class="plot-ramp" font-family="system-ui, sans-serif" font-size="10" width="240" height="50" viewBox="0 0 240 50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
22
<style>
33
.plot-ramp {
44
display: block;

test/output/colorPiecewiseLinearRange.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure style="max-width: initial;"><svg class="plot-ramp" font-family="system-ui, sans-serif" font-size="10" width="240" height="50" viewBox="0 0 240 50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1+
<figure class="plot-d6a7b5-figure" style="max-width: initial;"><svg class="plot-ramp" font-family="system-ui, sans-serif" font-size="10" width="240" height="50" viewBox="0 0 240 50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
22
<style>
33
.plot-ramp {
44
display: block;

test/output/colorPiecewiseLinearRangeHcl.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure style="max-width: initial;"><svg class="plot-ramp" font-family="system-ui, sans-serif" font-size="10" width="240" height="50" viewBox="0 0 240 50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1+
<figure class="plot-d6a7b5-figure" style="max-width: initial;"><svg class="plot-ramp" font-family="system-ui, sans-serif" font-size="10" width="240" height="50" viewBox="0 0 240 50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
22
<style>
33
.plot-ramp {
44
display: block;

test/output/colorPiecewiseLinearRangeReverse.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure style="max-width: initial;"><svg class="plot-ramp" font-family="system-ui, sans-serif" font-size="10" width="240" height="50" viewBox="0 0 240 50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1+
<figure class="plot-d6a7b5-figure" style="max-width: initial;"><svg class="plot-ramp" font-family="system-ui, sans-serif" font-size="10" width="240" height="50" viewBox="0 0 240 50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
22
<style>
33
.plot-ramp {
44
display: block;

test/output/decathlon.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure style="max-width: initial;">
1+
<figure class="plot-d6a7b5-figure" style="max-width: initial;">
22
<div class="plot-swatches plot-swatches-wrap">
33
<style>
44
.plot-swatches {

test/output/dotSort.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<span>
2-
<figure style="max-width: initial;"><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="300" height="60" viewBox="0 0 300 60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
2+
<figure class="plot-d6a7b5-figure" style="max-width: initial;"><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="300" height="60" viewBox="0 0 300 60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
33
<style>
44
.plot {
55
display: block;
@@ -28,7 +28,7 @@
2828
<figcaption>default sort (r desc)</figcaption>
2929
</figure>
3030
<br>
31-
<figure style="max-width: initial;"><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="300" height="60" viewBox="0 0 300 60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
31+
<figure class="plot-d6a7b5-figure" style="max-width: initial;"><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="300" height="60" viewBox="0 0 300 60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3232
<style>
3333
.plot {
3434
display: block;
@@ -57,7 +57,7 @@
5757
<figcaption>sort by r</figcaption>
5858
</figure>
5959
<br>
60-
<figure style="max-width: initial;"><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="300" height="60" viewBox="0 0 300 60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
60+
<figure class="plot-d6a7b5-figure" style="max-width: initial;"><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="300" height="60" viewBox="0 0 300 60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
6161
<style>
6262
.plot {
6363
display: block;
@@ -86,7 +86,7 @@
8686
<figcaption>null sort</figcaption>
8787
</figure>
8888
<br>
89-
<figure style="max-width: initial;"><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="300" height="60" viewBox="0 0 300 60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
89+
<figure class="plot-d6a7b5-figure" style="max-width: initial;"><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="300" height="60" viewBox="0 0 300 60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
9090
<style>
9191
.plot {
9292
display: block;
@@ -115,7 +115,7 @@
115115
<figcaption>reverse</figcaption>
116116
</figure>
117117
<br>
118-
<figure style="max-width: initial;"><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="300" height="60" viewBox="0 0 300 60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
118+
<figure class="plot-d6a7b5-figure" style="max-width: initial;"><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="300" height="60" viewBox="0 0 300 60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
119119
<style>
120120
.plot {
121121
display: block;
@@ -144,7 +144,7 @@
144144
<figcaption>sort by x</figcaption>
145145
</figure>
146146
<br>
147-
<figure style="max-width: initial;"><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="300" height="60" viewBox="0 0 300 60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
147+
<figure class="plot-d6a7b5-figure" style="max-width: initial;"><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="300" height="60" viewBox="0 0 300 60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
148148
<style>
149149
.plot {
150150
display: block;
@@ -173,7 +173,7 @@
173173
<figcaption>reverse sort by x</figcaption>
174174
</figure>
175175
<br>
176-
<figure style="max-width: initial;"><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="300" height="60" viewBox="0 0 300 60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
176+
<figure class="plot-d6a7b5-figure" style="max-width: initial;"><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="300" height="60" viewBox="0 0 300 60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
177177
<style>
178178
.plot {
179179
display: block;

test/output/energyProduction.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure style="max-width: initial;">
1+
<figure class="plot-d6a7b5-figure" style="max-width: initial;">
22
<div class="plot-swatches plot-swatches-wrap">
33
<style>
44
.plot-swatches {

test/output/figcaption.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure style="max-width: initial;"><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="640" height="400" viewBox="0 0 640 400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1+
<figure class="plot-d6a7b5-figure" style="max-width: initial;"><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="640" height="400" viewBox="0 0 640 400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
22
<style>
33
.plot {
44
display: block;

test/output/figcaptionHtml.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure style="max-width: initial;"><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="640" height="400" viewBox="0 0 640 400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1+
<figure class="plot-d6a7b5-figure" style="max-width: initial;"><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="640" height="400" viewBox="0 0 640 400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
22
<style>
33
.plot {
44
display: block;

test/output/frameFillCategorical.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure style="max-width: initial;">
1+
<figure class="plot-d6a7b5-figure" style="max-width: initial;">
22
<div class="plot-swatches plot-swatches-wrap">
33
<style>
44
.plot-swatches {

test/output/frameFillQuantitative.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure style="max-width: initial;"><svg class="plot-ramp" font-family="system-ui, sans-serif" font-size="10" width="240" height="50" viewBox="0 0 240 50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1+
<figure class="plot-d6a7b5-figure" style="max-width: initial;"><svg class="plot-ramp" font-family="system-ui, sans-serif" font-size="10" width="240" height="50" viewBox="0 0 240 50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
22
<style>
33
.plot-ramp {
44
display: block;

test/output/hexbinR.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure style="max-width: initial;"><svg class="plot-ramp" font-family="system-ui, sans-serif" font-size="10" width="240" height="50" viewBox="0 0 240 50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1+
<figure class="plot-d6a7b5-figure" style="max-width: initial;"><svg class="plot-ramp" font-family="system-ui, sans-serif" font-size="10" width="240" height="50" viewBox="0 0 240 50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
22
<style>
33
.plot-ramp {
44
display: block;

test/output/hexbinSymbol.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure style="max-width: initial;">
1+
<figure class="plot-d6a7b5-figure" style="max-width: initial;">
22
<div class="plot-swatches plot-swatches-wrap">
33
<style>
44
.plot-swatches {

0 commit comments

Comments
 (0)