Source code for betty.extension.trees
"""Provide interactive family trees by integrating Betty with `Cytoscape.js <https://cytoscape.org/>`_."""
from __future__ import annotations
from collections.abc import Sequence
from pathlib import Path
from betty.app.extension import Extension, UserFacingExtension
from betty.extension.webpack import Webpack, WebpackEntrypointProvider
from betty.locale import Str
[docs]
class Trees(UserFacingExtension, WebpackEntrypointProvider):
[docs]
@classmethod
def name(cls) -> str:
return "betty.extension.Trees"
[docs]
@classmethod
def depends_on(cls) -> set[type[Extension]]:
return {Webpack}
[docs]
@classmethod
def assets_directory_path(cls) -> Path:
return Path(__file__).parent / "assets"
[docs]
@classmethod
def webpack_entrypoint_directory_path(cls) -> Path:
return Path(__file__).parent / "webpack"
[docs]
def webpack_entrypoint_cache_keys(self) -> Sequence[str]:
return ()
[docs]
@classmethod
def label(cls) -> Str:
return Str._("Trees")
[docs]
@classmethod
def description(cls) -> Str:
return Str._(
'Display interactive family trees using <a href="https://cytoscape.org/">Cytoscape</a>.'
)