Closed kylemas closed 4 years ago
You'll need to keep track of the current row separately from the state of the tree.
Hmm, okay. I thought of doing them outside of the state of the tree, though was having a bit of difficulty on thinking about the specifics. I'll have a bit more time to work on it this week, so I will try this out.
Also, thanks for pointing out the error with the rows. I actually didn't notice that since I just assumed that it would be on the same row. I will add a fix to this then start working on it getting to appear like how it should be.
@McTano
I've fixed up how the rows increment now. I kept track of the 'maxRow' outside of the state of the tree and is incremented when splitBranch or continueBranch is called.
To answer the question you asked, I'm not sure what the best way is to get the row label to show up at the right height. It might be kind of tricky. To show it once per row, we need to add rows outside of the tree instead of the node div, and then figure out how far apart they need to be vertically spaced.
For now, don't worry about how the labels get displayed. First, let's get the nodes labelled with the correct row. Right now they're not getting labelled correctly.
The point of having a row # on each node is that it is independent of the node's position in the tree. Otherwise we wouldn't actually need it.
Consider this truth tree.
There are four nodes in row 3, but the two on the left were added before the two on the right. Therefore the left side should be in row 3, but the right side should be in row 4. (Note rows 6 and 7)
The forall-x text doesn't seem to include any examples which actually illustrate this point. Here's another example I found online.