-
Notifications
You must be signed in to change notification settings - Fork 161
Jaw.clarify definitions and layout #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,15 +96,15 @@ We'll need to manually write out each point. Transform attributes are inherited | |
| by child elements, so we can use `<g>` tags to move entire groups, such as the | ||
| axes, or even offset the entire graph by a margin. | ||
|
|
||
| <div class="example-row-2"> | ||
| <div class="example-row-1"> | ||
| <div class="example"> | ||
| {% include examples/scatterplot.svg %} | ||
| </div> | ||
| <div class="example"> | ||
| {% highlight html %} | ||
| {% include examples/scatterplot.svg %} | ||
| {% endhighlight %} | ||
| </div> | ||
| <div class="example"> | ||
| {% include examples/scatterplot.svg %} | ||
| </div> | ||
| </div> | ||
|
|
||
| Man! All that work for such a simple graph? SVG is a lot of work! | ||
|
|
@@ -130,6 +130,8 @@ often the data is homogenous arrays. | |
| {% include examples/data.js %} | ||
| d3.min(numbers); | ||
| // 1 | ||
| d3.extent(numbers); | ||
| // [1, 10] | ||
| {% endhighlight %} | ||
| </div> | ||
| </div> | ||
|
|
@@ -155,8 +157,8 @@ d3.extent(numbers); | |
|
|
||
| D3 has objects called scales that help map values across coordinate systems. | ||
| There are different kinds of scales (linear, logarithmic, linear for time). | ||
| Scales are configured with a domain and a range, they map from the data to | ||
| the approprate part of the screen (screen space). | ||
| Scales are configured with a Domain (the raw data) and a Range (pixel plot size), | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's not capitalize "Domain" and "Range" here, they're not proper nouns. Would this sentence reflect the clarification you're trying to make?
|
||
| they map from the data to the approprate part of the screen (screen space). | ||
|
|
||
| Here is how we set up the y-scale for the above money example: | ||
|
|
||
|
|
@@ -224,19 +226,18 @@ We'll come across more scales later. | |
|
|
||
| In our example, up top, we have these nice labels and tick marks. This is | ||
| something D3 can do for us. We can build an axis, and apply it to a scale. We | ||
| say, "hey, I want to build an axis that". | ||
| say, "hey, I want to build an axis that labels the plot". | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. derp, good catch. I think I meant "an axis that describes the range of data that I have" |
||
|
|
||
| <div class="example-row-2"> | ||
| <div class="example-row-1"> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The style of this tutorial is to have code on the left side, result on the right side. What is the goal of the single column layout? |
||
| <iframe class="example" | ||
| height="50" | ||
| src="{{ "/examples/axes" | prepend: site.baseurl }}"> | ||
| </iframe> | ||
| <div class="example"> | ||
| {% highlight javascript %} | ||
| {% include examples/axes.js %} | ||
| {% endhighlight %} | ||
| </div> | ||
|
|
||
| <iframe class="example" | ||
| height="180" | ||
| src="{{ "/examples/axes" | prepend: site.baseurl }}"> | ||
| </iframe> | ||
| </div> | ||
|
|
||
| D3's axes are really powerful! Notice how we built it using <kbd>Date</kbd> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extent is used an an example a few lines below. Should we remove that to move it up here?