MCPcopy
hub / github.com/python-visualization/folium / __init__

Method __init__

folium/map.py:541–576  ·  view source on GitHub ↗
(
        self,
        html: Union[str, Element, None] = None,
        parse_html: bool = False,
        max_width: Union[str, int] = "100%",
        show: bool = False,
        sticky: bool = False,
        lazy: bool = False,
        **kwargs: TypeJsonValue,
    )

Source from the content-addressed store, hash-verified

539 ) # noqa
540
541 def __init__(
542 self,
543 html: Union[str, Element, None] = None,
544 parse_html: bool = False,
545 max_width: Union[str, int] = "100%",
546 show: bool = False,
547 sticky: bool = False,
548 lazy: bool = False,
549 **kwargs: TypeJsonValue,
550 ):
551 super().__init__()
552 self._name = "Popup"
553 self.header = Element()
554 self.html = Element()
555 self.script = Element()
556
557 self.header._parent = self
558 self.html._parent = self
559 self.script._parent = self
560
561 script = not parse_html
562
563 if isinstance(html, Element):
564 self.html.add_child(html)
565 elif isinstance(html, str):
566 html = escape_backticks(html)
567 self.html.add_child(Html(html, script=script))
568
569 self.show = show
570 self.lazy = lazy
571 self.options = remove_empty(
572 max_width=max_width,
573 autoClose=False if show or sticky else None,
574 closeOnClick=False if sticky else None,
575 **kwargs,
576 )
577
578 def render(self, **kwargs):
579 """Renders the HTML representation of the element."""

Callers

nothing calls this directly

Calls 4

escape_backticksFunction · 0.90
remove_emptyFunction · 0.90
__init__Method · 0.45
add_childMethod · 0.45

Tested by

no test coverage detected