Closed cyberwombat closed 10 months ago
I'm sure you're aware, but you can instead use a relative dimensional calculation if you're stuck on this. Pain in the butt, though, they should fix this to match JS.
const svgWidth = svg.viewbox().width;
const svgHeight = svg.viewbox().height;
const element = svg.rect(svgWidth, svgHeight);
Thanks that's a nice workaround. Was gonna extend the typings locally but struggling a bit with it so gonna use your suggestion
Bug report
I am converting project to TS and in my case the
rect
method doesn't accept percentages.Yields a TS error of "Agument of type 'string' is not assignable to parameter of type 'number'." I can make a fiddle if necessary but I think it's pretty clear. The TS definitions for all the shapes should accept strings as well.