Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export function plot(options = {}) {
const legends = Legends(scaleDescriptors, options);
if (caption != null || legends.length > 0) {
figure = document.createElement("figure");
figure.style.maxWidth = "initial";
figure.append(...legends, svg);
if (caption != null) {
const figcaption = document.createElement("figcaption");
Expand Down
2 changes: 1 addition & 1 deletion test/output/caltrain.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<figure>
<figure style="max-width: initial;">
<div class="plot" style="
--swatchWidth: 15px;
--swatchHeight: 15px;
Expand Down
2 changes: 1 addition & 1 deletion test/output/figcaption.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<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">
<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">
<style>
.plot {
display: block;
Expand Down
2 changes: 1 addition & 1 deletion test/output/figcaptionHtml.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<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">
<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">
<style>
.plot {
display: block;
Expand Down
31 changes: 0 additions & 31 deletions test/output/policeDeaths.svg

This file was deleted.