chartflow 0.1__py3-none-any.whl
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.
- chartflow/__init__.py +28 -0
- chartflow/_verify_importexport.py +169 -0
- chartflow/edit/__init__.py +119 -0
- chartflow/edit/code_editor.py +1007 -0
- chartflow/edit/code_folder.py +523 -0
- chartflow/edit/completer.py +2652 -0
- chartflow/edit/context_analyzer.py +521 -0
- chartflow/edit/demo.py +469 -0
- chartflow/edit/line_number_area.py +548 -0
- chartflow/edit/minimap.py +581 -0
- chartflow/edit/python_editor.py +509 -0
- chartflow/edit/syntax_highlighter.py +291 -0
- chartflow/edit/test_editor.py +190 -0
- chartflow/flow/__init__.py +31 -0
- chartflow/flow/_demo.py +98 -0
- chartflow/flow/chart.py +1101 -0
- chartflow/flow/editor.py +375 -0
- chartflow/flow/flow.py +6 -0
- chartflow/flow/qchart.py +1250 -0
- chartflow/flow/test/__init__.py +0 -0
- chartflow/flow/test/test_chart.py +537 -0
- chartflow/flow/test_decorator_sync.py +102 -0
- chartflow/fsm/__init__.py +84 -0
- chartflow/fsm/decorators.py +395 -0
- chartflow/fsm/demo.py +381 -0
- chartflow/fsm/demo_pyqt6.py +881 -0
- chartflow/fsm/demo_tree.py +46 -0
- chartflow/fsm/logic.py +447 -0
- chartflow/fsm/meta.py +569 -0
- chartflow/fsm/scheduler.py +427 -0
- chartflow/fsm/stage.py +2079 -0
- chartflow/fsm/stdio.py +66 -0
- chartflow/fsm/test/__init__.py +7 -0
- chartflow/fsm/test/test_decorators.py +210 -0
- chartflow/fsm/test/test_events.py +202 -0
- chartflow/fsm/test/test_integration.py +596 -0
- chartflow/fsm/test/test_logic.py +371 -0
- chartflow/fsm/test/test_meta.py +192 -0
- chartflow/fsm/test/test_runtime_param.py +336 -0
- chartflow/fsm/test/test_scheduler.py +280 -0
- chartflow/fsm/test/test_stage.py +314 -0
- chartflow/fsm/test_behavior_events.py +263 -0
- chartflow/fsm/test_nested_parallel.py +80 -0
- chartflow/fsm/test_stage_spec.py +448 -0
- chartflow/fsm/utils.py +34 -0
- chartflow/node/__init__.py +66 -0
- chartflow/node/_node_base.py +727 -0
- chartflow/node/_node_interaction.py +488 -0
- chartflow/node/_node_interface.py +426 -0
- chartflow/node/_node_markers.py +648 -0
- chartflow/node/_node_ports.py +536 -0
- chartflow/node/_port_interface.py +111 -0
- chartflow/node/arrow_item.py +287 -0
- chartflow/node/color_utils.py +113 -0
- chartflow/node/connection_item.py +939 -0
- chartflow/node/demo.py +258 -0
- chartflow/node/demo_arrow_drag.py +46 -0
- chartflow/node/demo_decorator.py +63 -0
- chartflow/node/demo_ports.py +69 -0
- chartflow/node/enums.py +35 -0
- chartflow/node/example.py +84 -0
- chartflow/node/layout_utils.py +307 -0
- chartflow/node/main_window.py +196 -0
- chartflow/node/menu_bar.py +240 -0
- chartflow/node/node_canvas.py +1730 -0
- chartflow/node/node_item.py +754 -0
- chartflow/node/popmenu.py +472 -0
- chartflow/node/port_item.py +591 -0
- chartflow/node/qnode_editor.py +73 -0
- chartflow/node/selection_rect.py +53 -0
- chartflow/node/style_panel.py +615 -0
- chartflow/node/styles.py +63 -0
- chartflow/node/test_qnode.py +2336 -0
- chartflow/showcase.py +528 -0
- chartflow/theme.py +508 -0
- chartflow-0.1.dist-info/METADATA +23 -0
- chartflow-0.1.dist-info/RECORD +79 -0
- chartflow-0.1.dist-info/WHEEL +5 -0
- chartflow-0.1.dist-info/top_level.txt +1 -0
chartflow/node/styles.py
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""
|
|
2
|
+
样式配置模块
|
|
3
|
+
|
|
4
|
+
遵循代码规范:
|
|
5
|
+
- dataclass类不能定义函数,数据和方法必须分离
|
|
6
|
+
- 常量形式的变量,必须全大写,使用_连接
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from dataclasses import dataclass, field
|
|
10
|
+
from PyQt6.QtGui import QColor
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# 默认颜色常量 —— 与 uipcweb 卡片视觉一致(白底卡片 + DodgerBlue 选中)
|
|
14
|
+
DEFAULT_IDLE_FILL = "#FFFFFF"
|
|
15
|
+
DEFAULT_IDLE_STROKE = "#D6D9DF"
|
|
16
|
+
DEFAULT_HOVER_OVERLAY = "#E3EEFF"
|
|
17
|
+
DEFAULT_SELECTED_STROKE = "#1E90FF"
|
|
18
|
+
DEFAULT_SELECTED_OVERLAY = "#CFE3FF"
|
|
19
|
+
DEFAULT_TEXT_COLOR = "#1F232A"
|
|
20
|
+
|
|
21
|
+
DEFAULT_CONNECTION_NORMAL = "#8B93A1"
|
|
22
|
+
DEFAULT_CONNECTION_SELECTED = "#1E90FF"
|
|
23
|
+
DEFAULT_CONNECTION_HOVER = "#6B7280"
|
|
24
|
+
|
|
25
|
+
DEFAULT_ARROW_NORMAL = "#8B93A1"
|
|
26
|
+
DEFAULT_ARROW_SELECTED = "#1E90FF"
|
|
27
|
+
DEFAULT_ARROW_HOVER = "#EE7942"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@dataclass
|
|
31
|
+
class NodeStyle:
|
|
32
|
+
"""节点样式配置"""
|
|
33
|
+
# Idle状态
|
|
34
|
+
idle_fill: QColor = field(default_factory=lambda: QColor(DEFAULT_IDLE_FILL))
|
|
35
|
+
idle_stroke: QColor = field(default_factory=lambda: QColor(DEFAULT_IDLE_STROKE))
|
|
36
|
+
# Hover状态叠加
|
|
37
|
+
hover_overlay: QColor = field(default_factory=lambda: QColor(DEFAULT_HOVER_OVERLAY))
|
|
38
|
+
# 选中状态
|
|
39
|
+
selected_stroke: QColor = field(default_factory=lambda: QColor(DEFAULT_SELECTED_STROKE))
|
|
40
|
+
selected_overlay: QColor = field(default_factory=lambda: QColor(DEFAULT_SELECTED_OVERLAY))
|
|
41
|
+
# 通用
|
|
42
|
+
stroke_width: float = 2.0
|
|
43
|
+
text_color: QColor = field(default_factory=lambda: QColor(DEFAULT_TEXT_COLOR))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@dataclass
|
|
47
|
+
class ConnectionStyle:
|
|
48
|
+
"""连接线样式配置"""
|
|
49
|
+
normal_color: QColor = field(default_factory=lambda: QColor(DEFAULT_CONNECTION_NORMAL))
|
|
50
|
+
selected_color: QColor = field(default_factory=lambda: QColor(DEFAULT_CONNECTION_SELECTED))
|
|
51
|
+
hover_color: QColor = field(default_factory=lambda: QColor(DEFAULT_CONNECTION_HOVER))
|
|
52
|
+
stroke_width: float = 2.0
|
|
53
|
+
selected_stroke_width: float = 3.0
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
@dataclass
|
|
57
|
+
class ArrowStyle:
|
|
58
|
+
"""箭头样式配置"""
|
|
59
|
+
normal_color: QColor = field(default_factory=lambda: QColor(DEFAULT_ARROW_NORMAL))
|
|
60
|
+
selected_color: QColor = field(default_factory=lambda: QColor(DEFAULT_ARROW_SELECTED))
|
|
61
|
+
hover_color: QColor = field(default_factory=lambda: QColor(DEFAULT_ARROW_HOVER))
|
|
62
|
+
arrow_size: float = 12.0
|
|
63
|
+
stroke_width: float = 2.0
|