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

16 Mar, 2025 04:21 AM
14 Mar, 2025 08:32 AM
10 Mar, 2025 06:36 PM
10 Mar, 2025 06:36 PM
10 Mar, 2025 06:36 PM

 

10 Mar, 2025 12:30 AM
02 Mar, 2025 12:34 AM
01 Mar, 2025 12:27 AM
24 Feb, 2025 11:24 PM
24 Feb, 2025 08:19 AM
24 Feb, 2025 01:07 AM