spinetoolbox.spine_db_editor.widgets.graph_view_mixin
Contains the GraphViewMixin class.
Module Contents
Classes
Provides the graph view for the DB editor. |
|
Functions
|
|
|
|
|
|
|
|
|
- class spinetoolbox.spine_db_editor.widgets.graph_view_mixin.GraphViewMixin(*args, **kwargs)[source]
Provides the graph view for the DB editor.
- _refresh_icons(item_type, db_map_data)[source]
Runs when entity classes are added or updated in the db. Refreshes icons of entities in graph.
- Parameters
db_map_data (dict) – list of dictionary-items keyed by DiffDatabaseMapping instance.
- _graph_handle_entities_added(db_map_data)[source]
Runs when entities are added to the db. Adds the new entities to the graph if needed.
- Parameters
db_map_data (dict) – list of dictionary-items keyed by DiffDatabaseMapping instance.
- _graph_handle_entities_removed(db_map_data)[source]
Runs when entities are removed from the db. Rebuilds graph if needed.
- Parameters
db_map_data (dict) – list of dictionary-items keyed by DiffDatabaseMapping instance.
- _graph_handle_entities_updated(db_map_data)[source]
Runs when entities are updated in the db.
- Parameters
db_map_data (dict) – list of dictionary-items keyed by DiffDatabaseMapping instance.
- add_db_map_ids_to_items(db_map_data)[source]
Goes through entity items and adds the corresponding db_map ids. This could mean either restoring removed (db_map, id) tuples previously removed, or adding new (db_map, id) tuples.
- Parameters
db_map_data (dict(DiffDatabaseMapping, list)) – List of added items keyed by db_map
- Returns
tuples (db_map, id) that didn’t match any item in the view.
- Return type
list
- _handle_entity_tree_selection_changed_in_graph(selected)[source]
Stores the given selection of entity tree indexes and builds graph.
- build_graph(persistent=False)[source]
Builds graph from current selection of items.
- Parameters
persistent (bool, optional) – If True, elements in the current graph (if any) retain their position in the new one.
- _complete_graph(layout_gen_id, x, y)[source]
- Parameters
layout_gen_id (object) –
x (list) – Horizontal coordinates
y (list) – Vertical coordinates
- _update_selected_item_type_db_map_ids(selected_tree_inds)[source]
Upsates the dict mapping item type to db_map to selected ids.
- _get_item_property(db_map, entity_id, pname, time_line_index)[source]
Returns a tuple of (min_value, value, max_value) for given entity and property. Returns self.NOT_SPECIFIED if the property is not defined for the entity. Returns None if the property is not defined for any entity.
- Returns
tuple or None
- _make_layout_generator()[source]
Returns a layout generator for the current graph.
- Returns
GraphLayoutGeneratorRunnable
- _make_new_items(x, y)[source]
Makes new items for the graph.
- Parameters
x (list) –
y (list) –
- Returns
True if graph contains any items after the operation, False otherwise
- Return type
bool
- start_connecting_entities(db_map, entity_class, ent_item)[source]
Starts connecting entites with the given entity item.
- Parameters
db_map (DiffDatabaseMapping) –
entity_class (dict) –
ent_item (..graphics_items.EntityItem) –