A few debug passes, and it renders schematic table...
# devlog-together
a
A few debug passes, and it renders schematic tables!
j
Impressive! What does the code for that look like? I'm curious how you handle tabular stuff...
a
It’s that layout algorithm where you ask all of your subviews, “How big would you want to be if you had [this much space]?” then tell them, “Okay, I’m giving you [this much space], lay out your subviews.” I don’t know the name for it! But it meant the table was easy: it just takes max() of all the heights and widths for the cells in every row and column. I draw the wires in a second pass using the world coordinates of the THREE.Object3Ds post-layout.
j
Oh I guess I was curious mainly about the client code, like you showed for the previous screenshot. Cuz there's no longer a simple tree hierarchy. Those details are cool tho. 👍
j
Deja Vu 😀 I take it this in three.js? How do you render text and edit it?
a
@Joshua Horowitz: I ended up making a SchematicTable class because I didn't want to worry about making it useful for tables in general. So it just takes a list of headers, a list of rows with views and their spans, etc. Nothing smart here yet. 🙂
@jonathoda: Yeah, Three.js! I'm using CSS2DRenderer and CSS2DObject for text. All my prototypes are view-only, so I haven't had to worry about editing yet. 😬