d2/d2renderers/d2sketch/setup.js

20 lines
416 B
JavaScript
Raw Normal View History

2022-12-21 07:43:45 +00:00
const root = {
ownerDocument: {
createElementNS: (ns, tagName) => {
const children = [];
const attrs = {};
const style = {};
return {
style,
tagName,
attrs,
setAttribute: (key, value) => (attrs[key] = value),
appendChild: (node) => children.push(node),
children,
};
},
},
};
const rc = rough.svg(root, { seed: 1 });
let node;