Check out a free preview of the full Data Visualization First Steps course

The "Filtering the Data Exercise" Lesson is part of the full, Data Visualization First Steps course featured in this preview video. Here's what you'd learn in this lesson:

Students are instructed to create checkboxes that filter for some/all of the present HTTP status codes.

Preview
Close

Transcript from the "Filtering the Data Exercise" Lesson

[00:00:00]
>> What we're gonna do is we're gonna create a checkbox input for the different status codes that we find represented in our data set. And once we've done that, we're going to hook it up to our plot, and only display data from responses that came back with those status codes, if that makes sense.

[00:00:24]
So first of all, let's create a checkbox input. And in the cell below this next to do, we have kinda the scaffolding for this. We're gonna give it an array of possible values, and then we're going to give it some options, like for example, if we wanna give it a label like status code, something like that.

[00:00:45]
And to help you out, what I've done here in this statusCodes array is pull out all of the different statusCodes observed in our particular little chunk of the logs here. So you can use this statusCodes array to help get this checkbox going. So use the colors example as a starting point and see if you can get the checkboxes for the different status codes working, so that you can capture those values in this selectedCodes variable.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now