objektviz 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. objektviz-0.2.2/PKG-INFO +111 -0
  2. objektviz-0.2.2/README.md +92 -0
  3. objektviz-0.2.2/pyproject.toml +41 -0
  4. objektviz-0.2.2/setup.cfg +4 -0
  5. objektviz-0.2.2/src/objektviz/__init__.py +0 -0
  6. objektviz-0.2.2/src/objektviz/backend/BackendConfig.py +145 -0
  7. objektviz-0.2.2/src/objektviz/backend/SessionState.py +8 -0
  8. objektviz-0.2.2/src/objektviz/backend/__init__.py +0 -0
  9. objektviz-0.2.2/src/objektviz/backend/adaptors/__init__.py +0 -0
  10. objektviz-0.2.2/src/objektviz/backend/adaptors/kuzudb.py +326 -0
  11. objektviz-0.2.2/src/objektviz/backend/adaptors/neo4j.py +435 -0
  12. objektviz-0.2.2/src/objektviz/backend/adaptors/shared.py +358 -0
  13. objektviz-0.2.2/src/objektviz/backend/databse/AbstractRepository.py +358 -0
  14. objektviz-0.2.2/src/objektviz/backend/databse/DBEdge.py +0 -0
  15. objektviz-0.2.2/src/objektviz/backend/databse/DBNode.py +62 -0
  16. objektviz-0.2.2/src/objektviz/backend/databse/__init__.py +0 -0
  17. objektviz-0.2.2/src/objektviz/backend/dot_elements/AbstractDotEdge.py +116 -0
  18. objektviz-0.2.2/src/objektviz/backend/dot_elements/AbstractDotElement.py +79 -0
  19. objektviz-0.2.2/src/objektviz/backend/dot_elements/AbstractDotNode.py +92 -0
  20. objektviz-0.2.2/src/objektviz/backend/dot_elements/__init__.py +14 -0
  21. objektviz-0.2.2/src/objektviz/backend/dot_graph_builder.py +445 -0
  22. objektviz-0.2.2/src/objektviz/backend/filters/AbstractFilter.py +37 -0
  23. objektviz-0.2.2/src/objektviz/backend/filters/AndFilter.py +23 -0
  24. objektviz-0.2.2/src/objektviz/backend/filters/DummyFilter.py +20 -0
  25. objektviz-0.2.2/src/objektviz/backend/filters/MatchFilter.py +45 -0
  26. objektviz-0.2.2/src/objektviz/backend/filters/NotFilter.py +19 -0
  27. objektviz-0.2.2/src/objektviz/backend/filters/OrFilter.py +27 -0
  28. objektviz-0.2.2/src/objektviz/backend/filters/RangeFilter.py +38 -0
  29. objektviz-0.2.2/src/objektviz/backend/filters/__init__.py +17 -0
  30. objektviz-0.2.2/src/objektviz/backend/shaders/AbstractShader.py +107 -0
  31. objektviz-0.2.2/src/objektviz/backend/shaders/NormalizedShader.py +33 -0
  32. objektviz-0.2.2/src/objektviz/backend/shaders/PercentileShader.py +75 -0
  33. objektviz-0.2.2/src/objektviz/backend/shaders/RobustScalerShader.py +57 -0
  34. objektviz-0.2.2/src/objektviz/backend/shaders/__init__.py +14 -0
  35. objektviz-0.2.2/src/objektviz/backend/utils.py +31 -0
  36. objektviz-0.2.2/src/objektviz/frontend/__init__.py +148 -0
  37. objektviz-0.2.2/src/objektviz/streamlit/__init__.py +0 -0
  38. objektviz-0.2.2/src/objektviz/streamlit/components.py +918 -0
  39. objektviz-0.2.2/src/objektviz/streamlit/utils.py +74 -0
  40. objektviz-0.2.2/src/objektviz.egg-info/PKG-INFO +111 -0
  41. objektviz-0.2.2/src/objektviz.egg-info/SOURCES.txt +42 -0
  42. objektviz-0.2.2/src/objektviz.egg-info/dependency_links.txt +1 -0
  43. objektviz-0.2.2/src/objektviz.egg-info/requires.txt +11 -0
  44. objektviz-0.2.2/src/objektviz.egg-info/top_level.txt +1 -0
@@ -0,0 +1,111 @@
1
+ Metadata-Version: 2.4
2
+ Name: objektviz
3
+ Version: 0.2.2
4
+ Summary: ObjektViz is a visualizer for object-centric process models that enables users to explore and analyze even _very complex_ processes involving multiple interacting objects
5
+ Project-URL: Homepage, https://mamiksik.github.io/ObjektViz/
6
+ Project-URL: Repository, https://github.com/mamiksik/ObjektViz.git
7
+ Requires-Python: >=3.13
8
+ Description-Content-Type: text/markdown
9
+ Requires-Dist: graphviz>=0.21
10
+ Requires-Dist: kuzu>=0.11.3
11
+ Requires-Dist: matplotlib>=3.10.7
12
+ Requires-Dist: neo4j>=6.0.3
13
+ Requires-Dist: scikit-learn>=1.7.2
14
+ Requires-Dist: streamlit[charts]>=1.51.0
15
+ Requires-Dist: watchdog>=6.0.0
16
+ Provides-Extra: publish
17
+ Requires-Dist: build; extra == "publish"
18
+ Requires-Dist: twine; extra == "publish"
19
+
20
+ # 📦 ObjektViz
21
+
22
+ <p align="center">
23
+ <img src="assets/objektviz.png" alt="ObjektViz Screenshot" width="550px" align='center'/>
24
+ </p>
25
+
26
+ > ObjektViz is a visualizer for object-centric process models that enables users to explore and analyze even _very complex_ processes involving multiple interacting objects.
27
+
28
+ ## Features
29
+ - 🔍 **Interactive Visualization**: Explore object-centric process models with intuitive visualizations.
30
+ - 🤝 **Multi-Object Support**: Analyze processes involving multiple interacting objects seamlessly.
31
+ - ⚙️ **Customizable**: Every dataset, every process is different. ObjektViz allows you to customize visualizations to fit your data.
32
+ - 🧩 **Manage Complexity**: Designed to handle very complex processes without overwhelming the user.
33
+ - ▶️ **Token Replay**: Replay the flow of tokens through the process to understand dynamics and interactions, even for **multi-object** scenarios.
34
+ - 🔄 **Morphing Visualizations**: Smoothly transition between different views and representations of the process model to understand various aspects of the data.
35
+
36
+ ## Quick Start
37
+ ObjektViz has a lot of customization, and is built with the idea that you as a user will compose your own dashboard for the analysis you have at hand. However, to get you started quickly, we provide some example dashboards that you can run and explore.
38
+
39
+ In the examples we use KuzuDB, which works fine for small examples and the setup is easy. For real-world datasets, you might use Neo4J, but that requires more setup.
40
+ We have exported and processed some OCEL datasets into EKG and generated aggregated views (i.e. process models) for you to explore in the examples.
41
+
42
+ 1. Clone the repository:
43
+ ```bash
44
+ git clone git@github.com:mamiksik/ObjektViz.git
45
+ 2. Navigate to the project directory:
46
+ ```bash
47
+ cd ObjektViz
48
+ 3. Install the required dependencies (we use [uv](https://docs.astral.sh/uv/) to manage the Python environment and dependencies):
49
+ ```bash
50
+ uv sync
51
+
52
+ 4. Activate the virtual environment (bash shell):
53
+ ```bash
54
+ source .venv/bin/activate
55
+
56
+ 5. Run the example dashboard:
57
+ ```bash
58
+ streamlit run examples/generic_ocel_viewer.py
59
+ ```
60
+ > INFO: Using Chrome is strongly recommended. Mozilla Firefox and Safari should also work. (Although Safari does not support token replay.)
61
+
62
+ > INFO: Token Replay for now requires APOC library and is thus not available with KuzuDB
63
+
64
+ 6. [OPTIONAL] If you are planning on editing the objektviz source code, you can install the objektviz package it in editable mode:
65
+ ```bash
66
+ uv add --editable --dev objektviz
67
+ ```
68
+
69
+ <p align="center">
70
+ <img src="assets/generic_ocel_visualizer.png" alt="Visualizer" width="750px" align='center'/>
71
+ </p>
72
+
73
+ ## Feature spotlight
74
+
75
+ **Morphing and Animation** - ObjektViz supports smooth morphing between different process model views. This allows users to transition seamlessly from one perspective to another, this helps to manage complexity and understand different aspects of the process.
76
+ <p align="center">
77
+ <img src="assets/morphing.gif" alt="Morphing" width="550px" align='center'/>
78
+ </p>
79
+
80
+ **Shaders** - color lightness and thickness of edges play critical role in making a proces s model understandable. ObjektViz supports a variety of shaders that can be applied to nodes and edges to highlight different aspects of the process model or to deal with skewed distributions.
81
+ <p align="center">
82
+ <img src="assets/shader-types.png" alt="Custom Shaders" width="300px" align='center'/>
83
+ </p>
84
+
85
+ **Token Replay** - understand the dynamics of your process by replaying tokens through the process model. This feature allows you to visualize how different objects interact over time within the process.
86
+ <p align="center">
87
+ <img src="assets/token-replay.gif" alt="Custom Shaders" width="550px" align='center'/>
88
+ </p>
89
+
90
+ ## Import your own OCEL dataset
91
+ To import your own OCEL dataset, you need to convert it into EKG format first and then generate aggregated views (i.e., process models) from it.
92
+ We provide scripts to help you with this process in the `examples` folder.
93
+
94
+ 1. Convert OCEL to EKG and infer aggregated views:
95
+ ```bash
96
+ uv run python examples/ocel/kuzudb/process_ocel_to_kuzudb.py path/to/your/ocel.json path/to/save/ekg.kuzu
97
+ ```
98
+ 2. Copy one of the example dashboards (e.g. 'examples/generic_ocel_viewer.py') script and modify it to point to your newly created EKG database. The line to change is where the database is initialized:
99
+ ```python
100
+ db = kuzu.Database("path/to/save/ekg.kuzu")
101
+ ```
102
+ 3. Run your modified dashboard:
103
+ ```bash
104
+ uv run python -m streamlit run path/to/your/custom_dashboard.py
105
+ ```
106
+
107
+ # ObjektViz Proclet Metamodel (Work In Progress - Subject to Change)
108
+ <p align="center">
109
+ <img src="assets/metamodel-objektviz.png" alt="Proclet Metamodel" width="550px" align='center'/>
110
+ </p>
111
+
@@ -0,0 +1,92 @@
1
+ # 📦 ObjektViz
2
+
3
+ <p align="center">
4
+ <img src="assets/objektviz.png" alt="ObjektViz Screenshot" width="550px" align='center'/>
5
+ </p>
6
+
7
+ > ObjektViz is a visualizer for object-centric process models that enables users to explore and analyze even _very complex_ processes involving multiple interacting objects.
8
+
9
+ ## Features
10
+ - 🔍 **Interactive Visualization**: Explore object-centric process models with intuitive visualizations.
11
+ - 🤝 **Multi-Object Support**: Analyze processes involving multiple interacting objects seamlessly.
12
+ - ⚙️ **Customizable**: Every dataset, every process is different. ObjektViz allows you to customize visualizations to fit your data.
13
+ - 🧩 **Manage Complexity**: Designed to handle very complex processes without overwhelming the user.
14
+ - ▶️ **Token Replay**: Replay the flow of tokens through the process to understand dynamics and interactions, even for **multi-object** scenarios.
15
+ - 🔄 **Morphing Visualizations**: Smoothly transition between different views and representations of the process model to understand various aspects of the data.
16
+
17
+ ## Quick Start
18
+ ObjektViz has a lot of customization, and is built with the idea that you as a user will compose your own dashboard for the analysis you have at hand. However, to get you started quickly, we provide some example dashboards that you can run and explore.
19
+
20
+ In the examples we use KuzuDB, which works fine for small examples and the setup is easy. For real-world datasets, you might use Neo4J, but that requires more setup.
21
+ We have exported and processed some OCEL datasets into EKG and generated aggregated views (i.e. process models) for you to explore in the examples.
22
+
23
+ 1. Clone the repository:
24
+ ```bash
25
+ git clone git@github.com:mamiksik/ObjektViz.git
26
+ 2. Navigate to the project directory:
27
+ ```bash
28
+ cd ObjektViz
29
+ 3. Install the required dependencies (we use [uv](https://docs.astral.sh/uv/) to manage the Python environment and dependencies):
30
+ ```bash
31
+ uv sync
32
+
33
+ 4. Activate the virtual environment (bash shell):
34
+ ```bash
35
+ source .venv/bin/activate
36
+
37
+ 5. Run the example dashboard:
38
+ ```bash
39
+ streamlit run examples/generic_ocel_viewer.py
40
+ ```
41
+ > INFO: Using Chrome is strongly recommended. Mozilla Firefox and Safari should also work. (Although Safari does not support token replay.)
42
+
43
+ > INFO: Token Replay for now requires APOC library and is thus not available with KuzuDB
44
+
45
+ 6. [OPTIONAL] If you are planning on editing the objektviz source code, you can install the objektviz package it in editable mode:
46
+ ```bash
47
+ uv add --editable --dev objektviz
48
+ ```
49
+
50
+ <p align="center">
51
+ <img src="assets/generic_ocel_visualizer.png" alt="Visualizer" width="750px" align='center'/>
52
+ </p>
53
+
54
+ ## Feature spotlight
55
+
56
+ **Morphing and Animation** - ObjektViz supports smooth morphing between different process model views. This allows users to transition seamlessly from one perspective to another, this helps to manage complexity and understand different aspects of the process.
57
+ <p align="center">
58
+ <img src="assets/morphing.gif" alt="Morphing" width="550px" align='center'/>
59
+ </p>
60
+
61
+ **Shaders** - color lightness and thickness of edges play critical role in making a proces s model understandable. ObjektViz supports a variety of shaders that can be applied to nodes and edges to highlight different aspects of the process model or to deal with skewed distributions.
62
+ <p align="center">
63
+ <img src="assets/shader-types.png" alt="Custom Shaders" width="300px" align='center'/>
64
+ </p>
65
+
66
+ **Token Replay** - understand the dynamics of your process by replaying tokens through the process model. This feature allows you to visualize how different objects interact over time within the process.
67
+ <p align="center">
68
+ <img src="assets/token-replay.gif" alt="Custom Shaders" width="550px" align='center'/>
69
+ </p>
70
+
71
+ ## Import your own OCEL dataset
72
+ To import your own OCEL dataset, you need to convert it into EKG format first and then generate aggregated views (i.e., process models) from it.
73
+ We provide scripts to help you with this process in the `examples` folder.
74
+
75
+ 1. Convert OCEL to EKG and infer aggregated views:
76
+ ```bash
77
+ uv run python examples/ocel/kuzudb/process_ocel_to_kuzudb.py path/to/your/ocel.json path/to/save/ekg.kuzu
78
+ ```
79
+ 2. Copy one of the example dashboards (e.g. 'examples/generic_ocel_viewer.py') script and modify it to point to your newly created EKG database. The line to change is where the database is initialized:
80
+ ```python
81
+ db = kuzu.Database("path/to/save/ekg.kuzu")
82
+ ```
83
+ 3. Run your modified dashboard:
84
+ ```bash
85
+ uv run python -m streamlit run path/to/your/custom_dashboard.py
86
+ ```
87
+
88
+ # ObjektViz Proclet Metamodel (Work In Progress - Subject to Change)
89
+ <p align="center">
90
+ <img src="assets/metamodel-objektviz.png" alt="Proclet Metamodel" width="550px" align='center'/>
91
+ </p>
92
+
@@ -0,0 +1,41 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77.0.3", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "objektviz"
7
+ version = "0.2.2"
8
+ description = "ObjektViz is a visualizer for object-centric process models that enables users to explore and analyze even _very complex_ processes involving multiple interacting objects"
9
+ readme = "README.md"
10
+ requires-python = ">=3.13"
11
+ dependencies = [
12
+ "graphviz>=0.21",
13
+ "kuzu>=0.11.3",
14
+ "matplotlib>=3.10.7",
15
+ "neo4j>=6.0.3",
16
+ "scikit-learn>=1.7.2",
17
+ "streamlit[charts]>=1.51.0",
18
+ "watchdog>=6.0.0",
19
+ ]
20
+
21
+ [project.optional-dependencies]
22
+ publish = ["build", "twine"]
23
+
24
+ [project.urls]
25
+ Homepage = "https://mamiksik.github.io/ObjektViz/"
26
+ Repository = "https://github.com/mamiksik/ObjektViz.git"
27
+
28
+
29
+ [tool.setuptools.packages.find]
30
+ where = ["src"]
31
+ include = ['objektviz*']
32
+
33
+ [tool.uv.sources]
34
+ objektviz = { workspace = true, editable = true }
35
+
36
+
37
+ [dependency-groups]
38
+ dev = [
39
+ "objektviz",
40
+ "ruff>=0.14.13",
41
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
File without changes
@@ -0,0 +1,145 @@
1
+ import dataclasses
2
+ from typing import Callable, Self, Literal
3
+
4
+ from objektviz.backend.filters import AbstractFilter
5
+ from objektviz.backend.shaders import AbstractShader
6
+
7
+
8
+ @dataclasses.dataclass
9
+ class LayoutPreferences:
10
+ """Subset of settings related to dot node and edge layout"""
11
+
12
+ # All classes with the same activity string are put on the same level
13
+ force_same_rank_for_event_class: bool = False
14
+
15
+ # Make rank exclusive
16
+ exclusive_event_class_ranks_experimental: bool = False
17
+
18
+ # Force that start/end nodes are on same rank (diff for start and end)
19
+ force_process_start_end_same_rank: bool = False
20
+
21
+ # Sort nodes based on frequency, this influences the order in which they are
22
+ # declared in the dot source code (this then influences the layout heuristics)
23
+ sort_event_classes_by_frequency: bool = True
24
+
25
+ # Sort edges based on frequency, this influences the order in which they are
26
+ # declared in the dot source code (this then influences the layout heuristics)
27
+ sort_connections_by_frequency: bool = True
28
+
29
+ # If set to an attribute name, the attribute values will be used as edge weights
30
+ # during layout computation. Higher weight means that the edge is "shorter" and "straighter"
31
+ weight_attribute: str | None = None
32
+
33
+ # List of keys used to create subgraph clusters, order matters!
34
+ # e.g. ['EntityType', 'Location'] will create big clusters for
35
+ # each entity type and within each it will create sub-clusters
36
+ # for each location
37
+ clustering_keys: list = dataclasses.field(default_factory=list)
38
+
39
+ # Minimal (horizontal) spacing between nodes on the same rank/level
40
+ node_separation: float = 0.5
41
+
42
+ # Minimal vertical spacing between ranks/levels
43
+ rank_separation: float = 0.5
44
+
45
+ # Direction of the graph layout
46
+ rank_direction: Literal["TB", "BT", "LR", "RL"] = "TB" # Top to Bottom
47
+
48
+
49
+ @dataclasses.dataclass
50
+ class EventClassPreferences:
51
+ """Subset of settings related to dot node appearance and content"""
52
+
53
+ # Which (numeric) attributes is used to compute the shading range
54
+ shading_attr: str
55
+
56
+ # Attribute to be displayed as the node title
57
+ title: str
58
+
59
+ # Which attribute is used to display value on the left of the node
60
+ caption_left: str
61
+
62
+ # Which attribute is used to display value on the right of the node
63
+ caption_right: str
64
+
65
+ # In case the attribute value matches the value in the dict, the item
66
+ # will be used as prefix
67
+ # e.g. {"EntityType": {"Package": "📦","Contract": "📝"}}
68
+ icon_map: dict[str, dict[str, str]]
69
+
70
+
71
+ @dataclasses.dataclass
72
+ class DFCPreferences:
73
+ """Subset of settings related to dot edge appearance and content"""
74
+
75
+ # Which attribute is used to display value on top of the edge
76
+ caption: str
77
+
78
+ # Which (numeric) attributes is used to compute the shading range
79
+ shading_attr: str
80
+
81
+ # If true, xlabels are used for caption, this means the labels are not taking into account while computing layout
82
+ # It might prodice more compact and less convoluted routes for edges, but labels might not be visible
83
+ use_x_labels: bool
84
+
85
+ # Minimal and maximal edge line thickens. e.g (1, 15)
86
+ pen_width_range: tuple[int, int]
87
+
88
+ # If true, the edge will be shaded with the same color as the connected nodes,
89
+ # else plain green/red color will be used for start/end edges respectively
90
+ use_shading_color_on_start_end_edge: bool = False
91
+
92
+ # If true, the start/end edges will have lower opacity to not overpower the nodes and other edges
93
+ lower_start_end_edge_opacity: bool = False
94
+
95
+ # If true, the :SYNC edges will be hidden, this is useful when there are too many :SYNC edges that make the graph unreadable
96
+ hide_sync_edges: bool = False
97
+
98
+
99
+ @dataclasses.dataclass
100
+ class BackendConfig:
101
+ """Configuration of ObjektViz backend, used to generate dot source based"""
102
+
103
+ # What attribute is used group shaders
104
+ shader_groping_key: str
105
+
106
+ # Mapping of shader_grouping_key attr values to color map name (matplotlib.colors.Colormap) or hex color
107
+ # Matplot lib color maps are safer option since the luminosity change is precised uniformly,
108
+ # but that also means that there is only very few of them.
109
+ # e.g. {'Loan Application': ("hex", "#FF00FF"), "Workflow": ("cmap", "Reds")}
110
+ shader_groups_color: dict[str, tuple[str, str]]
111
+
112
+ # If true, process start/end nodes will be computed and visualized
113
+ # This requires that the :Class nodes have "StartCount" and "EndCount" attributes defined
114
+ show_start_end_nodes: bool
115
+
116
+ # If true, each cluster will have its own virtual start/end node
117
+ show_start_end_nodes_per_cluster: bool
118
+
119
+ # Root filter used to filter :Class nodes (to include all nodes, just pass instance of DummyFilter)
120
+ event_class_root_filter: AbstractFilter
121
+
122
+ # Root filter used to filter :DF_C edges (to include all edges, just pass instance of DummyFilter)
123
+ dfc_root_filter: AbstractFilter
124
+
125
+ # Global filter is applied to all elements including :SYNC edges
126
+ # this is useful for instance for element_id filter to remove any elements based on their id
127
+ # Also take into account not all elements have to have the same attribute, so use with caution
128
+ root_element_filter: AbstractFilter | None
129
+
130
+ layout_preferences: LayoutPreferences
131
+ dfc_preferences: DFCPreferences
132
+ event_class_preferences: EventClassPreferences
133
+
134
+ # Factory that creates the shader instances for event classes and connections
135
+ # The parameters are:
136
+ # 1) config (instance of this class),
137
+ # 2) leading_attribute (shading attributed),
138
+ # 3) cmap (matplotlib.colors.Colormap)
139
+ # The factory must return an instance of AbstractShader subclass
140
+ # e.g.
141
+ #
142
+ # lambda config, leading_attribute, cmap: NormalizedShader(
143
+ # config=config, leading_attribute=leading_attribute, cmap=cmap
144
+ # )
145
+ shader_factory: Callable[[Self, str, str], AbstractShader]
@@ -0,0 +1,8 @@
1
+ import dataclasses
2
+
3
+
4
+ @dataclasses.dataclass
5
+ class SessionState:
6
+ selected_edge: str = None
7
+ selected_class: str = None
8
+
File without changes