Interactive¶
- class mappyng.interactive.InteractiveMap(svg_content)[source]¶
Bases:
objectInteractive SVG map with hover tooltips.
Auto-renders in Jupyter via
_repr_html_()and can be saved as a standalone HTML file.- save(path, title='Interactive Map')[source]¶
Save as standalone HTML file.
- Parameters:
path (str) – Output file path.
title (str) – HTML page title.
- Return type:
None
- property svg: str¶
Raw SVG markup with embedded JavaScript.
- class mappyng.interactive.TooltipStyle(background='rgba(30,30,30,0.92)', text_color='#fff', font_size=11, font_family='-apple-system,BlinkMacSystemFont,sans-serif', border_radius=4, border_color='rgba(255,255,255,0.15)', key_weight='600', hover=HoverEffect())[source]¶
Bases:
objectTooltip appearance configuration.
All fields map directly to CSS/SVG style properties injected into the tooltip
<script>block.- __init__(background='rgba(30, 30, 30, 0.92)', text_color='#fff', font_size=11, font_family='-apple-system, BlinkMacSystemFont, sans-serif', border_radius=4, border_color='rgba(255, 255, 255, 0.15)', key_weight='600', hover=<factory>)¶
- background: str = 'rgba(30,30,30,0.92)'¶
- border_color: str = 'rgba(255,255,255,0.15)'¶
- border_radius: int = 4¶
- font_family: str = '-apple-system,BlinkMacSystemFont,sans-serif'¶
- font_size: int = 11¶
- hover: Any¶
True (defaults), False (disabled), or dict.
- Type:
Hover effect config
- key_weight: str = '600'¶
- text_color: str = '#fff'¶
- class mappyng.interactive.HoverEffect(enabled=True, transition='all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94)', opacity=1.0, scale=1.0, shadow=False, shadow_color='rgba(0,0,0,0.35)', shadow_dx=0.0, shadow_dy=4.0, shadow_blur=8.0, stroke_width_boost=1.0, stroke_color='#333333')[source]¶
Bases:
objectHover visual effect configuration for interactive SVG elements.
Effects are implemented via CSS transitions + SVG filters so they animate smoothly. Set
enabled=Falseto disable all hover visuals (tooltip still works).- Parameters:
enabled (bool) – Master switch for hover effects.
transition (str) – CSS transition timing (applies to all animated properties).
opacity (float) – Opacity on hover (< 1 = dim, > 1 ignored).
scale (float) – Scale factor on hover (1.0 = no change).
shadow (bool) – Show a drop-shadow on hover.
shadow_color (str) – Shadow color.
shadow_dx (float) – Shadow horizontal offset (SVG px).
shadow_dy (float) – Shadow vertical offset (SVG px).
shadow_blur (float) – Shadow blur radius (SVG px).
stroke_width_boost (float) – Extra stroke-width on hover (added to existing, 0 = no change).
stroke_color (str or None) – Override stroke color on hover (None = keep original).
- __init__(enabled=True, transition='all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94)', opacity=1.0, scale=1.0, shadow=False, shadow_color='rgba(0,0,0,0.35)', shadow_dx=0.0, shadow_dy=4.0, shadow_blur=8.0, stroke_width_boost=1.0, stroke_color='#333333')¶
- enabled: bool = True¶
- opacity: float = 1.0¶
- scale: float = 1.0¶
- shadow: bool = False¶
- shadow_blur: float = 8.0¶
- shadow_color: str = 'rgba(0,0,0,0.35)'¶
- shadow_dx: float = 0.0¶
- shadow_dy: float = 4.0¶
- stroke_color: str | None = '#333333'¶
- stroke_width_boost: float = 1.0¶
- transition: str = 'all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94)'¶