close

==== Getting Start ====
http://github.com/d3/d3/blob/master/

image

Selecting the DOM
  - DOM Access
  - select (STR)
  - selectAll (STR)
  - STR CSS selectors
  - Chain action methods

  * not zero index, start from 1
image
image

Controlling HTML within selection
  - text() : modify text
imageimage
  - html() : modify html
imageimage
  - append() : appends elements
imageimage
  - insert() : inserts elements
    - if not defining anything, append
imageimage
    - define location
imageimage
  - remove() : deletes elements
imageimage

Modifying attributes through CSS
  - style() : CSS style
imageimage
  - classed() : toggle classes
imageimage
image
imageimage
image
  - attr() : any attribute
imageimage
  - property() : any property
imageimage

Binding data to the DOM
  - data() : joins data
imageimage
imageimage
imageimage
imageimage
imageimage
  - Callback access
  - Index available

Creating subselections
  - enter()
  - Sub-selections
  - exit()

image
image

==== Understanding SVG Graphics ====

Drawing with SVG
  - HTML : shapes lacking
  - XML format
  - Style through CSS
  - Easy to create
  - Scriptable

Understanding SVG primitives
  - <svg> tag
imageimage
    - <line /> : self finish
imageimage
  - Use style declarations
  - rect, circle, line, text, polyline
imageimage
imageimage
imageimage
  - g : creates groups
imageimage
  - xlink:href : create instance
imageimage

Create SVGs
  - Target DOM
  - append()
  - attr(), style(), etc
imageimage

Create a simple SVG bar chart
imageimage

==== Using D3 Methods ====

Adding a linear scale
  - scaleLinear() : fit the range
  - domain()
  - range()
  - Stats : min(), max(), etc
image
image

Using Ordinal Scales : ordinal scales
  - scaleBand()
  - padding(), paddingInner(), paddingOuter()
  - bandwidth()
image
image

Creating meaningful color scales
imageimage
imageimage
imageimage
imageimage

Adding events
  - on (EVT) handler
  - mouseout, mouseover, etc
imageimage
imageimage
imageimage
  * Be careful of the location of tempColor Assignment
imageimage

Using transitions and animations : API.md#transitions-d3-transition
  - transition() : sets up
  - duration() : control speed
  - delay() : add time
imageimage
imageimage

Adding a tooltip :
imageimage
image

==== Using Data ====

Using external data
  - d3 AJAX
  - .csv, html, .json, .text, tsv, .xml
  - Handle with callback()
  - http://openweathermap.org
  - http://jsoneditoronline.org  --> Use to see the data hierarchy

Using meaningful colors

imageimage
imageimage

Adding a simple guide : API.md#axes-d3-axis
  - Regular scales
  - axisTop, axisRight, axisBottom, axisLeft
  - Tick methods
  - Group elements

  1. Create Axis Elements
image
  2. Add one group for the original graph
image
  3. Append another chart as axis
image

Create margins
Margin Convention / D3 / Observable (observablehq.com)
image

imageimage
image

Adding a time-based guide
  - scaleTime()
  - Date based domain
  - Special ticks
  - Group elements
imageimage
image
imageimage
​​​​​

arrow
arrow
    全站熱搜
    創作者介紹

    pixnetinpenang 發表在 痞客邦 留言(0) 人氣()