Interactive

class mappyng.interactive.InteractiveMap(svg_content)[source]

Bases: object

Interactive SVG map with hover tooltips.

Auto-renders in Jupyter via _repr_html_() and can be saved as a standalone HTML file.

__init__(svg_content)[source]
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=<factory>)[source]

Bases: object

Tooltip 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: object

Hover visual effect configuration for interactive SVG elements.

Effects are implemented via CSS transitions + SVG filters so they animate smoothly. Set enabled=False to disable all hover visuals (tooltip still works).

enabled

Master switch for hover effects.

Type:

bool

transition

CSS transition timing (applies to all animated properties).

Type:

str

opacity

Opacity on hover (< 1 = dim, > 1 ignored).

Type:

float

scale

Scale factor on hover (1.0 = no change).

Type:

float

shadow

Show a drop-shadow on hover.

Type:

bool

shadow_color

Shadow color.

Type:

str

shadow_dx

Shadow horizontal offset (SVG px).

Type:

float

shadow_dy

Shadow vertical offset (SVG px).

Type:

float

shadow_blur

Shadow blur radius (SVG px).

Type:

float

stroke_width_boost

Extra stroke-width on hover (added to existing, 0 = no change).

Type:

float

stroke_color

Override stroke color on hover (None = keep original).

Type:

str or None

__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)'