MCPcopy Create free account
hub / github.com/dcharatan/flowmap / _compute_offset

Function _compute_offset

flowmap/visualization/layout.py:75–82  ·  view source on GitHub ↗
(base: int, overlay: int, align: Alignment)

Source from the content-addressed store, hash-verified

73
74
75def _compute_offset(base: int, overlay: int, align: Alignment) -> slice:
76 assert base >= overlay
77 offset = {
78 "start": 0,
79 "center": (base - overlay) // 2,
80 "end": base - overlay,
81 }[align]
82 return slice(offset, offset + overlay)
83
84
85def overlay(

Callers 1

overlayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected