Skip to content

Commit

Permalink
style: pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Mar 3, 2025
1 parent 6ede815 commit 6ee8282
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 23 deletions.
38 changes: 19 additions & 19 deletions docs/user-guide/notebooks/SVGHistogram.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -448,22 +448,22 @@
"\n",
" polylines = [\n",
" polyline(\n",
" points=f\"{3*20}, {3*20+105} \"\n",
" f\"{3*20+30}, {3*20+105} \"\n",
" f\"{3*20+30}, {3*20+95} \"\n",
" f\"{3*20+40}, {3*20+95} \"\n",
" f\"{3*20+40}, {3*20+70} \"\n",
" f\"{3*20+50}, {3*20+70} \"\n",
" f\"{3*20+50}, {3*20+52} \"\n",
" f\"{3*20+60}, {3*20+52} \"\n",
" f\"{3*20+60}, {3*20+45} \"\n",
" f\"{3*20+70}, {3*20+45} \"\n",
" f\"{3*20+70}, {3*20+65} \"\n",
" f\"{3*20+80}, {3*20+65} \"\n",
" f\"{3*20+80}, {3*20+95} \"\n",
" f\"{3*20+90}, {3*20+95} \"\n",
" f\"{3*20+90}, {3*20+105} \"\n",
" f\"{3*20+120}, {3*20+105} \",\n",
" points=f\"{3 * 20}, {3 * 20 + 105} \"\n",
" f\"{3 * 20 + 30}, {3 * 20 + 105} \"\n",
" f\"{3 * 20 + 30}, {3 * 20 + 95} \"\n",
" f\"{3 * 20 + 40}, {3 * 20 + 95} \"\n",
" f\"{3 * 20 + 40}, {3 * 20 + 70} \"\n",
" f\"{3 * 20 + 50}, {3 * 20 + 70} \"\n",
" f\"{3 * 20 + 50}, {3 * 20 + 52} \"\n",
" f\"{3 * 20 + 60}, {3 * 20 + 52} \"\n",
" f\"{3 * 20 + 60}, {3 * 20 + 45} \"\n",
" f\"{3 * 20 + 70}, {3 * 20 + 45} \"\n",
" f\"{3 * 20 + 70}, {3 * 20 + 65} \"\n",
" f\"{3 * 20 + 80}, {3 * 20 + 65} \"\n",
" f\"{3 * 20 + 80}, {3 * 20 + 95} \"\n",
" f\"{3 * 20 + 90}, {3 * 20 + 95} \"\n",
" f\"{3 * 20 + 90}, {3 * 20 + 105} \"\n",
" f\"{3 * 20 + 120}, {3 * 20 + 105} \",\n",
" style=\"fill:none;stroke:black;stroke-width:2\",\n",
" ),\n",
" ]\n",
Expand Down Expand Up @@ -538,8 +538,8 @@
" polygons.append(\n",
" polygon(\n",
" points=\"150, 125 \"\n",
" f\"{150+100*norm_vals[i] * math.cos(i * ang)}, {125+100*norm_vals[i] * math.sin(i * ang)} \"\n",
" f\"{150+100*norm_vals[i] * math.cos((i+1) * ang)}, {125+100*norm_vals[i] * math.sin((i+1) * ang)} \",\n",
" f\"{150 + 100 * norm_vals[i] * math.cos(i * ang)}, {125 + 100 * norm_vals[i] * math.sin(i * ang)} \"\n",
" f\"{150 + 100 * norm_vals[i] * math.cos((i + 1) * ang)}, {125 + 100 * norm_vals[i] * math.sin((i + 1) * ang)} \",\n",
" style=\"fill:none;stroke:black;stroke-width:2\",\n",
" )\n",
" )\n",
Expand All @@ -548,7 +548,7 @@
" circle(\n",
" cx=\"150\",\n",
" cy=\"125\",\n",
" r=f\"{30*min(norm_vals)}\",\n",
" r=f\"{30 * min(norm_vals)}\",\n",
" stroke=\"black\",\n",
" fill=\"white\",\n",
" stroke_width=\"3\",\n",
Expand Down
10 changes: 6 additions & 4 deletions src/hist/svgplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def svg_hist_1d(h: hist.BaseHist) -> svg:
upper,
label,
bins,
viewBox=f"-10 {-height-5} {width+20} {height+20}",
viewBox=f"-10 {-height - 5} {width + 20} {height + 20}",
)


Expand Down Expand Up @@ -142,7 +142,7 @@ def svg_hist_1d_c(h: hist.BaseHist) -> svg:
style="fill:none;stroke-width:2;stroke:currentColor",
)

return svg(bins, center, viewBox=f"{-width/2} {-height/2} {width} {height}")
return svg(bins, center, viewBox=f"{-width / 2} {-height / 2} {width} {height}")


def svg_hist_2d(h: hist.BaseHist) -> svg:
Expand Down Expand Up @@ -190,8 +190,10 @@ def svg_hist_2d(h: hist.BaseHist) -> svg:
h.axes[1],
x=-10,
y=-height / 2,
transform=f"rotate(-90,{-10},{-height/2})",
transform=f"rotate(-90,{-10},{-height / 2})",
),
]

return svg(*texts, *boxes, viewBox=f"{-20} {-height - 20} {width+40} {height+40}")
return svg(
*texts, *boxes, viewBox=f"{-20} {-height - 20} {width + 40} {height + 40}"
)

0 comments on commit 6ee8282

Please sign in to comment.