Skip to content

Commit

Permalink
Use the JsCode object from the js_loader package
Browse files Browse the repository at this point in the history
  • Loading branch information
hansthen committed Jan 16, 2025
1 parent af03218 commit e7397ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
14 changes: 1 addition & 13 deletions folium/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
none_min,
write_png,
)
from js_loader import JsCode # noqa: F401

try:
import pandas as pd
Expand Down Expand Up @@ -436,19 +437,6 @@ def get_and_assert_figure_root(obj: Element) -> Figure:
return figure


class JsCode:
"""Wrapper around Javascript code."""

def __init__(self, js_code: Union[str, "JsCode"]):
if isinstance(js_code, JsCode):
self.js_code: str = js_code.js_code
else:
self.js_code = js_code

def __str__(self):
return self.js_code


def parse_font_size(value: Union[str, int, float]) -> str:
"""Parse a font size value, if number set as px"""
if isinstance(value, (int, float)):
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
branca>=0.6.0
jinja2>=2.9
js_loader
numpy
requests
xyzservices

0 comments on commit e7397ee

Please sign in to comment.