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;
|
2025-01-15 23:30:17 +00:00
|
|
|
|
|
|
|
|
if (typeof globalThis !== 'undefined') {
|
|
|
|
|
globalThis.rc = rc;
|
|
|
|
|
}
|