b299d32fc3
text nodes are the only elements that need to be "measured". The dimensions of all other image components can be determined based on the dimensions of their children. This adds a pre-rendering pass to work out dimensions so multiple renders don't need to happen
26 lines
342 B
JavaScript
26 lines
342 B
JavaScript
import Render from 'components/Render';
|
|
import layout from 'layout';
|
|
|
|
const parse = expr => {
|
|
return {
|
|
type: 'SVG',
|
|
children: [
|
|
{
|
|
type: 'Text',
|
|
props: {
|
|
quoted: true
|
|
},
|
|
children: [
|
|
`PCRE => ${ expr }`
|
|
]
|
|
}
|
|
]
|
|
};
|
|
};
|
|
|
|
export {
|
|
parse,
|
|
layout,
|
|
Render
|
|
};
|