Lookup and Filter Data with native nodes

Guilherme Vieira's Avatar

Guilherme Vieira

18 Apr, 2022 10:37 AM

Hi,

Sometimes I see some projects using the lookup and filter data nodes on the output of some other native Nodebox nodes such as using the lookup on the output of a point node to get the x of the point. Is there any way for me to know which items can be filtered or parsed in the output of a node?

Thanks

  1. Support Staff 1 Posted by john on 18 Apr, 2022 07:31 PM

    john's Avatar

    Guilherme,

    Yes, there is!

    Use the Keys node. Hook the output of any native Nodebox node to the Keys node. It will produce a list of all they keys that you can look up. Some keys will be internal Nodebox things (e.g. class) that you can't use, but the rest will be fine.

    A special key is "bounds". If you look up the bounds of a rect you will get a 4-tuple, something like "Rect(-50.0, -50.0, 100, 100). The first two values are the x and y of the shape's top left corner; the other two values are its width and height. You can retrieve any of these four values in a single bound by using dot notation:

    bounds.x = top left x
    bounds.y - top left y
    bounds.width = width
    bounds.height = height

    The Keys node is one of my secret weapons. I use it all the time to find these hidden gems.

    Enjoy!

    John

  2. 2 Posted by Guilherme Vieir... on 18 Apr, 2022 09:01 PM

    Guilherme Vieira's Avatar

    Thanks John!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

24 May, 2022 11:36 AM
20 May, 2022 04:12 PM
14 May, 2022 12:26 PM
05 May, 2022 02:25 AM
03 May, 2022 04:46 AM

 

01 May, 2022 09:22 AM
18 Apr, 2022 09:01 PM
18 Apr, 2022 02:02 AM
16 Apr, 2022 06:01 PM
14 Apr, 2022 07:38 PM
22 Mar, 2022 08:44 AM