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

06 Sep, 2023 07:20 AM
05 Sep, 2023 08:40 PM
30 Aug, 2023 03:16 AM
19 Aug, 2023 03:22 AM
29 Jul, 2023 05:52 AM

 

28 Jul, 2023 10:53 PM
23 Jul, 2023 07:04 AM
14 Jul, 2023 03:05 AM
07 Jul, 2023 06:26 AM
05 Jul, 2023 11:44 PM
30 Jun, 2023 12:48 PM