iCraft Editor and Player
repository·main·Indexed 23 days ago
https://github.com/gantfdt/icraftA 3D architectural design tool for creating immersive diagrams of complex software and physical systems. iCraft Editor features 2D-to-3D transformation, nestable sub-scenes, and precision tools for designing system architectures. iCraft Player allows for the integration of these 3D scenes into applications with API-driven state control, real-time data synchronization for digital twins, and support for GLB/GLTF model imports.
What's inside iCraft
- iCraft Editor is a tool designed for creating 3D architecture diagrams. It moves beyond traditional 2D flat planes to provide three-dimensional visual effects, helping users capture attention and improve communication efficiency when designing complex systems. It is suitable for software architecture design, system deployment visualization, training, and expressing structural relationships (like BOM structures).
Features of @icraft/player-react
mainThe
@icraft/player-reactlibrary provides several capabilities for building digital twin applications:- Out-of-the-box integration: Zero-configuration setup for quick access.
- Customizable plugin sets: Support for integrating optional features via a flexible plugin mechanism.
- Events and Methods: A rich set of APIs to facilitate integration with your existing project logic.
- Animation Control: Support for playback controls such as auto-play and looping.
- Real-time Data Integration: Capability to connect real-time data streams to 3D scenes for digital twin visualization.
Key features of @icraft/player-react
mainThe
@icraft/player-reactlibrary provides several capabilities for building 3D digital twin applications:- Zero configuration integration: Quick setup with minimal code.
- Custom Plugin Sets: Extend functionality through a flexible plugin mechanism.
- Events and Methods: Rich API for interacting with the 3D scene from your React code.
- Animation Control: Support for autoplay, loop playback, and other controls.
- Real-time Data Integration: Capability to map real-time data (e.g., server metrics, e-commerce transactions, or industrial production data) into the 3D environment.
Licensing for iCraft Player
mainThe licensing model for iCraft Player is as follows:
- Personal Use: Free
- Commercial Use: Enterprise license at $299 USD/year (includes remote technical support).
For commercial licensing, contact yukg@gantsoftware.com.
Customize and control floating tips (悬浮提示)
mainYou can control the content, visibility, and appearance of floating tips by accessing the
tipproperty on an element instance. This allows you to replace default tooltips with custom HTML elements, such as user profile cards or complex UI components.To use a custom tip, you typically:
- Locate the target element using
getElementsByNameor similar methods. - Create a new DOM element containing your custom content and styles.
- Use the
tipinstance methods to inject the element and make it visible.
- Locate the target element using
Advantages of using Nested Subscenes in iCraft Editor
mainNested subscenes provide several architectural visualization benefits:
- Layered Display: Enables a "drill-down" approach, moving from high-level overviews to granular component details (e.g., Cloud $\rightarrow$ VM $\rightarrow$ Service).
- Modular Clarity: Represents modular designs intuitively by showing the internal composition and dependencies of specific modules.
- Information Hiding: Reduces visual clutter by hiding complex internal details behind top-level structures, showing them only on demand.
- Scalability: Makes large-scale system visualization feasible by managing different modules in separate subscenes.
- Interactive Exploration: Supports dynamic navigation through different levels of the architecture via clicks and zooming.
What are Addons in iCraft Player?
mainAddons are extension components for the iCraft Player that provide additional functionality. They allow you to add features like camera controls, zoom controls, sub-scene navigation, and player controls to your player instance. Users can enable them using predefined keys for quick setup or manually import and style them for custom layouts.Customize hover tips (悬浮提示)
mainYou can customize the content, style, and visibility of hover tips by accessing the
tipproperty on an element instance. There are two primary ways to implement custom tips:- Native Elements: Create standard DOM elements (e.g., using
document.createElement) and pass them to the tip instance. - React Elements: Use
react-dom'screatePortalto render React components into a DOM node managed by the tip instance. This is the recommended approach for complex UI components.
To access the tip instance, first find the target element using
player.getElementsByName(name)and then access its.tipproperty.- Native Elements: Create standard DOM elements (e.g., using
Key Features of iCraft Editor
mainiCraft Editor provides several core capabilities for 3D architectural design:
Design Capabilities
- 3D Model Elements: Access to a rich library of exquisite 3D models and geometric shapes.
- Templates: Example templates to accelerate the design process.
- View Switching: One-click toggle between 2D and 3D views.
- Precision Tools: Automatic grid snapping for connections, and automatic stacking/magnetic attraction for drawing elements.
- Nestable Sub-scenes: Modular management of complex designs by nesting multiple sub-scenes within a main scene. Each sub-scene can be edited and adjusted independently.
Presentation Capabilities
- Immersive Views: 3D panoramic presentation with freely transformable multi-angle views (rotate, zoom, examine).
- Animation: Supports animation playback to convey design concepts.
- Layered Concepts: Seamless switching between sub-scene states to express complex designs in layers.
Digital Twin & Integration
- Web Rendering: Embeddable Web rendering components.
- API Control: Control 3D element states through APIs.
- Real-time Synchronization: Visualizes synchronization between Web system information and 3D architecture diagrams (e.g., displaying server or network device status).
- External Model Integration: Supports importing common 3D file formats such as
GLBandGLTF.
Advantages of using 3D system architecture diagrams
main3D architecture diagrams provide several benefits over traditional 2D diagrams for complex systems like microservices or distributed cloud infrastructure:
- Clearer Hierarchical Relationships: Uses 3D space to show nesting and dependencies (e.g., layers or modules) without the visual clutter of 2D layouts.
- Intuitive Interaction: Supports rotation, scaling, and dragging, allowing users to focus on specific parts of the system from multiple angles.
- Rich Information Visualization: Uses color, size, shape, and transparency to represent system states, performance, or load.
- Complexity Management: Effectively handles large-scale distributed systems and multi-layer network architectures that are difficult to represent in 2D.
- Improved Team Collaboration: Provides a common visual language for developers, architects, and product managers.
- Dynamic Simulation: Can be combined with dynamic simulations to demonstrate workflows, request flows, or real-time performance data.
How tooltips (Tips) work in iCraft Player
mainA
Tipis a tooltip associated with an element instance in the iCraft Player. You can access the tooltip instance via the.tipproperty on an element instance. By calling methods on this instance, you can dynamically update the tooltip's content, visibility, height, and style. There are two primary patterns for using tooltips: using native DOM elements or using React elements via Portals.const user = player?.getElementsByName("User")?.[0]; user?.tip?.updateInnerHTML(someElement); user?.tip?.updateVisible(true);How font resources work in iCraft Editor
mainBecause iCraft Editor's drawing engine is based on WebGL, font resources are not handled by the browser's standard CSS engine in the same way and must be loaded explicitly.
If you do not actively set font resources using
defineConfig, the editor will attempt to use default fonts from the iCraft Editor server and Google. For intranet or offline environments, you should download the required.ttffiles and host them locally within your project, then point to them usingfontUrlorfonts.