Bands that start with "The"

kbjornard's Avatar

kbjornard

19 May, 2018 07:12 PM

I've been playing around with Nodebox for about a month. A student turned me onto it, and I'm in love. This has been the most fun software to learn of anything I've ever tried, and certainly the most user friendly generative/data viz tool I've used. I love that even though I cannot program, that since I do at least understand the abstract way functions and variables must fit together I can still put together some pretty rad and complex things amazingly quickly.

As a visual designer interested in systems, I thought I'd try recreating a poster I made a long time ago, a visualization of bands starting with "the" in my itunes library...

The issues I ran into were related to data — I didn't have a good data source, just all the names pulled into a text file. I was able to figure out how to remove duplicates within nodebox, but couldn't figure out how to sort/group alphabetically other than manually making a bunch of "ranges"

I also realize that I use the same text node and group node on every single letter, so that's something that could be "subnetworked" or something?

Anyway, I'm really interested in using Nodebox to open new territory for my designs, as well utilize it as a way to get more into programming directly, if anyone has any suggestions for how I can utilize this more effectively/efficiently I'd be pleased to converse.

I'm a graphic design faculty in Baltimore, MD at the Maryland institute college of art, so I'm also trying to think about how Nodebox can become an integral tool in some of my classroom related things...

If anyone wants to play with my nodebox file its attached w/ the .txt data in the zip, the font I am using is League Gothic: https://www.theleagueofmoveabletype.com/league-gothic

  1. Support Staff 1 Posted by john on 19 May, 2018 11:29 PM

    john's Avatar

    Hi kbjornard!

    Welcome to the NodeBox community. Like you, I fell in love with NodeBox a few years ago and since then my initial impression has only deepened. I use NodeBox constantly, both at work (for data visualization) and for my own art projects.

    Your instinct is correct: whenever you find yourself repeating the same set of nodes 27 times there is usually a simpler way of doing things. And, indeed, the secret is subnetworks.

    A subnetwork is just a way of making your own function. In this case you need a function that reads in the whole list of band names a spits out one group at a time: the group that starts with A, the group that starts with B, etc.

    I have attached a NodeBox network that perfectly recreates your poster using just such a subnetwork. I called it "alpha_groups". It takes the band list as an input along with three other parameters: Starting Letter, Font Name, and Font Size. If you set Starting Letter to A it will return a group of text paths for all bands starting with A.

    I pass this function a list of 26 letters from A to Z (using a make_strings node) and it spits out 26 groups ready to place and color.

    To see how it works, control click on alpha_groups and choose "Edit Children". It takes the list (passed through a Null node) and sends it to a starts_with node to produce a list of booleans (true or false) showing whether each band does or does not start with the supplied letter. We pass that to a cull node to remove all the bands that do not start with that letter. The bands that remain are turned into text paths and grouped together.

    One subtle trick when making subnetworks like this: It matters a lot whether each input is taken in one at a time (value) or all at once (list). In order to work correctly, this subnetwork has to take in the band list all at once. So when I made the subnetwork I had to select it, click Metadata (above the ports pane), and for the first input "list" change its range from value to list. This detail is the single most confusing but all-important part of using subnetworks.

    To finish I had to create one more subnetwork to handle band names that begin with something other than a letter. For this I made the "other_group" subnetwork. Just feed it the list and it spits back a group of text paths for all the non-alpha bands. I'll let you open that one up yourself to see how I did it.

    The rest of the nodes to color and place the text groups are from your original network. I just tidied them up a bit.

    Please play with this new simpler network and let me know if it answers your questions. You may also want to search this forum for other bits of example code. If you have a question there's a good chance it has already been asked and answered somewhere in the forum.

    If you do incorporate NodeBox into your courses we'd all love to see samples of your work and the work of your students. And don't be afraid to ask for help when you get stuck.

    Happy NodeBoxing!

    John

  2. 2 Posted by kbjornard on 20 May, 2018 01:35 AM

    kbjornard's Avatar

    John, Aha! wow! Thank you!

    Okay, I had not figured out that playing in the metadata options allowed for things to happen a certain/different way, thanks for sharing that.

    Going through your updates makes a lot of sense. Thanks for taking the time to do that.

    Can't wait to keep experimenting, and searching the forums for things!

Reply to this discussion

Internal reply

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

Attaching KB article:

»

Already uploaded files

  • BandNamesThatStartWithThe.png 677 KB
  • Screenshot_2018-05-19_15.08.28.png 285 KB
  • Screenshot_2018-05-19_15.08.54.png 139 KB
  • Screenshot_2018-05-19_15.09.04.png 445 KB
  • Screenshot_2018-05-19_15.09.10.png 510 KB
  • Screenshot_2018-05-19_15.09.15.png 320 KB
  • Screenshot_2018-05-19_15.09.30.png 342 KB
  • BandsThatStartWithThe.zip 6.22 KB
  • BandsThatStartWithThe.zip 6.22 KB

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 Jun, 2022 05:30 AM
15 Jun, 2022 06:03 AM
06 Jun, 2022 01:07 PM
02 Jun, 2022 11:58 PM
30 May, 2022 07:48 AM

 

24 May, 2022 06:27 PM
20 May, 2022 04:12 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