add common imports

This commit is contained in:
Anton Nesterov 2024-09-24 19:49:09 +02:00
parent 2ab62c83a7
commit 7e0085ffbd
No known key found for this signature in database
GPG key ID: 59121E8AE2851FB5

View file

@ -1,4 +1,4 @@
import * as Plot from "npm:@observablehq/plot";
import * as _Plot from "npm:@observablehq/plot";
import { DOMParser, SVGElement } from "npm:linkedom";
const defaultPlotSettings = {
@ -17,6 +17,9 @@ export function configurePlots(options: any) {
Object.assign(defaultPlotSettings, options)
}
export const document = new DOMParser().parseFromString(`<!DOCTYPE html><html></html>`, "text/html");
export const Plot = _Plot;
/**
* Draw side-by-side plots
@ -43,7 +46,6 @@ export function sideBySidePlot(opts: {
cols: number,
options,
}) {
const document = new DOMParser().parseFromString(`<!DOCTYPE html><html></html>`, "text/html");
const imgTags: string[] = []
for (const xTarget of opts.x) {
for (const yTarget of opts.y) {