title: Calling getBBox for a SVG text element in a Seed Rust application
body: <p>I just made my first steps with WASM and <a href="https://seed-rs.org/" rel="nofollow noreferrer">Seed</a> which was a very smooth experience so far. I was able to create SVG using <code>svg!</code>, <code>circle!</code>, <code>text!</code>, ... and similar macros. To generate my SVG in the proper way, I have to measure text. My idea is to generate SVG text nodes and call <a href="https://developer.mozilla.org/en-US/docs/Web/API/SVGGraphicsElement/getBBox" rel="nofollow noreferrer">getBBox</a> on the node. I figured out that Seed is using <a href="https://rustwasm.github.io/wasm-bindgen/api/web_sys/index.html" rel="nofollow noreferrer">web_sys</a> and that <a href="https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.SvgTextContentElement.html#method.get_b_box" rel="nofollow noreferrer">getBBox is implemented there</a>.</p>
  <p>My problem is how to get from the <code>Node</code> created by <code>text!</code> to the <a href="https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.SvgTextElement.html" rel="nofollow noreferrer">SvgTextElement</a>. I tried to access the <code>node_ws</code> field, but it seems to be &quot;empty&quot;. It might not yet been created, but I don't now enough about the Seed internals.</p>
  <p>So how do I create a SVG text node so that I can call getBBox on it before generating the &quot;main&quot; SVG nodes?</p>