Skip to content

Commit

Permalink
Revert "Fix scale_SVG (#180)"
Browse files Browse the repository at this point in the history
This reverts commit 9c906c6.
  • Loading branch information
parrt committed Mar 10, 2022
1 parent 9c906c6 commit 07e1d64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dtreeviz/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def scale_SVG(svg:str, scale:float) -> str:
Convert:
<svg ... height="382pt" viewBox="0.00 0.00 344.00 382.00" width="344pt">
<g class="graph" id="graph0" transform="scale(1.0 1.0) rotate(0) translate(4 378)">
<g class="graph" id="graph0" transform="scale(1 1) rotate(0) translate(4 378)">
To:
Expand All @@ -109,7 +109,7 @@ def scale_SVG(svg:str, scale:float) -> str:
ns = {"svg": "http://www.w3.org/2000/svg"}
graph = root.find(".//svg:g", ns) # get first node, which is graph
transform = graph.attrib['transform']
transform = transform.replace('scale(1.0 1.0)', f'scale({scale} {scale})')
transform = transform.replace('scale(1 1)', f'scale({scale} {scale})')
graph.set("transform", transform)

ET.register_namespace('', "http://www.w3.org/2000/svg")
Expand Down

0 comments on commit 07e1d64

Please sign in to comment.