Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Checking out examples of maps, hierarchies, and networks

From: Interactive Data Visualization with Processing

Video: Checking out examples of maps, hierarchies, and networks

In the last several movies, we've introduced you to a number of ways to create graphics in Processing, both based on the formulas in your sketches and also based on references to external data. We've also shown you how to create the basic elements of interaction, by, for instance, being able to click on shapes and drag them, being able to roll over, have them change, respond, provide extra information, being able to slice through, being able to rotate, to zoom, to slide. These really are the basic forms of interaction for the great majority of data visualizations, and I think you'll find that as you take those elements, you'll be able to build almost everything that you want to do.

Checking out examples of maps, hierarchies, and networks

In the last several movies, we've introduced you to a number of ways to create graphics in Processing, both based on the formulas in your sketches and also based on references to external data. We've also shown you how to create the basic elements of interaction, by, for instance, being able to click on shapes and drag them, being able to roll over, have them change, respond, provide extra information, being able to slice through, being able to rotate, to zoom, to slide. These really are the basic forms of interaction for the great majority of data visualizations, and I think you'll find that as you take those elements, you'll be able to build almost everything that you want to do.

However, I did want to show you a few kinds of more elaborate data visualizations and user responsiveness that because they are rather lengthy, very time consuming, I wanted to show you the code from the built-in examples in Processing, really, so that you're aware that they exist, and you can take a look at them and see if they provide any kind of inspiration or direction for your own work. The three examples that I'm going to show you all come from one book by Ben Fry, one of the co-creators of Processing.

They are from his book Visualizing Data. It's an excellent resource, and I strongly encourage you to take a look at. It's relatively advanced, but it is very careful and steps through all the way. I want to show you three of the examples that come in the Processing example folder. So, for instance, if you have Processing open, you simply go to File, to Examples, and then this window here pops up, Standard Examples, and you go to Books, down to Visualizing Data.

And the two that I want to show you are first from the one that says ch03-usmap where he shows every step of a build of a map that has some data that's responsive on it. I wanted to show you number 16, step 16, very quickly. And what you have here--I'll pull that out--is that he's been taking step by step of getting a map of the United States and then superimposing what are actually random data points in the middle of each state, along with a rollover.

This is great work. This is where the Table class that we've been using comes from. And I want you to see some of the things that he is able to do to serve as an inspiration in your own work. I'm just going to hit Run here. And what we get is a map of the United States, with a dot in each central location. And there are two things that happen. Number one, if I press the space key, those dots change to other random values, where the colors indicate positive and negative and the size indicates the magnitude of the number. And they're totally random. These look like voting results, but they're just random numbers.

And what happens is first off, he has this nice little compression thing that refers to as the integrator, that makes it possible for these to change slowly from one to the other. The other one is if you hover over one of these, it actually gives you the name of the state and the current random number. Also, he's got a wonderful bit of code that makes it so that even when things are closed into each other, you don't accidentally queue the other state's information. Anyhow, this is a way of working with latitude and longitude, as well as data values, and providing levels of interactivity.

I suggest you look at it. Again it's in the Standard Examples of Processing, under Books/ Visualizing Data/ch03-usmap. This one is step16_lethargic. The next one I want you to take a look at, if we close that, is from hierarchies, and what this is is a way of looking at how things are apportioned and groups that are contained within groups, contained within groups. In this particular example, what we're going to be looking at is the filetreemap, and that's the one that I have open right here.

A treemap is a space-filling diagram that shows hierarchical relationships. Now, in order for this one to run, you're going to have to go and download a folder from his own website. You're going to need to download the treemap library and the place you go for that--I'll just show it you in a web browser--is to his own web page, benfry.com/writing/treemap, and that brings up this page that says Treemap Library.

What you need to do is go to the second paragraph and click on where it says library zip. That will download a folder for you and put it in your Downloads, and it shows up first at library, but if you double-click on that, it says treemap. And then what you need to do is need to go to your Sketchbook folder in Processing and find your library folder. Mine is right here. I have it under Documents/ Processing. And then you just drag it in. Then you need to quit and reopen Processing, and then the treemap library will be functional in there.

And what you find, when you open that one, is you get this program that's going to look at the size of files on your computer disk in the folder that you designate. Now, it also runs at a rather high resolution natively, 1024 x 768. So, for right now I've just bumped it down to 800 x 600 so it all fits on the screen. And here's how it works. You click Run, choose a folder. I'm going to go--so I'm going to go to the desktop here and just choose my Exercise Files folder that I have created for this course, and I'll press Open.

What you see is that it looks at each of the folders and it draws a space for each of them proportioned to the amount of size that that folder requires. What you see from this one is I've got a lot of little tiny ones. There is Chapter 3 (Ch03), Chapter 4 (Ch04), Chapter 5 (Ch05), 6, 7. 8 is big, 9 is miniscule, 10 is tiny, and it's Chapter 14 (Ch14) that's huge. And the reason for that is that's the one where we actually saved Mac, Windows, and Linux applications, as well as JavaScripts of things. I'm going to click on that one, and you see it highlights and it shows me what else is in here.

There we have 14_02, 14_03. And I'm just going to double-click on this one. And this breaks it up into its constituent pieces, and you can see how big each of the files is relative to each other. So, this is--again, it's called a treemap. It's an interesting way of looking at relative sizes and how things are nested within each other. It is, however, very complicated coding. You'll notice that we have 1, 2, 3, 4, 5 separate tabs in this one, as well as an external library.

That's why instead of me demonstrating how to create it, I simply want you to be aware that it exists, and I'd encourage you to look at Ben Fry's book and add the sample code that he has provided in Processing to figure that one out. The last one I want to show you very quickly is under graphlayout. A graph means also a network diagram. And I'm going to show you this one that, right now it bounces around a fair amount. It's little weird. But what it's doing is it's taking the text from Huckleberry Finn and it's showing the relationship between the words. Again, this is another wonderful piece by Ben Fry.

It's from his book, and it's included in the Standard Examples in Processing. And all I want to do is run it and show you how it connects things. Now, we think there maybe some little funky right here, that's I'm just clicking and dragging each of these pieces around, but it shows the relationships between words. Anyhow, this is a network diagram. It can be used with social networks. It can be used with telephone calls. It can be used with anything that connects with other things: scientific publications that connect through referencing to other ones, people who register in same courses together.

Anyhow, this is an elaborate version, and really an advanced topic, but something that I want you to be aware that it exists and that you can explore, especially in consultation with Ben Fry's excellent book, Visualizing Data.

Show transcript

This video is part of

Image for Interactive Data Visualization with Processing
Interactive Data Visualization with Processing

72 video lessons · 12524 viewers

Barton Poulson
Author

 
Expand all | Collapse all
  1. 3m 16s
    1. Welcome
      58s
    2. What you should know
      1m 22s
    3. Using the exercise files
      56s
  2. 11m 51s
    1. Overview of data visualization
      11m 51s
  3. 11m 53s
    1. Installing Processing
      3m 38s
    2. Overview of Processing
      4m 5s
    3. Exploring libraries
      4m 10s
  4. 1h 1m
    1. Basic setup
      7m 31s
    2. Drawing points
      4m 37s
    3. Drawing lines
      5m 6s
    4. Drawing ellipses and circles
      5m 24s
    5. Drawing arcs
      6m 54s
    6. Drawing rectangles and squares
      4m 58s
    7. Drawing quadrangles
      3m 25s
    8. Drawing triangles
      2m 55s
    9. Drawing polygons
      3m 37s
    10. Drawing simple curves
      4m 54s
    11. Drawing complex curves
      6m 46s
    12. Drawing Bézier curves
      5m 38s
  5. 54m 3s
    1. Introduction to variables
      10m 44s
    2. Understanding variable scope
      6m 53s
    3. Modifying variables
      9m 8s
    4. Creating arrays
      9m 53s
    5. Modifying arrays
      6m 37s
    6. Creating strings
      7m 3s
    7. Modifying strings
      3m 45s
  6. 1h 2m
    1. Incorporating randomness
      7m 59s
    2. Using Perlin noise
      4m 24s
    3. Shuffling with Java
      3m 30s
    4. Specifying line attributes
      8m 2s
    5. Changing placement modes
      5m 45s
    6. Understanding color attributes and functions
      4m 16s
    7. Exploring color spaces
      7m 44s
    8. Using color palettes
      7m 5s
    9. Transforming the grid
      8m 38s
    10. Exploring the attribute matrix
      5m 33s
  7. 52m 7s
    1. Building code blocks
      5m 57s
    2. Writing a while loop
      3m 52s
    3. Using for loops
      5m 35s
    4. Creating conditionals
      14m 50s
    5. Working with easing
      10m 51s
    6. Creating spirals
      11m 2s
  8. 18m 55s
    1. Mouse tracking
      3m 54s
    2. Hovering and clicking
      11m 16s
    3. Understanding keyboard interaction
      3m 45s
  9. 27m 32s
    1. Specifying fonts
      6m 43s
    2. Using images
      5m 51s
    3. Playing a video loop
      6m 20s
    4. Exporting video
      3m 47s
    5. Adding sound
      4m 51s
  10. 20m 49s
    1. Creating functions
      11m 48s
    2. Creating classes and objects
      9m 1s
  11. 31m 10s
    1. Using embedded data
      5m 26s
    2. Working with appended text data
      6m 4s
    3. Working with appended tabular data
      10m 26s
    4. Reading XML data
      9m 14s
  12. 48m 17s
    1. Generating dot plots
      11m 11s
    2. Building scatter plots
      10m 0s
    3. Making line plots
      9m 55s
    4. Creating bar charts
      9m 12s
    5. Checking out examples of maps, hierarchies, and networks
      7m 59s
  13. 20m 57s
    1. Introducing some principles of 2D design
      13m 44s
    2. Understanding color theory
      7m 13s
  14. 24m 46s
    1. Interacting with zooming, rotating, and sliding
      6m 26s
    2. Implementing slicing
      6m 47s
    3. Using rollovers
      5m 58s
    4. Introducing the GUI libraries
      5m 35s
  15. 10m 35s
    1. Sharing via OpenProcessing and other sites
      3m 19s
    2. Saving as a desktop application
      2m 42s
    3. Saving as JavaScript
      1m 47s
    4. Saving as an Android application
      2m 47s
  16. 2m 38s
    1. Where to go from here
      2m 38s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Interactive Data Visualization with Processing.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.