Open StarLederer opened 1 year ago
Might be a duplicate of #140 but that issue focuses entirely on CSS while this one entirely on the DOM
Thanks for making the issue. I'm really curious about being able to run plotting libraries server side like this:
import { DOMParser } from "https://deno.land/x/deno_dom/deno-dom-wasm.ts";
import * as Plot from "npm:@observablehq/plot"
const document = new DOMParser().parseFromString(
`<html>
<body>
<div id="root" />
</body>
</html>`,
"text/html",
);
Plot.barY(alphabet, {x: "letter", y: "frequency"}).plot({document})
which inevitably needs createElementNS
to work for SVG:
Error: createElementNS: "http://www.w3.org/2000/svg" namespace unimplemented
at HTMLDocument.createElementNS (https://deno.land/x/deno_dom@v0.1.38/src/dom/document.ts:244:13)
at Element.<anonymous> (file:///Users/kai/Library/Caches/deno/npm/registry.npmjs.org/d3-selection/3.0.0/src/creator.js:16:31)
at plot (file:///Users/kai/Library/Caches/deno/npm/registry.npmjs.org/@observablehq/plot/0.6.10/src/plot.js:156:30)
at BarY.plotThis [as plot] (file:///Users/kai/Library/Caches/deno/npm/registry.npmjs.org/@observablehq/plot/0.6.10/src/plot.js:370:10)
at <anonymous>:12:4:
Might be a duplicate of https://github.com/b-fuze/deno-dom/issues/140 but that issue focuses entirely on CSS while this one entirely on the DOM
No, it's not a duplicate of that issue. But it does coincide with that issue + #73 in general. I want to add XML support which will also require implementing namespaces as well
Awesome! Really looking forward to it
It looks like Namespaces are not currently supported.
Namespaces are not too common but are still sometimes found useful, e.g. when working with SVG, OOXML or other non-HTML XML formats.
Would it be possible to add support for this feature and implement functions such as
createAttributeNS
,createElementNS
,setAttributeNS
etc. so that deno-dom can be used in libraries that build and manipulate exotic (or not so much) XML formats?