D3 Flashcards

1
Q

Creating a selection

A

You can create a selection with .selectAll() or a single-item selection with .select()

The .attr() and .style() methods allow you to customize the appearance of each element based on data.
The .on() method can bind an event listener on the elements in the selection.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What do data, enter and append do?

A

The .data(), .enter() and .append() methods all work in unison to create elements and associate their corresponding data with the existing DOM

data(somedata) - contains the data

enter() - calculates the amount of DOM elements that needs to be created in order to append data items

append(“element”) - creates and appends the DOM elements calculated by enter().

The d parameter inside functions used in a D3 context represents the datum associated with the element at hand. The i paramenter is an incremter or index variable for array data structures.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are composition charts?

A

Composition charts
Focusing Question: What are the parts of some whole? What is the data made of?

Datasets that work well: Data pertaining to probabilities, proportions, and percentages can be visualized as with the graphs in this composition category. Charts in this category illustrate the different data components and their percentages as part of a whole.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are Distribution Charts?

A

Datasets that work well: Data in large quantities and/or with an array of attributes works well for these types of charts. Visualizations in this category will allow you to see patterns, re-occurrences, and a clustering of data points.

Note: In statistics, a commonly seen distribution is a bell curve, also known as a normal distribution. A bell curve is a bell-shaped distribution where most of the values in the dataset crowd around the average (also known as the mean), therefore causing the curve to form. If you want to see how values in the data are “distributed” across variables, the best way to do that would be with the visualizations in this category.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are Relationship Charts

A

Focusing Question: How do variables relate to each other?

Datasets that work well: Data with two or more variables can be displayed in these charts. These charts typically illustrate a correlation between two or more variables. You can communicate this relationship by mapping multiple variables in the same chart. Correlation measures the strength of a relationship between variables.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are Comparison Charts?

A

Focusing Question: How do variables compare to each other?

Datasets that work well: Data must have multiple variables, and the visualizations in this category allow readers to compare those items against the others. For example, a line graph that has multiple lines, each belonging to a different variable. Multi-colored bar charts are also a great way to compare items in data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what are the 4 main types of visualization charts?

A

Comparison, Composition, Distribution, and Relationship charts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is data visualization?

A

Portraying abstract information in a visual form

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the 3 main functions of data visualization?

A
  1. to find an unknown, or identify a problem -Exploring data
  2. to test a hypothesis - analyze data
  3. to tell a story -presenting data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does D3 stand for?

A

Data Driven Documents

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Linear scales

A

var y = d3.scaleLinear().domain([0,828]).range([0,400]);

y(100) //48.3
y.invert(48.3) //100

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the most common scales used in D3

A

linear scale, time scale, ordinal scale, logarithm scale,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Tufte’s 4 principles of design

A
  1. Graphical integrity
  2. The lie factor
  3. Chart Junk
  4. Data-to-ink ration
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Tufte’s 4 principles of design

A
  1. Graphical integrity
  2. The lie factor
  3. Chart Junk
  4. Data-to-ink ratio
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

When might Tufte’s principles not apply

A

When the goal is to grab the user’s attention and to encourage further exploration, by creating interesting visualizaitons

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the 3 data types?

A

Quantitative(numerical), Categorical(categories), Ordinal(rankings)

17
Q

Which channels are good for communicating numbers?

A

Position, length, and slope

18
Q

Which channels are good for communicating Ranking?

A

Area size, Shades of a color

19
Q

Which channels are good for communicating Categories?

A

Shapes and colors