connecting through the link node

mark's Avatar

mark

05 Feb, 2014 03:03 PM

Hi,

I'm trying to connect two different keys by using the link node. The data of both keys consists out of (the same) years. Through the distinct count node (see bottom part of attachment), created by Frederik earlier, I'm able to count the amount of appearances of each year.

So far I've managed to create a line for both of the keys, both divided into the (distinct) amount of points of each key. I've placed rectangles on top of them. The hard part is to connect these rectangles by using this data. I understand I have to layer rectangles on top of each other in the amount of the specific value, and that assigned tot the right points on both lines.

How am I able to transform the data into the right amount of rectangles and distribute them onto the right position? And as a result, will I then be able to connect them through the link node.

Thank you!
Mark

  1. Support Staff 1 Posted by Frederik De Ble... on 10 Feb, 2014 11:31 AM

    Frederik De Bleser's Avatar

    Hi,

    The big trick is to use the zip map to create a mapping between an element and its position.

    Here's an example where I map the favorite foods of a number of people. Since some people like the same food, we have to do a lookup.

    • Create a list of unique (distinct) food items, using the distinct node.
    • For each unique food item, generate a point where that item will end up, using the grid node.
    • Use the zipmap node to link the two: the list of unique food items, and a list of positions.
    • Then, use a lookup node to take the original list of food items, and generate positions based on that. The result will be a list of positions in the same order as the original list of food items.
    • Then, use those positions to do whatever you want. I generate rectangles that I use as templates for the link node.

    I've attached the example so you can play around with it.

    Hope this helps,

    F

  2. Frederik De Bleser closed this discussion on 30 Jun, 2014 11:41 AM.

Comments are currently closed for this discussion. You can start a new one.

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

18 Nov, 2024 11:24 PM
18 Nov, 2024 09:01 PM
07 Nov, 2024 10:53 AM
02 Nov, 2024 11:22 AM
01 Nov, 2024 12:41 AM

 

01 Oct, 2024 07:59 AM
30 Sep, 2024 11:37 PM
30 Sep, 2024 11:11 AM
30 Sep, 2024 02:37 AM
28 Sep, 2024 10:33 AM
26 Sep, 2024 06:41 AM