The Houdini Way
In Houdini, geometry isn’t a fixed data structure. Instead, it’s a collection of points with attributes. Want to add color? Add aCd attribute. Want to store velocity? Add a v attribute. Want custom data? Add any attribute you want.
This approach has profound benefits:
- No schema changes: Adding new data doesn’t require restructuring
- Pipeline flexibility: Any node can read any attribute
- Clean data flow: Data flows through attributes, not side channels
Attributes in CodeGraph
CodeGraph applies this philosophy to code visualization:Everything is a Node with Attributes
A class in CodeGraph isn’t a rigidClass object with fixed properties. It’s a node with attributes:
- Core data:
name,type,filePath - Layout data:
layout:x,layout:y,layout:z - Git overlay:
git:churn,git:authors - Coverage overlay:
coverage:percent - Complexity overlay:
complexity:cyclomatic
Prefixed Attributes
We use prefixes to organize attributes by source:| Prefix | Source | Purpose |
|---|---|---|
| (none) | Core analysis | Essential node data |
layout: | Layout engine | 3D positions |
git: | Git plugin | Version control data |
coverage: | Coverage plugin | Test coverage data |
complexity: | Complexity plugin | Code metrics |
- Clean separation: Each system owns its namespace
- Easy cleanup: Remove all
git:*attributes in one operation - No conflicts: Two plugins can’t overwrite each other’s data
Why This Matters
1. Extensibility Without Schema Changes
Traditional approach:2. Plugin Independence
Each plugin writes its own attributes without knowing about others:3. Clean Removal
Removing a plugin’s data is trivial:4. Frontend Flexibility
The frontend doesn’t need to know about every possible attribute. It can:- Display any attribute in the inspector
- Map any numeric attribute to color/size
- Filter nodes by any attribute
Open Source Philosophy
CodeGraph is open source under the GPL-3.0 license. This isn’t just a licensing choice—it’s a statement about how we believe software should be built.Why GPL?
Copyleft Protection
If someone improves CodeGraph, those improvements must stay open. The community benefits from every contribution.
Commercial Use Allowed
Companies can use CodeGraph freely. They only need to share changes if they distribute a modified version.
Summary
CodeGraph’s philosophy:- Everything is an attribute: Nodes have dynamic attributes, not fixed schemas
- Prefixed namespaces: Each system owns its attribute prefix
- Minimal coupling: Plugins don’t know about each other
- Open source (GPL-3.0): Community contributions benefit everyone