Drilldown remix

I remixed the Jens's drilldown block

drilldown example - Jens v1.3 script pic

new version:
drilldown example - Jens v1.3 script pic (3)

See full examples in the project !

I love it!

Except for the huge IF/ELSE chain relating to the OP input. I wish you could just say

I personally would just use a ring instead of magic strings for block names.

Can you have rings as menu item values? I vaguely thought that wasn't allowed. Otherwise, sure, I would have done it that way.

Yeah, but less intuitive...

Maybe in v2?

Maybe something like this:
drilldown example - Jens v1.3 script pic (1)

Sure, but that's a little less convenient to use because you have to switch from the Other category to the Operators category.

I think the 1st block offers is a much better UI for the user - the fact that the code in the block is a bit industrial doesn't matter as much :slight_smile:

Oh, yeah, I did say I loved it!

But I'm interested in what Snap! users have to do in order to implement some feature, and if it's ugly I want to fix it. The idea with rings is that you'd put, e.g., "< = untitled script pic (7)" in the menu, not just untitled script pic (7).

Which reminds me, sometimes I want what appears in the slot to be the left hand side of the equation, i.e., what the user actually entered, so your block would say POINT IN DIRECTION (RIGHT) rather than POINT IN DIRECTION (90). I know the restriction of characters in a numeric slot to digits prevents that, but in every other case Snap! is permissive about what you can put in a typed slot.

How about this for a compromise


I've only implemented contains and > to show the principle of having a text menu being converted to true operators

Don't do my homework ! hahaha

Sorry :slight_smile:
.....

Better than nothing, but it doesn't seem right that a Snap! programmer should have to teach Snap! that "<" means untitled script pic (7). It already knows.

why not just other data types in menus?

A simpler one (ignoring contains option)


image

Jens thought about it, but there were enough ambiguities and implementation difficulties that he decided to get the core feature out sooner instead of later. Maybe someday.

oh.

isnt that already in the [ V] of [ V] block?

wouldnt it be better now since we can just put it in a report (list [] [] [] @delInput@addInput) ?

Except you can't drag the block out, and I feel like we would want to be able to drag it out.

why

v1.31
optimization:
- Removing zillion of "if" by calling an operator with 2 inputs
- Saving the list of operators in a block variable, so when you export
the block ou script pic the block, the content of the opList is
transfered and immediately available for the hat block
when slot op signals menu
New features:
- Now, you can drop a real ringnified operator in tho operator input.
The operator should return a boolean value. 1 or 2 parameters
function are accepted. The 1st parameter of your function will be
the "column value" and the 2nd parameter (optional) of your
function will be the "delail value" . See the example with "is even"

drilldown example - Jens v1.3 script pic (3)
Don't forgot to rignify the operator (see example inside the block or in the project)