#@ignore-def #@input :: String SVG, slurped #@output :: String SVG ## `debug` doesnt work in gojq # debug( # { # $relSize,$x, # $y, # }) | def viewBox: [ $relSize*$x, $relSize*$y, $viewBoxTile, $viewBoxTile ] | map(tostring) | join(" ") ; # TODO use precompiled with svgson def fixViewBox($baseSize; $relSize; $x; $y; $zoom; $viewBoxTile): # #minX="$(calc $relSize*$x)" # #minY="$(calc $relSize*$y)" # #viewBox="$minX $minY $viewBoxTile $viewBoxTile" # TODO mohol som to vypocitat v jq # # ($relSize*$x) as $minX | # ($relSize*$y) as $minY | # "\($minX) \($minY) \($viewBoxTile) \($viewBoxTile)" as $viewBox | viewBox as $viewBox | sub("height=\"([^/\"]+)\"";"height=\($baseSize|tostring|tojson)") | sub("width=\"([^/\"]+)\"";"width=\($baseSize|tostring|tojson)") | sub("viewBox=\"([^/\"]+)\"";"viewBox=\($viewBox|tojson)") | #gsub("";"") | #gsub("";"") | . ; # split("` element needs to be patched. its located before the first `` element. index("