Utilities

s3dgraphy.utils.utils.files(package: ModuleType | str) Traversable[source]

Get a Traversable resource from a package

class s3dgraphy.utils.utils.StratigraphicNode(node_id, name, description='')[source]

Bases: Node

Base class for all stratigraphic units within the graph structure. Inherits from Node and provides additional functionality specific to stratigraphy.

node_type = 'StratigraphicNode'
__init__(node_id, name, description='')[source]
class s3dgraphy.utils.utils.StratigraphicUnit(node_id, name, description='')[source]

Bases: StratigraphicNode

node_type = 'US'
__init__(node_id, name, description='')[source]
class s3dgraphy.utils.utils.NegativeStratigraphicUnit(node_id, name, description='')[source]

Bases: StratigraphicNode

Negative Stratigraphic Unit (US negativa / USN).

Describes a lacuna, a removal, or an interface that marks the absence of matter rather than its presence — e.g. a pit cut, an erosion surface, a demolition void. Distinct from a plain StratigraphicUnit (which is positive by default), but equally observable on the ground: it is a real stratigraphic element, hence classified in the real family alongside StratigraphicUnit and DocumentaryStratigraphicUnit.

node_type = 'USN'
__init__(node_id, name, description='')[source]
class s3dgraphy.utils.utils.SeriesOfStratigraphicUnit(node_id, name, description='')[source]

Bases: StratigraphicNode

node_type = 'serSU'
__init__(node_id, name, description='')[source]
class s3dgraphy.utils.utils.SeriesOfNonStructuralVirtualStratigraphicUnit(node_id, name, description='')[source]

Bases: StratigraphicNode

node_type = 'serUSVn'
__init__(node_id, name, description='')[source]
class s3dgraphy.utils.utils.SeriesOfStructuralVirtualStratigraphicUnit(node_id, name, description='')[source]

Bases: StratigraphicNode

node_type = 'serUSVs'
__init__(node_id, name, description='')[source]
class s3dgraphy.utils.utils.SeriesOfDocumentaryStratigraphicUnit(node_id, name, description='')[source]

Bases: StratigraphicNode

node_type = 'serUSD'
__init__(node_id, name, description='')[source]
class s3dgraphy.utils.utils.NonStructuralVirtualStratigraphicUnit(node_id, name, description='')[source]

Bases: StratigraphicNode

node_type = 'USVn'
__init__(node_id, name, description='')[source]
class s3dgraphy.utils.utils.StructuralVirtualStratigraphicUnit(node_id, name, description='')[source]

Bases: StratigraphicNode

node_type = 'USVs'
__init__(node_id, name, description='')[source]
class s3dgraphy.utils.utils.SpecialFindUnit(node_id, name, description='')[source]

Bases: StratigraphicNode

node_type = 'SF'
__init__(node_id, name, description='')[source]
class s3dgraphy.utils.utils.VirtualSpecialFindUnit(node_id, name, description='')[source]

Bases: StratigraphicNode

node_type = 'VSF'
__init__(node_id, name, description='')[source]
class s3dgraphy.utils.utils.ReusedSpecialFind(node_id, name, description='')[source]

Bases: StratigraphicNode

Reused Special Find (RSF) — re-used architectural / decorative element (spolia) in archaeological reconstructions.

Typological cousin of SpecialFindUnit (SF) and VirtualSpecialFindUnit (VSF): all three render as octagons. RSF is distinguished by its red border (#9B3333) and a white fill, marking the element as physically present and re-deployed out of its original construction context.

Originating Development Project: DP-26 (spolia project, last DP before the EM 1.5 cut). Visual stencil shipped in the palette template at templates/em_palette_template.graphml.

node_type = 'RSF'
__init__(node_id, name, description='')[source]
class s3dgraphy.utils.utils.DocumentaryStratigraphicUnit(node_id, name, description='')[source]

Bases: StratigraphicNode

node_type = 'USD'
__init__(node_id, name, description='')[source]
class s3dgraphy.utils.utils.TransformationStratigraphicUnit(node_id, name, description='')[source]

Bases: StratigraphicNode

node_type = 'TSU'
__init__(node_id, name, description='')[source]
class s3dgraphy.utils.utils.WorkingUnit(node_id, name, description='')[source]

Bases: StratigraphicNode

node_type = 'UL'
__init__(node_id, name, description='')[source]
class s3dgraphy.utils.utils.StratigraphicEventNode(node_id, name, description='')[source]

Bases: StratigraphicNode

node_type = 'SE'
__init__(node_id, name, description='')[source]
class s3dgraphy.utils.utils.ContinuityNode(node_id, name, description='')[source]

Bases: StratigraphicNode

node_type = 'BR'
__init__(node_id, name, description='')[source]
s3dgraphy.utils.utils.debug_graph_structure(graph, node_id=None, max_depth=5, current_depth=0)[source]

Stampa informazioni dettagliate sulla struttura del grafo. Se node_id è specificato, si concentra sulle relazioni di quel nodo.

Parameters:
  • graph – Il grafo da analizzare

  • node_id – ID del nodo su cui concentrarsi (opzionale)

  • max_depth – Profondità massima di ricorsione

  • current_depth – Profondità corrente di ricorsione

s3dgraphy.utils.utils.convert_shape2type(yedtype, border_style, border_type='line')[source]

Converts YED node shape and border style to a specific stratigraphic node type.

Parameters:
  • yedtype (str) – The shape type of the node in YED.

  • border_style (str) – The border color of the node.

  • border_type (str) – The border line type (‘line’, ‘dashed’, etc.).

Returns:

A tuple with a short code for the node type and an extended description.

Return type:

tuple

s3dgraphy.utils.utils.get_stratigraphic_node_class(stratigraphic_type)[source]

Returns the stratigraphic node class corresponding to the specified type.

Parameters:

stratigraphic_type (str) – The type of stratigraphic unit.

Returns:

The corresponding stratigraphic node class.

Return type:

class

s3dgraphy.utils.utils.get_material_color(matname, rules_path=None)[source]

Ottiene i valori RGB per un dato tipo di materiale dal file di configurazione.

Parameters:
  • matname (str) – Nome del materiale/tipo di unità stratigrafica

  • rules_path (str, optional) – Percorso al file JSON delle regole. Se None, usa il path di default.

Returns:

(R, G, B, A) con valori tra 0 e 1 o None se il nodo non prevede un materiale

Return type:

tuple

s3dgraphy.utils.utils.get_document_vocabularies()[source]

Derive the three canonical Master-Document vocabularies from em_visual_rules.json.

Returns (DOCUMENT_ROLES, DOCUMENT_CONTENT_NATURES, DOCUMENT_GEOMETRIES) as tuples, reading from:

  • document_roles → keys (e.g. analytical, comparative)

  • document_content_natures → keys (e.g. 2d_object)

  • document_variant_styles → keys excluding default and any _comment entry (e.g. reality_based, observable, asserted)

The JSON is the single source of truth for the Master-Document classification vocabulary; adding a new value there flows through to constructor validation and UI dropdowns automatically.

s3dgraphy.utils.utils.get_document_variant_style(variant_key: str) dict[source]

Return the render-style dict for a DocumentNode variant key.

In EM 1.6 variant_key is a geometry value ("reality_based", "observable", "asserted") or "default" when the document has no RM — see DocumentNode.variant_style_key().

The returned dict includes at least border_color, border_style and border_width; callers consume whichever they need to emit yEd XML. An unknown key falls back to "default" so an exporter is never left without a style.

s3dgraphy.utils.utils.get_original_node_id(node)[source]

Recupera l’ID originale di un nodo.

Parameters:

node – Il nodo da cui estrarre l’ID originale

Returns:

L’ID originale o l’ID corrente se non disponibile

Return type:

str

s3dgraphy.utils.utils.get_original_node_name(node)[source]

Recupera il nome originale di un nodo (senza prefisso del grafo).

Parameters:

node – Il nodo da cui estrarre il nome originale

Returns:

Il nome originale o il nome corrente se non disponibile

Return type:

str

s3dgraphy.utils.utils.get_graph_code_from_node(node)[source]

Estrae il codice del grafo da un nodo.

Parameters:

node – Il nodo da cui estrarre il codice

Returns:

Il codice del grafo o None se non disponibile

Return type:

str

s3dgraphy.utils.utils.manage_id_prefix(name: str, graph_code: str = None, action: str = 'add', separator: str = '.') str[source]

Add or remove graph code prefix from element names.

This utility is useful for managing unique names when working with multiple graphs, especially when mapping to external systems with unique name constraints (e.g., 3D object names in Blender, database primary keys, file systems).

The function handles edge cases gracefully: - Adding a prefix when one already exists (replaces old prefix) - Removing prefix when none exists (returns name unchanged) - Handling empty or None values

Parameters:
  • name (str) – The name to modify

  • graph_code (str, optional) – The graph code to use as prefix. If None and action=’remove’, removes any existing prefix. Defaults to None.

  • action (str) – Operation to perform: ‘add’ or ‘remove’. Defaults to ‘add’.

  • separator (str) – Character(s) between prefix and name. Defaults to ‘.’.

Returns:

The modified name

Return type:

str

Raises:

ValueError – If action is not ‘add’ or ‘remove’

Examples

>>> manage_id_prefix('US001', 'VDL16', 'add')
'VDL16.US001'
>>> manage_id_prefix('VDL16.US001', 'VDL16', 'remove')
'US001'
>>> manage_id_prefix('GT15.US001', None, 'remove')
'US001'
>>> manage_id_prefix('GT15.US001', 'VDL16', 'add')
'VDL16.US001'
>>> manage_id_prefix('US001', None, 'add')
'US001'
>>> manage_id_prefix('', 'VDL16', 'add')
''
s3dgraphy.utils.utils.get_base_name(name: str, separator: str = '.') str[source]

Convenience function to extract base name without prefix.

This is a wrapper around manage_id_prefix with action=’remove’.

Parameters:
  • name (str) – The name potentially containing a prefix

  • separator (str) – Character(s) between prefix and name. Defaults to ‘.’.

Returns:

The base name without prefix

Return type:

str

Examples

>>> get_base_name('VDL16.US001')
'US001'
>>> get_base_name('US001')
'US001'
s3dgraphy.utils.utils.add_graph_prefix(name: str, graph_code: str, separator: str = '.') str[source]

Convenience function to add graph code prefix to a name.

This is a wrapper around manage_id_prefix with action=’add’.

Parameters:
  • name (str) – The name to add prefix to

  • graph_code (str) – The graph code to use as prefix

  • separator (str) – Character(s) between prefix and name. Defaults to ‘.’.

Returns:

The name with prefix added

Return type:

str

Examples

>>> add_graph_prefix('US001', 'VDL16')
'VDL16.US001'
s3dgraphy.utils.utils.get_ai_prompt(language: str = None, include_validation: bool = True, include_checklist: bool = True, include_stratigraphy_only: bool = False, documents_folder: str = None, document_list: list = None, dosco_in_place: bool = True, ai_has_filesystem_access: bool = True) str[source]

Build and return the StratiMiner extraction prompt (v5.1 schema).

Reads StratiMiner_Extraction_Prompt.md bundled inside the s3dgraphy package and produces a ready-to-paste prompt that instructs an AI assistant (Claude, ChatGPT, Gemini, …) to output a single em_data.xlsx file with the 5 typed sheets (Units, Epochs, Claims, Authors, Documents).

The prompt is now fully written in English: meta-instructions are universal, while the AI’s textual output (VALUE, EXTRACTOR excerpts, COMBINER_REASONING) is controlled by the language argument, substituted at the [OUTPUT_LANGUAGE] placeholder inside the prompt.

Parameters:
  • language – Output language for the values the AI writes into the xlsx (VALUE, EXTRACTOR, COMBINER_REASONING, DISPLAY_NAME). None / empty / “the same as the original document” → the AI is instructed to preserve each document’s original language on a per-claim basis.

  • include_validation – Include the embedded Python validation script. Default True.

  • include_checklist – Include the end-of-session checklist. Default True.

  • include_stratigraphy_only – Include the STRATIGRAPHY_ONLY appendix that describes the minimal flow for pre-existing archaeological databases (curator as sole author, no paradata chain). Default False.

  • documents_folder – Optional path to a folder of source PDFs; when provided, appended to the SOURCES PROVIDED section so the AI knows where to look.

  • document_list – Optional pre-catalogued document descriptors (each either a string or a dict with id / title / path).

  • dosco_in_place – When True (default) the AI renames files in place inside documents_folder with the D.NN_ prefix and uses the folder as the DosCo. When False the AI must treat the folder as read-only and produce the document catalog without actually renaming — the user will copy+rename offline.

  • ai_has_filesystem_access – When True (default) the AI is instructed to enumerate and read files from documents_folder. When False, the AI is told it won’t have filesystem access and should ask the user to upload the files into the conversation directly, with a data-sovereignty disclaimer.

Returns:

The assembled prompt ready to paste into an AI assistant.

Return type:

str

Raises:

FileNotFoundError – If the bundled prompt file cannot be located.

Visual Layout

Module for generating visual layouts for s3Dgraphy graphs using NetworkX.

This module provides functionality to generate hierarchical X, Y coordinates for nodes within a graph using NetworkX.

class s3dgraphy.utils.visual_layout.Graph(graph_id, name=None, description=None, audio=None, video=None, data=None)[source]

Bases: object

Class representing a graph containing nodes and edges.

graph_id

Unique identifier for the graph.

Type:

str

name

Dictionary of graph name translations.

Type:

dict

description

Dictionary of graph description translations.

Type:

dict

audio

Dictionary of audio file lists by language.

Type:

dict

video

Dictionary of video file lists by language.

Type:

dict

data

Additional metadata like geographical position.

Type:

dict

nodes

List of nodes in the graph.

Type:

List[Node]

edges

List of edges in the graph.

Type:

List[Edge]

warnings

List to accumulate warning messages during operations.

Type:

List[str]

__init__(graph_id, name=None, description=None, audio=None, video=None, data=None)[source]
property indices

Lazy loading degli indici con rebuild automatico se necessario

static validate_connection(source_node_type, target_node_type, edge_type)[source]

Validates if a connection type between two nodes is allowed by the rules.

Uses the v1.5.3 connections datamodel for validation.

Parameters:
  • source_node_type (str) – The type of the source node.

  • target_node_type (str) – The type of the target node.

  • edge_type (str) – The type of edge connecting the nodes.

Returns:

True if the connection is allowed, False otherwise.

Return type:

bool

add_warning(message)[source]

Adds a warning message to the warnings list.

add_node(node: Node, overwrite=False) Node[source]

Adds a node to the graph.

add_edge(edge_id: str, edge_source: str, edge_target: str, edge_type: str) Edge[source]

Adds an edge to the graph with connection validation.

Parameters:
  • edge_id (str) – Unique ID of the edge.

  • edge_source (str) – Source node ID.

  • edge_target (str) – Target node ID.

  • edge_type (str) – Type of edge, must be defined in the connection rules.

Returns:

The added edge.

Return type:

Edge

Raises:

ValueError – If the source or target node does not exist or if the edge is a duplicate.

connect_paradatagroup_propertynode_to_stratigraphic(verbose=False)[source]

Identifica le relazioni tra unità stratigrafiche e ParadataNodeGroup, poi collega direttamente le unità stratigrafiche ai PropertyNode contenuti nel ParadataNodeGroup.

Questa funzione permette due modalità di collegamento: 1. Collegamento diretto: Unità Stratigrafica -> PropertyNode (modalità già supportata nel codice esistente) 2. Collegamento indiretto: Unità Stratigrafica -> ParadataNodeGroup -> PropertyNode In questo caso, crea anche collegamenti diretti tra Unità Stratigrafica e PropertyNode

Il risultato è una rete semantica più ricca, dove ogni unità stratigrafica può accedere direttamente alle sue proprietà, indipendentemente dalla struttura organizzativa scelta dall’utente (collegamento diretto o tramite gruppo).

Parameters:

verbose (bool) – Se True, stampa messaggi dettagliati durante l’esecuzione. Utile per debug. Default: True

Returns:

Statistiche sulle operazioni eseguite (gruppi analizzati, collegamenti creati, ecc.)

Return type:

dict

display_warnings()[source]

Displays all accumulated warning messages.

find_node_by_id(node_id)[source]

Finds a node by ID.

✅ OPTIMIZATION: O(1) lookup using indices instead of O(n) iteration

find_edge_by_id(edge_id)[source]

Finds an edge by ID.

get_connected_nodes(node_id)[source]

Gets all nodes connected to a given node.

get_connected_edges(node_id)[source]

Gets all edges connected to a given node.

filter_nodes_by_connection_to_type(node_id, node_type)[source]

Filters nodes connected to a given node by node type.

get_nodes_by_type(node_type)[source]

Gets all nodes of a given type.

✅ OPTIMIZATION: O(1) lookup using type index instead of O(n) iteration

remove_node(node_id)[source]

Removes a node and all edges connected to it.

remove_edge(edge_id)[source]

Removes an edge from the graph.

update_node(node_id, **kwargs)[source]

Updates attributes of an existing node.

update_edge(edge_id, **kwargs)[source]

Updates attributes of an existing edge.

find_node_by_name(name)[source]

Cerca un nodo per nome.

Parameters:

name (str) – Nome del nodo da cercare.

Returns:

Il nodo trovato, o None se non esiste.

Return type:

Node

find_edge_by_nodes(source_id, target_id)[source]

Cerca un arco basato sugli ID dei nodi sorgente e destinazione.

Parameters:
  • source_id (str) – ID del nodo sorgente.

  • target_id (str) – ID del nodo destinazione.

Returns:

L’arco trovato, o None se non esiste.

Return type:

Edge

get_connected_node_by_type(node, node_type)[source]

Ottiene un nodo collegato di un determinato tipo.

Parameters:
  • node (Node) – Nodo di partenza.

  • node_type (str) – Tipo di nodo da cercare.

Returns:

Il nodo collegato del tipo specificato, o None se non trovato.

Return type:

Node

get_connected_epoch_node_by_edge_type(node, edge_type: str)[source]

Ottiene il nodo EpochNode connesso tramite un arco di tipo specifico.

Parameters:
  • node (Node) – Il nodo da cui partire.

  • edge_type (str) – Il tipo di arco da filtrare.

Returns:

Il nodo EpochNode connesso, oppure None se non trovato.

Return type:

EpochNode | None

✅ OPTIMIZATION: O(1) lookup using composite index instead of O(E) iteration

get_connected_epoch_nodes_list_by_edge_type(node, edge_type: str)[source]

Ottiene una lista di nodi EpochNode connessi tramite un arco di tipo specifico.

Parameters:
  • node (Node) – Il nodo da cui partire.

  • edge_type (str) – Il tipo di arco da filtrare.

Returns:

Lista di nodi EpochNode connessi.

Return type:

List[EpochNode]

✅ OPTIMIZATION: O(1) lookup using composite index instead of O(E) iteration

calculate_chronology(graph=None)[source]

Calculate chronology for all stratigraphic nodes in this graph.

Protocol (hierarchy: specific > local > general): 1. Assign base times from epoch associations (has_first_epoch, survive_in_epoch) 2. Override with specific property values (absolute_time_start, absolute_time_end) 3. Propagate TPQ/TAQ constraints through stratigraphic relations

Parameters:

graph – Deprecated, ignored. Kept for backwards compatibility.

get_property(node, rule_id, default=None)[source]

Resolve a propagative property on node via the registered rule.

Convenience wrapper around s3dgraphy.resolvers.resolve(). Walks the 3-level hierarchy (node > swimlane > graph) and returns the first non-null value, or default.

Example:

author = graph.get_property(node, "author")
start  = graph.get_property(node, "absolute_time_start")
Parameters:
  • node – The node to resolve the property for.

  • rule_id – Id of a registered PropagationRule (see s3dgraphy.resolvers.list_rules()).

  • default – Value to return when no level yields a non-null value.

Raises:

KeyError – If rule_id is not registered.

filter_nodes_by_time_range(*args)[source]

Filter stratigraphic nodes that overlap with a given time range.

Accepts:

filter_nodes_by_time_range(start_time, end_time) - new API filter_nodes_by_time_range(graph, start_time, end_time) - old API (graph ignored)

print_node_connections(node)[source]
get_connected_nodes_by_filters(node, target_node_type='all', edge_type='all')[source]

Ottiene una lista di nodi collegati in base ai filtri specificati su target_node_type ed edge_type.

Parameters:
  • node (Node) – Nodo di partenza.

  • target_node_type (str) – Tipo di nodo target da cercare (“all” per nessun filtro).

  • edge_type (str) – Tipo di edge da cercare (“all” per nessun filtro).

Returns:

Lista di nodi collegati che soddisfano i criteri specificati.

Return type:

list[Node]

get_connected_nodes_by_edge_type(node_id, edge_type)[source]

Ottiene tutti i nodi connessi a un nodo specifico tramite un tipo di edge.

Parameters:
  • node_id (str) – ID del nodo di partenza

  • edge_type (str) – Tipo di edge da filtrare

Returns:

Lista di nodi connessi attraverso il tipo di edge specificato

Return type:

list

✅ OPTIMIZATION: O(1) lookup using composite index instead of O(E) iteration

get_property_nodes_for_node(node_id)[source]

Ottiene tutti i nodi proprietà connessi a un nodo specifico.

Parameters:

node_id (str) – ID del nodo di partenza

Returns:

Lista di nodi proprietà connessi

Return type:

list

get_combiner_nodes_for_property(property_node_id)[source]

Ottiene tutti i nodi combiner connessi a un nodo proprietà.

Parameters:

property_node_id (str) – ID del nodo proprietà

Returns:

Lista di nodi combiner connessi

Return type:

list

✅ OPTIMIZATION: O(1) lookup using source index instead of O(E) iteration

get_extractor_nodes_for_node(node_id)[source]

Ottiene tutti i nodi extractor connessi a un nodo (proprietà o combiner).

Parameters:

node_id (str) – ID del nodo di partenza

Returns:

Lista di nodi extractor connessi

Return type:

list

get_document_nodes_for_extractor(extractor_node_id)[source]

Ottiene tutti i nodi documento connessi a un nodo extractor.

Parameters:

extractor_node_id (str) – ID del nodo extractor

Returns:

Lista di nodi documento connessi

Return type:

list

get_paradata_chain(strat_node_id)[source]

Ottiene la catena completa di paradata per un nodo stratigrafico.

Parameters:

strat_node_id (str) – ID del nodo stratigrafico

Returns:

Dizionario con le catene di paradata strutturate

Return type:

dict

refine_edge_types(verbose=False)[source]

Refines placeholder edge types to more specific semantic types based on the types of connected nodes.

This method applies the same logic as the GraphML importer’s enhance_edge_type() to edges that are already in memory, transforming placeholders into semantic edge types according to the s3Dgraphy datamodel.

Refines both: - ‘has_data_provenance’ (placeholder for GraphML ‘dashed’ edges) - ‘generic_connection’ (placeholder for runtime-created edges)

Parameters:

verbose (bool) – If True, prints details about refined edges

Returns:

Number of edges that were refined

Return type:

int

refine_generic_connections(verbose=False)[source]

Deprecated: Use refine_edge_types() instead.

class s3dgraphy.utils.visual_layout.Node(node_id, name, description='')[source]

Bases: object

Base class to represent a node in the graph.

node_id

Unique identifier for the node.

Type:

str

name

Name of the node.

Type:

str

node_type

Type of the node.

Type:

str

description

Description of the node.

Type:

str

attributes

Dictionary for additional attributes.

Type:

dict

node_type_map = {'ActivityNodeGroup': <class 's3dgraphy.nodes.group_node.ActivityNodeGroup'>, 'BR': <class 's3dgraphy.nodes.stratigraphic_node.ContinuityNode'>, 'EpochNode': <class 's3dgraphy.nodes.epoch_node.EpochNode'>, 'Group': <class 's3dgraphy.nodes.group_node.GroupNode'>, 'LocationNodeGroup': <class 's3dgraphy.nodes.group_node.LocationNodeGroup'>, 'ParadataNode': <class 's3dgraphy.nodes.paradata_node.ParadataNode'>, 'ParadataNodeGroup': <class 's3dgraphy.nodes.group_node.ParadataNodeGroup'>, 'RSF': <class 's3dgraphy.nodes.stratigraphic_node.ReusedSpecialFind'>, 'SE': <class 's3dgraphy.nodes.stratigraphic_node.StratigraphicEventNode'>, 'SF': <class 's3dgraphy.nodes.stratigraphic_node.SpecialFindUnit'>, 'StratigraphicNode': <class 's3dgraphy.nodes.stratigraphic_node.StratigraphicNode'>, 'TSU': <class 's3dgraphy.nodes.stratigraphic_node.TransformationStratigraphicUnit'>, 'TimeBranchNodeGroup': <class 's3dgraphy.nodes.group_node.TimeBranchNodeGroup'>, 'UL': <class 's3dgraphy.nodes.stratigraphic_node.WorkingUnit'>, 'US': <class 's3dgraphy.nodes.stratigraphic_node.StratigraphicUnit'>, 'USD': <class 's3dgraphy.nodes.stratigraphic_node.DocumentaryStratigraphicUnit'>, 'USN': <class 's3dgraphy.nodes.stratigraphic_node.NegativeStratigraphicUnit'>, 'USVn': <class 's3dgraphy.nodes.stratigraphic_node.NonStructuralVirtualStratigraphicUnit'>, 'USVs': <class 's3dgraphy.nodes.stratigraphic_node.StructuralVirtualStratigraphicUnit'>, 'VSF': <class 's3dgraphy.nodes.stratigraphic_node.VirtualSpecialFindUnit'>, 'author': <class 's3dgraphy.nodes.author_node.AuthorNode'>, 'author_ai': <class 's3dgraphy.nodes.author_node.AuthorAINode'>, 'combiner': <class 's3dgraphy.nodes.combiner_node.CombinerNode'>, 'document': <class 's3dgraphy.nodes.document_node.DocumentNode'>, 'embargo': <class 's3dgraphy.nodes.embargo_node.EmbargoNode'>, 'extractor': <class 's3dgraphy.nodes.extractor_node.ExtractorNode'>, 'geo_position': <class 's3dgraphy.nodes.geo_position_node.GeoPositionNode'>, 'graph': <class 's3dgraphy.nodes.graph_node.GraphNode'>, 'license': <class 's3dgraphy.nodes.license_node.LicenseNode'>, 'link': <class 's3dgraphy.nodes.link_node.LinkNode'>, 'property': <class 's3dgraphy.nodes.property_node.PropertyNode'>, 'representation_model': <class 's3dgraphy.nodes.representation_node.RepresentationModelNode'>, 'representation_model_doc': <class 's3dgraphy.nodes.representation_node.RepresentationModelDocNode'>, 'representation_model_sf': <class 's3dgraphy.nodes.representation_node.RepresentationModelSpecialFindNode'>, 'representation_node': <class 's3dgraphy.nodes.representation_node.RepresentationNode'>, 'serSU': <class 's3dgraphy.nodes.stratigraphic_node.SeriesOfStratigraphicUnit'>, 'serUSD': <class 's3dgraphy.nodes.stratigraphic_node.SeriesOfDocumentaryStratigraphicUnit'>, 'serUSVn': <class 's3dgraphy.nodes.stratigraphic_node.SeriesOfNonStructuralVirtualStratigraphicUnit'>, 'serUSVs': <class 's3dgraphy.nodes.stratigraphic_node.SeriesOfStructuralVirtualStratigraphicUnit'>, 'unknown': <class 's3dgraphy.nodes.stratigraphic_node.UnknownNode'>}
__init__(node_id, name, description='')[source]
node_type = 'Node'
add_attribute(key, value)[source]
s3dgraphy.utils.visual_layout.generate_layout(graph: Graph)[source]

Generates X, Y coordinates for nodes in a graph based on a hierarchical layout.

Parameters:

graph – An instance of the Graph class containing nodes and edges.

Returns:

A dictionary with node IDs as keys and (x, y) tuples as values representing node coordinates.

Raises:

ImportError – If NetworkX is not installed.