vibrante-node 2.5.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.
- src/core/__init__.py +0 -0
- src/core/engine.py +484 -0
- src/core/events.py +32 -0
- src/core/graph.py +74 -0
- src/core/integrity.py +925 -0
- src/core/loader.py +56 -0
- src/core/manifest.py +910 -0
- src/core/models.py +59 -0
- src/core/persistence.py +27 -0
- src/core/python_to_workflow.py +182 -0
- src/core/registry.py +314 -0
- src/core/workflow_to_python.py +801 -0
- src/main.py +188 -0
- src/models/__init__.py +0 -0
- src/nodes/__init__.py +0 -0
- src/nodes/ai/__init__.py +1 -0
- src/nodes/base.py +174 -0
- src/nodes/builtins/__init__.py +0 -0
- src/nodes/builtins/group_node.py +210 -0
- src/nodes/builtins/nodes.py +452 -0
- src/nodes/print.py +19 -0
- src/nodes/test.py +19 -0
- src/ui/__init__.py +0 -0
- src/ui/canvas/__init__.py +0 -0
- src/ui/canvas/backdrop.py +223 -0
- src/ui/canvas/canvas_search_bar.py +222 -0
- src/ui/canvas/edge.py +98 -0
- src/ui/canvas/mini_map.py +138 -0
- src/ui/canvas/node_search_popup.py +270 -0
- src/ui/canvas/scene.py +1149 -0
- src/ui/canvas/sticky_note.py +123 -0
- src/ui/canvas/view.py +285 -0
- src/ui/code_editor.py +435 -0
- src/ui/export_python_dialog.py +490 -0
- src/ui/gemini_api_dialog.py +41 -0
- src/ui/gemini_chat.py +370 -0
- src/ui/import_python_dialog.py +122 -0
- src/ui/library_panel.py +246 -0
- src/ui/log_panel.py +315 -0
- src/ui/node_builder.py +841 -0
- src/ui/node_widget.py +1009 -0
- src/ui/port_widget.py +116 -0
- src/ui/script_editor.py +53 -0
- src/ui/scripting_console.py +270 -0
- src/ui/settings_window.py +575 -0
- src/ui/window.py +2012 -0
- src/utils/color_manager.py +50 -0
- src/utils/config_manager.py +71 -0
- src/utils/env_manager.py +232 -0
- src/utils/highlighter.py +110 -0
- src/utils/paths.py +30 -0
- src/utils/prism_config.py +300 -0
- src/utils/prism_core.py +80 -0
- src/utils/qt_compat.py +159 -0
- src/utils/runtime.py +80 -0
- vibrante_node/CLA.md +96 -0
- vibrante_node/COMMERCIAL_LICENSE.md +170 -0
- vibrante_node/LICENSE +178 -0
- vibrante_node/LICENSES/AGPL-3.0.txt +661 -0
- vibrante_node/LICENSES/CC-BY-4.0-SCOPE.md +53 -0
- vibrante_node/LICENSES/CC-BY-4.0.txt +396 -0
- vibrante_node/LICENSES/GPL-3.0.txt +674 -0
- vibrante_node/LICENSES/LGPL-3.0.txt +165 -0
- vibrante_node/LICENSES/README.md +65 -0
- vibrante_node/THIRD_PARTY_NOTICES.txt +3277 -0
- vibrante_node/__init__.py +2 -0
- vibrante_node/app.py +60 -0
- vibrante_node/docs/AUTOMATION_API.html +785 -0
- vibrante_node/docs/DEVELOPER.html +891 -0
- vibrante_node/docs/DOCUMENTATION.html +2761 -0
- vibrante_node/docs/LICENSE.txt +35 -0
- vibrante_node/docs/NODE_BUILDER_API.html +1155 -0
- vibrante_node/docs/RELEASE_v1.0.5.html +140 -0
- vibrante_node/docs/RELEASE_v1.1.0.html +163 -0
- vibrante_node/docs/RELEASE_v1.1.5.html +286 -0
- vibrante_node/docs/RELEASE_v1.2.0.html +175 -0
- vibrante_node/docs/RELEASE_v1.3.0.html +168 -0
- vibrante_node/docs/RELEASE_v1.4.0.html +160 -0
- vibrante_node/docs/RELEASE_v1.5.0.html +432 -0
- vibrante_node/docs/RELEASE_v1.6.0.html +293 -0
- vibrante_node/docs/RELEASE_v1.6.1.html +171 -0
- vibrante_node/docs/RELEASE_v1.7.0.html +270 -0
- vibrante_node/docs/RELEASE_v1.8.0.html +201 -0
- vibrante_node/docs/RELEASE_v1.8.1.html +124 -0
- vibrante_node/docs/RELEASE_v1.8.2.html +119 -0
- vibrante_node/docs/RELEASE_v1.8.3.html +125 -0
- vibrante_node/docs/RELEASE_v1.8.4.html +210 -0
- vibrante_node/docs/RELEASE_v1.8.5.html +223 -0
- vibrante_node/docs/RELEASE_v2.0.0.html +284 -0
- vibrante_node/docs/RELEASE_v2.1.0.html +259 -0
- vibrante_node/docs/RELEASE_v2.1.1.html +156 -0
- vibrante_node/docs/RELEASE_v2.2.0.html +369 -0
- vibrante_node/docs/RELEASE_v2.2.1.html +168 -0
- vibrante_node/docs/RELEASE_v2.3.0.html +185 -0
- vibrante_node/docs/RELEASE_v2.4.0.html +446 -0
- vibrante_node/docs/RELEASE_v2.5.0.html +478 -0
- vibrante_node/docs/RELEASE_v2.5.1.html +190 -0
- vibrante_node/docs/USER_GUIDE.html +1407 -0
- vibrante_node/docs/index.html +103 -0
- vibrante_node/docs/portal/01_introduction.html +1177 -0
- vibrante_node/docs/portal/02_getting_started.html +1267 -0
- vibrante_node/docs/portal/03_user_guide.html +1736 -0
- vibrante_node/docs/portal/04_workflow_tutorials.html +1473 -0
- vibrante_node/docs/portal/05_node_development.html +1562 -0
- vibrante_node/docs/portal/06_backend_architecture.html +1373 -0
- vibrante_node/docs/portal/07_frontend_architecture.html +1588 -0
- vibrante_node/docs/portal/08_api_reference.html +2336 -0
- vibrante_node/docs/portal/09_advanced_topics.html +1664 -0
- vibrante_node/docs/portal/10_contribution_guide.html +1263 -0
- vibrante_node/docs/portal/11_troubleshooting.html +1108 -0
- vibrante_node/docs/portal/12_examples_library.html +1498 -0
- vibrante_node/docs/portal/13_general_purpose_automation.html +1472 -0
- vibrante_node/docs/portal/14_custom_nodes_api.html +1960 -0
- vibrante_node/docs/portal/index.html +605 -0
- vibrante_node/docs/portal/integrations_blender.html +605 -0
- vibrante_node/docs/portal/integrations_deadline.html +536 -0
- vibrante_node/docs/portal/integrations_houdini.html +787 -0
- vibrante_node/docs/portal/integrations_maya.html +675 -0
- vibrante_node/docs/portal/integrations_prism.html +628 -0
- vibrante_node/docs/portal/search.json +1 -0
- vibrante_node/docs/validation.json +333 -0
- vibrante_node/examples/arnold_lighting/orchestration_notes.md +45 -0
- vibrante_node/examples/arnold_lighting/prompt.md +47 -0
- vibrante_node/examples/automation/01_linear_chain.py +10 -0
- vibrante_node/examples/automation/02_batch_update_prefix.py +8 -0
- vibrante_node/examples/automation/03_reset_scene.py +5 -0
- vibrante_node/examples/automation/04_batch_execution.py +9 -0
- vibrante_node/examples/automation/05_git_backup.py +6 -0
- vibrante_node/examples/automation/06_reset_math_nodes.py +12 -0
- vibrante_node/examples/automation/07_stress_test_grid.py +8 -0
- vibrante_node/examples/automation/08_scene_summary.py +8 -0
- vibrante_node/examples/automation/09_toggle_bools.py +8 -0
- vibrante_node/examples/automation/10_session_report.py +7 -0
- vibrante_node/examples/automation/11_simple_math_node.py +7 -0
- vibrante_node/examples/cinematic_camera/orchestration_notes.md +56 -0
- vibrante_node/examples/cinematic_camera/prompt.md +50 -0
- vibrante_node/examples/cinematic_explosion/orchestration_notes.md +76 -0
- vibrante_node/examples/cinematic_explosion/prompt.md +47 -0
- vibrante_node/examples/cinematic_explosion/review.md +75 -0
- vibrante_node/examples/dust_wave/orchestration_notes.md +43 -0
- vibrante_node/examples/dust_wave/prompt.md +40 -0
- vibrante_node/examples/nodes/async_delay.py +21 -0
- vibrante_node/examples/nodes/connection_logger.py +25 -0
- vibrante_node/examples/nodes/data_filter.py +19 -0
- vibrante_node/examples/nodes/dict_merge.py +20 -0
- vibrante_node/examples/nodes/dict_summary.py +21 -0
- vibrante_node/examples/nodes/dropdown_selector.py +29 -0
- vibrante_node/examples/nodes/env_reader.py +18 -0
- vibrante_node/examples/nodes/list_item_picker.py +85 -0
- vibrante_node/examples/nodes/list_stats.py +27 -0
- vibrante_node/examples/nodes/logic_threshold.py +23 -0
- vibrante_node/examples/nodes/math_square.py +30 -0
- vibrante_node/examples/nodes/random_list.py +18 -0
- vibrante_node/examples/nodes/reactive_config.py +24 -0
- vibrante_node/examples/nodes/safety_reset.py +31 -0
- vibrante_node/examples/nodes/string_reverse.py +16 -0
- vibrante_node/icons/210429_DeadlineFreeOn10RenderMachines.jpg +0 -0
- vibrante_node/icons/README.md +39 -0
- vibrante_node/icons/blender_icon.png +0 -0
- vibrante_node/icons/braces.png +0 -0
- vibrante_node/icons/braces.svg +1 -0
- vibrante_node/icons/builder.png +0 -0
- vibrante_node/icons/check.png +0 -0
- vibrante_node/icons/check.svg +1 -0
- vibrante_node/icons/chevron-right.svg +3 -0
- vibrante_node/icons/code.png +0 -0
- vibrante_node/icons/code.svg +4 -0
- vibrante_node/icons/computer-window.png +0 -0
- vibrante_node/icons/data.png +0 -0
- vibrante_node/icons/data.svg +5 -0
- vibrante_node/icons/database-search.png +0 -0
- vibrante_node/icons/database-search.svg +5 -0
- vibrante_node/icons/database-zap.png +0 -0
- vibrante_node/icons/database-zap.svg +5 -0
- vibrante_node/icons/database.png +0 -0
- vibrante_node/icons/database.svg +5 -0
- vibrante_node/icons/dice.png +0 -0
- vibrante_node/icons/dice.svg +1 -0
- vibrante_node/icons/divide.svg +5 -0
- vibrante_node/icons/file-input.svg +6 -0
- vibrante_node/icons/file-plus.png +0 -0
- vibrante_node/icons/file-plus.svg +6 -0
- vibrante_node/icons/file-text.png +0 -0
- vibrante_node/icons/file-text.svg +7 -0
- vibrante_node/icons/folder-plus.png +0 -0
- vibrante_node/icons/folder-plus.svg +5 -0
- vibrante_node/icons/folder.png +0 -0
- vibrante_node/icons/folder.svg +3 -0
- vibrante_node/icons/gear.png +0 -0
- vibrante_node/icons/gear.svg +1 -0
- vibrante_node/icons/git-branch.svg +6 -0
- vibrante_node/icons/hash.png +0 -0
- vibrante_node/icons/hash.svg +1 -0
- vibrante_node/icons/houdini.svg +4 -0
- vibrante_node/icons/houdini_icon.png +0 -0
- vibrante_node/icons/http.png +0 -0
- vibrante_node/icons/list-check.png +0 -0
- vibrante_node/icons/list-check.svg +7 -0
- vibrante_node/icons/list-plus.svg +10 -0
- vibrante_node/icons/list.png +0 -0
- vibrante_node/icons/list.svg +8 -0
- vibrante_node/icons/logic.png +0 -0
- vibrante_node/icons/logic.svg +7 -0
- vibrante_node/icons/math.png +0 -0
- vibrante_node/icons/math.svg +4 -0
- vibrante_node/icons/maya_icon.jpg +0 -0
- vibrante_node/icons/message.png +0 -0
- vibrante_node/icons/message.svg +3 -0
- vibrante_node/icons/minus.svg +3 -0
- vibrante_node/icons/multiply.png +0 -0
- vibrante_node/icons/multiply.svg +1 -0
- vibrante_node/icons/online-library.png +0 -0
- vibrante_node/icons/percentage.svg +5 -0
- vibrante_node/icons/plus.png +0 -0
- vibrante_node/icons/plus.svg +1 -0
- vibrante_node/icons/print.png +0 -0
- vibrante_node/icons/print.svg +5 -0
- vibrante_node/icons/prism_icon.png +0 -0
- vibrante_node/icons/refresh.svg +6 -0
- vibrante_node/icons/repeat.svg +6 -0
- vibrante_node/icons/scales.png +0 -0
- vibrante_node/icons/scales.svg +1 -0
- vibrante_node/icons/shuffle.svg +7 -0
- vibrante_node/icons/string.png +0 -0
- vibrante_node/icons/string.svg +5 -0
- vibrante_node/icons/terminal.png +0 -0
- vibrante_node/icons/terminal.svg +1 -0
- vibrante_node/icons/timer.png +0 -0
- vibrante_node/icons/timer.svg +4 -0
- vibrante_node/icons/toggle-switch.svg +5 -0
- vibrante_node/icons/uppercase.png +0 -0
- vibrante_node/icons/uppercase.svg +1 -0
- vibrante_node/icons/variable-get.svg +4 -0
- vibrante_node/icons/variable-set.svg +6 -0
- vibrante_node/icons/variable.png +0 -0
- vibrante_node/icons/variable.svg +5 -0
- vibrante_node/icons/vibrante-node-icon.png +0 -0
- vibrante_node/icons/vibrante-node-logo.png +0 -0
- vibrante_node/icons/vibrante-node-main_logo.png +0 -0
- vibrante_node/icons/vibrante-node-resize_main_logo.png +0 -0
- vibrante_node/logo.png +0 -0
- vibrante_node/mcp_cli.py +36 -0
- vibrante_node/node_examples/Split_String.json +35 -0
- vibrante_node/node_examples/async_delay.json +32 -0
- vibrante_node/node_examples/delay_timer.json +29 -0
- vibrante_node/node_examples/file_reader.json +29 -0
- vibrante_node/node_examples/fruit_selector.json +37 -0
- vibrante_node/node_examples/json_parser.json +29 -0
- vibrante_node/node_examples/line_counter.json +29 -0
- vibrante_node/node_examples/list_append.json +32 -0
- vibrante_node/node_examples/list_images_recursive.json +55 -0
- vibrante_node/node_examples/logic_and.json +34 -0
- vibrante_node/node_examples/logic_compare.json +36 -0
- vibrante_node/node_examples/math_abs.json +29 -0
- vibrante_node/node_examples/math_add.json +32 -0
- vibrante_node/node_examples/reactive_config.json +28 -0
- vibrante_node/node_examples/string_uppercase.json +29 -0
- vibrante_node/nodes/Dropdown_Selector.json +27 -0
- vibrante_node/nodes/add_integers.json +34 -0
- vibrante_node/nodes/blender_action_bake_animation.json +23 -0
- vibrante_node/nodes/blender_action_custom.json +21 -0
- vibrante_node/nodes/blender_action_export_alembic.json +22 -0
- vibrante_node/nodes/blender_action_export_fbx.json +23 -0
- vibrante_node/nodes/blender_action_export_gltf.json +21 -0
- vibrante_node/nodes/blender_action_export_obj.json +19 -0
- vibrante_node/nodes/blender_action_export_usd.json +23 -0
- vibrante_node/nodes/blender_action_import_alembic.json +18 -0
- vibrante_node/nodes/blender_action_import_fbx.json +18 -0
- vibrante_node/nodes/blender_action_import_gltf.json +18 -0
- vibrante_node/nodes/blender_action_import_obj.json +18 -0
- vibrante_node/nodes/blender_action_new_blend.json +18 -0
- vibrante_node/nodes/blender_action_open_blend.json +18 -0
- vibrante_node/nodes/blender_action_render.json +23 -0
- vibrante_node/nodes/blender_action_save_blend.json +18 -0
- vibrante_node/nodes/blender_action_scene_info.json +17 -0
- vibrante_node/nodes/blender_action_set_frame_range.json +20 -0
- vibrante_node/nodes/blender_action_set_render_settings.json +27 -0
- vibrante_node/nodes/blender_get_action_result.json +22 -0
- vibrante_node/nodes/blender_headless.json +86 -0
- vibrante_node/nodes/compare.json +48 -0
- vibrante_node/nodes/console_print.json +29 -0
- vibrante_node/nodes/create_dictionary.json +18 -0
- vibrante_node/nodes/create_folder.json +17 -0
- vibrante_node/nodes/create_list.json +18 -0
- vibrante_node/nodes/deadline_blender_submit.json +38 -0
- vibrante_node/nodes/deadline_houdini_submit.json +38 -0
- vibrante_node/nodes/deadline_job_status.json +28 -0
- vibrante_node/nodes/deadline_maya_submit.json +40 -0
- vibrante_node/nodes/delay_timer.json +26 -0
- vibrante_node/nodes/example_random_float.json +35 -0
- vibrante_node/nodes/file_append.json +18 -0
- vibrante_node/nodes/file_write.json +18 -0
- vibrante_node/nodes/for_loop.json +46 -0
- vibrante_node/nodes/get_dict_value.json +19 -0
- vibrante_node/nodes/get_list_item.json +19 -0
- vibrante_node/nodes/houdini_action_bake_animation.json +20 -0
- vibrante_node/nodes/houdini_action_custom.json +20 -0
- vibrante_node/nodes/houdini_action_export_alembic.json +20 -0
- vibrante_node/nodes/houdini_action_export_camera_alembic.json +20 -0
- vibrante_node/nodes/houdini_action_export_fbx.json +18 -0
- vibrante_node/nodes/houdini_action_import_alembic.json +18 -0
- vibrante_node/nodes/houdini_action_import_camera.json +17 -0
- vibrante_node/nodes/houdini_action_import_fbx.json +18 -0
- vibrante_node/nodes/houdini_action_import_obj.json +18 -0
- vibrante_node/nodes/houdini_action_new_hip.json +16 -0
- vibrante_node/nodes/houdini_action_open_hip.json +17 -0
- vibrante_node/nodes/houdini_action_save_hip.json +17 -0
- vibrante_node/nodes/houdini_action_scene_info.json +16 -0
- vibrante_node/nodes/houdini_action_set_frame_range.json +18 -0
- vibrante_node/nodes/houdini_get_action_result.json +21 -0
- vibrante_node/nodes/houdini_headless.json +85 -0
- vibrante_node/nodes/houdini_scene_snapshot.json +41 -0
- vibrante_node/nodes/http_request.json +76 -0
- vibrante_node/nodes/if_condition.json +45 -0
- vibrante_node/nodes/list_directory.json +17 -0
- vibrante_node/nodes/list_images_recursive.json +41 -0
- vibrante_node/nodes/list_item_picker.json +41 -0
- vibrante_node/nodes/list_length.json +17 -0
- vibrante_node/nodes/logical_gate.json +45 -0
- vibrante_node/nodes/loop_body.json +62 -0
- vibrante_node/nodes/math_add.json +17 -0
- vibrante_node/nodes/math_divide.json +17 -0
- vibrante_node/nodes/math_modulo.json +17 -0
- vibrante_node/nodes/math_multiply.json +36 -0
- vibrante_node/nodes/math_subtract.json +17 -0
- vibrante_node/nodes/maya_action_assign_material.json +18 -0
- vibrante_node/nodes/maya_action_bake_animation.json +21 -0
- vibrante_node/nodes/maya_action_create_render_layer.json +19 -0
- vibrante_node/nodes/maya_action_custom.json +20 -0
- vibrante_node/nodes/maya_action_export_alembic.json +22 -0
- vibrante_node/nodes/maya_action_export_camera_alembic.json +20 -0
- vibrante_node/nodes/maya_action_export_fbx.json +18 -0
- vibrante_node/nodes/maya_action_import_alembic.json +17 -0
- vibrante_node/nodes/maya_action_import_camera.json +17 -0
- vibrante_node/nodes/maya_action_import_fbx.json +17 -0
- vibrante_node/nodes/maya_action_import_obj.json +17 -0
- vibrante_node/nodes/maya_action_list_references.json +16 -0
- vibrante_node/nodes/maya_action_new_scene.json +16 -0
- vibrante_node/nodes/maya_action_open_scene.json +18 -0
- vibrante_node/nodes/maya_action_playblast.json +22 -0
- vibrante_node/nodes/maya_action_reference_alembic.json +18 -0
- vibrante_node/nodes/maya_action_reference_scene.json +18 -0
- vibrante_node/nodes/maya_action_save_scene.json +18 -0
- vibrante_node/nodes/maya_action_scene_info.json +16 -0
- vibrante_node/nodes/maya_action_set_aovs.json +18 -0
- vibrante_node/nodes/maya_action_set_frame_range.json +18 -0
- vibrante_node/nodes/maya_action_set_render_settings.json +23 -0
- vibrante_node/nodes/maya_get_action_result.json +21 -0
- vibrante_node/nodes/maya_headless.json +27 -0
- vibrante_node/nodes/mcp_call_tool.json +19 -0
- vibrante_node/nodes/mcp_list_tools.json +18 -0
- vibrante_node/nodes/mcp_server_init.json +23 -0
- vibrante_node/nodes/message_node.json +32 -0
- vibrante_node/nodes/prism_add_integration.json +49 -0
- vibrante_node/nodes/prism_build_entity.json +45 -0
- vibrante_node/nodes/prism_change_project.json +37 -0
- vibrante_node/nodes/prism_core_info.json +37 -0
- vibrante_node/nodes/prism_core_init.json +46 -0
- vibrante_node/nodes/prism_create_category.json +44 -0
- vibrante_node/nodes/prism_create_entity.json +60 -0
- vibrante_node/nodes/prism_create_playblast.json +56 -0
- vibrante_node/nodes/prism_create_product_version.json +64 -0
- vibrante_node/nodes/prism_create_project.json +50 -0
- vibrante_node/nodes/prism_create_scene_from_preset.json +59 -0
- vibrante_node/nodes/prism_eval.json +42 -0
- vibrante_node/nodes/prism_get_aovs.json +29 -0
- vibrante_node/nodes/prism_get_asset_by_name.json +69 -0
- vibrante_node/nodes/prism_get_asset_type_by_name.json +62 -0
- vibrante_node/nodes/prism_get_asset_types_by_project.json +55 -0
- vibrante_node/nodes/prism_get_assets_by_project.json +41 -0
- vibrante_node/nodes/prism_get_assets_by_type.json +69 -0
- vibrante_node/nodes/prism_get_config.json +48 -0
- vibrante_node/nodes/prism_get_current_scene.json +37 -0
- vibrante_node/nodes/prism_get_departments.json +37 -0
- vibrante_node/nodes/prism_get_entity_info.json +69 -0
- vibrante_node/nodes/prism_get_entity_path.json +69 -0
- vibrante_node/nodes/prism_get_export_path.json +26 -0
- vibrante_node/nodes/prism_get_latest_product_path.json +34 -0
- vibrante_node/nodes/prism_get_media.json +29 -0
- vibrante_node/nodes/prism_get_media_versions.json +33 -0
- vibrante_node/nodes/prism_get_plugin.json +35 -0
- vibrante_node/nodes/prism_get_preset_scenes.json +35 -0
- vibrante_node/nodes/prism_get_product_versions.json +33 -0
- vibrante_node/nodes/prism_get_products.json +29 -0
- vibrante_node/nodes/prism_get_project_by_name.json +55 -0
- vibrante_node/nodes/prism_get_project_config_path.json +26 -0
- vibrante_node/nodes/prism_get_scene_files.json +45 -0
- vibrante_node/nodes/prism_get_scene_path.json +23 -0
- vibrante_node/nodes/prism_get_sequence_by_project.json +48 -0
- vibrante_node/nodes/prism_get_sequences_by_project.json +41 -0
- vibrante_node/nodes/prism_get_shot_by_name.json +62 -0
- vibrante_node/nodes/prism_get_shot_by_sequence.json +55 -0
- vibrante_node/nodes/prism_get_shot_info.json +69 -0
- vibrante_node/nodes/prism_get_shots.json +29 -0
- vibrante_node/nodes/prism_get_shots_by_project_sequence.json +48 -0
- vibrante_node/nodes/prism_get_shots_by_sequence.json +48 -0
- vibrante_node/nodes/prism_get_tasks.json +39 -0
- vibrante_node/nodes/prism_import_product.json +37 -0
- vibrante_node/nodes/prism_list_plugins.json +25 -0
- vibrante_node/nodes/prism_list_projects.json +25 -0
- vibrante_node/nodes/prism_login_token.json +33 -0
- vibrante_node/nodes/prism_monkey_patch.json +46 -0
- vibrante_node/nodes/prism_open_scene.json +33 -0
- vibrante_node/nodes/prism_popup.json +40 -0
- vibrante_node/nodes/prism_register_callback.json +58 -0
- vibrante_node/nodes/prism_save_scene_version.json +90 -0
- vibrante_node/nodes/prism_send_cmd.json +54 -0
- vibrante_node/nodes/prism_set_config.json +55 -0
- vibrante_node/nodes/prism_studio_assign_project.json +43 -0
- vibrante_node/nodes/prism_trigger_callback.json +42 -0
- vibrante_node/nodes/prism_usd_department_layer_path.json +35 -0
- vibrante_node/nodes/prism_usd_entity_path.json +29 -0
- vibrante_node/nodes/prism_usd_sublayer_path.json +41 -0
- vibrante_node/nodes/prism_usd_update_department_layer.json +33 -0
- vibrante_node/nodes/prism_usd_update_sublayer.json +33 -0
- vibrante_node/nodes/python_script.json +17 -0
- vibrante_node/nodes/scene_intent_extractor.json +25 -0
- vibrante_node/nodes/set_dict_value.json +20 -0
- vibrante_node/nodes/string_concat.json +47 -0
- vibrante_node/nodes/string_length.json +16 -0
- vibrante_node/nodes/string_lowercase.json +16 -0
- vibrante_node/nodes/string_replace.json +18 -0
- vibrante_node/nodes/string_split.json +17 -0
- vibrante_node/nodes/string_uppercase.json +16 -0
- vibrante_node/nodes/variable_node.json +42 -0
- vibrante_node/nodes/while_loop.json +18 -0
- vibrante_node/splash.png +0 -0
- vibrante_node/vfx_workflows/01_prism_project_overview.json +492 -0
- vibrante_node/vfx_workflows/02_maya_asset_publish.json +776 -0
- vibrante_node/vfx_workflows/03_multi_shot_alembic_export.json +856 -0
- vibrante_node/vfx_workflows/04_deadline_render_pipeline.json +994 -0
- vibrante_node/vfx_workflows/05_houdini_fx_pipeline.json +1056 -0
- vibrante_node/vfx_workflows/06_blender_multi_format_export.json +1206 -0
- vibrante_node/website_examples/database_query.json +69 -0
- vibrante_node/website_examples/email_notification.json +104 -0
- vibrante_node/website_examples/file_batch_processor.json +62 -0
- vibrante_node/website_examples/folder_monitor.json +55 -0
- vibrante_node/website_examples/hou_sop_chain.json +69 -0
- vibrante_node/website_examples/http_request.json +90 -0
- vibrante_node/website_examples/image_resizer.json +90 -0
- vibrante_node/website_examples/llm_text_generation.json +90 -0
- vibrante_node/website_examples/prism_multi_asset_publisher.json +76 -0
- vibrante_node/website_examples/regex_replace.json +69 -0
- vibrante_node/workflows/If_condition.json +134 -0
- vibrante_node/workflows/Maya_WorkFlow.json +464 -0
- vibrante_node/workflows/asset_intelligence_pipeline.json +259 -0
- vibrante_node/workflows/concat_string_with_loop.json +262 -0
- vibrante_node/workflows/delay_time.json +74 -0
- vibrante_node/workflows/example_workflow_maya_prism_demo.json +503 -0
- vibrante_node/workflows/example_workflow_prism_demo.json +276 -0
- vibrante_node/workflows/example_workflow_prism_demo_02.json +221 -0
- vibrante_node/workflows/extract_FPS_from_maya_scene.json +265 -0
- vibrante_node/workflows/for_each.json +260 -0
- vibrante_node/workflows/get_list_item.json +151 -0
- vibrante_node/workflows/hou_mcp_scene_context_demo.json +67 -0
- vibrante_node/workflows/list_recursive_images.json +103 -0
- vibrante_node/workflows/logic_if_example.json +262 -0
- vibrante_node/workflows/logic_if_with_variables.json +210 -0
- vibrante_node/workflows/loop_break_example.json +197 -0
- vibrante_node/workflows/loop_operation_example.json +382 -0
- vibrante_node/workflows/mcp_list_tools_demo.json +90 -0
- vibrante_node/workflows/prism_assets_workflow.json +131 -0
- vibrante_node/workflows/python_script_node.json +89 -0
- vibrante_node/workflows/run_in_sequence.json +158 -0
- vibrante_node/workflows/scene_intent_pipeline.json +134 -0
- vibrante_node/workflows/scene_planning_pipeline.json +258 -0
- vibrante_node/workflows/semantic_scene_intent.json +96 -0
- vibrante_node/workflows/setup_maya_scene.json +352 -0
- vibrante_node/workflows/tutorial_maya_headless_prism_pipeline.json +593 -0
- vibrante_node/workflows/two_way_switch.json +341 -0
- vibrante_node/workflows/while_loop_class_example.json +192 -0
- vibrante_node/workflows/while_loop_example.json +184 -0
- vibrante_node/workflows/while_loop_retry_example.json +276 -0
- vibrante_node-2.5.1.dist-info/METADATA +715 -0
- vibrante_node-2.5.1.dist-info/RECORD +487 -0
- vibrante_node-2.5.1.dist-info/WHEEL +5 -0
- vibrante_node-2.5.1.dist-info/entry_points.txt +3 -0
- vibrante_node-2.5.1.dist-info/licenses/CLA.md +96 -0
- vibrante_node-2.5.1.dist-info/licenses/COMMERCIAL_LICENSE.md +170 -0
- vibrante_node-2.5.1.dist-info/licenses/LICENSE +178 -0
- vibrante_node-2.5.1.dist-info/licenses/LICENSES/AGPL-3.0.txt +661 -0
- vibrante_node-2.5.1.dist-info/licenses/LICENSES/CC-BY-4.0-SCOPE.md +53 -0
- vibrante_node-2.5.1.dist-info/licenses/LICENSES/CC-BY-4.0.txt +396 -0
- vibrante_node-2.5.1.dist-info/licenses/LICENSES/GPL-3.0.txt +674 -0
- vibrante_node-2.5.1.dist-info/licenses/LICENSES/LGPL-3.0.txt +165 -0
- vibrante_node-2.5.1.dist-info/licenses/LICENSES/README.md +65 -0
- vibrante_node-2.5.1.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,1588 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<meta name="description" content="Vibrante-Node v2.5.1 — Frontend Architecture">
|
|
7
|
+
<title>Frontend Architecture — Vibrante-Node Docs</title>
|
|
8
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@11.9.0/styles/atom-one-dark.min.css">
|
|
9
|
+
<style>
|
|
10
|
+
/* ── Reset & Variables ─────────────────────────────────────────────────── */
|
|
11
|
+
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
12
|
+
:root {
|
|
13
|
+
--bg: #1e1e2e;
|
|
14
|
+
--surface: #181825;
|
|
15
|
+
--surface2: #11111b;
|
|
16
|
+
--border: #313244;
|
|
17
|
+
--text: #cdd6f4;
|
|
18
|
+
--subtext: #a6adc8;
|
|
19
|
+
--muted: #6c7086;
|
|
20
|
+
--lavender: #b4befe;
|
|
21
|
+
--blue: #89b4fa;
|
|
22
|
+
--teal: #94e2d5;
|
|
23
|
+
--green: #a6e3a1;
|
|
24
|
+
--yellow: #f9e2af;
|
|
25
|
+
--peach: #fab387;
|
|
26
|
+
--red: #f38ba8;
|
|
27
|
+
--pink: #f5c2e7;
|
|
28
|
+
--mauve: #cba6f7;
|
|
29
|
+
--sidebar-w: 260px;
|
|
30
|
+
--toc-w: 220px;
|
|
31
|
+
--header-h: 56px;
|
|
32
|
+
--font: 'Segoe UI', system-ui, -apple-system, sans-serif;
|
|
33
|
+
--mono: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* ── Layout ─────────────────────────────────────────────────────────────── */
|
|
37
|
+
html { scroll-behavior: smooth; }
|
|
38
|
+
body {
|
|
39
|
+
font-family: var(--font);
|
|
40
|
+
background: var(--bg);
|
|
41
|
+
color: var(--text);
|
|
42
|
+
line-height: 1.7;
|
|
43
|
+
min-height: 100vh;
|
|
44
|
+
display: grid;
|
|
45
|
+
grid-template-rows: var(--header-h) 1fr;
|
|
46
|
+
grid-template-columns: var(--sidebar-w) 1fr var(--toc-w);
|
|
47
|
+
grid-template-areas:
|
|
48
|
+
"header header header"
|
|
49
|
+
"sidebar content toc";
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* ── Header ─────────────────────────────────────────────────────────────── */
|
|
53
|
+
.header {
|
|
54
|
+
grid-area: header;
|
|
55
|
+
position: sticky; top: 0; z-index: 200;
|
|
56
|
+
background: var(--surface2);
|
|
57
|
+
border-bottom: 1px solid var(--border);
|
|
58
|
+
display: flex; align-items: center; gap: 16px;
|
|
59
|
+
padding: 0 24px;
|
|
60
|
+
}
|
|
61
|
+
.header-logo {
|
|
62
|
+
font-weight: 700; font-size: 1.05em;
|
|
63
|
+
color: var(--mauve);
|
|
64
|
+
text-decoration: none;
|
|
65
|
+
white-space: nowrap;
|
|
66
|
+
}
|
|
67
|
+
.header-version {
|
|
68
|
+
font-size: .78em;
|
|
69
|
+
background: var(--border);
|
|
70
|
+
color: var(--subtext);
|
|
71
|
+
padding: 2px 8px; border-radius: 12px;
|
|
72
|
+
}
|
|
73
|
+
.header-spacer { flex: 1; }
|
|
74
|
+
.search-wrap { position: relative; }
|
|
75
|
+
#search-input {
|
|
76
|
+
background: var(--surface);
|
|
77
|
+
border: 1px solid var(--border);
|
|
78
|
+
border-radius: 8px;
|
|
79
|
+
color: var(--text);
|
|
80
|
+
font-family: var(--font);
|
|
81
|
+
font-size: .9em;
|
|
82
|
+
padding: 6px 14px 6px 36px;
|
|
83
|
+
width: 260px;
|
|
84
|
+
outline: none;
|
|
85
|
+
transition: border-color .15s;
|
|
86
|
+
}
|
|
87
|
+
#search-input:focus { border-color: var(--mauve); }
|
|
88
|
+
.search-icon {
|
|
89
|
+
position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
|
|
90
|
+
color: var(--muted); pointer-events: none; font-size: .9em;
|
|
91
|
+
}
|
|
92
|
+
#search-results {
|
|
93
|
+
position: absolute; top: calc(100% + 8px); right: 0;
|
|
94
|
+
width: 380px; max-height: 420px; overflow-y: auto;
|
|
95
|
+
background: var(--surface);
|
|
96
|
+
border: 1px solid var(--border);
|
|
97
|
+
border-radius: 10px;
|
|
98
|
+
box-shadow: 0 8px 32px rgba(0,0,0,.5);
|
|
99
|
+
display: none; z-index: 300;
|
|
100
|
+
}
|
|
101
|
+
#search-results.visible { display: block; }
|
|
102
|
+
.search-result-item {
|
|
103
|
+
padding: 10px 16px;
|
|
104
|
+
border-bottom: 1px solid var(--border);
|
|
105
|
+
cursor: pointer;
|
|
106
|
+
transition: background .1s;
|
|
107
|
+
}
|
|
108
|
+
.search-result-item:last-child { border-bottom: none; }
|
|
109
|
+
.search-result-item:hover { background: var(--bg); }
|
|
110
|
+
.search-result-title { color: var(--blue); font-weight: 600; font-size: .9em; }
|
|
111
|
+
.search-result-excerpt { color: var(--subtext); font-size: .82em; margin-top: 2px; line-height: 1.4; }
|
|
112
|
+
.search-no-results { padding: 16px; color: var(--muted); text-align: center; font-size: .9em; }
|
|
113
|
+
|
|
114
|
+
/* ── Sidebar ─────────────────────────────────────────────────────────────── */
|
|
115
|
+
.sidebar {
|
|
116
|
+
grid-area: sidebar;
|
|
117
|
+
position: sticky; top: var(--header-h);
|
|
118
|
+
height: calc(100vh - var(--header-h));
|
|
119
|
+
overflow-y: auto;
|
|
120
|
+
background: var(--surface);
|
|
121
|
+
border-right: 1px solid var(--border);
|
|
122
|
+
padding: 20px 0;
|
|
123
|
+
scrollbar-width: thin;
|
|
124
|
+
scrollbar-color: var(--border) transparent;
|
|
125
|
+
}
|
|
126
|
+
.sidebar::-webkit-scrollbar { width: 4px; }
|
|
127
|
+
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
|
|
128
|
+
|
|
129
|
+
.sidebar-group { margin-bottom: 4px; }
|
|
130
|
+
.sidebar-group-title {
|
|
131
|
+
font-size: .7em;
|
|
132
|
+
text-transform: uppercase;
|
|
133
|
+
letter-spacing: .1em;
|
|
134
|
+
color: var(--muted);
|
|
135
|
+
padding: 10px 20px 4px;
|
|
136
|
+
font-weight: 600;
|
|
137
|
+
}
|
|
138
|
+
.sidebar-link {
|
|
139
|
+
display: flex; align-items: center; gap: 8px;
|
|
140
|
+
padding: 6px 20px;
|
|
141
|
+
color: var(--subtext);
|
|
142
|
+
text-decoration: none;
|
|
143
|
+
font-size: .88em;
|
|
144
|
+
border-left: 3px solid transparent;
|
|
145
|
+
transition: all .12s;
|
|
146
|
+
line-height: 1.3;
|
|
147
|
+
}
|
|
148
|
+
.sidebar-link:hover { color: var(--text); background: var(--bg); }
|
|
149
|
+
.sidebar-link.active {
|
|
150
|
+
color: var(--mauve);
|
|
151
|
+
border-left-color: var(--mauve);
|
|
152
|
+
background: rgba(180,190,254,.06);
|
|
153
|
+
font-weight: 600;
|
|
154
|
+
}
|
|
155
|
+
.sidebar-num {
|
|
156
|
+
font-size: .7em;
|
|
157
|
+
color: var(--muted);
|
|
158
|
+
background: var(--border);
|
|
159
|
+
border-radius: 4px;
|
|
160
|
+
padding: 1px 5px;
|
|
161
|
+
flex-shrink: 0;
|
|
162
|
+
}
|
|
163
|
+
.sidebar-divider {
|
|
164
|
+
border: none;
|
|
165
|
+
border-top: 1px solid var(--border);
|
|
166
|
+
margin: 12px 16px;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* ── Content ─────────────────────────────────────────────────────────────── */
|
|
170
|
+
.content {
|
|
171
|
+
grid-area: content;
|
|
172
|
+
min-width: 0;
|
|
173
|
+
padding: 40px 48px 80px;
|
|
174
|
+
max-width: 860px;
|
|
175
|
+
}
|
|
176
|
+
.content-inner { max-width: 820px; }
|
|
177
|
+
|
|
178
|
+
/* Breadcrumb */
|
|
179
|
+
.breadcrumb {
|
|
180
|
+
font-size: .8em;
|
|
181
|
+
color: var(--muted);
|
|
182
|
+
margin-bottom: 28px;
|
|
183
|
+
display: flex; align-items: center; gap: 6px;
|
|
184
|
+
}
|
|
185
|
+
.breadcrumb a { color: var(--blue); text-decoration: none; }
|
|
186
|
+
.breadcrumb a:hover { text-decoration: underline; }
|
|
187
|
+
.breadcrumb-sep { color: var(--border); }
|
|
188
|
+
|
|
189
|
+
/* Typography */
|
|
190
|
+
h1 { font-size: 2em; color: var(--mauve); border-bottom: 2px solid var(--border); padding-bottom: 12px; margin: 20px 0 20px; }
|
|
191
|
+
h2 { font-size: 1.45em; color: var(--blue); margin: 40px 0 14px; padding-top: 8px; }
|
|
192
|
+
h3 { font-size: 1.15em; color: var(--teal); margin: 28px 0 10px; }
|
|
193
|
+
h4 { font-size: 1em; color: var(--pink); margin: 20px 0 8px; }
|
|
194
|
+
h5 { font-size: .95em; color: var(--yellow); margin: 16px 0 6px; }
|
|
195
|
+
p { margin-bottom: 16px; color: var(--text); }
|
|
196
|
+
a { color: var(--blue); }
|
|
197
|
+
a:hover { text-decoration: underline; }
|
|
198
|
+
strong { color: var(--peach); }
|
|
199
|
+
em { color: var(--yellow); font-style: italic; }
|
|
200
|
+
|
|
201
|
+
ul, ol { margin: 10px 0 16px 24px; }
|
|
202
|
+
li { margin-bottom: 6px; }
|
|
203
|
+
li > ul, li > ol { margin-top: 4px; margin-bottom: 4px; }
|
|
204
|
+
|
|
205
|
+
blockquote {
|
|
206
|
+
border-left: 4px solid var(--mauve);
|
|
207
|
+
padding: 10px 20px;
|
|
208
|
+
margin: 16px 0;
|
|
209
|
+
background: rgba(180,190,254,.05);
|
|
210
|
+
border-radius: 0 8px 8px 0;
|
|
211
|
+
color: var(--subtext);
|
|
212
|
+
}
|
|
213
|
+
blockquote strong { color: var(--mauve); }
|
|
214
|
+
|
|
215
|
+
hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
|
|
216
|
+
|
|
217
|
+
/* Code */
|
|
218
|
+
code {
|
|
219
|
+
background: var(--surface2);
|
|
220
|
+
color: var(--red);
|
|
221
|
+
padding: 2px 7px; border-radius: 5px;
|
|
222
|
+
font-family: var(--mono); font-size: .87em;
|
|
223
|
+
}
|
|
224
|
+
pre {
|
|
225
|
+
background: var(--surface2) !important;
|
|
226
|
+
border: 1px solid var(--border);
|
|
227
|
+
border-radius: 10px;
|
|
228
|
+
padding: 20px 22px;
|
|
229
|
+
overflow-x: auto;
|
|
230
|
+
margin: 16px 0 22px;
|
|
231
|
+
position: relative;
|
|
232
|
+
}
|
|
233
|
+
pre code {
|
|
234
|
+
background: none !important;
|
|
235
|
+
color: inherit !important;
|
|
236
|
+
padding: 0; font-size: .9em;
|
|
237
|
+
border-radius: 0;
|
|
238
|
+
}
|
|
239
|
+
/* Copy button */
|
|
240
|
+
.copy-btn {
|
|
241
|
+
position: absolute; top: 10px; right: 12px;
|
|
242
|
+
background: var(--border);
|
|
243
|
+
color: var(--subtext);
|
|
244
|
+
border: none; border-radius: 5px;
|
|
245
|
+
padding: 3px 10px; font-size: .75em;
|
|
246
|
+
cursor: pointer; transition: all .12s;
|
|
247
|
+
font-family: var(--font);
|
|
248
|
+
}
|
|
249
|
+
.copy-btn:hover { background: var(--mauve); color: var(--surface2); }
|
|
250
|
+
.copy-btn.copied { background: var(--green); color: var(--surface2); }
|
|
251
|
+
|
|
252
|
+
/* Tables */
|
|
253
|
+
table { border-collapse: collapse; width: 100%; margin: 16px 0 22px; font-size: .9em; }
|
|
254
|
+
th { background: var(--border); color: var(--mauve); padding: 10px 14px; text-align: left; font-weight: 600; }
|
|
255
|
+
td { border-top: 1px solid var(--border); padding: 9px 14px; color: var(--text); }
|
|
256
|
+
tr:nth-child(even) td { background: rgba(17,17,27,.4); }
|
|
257
|
+
td code { font-size: .85em; }
|
|
258
|
+
|
|
259
|
+
/* Callout boxes */
|
|
260
|
+
.callout {
|
|
261
|
+
border-radius: 8px;
|
|
262
|
+
padding: 14px 18px;
|
|
263
|
+
margin: 16px 0 22px;
|
|
264
|
+
border-left: 4px solid;
|
|
265
|
+
}
|
|
266
|
+
.callout-note { background: rgba(137,180,250,.08); border-color: var(--blue); }
|
|
267
|
+
.callout-tip { background: rgba(166,227,161,.08); border-color: var(--green); }
|
|
268
|
+
.callout-warning { background: rgba(249,226,175,.08); border-color: var(--yellow); }
|
|
269
|
+
.callout-danger { background: rgba(243,139,168,.08); border-color: var(--red); }
|
|
270
|
+
.callout-title { font-weight: 700; font-size: .85em; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
|
|
271
|
+
.callout-note .callout-title { color: var(--blue); }
|
|
272
|
+
.callout-tip .callout-title { color: var(--green); }
|
|
273
|
+
.callout-warning .callout-title { color: var(--yellow); }
|
|
274
|
+
.callout-danger .callout-title { color: var(--red); }
|
|
275
|
+
|
|
276
|
+
/* Validation badges */
|
|
277
|
+
.val-badge {
|
|
278
|
+
display: inline-block; font-size: .78em; font-weight: 600;
|
|
279
|
+
padding: 4px 12px; border-radius: 20px; margin-bottom: 18px;
|
|
280
|
+
border: 1px solid transparent; letter-spacing: .02em;
|
|
281
|
+
}
|
|
282
|
+
.val-badge-ok { background: rgba(166,227,161,.12); border-color: var(--green); color: var(--green); }
|
|
283
|
+
.val-badge-warn { background: rgba(249,226,175,.12); border-color: var(--yellow); color: var(--yellow); }
|
|
284
|
+
.val-badge-error { background: rgba(243,139,168,.12); border-color: var(--red); color: var(--red); }
|
|
285
|
+
.val-badge-unknown { background: rgba(108,112,134,.12); border-color: #6c7086; color: #6c7086; }
|
|
286
|
+
|
|
287
|
+
/* Prev/Next navigation */
|
|
288
|
+
.page-nav {
|
|
289
|
+
display: flex; justify-content: space-between;
|
|
290
|
+
margin-top: 60px; padding-top: 24px;
|
|
291
|
+
border-top: 1px solid var(--border);
|
|
292
|
+
gap: 16px;
|
|
293
|
+
}
|
|
294
|
+
.page-nav-link {
|
|
295
|
+
display: flex; flex-direction: column;
|
|
296
|
+
text-decoration: none;
|
|
297
|
+
padding: 14px 20px;
|
|
298
|
+
background: var(--surface);
|
|
299
|
+
border: 1px solid var(--border);
|
|
300
|
+
border-radius: 10px;
|
|
301
|
+
min-width: 200px;
|
|
302
|
+
transition: border-color .15s;
|
|
303
|
+
max-width: 48%;
|
|
304
|
+
}
|
|
305
|
+
.page-nav-link:hover { border-color: var(--mauve); }
|
|
306
|
+
.page-nav-label { font-size: .75em; color: var(--muted); margin-bottom: 4px; }
|
|
307
|
+
.page-nav-title { color: var(--blue); font-weight: 600; font-size: .95em; }
|
|
308
|
+
.page-nav-link.prev .page-nav-label::before { content: '← '; }
|
|
309
|
+
.page-nav-link.next { margin-left: auto; text-align: right; }
|
|
310
|
+
.page-nav-link.next .page-nav-label::after { content: ' →'; }
|
|
311
|
+
|
|
312
|
+
/* ── TOC (right panel) ───────────────────────────────────────────────────── */
|
|
313
|
+
.toc {
|
|
314
|
+
grid-area: toc;
|
|
315
|
+
position: sticky; top: var(--header-h);
|
|
316
|
+
height: calc(100vh - var(--header-h));
|
|
317
|
+
overflow-y: auto;
|
|
318
|
+
padding: 28px 16px 28px 8px;
|
|
319
|
+
scrollbar-width: thin;
|
|
320
|
+
scrollbar-color: var(--border) transparent;
|
|
321
|
+
}
|
|
322
|
+
.toc-title {
|
|
323
|
+
font-size: .72em;
|
|
324
|
+
text-transform: uppercase;
|
|
325
|
+
letter-spacing: .1em;
|
|
326
|
+
color: var(--muted);
|
|
327
|
+
font-weight: 600;
|
|
328
|
+
margin-bottom: 12px;
|
|
329
|
+
padding-left: 8px;
|
|
330
|
+
}
|
|
331
|
+
.toc-link {
|
|
332
|
+
display: block;
|
|
333
|
+
padding: 4px 8px;
|
|
334
|
+
color: var(--subtext);
|
|
335
|
+
text-decoration: none;
|
|
336
|
+
font-size: .82em;
|
|
337
|
+
border-left: 2px solid transparent;
|
|
338
|
+
border-radius: 0 4px 4px 0;
|
|
339
|
+
transition: all .12s;
|
|
340
|
+
line-height: 1.35;
|
|
341
|
+
margin-bottom: 1px;
|
|
342
|
+
}
|
|
343
|
+
.toc-link:hover { color: var(--text); border-left-color: var(--border); }
|
|
344
|
+
.toc-link.active { color: var(--mauve); border-left-color: var(--mauve); background: rgba(180,190,254,.05); }
|
|
345
|
+
.toc-link.toc-h3 { padding-left: 20px; font-size: .79em; }
|
|
346
|
+
.toc-link.toc-h4 { padding-left: 32px; font-size: .76em; color: var(--muted); }
|
|
347
|
+
|
|
348
|
+
/* ── Responsive ──────────────────────────────────────────────────────────── */
|
|
349
|
+
@media (max-width: 1100px) {
|
|
350
|
+
body { grid-template-columns: var(--sidebar-w) 1fr 0; }
|
|
351
|
+
.toc { display: none; }
|
|
352
|
+
}
|
|
353
|
+
@media (max-width: 760px) {
|
|
354
|
+
body { grid-template-columns: 0 1fr 0; grid-template-rows: var(--header-h) 1fr; }
|
|
355
|
+
.sidebar { display: none; }
|
|
356
|
+
.content { padding: 24px 20px 60px; }
|
|
357
|
+
#search-input { width: 180px; }
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/* ── Index / landing page ────────────────────────────────────────────────── */
|
|
361
|
+
.hero { text-align: center; padding: 60px 0 48px; }
|
|
362
|
+
.hero h1 { border: none; font-size: 2.8em; }
|
|
363
|
+
.hero .tagline { color: var(--subtext); font-size: 1.15em; margin-top: 10px; }
|
|
364
|
+
.hero .version-badge {
|
|
365
|
+
display: inline-block;
|
|
366
|
+
background: var(--border); color: var(--mauve);
|
|
367
|
+
padding: 4px 14px; border-radius: 20px; font-size: .85em;
|
|
368
|
+
margin-top: 14px;
|
|
369
|
+
}
|
|
370
|
+
.group-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 16px 0 36px; }
|
|
371
|
+
.doc-card {
|
|
372
|
+
background: var(--surface);
|
|
373
|
+
border: 1px solid var(--border);
|
|
374
|
+
border-radius: 12px;
|
|
375
|
+
padding: 20px 24px;
|
|
376
|
+
text-decoration: none;
|
|
377
|
+
color: var(--text);
|
|
378
|
+
transition: border-color .15s, background .15s;
|
|
379
|
+
display: block;
|
|
380
|
+
}
|
|
381
|
+
.doc-card:hover { border-color: var(--mauve); background: rgba(180,190,254,.04); }
|
|
382
|
+
.doc-card-num { font-size: .72em; color: var(--muted); margin-bottom: 4px; }
|
|
383
|
+
.doc-card-title { color: var(--blue); font-weight: 700; font-size: 1em; margin-bottom: 6px; }
|
|
384
|
+
.doc-card-desc { color: var(--subtext); font-size: .85em; line-height: 1.5; }
|
|
385
|
+
.group-title { color: var(--teal); font-size: 1.1em; font-weight: 600; margin: 32px 0 10px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
|
|
386
|
+
</style>
|
|
387
|
+
<span id="portal-base" data-base="" style="display:none"></span>
|
|
388
|
+
</head>
|
|
389
|
+
<body>
|
|
390
|
+
|
|
391
|
+
<!-- ── Header ─────────────────────────────────────────────────────────── -->
|
|
392
|
+
<header class="header">
|
|
393
|
+
<a class="header-logo" href="index.html">Vibrante-Node</a>
|
|
394
|
+
<span class="header-version">v2.5.1</span>
|
|
395
|
+
<div class="header-spacer"></div>
|
|
396
|
+
<div class="search-wrap">
|
|
397
|
+
<span class="search-icon">🔍</span>
|
|
398
|
+
<input id="search-input" type="text" placeholder="Search docs… (/)" autocomplete="off" spellcheck="false">
|
|
399
|
+
<div id="search-results"></div>
|
|
400
|
+
</div>
|
|
401
|
+
</header>
|
|
402
|
+
|
|
403
|
+
<!-- ── Sidebar ────────────────────────────────────────────────────────── -->
|
|
404
|
+
<nav class="sidebar">
|
|
405
|
+
<div class="sidebar-group">
|
|
406
|
+
<div class="sidebar-group-title">Overview</div>
|
|
407
|
+
<a class="sidebar-link" href="01_introduction.html"><span class="sidebar-num">01</span>Introduction</a>
|
|
408
|
+
<a class="sidebar-link" href="02_getting_started.html"><span class="sidebar-num">02</span>Getting Started</a>
|
|
409
|
+
</div>
|
|
410
|
+
<div class="sidebar-group">
|
|
411
|
+
<div class="sidebar-group-title">Using the App</div>
|
|
412
|
+
<a class="sidebar-link" href="03_user_guide.html"><span class="sidebar-num">03</span>User Guide</a>
|
|
413
|
+
<a class="sidebar-link" href="04_workflow_tutorials.html"><span class="sidebar-num">04</span>Workflow Tutorials</a>
|
|
414
|
+
</div>
|
|
415
|
+
<div class="sidebar-group">
|
|
416
|
+
<div class="sidebar-group-title">Developing Nodes</div>
|
|
417
|
+
<a class="sidebar-link" href="05_node_development.html"><span class="sidebar-num">05</span>Node Development Guide</a>
|
|
418
|
+
<a class="sidebar-link" href="14_custom_nodes_api.html"><span class="sidebar-num">14</span>Custom Nodes API</a>
|
|
419
|
+
<a class="sidebar-link" href="08_api_reference.html"><span class="sidebar-num">08</span>API Reference</a>
|
|
420
|
+
</div>
|
|
421
|
+
<div class="sidebar-group">
|
|
422
|
+
<div class="sidebar-group-title">Architecture</div>
|
|
423
|
+
<a class="sidebar-link" href="06_backend_architecture.html"><span class="sidebar-num">06</span>Backend Architecture</a>
|
|
424
|
+
<a class="sidebar-link active" href="07_frontend_architecture.html"><span class="sidebar-num">07</span>Frontend Architecture</a>
|
|
425
|
+
</div>
|
|
426
|
+
<div class="sidebar-group">
|
|
427
|
+
<div class="sidebar-group-title">Advanced</div>
|
|
428
|
+
<a class="sidebar-link" href="09_advanced_topics.html"><span class="sidebar-num">09</span>Advanced Topics</a>
|
|
429
|
+
<a class="sidebar-link" href="10_contribution_guide.html"><span class="sidebar-num">10</span>Contribution Guide</a>
|
|
430
|
+
</div>
|
|
431
|
+
<div class="sidebar-group">
|
|
432
|
+
<div class="sidebar-group-title">Reference</div>
|
|
433
|
+
<a class="sidebar-link" href="11_troubleshooting.html"><span class="sidebar-num">11</span>Troubleshooting</a>
|
|
434
|
+
<a class="sidebar-link" href="12_examples_library.html"><span class="sidebar-num">12</span>Examples Library</a>
|
|
435
|
+
<a class="sidebar-link" href="13_general_purpose_automation.html"><span class="sidebar-num">13</span>General Purpose Automation</a>
|
|
436
|
+
</div>
|
|
437
|
+
|
|
438
|
+
</nav>
|
|
439
|
+
|
|
440
|
+
<!-- ── Main content ───────────────────────────────────────────────────── -->
|
|
441
|
+
<main class="content">
|
|
442
|
+
<div class="content-inner">
|
|
443
|
+
<nav class="breadcrumb"><a href="index.html">Docs</a><span class="breadcrumb-sep">›</span><span>Frontend Architecture</span></nav>
|
|
444
|
+
<div class="val-badge val-badge-ok" title="Verified against source code">✓ Verified</div>
|
|
445
|
+
<p># 07 — Frontend Architecture</p>
|
|
446
|
+
<p><strong>Vibrante-Node v2.5.0 — Technical Reference</strong></p>
|
|
447
|
+
<p>This document describes the Qt5 widget hierarchy, rendering pipeline, event model, history system, and all supporting UI subsystems. It targets contributors who need to understand the canvas, add new UI panels, create custom graphics items, or modify how nodes and edges are drawn.</p>
|
|
448
|
+
<blockquote>
|
|
449
|
+
<p><strong>Architecture note:</strong> The UI Layer described in this document is the primary interface for Vibrante-Node users. The execution engine (<code>src/core/engine.py</code>) and Runtime Layer (<code>src/runtime/</code>) are designed to be fully decoupled from Qt — they can additionally be used headlessly from the MCP server (<code>vibrante-mcp</code>, or <code>scripts/run_vibrante_mcp.py</code> from a source checkout) for advanced automation without a display server. The frontend and backend are decoupled at the <code>NetworkExecutor</code> boundary: the executor calls node <code>execute()</code> coroutines; the UI listens to its Qt signals. Nothing in <code>src/runtime/</code> or <code>src/core/engine.py</code> imports from <code>src/ui/</code>.</p>
|
|
450
|
+
</blockquote>
|
|
451
|
+
<hr />
|
|
452
|
+
<h2 id="table-of-contents">Table of Contents</h2>
|
|
453
|
+
<ol>
|
|
454
|
+
<li><a href="#1-widget-hierarchy">Widget Hierarchy</a></li>
|
|
455
|
+
<li><a href="#2-mainwindow">MainWindow</a></li>
|
|
456
|
+
<li><a href="#3-nodescene-qgraphicsscene">NodeScene (QGraphicsScene)</a></li>
|
|
457
|
+
<li><a href="#4-nodeview-qgraphicsview">NodeView (QGraphicsView)</a></li>
|
|
458
|
+
<li><a href="#5-nodewidget-rendering">NodeWidget Rendering</a></li>
|
|
459
|
+
<li><a href="#6-portwidget">PortWidget</a></li>
|
|
460
|
+
<li><a href="#7-edge-wire-rendering">Edge (Wire) Rendering</a></li>
|
|
461
|
+
<li><a href="#8-minimap">MiniMap</a></li>
|
|
462
|
+
<li><a href="#9-canvassearchbar">CanvasSearchBar</a></li>
|
|
463
|
+
<li><a href="#10-nodesearchpopup">NodeSearchPopup</a></li>
|
|
464
|
+
<li><a href="#11-event-flow-creating-a-connection">Event Flow: Creating a Connection</a></li>
|
|
465
|
+
<li><a href="#12-history-undoredo">History (Undo/Redo)</a></li>
|
|
466
|
+
<li><a href="#13-serialization-scene-tofrom-workflowmodel">Serialization (Scene to/from WorkflowModel)</a></li>
|
|
467
|
+
<li><a href="#14-theme-system">Theme System</a></li>
|
|
468
|
+
<li><a href="#15-librarypanel">LibraryPanel</a></li>
|
|
469
|
+
<li><a href="#16-logpanel">LogPanel</a></li>
|
|
470
|
+
<li><a href="#17-scriptingconsole">ScriptingConsole</a></li>
|
|
471
|
+
<li><a href="#18-nodebuilderdialog">NodeBuilderDialog</a></li>
|
|
472
|
+
<li><a href="#19-codeeditor">CodeEditor</a></li>
|
|
473
|
+
<li><a href="#20-how-to-add-a-new-ui-panel">How to Add a New UI Panel</a></li>
|
|
474
|
+
<li><a href="#21-custom-graphics-items">Custom Graphics Items</a></li>
|
|
475
|
+
<li><a href="#22-stylesheet-architecture">Stylesheet Architecture</a></li>
|
|
476
|
+
<li><a href="#23-stickynote-and-backdrop">StickyNote and Backdrop</a></li>
|
|
477
|
+
</ol>
|
|
478
|
+
<hr />
|
|
479
|
+
<h2 id="1-widget-hierarchy">1. Widget Hierarchy</h2>
|
|
480
|
+
<p>The complete Qt widget tree for one open tab:</p>
|
|
481
|
+
<pre><code>QMainWindow (MainWindow)
|
|
482
|
+
│
|
|
483
|
+
├── QTabWidget (self.tabs) [central widget]
|
|
484
|
+
│ │
|
|
485
|
+
│ └── [per tab] QWidget → QVBoxLayout
|
|
486
|
+
│ └── NodeView (QGraphicsView)
|
|
487
|
+
│ │
|
|
488
|
+
│ ├── [child widget] CanvasSearchBar (QFrame)
|
|
489
|
+
│ │ └── QHBoxLayout
|
|
490
|
+
│ │ ├── QLineEdit (search input)
|
|
491
|
+
│ │ ├── QLabel (match counter)
|
|
492
|
+
│ │ ├── QToolButton ▲ prev
|
|
493
|
+
│ │ ├── QToolButton ▼ next
|
|
494
|
+
│ │ └── QToolButton ✕ close
|
|
495
|
+
│ │
|
|
496
|
+
│ └── [child widget] MiniMap (QGraphicsView)
|
|
497
|
+
│ shares the same QGraphicsScene as NodeView
|
|
498
|
+
│
|
|
499
|
+
│ QGraphicsScene (NodeScene) [not a widget; managed by NodeView]
|
|
500
|
+
│ │
|
|
501
|
+
│ ├── NodeWidget items [QGraphicsItem]
|
|
502
|
+
│ │ ├── header rect (QPainter)
|
|
503
|
+
│ │ ├── PortWidget items (QGraphicsEllipseItem)
|
|
504
|
+
│ │ └── QGraphicsProxyWidget [per input parameter]
|
|
505
|
+
│ │ └── QLineEdit / QSpinBox / QCheckBox / QComboBox / ...
|
|
506
|
+
│ │
|
|
507
|
+
│ ├── Edge items [QGraphicsPathItem]
|
|
508
|
+
│ │
|
|
509
|
+
│ ├── StickyNote items [QGraphicsItem]
|
|
510
|
+
│ │
|
|
511
|
+
│ └── Backdrop items [QGraphicsRectItem]
|
|
512
|
+
│
|
|
513
|
+
├── QDockWidget "Node Library" (LibraryPanel) [left dock]
|
|
514
|
+
│ └── QVBoxLayout
|
|
515
|
+
│ ├── QLineEdit (search filter)
|
|
516
|
+
│ └── DraggableTreeWidget (QTreeWidget)
|
|
517
|
+
│
|
|
518
|
+
├── QDockWidget "Log" (LogPanel) [bottom dock]
|
|
519
|
+
│ └── QTextEdit
|
|
520
|
+
│
|
|
521
|
+
├── QDockWidget "Scripting Console" [bottom dock, tabbed with Log]
|
|
522
|
+
│ └── QVBoxLayout
|
|
523
|
+
│ ├── QPlainTextEdit (output)
|
|
524
|
+
│ └── QLineEdit (input)
|
|
525
|
+
│
|
|
526
|
+
└── QStatusBar
|
|
527
|
+
</code></pre>
|
|
528
|
+
<hr />
|
|
529
|
+
<h2 id="2-mainwindow">2. MainWindow</h2>
|
|
530
|
+
<p><code>MainWindow</code> (<code>src/ui/window.py</code>) is the application's top-level window. It owns:</p>
|
|
531
|
+
<ul>
|
|
532
|
+
<li>The <code>QTabWidget</code> with one tab per open workflow.</li>
|
|
533
|
+
<li>The <code>LibraryPanel</code>, <code>LogPanel</code>, and <code>ScriptingConsole</code> dockable panels.</li>
|
|
534
|
+
<li>The main menu bar and toolbar.</li>
|
|
535
|
+
<li>The <code>_EventLoopRunner</code> that drives execution.</li>
|
|
536
|
+
<li>The autosave timer (<code>QTimer</code>, 2-minute interval).</li>
|
|
537
|
+
<li><code>_node_start_times</code> — a <code>Dict[UUID, float]</code> that records <code>time.perf_counter()</code> when each node starts, enabling elapsed-time logging.</li>
|
|
538
|
+
</ul>
|
|
539
|
+
<h3 id="tab-management">Tab management</h3>
|
|
540
|
+
<p>Each tab wraps a <code>NodeView → NodeScene</code> pair. The tab label is the workflow filename (or "Untitled N" for new workflows). Tabs are closable; <code>_close_tab()</code> prompts for unsaved changes.</p>
|
|
541
|
+
<p><code>add_new_workflow(name)</code> creates a new <code>NodeScene</code>, wraps it in a <code>NodeView</code>, adds the pair to the <code>QTabWidget</code>, and connects the necessary signals. It is also called by <code>_open_subgraph_tab()</code> when the user double-clicks a <code>GroupNode</code>.</p>
|
|
542
|
+
<h3 id="signal-connections-engine-ui">Signal connections (engine → UI)</h3>
|
|
543
|
+
<pre><code class="language-python">executor.node_started.connect(self._on_node_started)
|
|
544
|
+
executor.node_finished.connect(self._on_node_finished)
|
|
545
|
+
executor.node_error.connect(self._on_node_error)
|
|
546
|
+
executor.node_output.connect(self._on_node_output)
|
|
547
|
+
executor.node_log.connect(self._on_node_log)
|
|
548
|
+
executor.execution_finished.connect(self._on_execution_finished)
|
|
549
|
+
</code></pre>
|
|
550
|
+
<p><code>_on_node_started</code> records start time and calls <code>widget.set_executing(True)</code> to highlight the node on canvas.<br />
|
|
551
|
+
<code>_on_node_finished</code> computes elapsed time, logs it, calls <code>widget.set_executing(False)</code>.<br />
|
|
552
|
+
<code>_on_node_output</code> calls <code>widget.set_parameter(port_name, value)</code> for each output key, and calls <code>scene.update_edge_value(widget, port_name, value)</code> for wire inspector tooltips.</p>
|
|
553
|
+
<h3 id="autosave">Autosave</h3>
|
|
554
|
+
<p><code>_autosave()</code> is called every 2 minutes. It serialises all non-empty tabs to <code>~/.vibrante_node_autosave.json</code>:</p>
|
|
555
|
+
<pre><code class="language-json">{
|
|
556
|
+
"version": 1,
|
|
557
|
+
"tabs": [
|
|
558
|
+
{"name": "tab label", "file_path": "/path/or/empty", "workflow": {}}
|
|
559
|
+
]
|
|
560
|
+
}
|
|
561
|
+
</code></pre>
|
|
562
|
+
<!-- `workflow` contains the full WorkflowModel dict serialized to JSON -->
|
|
563
|
+
|
|
564
|
+
<p>Empty tabs and the <code>_is_executing</code> guard prevent spurious writes. On next startup, <code>_try_restore_autosave()</code> checks for this file and shows a restore dialog. On clean exit (<code>closeEvent</code>), the file is deleted so the dialog never appears unnecessarily.</p>
|
|
565
|
+
<h3 id="recent-files">Recent files</h3>
|
|
566
|
+
<p><code>MainWindow._add_recent_file(path)</code> is called after every successful save or load. It delegates to <code>config.add_recent_file(path)</code> in <code>src/utils/config_manager.py</code>, which keeps a JSON list of up to 10 absolute paths (newest first). The <strong>Open Recent</strong> submenu is rebuilt dynamically by <code>_rebuild_recent_menu()</code> on <code>file_menu.aboutToShow</code>. Files that no longer exist on disk are shown grayed-out (disabled actions).</p>
|
|
567
|
+
<hr />
|
|
568
|
+
<h2 id="3-nodescene-qgraphicsscene">3. NodeScene (QGraphicsScene)</h2>
|
|
569
|
+
<p><code>NodeScene</code> (<code>src/ui/canvas/scene.py</code>) is the model for a single workflow tab. It manages all graphics items and owns the history stack.</p>
|
|
570
|
+
<h3 id="key-attributes">Key attributes</h3>
|
|
571
|
+
<table>
|
|
572
|
+
<thead>
|
|
573
|
+
<tr>
|
|
574
|
+
<th>Attribute</th>
|
|
575
|
+
<th>Type</th>
|
|
576
|
+
<th>Description</th>
|
|
577
|
+
</tr>
|
|
578
|
+
</thead>
|
|
579
|
+
<tbody>
|
|
580
|
+
<tr>
|
|
581
|
+
<td><code>nodes</code></td>
|
|
582
|
+
<td><code>List[NodeWidget]</code></td>
|
|
583
|
+
<td>All node items in scene order</td>
|
|
584
|
+
</tr>
|
|
585
|
+
<tr>
|
|
586
|
+
<td><code>edges</code></td>
|
|
587
|
+
<td><code>List[Edge]</code></td>
|
|
588
|
+
<td>All wire items</td>
|
|
589
|
+
</tr>
|
|
590
|
+
<tr>
|
|
591
|
+
<td><code>sticky_notes</code></td>
|
|
592
|
+
<td><code>List[StickyNote]</code></td>
|
|
593
|
+
<td>All sticky note items</td>
|
|
594
|
+
</tr>
|
|
595
|
+
<tr>
|
|
596
|
+
<td><code>backdrops</code></td>
|
|
597
|
+
<td><code>List[Backdrop]</code></td>
|
|
598
|
+
<td>All backdrop items</td>
|
|
599
|
+
</tr>
|
|
600
|
+
<tr>
|
|
601
|
+
<td><code>history</code></td>
|
|
602
|
+
<td><code>List[dict]</code></td>
|
|
603
|
+
<td>Undo stack (snapshots, max 50)</td>
|
|
604
|
+
</tr>
|
|
605
|
+
<tr>
|
|
606
|
+
<td><code>redo_stack</code></td>
|
|
607
|
+
<td><code>List[dict]</code></td>
|
|
608
|
+
<td>Redo stack</td>
|
|
609
|
+
</tr>
|
|
610
|
+
<tr>
|
|
611
|
+
<td><code>_undoing</code></td>
|
|
612
|
+
<td><code>bool</code></td>
|
|
613
|
+
<td>Guard to prevent history writes during undo/redo</td>
|
|
614
|
+
</tr>
|
|
615
|
+
<tr>
|
|
616
|
+
<td><code>_sync_callback</code></td>
|
|
617
|
+
<td><code>Callable</code> or <code>None</code></td>
|
|
618
|
+
<td>Set by MainWindow for subgraph tab two-way sync</td>
|
|
619
|
+
</tr>
|
|
620
|
+
<tr>
|
|
621
|
+
<td><code>file_path</code></td>
|
|
622
|
+
<td><code>str</code> or <code>None</code></td>
|
|
623
|
+
<td>Last saved path for this tab</td>
|
|
624
|
+
</tr>
|
|
625
|
+
</tbody>
|
|
626
|
+
</table>
|
|
627
|
+
<h3 id="background-grid">Background grid</h3>
|
|
628
|
+
<p><code>NodeScene.drawBackground()</code> paints a dot-grid using <code>grid_pen</code> (color <code>#555555</code>, width 0.5). The grid spacing is <code>grid_size = 20</code> scene units. The grid is drawn in scene coordinates, so it scales with zoom automatically.</p>
|
|
629
|
+
<h3 id="history-undoredo">History (undo/redo)</h3>
|
|
630
|
+
<p><code>push_history()</code> snapshots the entire scene to a <code>WorkflowModel.model_dump()</code> dict and appends it to <code>history</code>. It also clears <code>redo_stack</code> and, if <code>_sync_callback</code> is set, calls it with the new snapshot.</p>
|
|
631
|
+
<p><code>undo()</code> pops the last snapshot, pushes the current state to <code>redo_stack</code>, and calls <code>from_workflow_model(model)</code> to restore.</p>
|
|
632
|
+
<p><code>redo()</code> does the reverse.</p>
|
|
633
|
+
<p>The maximum history depth is 50 snapshots. Older entries are discarded from the front of the list.</p>
|
|
634
|
+
<h3 id="scene-communication-_sync_callback">Scene communication: _sync_callback</h3>
|
|
635
|
+
<p>When <code>MainWindow._open_subgraph_tab()</code> opens a <code>GroupNode</code>'s inner graph in a new tab, it sets <code>scene._sync_callback</code> to a closure that writes every change back to the parent <code>GroupNode</code>'s <code>parameters["__workflow__"]</code> and pushes the parent scene's history. This makes subgraph tabs fully editable with two-way sync to the parent workflow.</p>
|
|
636
|
+
<h3 id="node-search-from-scene">Node search from scene</h3>
|
|
637
|
+
<p><code>NodeScene.add_node_by_name(node_id, scene_pos)</code> looks up the definition in <code>NodeRegistry</code>, creates a <code>NodeWidget</code>, positions it at <code>scene_pos</code>, and adds it to the scene. Returns the created widget or <code>None</code> on failure.</p>
|
|
638
|
+
<h3 id="grouping">Grouping</h3>
|
|
639
|
+
<p><code>NodeScene.group_selection()</code> (triggered by Ctrl+Shift+G) collapses selected nodes into a <code>GroupNode</code>. The algorithm:</p>
|
|
640
|
+
<ol>
|
|
641
|
+
<li>Classify edges incident on selected nodes as internal, boundary_in, boundary_out, boundary_exec_in, or boundary_exec_out.</li>
|
|
642
|
+
<li>Build a <code>WorkflowModel</code> containing the selected nodes plus synthetic <code>GroupInNode</code> and <code>GroupOutNode</code> instances for each boundary port.</li>
|
|
643
|
+
<li>Remove selected nodes and their edges.</li>
|
|
644
|
+
<li>Create a <code>GroupNode</code> widget at the centroid; populate <code>__workflow__</code>, <code>__port_defs__</code>, <code>__name__</code> parameters; call <code>rebuild_ports()</code>.</li>
|
|
645
|
+
<li>Reconnect external edges to the new <code>GroupNode</code>'s ports.</li>
|
|
646
|
+
</ol>
|
|
647
|
+
<hr />
|
|
648
|
+
<h2 id="4-nodeview-qgraphicsview">4. NodeView (QGraphicsView)</h2>
|
|
649
|
+
<p><code>NodeView</code> (<code>src/ui/canvas/view.py</code>) is the viewport for one workflow tab. It handles all user interaction at the canvas level.</p>
|
|
650
|
+
<h3 id="rendering-hints">Rendering hints</h3>
|
|
651
|
+
<pre><code class="language-python">self.setRenderHint(QPainter.Antialiasing)
|
|
652
|
+
self.setRenderHint(QPainter.SmoothPixmapTransform)
|
|
653
|
+
self.setTransformationAnchor(QGraphicsView.AnchorUnderMouse)
|
|
654
|
+
self.setResizeAnchor(QGraphicsView.AnchorUnderMouse)
|
|
655
|
+
</code></pre>
|
|
656
|
+
<p><code>AnchorUnderMouse</code> means zoom (Ctrl+Wheel) keeps the point under the cursor fixed in scene space.</p>
|
|
657
|
+
<h3 id="pan">Pan</h3>
|
|
658
|
+
<p>Middle-mouse button or Alt+Left drag initiates panning. Pan is implemented by directly adjusting horizontal and vertical scrollbar values rather than using <code>QGraphicsView.ScrollHandDrag</code>, to avoid interfering with rubber-band selection.</p>
|
|
659
|
+
<p>Spacebar shows an <code>OpenHandCursor</code> as a visual hint; actual panning starts on the next mouse press while space is held.</p>
|
|
660
|
+
<h3 id="zoom">Zoom</h3>
|
|
661
|
+
<p>Ctrl+Wheel scales the view by <code>1.25</code> (in) or <code>0.8</code> (out). After each zoom, <code>mini_map.refresh()</code> is called to redraw the viewport indicator.</p>
|
|
662
|
+
<h3 id="keyboard-shortcuts-handled-in-nodeviewkeypressevent">Keyboard shortcuts (handled in NodeView.keyPressEvent)</h3>
|
|
663
|
+
<table>
|
|
664
|
+
<thead>
|
|
665
|
+
<tr>
|
|
666
|
+
<th>Key</th>
|
|
667
|
+
<th>Action</th>
|
|
668
|
+
</tr>
|
|
669
|
+
</thead>
|
|
670
|
+
<tbody>
|
|
671
|
+
<tr>
|
|
672
|
+
<td>Tab</td>
|
|
673
|
+
<td>Open <code>NodeSearchPopup</code></td>
|
|
674
|
+
</tr>
|
|
675
|
+
<tr>
|
|
676
|
+
<td>F</td>
|
|
677
|
+
<td><code>focus_on_selection()</code> — fit selected items (or all items) in view</td>
|
|
678
|
+
</tr>
|
|
679
|
+
<tr>
|
|
680
|
+
<td>Ctrl+B</td>
|
|
681
|
+
<td>Toggle bypass on selected nodes</td>
|
|
682
|
+
</tr>
|
|
683
|
+
<tr>
|
|
684
|
+
<td>Ctrl+G</td>
|
|
685
|
+
<td>Wrap selected nodes in a Backdrop</td>
|
|
686
|
+
</tr>
|
|
687
|
+
<tr>
|
|
688
|
+
<td>Ctrl+Shift+G</td>
|
|
689
|
+
<td>Group selected nodes into a <code>GroupNode</code> (scene.group_selection)</td>
|
|
690
|
+
</tr>
|
|
691
|
+
<tr>
|
|
692
|
+
<td>Ctrl+F</td>
|
|
693
|
+
<td>Show <code>CanvasSearchBar</code> (via <code>MainWindow._find_in_canvas</code>)</td>
|
|
694
|
+
</tr>
|
|
695
|
+
<tr>
|
|
696
|
+
<td>Delete / Backspace</td>
|
|
697
|
+
<td>Delete selected items (handled in NodeScene)</td>
|
|
698
|
+
</tr>
|
|
699
|
+
<tr>
|
|
700
|
+
<td>Ctrl+Z</td>
|
|
701
|
+
<td>Undo</td>
|
|
702
|
+
</tr>
|
|
703
|
+
<tr>
|
|
704
|
+
<td>Ctrl+Shift+Z / Ctrl+Y</td>
|
|
705
|
+
<td>Redo</td>
|
|
706
|
+
</tr>
|
|
707
|
+
<tr>
|
|
708
|
+
<td>Ctrl+C / Ctrl+V</td>
|
|
709
|
+
<td>Copy / Paste selected nodes</td>
|
|
710
|
+
</tr>
|
|
711
|
+
<tr>
|
|
712
|
+
<td>Escape</td>
|
|
713
|
+
<td>Clear selection</td>
|
|
714
|
+
</tr>
|
|
715
|
+
</tbody>
|
|
716
|
+
</table>
|
|
717
|
+
<h3 id="drag-and-drop-from-librarypanel">Drag-and-drop from LibraryPanel</h3>
|
|
718
|
+
<p><code>NodeView.dropEvent()</code> reads <code>application/x-node-id</code> from the MIME data (set by <code>DraggableTreeWidget</code>), maps the drop position to scene coordinates via <code>mapToScene()</code>, and calls <code>scene.add_node_by_name(node_id, pos)</code>.</p>
|
|
719
|
+
<h3 id="mini-map-hosting">Mini-map hosting</h3>
|
|
720
|
+
<p><code>NodeView.__init__</code> creates one <code>MiniMap</code> child widget and attaches it to the scene. The mini-map is repositioned in <code>resizeEvent</code> via <code>_mini_map.reposition()</code>. Scrollbar <code>valueChanged</code> signals connect to <code>_mini_map.refresh()</code> so the viewport indicator redraws whenever the user pans.</p>
|
|
721
|
+
<hr />
|
|
722
|
+
<h2 id="5-nodewidget-rendering">5. NodeWidget Rendering</h2>
|
|
723
|
+
<p><code>NodeWidget</code> (<code>src/ui/node_widget.py</code>) is a <code>QGraphicsItem</code> subclass. It renders the node box using <code>QPainter</code> calls in <code>paint()</code> rather than Qt's built-in rectangle items, giving full control over the visual style.</p>
|
|
724
|
+
<h3 id="structure">Structure</h3>
|
|
725
|
+
<pre><code>NodeWidget (QGraphicsItem)
|
|
726
|
+
│
|
|
727
|
+
├── Header rect (painted via QPainter.fillRect + QPainter.drawText)
|
|
728
|
+
│ background: category color (configurable per node category)
|
|
729
|
+
│ text: node.name + optional icon (SVG loaded via QSvgRenderer)
|
|
730
|
+
│
|
|
731
|
+
├── Body rect (painted via QPainter.fillRect)
|
|
732
|
+
│ background: dark gray (#2a2a2a dark, lighter in light theme)
|
|
733
|
+
│
|
|
734
|
+
├── PortWidget items (QGraphicsEllipseItem, added as child items)
|
|
735
|
+
│ left side: input ports
|
|
736
|
+
│ right side: output ports
|
|
737
|
+
│
|
|
738
|
+
└── QGraphicsProxyWidget items (one per input port with a widget_type)
|
|
739
|
+
embedded QWidget (QLineEdit, QSpinBox, QDoubleSpinBox,
|
|
740
|
+
QCheckBox, QComboBox, QSlider, QTextEdit, QPushButton)
|
|
741
|
+
</code></pre>
|
|
742
|
+
<h3 id="proxy-widgets-and-z-ordering">Proxy widgets and z-ordering</h3>
|
|
743
|
+
<p><code>QGraphicsProxyWidget</code> items embed regular Qt widgets into the scene. A custom <code>QComboBox</code> subclass (<code>node_widget.py</code>) overrides <code>showPopup()</code> to display the dropdown as a <code>QMenu</code> (a native OS window) instead of a popup inside the proxy, because composite layers from other proxy widgets would otherwise paint on top of the dropdown.</p>
|
|
744
|
+
<h3 id="bypassed-rendering">Bypassed rendering</h3>
|
|
745
|
+
<p>When <code>node.bypassed</code> is <code>True</code>, <code>NodeWidget.paint()</code> draws the header with reduced opacity and a diagonal strikethrough line, and the body background uses a distinct "bypassed" color. <code>set_bypassed(value)</code> toggles this flag and calls <code>update()</code> to trigger a repaint.</p>
|
|
746
|
+
<h3 id="execution-state-highlighting">Execution state highlighting</h3>
|
|
747
|
+
<p><code>set_executing(True)</code> draws a colored border around the node (typically orange/amber). <code>set_executing(False)</code> removes it. This is driven by <code>MainWindow._on_node_started</code> and <code>_on_node_finished</code>.</p>
|
|
748
|
+
<h3 id="parameter-synchronization">Parameter synchronization</h3>
|
|
749
|
+
<p><code>set_parameter(port_name, value)</code> updates the in-scene widget to reflect a new value. For dropdowns, if <code>value</code> is a list, it updates the dropdown options. This is called by <code>MainWindow._on_node_output</code> to show live output values in the node's own UI as execution proceeds.</p>
|
|
750
|
+
<hr />
|
|
751
|
+
<h2 id="6-portwidget">6. PortWidget</h2>
|
|
752
|
+
<p><code>PortWidget</code> (<code>src/ui/port_widget.py</code>) is a <code>QGraphicsEllipseItem</code> that represents one input or output port. It stores a reference to the <code>Port</code> definition and knows its parent <code>NodeWidget</code>.</p>
|
|
753
|
+
<h3 id="colors">Colors</h3>
|
|
754
|
+
<p>Port color is determined by <code>data_type</code>:</p>
|
|
755
|
+
<table>
|
|
756
|
+
<thead>
|
|
757
|
+
<tr>
|
|
758
|
+
<th>data_type</th>
|
|
759
|
+
<th>Color</th>
|
|
760
|
+
</tr>
|
|
761
|
+
</thead>
|
|
762
|
+
<tbody>
|
|
763
|
+
<tr>
|
|
764
|
+
<td><code>exec</code></td>
|
|
765
|
+
<td>White (light mode: black)</td>
|
|
766
|
+
</tr>
|
|
767
|
+
<tr>
|
|
768
|
+
<td><code>string</code></td>
|
|
769
|
+
<td>Green</td>
|
|
770
|
+
</tr>
|
|
771
|
+
<tr>
|
|
772
|
+
<td><code>int</code></td>
|
|
773
|
+
<td>Cyan</td>
|
|
774
|
+
</tr>
|
|
775
|
+
<tr>
|
|
776
|
+
<td><code>float</code></td>
|
|
777
|
+
<td>Yellow</td>
|
|
778
|
+
</tr>
|
|
779
|
+
<tr>
|
|
780
|
+
<td><code>bool</code></td>
|
|
781
|
+
<td>Orange</td>
|
|
782
|
+
</tr>
|
|
783
|
+
<tr>
|
|
784
|
+
<td><code>list</code></td>
|
|
785
|
+
<td>Purple</td>
|
|
786
|
+
</tr>
|
|
787
|
+
<tr>
|
|
788
|
+
<td><code>any</code></td>
|
|
789
|
+
<td>Gray</td>
|
|
790
|
+
</tr>
|
|
791
|
+
</tbody>
|
|
792
|
+
</table>
|
|
793
|
+
<p>The color is applied as the ellipse fill brush. Edge (<code>Edge._refresh_color()</code>) reads the color from <code>from_port.brush().color()</code> to match the wire to its source port.</p>
|
|
794
|
+
<h3 id="hit-area">Hit area</h3>
|
|
795
|
+
<p>The port ellipse is typically 10×10 scene units. Port detection during wire dragging uses <code>scene.itemAt()</code> with a small tolerance rectangle.</p>
|
|
796
|
+
<h3 id="get_scene_pos">get_scene_pos()</h3>
|
|
797
|
+
<p><code>PortWidget.get_scene_pos()</code> returns the center of the port ellipse in scene coordinates. <code>Edge.update_path()</code> calls this on both endpoints to compute the bezier control points.</p>
|
|
798
|
+
<hr />
|
|
799
|
+
<h2 id="7-edge-wire-rendering">7. Edge (Wire) Rendering</h2>
|
|
800
|
+
<p><code>Edge</code> (<code>src/ui/canvas/edge.py</code>) is a <code>QGraphicsPathItem</code> that renders as a cubic bezier curve from one <code>PortWidget</code> to another.</p>
|
|
801
|
+
<h3 id="bezier-geometry">Bezier geometry</h3>
|
|
802
|
+
<pre><code class="language-python">pos_start = self.from_port.get_scene_pos()
|
|
803
|
+
pos_end = self.to_port.get_scene_pos() if self.to_port else self.pos_end
|
|
804
|
+
|
|
805
|
+
dx = pos_end.x() - pos_start.x()
|
|
806
|
+
dist = max(abs(dx) * 0.5, 20) # ensures minimum curvature even for vertical wires
|
|
807
|
+
|
|
808
|
+
ctrl1 = QPointF(pos_start.x() + dist, pos_start.y())
|
|
809
|
+
ctrl2 = QPointF(pos_end.x() - dist, pos_end.y())
|
|
810
|
+
|
|
811
|
+
path = QPainterPath()
|
|
812
|
+
path.moveTo(pos_start)
|
|
813
|
+
path.cubicTo(ctrl1, ctrl2, pos_end)
|
|
814
|
+
self.setPath(path)
|
|
815
|
+
</code></pre>
|
|
816
|
+
<p>The horizontal offset of the control points scales with the horizontal distance between ports. Ports directly above/below each other produce a gentle S-curve (dist = 20); ports far apart produce a wide arc.</p>
|
|
817
|
+
<h3 id="color">Color</h3>
|
|
818
|
+
<p>The wire inherits the color of <code>from_port.brush().color()</code>. In light theme, if the color is near-white (lightness > 200), it is overridden to black for visibility.</p>
|
|
819
|
+
<h3 id="12-pixel-hit-area">12-pixel hit area</h3>
|
|
820
|
+
<p><code>Edge.shape()</code> overrides the default shape (which is the path itself, only 2 px wide) to return a 12-pixel stroked version:</p>
|
|
821
|
+
<pre><code class="language-python">def shape(self):
|
|
822
|
+
stroker = QPainterPathStroker()
|
|
823
|
+
stroker.setWidth(12)
|
|
824
|
+
return stroker.createStroke(self.path())
|
|
825
|
+
</code></pre>
|
|
826
|
+
<p>This widens the hover and selection zone to 12 screen pixels, making it easy to click or hover over thin wires in a dense graph.</p>
|
|
827
|
+
<h3 id="live-value-tooltip">Live value tooltip</h3>
|
|
828
|
+
<p><code>set_live_value(value)</code> stores the value and sets a Qt tooltip:</p>
|
|
829
|
+
<pre><code class="language-python">s = repr(value)
|
|
830
|
+
if len(s) > 300:
|
|
831
|
+
s = s[:297] + "..."
|
|
832
|
+
self.setToolTip(f"{port_name}: {s}" if port_name else s)
|
|
833
|
+
</code></pre>
|
|
834
|
+
<p>Qt automatically shows the tooltip when the user hovers over the edge's hit area. Values persist after execution ends and are cleared only when the next run starts (by <code>NodeScene.clear_edge_values()</code>).</p>
|
|
835
|
+
<h3 id="temporary-edge-during-drag">Temporary edge during drag</h3>
|
|
836
|
+
<p>While the user drags a new wire from a port, <code>NodeScene.active_edge</code> holds an <code>Edge</code> instance with <code>to_port=None</code>. <code>NodeScene.mouseMoveEvent</code> calls <code>active_edge.set_end_pos(scene_pos)</code> on every move. On release over a compatible port, <code>to_port</code> is set and the connection is registered. On release over empty space, the temporary edge is removed.</p>
|
|
837
|
+
<hr />
|
|
838
|
+
<h2 id="8-minimap">8. MiniMap</h2>
|
|
839
|
+
<p><code>MiniMap</code> (<code>src/ui/canvas/mini_map.py</code>) is a secondary <code>QGraphicsView</code> that shares the same <code>QGraphicsScene</code> as the parent <code>NodeView</code>. Qt renders the full scene into both views automatically.</p>
|
|
840
|
+
<h3 id="fixed-size-and-position">Fixed size and position</h3>
|
|
841
|
+
<p>The mini-map is always 200×150 pixels (constants <code>_W</code>, <code>_H</code>). It is positioned 8 pixels from the bottom-right corner of its parent <code>NodeView</code> via <code>reposition()</code>:</p>
|
|
842
|
+
<pre><code class="language-python">def reposition(self):
|
|
843
|
+
pv = self._main_view
|
|
844
|
+
self.move(pv.width() - self.width() - 8,
|
|
845
|
+
pv.height() - self.height() - 8)
|
|
846
|
+
</code></pre>
|
|
847
|
+
<p><code>reposition()</code> is called in <code>NodeView.resizeEvent</code>.</p>
|
|
848
|
+
<h3 id="scene-fit-with-debouncing">Scene fit with debouncing</h3>
|
|
849
|
+
<p>When scene items change (nodes added, moved, deleted), <code>scene.changed</code> fires. <code>_schedule_fit</code> starts an 80 ms single-shot <code>QTimer</code>. When the timer fires, <code>_do_fit()</code> calls <code>fitInView(scene.itemsBoundingRect() + _PAD, Qt.KeepAspectRatio)</code>. The debounce prevents the mini-map from re-fitting on every tiny move during a drag, which would cause visible flickering.</p>
|
|
850
|
+
<h3 id="viewport-indicator">Viewport indicator</h3>
|
|
851
|
+
<p><code>drawForeground()</code> is called by Qt after the scene thumbnail is painted. It converts the main view's viewport rectangle into scene coordinates and draws a semi-transparent blue rectangle:</p>
|
|
852
|
+
<pre><code class="language-python">def drawForeground(self, painter, rect):
|
|
853
|
+
mv = self._main_view
|
|
854
|
+
vp = mv.viewport().rect()
|
|
855
|
+
scene_rect = QRectF(mv.mapToScene(vp.topLeft()),
|
|
856
|
+
mv.mapToScene(vp.bottomRight()))
|
|
857
|
+
painter.setBrush(QBrush(QColor(100, 180, 255, 35))) # very light fill
|
|
858
|
+
painter.setPen(QPen(QColor(100, 180, 255, 200), 1.5)) # visible outline
|
|
859
|
+
painter.drawRect(scene_rect)
|
|
860
|
+
</code></pre>
|
|
861
|
+
<h3 id="click-to-pan">Click-to-pan</h3>
|
|
862
|
+
<p><code>setInteractive(False)</code> prevents any mouse event from reaching the scene items through the mini-map. Instead, <code>mousePressEvent</code> and <code>mouseMoveEvent</code> are overridden to call <code>_pan_to(mini_pos)</code>:</p>
|
|
863
|
+
<pre><code class="language-python">def _pan_to(self, mini_pos):
|
|
864
|
+
scene_pos = self.mapToScene(mini_pos)
|
|
865
|
+
self._main_view.centerOn(scene_pos)
|
|
866
|
+
self.update()
|
|
867
|
+
</code></pre>
|
|
868
|
+
<p>This pans the main view so that <code>scene_pos</code> is centred in the main viewport. The viewport indicator redraws immediately via <code>update()</code>.</p>
|
|
869
|
+
<p><strong>Do not</strong> set <code>setInteractive(True)</code> on the mini-map — it would allow users to accidentally move nodes by clicking the thumbnail.</p>
|
|
870
|
+
<hr />
|
|
871
|
+
<h2 id="9-canvassearchbar">9. CanvasSearchBar</h2>
|
|
872
|
+
<p><code>CanvasSearchBar</code> (<code>src/ui/canvas/canvas_search_bar.py</code>) is a floating <code>QFrame</code> that is a child widget of <code>NodeView</code>, positioned at the top-centre via <code>move(x, 8)</code>.</p>
|
|
873
|
+
<h3 id="show-hide">Show / hide</h3>
|
|
874
|
+
<p><code>show_bar()</code> repositions the bar, shows it, gives focus to the <code>QLineEdit</code>, and immediately runs a search with the current text (in case the bar was hidden with text still in it). <code>hide_bar()</code> hides the bar, clears all state, and returns focus to <code>NodeView</code>.</p>
|
|
875
|
+
<h3 id="search-logic">Search logic</h3>
|
|
876
|
+
<p><code>_on_text_changed()</code> is connected to <code>QLineEdit.textChanged</code>. It filters <code>scene.nodes</code> by matching the query against <code>node_definition.name.lower()</code> and <code>node_definition.node_id.lower()</code>:</p>
|
|
877
|
+
<pre><code class="language-python">self._matches = [
|
|
878
|
+
w for w in scene.nodes
|
|
879
|
+
if t in w.node_definition.name.lower()
|
|
880
|
+
or t in getattr(w.node_definition, 'node_id', '').lower()
|
|
881
|
+
]
|
|
882
|
+
</code></pre>
|
|
883
|
+
<h3 id="navigation">Navigation</h3>
|
|
884
|
+
<p><code>_go_next()</code> and <code>_go_prev()</code> increment/decrement <code>_current_idx</code> (modulo <code>len(_matches)</code>). Each call updates the match counter label and pans the main view to the matched node via <code>self._view.centerOn(node)</code>. The matched node is also selected so it is visually highlighted.</p>
|
|
885
|
+
<h3 id="keyboard-handling">Keyboard handling</h3>
|
|
886
|
+
<p><code>keyPressEvent</code> intercepts:<br />
|
|
887
|
+
- <code>Escape</code> → <code>hide_bar()</code><br />
|
|
888
|
+
- <code>Enter</code> / <code>Return</code> → <code>_go_next()</code> (or <code>_go_prev()</code> with Shift)</p>
|
|
889
|
+
<p>Other keys propagate to the <code>QLineEdit</code> normally.</p>
|
|
890
|
+
<hr />
|
|
891
|
+
<h2 id="10-nodesearchpopup">10. NodeSearchPopup</h2>
|
|
892
|
+
<p><code>NodeSearchPopup</code> (<code>src/ui/canvas/node_search_popup.py</code>) is a <code>QDialog</code> that appears when the user presses Tab on the canvas. It displays a filterable list of all registered nodes (from <code>NodeRegistry._definitions</code>, which excludes group_in / group_out / group_node). Selecting an entry creates that node at the last tracked mouse position in the scene.</p>
|
|
893
|
+
<p>The popup position is calculated from <code>NodeView._last_mouse_scene_pos</code>, which <code>NodeView.mouseMoveEvent</code> updates on every mouse movement. This means the node spawns near where the user was pointing.</p>
|
|
894
|
+
<p>Theme detection uses:</p>
|
|
895
|
+
<pre><code class="language-python">is_dark = scene.backgroundBrush().color().lightness() < 128
|
|
896
|
+
</code></pre>
|
|
897
|
+
<hr />
|
|
898
|
+
<h2 id="11-event-flow-creating-a-connection">11. Event Flow: Creating a Connection</h2>
|
|
899
|
+
<p>This is the sequence of events from the moment a user starts dragging from a port to when the wire is committed:</p>
|
|
900
|
+
<pre><code>1. User presses left button on PortWidget
|
|
901
|
+
│
|
|
902
|
+
▼
|
|
903
|
+
NodeScene.mousePressEvent
|
|
904
|
+
├─ itemAt() → finds PortWidget under cursor
|
|
905
|
+
└─ creates Edge(from_port=port, to_port=None)
|
|
906
|
+
adds to scene as active_edge
|
|
907
|
+
|
|
908
|
+
2. User moves mouse
|
|
909
|
+
│
|
|
910
|
+
▼
|
|
911
|
+
NodeScene.mouseMoveEvent
|
|
912
|
+
└─ active_edge.set_end_pos(scene_mouse_pos)
|
|
913
|
+
→ Edge.update_path() recomputes bezier
|
|
914
|
+
→ scene repaints
|
|
915
|
+
|
|
916
|
+
[optional] hover snapping:
|
|
917
|
+
├─ itemAt() → finds PortWidget under cursor
|
|
918
|
+
└─ if compatible port found: highlight it, set _snapped_port
|
|
919
|
+
|
|
920
|
+
3. User releases mouse
|
|
921
|
+
│
|
|
922
|
+
▼
|
|
923
|
+
NodeScene.mouseReleaseEvent
|
|
924
|
+
├─ if _snapped_port is a compatible port:
|
|
925
|
+
│ to_port = _snapped_port
|
|
926
|
+
│ active_edge.to_port = to_port
|
|
927
|
+
│ scene.active_edge = None
|
|
928
|
+
│
|
|
929
|
+
│ validate: no duplicate connection, compatible types
|
|
930
|
+
│ graph_manager.add_connection(ConnectionModel(...))
|
|
931
|
+
│ └─ is_dag() check — reverts if cycle created
|
|
932
|
+
│
|
|
933
|
+
│ trigger on_plug_sync / on_plug callbacks on both nodes
|
|
934
|
+
│ push_history()
|
|
935
|
+
│ update LibraryPanel / parameter widgets
|
|
936
|
+
│
|
|
937
|
+
└─ else:
|
|
938
|
+
remove active_edge from scene
|
|
939
|
+
active_edge = None
|
|
940
|
+
</code></pre>
|
|
941
|
+
<h3 id="port-compatibility">Port compatibility</h3>
|
|
942
|
+
<p>Any connection between two ports is allowed unless one of them is already connected to the other (no duplicate edges). There is no strict data-type enforcement in the engine — <code>any</code> ports accept all types, and the node's <code>execute()</code> is responsible for handling type mismatches gracefully. The UI does color-code ports by type as a visual hint.</p>
|
|
943
|
+
<h3 id="exec-port-connections">Exec-port connections</h3>
|
|
944
|
+
<p>If <code>from_port.port_definition.data_type == 'exec'</code>, the created <code>ConnectionModel</code> has <code>is_exec=True</code>. The engine uses this flag to distinguish exec-chain wires from data wires.</p>
|
|
945
|
+
<hr />
|
|
946
|
+
<h2 id="12-history-undoredo">12. History (Undo/Redo)</h2>
|
|
947
|
+
<p>The history system uses full-scene snapshots rather than incremental diffs. This is simple to implement and correct, but it has a memory cost proportional to graph size.</p>
|
|
948
|
+
<h3 id="snapshot-format">Snapshot format</h3>
|
|
949
|
+
<p>Each snapshot is a <code>dict</code> returned by <code>WorkflowModel.model_dump(mode='json')</code>. This includes all nodes, connections, sticky notes, and backdrops. GroupNode subgraphs are stored inside <code>parameters["__workflow__"]</code> recursively.</p>
|
|
950
|
+
<h3 id="push">Push</h3>
|
|
951
|
+
<p><code>push_history()</code> is called after every user action that mutates the scene:<br />
|
|
952
|
+
- Adding / removing a node<br />
|
|
953
|
+
- Adding / removing a connection<br />
|
|
954
|
+
- Moving nodes (on mouse release)<br />
|
|
955
|
+
- Editing a parameter widget value (on change)<br />
|
|
956
|
+
- Grouping / ungrouping<br />
|
|
957
|
+
- Adding / removing sticky notes and backdrops</p>
|
|
958
|
+
<p>The <code>_undoing</code> guard prevents recursive push during undo/redo restoration.</p>
|
|
959
|
+
<h3 id="undo">Undo</h3>
|
|
960
|
+
<pre><code class="language-python">def undo(self):
|
|
961
|
+
if not self.history: return
|
|
962
|
+
self._undoing = True
|
|
963
|
+
current = self.to_workflow_model().model_dump()
|
|
964
|
+
self.redo_stack.append(current)
|
|
965
|
+
last_state = self.history.pop()
|
|
966
|
+
model = WorkflowModel.model_validate(last_state)
|
|
967
|
+
self.from_workflow_model(model)
|
|
968
|
+
self._undoing = False
|
|
969
|
+
if self._sync_callback:
|
|
970
|
+
self._sync_callback(last_state)
|
|
971
|
+
</code></pre>
|
|
972
|
+
<p><code>from_workflow_model()</code> completely rebuilds the scene from the snapshot. All existing items are removed and new ones are created. This is an O(n) operation but visually instant for typical graph sizes.</p>
|
|
973
|
+
<h3 id="max-depth">Max depth</h3>
|
|
974
|
+
<p>The history list is capped at 50 entries:</p>
|
|
975
|
+
<pre><code class="language-python">if len(self.history) > 50:
|
|
976
|
+
self.history.pop(0)
|
|
977
|
+
</code></pre>
|
|
978
|
+
<hr />
|
|
979
|
+
<h2 id="13-serialization-scene-tofrom-workflowmodel">13. Serialization (Scene to/from WorkflowModel)</h2>
|
|
980
|
+
<h3 id="scene-workflowmodel">Scene → WorkflowModel</h3>
|
|
981
|
+
<p><code>NodeScene.to_workflow_model()</code> collects:</p>
|
|
982
|
+
<ul>
|
|
983
|
+
<li><code>nodes</code>: one <code>NodeInstanceModel</code> per <code>NodeWidget</code>, preserving <code>instance_id</code>, <code>node_id</code>, position, parameters, <code>bypassed</code>, and <code>init_priority</code>.</li>
|
|
984
|
+
<li><code>connections</code>: one <code>ConnectionModel</code> per <code>Edge</code> with a committed <code>to_port</code>.</li>
|
|
985
|
+
<li><code>sticky_notes</code>: one <code>StickyNoteModel</code> per <code>StickyNote</code>.</li>
|
|
986
|
+
<li><code>backdrops</code>: one <code>BackdropModel</code> per <code>Backdrop</code>.</li>
|
|
987
|
+
</ul>
|
|
988
|
+
<p>Parameters are serialized by calling <code>NodeWidget.get_serializable_parameters()</code>, which merges the node's <code>instance.parameters</code> dict with the current widget values.</p>
|
|
989
|
+
<h3 id="workflowmodel-scene">WorkflowModel → Scene</h3>
|
|
990
|
+
<p><code>NodeScene.from_workflow_model(model)</code> clears all items from the scene, then:</p>
|
|
991
|
+
<ol>
|
|
992
|
+
<li>For each <code>NodeInstanceModel</code>: looks up <code>NodeRegistry.get_definition()</code> and <code>NodeRegistry.get_class()</code>, creates a <code>NodeWidget</code>, sets its position and parameters.</li>
|
|
993
|
+
<li>For each <code>ConnectionModel</code>: finds the matching <code>PortWidget</code> items by <code>instance_id</code> and <code>port_name</code>, creates an <code>Edge</code>, and adds it.</li>
|
|
994
|
+
<li>For each <code>StickyNoteModel</code> / <code>BackdropModel</code>: creates the corresponding item and positions it.</li>
|
|
995
|
+
</ol>
|
|
996
|
+
<h3 id="file-io">File I/O</h3>
|
|
997
|
+
<p><code>MainWindow.save_workflow_as()</code>:</p>
|
|
998
|
+
<pre><code class="language-python">model = scene.to_workflow_model()
|
|
999
|
+
json_str = model.model_dump_json(indent=2)
|
|
1000
|
+
with open(path, "w") as f:
|
|
1001
|
+
f.write(json_str)
|
|
1002
|
+
</code></pre>
|
|
1003
|
+
<p><code>MainWindow.load_workflow()</code>:</p>
|
|
1004
|
+
<pre><code class="language-python">with open(path, "r") as f:
|
|
1005
|
+
data = json.load(f)
|
|
1006
|
+
model = WorkflowModel.model_validate(data)
|
|
1007
|
+
scene.from_workflow_model(model)
|
|
1008
|
+
</code></pre>
|
|
1009
|
+
<hr />
|
|
1010
|
+
<h2 id="14-theme-system">14. Theme System</h2>
|
|
1011
|
+
<p>Vibrante-Node supports dark and light themes. Theme state is tracked by <code>MainWindow._is_dark_theme</code>.</p>
|
|
1012
|
+
<h3 id="application-stylesheet">Application stylesheet</h3>
|
|
1013
|
+
<p><code>MainWindow._apply_dark_theme()</code> and <code>_apply_light_theme()</code> call <code>QApplication.instance().setStyleSheet(css)</code> with a comprehensive CSS string that styles all standard Qt widgets (<code>QMainWindow</code>, <code>QDockWidget</code>, <code>QTabWidget</code>, <code>QMenuBar</code>, <code>QPushButton</code>, etc.).</p>
|
|
1014
|
+
<p>The Fusion style (<code>QApplication.setStyle("Fusion")</code>) is applied globally at startup to ensure consistent QSS rendering across platforms. Without Fusion, QSS rendering differs between Windows, macOS, and Linux.</p>
|
|
1015
|
+
<h3 id="cascade-to-canvas-items">Cascade to canvas items</h3>
|
|
1016
|
+
<p>After applying the application stylesheet, the theme methods call <code>apply_theme()</code> on items that manage their own appearance independently of QSS:</p>
|
|
1017
|
+
<pre><code class="language-python">scene.setBackgroundBrush(QColor(40, 40, 40)) # dark
|
|
1018
|
+
# or
|
|
1019
|
+
scene.setBackgroundBrush(QColor(220, 220, 220)) # light
|
|
1020
|
+
|
|
1021
|
+
for node in scene.nodes:
|
|
1022
|
+
node.apply_theme(is_dark)
|
|
1023
|
+
|
|
1024
|
+
for edge in scene.edges:
|
|
1025
|
+
edge.apply_theme(is_dark)
|
|
1026
|
+
|
|
1027
|
+
view._mini_map.apply_theme(is_dark)
|
|
1028
|
+
</code></pre>
|
|
1029
|
+
<h3 id="adding-a-themeable-component">Adding a themeable component</h3>
|
|
1030
|
+
<p>When creating a new graphics item or custom widget that cannot be styled purely via QSS:</p>
|
|
1031
|
+
<ol>
|
|
1032
|
+
<li>Add <code>apply_theme(is_dark: bool)</code> method.</li>
|
|
1033
|
+
<li>Set initial theme in <code>__init__</code> with <code>self.apply_theme(True)</code>.</li>
|
|
1034
|
+
<li>Connect to the theme cascade in <code>_apply_dark_theme()</code> / <code>_apply_light_theme()</code> in <code>MainWindow</code>.</li>
|
|
1035
|
+
</ol>
|
|
1036
|
+
<hr />
|
|
1037
|
+
<h2 id="15-librarypanel">15. LibraryPanel</h2>
|
|
1038
|
+
<p><code>LibraryPanel</code> (<code>src/ui/library_panel.py</code>) is a <code>QDockWidget</code> that displays all registered nodes grouped by category. It provides drag-to-canvas, double-click-to-add, and right-click context menus for edit and delete.</p>
|
|
1039
|
+
<h3 id="tree-structure">Tree structure</h3>
|
|
1040
|
+
<p>The <code>DraggableTreeWidget</code> (a <code>QTreeWidget</code> subclass) has top-level items for each category and child items for each node. Each child item stores <code>node_id</code> in <code>Qt.UserRole</code>.</p>
|
|
1041
|
+
<h3 id="drag-to-canvas">Drag-to-canvas</h3>
|
|
1042
|
+
<p><code>DraggableTreeWidget.mouseMoveEvent</code> starts a <code>QDrag</code> when the user moves more than <code>startDragDistance()</code> pixels from the press point. The <code>QMimeData</code> carries:</p>
|
|
1043
|
+
<ul>
|
|
1044
|
+
<li><code>application/x-node-id</code> — the <code>node_id</code> bytes (used by <code>NodeView.dropEvent</code>)</li>
|
|
1045
|
+
<li>plain text — the <code>node_id</code> string (fallback for external drops)</li>
|
|
1046
|
+
</ul>
|
|
1047
|
+
<h3 id="signals">Signals</h3>
|
|
1048
|
+
<table>
|
|
1049
|
+
<thead>
|
|
1050
|
+
<tr>
|
|
1051
|
+
<th>Signal</th>
|
|
1052
|
+
<th>When</th>
|
|
1053
|
+
</tr>
|
|
1054
|
+
</thead>
|
|
1055
|
+
<tbody>
|
|
1056
|
+
<tr>
|
|
1057
|
+
<td><code>node_selected(str)</code></td>
|
|
1058
|
+
<td>Double-click on a node item</td>
|
|
1059
|
+
</tr>
|
|
1060
|
+
<tr>
|
|
1061
|
+
<td><code>edit_requested(str)</code></td>
|
|
1062
|
+
<td>Right-click → Edit</td>
|
|
1063
|
+
</tr>
|
|
1064
|
+
<tr>
|
|
1065
|
+
<td><code>delete_requested(str)</code></td>
|
|
1066
|
+
<td>Right-click → Delete</td>
|
|
1067
|
+
</tr>
|
|
1068
|
+
</tbody>
|
|
1069
|
+
</table>
|
|
1070
|
+
<p><code>MainWindow</code> connects <code>node_selected</code> to <code>_on_node_selected()</code> which calls <code>scene.add_node_by_name()</code> at the current scene centre.</p>
|
|
1071
|
+
<hr />
|
|
1072
|
+
<h2 id="16-logpanel">16. LogPanel</h2>
|
|
1073
|
+
<p><code>LogPanel</code> (<code>src/ui/log_panel.py</code>) is a <code>QDockWidget</code> wrapping a <code>QTextEdit</code>. It displays messages with color-coded HTML:</p>
|
|
1074
|
+
<table>
|
|
1075
|
+
<thead>
|
|
1076
|
+
<tr>
|
|
1077
|
+
<th>Level</th>
|
|
1078
|
+
<th>Color</th>
|
|
1079
|
+
</tr>
|
|
1080
|
+
</thead>
|
|
1081
|
+
<tbody>
|
|
1082
|
+
<tr>
|
|
1083
|
+
<td><code>info</code></td>
|
|
1084
|
+
<td>Default text color (white/black per theme)</td>
|
|
1085
|
+
</tr>
|
|
1086
|
+
<tr>
|
|
1087
|
+
<td><code>success</code></td>
|
|
1088
|
+
<td>Green (<code>#4CAF50</code>)</td>
|
|
1089
|
+
</tr>
|
|
1090
|
+
<tr>
|
|
1091
|
+
<td><code>error</code></td>
|
|
1092
|
+
<td>Red (<code>#F44336</code>)</td>
|
|
1093
|
+
</tr>
|
|
1094
|
+
<tr>
|
|
1095
|
+
<td><code>warning</code></td>
|
|
1096
|
+
<td>Orange (<code>#FF9800</code>)</td>
|
|
1097
|
+
</tr>
|
|
1098
|
+
</tbody>
|
|
1099
|
+
</table>
|
|
1100
|
+
<p>Each message is prefixed with a timestamp (<code>HH:MM:SS</code>) and, when a <code>node_id</code> is known, the node name.</p>
|
|
1101
|
+
<p>Execution timing messages (logged by <code>MainWindow._on_node_finished</code>) appear as <code>info</code> level: <code>Node 'X' finished in 0.34s</code>.</p>
|
|
1102
|
+
<p>The <code>QTextEdit</code> is read-only. A <strong>Clear</strong> button calls <code>clear()</code>. Log entries are appended with <code>append(html)</code> which scrolls to the bottom automatically via <code>scrollContentsBy</code>.</p>
|
|
1103
|
+
<hr />
|
|
1104
|
+
<h2 id="17-scriptingconsole">17. ScriptingConsole</h2>
|
|
1105
|
+
<p><code>ScriptingConsole</code> (<code>src/ui/scripting_console.py</code>) is a <code>QDockWidget</code> with:<br />
|
|
1106
|
+
- A <code>QPlainTextEdit</code> (output area, read-only).<br />
|
|
1107
|
+
- A <code>QLineEdit</code> (input area).</p>
|
|
1108
|
+
<p>When the user presses Enter in the input area, the text is executed via <code>exec(code, context)</code> where <code>context = {'window': self._main_window, 'scene': current_scene}</code>. Standard output is captured and appended to the output area. Exceptions are displayed in red.</p>
|
|
1109
|
+
<p>Scripts have full access to <code>window</code> (<code>MainWindow</code>) and <code>scene</code> (<code>NodeScene</code>), so they can add nodes, read parameters, trigger execution, and modify the workflow programmatically.</p>
|
|
1110
|
+
<hr />
|
|
1111
|
+
<h2 id="18-nodebuilderdialog">18. NodeBuilderDialog</h2>
|
|
1112
|
+
<p><code>NodeBuilderDialog</code> (<code>src/ui/node_builder.py</code>) is a <code>QDialog</code> for creating and editing node definitions. It provides:</p>
|
|
1113
|
+
<ul>
|
|
1114
|
+
<li><strong>Metadata fields</strong>: name, category, description, icon path, <code>use_exec</code> checkbox.</li>
|
|
1115
|
+
<li><strong>Input ports table</strong> (<code>QTableWidget</code>): port name, data type, widget type columns; add/remove rows.</li>
|
|
1116
|
+
<li><strong>Output ports table</strong>: same structure.</li>
|
|
1117
|
+
<li><strong>Code editor</strong> (<code>CodeEditor</code>): Python source with syntax highlighting and autocomplete.</li>
|
|
1118
|
+
<li><strong>AI assistant</strong> (<code>GeminiChatWidget</code>): chat interface for generating node code with Gemini.</li>
|
|
1119
|
+
<li><strong>Test bridge button</strong>: calls <code>bridge.ping()</code> to verify Houdini connectivity.</li>
|
|
1120
|
+
</ul>
|
|
1121
|
+
<h3 id="code-to-ports-sync">Code-to-ports sync</h3>
|
|
1122
|
+
<p>A <code>QTimer</code> (debounced 300 ms) triggers <code>_sync_code_to_ui()</code> after each keystroke. This parses the code with <code>ast</code> and extracts <code>add_input()</code>/<code>add_output()</code> calls to populate the port tables. This is one-directional (code → tables); editing the tables does not modify the code.</p>
|
|
1123
|
+
<h3 id="save">Save</h3>
|
|
1124
|
+
<p>On <strong>Save</strong>, <code>NodeBuilderDialog</code> assembles a <code>NodeDefinitionJSON</code>, calls <code>NodeRegistry.register_definition()</code>, and writes the JSON file to <code>nodes/{node_id}.json</code>. It then calls <code>NodeRegistry.reload_node_definition()</code> and refreshes the <code>LibraryPanel</code>.</p>
|
|
1125
|
+
<hr />
|
|
1126
|
+
<h2 id="19-codeeditor">19. CodeEditor</h2>
|
|
1127
|
+
<p><code>CodeEditor</code> (<code>src/ui/code_editor.py</code>) provides Python-aware editing. It has two implementations selected at import time:</p>
|
|
1128
|
+
<pre><code class="language-python">try:
|
|
1129
|
+
from PyQt5.Qsci import QsciScintilla, QsciLexerPython, QsciAPIs
|
|
1130
|
+
_QSCINTILLA_AVAILABLE = True
|
|
1131
|
+
except ImportError:
|
|
1132
|
+
_QSCINTILLA_AVAILABLE = False
|
|
1133
|
+
# fallback class uses QPlainTextEdit + QSyntaxHighlighter
|
|
1134
|
+
</code></pre>
|
|
1135
|
+
<p>Both implementations expose an identical public API:</p>
|
|
1136
|
+
<table>
|
|
1137
|
+
<thead>
|
|
1138
|
+
<tr>
|
|
1139
|
+
<th>Method / attribute</th>
|
|
1140
|
+
<th>Notes</th>
|
|
1141
|
+
</tr>
|
|
1142
|
+
</thead>
|
|
1143
|
+
<tbody>
|
|
1144
|
+
<tr>
|
|
1145
|
+
<td><code>setPlainText(text)</code></td>
|
|
1146
|
+
<td>Set editor content</td>
|
|
1147
|
+
</tr>
|
|
1148
|
+
<tr>
|
|
1149
|
+
<td><code>toPlainText()</code></td>
|
|
1150
|
+
<td>Get editor content</td>
|
|
1151
|
+
</tr>
|
|
1152
|
+
<tr>
|
|
1153
|
+
<td><code>textChanged</code> signal</td>
|
|
1154
|
+
<td>Emitted on every keystroke</td>
|
|
1155
|
+
</tr>
|
|
1156
|
+
<tr>
|
|
1157
|
+
<td><code>apply_theme(is_dark)</code></td>
|
|
1158
|
+
<td>Switch Dracula-dark / One-Light color scheme</td>
|
|
1159
|
+
</tr>
|
|
1160
|
+
<tr>
|
|
1161
|
+
<td><code>set_completer_list(words)</code></td>
|
|
1162
|
+
<td>Replace autocomplete word list</td>
|
|
1163
|
+
</tr>
|
|
1164
|
+
<tr>
|
|
1165
|
+
<td><code>append_completer_list(words)</code></td>
|
|
1166
|
+
<td>Add words to autocomplete list</td>
|
|
1167
|
+
</tr>
|
|
1168
|
+
<tr>
|
|
1169
|
+
<td><code>error_line</code></td>
|
|
1170
|
+
<td>Line number of last syntax error (-1 if none)</td>
|
|
1171
|
+
</tr>
|
|
1172
|
+
<tr>
|
|
1173
|
+
<td>Ctrl+Wheel</td>
|
|
1174
|
+
<td>Zoom in/out</td>
|
|
1175
|
+
</tr>
|
|
1176
|
+
</tbody>
|
|
1177
|
+
</table>
|
|
1178
|
+
<p>Do not re-raise <code>ImportError</code> if QScintilla is missing. The fallback implementation keeps the application functional on systems without the optional dependency.</p>
|
|
1179
|
+
<p>To install the full editor:</p>
|
|
1180
|
+
<pre><code>pip install QScintilla
|
|
1181
|
+
</code></pre>
|
|
1182
|
+
<hr />
|
|
1183
|
+
<h2 id="20-how-to-add-a-new-ui-panel">20. How to Add a New UI Panel</h2>
|
|
1184
|
+
<p>This is the step-by-step pattern for adding a new dockable panel to the application.</p>
|
|
1185
|
+
<h3 id="step-1-create-the-panel-class">Step 1: Create the panel class</h3>
|
|
1186
|
+
<pre><code class="language-python"># src/ui/my_panel.py
|
|
1187
|
+
from PyQt5.QtWidgets import QDockWidget, QWidget, QVBoxLayout, QLabel
|
|
1188
|
+
|
|
1189
|
+
class MyPanel(QDockWidget):
|
|
1190
|
+
def __init__(self, parent=None):
|
|
1191
|
+
super().__init__("My Panel", parent)
|
|
1192
|
+
self.setObjectName("MyPanelDock") # must be unique for geometry save/restore
|
|
1193
|
+
self.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea)
|
|
1194
|
+
|
|
1195
|
+
container = QWidget()
|
|
1196
|
+
layout = QVBoxLayout(container)
|
|
1197
|
+
self._label = QLabel("Hello from MyPanel")
|
|
1198
|
+
layout.addWidget(self._label)
|
|
1199
|
+
self.setWidget(container)
|
|
1200
|
+
|
|
1201
|
+
def update_content(self, data):
|
|
1202
|
+
self._label.setText(str(data))
|
|
1203
|
+
</code></pre>
|
|
1204
|
+
<h3 id="step-2-instantiate-in-mainwindow">Step 2: Instantiate in MainWindow</h3>
|
|
1205
|
+
<pre><code class="language-python"># In MainWindow.__init__, after the existing dock panels:
|
|
1206
|
+
from src.ui.my_panel import MyPanel
|
|
1207
|
+
|
|
1208
|
+
self.my_panel = MyPanel(self)
|
|
1209
|
+
self.addDockWidget(Qt.RightDockWidgetArea, self.my_panel)
|
|
1210
|
+
</code></pre>
|
|
1211
|
+
<h3 id="step-3-connect-to-engine-signals-if-needed">Step 3: Connect to engine signals (if needed)</h3>
|
|
1212
|
+
<pre><code class="language-python">executor.node_output.connect(self._on_node_output_for_my_panel)
|
|
1213
|
+
|
|
1214
|
+
def _on_node_output_for_my_panel(self, node_id, output_data):
|
|
1215
|
+
if "my_output" in output_data:
|
|
1216
|
+
self.my_panel.update_content(output_data["my_output"])
|
|
1217
|
+
</code></pre>
|
|
1218
|
+
<h3 id="step-4-add-to-the-view-menu">Step 4: Add to the View menu</h3>
|
|
1219
|
+
<pre><code class="language-python"># In MainWindow._init_menu():
|
|
1220
|
+
view_menu.addAction(self.my_panel.toggleViewAction())
|
|
1221
|
+
</code></pre>
|
|
1222
|
+
<p>The <code>toggleViewAction()</code> is provided by <code>QDockWidget</code> and shows/hides the panel.</p>
|
|
1223
|
+
<h3 id="step-5-geometry-persistence">Step 5: Geometry persistence</h3>
|
|
1224
|
+
<p>Dock panel positions and sizes are saved/restored by <code>_save_user_settings()</code> / <code>_load_user_settings()</code> via <code>self.saveState()</code> / <code>self.restoreState()</code>. Any panel whose <code>objectName</code> was set before <code>restoreState()</code> is called will have its position restored automatically.</p>
|
|
1225
|
+
<hr />
|
|
1226
|
+
<h2 id="21-custom-graphics-items">21. Custom Graphics Items</h2>
|
|
1227
|
+
<h3 id="inheriting-qgraphicsitem">Inheriting QGraphicsItem</h3>
|
|
1228
|
+
<pre><code class="language-python">from PyQt5.QtWidgets import QGraphicsItem
|
|
1229
|
+
from PyQt5.QtCore import QRectF
|
|
1230
|
+
from PyQt5.QtGui import QPainter, QPen, QColor
|
|
1231
|
+
|
|
1232
|
+
class MyItem(QGraphicsItem):
|
|
1233
|
+
def __init__(self, parent=None):
|
|
1234
|
+
super().__init__(parent)
|
|
1235
|
+
self.setFlag(QGraphicsItem.ItemIsSelectable)
|
|
1236
|
+
self.setFlag(QGraphicsItem.ItemIsMovable)
|
|
1237
|
+
self.setFlag(QGraphicsItem.ItemSendsGeometryChanges)
|
|
1238
|
+
self._width = 100
|
|
1239
|
+
self._height = 60
|
|
1240
|
+
|
|
1241
|
+
def boundingRect(self) -> QRectF:
|
|
1242
|
+
# Must be exact or Qt will artifact during painting
|
|
1243
|
+
return QRectF(0, 0, self._width, self._height)
|
|
1244
|
+
|
|
1245
|
+
def paint(self, painter: QPainter, option, widget=None):
|
|
1246
|
+
painter.setPen(QPen(QColor("#888888"), 1))
|
|
1247
|
+
painter.drawRect(self.boundingRect())
|
|
1248
|
+
</code></pre>
|
|
1249
|
+
<h3 id="required-methods">Required methods</h3>
|
|
1250
|
+
<ul>
|
|
1251
|
+
<li><code>boundingRect()</code> — must return the exact bounding box in item-local coordinates. Qt uses this for culling (not painting items outside the viewport) and hit testing.</li>
|
|
1252
|
+
<li><code>paint(painter, option, widget)</code> — all drawing happens here. Use the provided <code>painter</code>; do not create a new <code>QPainter</code>.</li>
|
|
1253
|
+
</ul>
|
|
1254
|
+
<h3 id="z-order">Z-order</h3>
|
|
1255
|
+
<p>Z-value controls paint order. Higher Z-values paint on top:</p>
|
|
1256
|
+
<table>
|
|
1257
|
+
<thead>
|
|
1258
|
+
<tr>
|
|
1259
|
+
<th>Item</th>
|
|
1260
|
+
<th>Z-value</th>
|
|
1261
|
+
</tr>
|
|
1262
|
+
</thead>
|
|
1263
|
+
<tbody>
|
|
1264
|
+
<tr>
|
|
1265
|
+
<td>Backdrop</td>
|
|
1266
|
+
<td>-3</td>
|
|
1267
|
+
</tr>
|
|
1268
|
+
<tr>
|
|
1269
|
+
<td>Edge (wire)</td>
|
|
1270
|
+
<td>-1</td>
|
|
1271
|
+
</tr>
|
|
1272
|
+
<tr>
|
|
1273
|
+
<td>NodeWidget</td>
|
|
1274
|
+
<td>0</td>
|
|
1275
|
+
</tr>
|
|
1276
|
+
<tr>
|
|
1277
|
+
<td>StickyNote</td>
|
|
1278
|
+
<td>1</td>
|
|
1279
|
+
</tr>
|
|
1280
|
+
<tr>
|
|
1281
|
+
<td>Active edge (during drag)</td>
|
|
1282
|
+
<td>2</td>
|
|
1283
|
+
</tr>
|
|
1284
|
+
</tbody>
|
|
1285
|
+
</table>
|
|
1286
|
+
<p>Set z-value in <code>__init__</code>:</p>
|
|
1287
|
+
<pre><code class="language-python">self.setZValue(-1) # paint behind nodes
|
|
1288
|
+
</code></pre>
|
|
1289
|
+
<h3 id="adding-to-the-scene">Adding to the scene</h3>
|
|
1290
|
+
<pre><code class="language-python">item = MyItem()
|
|
1291
|
+
item.setPos(scene_x, scene_y)
|
|
1292
|
+
scene.addItem(item)
|
|
1293
|
+
</code></pre>
|
|
1294
|
+
<h3 id="custom-hit-area-shape">Custom hit area (shape())</h3>
|
|
1295
|
+
<p>To make a thin or irregular item easier to click, override <code>shape()</code>:</p>
|
|
1296
|
+
<pre><code class="language-python">def shape(self):
|
|
1297
|
+
stroker = QPainterPathStroker()
|
|
1298
|
+
stroker.setWidth(12)
|
|
1299
|
+
path = QPainterPath()
|
|
1300
|
+
path.addRect(self.boundingRect())
|
|
1301
|
+
return stroker.createStroke(path)
|
|
1302
|
+
</code></pre>
|
|
1303
|
+
<p>This is the same technique <code>Edge</code> uses to widen wire hit areas.</p>
|
|
1304
|
+
<hr />
|
|
1305
|
+
<h2 id="22-stylesheet-architecture">22. Stylesheet Architecture</h2>
|
|
1306
|
+
<p>The application uses Qt Style Sheets (QSS) applied to <code>QApplication</code>. There is one large CSS string for dark theme and one for light theme.</p>
|
|
1307
|
+
<h3 id="where-stylesheets-live">Where stylesheets live</h3>
|
|
1308
|
+
<p>The CSS strings are defined inline in <code>MainWindow._apply_dark_theme()</code> and <code>MainWindow._apply_light_theme()</code>. They are not loaded from files; embedding them avoids file-not-found issues in bundled deployments.</p>
|
|
1309
|
+
<h3 id="css-variable-pattern">CSS variable pattern</h3>
|
|
1310
|
+
<p>Qt 5's QSS does not support CSS variables. The pattern used here is Python string templating at the call site:</p>
|
|
1311
|
+
<pre><code class="language-python">PRIMARY = "#4a90d9"
|
|
1312
|
+
BACKGROUND = "#2b2b2b"
|
|
1313
|
+
|
|
1314
|
+
css = f"""
|
|
1315
|
+
QMainWindow {{
|
|
1316
|
+
background-color: {BACKGROUND};
|
|
1317
|
+
}}
|
|
1318
|
+
QPushButton {{
|
|
1319
|
+
background-color: {PRIMARY};
|
|
1320
|
+
color: white;
|
|
1321
|
+
}}
|
|
1322
|
+
"""
|
|
1323
|
+
QApplication.instance().setStyleSheet(css)
|
|
1324
|
+
</code></pre>
|
|
1325
|
+
<h3 id="per-widget-overrides">Per-widget overrides</h3>
|
|
1326
|
+
<p>To override the global stylesheet for a specific widget, call <code>widget.setStyleSheet(local_css)</code>. Local styles take precedence over the global stylesheet for that widget and its children. Example:</p>
|
|
1327
|
+
<pre><code class="language-python">self.my_button.setStyleSheet("""
|
|
1328
|
+
QPushButton {
|
|
1329
|
+
background-color: #c0392b; /* red override */
|
|
1330
|
+
color: white;
|
|
1331
|
+
}
|
|
1332
|
+
""")
|
|
1333
|
+
</code></pre>
|
|
1334
|
+
<h3 id="selectors-for-custom-items">Selectors for custom items</h3>
|
|
1335
|
+
<p>Custom <code>QWidget</code> subclasses can be styled by their Python class name only if they are also registered with Qt's meta-object system. To use <code>objectName</code> as a CSS ID:</p>
|
|
1336
|
+
<pre><code class="language-python">self.setObjectName("MiniMapView")
|
|
1337
|
+
# CSS:
|
|
1338
|
+
# QGraphicsView#MiniMapView { border: 1px solid #555; }
|
|
1339
|
+
</code></pre>
|
|
1340
|
+
<h3 id="what-qss-cannot-style">What QSS cannot style</h3>
|
|
1341
|
+
<ul>
|
|
1342
|
+
<li><code>QGraphicsItem</code> subclasses (e.g. <code>NodeWidget</code>, <code>Edge</code>). These must be styled via <code>QPainter</code> in <code>paint()</code> or via <code>apply_theme()</code> methods.</li>
|
|
1343
|
+
<li><code>QGraphicsScene</code> background — use <code>scene.setBackgroundBrush()</code>.</li>
|
|
1344
|
+
</ul>
|
|
1345
|
+
<hr />
|
|
1346
|
+
<h2 id="23-stickynote-and-backdrop">23. StickyNote and Backdrop</h2>
|
|
1347
|
+
<p><code>StickyNote</code> (<code>src/ui/canvas/sticky_note.py</code>) and <code>Backdrop</code> (<code>src/ui/canvas/backdrop.py</code>) are annotation items that do not participate in execution.</p>
|
|
1348
|
+
<h3 id="stickynote">StickyNote</h3>
|
|
1349
|
+
<p>A <code>QGraphicsItem</code> with:<br />
|
|
1350
|
+
- A colored rectangle background (user-configurable color via right-click).<br />
|
|
1351
|
+
- A <code>QGraphicsProxyWidget</code> embedding a <code>QTextEdit</code> for multi-line text.<br />
|
|
1352
|
+
- Resize handles at the corners and edges.<br />
|
|
1353
|
+
- Z-value <code>1</code> (above nodes and edges so notes are always readable).</p>
|
|
1354
|
+
<p><code>StickyNoteModel</code> is serialized as part of <code>WorkflowModel.sticky_notes</code>.</p>
|
|
1355
|
+
<h3 id="backdrop-network-box">Backdrop (Network Box)</h3>
|
|
1356
|
+
<p>A <code>QGraphicsRectItem</code> with:<br />
|
|
1357
|
+
- A semi-transparent colored fill.<br />
|
|
1358
|
+
- A title text rendered in the header area.<br />
|
|
1359
|
+
- Resize handles.<br />
|
|
1360
|
+
- Z-value <code>-3</code> (behind all other items so it acts as a visual grouping frame).<br />
|
|
1361
|
+
- Moving a Backdrop does <strong>not</strong> move contained nodes — the backdrop is purely cosmetic.</p>
|
|
1362
|
+
<p><code>BackdropModel</code> is serialized as part of <code>WorkflowModel.backdrops</code>.</p>
|
|
1363
|
+
<h3 id="creating-programmatically">Creating programmatically</h3>
|
|
1364
|
+
<pre><code class="language-python">scene.add_sticky_note(pos=(100, 200), text="Initial text", color="#ffffcc")
|
|
1365
|
+
scene.add_backdrop(title="My Group", pos=(50, 150), size=(400, 300), color="#444444")
|
|
1366
|
+
</code></pre>
|
|
1367
|
+
<p>Both methods push history after creation so they can be undone.</p>
|
|
1368
|
+
<nav class="page-nav">
|
|
1369
|
+
<a class="page-nav-link prev" href="06_backend_architecture.html"><span class="page-nav-label">Previous</span><span class="page-nav-title">Backend Architecture</span></a>
|
|
1370
|
+
<a class="page-nav-link next" href="08_api_reference.html"><span class="page-nav-label">Next</span><span class="page-nav-title">API Reference</span></a>
|
|
1371
|
+
</nav>
|
|
1372
|
+
<section class="licence-attribution" style="margin-top:40px;padding-top:14px;border-top:1px solid #313244;font-size:.82em;color:#a6adc8">
|
|
1373
|
+
<p>Documentation &copy; 2024&ndash;2026 Mahmoud Kamal (KamalTD), licensed under
|
|
1374
|
+
<a href="https://creativecommons.org/licenses/by/4.0/" rel="license">CC BY 4.0</a>.
|
|
1375
|
+
<a href="../LICENSE.txt">Full licence notice</a>.</p>
|
|
1376
|
+
<p>Search and syntax highlighting load <a href="https://lunrjs.com/">lunr.js</a> 2.3.9 (MIT)
|
|
1377
|
+
and <a href="https://highlightjs.org/">highlight.js</a> 11.9.0 (BSD-3-Clause) from
|
|
1378
|
+
cdn.jsdelivr.net at view time; neither library is redistributed with these files.</p>
|
|
1379
|
+
</section>
|
|
1380
|
+
</div>
|
|
1381
|
+
</main>
|
|
1382
|
+
|
|
1383
|
+
<!-- ── TOC ────────────────────────────────────────────────────────────── -->
|
|
1384
|
+
<aside class="toc">
|
|
1385
|
+
<div class="toc-title">On this page</div>
|
|
1386
|
+
<a class="toc-link toc-h2" href="#table-of-contents">Table of Contents</a>
|
|
1387
|
+
<a class="toc-link toc-h2" href="#1-widget-hierarchy">1. Widget Hierarchy</a>
|
|
1388
|
+
<a class="toc-link toc-h2" href="#2-mainwindow">2. MainWindow</a>
|
|
1389
|
+
<a class="toc-link toc-h3" href="#tab-management">Tab management</a>
|
|
1390
|
+
<a class="toc-link toc-h3" href="#signal-connections-engine-ui">Signal connections (engine → UI)</a>
|
|
1391
|
+
<a class="toc-link toc-h3" href="#autosave">Autosave</a>
|
|
1392
|
+
<a class="toc-link toc-h3" href="#recent-files">Recent files</a>
|
|
1393
|
+
<a class="toc-link toc-h2" href="#3-nodescene-qgraphicsscene">3. NodeScene (QGraphicsScene)</a>
|
|
1394
|
+
<a class="toc-link toc-h3" href="#key-attributes">Key attributes</a>
|
|
1395
|
+
<a class="toc-link toc-h3" href="#background-grid">Background grid</a>
|
|
1396
|
+
<a class="toc-link toc-h3" href="#history-undoredo">History (undo/redo)</a>
|
|
1397
|
+
<a class="toc-link toc-h3" href="#scene-communication-_sync_callback">Scene communication: _sync_callback</a>
|
|
1398
|
+
<a class="toc-link toc-h3" href="#node-search-from-scene">Node search from scene</a>
|
|
1399
|
+
<a class="toc-link toc-h3" href="#grouping">Grouping</a>
|
|
1400
|
+
<a class="toc-link toc-h2" href="#4-nodeview-qgraphicsview">4. NodeView (QGraphicsView)</a>
|
|
1401
|
+
<a class="toc-link toc-h3" href="#rendering-hints">Rendering hints</a>
|
|
1402
|
+
<a class="toc-link toc-h3" href="#pan">Pan</a>
|
|
1403
|
+
<a class="toc-link toc-h3" href="#zoom">Zoom</a>
|
|
1404
|
+
<a class="toc-link toc-h3" href="#keyboard-shortcuts-handled-in-nodeviewkeypressevent">Keyboard shortcuts (handled in NodeView.keyPressEvent)</a>
|
|
1405
|
+
<a class="toc-link toc-h3" href="#drag-and-drop-from-librarypanel">Drag-and-drop from LibraryPanel</a>
|
|
1406
|
+
<a class="toc-link toc-h3" href="#mini-map-hosting">Mini-map hosting</a>
|
|
1407
|
+
<a class="toc-link toc-h2" href="#5-nodewidget-rendering">5. NodeWidget Rendering</a>
|
|
1408
|
+
<a class="toc-link toc-h3" href="#structure">Structure</a>
|
|
1409
|
+
<a class="toc-link toc-h3" href="#proxy-widgets-and-z-ordering">Proxy widgets and z-ordering</a>
|
|
1410
|
+
<a class="toc-link toc-h3" href="#bypassed-rendering">Bypassed rendering</a>
|
|
1411
|
+
<a class="toc-link toc-h3" href="#execution-state-highlighting">Execution state highlighting</a>
|
|
1412
|
+
<a class="toc-link toc-h3" href="#parameter-synchronization">Parameter synchronization</a>
|
|
1413
|
+
<a class="toc-link toc-h2" href="#6-portwidget">6. PortWidget</a>
|
|
1414
|
+
<a class="toc-link toc-h3" href="#colors">Colors</a>
|
|
1415
|
+
<a class="toc-link toc-h3" href="#hit-area">Hit area</a>
|
|
1416
|
+
<a class="toc-link toc-h3" href="#get_scene_pos">get_scene_pos()</a>
|
|
1417
|
+
<a class="toc-link toc-h2" href="#7-edge-wire-rendering">7. Edge (Wire) Rendering</a>
|
|
1418
|
+
<a class="toc-link toc-h3" href="#bezier-geometry">Bezier geometry</a>
|
|
1419
|
+
<a class="toc-link toc-h3" href="#color">Color</a>
|
|
1420
|
+
<a class="toc-link toc-h3" href="#12-pixel-hit-area">12-pixel hit area</a>
|
|
1421
|
+
<a class="toc-link toc-h3" href="#live-value-tooltip">Live value tooltip</a>
|
|
1422
|
+
<a class="toc-link toc-h3" href="#temporary-edge-during-drag">Temporary edge during drag</a>
|
|
1423
|
+
<a class="toc-link toc-h2" href="#8-minimap">8. MiniMap</a>
|
|
1424
|
+
<a class="toc-link toc-h3" href="#fixed-size-and-position">Fixed size and position</a>
|
|
1425
|
+
<a class="toc-link toc-h3" href="#scene-fit-with-debouncing">Scene fit with debouncing</a>
|
|
1426
|
+
<a class="toc-link toc-h3" href="#viewport-indicator">Viewport indicator</a>
|
|
1427
|
+
<a class="toc-link toc-h3" href="#click-to-pan">Click-to-pan</a>
|
|
1428
|
+
<a class="toc-link toc-h2" href="#9-canvassearchbar">9. CanvasSearchBar</a>
|
|
1429
|
+
<a class="toc-link toc-h3" href="#show-hide">Show / hide</a>
|
|
1430
|
+
<a class="toc-link toc-h3" href="#search-logic">Search logic</a>
|
|
1431
|
+
<a class="toc-link toc-h3" href="#navigation">Navigation</a>
|
|
1432
|
+
<a class="toc-link toc-h3" href="#keyboard-handling">Keyboard handling</a>
|
|
1433
|
+
<a class="toc-link toc-h2" href="#10-nodesearchpopup">10. NodeSearchPopup</a>
|
|
1434
|
+
<a class="toc-link toc-h2" href="#11-event-flow-creating-a-connection">11. Event Flow: Creating a Connection</a>
|
|
1435
|
+
<a class="toc-link toc-h3" href="#port-compatibility">Port compatibility</a>
|
|
1436
|
+
<a class="toc-link toc-h3" href="#exec-port-connections">Exec-port connections</a>
|
|
1437
|
+
<a class="toc-link toc-h2" href="#12-history-undoredo">12. History (Undo/Redo)</a>
|
|
1438
|
+
<a class="toc-link toc-h3" href="#snapshot-format">Snapshot format</a>
|
|
1439
|
+
<a class="toc-link toc-h3" href="#push">Push</a>
|
|
1440
|
+
<a class="toc-link toc-h3" href="#undo">Undo</a>
|
|
1441
|
+
<a class="toc-link toc-h3" href="#max-depth">Max depth</a>
|
|
1442
|
+
<a class="toc-link toc-h2" href="#13-serialization-scene-tofrom-workflowmodel">13. Serialization (Scene to/from WorkflowModel)</a>
|
|
1443
|
+
<a class="toc-link toc-h3" href="#scene-workflowmodel">Scene → WorkflowModel</a>
|
|
1444
|
+
<a class="toc-link toc-h3" href="#workflowmodel-scene">WorkflowModel → Scene</a>
|
|
1445
|
+
<a class="toc-link toc-h3" href="#file-io">File I/O</a>
|
|
1446
|
+
<a class="toc-link toc-h2" href="#14-theme-system">14. Theme System</a>
|
|
1447
|
+
<a class="toc-link toc-h3" href="#application-stylesheet">Application stylesheet</a>
|
|
1448
|
+
<a class="toc-link toc-h3" href="#cascade-to-canvas-items">Cascade to canvas items</a>
|
|
1449
|
+
<a class="toc-link toc-h3" href="#adding-a-themeable-component">Adding a themeable component</a>
|
|
1450
|
+
<a class="toc-link toc-h2" href="#15-librarypanel">15. LibraryPanel</a>
|
|
1451
|
+
<a class="toc-link toc-h3" href="#tree-structure">Tree structure</a>
|
|
1452
|
+
<a class="toc-link toc-h3" href="#drag-to-canvas">Drag-to-canvas</a>
|
|
1453
|
+
<a class="toc-link toc-h3" href="#signals">Signals</a>
|
|
1454
|
+
<a class="toc-link toc-h2" href="#16-logpanel">16. LogPanel</a>
|
|
1455
|
+
<a class="toc-link toc-h2" href="#17-scriptingconsole">17. ScriptingConsole</a>
|
|
1456
|
+
<a class="toc-link toc-h2" href="#18-nodebuilderdialog">18. NodeBuilderDialog</a>
|
|
1457
|
+
<a class="toc-link toc-h3" href="#code-to-ports-sync">Code-to-ports sync</a>
|
|
1458
|
+
<a class="toc-link toc-h3" href="#save">Save</a>
|
|
1459
|
+
<a class="toc-link toc-h2" href="#19-codeeditor">19. CodeEditor</a>
|
|
1460
|
+
<a class="toc-link toc-h2" href="#20-how-to-add-a-new-ui-panel">20. How to Add a New UI Panel</a>
|
|
1461
|
+
<a class="toc-link toc-h3" href="#step-1-create-the-panel-class">Step 1: Create the panel class</a>
|
|
1462
|
+
<a class="toc-link toc-h3" href="#step-2-instantiate-in-mainwindow">Step 2: Instantiate in MainWindow</a>
|
|
1463
|
+
<a class="toc-link toc-h3" href="#step-3-connect-to-engine-signals-if-needed">Step 3: Connect to engine signals (if needed)</a>
|
|
1464
|
+
<a class="toc-link toc-h3" href="#step-4-add-to-the-view-menu">Step 4: Add to the View menu</a>
|
|
1465
|
+
<a class="toc-link toc-h3" href="#step-5-geometry-persistence">Step 5: Geometry persistence</a>
|
|
1466
|
+
<a class="toc-link toc-h2" href="#21-custom-graphics-items">21. Custom Graphics Items</a>
|
|
1467
|
+
<a class="toc-link toc-h3" href="#inheriting-qgraphicsitem">Inheriting QGraphicsItem</a>
|
|
1468
|
+
<a class="toc-link toc-h3" href="#required-methods">Required methods</a>
|
|
1469
|
+
<a class="toc-link toc-h3" href="#z-order">Z-order</a>
|
|
1470
|
+
<a class="toc-link toc-h3" href="#adding-to-the-scene">Adding to the scene</a>
|
|
1471
|
+
<a class="toc-link toc-h3" href="#custom-hit-area-shape">Custom hit area (shape())</a>
|
|
1472
|
+
<a class="toc-link toc-h2" href="#22-stylesheet-architecture">22. Stylesheet Architecture</a>
|
|
1473
|
+
<a class="toc-link toc-h3" href="#where-stylesheets-live">Where stylesheets live</a>
|
|
1474
|
+
<a class="toc-link toc-h3" href="#css-variable-pattern">CSS variable pattern</a>
|
|
1475
|
+
<a class="toc-link toc-h3" href="#per-widget-overrides">Per-widget overrides</a>
|
|
1476
|
+
<a class="toc-link toc-h3" href="#selectors-for-custom-items">Selectors for custom items</a>
|
|
1477
|
+
<a class="toc-link toc-h3" href="#what-qss-cannot-style">What QSS cannot style</a>
|
|
1478
|
+
<a class="toc-link toc-h2" href="#23-stickynote-and-backdrop">23. StickyNote and Backdrop</a>
|
|
1479
|
+
<a class="toc-link toc-h3" href="#stickynote">StickyNote</a>
|
|
1480
|
+
<a class="toc-link toc-h3" href="#backdrop-network-box">Backdrop (Network Box)</a>
|
|
1481
|
+
<a class="toc-link toc-h3" href="#creating-programmatically">Creating programmatically</a>
|
|
1482
|
+
</aside>
|
|
1483
|
+
|
|
1484
|
+
<script src="https://cdn.jsdelivr.net/npm/highlight.js@11.9.0/highlight.min.js"></script>
|
|
1485
|
+
<script src="https://cdn.jsdelivr.net/npm/lunr@2.3.9/lunr.min.js"></script>
|
|
1486
|
+
<script>
|
|
1487
|
+
// ── Search ──────────────────────────────────────────────────────────────
|
|
1488
|
+
let _idx = null, _docs = [];
|
|
1489
|
+
|
|
1490
|
+
async function initSearch() {
|
|
1491
|
+
try {
|
|
1492
|
+
const base = document.getElementById('portal-base').dataset.base;
|
|
1493
|
+
const resp = await fetch(base + 'search.json');
|
|
1494
|
+
_docs = await resp.json();
|
|
1495
|
+
_idx = lunr(function() {
|
|
1496
|
+
this.ref('id');
|
|
1497
|
+
this.field('title', { boost: 10 });
|
|
1498
|
+
this.field('body');
|
|
1499
|
+
_docs.forEach((d, i) => {
|
|
1500
|
+
this.add({ id: i, title: d.title, body: d.body });
|
|
1501
|
+
});
|
|
1502
|
+
});
|
|
1503
|
+
} catch(e) { console.warn('Search index not available', e); }
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
function doSearch(q) {
|
|
1507
|
+
const box = document.getElementById('search-results');
|
|
1508
|
+
if (!q || q.length < 2) { box.classList.remove('visible'); return; }
|
|
1509
|
+
if (!_idx) { box.innerHTML = '<div class="search-no-results">Search index loading…</div>'; box.classList.add('visible'); return; }
|
|
1510
|
+
const results = _idx.search(q + '~1');
|
|
1511
|
+
if (!results.length) {
|
|
1512
|
+
box.innerHTML = '<div class="search-no-results">No results for "' + q + '"</div>';
|
|
1513
|
+
box.classList.add('visible'); return;
|
|
1514
|
+
}
|
|
1515
|
+
box.innerHTML = results.slice(0, 8).map(r => {
|
|
1516
|
+
const d = _docs[r.ref];
|
|
1517
|
+
const excerpt = d.body.substring(0, 140).replace(/[#*`]/g, '').trim() + '…';
|
|
1518
|
+
return `<a class="search-result-item" href="${d.url}">
|
|
1519
|
+
<div class="search-result-title">${d.title}</div>
|
|
1520
|
+
<div class="search-result-excerpt">${excerpt}</div>
|
|
1521
|
+
</a>`;
|
|
1522
|
+
}).join('');
|
|
1523
|
+
box.classList.add('visible');
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
1527
|
+
initSearch();
|
|
1528
|
+
const inp = document.getElementById('search-input');
|
|
1529
|
+
if (inp) {
|
|
1530
|
+
inp.addEventListener('input', e => doSearch(e.target.value));
|
|
1531
|
+
inp.addEventListener('keydown', e => { if (e.key === 'Escape') { e.target.value=''; document.getElementById('search-results').classList.remove('visible'); }});
|
|
1532
|
+
}
|
|
1533
|
+
document.addEventListener('click', e => {
|
|
1534
|
+
if (!e.target.closest('.search-wrap')) document.getElementById('search-results')?.classList.remove('visible');
|
|
1535
|
+
});
|
|
1536
|
+
// Keyboard shortcut: / to focus search
|
|
1537
|
+
document.addEventListener('keydown', e => {
|
|
1538
|
+
if (e.key === '/' && !['INPUT','TEXTAREA'].includes(document.activeElement.tagName)) {
|
|
1539
|
+
e.preventDefault(); document.getElementById('search-input')?.focus();
|
|
1540
|
+
}
|
|
1541
|
+
});
|
|
1542
|
+
|
|
1543
|
+
// ── TOC active section ──────────────────────────────────────────────
|
|
1544
|
+
const tocLinks = document.querySelectorAll('.toc-link');
|
|
1545
|
+
const headings = document.querySelectorAll('h2[id],h3[id],h4[id]');
|
|
1546
|
+
if (tocLinks.length && headings.length) {
|
|
1547
|
+
const obs = new IntersectionObserver(entries => {
|
|
1548
|
+
entries.forEach(entry => {
|
|
1549
|
+
if (entry.isIntersecting) {
|
|
1550
|
+
tocLinks.forEach(l => l.classList.remove('active'));
|
|
1551
|
+
const link = document.querySelector(`.toc-link[href="#${entry.target.id}"]`);
|
|
1552
|
+
if (link) link.classList.add('active');
|
|
1553
|
+
}
|
|
1554
|
+
});
|
|
1555
|
+
}, { rootMargin: '-20% 0px -70% 0px' });
|
|
1556
|
+
headings.forEach(h => obs.observe(h));
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
// ── Copy buttons ────────────────────────────────────────────────────
|
|
1560
|
+
document.querySelectorAll('pre').forEach(pre => {
|
|
1561
|
+
const btn = document.createElement('button');
|
|
1562
|
+
btn.className = 'copy-btn'; btn.textContent = 'Copy';
|
|
1563
|
+
btn.addEventListener('click', () => {
|
|
1564
|
+
const code = pre.querySelector('code');
|
|
1565
|
+
navigator.clipboard.writeText(code ? code.innerText : pre.innerText).then(() => {
|
|
1566
|
+
btn.textContent = 'Copied!'; btn.classList.add('copied');
|
|
1567
|
+
setTimeout(() => { btn.textContent = 'Copy'; btn.classList.remove('copied'); }, 2000);
|
|
1568
|
+
});
|
|
1569
|
+
});
|
|
1570
|
+
pre.style.position = 'relative';
|
|
1571
|
+
pre.appendChild(btn);
|
|
1572
|
+
});
|
|
1573
|
+
|
|
1574
|
+
// ── Sidebar active ──────────────────────────────────────────────────
|
|
1575
|
+
const cur = window.location.pathname.split('/').pop();
|
|
1576
|
+
document.querySelectorAll('.sidebar-link').forEach(l => {
|
|
1577
|
+
if (l.getAttribute('href') === cur || l.getAttribute('href').endsWith(cur)) l.classList.add('active');
|
|
1578
|
+
});
|
|
1579
|
+
|
|
1580
|
+
// ── highlight.js ────────────────────────────────────────────────────
|
|
1581
|
+
if (window.hljs) {
|
|
1582
|
+
hljs.configure({ ignoreUnescapedHTML: true });
|
|
1583
|
+
hljs.highlightAll();
|
|
1584
|
+
}
|
|
1585
|
+
});
|
|
1586
|
+
</script>
|
|
1587
|
+
</body>
|
|
1588
|
+
</html>
|