Skip to content

Commit 5d11571

Browse files
authored
figure max-width: initial (#604)
1 parent 2014284 commit 5d11571

File tree

5 files changed

+4
-34
lines changed

5 files changed

+4
-34
lines changed

src/plot.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export function plot(options = {}) {
103103
const legends = Legends(scaleDescriptors, options);
104104
if (caption != null || legends.length > 0) {
105105
figure = document.createElement("figure");
106+
figure.style.maxWidth = "initial";
106107
figure.append(...legends, svg);
107108
if (caption != null) {
108109
const figcaption = document.createElement("figcaption");

test/output/caltrain.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure>
1+
<figure style="max-width: initial;">
22
<div class="plot" style="
33
--swatchWidth: 15px;
44
--swatchHeight: 15px;

test/output/figcaption.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" font-variant="tabular-nums" 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 style="max-width: initial;"><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" font-variant="tabular-nums" 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><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" font-variant="tabular-nums" 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 style="max-width: initial;"><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" font-variant="tabular-nums" 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/policeDeaths.svg

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)