Permalink
Browse files

Starting up the whole documenting process

  • Loading branch information...
1 parent dd2a424 commit 5a71369b6a2e5c1f9936562bb3858e09f6bf0cc1 @zmaril committed May 17, 2012
Sorry, we could not display the entire diff because it was too big.
View
3 doc
@@ -0,0 +1,3 @@
+docco src/*/*.js
+docco src/*.js
+docco src/*/*.js
View
123 docs/albers.html
@@ -0,0 +1,123 @@
+<!DOCTYPE html> <html> <head> <title>albers.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="behavior.html"> behavior.js </a> <a class="source" href="drag.html"> drag.js </a> <a class="source" href="zoom.html"> zoom.js </a> <a class="source" href="date.html"> date.js </a> <a class="source" href="style.html"> style.js </a> <a class="source" href="array.html"> array.js </a> <a class="source" href="ascending.html"> ascending.js </a> <a class="source" href="bisect.html"> bisect.js </a> <a class="source" href="class.html"> class.js </a> <a class="source" href="collapse.html"> collapse.js </a> <a class="source" href="core.html"> core.js </a> <a class="source" href="descending.html"> descending.js </a> <a class="source" href="dispatch.html"> dispatch.js </a> <a class="source" href="ease.html"> ease.js </a> <a class="source" href="entries.html"> entries.js </a> <a class="source" href="event.html"> event.js </a> <a class="source" href="extent.html"> extent.js </a> <a class="source" href="first.html"> first.js </a> <a class="source" href="format.html"> format.js </a> <a class="source" href="formatPrefix.html"> formatPrefix.js </a> <a class="source" href="functor.html"> functor.js </a> <a class="source" href="hsl.html"> hsl.js </a> <a class="source" href="html.html"> html.js </a> <a class="source" href="identity.html"> identity.js </a> <a class="source" href="interpolate.html"> interpolate.js </a> <a class="source" href="json.html"> json.js </a> <a class="source" href="keys.html"> keys.js </a> <a class="source" href="last.html"> last.js </a> <a class="source" href="map.html"> map.js </a> <a class="source" href="max.html"> max.js </a> <a class="source" href="mean.html"> mean.js </a> <a class="source" href="median.html"> median.js </a> <a class="source" href="merge.html"> merge.js </a> <a class="source" href="min.html"> min.js </a> <a class="source" href="mouse.html"> mouse.js </a> <a class="source" href="nest.html"> nest.js </a> <a class="source" href="noop.html"> noop.js </a> <a class="source" href="ns.html"> ns.js </a> <a class="source" href="number.html"> number.js </a> <a class="source" href="permute.html"> permute.js </a> <a class="source" href="quantile.html"> quantile.js </a> <a class="source" href="random.html"> random.js </a> <a class="source" href="range.html"> range.js </a> <a class="source" href="rebind.html"> rebind.js </a> <a class="source" href="requote.html"> requote.js </a> <a class="source" href="rgb.html"> rgb.js </a> <a class="source" href="round.html"> round.js </a> <a class="source" href="selection-append.html"> selection-append.js </a> <a class="source" href="selection-attr.html"> selection-attr.js </a> <a class="source" href="selection-call.html"> selection-call.js </a> <a class="source" href="selection-classed.html"> selection-classed.js </a> <a class="source" href="selection-data.html"> selection-data.js </a> <a class="source" href="selection-datum.html"> selection-datum.js </a> <a class="source" href="selection-each.html"> selection-each.js </a> <a class="source" href="selection-empty.html"> selection-empty.js </a> <a class="source" href="selection-enter-select.html"> selection-enter-select.js </a> <a class="source" href="selection-enter.html"> selection-enter.js </a> <a class="source" href="selection-filter.html"> selection-filter.js </a> <a class="source" href="selection-html.html"> selection-html.js </a> <a class="source" href="selection-insert.html"> selection-insert.js </a> <a class="source" href="selection-node.html"> selection-node.js </a> <a class="source" href="selection-on.html"> selection-on.js </a> <a class="source" href="selection-order.html"> selection-order.js </a> <a class="source" href="selection-property.html"> selection-property.js </a> <a class="source" href="selection-remove.html"> selection-remove.js </a> <a class="source" href="selection-root.html"> selection-root.js </a> <a class="source" href="selection-select.html"> selection-select.js </a> <a class="source" href="selection-selectAll.html"> selection-selectAll.js </a> <a class="source" href="selection-sort.html"> selection-sort.js </a> <a class="source" href="selection-style.html"> selection-style.js </a> <a class="source" href="selection-text.html"> selection-text.js </a> <a class="source" href="selection-transition.html"> selection-transition.js </a> <a class="source" href="selection.html"> selection.js </a> <a class="source" href="split.html"> split.js </a> <a class="source" href="sum.html"> sum.js </a> <a class="source" href="text.html"> text.js </a> <a class="source" href="this.html"> this.js </a> <a class="source" href="timer.html"> timer.js </a> <a class="source" href="touches.html"> touches.js </a> <a class="source" href="transform.html"> transform.js </a> <a class="source" href="transition-attr.html"> transition-attr.js </a> <a class="source" href="transition-delay.html"> transition-delay.js </a> <a class="source" href="transition-duration.html"> transition-duration.js </a> <a class="source" href="transition-each.html"> transition-each.js </a> <a class="source" href="transition-remove.html"> transition-remove.js </a> <a class="source" href="transition-select.html"> transition-select.js </a> <a class="source" href="transition-selectAll.html"> transition-selectAll.js </a> <a class="source" href="transition-style.html"> transition-style.js </a> <a class="source" href="transition-text.html"> transition-text.js </a> <a class="source" href="transition-transition.html"> transition-transition.js </a> <a class="source" href="transition.html"> transition.js </a> <a class="source" href="transpose.html"> transpose.js </a> <a class="source" href="true.html"> true.js </a> <a class="source" href="uninterpolate.html"> uninterpolate.js </a> <a class="source" href="values.html"> values.js </a> <a class="source" href="xhr.html"> xhr.js </a> <a class="source" href="xml.html"> xml.js </a> <a class="source" href="zip.html"> zip.js </a> <a class="source" href="csv.html"> csv.js </a> <a class="source" href="format.html"> format.js </a> <a class="source" href="parse.html"> parse.js </a> <a class="source" href="albers.html"> albers.js </a> <a class="source" href="azimuthal.html"> azimuthal.js </a> <a class="source" href="bonne.html"> bonne.js </a> <a class="source" href="bounds.html"> bounds.js </a> <a class="source" href="circle.html"> circle.js </a> <a class="source" href="equirectangular.html"> equirectangular.js </a> <a class="source" href="geo.html"> geo.js </a> <a class="source" href="greatArc.html"> greatArc.js </a> <a class="source" href="greatCircle.html"> greatCircle.js </a> <a class="source" href="mercator.html"> mercator.js </a> <a class="source" href="path.html"> path.js </a> <a class="source" href="type.html"> type.js </a> <a class="source" href="contour.html"> contour.js </a> <a class="source" href="delaunay.html"> delaunay.js </a> <a class="source" href="geom.html"> geom.js </a> <a class="source" href="hull.html"> hull.js </a> <a class="source" href="polygon.html"> polygon.js </a> <a class="source" href="quadtree.html"> quadtree.js </a> <a class="source" href="voronoi.html"> voronoi.js </a> <a class="source" href="bundle.html"> bundle.js </a> <a class="source" href="chord.html"> chord.js </a> <a class="source" href="cluster.html"> cluster.js </a> <a class="source" href="force.html"> force.js </a> <a class="source" href="hierarchy.html"> hierarchy.js </a> <a class="source" href="histogram.html"> histogram.js </a> <a class="source" href="layout.html"> layout.js </a> <a class="source" href="pack.html"> pack.js </a> <a class="source" href="partition.html"> partition.js </a> <a class="source" href="pie.html"> pie.js </a> <a class="source" href="stack.html"> stack.js </a> <a class="source" href="tree.html"> tree.js </a> <a class="source" href="treemap.html"> treemap.js </a> <a class="source" href="bilinear.html"> bilinear.js </a> <a class="source" href="category.html"> category.js </a> <a class="source" href="identity.html"> identity.js </a> <a class="source" href="linear.html"> linear.js </a> <a class="source" href="log.html"> log.js </a> <a class="source" href="nice.html"> nice.js </a> <a class="source" href="ordinal.html"> ordinal.js </a> <a class="source" href="polylinear.html"> polylinear.js </a> <a class="source" href="pow.html"> pow.js </a> <a class="source" href="quantile.html"> quantile.js </a> <a class="source" href="quantize.html"> quantize.js </a> <a class="source" href="scale.html"> scale.js </a> <a class="source" href="sqrt.html"> sqrt.js </a> <a class="source" href="arc.html"> arc.js </a> <a class="source" href="area-radial.html"> area-radial.js </a> <a class="source" href="area.html"> area.js </a> <a class="source" href="axis.html"> axis.js </a> <a class="source" href="brush.html"> brush.js </a> <a class="source" href="chord.html"> chord.js </a> <a class="source" href="diagonal-radial.html"> diagonal-radial.js </a> <a class="source" href="diagonal.html"> diagonal.js </a> <a class="source" href="line-radial.html"> line-radial.js </a> <a class="source" href="line.html"> line.js </a> <a class="source" href="mouse.html"> mouse.js </a> <a class="source" href="svg.html"> svg.js </a> <a class="source" href="symbol.html"> symbol.js </a> <a class="source" href="touches.html"> touches.js </a> <a class="source" href="day.html"> day.js </a> <a class="source" href="format-iso.html"> format-iso.js </a> <a class="source" href="format-utc.html"> format-utc.js </a> <a class="source" href="format.html"> format.js </a> <a class="source" href="hour.html"> hour.js </a> <a class="source" href="interval.html"> interval.js </a> <a class="source" href="minute.html"> minute.js </a> <a class="source" href="month.html"> month.js </a> <a class="source" href="scale-utc.html"> scale-utc.js </a> <a class="source" href="scale.html"> scale.js </a> <a class="source" href="second.html"> second.js </a> <a class="source" href="time.html"> time.js </a> <a class="source" href="week.html"> week.js </a> <a class="source" href="year.html"> year.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> albers.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Derived from Tom Carden's Albers implementation for Protovis.
+http://gist.github.com/476238
+http://mathworld.wolfram.com/AlbersEqual-AreaConicProjection.html</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">d3</span><span class="p">.</span><span class="nx">geo</span><span class="p">.</span><span class="nx">albers</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">origin</span> <span class="o">=</span> <span class="p">[</span><span class="o">-</span><span class="mi">98</span><span class="p">,</span> <span class="mi">38</span><span class="p">],</span>
+ <span class="nx">parallels</span> <span class="o">=</span> <span class="p">[</span><span class="mf">29.5</span><span class="p">,</span> <span class="mf">45.5</span><span class="p">],</span>
+ <span class="nx">scale</span> <span class="o">=</span> <span class="mi">1000</span><span class="p">,</span>
+ <span class="nx">translate</span> <span class="o">=</span> <span class="p">[</span><span class="mi">480</span><span class="p">,</span> <span class="mi">250</span><span class="p">],</span>
+ <span class="nx">lng0</span><span class="p">,</span> <span class="c1">// d3_geo_radians * origin[0]</span>
+ <span class="nx">n</span><span class="p">,</span>
+ <span class="nx">C</span><span class="p">,</span>
+ <span class="nx">p0</span><span class="p">;</span>
+
+ <span class="kd">function</span> <span class="nx">albers</span><span class="p">(</span><span class="nx">coordinates</span><span class="p">)</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">t</span> <span class="o">=</span> <span class="nx">n</span> <span class="o">*</span> <span class="p">(</span><span class="nx">d3_geo_radians</span> <span class="o">*</span> <span class="nx">coordinates</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">-</span> <span class="nx">lng0</span><span class="p">),</span>
+ <span class="nx">p</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">sqrt</span><span class="p">(</span><span class="nx">C</span> <span class="o">-</span> <span class="mi">2</span> <span class="o">*</span> <span class="nx">n</span> <span class="o">*</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">sin</span><span class="p">(</span><span class="nx">d3_geo_radians</span> <span class="o">*</span> <span class="nx">coordinates</span><span class="p">[</span><span class="mi">1</span><span class="p">]))</span> <span class="o">/</span> <span class="nx">n</span><span class="p">;</span>
+ <span class="k">return</span> <span class="p">[</span>
+ <span class="nx">scale</span> <span class="o">*</span> <span class="nx">p</span> <span class="o">*</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">sin</span><span class="p">(</span><span class="nx">t</span><span class="p">)</span> <span class="o">+</span> <span class="nx">translate</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span>
+ <span class="nx">scale</span> <span class="o">*</span> <span class="p">(</span><span class="nx">p</span> <span class="o">*</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">cos</span><span class="p">(</span><span class="nx">t</span><span class="p">)</span> <span class="o">-</span> <span class="nx">p0</span><span class="p">)</span> <span class="o">+</span> <span class="nx">translate</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
+ <span class="p">];</span>
+ <span class="p">}</span>
+
+ <span class="nx">albers</span><span class="p">.</span><span class="nx">invert</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">coordinates</span><span class="p">)</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">x</span> <span class="o">=</span> <span class="p">(</span><span class="nx">coordinates</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">-</span> <span class="nx">translate</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="o">/</span> <span class="nx">scale</span><span class="p">,</span>
+ <span class="nx">y</span> <span class="o">=</span> <span class="p">(</span><span class="nx">coordinates</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">-</span> <span class="nx">translate</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span> <span class="o">/</span> <span class="nx">scale</span><span class="p">,</span>
+ <span class="nx">p0y</span> <span class="o">=</span> <span class="nx">p0</span> <span class="o">+</span> <span class="nx">y</span><span class="p">,</span>
+ <span class="nx">t</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">atan2</span><span class="p">(</span><span class="nx">x</span><span class="p">,</span> <span class="nx">p0y</span><span class="p">),</span>
+ <span class="nx">p</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">sqrt</span><span class="p">(</span><span class="nx">x</span> <span class="o">*</span> <span class="nx">x</span> <span class="o">+</span> <span class="nx">p0y</span> <span class="o">*</span> <span class="nx">p0y</span><span class="p">);</span>
+ <span class="k">return</span> <span class="p">[</span>
+ <span class="p">(</span><span class="nx">lng0</span> <span class="o">+</span> <span class="nx">t</span> <span class="o">/</span> <span class="nx">n</span><span class="p">)</span> <span class="o">/</span> <span class="nx">d3_geo_radians</span><span class="p">,</span>
+ <span class="nb">Math</span><span class="p">.</span><span class="nx">asin</span><span class="p">((</span><span class="nx">C</span> <span class="o">-</span> <span class="nx">p</span> <span class="o">*</span> <span class="nx">p</span> <span class="o">*</span> <span class="nx">n</span> <span class="o">*</span> <span class="nx">n</span><span class="p">)</span> <span class="o">/</span> <span class="p">(</span><span class="mi">2</span> <span class="o">*</span> <span class="nx">n</span><span class="p">))</span> <span class="o">/</span> <span class="nx">d3_geo_radians</span>
+ <span class="p">];</span>
+ <span class="p">};</span>
+
+ <span class="kd">function</span> <span class="nx">reload</span><span class="p">()</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">phi1</span> <span class="o">=</span> <span class="nx">d3_geo_radians</span> <span class="o">*</span> <span class="nx">parallels</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span>
+ <span class="nx">phi2</span> <span class="o">=</span> <span class="nx">d3_geo_radians</span> <span class="o">*</span> <span class="nx">parallels</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span>
+ <span class="nx">lat0</span> <span class="o">=</span> <span class="nx">d3_geo_radians</span> <span class="o">*</span> <span class="nx">origin</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span>
+ <span class="nx">s</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">sin</span><span class="p">(</span><span class="nx">phi1</span><span class="p">),</span>
+ <span class="nx">c</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">cos</span><span class="p">(</span><span class="nx">phi1</span><span class="p">);</span>
+ <span class="nx">lng0</span> <span class="o">=</span> <span class="nx">d3_geo_radians</span> <span class="o">*</span> <span class="nx">origin</span><span class="p">[</span><span class="mi">0</span><span class="p">];</span>
+ <span class="nx">n</span> <span class="o">=</span> <span class="p">.</span><span class="mi">5</span> <span class="o">*</span> <span class="p">(</span><span class="nx">s</span> <span class="o">+</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">sin</span><span class="p">(</span><span class="nx">phi2</span><span class="p">));</span>
+ <span class="nx">C</span> <span class="o">=</span> <span class="nx">c</span> <span class="o">*</span> <span class="nx">c</span> <span class="o">+</span> <span class="mi">2</span> <span class="o">*</span> <span class="nx">n</span> <span class="o">*</span> <span class="nx">s</span><span class="p">;</span>
+ <span class="nx">p0</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">sqrt</span><span class="p">(</span><span class="nx">C</span> <span class="o">-</span> <span class="mi">2</span> <span class="o">*</span> <span class="nx">n</span> <span class="o">*</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">sin</span><span class="p">(</span><span class="nx">lat0</span><span class="p">))</span> <span class="o">/</span> <span class="nx">n</span><span class="p">;</span>
+ <span class="k">return</span> <span class="nx">albers</span><span class="p">;</span>
+ <span class="p">}</span>
+
+ <span class="nx">albers</span><span class="p">.</span><span class="nx">origin</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">x</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="k">return</span> <span class="nx">origin</span><span class="p">;</span>
+ <span class="nx">origin</span> <span class="o">=</span> <span class="p">[</span><span class="o">+</span><span class="nx">x</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="o">+</span><span class="nx">x</span><span class="p">[</span><span class="mi">1</span><span class="p">]];</span>
+ <span class="k">return</span> <span class="nx">reload</span><span class="p">();</span>
+ <span class="p">};</span>
+
+ <span class="nx">albers</span><span class="p">.</span><span class="nx">parallels</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">x</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="k">return</span> <span class="nx">parallels</span><span class="p">;</span>
+ <span class="nx">parallels</span> <span class="o">=</span> <span class="p">[</span><span class="o">+</span><span class="nx">x</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="o">+</span><span class="nx">x</span><span class="p">[</span><span class="mi">1</span><span class="p">]];</span>
+ <span class="k">return</span> <span class="nx">reload</span><span class="p">();</span>
+ <span class="p">};</span>
+
+ <span class="nx">albers</span><span class="p">.</span><span class="nx">scale</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">x</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="k">return</span> <span class="nx">scale</span><span class="p">;</span>
+ <span class="nx">scale</span> <span class="o">=</span> <span class="o">+</span><span class="nx">x</span><span class="p">;</span>
+ <span class="k">return</span> <span class="nx">albers</span><span class="p">;</span>
+ <span class="p">};</span>
+
+ <span class="nx">albers</span><span class="p">.</span><span class="nx">translate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">x</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="k">return</span> <span class="nx">translate</span><span class="p">;</span>
+ <span class="nx">translate</span> <span class="o">=</span> <span class="p">[</span><span class="o">+</span><span class="nx">x</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="o">+</span><span class="nx">x</span><span class="p">[</span><span class="mi">1</span><span class="p">]];</span>
+ <span class="k">return</span> <span class="nx">albers</span><span class="p">;</span>
+ <span class="p">};</span>
+
+ <span class="k">return</span> <span class="nx">reload</span><span class="p">();</span>
+<span class="p">};</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>A composite projection for the United States, 960x500. The set of standard
+parallels for each region comes from USGS, which is published here:
+http://egsc.usgs.gov/isb/pubs/MapProjections/projections.html#albers
+TODO allow the composite projection to be rescaled?</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">d3</span><span class="p">.</span><span class="nx">geo</span><span class="p">.</span><span class="nx">albersUsa</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">lower48</span> <span class="o">=</span> <span class="nx">d3</span><span class="p">.</span><span class="nx">geo</span><span class="p">.</span><span class="nx">albers</span><span class="p">();</span>
+
+ <span class="kd">var</span> <span class="nx">alaska</span> <span class="o">=</span> <span class="nx">d3</span><span class="p">.</span><span class="nx">geo</span><span class="p">.</span><span class="nx">albers</span><span class="p">()</span>
+ <span class="p">.</span><span class="nx">origin</span><span class="p">([</span><span class="o">-</span><span class="mi">160</span><span class="p">,</span> <span class="mi">60</span><span class="p">])</span>
+ <span class="p">.</span><span class="nx">parallels</span><span class="p">([</span><span class="mi">55</span><span class="p">,</span> <span class="mi">65</span><span class="p">]);</span>
+
+ <span class="kd">var</span> <span class="nx">hawaii</span> <span class="o">=</span> <span class="nx">d3</span><span class="p">.</span><span class="nx">geo</span><span class="p">.</span><span class="nx">albers</span><span class="p">()</span>
+ <span class="p">.</span><span class="nx">origin</span><span class="p">([</span><span class="o">-</span><span class="mi">160</span><span class="p">,</span> <span class="mi">20</span><span class="p">])</span>
+ <span class="p">.</span><span class="nx">parallels</span><span class="p">([</span><span class="mi">8</span><span class="p">,</span> <span class="mi">18</span><span class="p">]);</span>
+
+ <span class="kd">var</span> <span class="nx">puertoRico</span> <span class="o">=</span> <span class="nx">d3</span><span class="p">.</span><span class="nx">geo</span><span class="p">.</span><span class="nx">albers</span><span class="p">()</span>
+ <span class="p">.</span><span class="nx">origin</span><span class="p">([</span><span class="o">-</span><span class="mi">60</span><span class="p">,</span> <span class="mi">10</span><span class="p">])</span>
+ <span class="p">.</span><span class="nx">parallels</span><span class="p">([</span><span class="mi">8</span><span class="p">,</span> <span class="mi">18</span><span class="p">]);</span>
+
+ <span class="kd">function</span> <span class="nx">albersUsa</span><span class="p">(</span><span class="nx">coordinates</span><span class="p">)</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">lon</span> <span class="o">=</span> <span class="nx">coordinates</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span>
+ <span class="nx">lat</span> <span class="o">=</span> <span class="nx">coordinates</span><span class="p">[</span><span class="mi">1</span><span class="p">];</span>
+ <span class="k">return</span> <span class="p">(</span><span class="nx">lat</span> <span class="o">&gt;</span> <span class="mi">50</span> <span class="o">?</span> <span class="nx">alaska</span>
+ <span class="o">:</span> <span class="nx">lon</span> <span class="o">&lt;</span> <span class="o">-</span><span class="mi">140</span> <span class="o">?</span> <span class="nx">hawaii</span>
+ <span class="o">:</span> <span class="nx">lat</span> <span class="o">&lt;</span> <span class="mi">21</span> <span class="o">?</span> <span class="nx">puertoRico</span>
+ <span class="o">:</span> <span class="nx">lower48</span><span class="p">)(</span><span class="nx">coordinates</span><span class="p">);</span>
+ <span class="p">}</span>
+
+ <span class="nx">albersUsa</span><span class="p">.</span><span class="nx">scale</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">x</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="k">return</span> <span class="nx">lower48</span><span class="p">.</span><span class="nx">scale</span><span class="p">();</span>
+ <span class="nx">lower48</span><span class="p">.</span><span class="nx">scale</span><span class="p">(</span><span class="nx">x</span><span class="p">);</span>
+ <span class="nx">alaska</span><span class="p">.</span><span class="nx">scale</span><span class="p">(</span><span class="nx">x</span> <span class="o">*</span> <span class="p">.</span><span class="mi">6</span><span class="p">);</span>
+ <span class="nx">hawaii</span><span class="p">.</span><span class="nx">scale</span><span class="p">(</span><span class="nx">x</span><span class="p">);</span>
+ <span class="nx">puertoRico</span><span class="p">.</span><span class="nx">scale</span><span class="p">(</span><span class="nx">x</span> <span class="o">*</span> <span class="mf">1.5</span><span class="p">);</span>
+ <span class="k">return</span> <span class="nx">albersUsa</span><span class="p">.</span><span class="nx">translate</span><span class="p">(</span><span class="nx">lower48</span><span class="p">.</span><span class="nx">translate</span><span class="p">());</span>
+ <span class="p">};</span>
+
+ <span class="nx">albersUsa</span><span class="p">.</span><span class="nx">translate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">x</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="k">return</span> <span class="nx">lower48</span><span class="p">.</span><span class="nx">translate</span><span class="p">();</span>
+ <span class="kd">var</span> <span class="nx">dz</span> <span class="o">=</span> <span class="nx">lower48</span><span class="p">.</span><span class="nx">scale</span><span class="p">()</span> <span class="o">/</span> <span class="mi">1000</span><span class="p">,</span>
+ <span class="nx">dx</span> <span class="o">=</span> <span class="nx">x</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span>
+ <span class="nx">dy</span> <span class="o">=</span> <span class="nx">x</span><span class="p">[</span><span class="mi">1</span><span class="p">];</span>
+ <span class="nx">lower48</span><span class="p">.</span><span class="nx">translate</span><span class="p">(</span><span class="nx">x</span><span class="p">);</span>
+ <span class="nx">alaska</span><span class="p">.</span><span class="nx">translate</span><span class="p">([</span><span class="nx">dx</span> <span class="o">-</span> <span class="mi">400</span> <span class="o">*</span> <span class="nx">dz</span><span class="p">,</span> <span class="nx">dy</span> <span class="o">+</span> <span class="mi">170</span> <span class="o">*</span> <span class="nx">dz</span><span class="p">]);</span>
+ <span class="nx">hawaii</span><span class="p">.</span><span class="nx">translate</span><span class="p">([</span><span class="nx">dx</span> <span class="o">-</span> <span class="mi">190</span> <span class="o">*</span> <span class="nx">dz</span><span class="p">,</span> <span class="nx">dy</span> <span class="o">+</span> <span class="mi">200</span> <span class="o">*</span> <span class="nx">dz</span><span class="p">]);</span>
+ <span class="nx">puertoRico</span><span class="p">.</span><span class="nx">translate</span><span class="p">([</span><span class="nx">dx</span> <span class="o">+</span> <span class="mi">580</span> <span class="o">*</span> <span class="nx">dz</span><span class="p">,</span> <span class="nx">dy</span> <span class="o">+</span> <span class="mi">430</span> <span class="o">*</span> <span class="nx">dz</span><span class="p">]);</span>
+ <span class="k">return</span> <span class="nx">albersUsa</span><span class="p">;</span>
+ <span class="p">};</span>
+
+ <span class="k">return</span> <span class="nx">albersUsa</span><span class="p">.</span><span class="nx">scale</span><span class="p">(</span><span class="nx">lower48</span><span class="p">.</span><span class="nx">scale</span><span class="p">());</span>
+<span class="p">};</span>
+
+</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
97 docs/arc.html
@@ -0,0 +1,97 @@
+<!DOCTYPE html> <html> <head> <title>arc.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="behavior.html"> behavior.js </a> <a class="source" href="drag.html"> drag.js </a> <a class="source" href="zoom.html"> zoom.js </a> <a class="source" href="date.html"> date.js </a> <a class="source" href="style.html"> style.js </a> <a class="source" href="array.html"> array.js </a> <a class="source" href="ascending.html"> ascending.js </a> <a class="source" href="bisect.html"> bisect.js </a> <a class="source" href="class.html"> class.js </a> <a class="source" href="collapse.html"> collapse.js </a> <a class="source" href="core.html"> core.js </a> <a class="source" href="descending.html"> descending.js </a> <a class="source" href="dispatch.html"> dispatch.js </a> <a class="source" href="ease.html"> ease.js </a> <a class="source" href="entries.html"> entries.js </a> <a class="source" href="event.html"> event.js </a> <a class="source" href="extent.html"> extent.js </a> <a class="source" href="first.html"> first.js </a> <a class="source" href="format.html"> format.js </a> <a class="source" href="formatPrefix.html"> formatPrefix.js </a> <a class="source" href="functor.html"> functor.js </a> <a class="source" href="hsl.html"> hsl.js </a> <a class="source" href="html.html"> html.js </a> <a class="source" href="identity.html"> identity.js </a> <a class="source" href="interpolate.html"> interpolate.js </a> <a class="source" href="json.html"> json.js </a> <a class="source" href="keys.html"> keys.js </a> <a class="source" href="last.html"> last.js </a> <a class="source" href="map.html"> map.js </a> <a class="source" href="max.html"> max.js </a> <a class="source" href="mean.html"> mean.js </a> <a class="source" href="median.html"> median.js </a> <a class="source" href="merge.html"> merge.js </a> <a class="source" href="min.html"> min.js </a> <a class="source" href="mouse.html"> mouse.js </a> <a class="source" href="nest.html"> nest.js </a> <a class="source" href="noop.html"> noop.js </a> <a class="source" href="ns.html"> ns.js </a> <a class="source" href="number.html"> number.js </a> <a class="source" href="permute.html"> permute.js </a> <a class="source" href="quantile.html"> quantile.js </a> <a class="source" href="random.html"> random.js </a> <a class="source" href="range.html"> range.js </a> <a class="source" href="rebind.html"> rebind.js </a> <a class="source" href="requote.html"> requote.js </a> <a class="source" href="rgb.html"> rgb.js </a> <a class="source" href="round.html"> round.js </a> <a class="source" href="selection-append.html"> selection-append.js </a> <a class="source" href="selection-attr.html"> selection-attr.js </a> <a class="source" href="selection-call.html"> selection-call.js </a> <a class="source" href="selection-classed.html"> selection-classed.js </a> <a class="source" href="selection-data.html"> selection-data.js </a> <a class="source" href="selection-datum.html"> selection-datum.js </a> <a class="source" href="selection-each.html"> selection-each.js </a> <a class="source" href="selection-empty.html"> selection-empty.js </a> <a class="source" href="selection-enter-select.html"> selection-enter-select.js </a> <a class="source" href="selection-enter.html"> selection-enter.js </a> <a class="source" href="selection-filter.html"> selection-filter.js </a> <a class="source" href="selection-html.html"> selection-html.js </a> <a class="source" href="selection-insert.html"> selection-insert.js </a> <a class="source" href="selection-node.html"> selection-node.js </a> <a class="source" href="selection-on.html"> selection-on.js </a> <a class="source" href="selection-order.html"> selection-order.js </a> <a class="source" href="selection-property.html"> selection-property.js </a> <a class="source" href="selection-remove.html"> selection-remove.js </a> <a class="source" href="selection-root.html"> selection-root.js </a> <a class="source" href="selection-select.html"> selection-select.js </a> <a class="source" href="selection-selectAll.html"> selection-selectAll.js </a> <a class="source" href="selection-sort.html"> selection-sort.js </a> <a class="source" href="selection-style.html"> selection-style.js </a> <a class="source" href="selection-text.html"> selection-text.js </a> <a class="source" href="selection-transition.html"> selection-transition.js </a> <a class="source" href="selection.html"> selection.js </a> <a class="source" href="split.html"> split.js </a> <a class="source" href="sum.html"> sum.js </a> <a class="source" href="text.html"> text.js </a> <a class="source" href="this.html"> this.js </a> <a class="source" href="timer.html"> timer.js </a> <a class="source" href="touches.html"> touches.js </a> <a class="source" href="transform.html"> transform.js </a> <a class="source" href="transition-attr.html"> transition-attr.js </a> <a class="source" href="transition-delay.html"> transition-delay.js </a> <a class="source" href="transition-duration.html"> transition-duration.js </a> <a class="source" href="transition-each.html"> transition-each.js </a> <a class="source" href="transition-remove.html"> transition-remove.js </a> <a class="source" href="transition-select.html"> transition-select.js </a> <a class="source" href="transition-selectAll.html"> transition-selectAll.js </a> <a class="source" href="transition-style.html"> transition-style.js </a> <a class="source" href="transition-text.html"> transition-text.js </a> <a class="source" href="transition-transition.html"> transition-transition.js </a> <a class="source" href="transition.html"> transition.js </a> <a class="source" href="transpose.html"> transpose.js </a> <a class="source" href="true.html"> true.js </a> <a class="source" href="uninterpolate.html"> uninterpolate.js </a> <a class="source" href="values.html"> values.js </a> <a class="source" href="xhr.html"> xhr.js </a> <a class="source" href="xml.html"> xml.js </a> <a class="source" href="zip.html"> zip.js </a> <a class="source" href="csv.html"> csv.js </a> <a class="source" href="format.html"> format.js </a> <a class="source" href="parse.html"> parse.js </a> <a class="source" href="albers.html"> albers.js </a> <a class="source" href="azimuthal.html"> azimuthal.js </a> <a class="source" href="bonne.html"> bonne.js </a> <a class="source" href="bounds.html"> bounds.js </a> <a class="source" href="circle.html"> circle.js </a> <a class="source" href="equirectangular.html"> equirectangular.js </a> <a class="source" href="geo.html"> geo.js </a> <a class="source" href="greatArc.html"> greatArc.js </a> <a class="source" href="greatCircle.html"> greatCircle.js </a> <a class="source" href="mercator.html"> mercator.js </a> <a class="source" href="path.html"> path.js </a> <a class="source" href="type.html"> type.js </a> <a class="source" href="contour.html"> contour.js </a> <a class="source" href="delaunay.html"> delaunay.js </a> <a class="source" href="geom.html"> geom.js </a> <a class="source" href="hull.html"> hull.js </a> <a class="source" href="polygon.html"> polygon.js </a> <a class="source" href="quadtree.html"> quadtree.js </a> <a class="source" href="voronoi.html"> voronoi.js </a> <a class="source" href="bundle.html"> bundle.js </a> <a class="source" href="chord.html"> chord.js </a> <a class="source" href="cluster.html"> cluster.js </a> <a class="source" href="force.html"> force.js </a> <a class="source" href="hierarchy.html"> hierarchy.js </a> <a class="source" href="histogram.html"> histogram.js </a> <a class="source" href="layout.html"> layout.js </a> <a class="source" href="pack.html"> pack.js </a> <a class="source" href="partition.html"> partition.js </a> <a class="source" href="pie.html"> pie.js </a> <a class="source" href="stack.html"> stack.js </a> <a class="source" href="tree.html"> tree.js </a> <a class="source" href="treemap.html"> treemap.js </a> <a class="source" href="bilinear.html"> bilinear.js </a> <a class="source" href="category.html"> category.js </a> <a class="source" href="identity.html"> identity.js </a> <a class="source" href="linear.html"> linear.js </a> <a class="source" href="log.html"> log.js </a> <a class="source" href="nice.html"> nice.js </a> <a class="source" href="ordinal.html"> ordinal.js </a> <a class="source" href="polylinear.html"> polylinear.js </a> <a class="source" href="pow.html"> pow.js </a> <a class="source" href="quantile.html"> quantile.js </a> <a class="source" href="quantize.html"> quantize.js </a> <a class="source" href="scale.html"> scale.js </a> <a class="source" href="sqrt.html"> sqrt.js </a> <a class="source" href="arc.html"> arc.js </a> <a class="source" href="area-radial.html"> area-radial.js </a> <a class="source" href="area.html"> area.js </a> <a class="source" href="axis.html"> axis.js </a> <a class="source" href="brush.html"> brush.js </a> <a class="source" href="chord.html"> chord.js </a> <a class="source" href="diagonal-radial.html"> diagonal-radial.js </a> <a class="source" href="diagonal.html"> diagonal.js </a> <a class="source" href="line-radial.html"> line-radial.js </a> <a class="source" href="line.html"> line.js </a> <a class="source" href="mouse.html"> mouse.js </a> <a class="source" href="svg.html"> svg.js </a> <a class="source" href="symbol.html"> symbol.js </a> <a class="source" href="touches.html"> touches.js </a> <a class="source" href="day.html"> day.js </a> <a class="source" href="format-iso.html"> format-iso.js </a> <a class="source" href="format-utc.html"> format-utc.js </a> <a class="source" href="format.html"> format.js </a> <a class="source" href="hour.html"> hour.js </a> <a class="source" href="interval.html"> interval.js </a> <a class="source" href="minute.html"> minute.js </a> <a class="source" href="month.html"> month.js </a> <a class="source" href="scale-utc.html"> scale-utc.js </a> <a class="source" href="scale.html"> scale.js </a> <a class="source" href="second.html"> second.js </a> <a class="source" href="time.html"> time.js </a> <a class="source" href="week.html"> week.js </a> <a class="source" href="year.html"> year.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> arc.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="nx">d3</span><span class="p">.</span><span class="nx">svg</span><span class="p">.</span><span class="nx">arc</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">innerRadius</span> <span class="o">=</span> <span class="nx">d3_svg_arcInnerRadius</span><span class="p">,</span>
+ <span class="nx">outerRadius</span> <span class="o">=</span> <span class="nx">d3_svg_arcOuterRadius</span><span class="p">,</span>
+ <span class="nx">startAngle</span> <span class="o">=</span> <span class="nx">d3_svg_arcStartAngle</span><span class="p">,</span>
+ <span class="nx">endAngle</span> <span class="o">=</span> <span class="nx">d3_svg_arcEndAngle</span><span class="p">;</span>
+
+ <span class="kd">function</span> <span class="nx">arc</span><span class="p">()</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">r0</span> <span class="o">=</span> <span class="nx">innerRadius</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">),</span>
+ <span class="nx">r1</span> <span class="o">=</span> <span class="nx">outerRadius</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">),</span>
+ <span class="nx">a0</span> <span class="o">=</span> <span class="nx">startAngle</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">)</span> <span class="o">+</span> <span class="nx">d3_svg_arcOffset</span><span class="p">,</span>
+ <span class="nx">a1</span> <span class="o">=</span> <span class="nx">endAngle</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">)</span> <span class="o">+</span> <span class="nx">d3_svg_arcOffset</span><span class="p">,</span>
+ <span class="nx">da</span> <span class="o">=</span> <span class="p">(</span><span class="nx">a1</span> <span class="o">&lt;</span> <span class="nx">a0</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">da</span> <span class="o">=</span> <span class="nx">a0</span><span class="p">,</span> <span class="nx">a0</span> <span class="o">=</span> <span class="nx">a1</span><span class="p">,</span> <span class="nx">a1</span> <span class="o">=</span> <span class="nx">da</span><span class="p">),</span> <span class="nx">a1</span> <span class="o">-</span> <span class="nx">a0</span><span class="p">),</span>
+ <span class="nx">df</span> <span class="o">=</span> <span class="nx">da</span> <span class="o">&lt;</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">PI</span> <span class="o">?</span> <span class="s2">&quot;0&quot;</span> <span class="o">:</span> <span class="s2">&quot;1&quot;</span><span class="p">,</span>
+ <span class="nx">c0</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">cos</span><span class="p">(</span><span class="nx">a0</span><span class="p">),</span>
+ <span class="nx">s0</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">sin</span><span class="p">(</span><span class="nx">a0</span><span class="p">),</span>
+ <span class="nx">c1</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">cos</span><span class="p">(</span><span class="nx">a1</span><span class="p">),</span>
+ <span class="nx">s1</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">sin</span><span class="p">(</span><span class="nx">a1</span><span class="p">);</span>
+ <span class="k">return</span> <span class="nx">da</span> <span class="o">&gt;=</span> <span class="nx">d3_svg_arcMax</span>
+ <span class="o">?</span> <span class="p">(</span><span class="nx">r0</span>
+ <span class="o">?</span> <span class="s2">&quot;M0,&quot;</span> <span class="o">+</span> <span class="nx">r1</span>
+ <span class="o">+</span> <span class="s2">&quot;A&quot;</span> <span class="o">+</span> <span class="nx">r1</span> <span class="o">+</span> <span class="s2">&quot;,&quot;</span> <span class="o">+</span> <span class="nx">r1</span> <span class="o">+</span> <span class="s2">&quot; 0 1,1 0,&quot;</span> <span class="o">+</span> <span class="p">(</span><span class="o">-</span><span class="nx">r1</span><span class="p">)</span>
+ <span class="o">+</span> <span class="s2">&quot;A&quot;</span> <span class="o">+</span> <span class="nx">r1</span> <span class="o">+</span> <span class="s2">&quot;,&quot;</span> <span class="o">+</span> <span class="nx">r1</span> <span class="o">+</span> <span class="s2">&quot; 0 1,1 0,&quot;</span> <span class="o">+</span> <span class="nx">r1</span>
+ <span class="o">+</span> <span class="s2">&quot;M0,&quot;</span> <span class="o">+</span> <span class="nx">r0</span>
+ <span class="o">+</span> <span class="s2">&quot;A&quot;</span> <span class="o">+</span> <span class="nx">r0</span> <span class="o">+</span> <span class="s2">&quot;,&quot;</span> <span class="o">+</span> <span class="nx">r0</span> <span class="o">+</span> <span class="s2">&quot; 0 1,0 0,&quot;</span> <span class="o">+</span> <span class="p">(</span><span class="o">-</span><span class="nx">r0</span><span class="p">)</span>
+ <span class="o">+</span> <span class="s2">&quot;A&quot;</span> <span class="o">+</span> <span class="nx">r0</span> <span class="o">+</span> <span class="s2">&quot;,&quot;</span> <span class="o">+</span> <span class="nx">r0</span> <span class="o">+</span> <span class="s2">&quot; 0 1,0 0,&quot;</span> <span class="o">+</span> <span class="nx">r0</span>
+ <span class="o">+</span> <span class="s2">&quot;Z&quot;</span>
+ <span class="o">:</span> <span class="s2">&quot;M0,&quot;</span> <span class="o">+</span> <span class="nx">r1</span>
+ <span class="o">+</span> <span class="s2">&quot;A&quot;</span> <span class="o">+</span> <span class="nx">r1</span> <span class="o">+</span> <span class="s2">&quot;,&quot;</span> <span class="o">+</span> <span class="nx">r1</span> <span class="o">+</span> <span class="s2">&quot; 0 1,1 0,&quot;</span> <span class="o">+</span> <span class="p">(</span><span class="o">-</span><span class="nx">r1</span><span class="p">)</span>
+ <span class="o">+</span> <span class="s2">&quot;A&quot;</span> <span class="o">+</span> <span class="nx">r1</span> <span class="o">+</span> <span class="s2">&quot;,&quot;</span> <span class="o">+</span> <span class="nx">r1</span> <span class="o">+</span> <span class="s2">&quot; 0 1,1 0,&quot;</span> <span class="o">+</span> <span class="nx">r1</span>
+ <span class="o">+</span> <span class="s2">&quot;Z&quot;</span><span class="p">)</span>
+ <span class="o">:</span> <span class="p">(</span><span class="nx">r0</span>
+ <span class="o">?</span> <span class="s2">&quot;M&quot;</span> <span class="o">+</span> <span class="nx">r1</span> <span class="o">*</span> <span class="nx">c0</span> <span class="o">+</span> <span class="s2">&quot;,&quot;</span> <span class="o">+</span> <span class="nx">r1</span> <span class="o">*</span> <span class="nx">s0</span>
+ <span class="o">+</span> <span class="s2">&quot;A&quot;</span> <span class="o">+</span> <span class="nx">r1</span> <span class="o">+</span> <span class="s2">&quot;,&quot;</span> <span class="o">+</span> <span class="nx">r1</span> <span class="o">+</span> <span class="s2">&quot; 0 &quot;</span> <span class="o">+</span> <span class="nx">df</span> <span class="o">+</span> <span class="s2">&quot;,1 &quot;</span> <span class="o">+</span> <span class="nx">r1</span> <span class="o">*</span> <span class="nx">c1</span> <span class="o">+</span> <span class="s2">&quot;,&quot;</span> <span class="o">+</span> <span class="nx">r1</span> <span class="o">*</span> <span class="nx">s1</span>
+ <span class="o">+</span> <span class="s2">&quot;L&quot;</span> <span class="o">+</span> <span class="nx">r0</span> <span class="o">*</span> <span class="nx">c1</span> <span class="o">+</span> <span class="s2">&quot;,&quot;</span> <span class="o">+</span> <span class="nx">r0</span> <span class="o">*</span> <span class="nx">s1</span>
+ <span class="o">+</span> <span class="s2">&quot;A&quot;</span> <span class="o">+</span> <span class="nx">r0</span> <span class="o">+</span> <span class="s2">&quot;,&quot;</span> <span class="o">+</span> <span class="nx">r0</span> <span class="o">+</span> <span class="s2">&quot; 0 &quot;</span> <span class="o">+</span> <span class="nx">df</span> <span class="o">+</span> <span class="s2">&quot;,0 &quot;</span> <span class="o">+</span> <span class="nx">r0</span> <span class="o">*</span> <span class="nx">c0</span> <span class="o">+</span> <span class="s2">&quot;,&quot;</span> <span class="o">+</span> <span class="nx">r0</span> <span class="o">*</span> <span class="nx">s0</span>
+ <span class="o">+</span> <span class="s2">&quot;Z&quot;</span>
+ <span class="o">:</span> <span class="s2">&quot;M&quot;</span> <span class="o">+</span> <span class="nx">r1</span> <span class="o">*</span> <span class="nx">c0</span> <span class="o">+</span> <span class="s2">&quot;,&quot;</span> <span class="o">+</span> <span class="nx">r1</span> <span class="o">*</span> <span class="nx">s0</span>
+ <span class="o">+</span> <span class="s2">&quot;A&quot;</span> <span class="o">+</span> <span class="nx">r1</span> <span class="o">+</span> <span class="s2">&quot;,&quot;</span> <span class="o">+</span> <span class="nx">r1</span> <span class="o">+</span> <span class="s2">&quot; 0 &quot;</span> <span class="o">+</span> <span class="nx">df</span> <span class="o">+</span> <span class="s2">&quot;,1 &quot;</span> <span class="o">+</span> <span class="nx">r1</span> <span class="o">*</span> <span class="nx">c1</span> <span class="o">+</span> <span class="s2">&quot;,&quot;</span> <span class="o">+</span> <span class="nx">r1</span> <span class="o">*</span> <span class="nx">s1</span>
+ <span class="o">+</span> <span class="s2">&quot;L0,0&quot;</span>
+ <span class="o">+</span> <span class="s2">&quot;Z&quot;</span><span class="p">);</span>
+ <span class="p">}</span>
+
+ <span class="nx">arc</span><span class="p">.</span><span class="nx">innerRadius</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">v</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="k">return</span> <span class="nx">innerRadius</span><span class="p">;</span>
+ <span class="nx">innerRadius</span> <span class="o">=</span> <span class="nx">d3_functor</span><span class="p">(</span><span class="nx">v</span><span class="p">);</span>
+ <span class="k">return</span> <span class="nx">arc</span><span class="p">;</span>
+ <span class="p">};</span>
+
+ <span class="nx">arc</span><span class="p">.</span><span class="nx">outerRadius</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">v</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="k">return</span> <span class="nx">outerRadius</span><span class="p">;</span>
+ <span class="nx">outerRadius</span> <span class="o">=</span> <span class="nx">d3_functor</span><span class="p">(</span><span class="nx">v</span><span class="p">);</span>
+ <span class="k">return</span> <span class="nx">arc</span><span class="p">;</span>
+ <span class="p">};</span>
+
+ <span class="nx">arc</span><span class="p">.</span><span class="nx">startAngle</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">v</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="k">return</span> <span class="nx">startAngle</span><span class="p">;</span>
+ <span class="nx">startAngle</span> <span class="o">=</span> <span class="nx">d3_functor</span><span class="p">(</span><span class="nx">v</span><span class="p">);</span>
+ <span class="k">return</span> <span class="nx">arc</span><span class="p">;</span>
+ <span class="p">};</span>
+
+ <span class="nx">arc</span><span class="p">.</span><span class="nx">endAngle</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">v</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="k">return</span> <span class="nx">endAngle</span><span class="p">;</span>
+ <span class="nx">endAngle</span> <span class="o">=</span> <span class="nx">d3_functor</span><span class="p">(</span><span class="nx">v</span><span class="p">);</span>
+ <span class="k">return</span> <span class="nx">arc</span><span class="p">;</span>
+ <span class="p">};</span>
+
+ <span class="nx">arc</span><span class="p">.</span><span class="nx">centroid</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">r</span> <span class="o">=</span> <span class="p">(</span><span class="nx">innerRadius</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">)</span>
+ <span class="o">+</span> <span class="nx">outerRadius</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">))</span> <span class="o">/</span> <span class="mi">2</span><span class="p">,</span>
+ <span class="nx">a</span> <span class="o">=</span> <span class="p">(</span><span class="nx">startAngle</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">)</span>
+ <span class="o">+</span> <span class="nx">endAngle</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">))</span> <span class="o">/</span> <span class="mi">2</span> <span class="o">+</span> <span class="nx">d3_svg_arcOffset</span><span class="p">;</span>
+ <span class="k">return</span> <span class="p">[</span><span class="nb">Math</span><span class="p">.</span><span class="nx">cos</span><span class="p">(</span><span class="nx">a</span><span class="p">)</span> <span class="o">*</span> <span class="nx">r</span><span class="p">,</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">sin</span><span class="p">(</span><span class="nx">a</span><span class="p">)</span> <span class="o">*</span> <span class="nx">r</span><span class="p">];</span>
+ <span class="p">};</span>
+
+ <span class="k">return</span> <span class="nx">arc</span><span class="p">;</span>
+<span class="p">};</span>
+
+<span class="kd">var</span> <span class="nx">d3_svg_arcOffset</span> <span class="o">=</span> <span class="o">-</span><span class="nb">Math</span><span class="p">.</span><span class="nx">PI</span> <span class="o">/</span> <span class="mi">2</span><span class="p">,</span>
+ <span class="nx">d3_svg_arcMax</span> <span class="o">=</span> <span class="mi">2</span> <span class="o">*</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">PI</span> <span class="o">-</span> <span class="mi">1</span><span class="nx">e</span><span class="o">-</span><span class="mi">6</span><span class="p">;</span>
+
+<span class="kd">function</span> <span class="nx">d3_svg_arcInnerRadius</span><span class="p">(</span><span class="nx">d</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">return</span> <span class="nx">d</span><span class="p">.</span><span class="nx">innerRadius</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="kd">function</span> <span class="nx">d3_svg_arcOuterRadius</span><span class="p">(</span><span class="nx">d</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">return</span> <span class="nx">d</span><span class="p">.</span><span class="nx">outerRadius</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="kd">function</span> <span class="nx">d3_svg_arcStartAngle</span><span class="p">(</span><span class="nx">d</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">return</span> <span class="nx">d</span><span class="p">.</span><span class="nx">startAngle</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="kd">function</span> <span class="nx">d3_svg_arcEndAngle</span><span class="p">(</span><span class="nx">d</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">return</span> <span class="nx">d</span><span class="p">.</span><span class="nx">endAngle</span><span class="p">;</span>
+<span class="p">}</span>
+
+</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
12 docs/area-radial.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html> <html> <head> <title>area-radial.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="behavior.html"> behavior.js </a> <a class="source" href="drag.html"> drag.js </a> <a class="source" href="zoom.html"> zoom.js </a> <a class="source" href="date.html"> date.js </a> <a class="source" href="style.html"> style.js </a> <a class="source" href="array.html"> array.js </a> <a class="source" href="ascending.html"> ascending.js </a> <a class="source" href="bisect.html"> bisect.js </a> <a class="source" href="class.html"> class.js </a> <a class="source" href="collapse.html"> collapse.js </a> <a class="source" href="core.html"> core.js </a> <a class="source" href="descending.html"> descending.js </a> <a class="source" href="dispatch.html"> dispatch.js </a> <a class="source" href="ease.html"> ease.js </a> <a class="source" href="entries.html"> entries.js </a> <a class="source" href="event.html"> event.js </a> <a class="source" href="extent.html"> extent.js </a> <a class="source" href="first.html"> first.js </a> <a class="source" href="format.html"> format.js </a> <a class="source" href="formatPrefix.html"> formatPrefix.js </a> <a class="source" href="functor.html"> functor.js </a> <a class="source" href="hsl.html"> hsl.js </a> <a class="source" href="html.html"> html.js </a> <a class="source" href="identity.html"> identity.js </a> <a class="source" href="interpolate.html"> interpolate.js </a> <a class="source" href="json.html"> json.js </a> <a class="source" href="keys.html"> keys.js </a> <a class="source" href="last.html"> last.js </a> <a class="source" href="map.html"> map.js </a> <a class="source" href="max.html"> max.js </a> <a class="source" href="mean.html"> mean.js </a> <a class="source" href="median.html"> median.js </a> <a class="source" href="merge.html"> merge.js </a> <a class="source" href="min.html"> min.js </a> <a class="source" href="mouse.html"> mouse.js </a> <a class="source" href="nest.html"> nest.js </a> <a class="source" href="noop.html"> noop.js </a> <a class="source" href="ns.html"> ns.js </a> <a class="source" href="number.html"> number.js </a> <a class="source" href="permute.html"> permute.js </a> <a class="source" href="quantile.html"> quantile.js </a> <a class="source" href="random.html"> random.js </a> <a class="source" href="range.html"> range.js </a> <a class="source" href="rebind.html"> rebind.js </a> <a class="source" href="requote.html"> requote.js </a> <a class="source" href="rgb.html"> rgb.js </a> <a class="source" href="round.html"> round.js </a> <a class="source" href="selection-append.html"> selection-append.js </a> <a class="source" href="selection-attr.html"> selection-attr.js </a> <a class="source" href="selection-call.html"> selection-call.js </a> <a class="source" href="selection-classed.html"> selection-classed.js </a> <a class="source" href="selection-data.html"> selection-data.js </a> <a class="source" href="selection-datum.html"> selection-datum.js </a> <a class="source" href="selection-each.html"> selection-each.js </a> <a class="source" href="selection-empty.html"> selection-empty.js </a> <a class="source" href="selection-enter-select.html"> selection-enter-select.js </a> <a class="source" href="selection-enter.html"> selection-enter.js </a> <a class="source" href="selection-filter.html"> selection-filter.js </a> <a class="source" href="selection-html.html"> selection-html.js </a> <a class="source" href="selection-insert.html"> selection-insert.js </a> <a class="source" href="selection-node.html"> selection-node.js </a> <a class="source" href="selection-on.html"> selection-on.js </a> <a class="source" href="selection-order.html"> selection-order.js </a> <a class="source" href="selection-property.html"> selection-property.js </a> <a class="source" href="selection-remove.html"> selection-remove.js </a> <a class="source" href="selection-root.html"> selection-root.js </a> <a class="source" href="selection-select.html"> selection-select.js </a> <a class="source" href="selection-selectAll.html"> selection-selectAll.js </a> <a class="source" href="selection-sort.html"> selection-sort.js </a> <a class="source" href="selection-style.html"> selection-style.js </a> <a class="source" href="selection-text.html"> selection-text.js </a> <a class="source" href="selection-transition.html"> selection-transition.js </a> <a class="source" href="selection.html"> selection.js </a> <a class="source" href="split.html"> split.js </a> <a class="source" href="sum.html"> sum.js </a> <a class="source" href="text.html"> text.js </a> <a class="source" href="this.html"> this.js </a> <a class="source" href="timer.html"> timer.js </a> <a class="source" href="touches.html"> touches.js </a> <a class="source" href="transform.html"> transform.js </a> <a class="source" href="transition-attr.html"> transition-attr.js </a> <a class="source" href="transition-delay.html"> transition-delay.js </a> <a class="source" href="transition-duration.html"> transition-duration.js </a> <a class="source" href="transition-each.html"> transition-each.js </a> <a class="source" href="transition-remove.html"> transition-remove.js </a> <a class="source" href="transition-select.html"> transition-select.js </a> <a class="source" href="transition-selectAll.html"> transition-selectAll.js </a> <a class="source" href="transition-style.html"> transition-style.js </a> <a class="source" href="transition-text.html"> transition-text.js </a> <a class="source" href="transition-transition.html"> transition-transition.js </a> <a class="source" href="transition.html"> transition.js </a> <a class="source" href="transpose.html"> transpose.js </a> <a class="source" href="true.html"> true.js </a> <a class="source" href="uninterpolate.html"> uninterpolate.js </a> <a class="source" href="values.html"> values.js </a> <a class="source" href="xhr.html"> xhr.js </a> <a class="source" href="xml.html"> xml.js </a> <a class="source" href="zip.html"> zip.js </a> <a class="source" href="csv.html"> csv.js </a> <a class="source" href="format.html"> format.js </a> <a class="source" href="parse.html"> parse.js </a> <a class="source" href="albers.html"> albers.js </a> <a class="source" href="azimuthal.html"> azimuthal.js </a> <a class="source" href="bonne.html"> bonne.js </a> <a class="source" href="bounds.html"> bounds.js </a> <a class="source" href="circle.html"> circle.js </a> <a class="source" href="equirectangular.html"> equirectangular.js </a> <a class="source" href="geo.html"> geo.js </a> <a class="source" href="greatArc.html"> greatArc.js </a> <a class="source" href="greatCircle.html"> greatCircle.js </a> <a class="source" href="mercator.html"> mercator.js </a> <a class="source" href="path.html"> path.js </a> <a class="source" href="type.html"> type.js </a> <a class="source" href="contour.html"> contour.js </a> <a class="source" href="delaunay.html"> delaunay.js </a> <a class="source" href="geom.html"> geom.js </a> <a class="source" href="hull.html"> hull.js </a> <a class="source" href="polygon.html"> polygon.js </a> <a class="source" href="quadtree.html"> quadtree.js </a> <a class="source" href="voronoi.html"> voronoi.js </a> <a class="source" href="bundle.html"> bundle.js </a> <a class="source" href="chord.html"> chord.js </a> <a class="source" href="cluster.html"> cluster.js </a> <a class="source" href="force.html"> force.js </a> <a class="source" href="hierarchy.html"> hierarchy.js </a> <a class="source" href="histogram.html"> histogram.js </a> <a class="source" href="layout.html"> layout.js </a> <a class="source" href="pack.html"> pack.js </a> <a class="source" href="partition.html"> partition.js </a> <a class="source" href="pie.html"> pie.js </a> <a class="source" href="stack.html"> stack.js </a> <a class="source" href="tree.html"> tree.js </a> <a class="source" href="treemap.html"> treemap.js </a> <a class="source" href="bilinear.html"> bilinear.js </a> <a class="source" href="category.html"> category.js </a> <a class="source" href="identity.html"> identity.js </a> <a class="source" href="linear.html"> linear.js </a> <a class="source" href="log.html"> log.js </a> <a class="source" href="nice.html"> nice.js </a> <a class="source" href="ordinal.html"> ordinal.js </a> <a class="source" href="polylinear.html"> polylinear.js </a> <a class="source" href="pow.html"> pow.js </a> <a class="source" href="quantile.html"> quantile.js </a> <a class="source" href="quantize.html"> quantize.js </a> <a class="source" href="scale.html"> scale.js </a> <a class="source" href="sqrt.html"> sqrt.js </a> <a class="source" href="arc.html"> arc.js </a> <a class="source" href="area-radial.html"> area-radial.js </a> <a class="source" href="area.html"> area.js </a> <a class="source" href="axis.html"> axis.js </a> <a class="source" href="brush.html"> brush.js </a> <a class="source" href="chord.html"> chord.js </a> <a class="source" href="diagonal-radial.html"> diagonal-radial.js </a> <a class="source" href="diagonal.html"> diagonal.js </a> <a class="source" href="line-radial.html"> line-radial.js </a> <a class="source" href="line.html"> line.js </a> <a class="source" href="mouse.html"> mouse.js </a> <a class="source" href="svg.html"> svg.js </a> <a class="source" href="symbol.html"> symbol.js </a> <a class="source" href="touches.html"> touches.js </a> <a class="source" href="day.html"> day.js </a> <a class="source" href="format-iso.html"> format-iso.js </a> <a class="source" href="format-utc.html"> format-utc.js </a> <a class="source" href="format.html"> format.js </a> <a class="source" href="hour.html"> hour.js </a> <a class="source" href="interval.html"> interval.js </a> <a class="source" href="minute.html"> minute.js </a> <a class="source" href="month.html"> month.js </a> <a class="source" href="scale-utc.html"> scale-utc.js </a> <a class="source" href="scale.html"> scale.js </a> <a class="source" href="second.html"> second.js </a> <a class="source" href="time.html"> time.js </a> <a class="source" href="week.html"> week.js </a> <a class="source" href="year.html"> year.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> area-radial.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="nx">d3</span><span class="p">.</span><span class="nx">svg</span><span class="p">.</span><span class="nx">area</span><span class="p">.</span><span class="nx">radial</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">area</span> <span class="o">=</span> <span class="nx">d3_svg_area</span><span class="p">(</span><span class="nx">d3_svg_lineRadial</span><span class="p">);</span>
+ <span class="nx">area</span><span class="p">.</span><span class="nx">radius</span> <span class="o">=</span> <span class="nx">area</span><span class="p">.</span><span class="nx">x</span><span class="p">,</span> <span class="k">delete</span> <span class="nx">area</span><span class="p">.</span><span class="nx">x</span><span class="p">;</span>
+ <span class="nx">area</span><span class="p">.</span><span class="nx">innerRadius</span> <span class="o">=</span> <span class="nx">area</span><span class="p">.</span><span class="nx">x0</span><span class="p">,</span> <span class="k">delete</span> <span class="nx">area</span><span class="p">.</span><span class="nx">x0</span><span class="p">;</span>
+ <span class="nx">area</span><span class="p">.</span><span class="nx">outerRadius</span> <span class="o">=</span> <span class="nx">area</span><span class="p">.</span><span class="nx">x1</span><span class="p">,</span> <span class="k">delete</span> <span class="nx">area</span><span class="p">.</span><span class="nx">x1</span><span class="p">;</span>
+ <span class="nx">area</span><span class="p">.</span><span class="nx">angle</span> <span class="o">=</span> <span class="nx">area</span><span class="p">.</span><span class="nx">y</span><span class="p">,</span> <span class="k">delete</span> <span class="nx">area</span><span class="p">.</span><span class="nx">y</span><span class="p">;</span>
+ <span class="nx">area</span><span class="p">.</span><span class="nx">startAngle</span> <span class="o">=</span> <span class="nx">area</span><span class="p">.</span><span class="nx">y0</span><span class="p">,</span> <span class="k">delete</span> <span class="nx">area</span><span class="p">.</span><span class="nx">y0</span><span class="p">;</span>
+ <span class="nx">area</span><span class="p">.</span><span class="nx">endAngle</span> <span class="o">=</span> <span class="nx">area</span><span class="p">.</span><span class="nx">y1</span><span class="p">,</span> <span class="k">delete</span> <span class="nx">area</span><span class="p">.</span><span class="nx">y1</span><span class="p">;</span>
+ <span class="k">return</span> <span class="nx">area</span><span class="p">;</span>
+<span class="p">};</span>
+
+</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
116 docs/area.html
@@ -0,0 +1,116 @@
+<!DOCTYPE html> <html> <head> <title>area.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="behavior.html"> behavior.js </a> <a class="source" href="drag.html"> drag.js </a> <a class="source" href="zoom.html"> zoom.js </a> <a class="source" href="date.html"> date.js </a> <a class="source" href="style.html"> style.js </a> <a class="source" href="array.html"> array.js </a> <a class="source" href="ascending.html"> ascending.js </a> <a class="source" href="bisect.html"> bisect.js </a> <a class="source" href="class.html"> class.js </a> <a class="source" href="collapse.html"> collapse.js </a> <a class="source" href="core.html"> core.js </a> <a class="source" href="descending.html"> descending.js </a> <a class="source" href="dispatch.html"> dispatch.js </a> <a class="source" href="ease.html"> ease.js </a> <a class="source" href="entries.html"> entries.js </a> <a class="source" href="event.html"> event.js </a> <a class="source" href="extent.html"> extent.js </a> <a class="source" href="first.html"> first.js </a> <a class="source" href="format.html"> format.js </a> <a class="source" href="formatPrefix.html"> formatPrefix.js </a> <a class="source" href="functor.html"> functor.js </a> <a class="source" href="hsl.html"> hsl.js </a> <a class="source" href="html.html"> html.js </a> <a class="source" href="identity.html"> identity.js </a> <a class="source" href="interpolate.html"> interpolate.js </a> <a class="source" href="json.html"> json.js </a> <a class="source" href="keys.html"> keys.js </a> <a class="source" href="last.html"> last.js </a> <a class="source" href="map.html"> map.js </a> <a class="source" href="max.html"> max.js </a> <a class="source" href="mean.html"> mean.js </a> <a class="source" href="median.html"> median.js </a> <a class="source" href="merge.html"> merge.js </a> <a class="source" href="min.html"> min.js </a> <a class="source" href="mouse.html"> mouse.js </a> <a class="source" href="nest.html"> nest.js </a> <a class="source" href="noop.html"> noop.js </a> <a class="source" href="ns.html"> ns.js </a> <a class="source" href="number.html"> number.js </a> <a class="source" href="permute.html"> permute.js </a> <a class="source" href="quantile.html"> quantile.js </a> <a class="source" href="random.html"> random.js </a> <a class="source" href="range.html"> range.js </a> <a class="source" href="rebind.html"> rebind.js </a> <a class="source" href="requote.html"> requote.js </a> <a class="source" href="rgb.html"> rgb.js </a> <a class="source" href="round.html"> round.js </a> <a class="source" href="selection-append.html"> selection-append.js </a> <a class="source" href="selection-attr.html"> selection-attr.js </a> <a class="source" href="selection-call.html"> selection-call.js </a> <a class="source" href="selection-classed.html"> selection-classed.js </a> <a class="source" href="selection-data.html"> selection-data.js </a> <a class="source" href="selection-datum.html"> selection-datum.js </a> <a class="source" href="selection-each.html"> selection-each.js </a> <a class="source" href="selection-empty.html"> selection-empty.js </a> <a class="source" href="selection-enter-select.html"> selection-enter-select.js </a> <a class="source" href="selection-enter.html"> selection-enter.js </a> <a class="source" href="selection-filter.html"> selection-filter.js </a> <a class="source" href="selection-html.html"> selection-html.js </a> <a class="source" href="selection-insert.html"> selection-insert.js </a> <a class="source" href="selection-node.html"> selection-node.js </a> <a class="source" href="selection-on.html"> selection-on.js </a> <a class="source" href="selection-order.html"> selection-order.js </a> <a class="source" href="selection-property.html"> selection-property.js </a> <a class="source" href="selection-remove.html"> selection-remove.js </a> <a class="source" href="selection-root.html"> selection-root.js </a> <a class="source" href="selection-select.html"> selection-select.js </a> <a class="source" href="selection-selectAll.html"> selection-selectAll.js </a> <a class="source" href="selection-sort.html"> selection-sort.js </a> <a class="source" href="selection-style.html"> selection-style.js </a> <a class="source" href="selection-text.html"> selection-text.js </a> <a class="source" href="selection-transition.html"> selection-transition.js </a> <a class="source" href="selection.html"> selection.js </a> <a class="source" href="split.html"> split.js </a> <a class="source" href="sum.html"> sum.js </a> <a class="source" href="text.html"> text.js </a> <a class="source" href="this.html"> this.js </a> <a class="source" href="timer.html"> timer.js </a> <a class="source" href="touches.html"> touches.js </a> <a class="source" href="transform.html"> transform.js </a> <a class="source" href="transition-attr.html"> transition-attr.js </a> <a class="source" href="transition-delay.html"> transition-delay.js </a> <a class="source" href="transition-duration.html"> transition-duration.js </a> <a class="source" href="transition-each.html"> transition-each.js </a> <a class="source" href="transition-remove.html"> transition-remove.js </a> <a class="source" href="transition-select.html"> transition-select.js </a> <a class="source" href="transition-selectAll.html"> transition-selectAll.js </a> <a class="source" href="transition-style.html"> transition-style.js </a> <a class="source" href="transition-text.html"> transition-text.js </a> <a class="source" href="transition-transition.html"> transition-transition.js </a> <a class="source" href="transition.html"> transition.js </a> <a class="source" href="transpose.html"> transpose.js </a> <a class="source" href="true.html"> true.js </a> <a class="source" href="uninterpolate.html"> uninterpolate.js </a> <a class="source" href="values.html"> values.js </a> <a class="source" href="xhr.html"> xhr.js </a> <a class="source" href="xml.html"> xml.js </a> <a class="source" href="zip.html"> zip.js </a> <a class="source" href="csv.html"> csv.js </a> <a class="source" href="format.html"> format.js </a> <a class="source" href="parse.html"> parse.js </a> <a class="source" href="albers.html"> albers.js </a> <a class="source" href="azimuthal.html"> azimuthal.js </a> <a class="source" href="bonne.html"> bonne.js </a> <a class="source" href="bounds.html"> bounds.js </a> <a class="source" href="circle.html"> circle.js </a> <a class="source" href="equirectangular.html"> equirectangular.js </a> <a class="source" href="geo.html"> geo.js </a> <a class="source" href="greatArc.html"> greatArc.js </a> <a class="source" href="greatCircle.html"> greatCircle.js </a> <a class="source" href="mercator.html"> mercator.js </a> <a class="source" href="path.html"> path.js </a> <a class="source" href="type.html"> type.js </a> <a class="source" href="contour.html"> contour.js </a> <a class="source" href="delaunay.html"> delaunay.js </a> <a class="source" href="geom.html"> geom.js </a> <a class="source" href="hull.html"> hull.js </a> <a class="source" href="polygon.html"> polygon.js </a> <a class="source" href="quadtree.html"> quadtree.js </a> <a class="source" href="voronoi.html"> voronoi.js </a> <a class="source" href="bundle.html"> bundle.js </a> <a class="source" href="chord.html"> chord.js </a> <a class="source" href="cluster.html"> cluster.js </a> <a class="source" href="force.html"> force.js </a> <a class="source" href="hierarchy.html"> hierarchy.js </a> <a class="source" href="histogram.html"> histogram.js </a> <a class="source" href="layout.html"> layout.js </a> <a class="source" href="pack.html"> pack.js </a> <a class="source" href="partition.html"> partition.js </a> <a class="source" href="pie.html"> pie.js </a> <a class="source" href="stack.html"> stack.js </a> <a class="source" href="tree.html"> tree.js </a> <a class="source" href="treemap.html"> treemap.js </a> <a class="source" href="bilinear.html"> bilinear.js </a> <a class="source" href="category.html"> category.js </a> <a class="source" href="identity.html"> identity.js </a> <a class="source" href="linear.html"> linear.js </a> <a class="source" href="log.html"> log.js </a> <a class="source" href="nice.html"> nice.js </a> <a class="source" href="ordinal.html"> ordinal.js </a> <a class="source" href="polylinear.html"> polylinear.js </a> <a class="source" href="pow.html"> pow.js </a> <a class="source" href="quantile.html"> quantile.js </a> <a class="source" href="quantize.html"> quantize.js </a> <a class="source" href="scale.html"> scale.js </a> <a class="source" href="sqrt.html"> sqrt.js </a> <a class="source" href="arc.html"> arc.js </a> <a class="source" href="area-radial.html"> area-radial.js </a> <a class="source" href="area.html"> area.js </a> <a class="source" href="axis.html"> axis.js </a> <a class="source" href="brush.html"> brush.js </a> <a class="source" href="chord.html"> chord.js </a> <a class="source" href="diagonal-radial.html"> diagonal-radial.js </a> <a class="source" href="diagonal.html"> diagonal.js </a> <a class="source" href="line-radial.html"> line-radial.js </a> <a class="source" href="line.html"> line.js </a> <a class="source" href="mouse.html"> mouse.js </a> <a class="source" href="svg.html"> svg.js </a> <a class="source" href="symbol.html"> symbol.js </a> <a class="source" href="touches.html"> touches.js </a> <a class="source" href="day.html"> day.js </a> <a class="source" href="format-iso.html"> format-iso.js </a> <a class="source" href="format-utc.html"> format-utc.js </a> <a class="source" href="format.html"> format.js </a> <a class="source" href="hour.html"> hour.js </a> <a class="source" href="interval.html"> interval.js </a> <a class="source" href="minute.html"> minute.js </a> <a class="source" href="month.html"> month.js </a> <a class="source" href="scale-utc.html"> scale-utc.js </a> <a class="source" href="scale.html"> scale.js </a> <a class="source" href="second.html"> second.js </a> <a class="source" href="time.html"> time.js </a> <a class="source" href="week.html"> week.js </a> <a class="source" href="year.html"> year.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> area.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span> <span class="nx">d3_svg_area</span><span class="p">(</span><span class="nx">projection</span><span class="p">)</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">x0</span> <span class="o">=</span> <span class="nx">d3_svg_lineX</span><span class="p">,</span>
+ <span class="nx">x1</span> <span class="o">=</span> <span class="nx">d3_svg_lineX</span><span class="p">,</span>
+ <span class="nx">y0</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span>
+ <span class="nx">y1</span> <span class="o">=</span> <span class="nx">d3_svg_lineY</span><span class="p">,</span>
+ <span class="nx">defined</span> <span class="o">=</span> <span class="nx">d3_true</span><span class="p">,</span>
+ <span class="nx">interpolate</span> <span class="o">=</span> <span class="nx">d3_svg_lineInterpolatorDefault</span><span class="p">,</span>
+ <span class="nx">i0</span> <span class="o">=</span> <span class="nx">d3_svg_lineLinear</span><span class="p">,</span>
+ <span class="nx">i1</span> <span class="o">=</span> <span class="nx">d3_svg_lineLinear</span><span class="p">,</span>
+ <span class="nx">L</span> <span class="o">=</span> <span class="s2">&quot;L&quot;</span><span class="p">,</span>
+ <span class="nx">tension</span> <span class="o">=</span> <span class="p">.</span><span class="mi">7</span><span class="p">;</span>
+
+ <span class="kd">function</span> <span class="nx">area</span><span class="p">(</span><span class="nx">data</span><span class="p">)</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">segments</span> <span class="o">=</span> <span class="p">[],</span>
+ <span class="nx">points0</span> <span class="o">=</span> <span class="p">[],</span>
+ <span class="nx">points1</span> <span class="o">=</span> <span class="p">[],</span>
+ <span class="nx">i</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span>
+ <span class="nx">n</span> <span class="o">=</span> <span class="nx">data</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span>
+ <span class="nx">d</span><span class="p">,</span>
+ <span class="nx">fx0</span> <span class="o">=</span> <span class="nx">d3_functor</span><span class="p">(</span><span class="nx">x0</span><span class="p">),</span>
+ <span class="nx">fy0</span> <span class="o">=</span> <span class="nx">d3_functor</span><span class="p">(</span><span class="nx">y0</span><span class="p">),</span>
+ <span class="nx">fx1</span> <span class="o">=</span> <span class="nx">x0</span> <span class="o">===</span> <span class="nx">x1</span> <span class="o">?</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="nx">x</span><span class="p">;</span> <span class="p">}</span> <span class="o">:</span> <span class="nx">d3_functor</span><span class="p">(</span><span class="nx">x1</span><span class="p">),</span>
+ <span class="nx">fy1</span> <span class="o">=</span> <span class="nx">y0</span> <span class="o">===</span> <span class="nx">y1</span> <span class="o">?</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="nx">y</span><span class="p">;</span> <span class="p">}</span> <span class="o">:</span> <span class="nx">d3_functor</span><span class="p">(</span><span class="nx">y1</span><span class="p">),</span>
+ <span class="nx">x</span><span class="p">,</span>
+ <span class="nx">y</span><span class="p">;</span>
+
+ <span class="kd">function</span> <span class="nx">segment</span><span class="p">()</span> <span class="p">{</span>
+ <span class="nx">segments</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="s2">&quot;M&quot;</span><span class="p">,</span> <span class="nx">i0</span><span class="p">(</span><span class="nx">projection</span><span class="p">(</span><span class="nx">points1</span><span class="p">),</span> <span class="nx">tension</span><span class="p">),</span>
+ <span class="nx">L</span><span class="p">,</span> <span class="nx">i1</span><span class="p">(</span><span class="nx">projection</span><span class="p">(</span><span class="nx">points0</span><span class="p">.</span><span class="nx">reverse</span><span class="p">()),</span> <span class="nx">tension</span><span class="p">),</span>
+ <span class="s2">&quot;Z&quot;</span><span class="p">);</span>
+ <span class="p">}</span>
+
+ <span class="k">while</span> <span class="p">(</span><span class="o">++</span><span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">n</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="nx">defined</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">d</span> <span class="o">=</span> <span class="nx">data</span><span class="p">[</span><span class="nx">i</span><span class="p">],</span> <span class="nx">i</span><span class="p">))</span> <span class="p">{</span>
+ <span class="nx">points0</span><span class="p">.</span><span class="nx">push</span><span class="p">([</span><span class="nx">x</span> <span class="o">=</span> <span class="o">+</span><span class="nx">fx0</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">d</span><span class="p">,</span> <span class="nx">i</span><span class="p">),</span> <span class="nx">y</span> <span class="o">=</span> <span class="o">+</span><span class="nx">fy0</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">d</span><span class="p">,</span> <span class="nx">i</span><span class="p">)]);</span>
+ <span class="nx">points1</span><span class="p">.</span><span class="nx">push</span><span class="p">([</span><span class="o">+</span><span class="nx">fx1</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">d</span><span class="p">,</span> <span class="nx">i</span><span class="p">),</span> <span class="o">+</span><span class="nx">fy1</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">d</span><span class="p">,</span> <span class="nx">i</span><span class="p">)]);</span>
+ <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">points0</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="p">{</span>
+ <span class="nx">segment</span><span class="p">();</span>
+ <span class="nx">points0</span> <span class="o">=</span> <span class="p">[];</span>
+ <span class="nx">points1</span> <span class="o">=</span> <span class="p">[];</span>
+ <span class="p">}</span>
+ <span class="p">}</span>
+
+ <span class="k">if</span> <span class="p">(</span><span class="nx">points0</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="nx">segment</span><span class="p">();</span>
+
+ <span class="k">return</span> <span class="nx">segments</span><span class="p">.</span><span class="nx">length</span> <span class="o">?</span> <span class="nx">segments</span><span class="p">.</span><span class="nx">join</span><span class="p">(</span><span class="s2">&quot;&quot;</span><span class="p">)</span> <span class="o">:</span> <span class="kc">null</span><span class="p">;</span>
+ <span class="p">}</span>
+
+ <span class="nx">area</span><span class="p">.</span><span class="nx">x</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">_</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="k">return</span> <span class="nx">x1</span><span class="p">;</span>
+ <span class="nx">x0</span> <span class="o">=</span> <span class="nx">x1</span> <span class="o">=</span> <span class="nx">_</span><span class="p">;</span>
+ <span class="k">return</span> <span class="nx">area</span><span class="p">;</span>
+ <span class="p">};</span>
+
+ <span class="nx">area</span><span class="p">.</span><span class="nx">x0</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">_</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="k">return</span> <span class="nx">x0</span><span class="p">;</span>
+ <span class="nx">x0</span> <span class="o">=</span> <span class="nx">_</span><span class="p">;</span>
+ <span class="k">return</span> <span class="nx">area</span><span class="p">;</span>
+ <span class="p">};</span>
+
+ <span class="nx">area</span><span class="p">.</span><span class="nx">x1</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">_</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="k">return</span> <span class="nx">x1</span><span class="p">;</span>
+ <span class="nx">x1</span> <span class="o">=</span> <span class="nx">_</span><span class="p">;</span>
+ <span class="k">return</span> <span class="nx">area</span><span class="p">;</span>
+ <span class="p">};</span>
+
+ <span class="nx">area</span><span class="p">.</span><span class="nx">y</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">_</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="k">return</span> <span class="nx">y1</span><span class="p">;</span>
+ <span class="nx">y0</span> <span class="o">=</span> <span class="nx">y1</span> <span class="o">=</span> <span class="nx">_</span><span class="p">;</span>
+ <span class="k">return</span> <span class="nx">area</span><span class="p">;</span>
+ <span class="p">};</span>
+
+ <span class="nx">area</span><span class="p">.</span><span class="nx">y0</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">_</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="k">return</span> <span class="nx">y0</span><span class="p">;</span>
+ <span class="nx">y0</span> <span class="o">=</span> <span class="nx">_</span><span class="p">;</span>
+ <span class="k">return</span> <span class="nx">area</span><span class="p">;</span>
+ <span class="p">};</span>
+
+ <span class="nx">area</span><span class="p">.</span><span class="nx">y1</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">_</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="k">return</span> <span class="nx">y1</span><span class="p">;</span>
+ <span class="nx">y1</span> <span class="o">=</span> <span class="nx">_</span><span class="p">;</span>
+ <span class="k">return</span> <span class="nx">area</span><span class="p">;</span>
+ <span class="p">};</span>
+
+ <span class="nx">area</span><span class="p">.</span><span class="nx">defined</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">_</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="k">return</span> <span class="nx">defined</span><span class="p">;</span>
+ <span class="nx">defined</span> <span class="o">=</span> <span class="nx">_</span><span class="p">;</span>
+ <span class="k">return</span> <span class="nx">area</span><span class="p">;</span>
+ <span class="p">};</span>
+
+ <span class="nx">area</span><span class="p">.</span><span class="nx">interpolate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">_</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="k">return</span> <span class="nx">interpolate</span><span class="p">;</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">d3_svg_lineInterpolators</span><span class="p">.</span><span class="nx">has</span><span class="p">(</span><span class="nx">_</span> <span class="o">+=</span> <span class="s2">&quot;&quot;</span><span class="p">))</span> <span class="nx">_</span> <span class="o">=</span> <span class="nx">d3_svg_lineInterpolatorDefault</span><span class="p">;</span>
+ <span class="nx">i0</span> <span class="o">=</span> <span class="nx">d3_svg_lineInterpolators</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="nx">interpolate</span> <span class="o">=</span> <span class="nx">_</span><span class="p">);</span>
+ <span class="nx">i1</span> <span class="o">=</span> <span class="nx">i0</span><span class="p">.</span><span class="nx">reverse</span> <span class="o">||</span> <span class="nx">i0</span><span class="p">;</span>
+ <span class="nx">L</span> <span class="o">=</span> <span class="sr">/-closed$/</span><span class="p">.</span><span class="nx">test</span><span class="p">(</span><span class="nx">_</span><span class="p">)</span> <span class="o">?</span> <span class="s2">&quot;M&quot;</span> <span class="o">:</span> <span class="s2">&quot;L&quot;</span><span class="p">;</span>
+ <span class="k">return</span> <span class="nx">area</span><span class="p">;</span>
+ <span class="p">};</span>
+
+ <span class="nx">area</span><span class="p">.</span><span class="nx">tension</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">_</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="k">return</span> <span class="nx">tension</span><span class="p">;</span>
+ <span class="nx">tension</span> <span class="o">=</span> <span class="nx">_</span><span class="p">;</span>
+ <span class="k">return</span> <span class="nx">area</span><span class="p">;</span>
+ <span class="p">};</span>
+
+ <span class="k">return</span> <span class="nx">area</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="nx">d3_svg_lineStepBefore</span><span class="p">.</span><span class="nx">reverse</span> <span class="o">=</span> <span class="nx">d3_svg_lineStepAfter</span><span class="p">;</span>
+<span class="nx">d3_svg_lineStepAfter</span><span class="p">.</span><span class="nx">reverse</span> <span class="o">=</span> <span class="nx">d3_svg_lineStepBefore</span><span class="p">;</span>
+
+<span class="nx">d3</span><span class="p">.</span><span class="nx">svg</span><span class="p">.</span><span class="nx">area</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="k">return</span> <span class="nx">d3_svg_area</span><span class="p">(</span><span class="nb">Object</span><span class="p">);</span>
+<span class="p">};</span>
+
+</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
25 docs/array.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html> <html> <head> <title>array.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="behavior.html"> behavior.js </a> <a class="source" href="drag.html"> drag.js </a> <a class="source" href="zoom.html"> zoom.js </a> <a class="source" href="date.html"> date.js </a> <a class="source" href="style.html"> style.js </a> <a class="source" href="array.html"> array.js </a> <a class="source" href="ascending.html"> ascending.js </a> <a class="source" href="bisect.html"> bisect.js </a> <a class="source" href="class.html"> class.js </a> <a class="source" href="collapse.html"> collapse.js </a> <a class="source" href="core.html"> core.js </a> <a class="source" href="descending.html"> descending.js </a> <a class="source" href="dispatch.html"> dispatch.js </a> <a class="source" href="ease.html"> ease.js </a> <a class="source" href="entries.html"> entries.js </a> <a class="source" href="event.html"> event.js </a> <a class="source" href="extent.html"> extent.js </a> <a class="source" href="first.html"> first.js </a> <a class="source" href="format.html"> format.js </a> <a class="source" href="formatPrefix.html"> formatPrefix.js </a> <a class="source" href="functor.html"> functor.js </a> <a class="source" href="hsl.html"> hsl.js </a> <a class="source" href="html.html"> html.js </a> <a class="source" href="identity.html"> identity.js </a> <a class="source" href="interpolate.html"> interpolate.js </a> <a class="source" href="json.html"> json.js </a> <a class="source" href="keys.html"> keys.js </a> <a class="source" href="last.html"> last.js </a> <a class="source" href="map.html"> map.js </a> <a class="source" href="max.html"> max.js </a> <a class="source" href="mean.html"> mean.js </a> <a class="source" href="median.html"> median.js </a> <a class="source" href="merge.html"> merge.js </a> <a class="source" href="min.html"> min.js </a> <a class="source" href="mouse.html"> mouse.js </a> <a class="source" href="nest.html"> nest.js </a> <a class="source" href="noop.html"> noop.js </a> <a class="source" href="ns.html"> ns.js </a> <a class="source" href="number.html"> number.js </a> <a class="source" href="permute.html"> permute.js </a> <a class="source" href="quantile.html"> quantile.js </a> <a class="source" href="random.html"> random.js </a> <a class="source" href="range.html"> range.js </a> <a class="source" href="rebind.html"> rebind.js </a> <a class="source" href="requote.html"> requote.js </a> <a class="source" href="rgb.html"> rgb.js </a> <a class="source" href="round.html"> round.js </a> <a class="source" href="selection-append.html"> selection-append.js </a> <a class="source" href="selection-attr.html"> selection-attr.js </a> <a class="source" href="selection-call.html"> selection-call.js </a> <a class="source" href="selection-classed.html"> selection-classed.js </a> <a class="source" href="selection-data.html"> selection-data.js </a> <a class="source" href="selection-datum.html"> selection-datum.js </a> <a class="source" href="selection-each.html"> selection-each.js </a> <a class="source" href="selection-empty.html"> selection-empty.js </a> <a class="source" href="selection-enter-select.html"> selection-enter-select.js </a> <a class="source" href="selection-enter.html"> selection-enter.js </a> <a class="source" href="selection-filter.html"> selection-filter.js </a> <a class="source" href="selection-html.html"> selection-html.js </a> <a class="source" href="selection-insert.html"> selection-insert.js </a> <a class="source" href="selection-node.html"> selection-node.js </a> <a class="source" href="selection-on.html"> selection-on.js </a> <a class="source" href="selection-order.html"> selection-order.js </a> <a class="source" href="selection-property.html"> selection-property.js </a> <a class="source" href="selection-remove.html"> selection-remove.js </a> <a class="source" href="selection-root.html"> selection-root.js </a> <a class="source" href="selection-select.html"> selection-select.js </a> <a class="source" href="selection-selectAll.html"> selection-selectAll.js </a> <a class="source" href="selection-sort.html"> selection-sort.js </a> <a class="source" href="selection-style.html"> selection-style.js </a> <a class="source" href="selection-text.html"> selection-text.js </a> <a class="source" href="selection-transition.html"> selection-transition.js </a> <a class="source" href="selection.html"> selection.js </a> <a class="source" href="split.html"> split.js </a> <a class="source" href="sum.html"> sum.js </a> <a class="source" href="text.html"> text.js </a> <a class="source" href="this.html"> this.js </a> <a class="source" href="timer.html"> timer.js </a> <a class="source" href="touches.html"> touches.js </a> <a class="source" href="transform.html"> transform.js </a> <a class="source" href="transition-attr.html"> transition-attr.js </a> <a class="source" href="transition-delay.html"> transition-delay.js </a> <a class="source" href="transition-duration.html"> transition-duration.js </a> <a class="source" href="transition-each.html"> transition-each.js </a> <a class="source" href="transition-remove.html"> transition-remove.js </a> <a class="source" href="transition-select.html"> transition-select.js </a> <a class="source" href="transition-selectAll.html"> transition-selectAll.js </a> <a class="source" href="transition-style.html"> transition-style.js </a> <a class="source" href="transition-text.html"> transition-text.js </a> <a class="source" href="transition-transition.html"> transition-transition.js </a> <a class="source" href="transition.html"> transition.js </a> <a class="source" href="transpose.html"> transpose.js </a> <a class="source" href="true.html"> true.js </a> <a class="source" href="uninterpolate.html"> uninterpolate.js </a> <a class="source" href="values.html"> values.js </a> <a class="source" href="xhr.html"> xhr.js </a> <a class="source" href="xml.html"> xml.js </a> <a class="source" href="zip.html"> zip.js </a> <a class="source" href="csv.html"> csv.js </a> <a class="source" href="format.html"> format.js </a> <a class="source" href="parse.html"> parse.js </a> <a class="source" href="albers.html"> albers.js </a> <a class="source" href="azimuthal.html"> azimuthal.js </a> <a class="source" href="bonne.html"> bonne.js </a> <a class="source" href="bounds.html"> bounds.js </a> <a class="source" href="circle.html"> circle.js </a> <a class="source" href="equirectangular.html"> equirectangular.js </a> <a class="source" href="geo.html"> geo.js </a> <a class="source" href="greatArc.html"> greatArc.js </a> <a class="source" href="greatCircle.html"> greatCircle.js </a> <a class="source" href="mercator.html"> mercator.js </a> <a class="source" href="path.html"> path.js </a> <a class="source" href="type.html"> type.js </a> <a class="source" href="contour.html"> contour.js </a> <a class="source" href="delaunay.html"> delaunay.js </a> <a class="source" href="geom.html"> geom.js </a> <a class="source" href="hull.html"> hull.js </a> <a class="source" href="polygon.html"> polygon.js </a> <a class="source" href="quadtree.html"> quadtree.js </a> <a class="source" href="voronoi.html"> voronoi.js </a> <a class="source" href="bundle.html"> bundle.js </a> <a class="source" href="chord.html"> chord.js </a> <a class="source" href="cluster.html"> cluster.js </a> <a class="source" href="force.html"> force.js </a> <a class="source" href="hierarchy.html"> hierarchy.js </a> <a class="source" href="histogram.html"> histogram.js </a> <a class="source" href="layout.html"> layout.js </a> <a class="source" href="pack.html"> pack.js </a> <a class="source" href="partition.html"> partition.js </a> <a class="source" href="pie.html"> pie.js </a> <a class="source" href="stack.html"> stack.js </a> <a class="source" href="tree.html"> tree.js </a> <a class="source" href="treemap.html"> treemap.js </a> <a class="source" href="bilinear.html"> bilinear.js </a> <a class="source" href="category.html"> category.js </a> <a class="source" href="identity.html"> identity.js </a> <a class="source" href="linear.html"> linear.js </a> <a class="source" href="log.html"> log.js </a> <a class="source" href="nice.html"> nice.js </a> <a class="source" href="ordinal.html"> ordinal.js </a> <a class="source" href="polylinear.html"> polylinear.js </a> <a class="source" href="pow.html"> pow.js </a> <a class="source" href="quantile.html"> quantile.js </a> <a class="source" href="quantize.html"> quantize.js </a> <a class="source" href="scale.html"> scale.js </a> <a class="source" href="sqrt.html"> sqrt.js </a> <a class="source" href="arc.html"> arc.js </a> <a class="source" href="area-radial.html"> area-radial.js </a> <a class="source" href="area.html"> area.js </a> <a class="source" href="axis.html"> axis.js </a> <a class="source" href="brush.html"> brush.js </a> <a class="source" href="chord.html"> chord.js </a> <a class="source" href="diagonal-radial.html"> diagonal-radial.js </a> <a class="source" href="diagonal.html"> diagonal.js </a> <a class="source" href="line-radial.html"> line-radial.js </a> <a class="source" href="line.html"> line.js </a> <a class="source" href="mouse.html"> mouse.js </a> <a class="source" href="svg.html"> svg.js </a> <a class="source" href="symbol.html"> symbol.js </a> <a class="source" href="touches.html"> touches.js </a> <a class="source" href="day.html"> day.js </a> <a class="source" href="format-iso.html"> format-iso.js </a> <a class="source" href="format-utc.html"> format-utc.js </a> <a class="source" href="format.html"> format.js </a> <a class="source" href="hour.html"> hour.js </a> <a class="source" href="interval.html"> interval.js </a> <a class="source" href="minute.html"> minute.js </a> <a class="source" href="month.html"> month.js </a> <a class="source" href="scale-utc.html"> scale-utc.js </a> <a class="source" href="scale.html"> scale.js </a> <a class="source" href="second.html"> second.js </a> <a class="source" href="time.html"> time.js </a> <a class="source" href="week.html"> week.js </a> <a class="source" href="year.html"> year.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> array.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="kd">var</span> <span class="nx">d3_array</span> <span class="o">=</span> <span class="nx">d3_arraySlice</span><span class="p">;</span> <span class="c1">// conversion for NodeLists</span>
+
+<span class="kd">function</span> <span class="nx">d3_arrayCopy</span><span class="p">(</span><span class="nx">pseudoarray</span><span class="p">)</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="nx">n</span> <span class="o">=</span> <span class="nx">pseudoarray</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span> <span class="nx">array</span> <span class="o">=</span> <span class="p">[];</span>
+ <span class="k">while</span> <span class="p">(</span><span class="o">++</span><span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">n</span><span class="p">)</span> <span class="nx">array</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">pseudoarray</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
+ <span class="k">return</span> <span class="nx">array</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="kd">function</span> <span class="nx">d3_arraySlice</span><span class="p">(</span><span class="nx">pseudoarray</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">return</span> <span class="nb">Array</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">slice</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">pseudoarray</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="k">try</span> <span class="p">{</span>
+ <span class="nx">d3_array</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">documentElement</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">)[</span><span class="mi">0</span><span class="p">].</span><span class="nx">nodeType</span><span class="p">;</span>
+<span class="p">}</span> <span class="k">catch</span><span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
+ <span class="nx">d3_array</span> <span class="o">=</span> <span class="nx">d3_arrayCopy</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="kd">var</span> <span class="nx">d3_arraySubclass</span> <span class="o">=</span> <span class="p">[].</span><span class="nx">__proto__</span><span class="o">?</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>Until ECMAScript supports array subclassing, prototype injection works well.</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span><span class="p">(</span><span class="nx">array</span><span class="p">,</span> <span class="nx">prototype</span><span class="p">)</span> <span class="p">{</span>
+ <span class="nx">array</span><span class="p">.</span><span class="nx">__proto__</span> <span class="o">=</span> <span class="nx">prototype</span><span class="p">;</span>
+<span class="p">}</span><span class="o">:</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>And if your browser doesn't support <strong>proto</strong>, we'll use direct extension.</p> </td> <td class="code"> <div class="highlight"><pre><span class="kd">function</span><span class="p">(</span><span class="nx">array</span><span class="p">,</span> <span class="nx">prototype</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">property</span> <span class="k">in</span> <span class="nx">prototype</span><span class="p">)</span> <span class="nx">array</span><span class="p">[</span><span class="nx">property</span><span class="p">]</span> <span class="o">=</span> <span class="nx">prototype</span><span class="p">[</span><span class="nx">property</span><span class="p">];</span>
+<span class="p">};</span>
+
+</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
5 docs/ascending.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html> <html> <head> <title>ascending.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="behavior.html"> behavior.js </a> <a class="source" href="drag.html"> drag.js </a> <a class="source" href="zoom.html"> zoom.js </a> <a class="source" href="date.html"> date.js </a> <a class="source" href="style.html"> style.js </a> <a class="source" href="array.html"> array.js </a> <a class="source" href="ascending.html"> ascending.js </a> <a class="source" href="bisect.html"> bisect.js </a> <a class="source" href="class.html"> class.js </a> <a class="source" href="collapse.html"> collapse.js </a> <a class="source" href="core.html"> core.js </a> <a class="source" href="descending.html"> descending.js </a> <a class="source" href="dispatch.html"> dispatch.js </a> <a class="source" href="ease.html"> ease.js </a> <a class="source" href="entries.html"> entries.js </a> <a class="source" href="event.html"> event.js </a> <a class="source" href="extent.html"> extent.js </a> <a class="source" href="first.html"> first.js </a> <a class="source" href="format.html"> format.js </a> <a class="source" href="formatPrefix.html"> formatPrefix.js </a> <a class="source" href="functor.html"> functor.js </a> <a class="source" href="hsl.html"> hsl.js </a> <a class="source" href="html.html"> html.js </a> <a class="source" href="identity.html"> identity.js </a> <a class="source" href="interpolate.html"> interpolate.js </a> <a class="source" href="json.html"> json.js </a> <a class="source" href="keys.html"> keys.js </a> <a class="source" href="last.html"> last.js </a> <a class="source" href="map.html"> map.js </a> <a class="source" href="max.html"> max.js </a> <a class="source" href="mean.html"> mean.js </a> <a class="source" href="median.html"> median.js </a> <a class="source" href="merge.html"> merge.js </a> <a class="source" href="min.html"> min.js </a> <a class="source" href="mouse.html"> mouse.js </a> <a class="source" href="nest.html"> nest.js </a> <a class="source" href="noop.html"> noop.js </a> <a class="source" href="ns.html"> ns.js </a> <a class="source" href="number.html"> number.js </a> <a class="source" href="permute.html"> permute.js </a> <a class="source" href="quantile.html"> quantile.js </a> <a class="source" href="random.html"> random.js </a> <a class="source" href="range.html"> range.js </a> <a class="source" href="rebind.html"> rebind.js </a> <a class="source" href="requote.html"> requote.js </a> <a class="source" href="rgb.html"> rgb.js </a> <a class="source" href="round.html"> round.js </a> <a class="source" href="selection-append.html"> selection-append.js </a> <a class="source" href="selection-attr.html"> selection-attr.js </a> <a class="source" href="selection-call.html"> selection-call.js </a> <a class="source" href="selection-classed.html"> selection-classed.js </a> <a class="source" href="selection-data.html"> selection-data.js </a> <a class="source" href="selection-datum.html"> selection-datum.js </a> <a class="source" href="selection-each.html"> selection-each.js </a> <a class="source" href="selection-empty.html"> selection-empty.js </a> <a class="source" href="selection-enter-select.html"> selection-enter-select.js </a> <a class="source" href="selection-enter.html"> selection-enter.js </a> <a class="source" href="selection-filter.html"> selection-filter.js </a> <a class="source" href="selection-html.html"> selection-html.js </a> <a class="source" href="selection-insert.html"> selection-insert.js </a> <a class="source" href="selection-node.html"> selection-node.js </a> <a class="source" href="selection-on.html"> selection-on.js </a> <a class="source" href="selection-order.html"> selection-order.js </a> <a class="source" href="selection-property.html"> selection-property.js </a> <a class="source" href="selection-remove.html"> selection-remove.js </a> <a class="source" href="selection-root.html"> selection-root.js </a> <a class="source" href="selection-select.html"> selection-select.js </a> <a class="source" href="selection-selectAll.html"> selection-selectAll.js </a> <a class="source" href="selection-sort.html"> selection-sort.js </a> <a class="source" href="selection-style.html"> selection-style.js </a> <a class="source" href="selection-text.html"> selection-text.js </a> <a class="source" href="selection-transition.html"> selection-transition.js </a> <a class="source" href="selection.html"> selection.js </a> <a class="source" href="split.html"> split.js </a> <a class="source" href="sum.html"> sum.js </a> <a class="source" href="text.html"> text.js </a> <a class="source" href="this.html"> this.js </a> <a class="source" href="timer.html"> timer.js </a> <a class="source" href="touches.html"> touches.js </a> <a class="source" href="transform.html"> transform.js </a> <a class="source" href="transition-attr.html"> transition-attr.js </a> <a class="source" href="transition-delay.html"> transition-delay.js </a> <a class="source" href="transition-duration.html"> transition-duration.js </a> <a class="source" href="transition-each.html"> transition-each.js </a> <a class="source" href="transition-remove.html"> transition-remove.js </a> <a class="source" href="transition-select.html"> transition-select.js </a> <a class="source" href="transition-selectAll.html"> transition-selectAll.js </a> <a class="source" href="transition-style.html"> transition-style.js </a> <a class="source" href="transition-text.html"> transition-text.js </a> <a class="source" href="transition-transition.html"> transition-transition.js </a> <a class="source" href="transition.html"> transition.js </a> <a class="source" href="transpose.html"> transpose.js </a> <a class="source" href="true.html"> true.js </a> <a class="source" href="uninterpolate.html"> uninterpolate.js </a> <a class="source" href="values.html"> values.js </a> <a class="source" href="xhr.html"> xhr.js </a> <a class="source" href="xml.html"> xml.js </a> <a class="source" href="zip.html"> zip.js </a> <a class="source" href="csv.html"> csv.js </a> <a class="source" href="format.html"> format.js </a> <a class="source" href="parse.html"> parse.js </a> <a class="source" href="albers.html"> albers.js </a> <a class="source" href="azimuthal.html"> azimuthal.js </a> <a class="source" href="bonne.html"> bonne.js </a> <a class="source" href="bounds.html"> bounds.js </a> <a class="source" href="circle.html"> circle.js </a> <a class="source" href="equirectangular.html"> equirectangular.js </a> <a class="source" href="geo.html"> geo.js </a> <a class="source" href="greatArc.html"> greatArc.js </a> <a class="source" href="greatCircle.html"> greatCircle.js </a> <a class="source" href="mercator.html"> mercator.js </a> <a class="source" href="path.html"> path.js </a> <a class="source" href="type.html"> type.js </a> <a class="source" href="contour.html"> contour.js </a> <a class="source" href="delaunay.html"> delaunay.js </a> <a class="source" href="geom.html"> geom.js </a> <a class="source" href="hull.html"> hull.js </a> <a class="source" href="polygon.html"> polygon.js </a> <a class="source" href="quadtree.html"> quadtree.js </a> <a class="source" href="voronoi.html"> voronoi.js </a> <a class="source" href="bundle.html"> bundle.js </a> <a class="source" href="chord.html"> chord.js </a> <a class="source" href="cluster.html"> cluster.js </a> <a class="source" href="force.html"> force.js </a> <a class="source" href="hierarchy.html"> hierarchy.js </a> <a class="source" href="histogram.html"> histogram.js </a> <a class="source" href="layout.html"> layout.js </a> <a class="source" href="pack.html"> pack.js </a> <a class="source" href="partition.html"> partition.js </a> <a class="source" href="pie.html"> pie.js </a> <a class="source" href="stack.html"> stack.js </a> <a class="source" href="tree.html"> tree.js </a> <a class="source" href="treemap.html"> treemap.js </a> <a class="source" href="bilinear.html"> bilinear.js </a> <a class="source" href="category.html"> category.js </a> <a class="source" href="identity.html"> identity.js </a> <a class="source" href="linear.html"> linear.js </a> <a class="source" href="log.html"> log.js </a> <a class="source" href="nice.html"> nice.js </a> <a class="source" href="ordinal.html"> ordinal.js </a> <a class="source" href="polylinear.html"> polylinear.js </a> <a class="source" href="pow.html"> pow.js </a> <a class="source" href="quantile.html"> quantile.js </a> <a class="source" href="quantize.html"> quantize.js </a> <a class="source" href="scale.html"> scale.js </a> <a class="source" href="sqrt.html"> sqrt.js </a> <a class="source" href="arc.html"> arc.js </a> <a class="source" href="area-radial.html"> area-radial.js </a> <a class="source" href="area.html"> area.js </a> <a class="source" href="axis.html"> axis.js </a> <a class="source" href="brush.html"> brush.js </a> <a class="source" href="chord.html"> chord.js </a> <a class="source" href="diagonal-radial.html"> diagonal-radial.js </a> <a class="source" href="diagonal.html"> diagonal.js </a> <a class="source" href="line-radial.html"> line-radial.js </a> <a class="source" href="line.html"> line.js </a> <a class="source" href="mouse.html"> mouse.js </a> <a class="source" href="svg.html"> svg.js </a> <a class="source" href="symbol.html"> symbol.js </a> <a class="source" href="touches.html"> touches.js </a> <a class="source" href="day.html"> day.js </a> <a class="source" href="format-iso.html"> format-iso.js </a> <a class="source" href="format-utc.html"> format-utc.js </a> <a class="source" href="format.html"> format.js </a> <a class="source" href="hour.html"> hour.js </a> <a class="source" href="interval.html"> interval.js </a> <a class="source" href="minute.html"> minute.js </a> <a class="source" href="month.html"> month.js </a> <a class="source" href="scale-utc.html"> scale-utc.js </a> <a class="source" href="scale.html"> scale.js </a> <a class="source" href="second.html"> second.js </a> <a class="source" href="time.html"> time.js </a> <a class="source" href="week.html"> week.js </a> <a class="source" href="year.html"> year.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> ascending.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="nx">d3</span><span class="p">.</span><span class="nx">ascending</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">a</span><span class="p">,</span> <span class="nx">b</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">return</span> <span class="nx">a</span> <span class="o">&lt;</span> <span class="nx">b</span> <span class="o">?</span> <span class="o">-</span><span class="mi">1</span> <span class="o">:</span> <span class="nx">a</span> <span class="o">&gt;</span> <span class="nx">b</span> <span class="o">?</span> <span class="mi">1</span> <span class="o">:</span> <span class="nx">a</span> <span class="o">&gt;=</span> <span class="nx">b</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="kc">NaN</span><span class="p">;</span>
+<span class="p">};</span>
+
+</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
View
186 docs/axis.html
@@ -0,0 +1,186 @@
+<!DOCTYPE html> <html> <head> <title>axis.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="behavior.html"> behavior.js </a> <a class="source" href="drag.html"> drag.js </a> <a class="source" href="zoom.html"> zoom.js </a> <a class="source" href="date.html"> date.js </a> <a class="source" href="style.html"> style.js </a> <a class="source" href="array.html"> array.js </a> <a class="source" href="ascending.html"> ascending.js </a> <a class="source" href="bisect.html"> bisect.js </a> <a class="source" href="class.html"> class.js </a> <a class="source" href="collapse.html"> collapse.js </a> <a class="source" href="core.html"> core.js </a> <a class="source" href="descending.html"> descending.js </a> <a class="source" href="dispatch.html"> dispatch.js </a> <a class="source" href="ease.html"> ease.js </a> <a class="source" href="entries.html"> entries.js </a> <a class="source" href="event.html"> event.js </a> <a class="source" href="extent.html"> extent.js </a> <a class="source" href="first.html"> first.js </a> <a class="source" href="format.html"> format.js </a> <a class="source" href="formatPrefix.html"> formatPrefix.js </a> <a class="source" href="functor.html"> functor.js </a> <a class="source" href="hsl.html"> hsl.js </a> <a class="source" href="html.html"> html.js </a> <a class="source" href="identity.html"> identity.js </a> <a class="source" href="interpolate.html"> interpolate.js </a> <a class="source" href="json.html"> json.js </a> <a class="source" href="keys.html"> keys.js </a> <a class="source" href="last.html"> last.js </a> <a class="source" href="map.html"> map.js </a> <a class="source" href="max.html"> max.js </a> <a class="source" href="mean.html"> mean.js </a> <a class="source" href="median.html"> median.js </a> <a class="source" href="merge.html"> merge.js </a> <a class="source" href="min.html"> min.js </a> <a class="source" href="mouse.html"> mouse.js </a> <a class="source" href="nest.html"> nest.js </a> <a class="source" href="noop.html"> noop.js </a> <a class="source" href="ns.html"> ns.js </a> <a class="source" href="number.html"> number.js </a> <a class="source" href="permute.html"> permute.js </a> <a class="source" href="quantile.html"> quantile.js </a> <a class="source" href="random.html"> random.js </a> <a class="source" href="range.html"> range.js </a> <a class="source" href="rebind.html"> rebind.js </a> <a class="source" href="requote.html"> requote.js </a> <a class="source" href="rgb.html"> rgb.js </a> <a class="source" href="round.html"> round.js </a> <a class="source" href="selection-append.html"> selection-append.js </a> <a class="source" href="selection-attr.html"> selection-attr.js </a> <a class="source" href="selection-call.html"> selection-call.js </a> <a class="source" href="selection-classed.html"> selection-classed.js </a> <a class="source" href="selection-data.html"> selection-data.js </a> <a class="source" href="selection-datum.html"> selection-datum.js </a> <a class="source" href="selection-each.html"> selection-each.js </a> <a class="source" href="selection-empty.html"> selection-empty.js </a> <a class="source" href="selection-enter-select.html"> selection-enter-select.js </a> <a class="source" href="selection-enter.html"> selection-enter.js </a> <a class="source" href="selection-filter.html"> selection-filter.js </a> <a class="source" href="selection-html.html"> selection-html.js </a> <a class="source" href="selection-insert.html"> selection-insert.js </a> <a class="source" href="selection-node.html"> selection-node.js </a> <a class="source" href="selection-on.html"> selection-on.js </a> <a class="source" href="selection-order.html"> selection-order.js </a> <a class="source" href="selection-property.html"> selection-property.js </a> <a class="source" href="selection-remove.html"> selection-remove.js </a> <a class="source" href="selection-root.html"> selection-root.js </a> <a class="source" href="selection-select.html"> selection-select.js </a> <a class="source" href="selection-selectAll.html"> selection-selectAll.js </a> <a class="source" href="selection-sort.html"> selection-sort.js </a> <a class="source" href="selection-style.html"> selection-style.js </a> <a class="source" href="selection-text.html"> selection-text.js </a> <a class="source" href="selection-transition.html"> selection-transition.js </a> <a class="source" href="selection.html"> selection.js </a> <a class="source" href="split.html"> split.js </a> <a class="source" href="sum.html"> sum.js </a> <a class="source" href="text.html"> text.js </a> <a class="source" href="this.html"> this.js </a> <a class="source" href="timer.html"> timer.js </a> <a class="source" href="touches.html"> touches.js </a> <a class="source" href="transform.html"> transform.js </a> <a class="source" href="transition-attr.html"> transition-attr.js </a> <a class="source" href="transition-delay.html"> transition-delay.js </a> <a class="source" href="transition-duration.html"> transition-duration.js </a> <a class="source" href="transition-each.html"> transition-each.js </a> <a class="source" href="transition-remove.html"> transition-remove.js </a> <a class="source" href="transition-select.html"> transition-select.js </a> <a class="source" href="transition-selectAll.html"> transition-selectAll.js </a> <a class="source" href="transition-style.html"> transition-style.js </a> <a class="source" href="transition-text.html"> transition-text.js </a> <a class="source" href="transition-transition.html"> transition-transition.js </a> <a class="source" href="transition.html"> transition.js </a> <a class="source" href="transpose.html"> transpose.js </a> <a class="source" href="true.html"> true.js </a> <a class="source" href="uninterpolate.html"> uninterpolate.js </a> <a class="source" href="values.html"> values.js </a> <a class="source" href="xhr.html"> xhr.js </a> <a class="source" href="xml.html"> xml.js </a> <a class="source" href="zip.html"> zip.js </a> <a class="source" href="csv.html"> csv.js </a> <a class="source" href="format.html"> format.js </a> <a class="source" href="parse.html"> parse.js </a> <a class="source" href="albers.html"> albers.js </a> <a class="source" href="azimuthal.html"> azimuthal.js </a> <a class="source" href="bonne.html"> bonne.js </a> <a class="source" href="bounds.html"> bounds.js </a> <a class="source" href="circle.html"> circle.js </a> <a class="source" href="equirectangular.html"> equirectangular.js </a> <a class="source" href="geo.html"> geo.js </a> <a class="source" href="greatArc.html"> greatArc.js </a> <a class="source" href="greatCircle.html"> greatCircle.js </a> <a class="source" href="mercator.html"> mercator.js </a> <a class="source" href="path.html"> path.js </a> <a class="source" href="type.html"> type.js </a> <a class="source" href="contour.html"> contour.js </a> <a class="source" href="delaunay.html"> delaunay.js </a> <a class="source" href="geom.html"> geom.js </a> <a class="source" href="hull.html"> hull.js </a> <a class="source" href="polygon.html"> polygon.js </a> <a class="source" href="quadtree.html"> quadtree.js </a> <a class="source" href="voronoi.html"> voronoi.js </a> <a class="source" href="bundle.html"> bundle.js </a> <a class="source" href="chord.html"> chord.js </a> <a class="source" href="cluster.html"> cluster.js </a> <a class="source" href="force.html"> force.js </a> <a class="source" href="hierarchy.html"> hierarchy.js </a> <a class="source" href="histogram.html"> histogram.js </a> <a class="source" href="layout.html"> layout.js </a> <a class="source" href="pack.html"> pack.js </a> <a class="source" href="partition.html"> partition.js </a> <a class="source" href="pie.html"> pie.js </a> <a class="source" href="stack.html"> stack.js </a> <a class="source" href="tree.html"> tree.js </a> <a class="source" href="treemap.html"> treemap.js </a> <a class="source" href="bilinear.html"> bilinear.js </a> <a class="source" href="category.html"> category.js </a> <a class="source" href="identity.html"> identity.js </a> <a class="source" href="linear.html"> linear.js </a> <a class="source" href="log.html"> log.js </a> <a class="source" href="nice.html"> nice.js </a> <a class="source" href="ordinal.html"> ordinal.js </a> <a class="source" href="polylinear.html"> polylinear.js </a> <a class="source" href="pow.html"> pow.js </a> <a class="source" href="quantile.html"> quantile.js </a> <a class="source" href="quantize.html"> quantize.js </a> <a class="source" href="scale.html"> scale.js </a> <a class="source" href="sqrt.html"> sqrt.js </a> <a class="source" href="arc.html"> arc.js </a> <a class="source" href="area-radial.html"> area-radial.js </a> <a class="source" href="area.html"> area.js </a> <a class="source" href="axis.html"> axis.js </a> <a class="source" href="brush.html"> brush.js </a> <a class="source" href="chord.html"> chord.js </a> <a class="source" href="diagonal-radial.html"> diagonal-radial.js </a> <a class="source" href="diagonal.html"> diagonal.js </a> <a class="source" href="line-radial.html"> line-radial.js </a> <a class="source" href="line.html"> line.js </a> <a class="source" href="mouse.html"> mouse.js </a> <a class="source" href="svg.html"> svg.js </a> <a class="source" href="symbol.html"> symbol.js </a> <a class="source" href="touches.html"> touches.js </a> <a class="source" href="day.html"> day.js </a> <a class="source" href="format-iso.html"> format-iso.js </a> <a class="source" href="format-utc.html"> format-utc.js </a> <a class="source" href="format.html"> format.js </a> <a class="source" href="hour.html"> hour.js </a> <a class="source" href="interval.html"> interval.js </a> <a class="source" href="minute.html"> minute.js </a> <a class="source" href="month.html"> month.js </a> <a class="source" href="scale-utc.html"> scale-utc.js </a> <a class="source" href="scale.html"> scale.js </a> <a class="source" href="second.html"> second.js </a> <a class="source" href="time.html"> time.js </a> <a class="source" href="week.html"> week.js </a> <a class="source" href="year.html"> year.js </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> axis.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="nx">d3</span><span class="p">.</span><span class="nx">svg</span><span class="p">.</span><span class="nx">axis</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">scale</span> <span class="o">=</span> <span class="nx">d3</span><span class="p">.</span><span class="nx">scale</span><span class="p">.</span><span class="nx">linear</span><span class="p">(),</span>
+ <span class="nx">orient</span> <span class="o">=</span> <span class="s2">&quot;bottom&quot;</span><span class="p">,</span>
+ <span class="nx">tickMajorSize</span> <span class="o">=</span> <span class="mi">6</span><span class="p">,</span>
+ <span class="nx">tickMinorSize</span> <span class="o">=</span> <span class="mi">6</span><span class="p">,</span>
+ <span class="nx">tickEndSize</span> <span class="o">=</span> <span class="mi">6</span><span class="p">,</span>
+ <span class="nx">tickPadding</span> <span class="o">=</span> <span class="mi">3</span><span class="p">,</span>
+ <span class="nx">tickArguments_</span> <span class="o">=</span> <span class="p">[</span><span class="mi">10</span><span class="p">],</span>
+ <span class="nx">tickValues</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span>
+ <span class="nx">tickFormat_</span><span class="p">,</span>
+ <span class="nx">tickSubdivide</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+
+ <span class="kd">function</span> <span class="nx">axis</span><span class="p">(</span><span class="nx">g</span><span class="p">)</span> <span class="p">{</span>
+ <span class="nx">g</span><span class="p">.</span><span class="nx">each</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
+ <span class="kd">var</span> <span class="nx">g</span> <span class="o">=</span> <span class="nx">d3</span><span class="p">.</span><span class="nx">select</span><span class="p">(</span><span class="k">this</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>Ticks, or domain values for ordinal scales.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">ticks</span> <span class="o">=</span> <span class="nx">tickValues</span> <span class="o">==</span> <span class="kc">null</span> <span class="o">?</span> <span class="p">(</span><span class="nx">scale</span><span class="p">.</span><span class="nx">ticks</span> <span class="o">?</span> <span class="nx">scale</span><span class="p">.</span><span class="nx">ticks</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="nx">scale</span><span class="p">,</span> <span class="nx">tickArguments_</span><span class="p">)</span> <span class="o">:</span> <span class="nx">scale</span><span class="p">.</span><span class="nx">domain</span><span class="p">())</span> <span class="o">:</span> <span class="nx">tickValues</span><span class="p">,</span>
+ <span class="nx">tickFormat</span> <span class="o">=</span> <span class="nx">tickFormat_</span> <span class="o">==</span> <span class="kc">null</span> <span class="o">?</span> <span class="p">(</span><span class="nx">scale</span><span class="p">.</span><span class="nx">tickFormat</span> <span class="o">?</span> <span class="nx">scale</span><span class="p">.</span><span class="nx">tickFormat</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="nx">scale</span><span class="p">,</span> <span class="nx">tickArguments_</span><span class="p">)</span> <span class="o">:</span> <span class="nb">String</span><span class="p">)</span> <span class="o">:</span> <span class="nx">tickFormat_</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>Minor ticks.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">subticks</span> <span class="o">=</span> <span class="nx">d3_svg_axisSubdivide</span><span class="p">(</span><span class="nx">scale</span><span class="p">,</span> <span class="nx">ticks</span><span class="p">,</span> <span class="nx">tickSubdivide</span><span class="p">),</span>
+ <span class="nx">subtick</span> <span class="o">=</span> <span class="nx">g</span><span class="p">.</span><span class="nx">selectAll</span><span class="p">(</span><span class="s2">&quot;.minor&quot;</span><span class="p">).</span><span class="nx">data</span><span class="p">(</span><span class="nx">subticks</span><span class="p">,</span> <span class="nb">String</span><span class="p">),</span>
+ <span class="nx">subtickEnter</span> <span class="o">=</span> <span class="nx">subtick</span><span class="p">.</span><span class="nx">enter</span><span class="p">().</span><span class="nx">insert</span><span class="p">(</span><span class="s2">&quot;line&quot;</span><span class="p">,</span> <span class="s2">&quot;g&quot;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;class&quot;</span><span class="p">,</span> <span class="s2">&quot;tick minor&quot;</span><span class="p">).</span><span class="nx">style</span><span class="p">(</span><span class="s2">&quot;opacity&quot;</span><span class="p">,</span> <span class="mi">1</span><span class="nx">e</span><span class="o">-</span><span class="mi">6</span><span class="p">),</span>
+ <span class="nx">subtickExit</span> <span class="o">=</span> <span class="nx">d3</span><span class="p">.</span><span class="nx">transition</span><span class="p">(</span><span class="nx">subtick</span><span class="p">.</span><span class="nx">exit</span><span class="p">()).</span><span class="nx">style</span><span class="p">(</span><span class="s2">&quot;opacity&quot;</span><span class="p">,</span> <span class="mi">1</span><span class="nx">e</span><span class="o">-</span><span class="mi">6</span><span class="p">).</span><span class="nx">remove</span><span class="p">(),</span>
+ <span class="nx">subtickUpdate</span> <span class="o">=</span> <span class="nx">d3</span><span class="p">.</span><span class="nx">transition</span><span class="p">(</span><span class="nx">subtick</span><span class="p">).</span><span class="nx">style</span><span class="p">(</span><span class="s2">&quot;opacity&quot;</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>Major ticks.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">tick</span> <span class="o">=</span> <span class="nx">g</span><span class="p">.</span><span class="nx">selectAll</span><span class="p">(</span><span class="s2">&quot;g&quot;</span><span class="p">).</span><span class="nx">data</span><span class="p">(</span><span class="nx">ticks</span><span class="p">,</span> <span class="nb">String</span><span class="p">),</span>
+ <span class="nx">tickEnter</span> <span class="o">=</span> <span class="nx">tick</span><span class="p">.</span><span class="nx">enter</span><span class="p">().</span><span class="nx">insert</span><span class="p">(</span><span class="s2">&quot;g&quot;</span><span class="p">,</span> <span class="s2">&quot;path&quot;</span><span class="p">).</span><span class="nx">style</span><span class="p">(</span><span class="s2">&quot;opacity&quot;</span><span class="p">,</span> <span class="mi">1</span><span class="nx">e</span><span class="o">-</span><span class="mi">6</span><span class="p">),</span>
+ <span class="nx">tickExit</span> <span class="o">=</span> <span class="nx">d3</span><span class="p">.</span><span class="nx">transition</span><span class="p">(</span><span class="nx">tick</span><span class="p">.</span><span class="nx">exit</span><span class="p">()).</span><span class="nx">style</span><span class="p">(</span><span class="s2">&quot;opacity&quot;</span><span class="p">,</span> <span class="mi">1</span><span class="nx">e</span><span class="o">-</span><span class="mi">6</span><span class="p">).</span><span class="nx">remove</span><span class="p">(),</span>
+ <span class="nx">tickUpdate</span> <span class="o">=</span> <span class="nx">d3</span><span class="p">.</span><span class="nx">transition</span><span class="p">(</span><span class="nx">tick</span><span class="p">).</span><span class="nx">style</span><span class="p">(</span><span class="s2">&quot;opacity&quot;</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
+ <span class="nx">tickTransform</span><span class="p">;</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>Domain.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">range</span> <span class="o">=</span> <span class="nx">d3_scaleRange</span><span class="p">(</span><span class="nx">scale</span><span class="p">),</span>
+ <span class="nx">path</span> <span class="o">=</span> <span class="nx">g</span><span class="p">.</span><span class="nx">selectAll</span><span class="p">(</span><span class="s2">&quot;.domain&quot;</span><span class="p">).</span><span class="nx">data</span><span class="p">([</span><span class="mi">0</span><span class="p">]),</span>
+ <span class="nx">pathEnter</span> <span class="o">=</span> <span class="nx">path</span><span class="p">.</span><span class="nx">enter</span><span class="p">().</span><span class="nx">append</span><span class="p">(</span><span class="s2">&quot;path&quot;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;class&quot;</span><span class="p">,</span> <span class="s2">&quot;domain&quot;</span><span class="p">),</span>
+ <span class="nx">pathUpdate</span> <span class="o">=</span> <span class="nx">d3</span><span class="p">.</span><span class="nx">transition</span><span class="p">(</span><span class="nx">path</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <p>Stash a snapshot of the new scale, and retrieve the old snapshot.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">scale1</span> <span class="o">=</span> <span class="nx">scale</span><span class="p">.</span><span class="nx">copy</span><span class="p">(),</span>
+ <span class="nx">scale0</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">__chart__</span> <span class="o">||</span> <span class="nx">scale1</span><span class="p">;</span>
+ <span class="k">this</span><span class="p">.</span><span class="nx">__chart__</span> <span class="o">=</span> <span class="nx">scale1</span><span class="p">;</span>
+
+ <span class="nx">tickEnter</span><span class="p">.</span><span class="nx">append</span><span class="p">(</span><span class="s2">&quot;line&quot;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;class&quot;</span><span class="p">,</span> <span class="s2">&quot;tick&quot;</span><span class="p">);</span>
+ <span class="nx">tickEnter</span><span class="p">.</span><span class="nx">append</span><span class="p">(</span><span class="s2">&quot;text&quot;</span><span class="p">);</span>
+ <span class="nx">tickUpdate</span><span class="p">.</span><span class="nx">select</span><span class="p">(</span><span class="s2">&quot;text&quot;</span><span class="p">).</span><span class="nx">text</span><span class="p">(</span><span class="nx">tickFormat</span><span class="p">);</span>
+
+ <span class="k">switch</span> <span class="p">(</span><span class="nx">orient</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">case</span> <span class="s2">&quot;bottom&quot;</span><span class="o">:</span> <span class="p">{</span>
+ <span class="nx">tickTransform</span> <span class="o">=</span> <span class="nx">d3_svg_axisX</span><span class="p">;</span>
+ <span class="nx">subtickEnter</span><span class="p">.</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;y2&quot;</span><span class="p">,</span> <span class="nx">tickMinorSize</span><span class="p">);</span>
+ <span class="nx">subtickUpdate</span><span class="p">.</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;x2&quot;</span><span class="p">,</span> <span class="mi">0</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;y2&quot;</span><span class="p">,</span> <span class="nx">tickMinorSize</span><span class="p">);</span>
+ <span class="nx">tickEnter</span><span class="p">.</span><span class="nx">select</span><span class="p">(</span><span class="s2">&quot;line&quot;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;y2&quot;</span><span class="p">,</span> <span class="nx">tickMajorSize</span><span class="p">);</span>
+ <span class="nx">tickEnter</span><span class="p">.</span><span class="nx">select</span><span class="p">(</span><span class="s2">&quot;text&quot;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;y&quot;</span><span class="p">,</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">max</span><span class="p">(</span><span class="nx">tickMajorSize</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> <span class="o">+</span> <span class="nx">tickPadding</span><span class="p">);</span>
+ <span class="nx">tickUpdate</span><span class="p">.</span><span class="nx">select</span><span class="p">(</span><span class="s2">&quot;line&quot;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;x2&quot;</span><span class="p">,</span> <span class="mi">0</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;y2&quot;</span><span class="p">,</span> <span class="nx">tickMajorSize</span><span class="p">);</span>
+ <span class="nx">tickUpdate</span><span class="p">.</span><span class="nx">select</span><span class="p">(</span><span class="s2">&quot;text&quot;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;x&quot;</span><span class="p">,</span> <span class="mi">0</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;y&quot;</span><span class="p">,</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">max</span><span class="p">(</span><span class="nx">tickMajorSize</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> <span class="o">+</span> <span class="nx">tickPadding</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;dy&quot;</span><span class="p">,</span> <span class="s2">&quot;.71em&quot;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;text-anchor&quot;</span><span class="p">,</span> <span class="s2">&quot;middle&quot;</span><span class="p">);</span>
+ <span class="nx">pathUpdate</span><span class="p">.</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;d&quot;</span><span class="p">,</span> <span class="s2">&quot;M&quot;</span> <span class="o">+</span> <span class="nx">range</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="s2">&quot;,&quot;</span> <span class="o">+</span> <span class="nx">tickEndSize</span> <span class="o">+</span> <span class="s2">&quot;V0H&quot;</span> <span class="o">+</span> <span class="nx">range</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="s2">&quot;V&quot;</span> <span class="o">+</span> <span class="nx">tickEndSize</span><span class="p">);</span>
+ <span class="k">break</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="k">case</span> <span class="s2">&quot;top&quot;</span><span class="o">:</span> <span class="p">{</span>
+ <span class="nx">tickTransform</span> <span class="o">=</span> <span class="nx">d3_svg_axisX</span><span class="p">;</span>
+ <span class="nx">subtickEnter</span><span class="p">.</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;y2&quot;</span><span class="p">,</span> <span class="o">-</span><span class="nx">tickMinorSize</span><span class="p">);</span>
+ <span class="nx">subtickUpdate</span><span class="p">.</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;x2&quot;</span><span class="p">,</span> <span class="mi">0</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;y2&quot;</span><span class="p">,</span> <span class="o">-</span><span class="nx">tickMinorSize</span><span class="p">);</span>
+ <span class="nx">tickEnter</span><span class="p">.</span><span class="nx">select</span><span class="p">(</span><span class="s2">&quot;line&quot;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;y2&quot;</span><span class="p">,</span> <span class="o">-</span><span class="nx">tickMajorSize</span><span class="p">);</span>
+ <span class="nx">tickEnter</span><span class="p">.</span><span class="nx">select</span><span class="p">(</span><span class="s2">&quot;text&quot;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;y&quot;</span><span class="p">,</span> <span class="o">-</span><span class="p">(</span><span class="nb">Math</span><span class="p">.</span><span class="nx">max</span><span class="p">(</span><span class="nx">tickMajorSize</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> <span class="o">+</span> <span class="nx">tickPadding</span><span class="p">));</span>
+ <span class="nx">tickUpdate</span><span class="p">.</span><span class="nx">select</span><span class="p">(</span><span class="s2">&quot;line&quot;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;x2&quot;</span><span class="p">,</span> <span class="mi">0</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;y2&quot;</span><span class="p">,</span> <span class="o">-</span><span class="nx">tickMajorSize</span><span class="p">);</span>
+ <span class="nx">tickUpdate</span><span class="p">.</span><span class="nx">select</span><span class="p">(</span><span class="s2">&quot;text&quot;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;x&quot;</span><span class="p">,</span> <span class="mi">0</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;y&quot;</span><span class="p">,</span> <span class="o">-</span><span class="p">(</span><span class="nb">Math</span><span class="p">.</span><span class="nx">max</span><span class="p">(</span><span class="nx">tickMajorSize</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> <span class="o">+</span> <span class="nx">tickPadding</span><span class="p">)).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;dy&quot;</span><span class="p">,</span> <span class="s2">&quot;0em&quot;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;text-anchor&quot;</span><span class="p">,</span> <span class="s2">&quot;middle&quot;</span><span class="p">);</span>
+ <span class="nx">pathUpdate</span><span class="p">.</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;d&quot;</span><span class="p">,</span> <span class="s2">&quot;M&quot;</span> <span class="o">+</span> <span class="nx">range</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="s2">&quot;,&quot;</span> <span class="o">+</span> <span class="o">-</span><span class="nx">tickEndSize</span> <span class="o">+</span> <span class="s2">&quot;V0H&quot;</span> <span class="o">+</span> <span class="nx">range</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="s2">&quot;V&quot;</span> <span class="o">+</span> <span class="o">-</span><span class="nx">tickEndSize</span><span class="p">);</span>
+ <span class="k">break</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="k">case</span> <span class="s2">&quot;left&quot;</span><span class="o">:</span> <span class="p">{</span>
+ <span class="nx">tickTransform</span> <span class="o">=</span> <span class="nx">d3_svg_axisY</span><span class="p">;</span>
+ <span class="nx">subtickEnter</span><span class="p">.</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;x2&quot;</span><span class="p">,</span> <span class="o">-</span><span class="nx">tickMinorSize</span><span class="p">);</span>
+ <span class="nx">subtickUpdate</span><span class="p">.</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;x2&quot;</span><span class="p">,</span> <span class="o">-</span><span class="nx">tickMinorSize</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;y2&quot;</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
+ <span class="nx">tickEnter</span><span class="p">.</span><span class="nx">select</span><span class="p">(</span><