cdglabs/apparatus

Dependencies between spreads don't work

dialmove opened this issue · 7 comments

My first test with apparatus, and I've already broken it. :-)

There's a bug whenever you use a variable for any parameter of a spread, and the variable itself depends on the value of another spread, even for very small sizes. The user interface makes it extremely easy to do this, and it makes sense for any drawing that would have been programmed with nested loops in a traditional language.

I've attached my example. It's a grid looping over X and Y variables, where the Y max value is not constant but made dependent on the current value of X.

The first file (1-recursivity global var.json) contains a functional grid, having the "Y" max equal to the global "pileup" variable. If you then drag the spread variable X to be value of pileup, the interface freezes and most options become unresponsive.

The second file (2-recursivity pileup.json) is what happens after assigning X as the value of pileup.

The funniest thing is that the group thumbnail works as expected! :-) When you drag X over pileup, the thumbnail draws the staircase shape. Therefore recursion is working well there. Can we get the whole interface work like the thumbnail? ;-)

Other than that, Apparatus is an amazing tool. Keep up the excelent work!

Sorry, github won't let me attach the JSON files. Pasting here its content:

1-recursivity global var.json: https://gist.github.com/dialmove/5ab59e4e62f5ef471bb5

edit: moving the content of the file to the above link

2-recursivity pileup.json https://gist.github.com/dialmove/b35519b2f3038c93b9e3

edit: moving the content of the file to the above link

Next time you can upload a Gist and link to it 😄

Hey, I'm attracted to this project because I don't like the details of all that boring development stuff ;-)

Good idea, I've edited the comments to link to some newly created gists with the content of the files.

Thanks for catching this @dialmove!

The main architecture for dealing with dependencies was good.

The bug was in the code that rendered the evaluated spread in the right hand column. It didn't like nested spreads. I pushed a commit to fix this.

image

I'm glad I could help. ^_^
I promise to keep pushing Apparatus to its limits to catch more stuff like this. ;-)