wiizworks

A 3D take on React Flow with node dragging, 3D model imports, dynamic curved edges, and seamless 2D-to-3D canvas conversion. Built with React Three Fiber for an immersive workflow experience.

Overview

What I did

The challenge was to extend the existing 2D node-based workflow of React Flow into a fully interactive 3D environment. While the 2D canvas provided a structured way to visualize and manipulate nodes, it lacked depth and spatial interaction, limiting its potential for more immersive applications. The goal was to develop a 3D version that retained the intuitive drag-and-drop functionality while enabling seamless node movement, dynamic curved connections, and the ability to import 3D models. Additionally, the solution needed to support a smooth transition from the existing 2D canvas to a 3D workspace, enhancing visualization and user interaction without compromising performance or usability.

Features

The entire workspace is built in 3D, allowing for immersive node interactions, spatial visualization, and dynamic depth adjustments.

Smooth node movement with dynamic curved edges

Importing 3D nodes and being able to move them around

Challenges 

overcoming problems

Seamless Integration of 2D and 3D Canvases
The client required an architecture where the 3D canvas would be rendered using the same data structure as React Flow. The real challenge was to ensure seamless integration while developing a library that functioned identically to the React Flow library in a 3D environment.

Establishing a Unified Data Contract
A crucial aspect of the project was defining a data contract that both the 2D and 3D canvases could rely on. This agreement was essential to maintain consistency and interoperability between the two visualization formats.

Adapting Algorithms for a 3D Environment
Many existing algorithms had to be rewritten to accommodate the complexities of a 3D space. This included adapting node movement mechanics, implementing dynamic edges with an additional control point in the Y direction, and optimizing the rendering logic for nodes within the 3D canvas.

React Three Flow Data Types

Results

solution

Maintaining Consistency with React Flow Data Types
To ensure seamless integration, I used the same data types as provided by React Flow for nodes and edges. Even the callback functions for handling canvas changes followed the same data structure as React Flow. This approach minimized code changes, making it almost effortless to incorporate the 3D canvas alongside the existing 2D setup.

Independent Library for Easy Integration
The 3D functionality was packaged as a separate library, allowing for easy integration into different projects. Every algorithm was built from scratch to mirror the functionality of the 2D canvas while adapting to the 3D environment

Identical Interface, Different Implementation
Essentially, the library offers the same interface as React Flow, ensuring a familiar experience for developers. However, under the hood, it features a completely different implementation tailored for 3D rendering and interactions.

Learnings

what i learnt

Through this project, I learned the importance of maintaining data consistency when integrating 2D and 3D environments, ensuring minimal code changes while extending functionality. Designing a seamless transition from React Flow’s structured 2D workflow to an interactive 3D space required careful planning, especially in adapting algorithms for node movement, dynamic edges, and 3D model imports. The custom algorithms I wrote were significantly more complex than their 2D counterparts, requiring a deep understanding of mathematics to handle spatial transformations, dynamic edge calculations, and real-time interactions. Building a separate library with an identical interface but a completely different internal implementation reinforced my understanding of modular design and reusability. Additionally, optimizing for performance and usability in a 3D workspace while preserving the intuitive drag-and-drop experience highlighted the challenges of balancing complexity with user experience.

Work With me.

Let’s bring your ideas to life with interactive 3D experiences, immersive web designs, and high-performance applications. Whether it’s React, Three.js, or custom animations, I’ve got you covered—let’s build something amazing together!