diff --git a/capellambse_context_diagrams/__init__.py b/capellambse_context_diagrams/__init__.py index e3786726..11d35713 100644 --- a/capellambse_context_diagrams/__init__.py +++ b/capellambse_context_diagrams/__init__.py @@ -29,7 +29,7 @@ from capellambse.model.layers import ctx, la, oa, pa from capellambse.model.modeltypes import DiagramType -from . import context, styling +from . import _elkjs, context, styling try: __version__ = metadata.version("capellambse-context-diagrams") @@ -46,6 +46,18 @@ ATTR_NAME = "context_diagram" +def install_elk() -> None: + """Install elk.js and its dependencies into the local cache directory. + + When rendering a context diagram, elk.js will be installed + automatically into a persistent local cache directory. This function + may be called while building a container, starting a server or + similar tasks in order to prepare the elk.js execution environment + ahead of time. + """ + _elkjs._install_required_npm_pkg_versions() + + def init() -> None: """Initialize the extension.""" register_classes()