Changeset 98209 in spip-zone


Ignore:
Timestamp:
Jun 5, 2016, 1:04:37 PM (3 years ago)
Author:
cyp@…
Message:

Mise à jour de la lib et ajout de le version minifier

Location:
_plugins_/d3js/trunk
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/d3js/trunk/README.md

    r98182 r98209  
    1616
    1717### Version 1.2.x
     18
     19#### Version 1.2.4
     20
     21* Mise à jour de la version de d3js
     22* On ajoute la version minifier de d3js. Attention la version non minifié fait bugguer le javascript du site. 
    1823
    1924#### Version 1.2.3
  • _plugins_/d3js/trunk/examples/bivariable.html

    r96616 r98209  
    1818<div class="box_bivariable"></div>
    1919
    20 <script src="../javascript/d3.v3.min.js"></script>
     20<script src="../javascript/d3.min.js"></script>
    2121
    2222<script>
  • _plugins_/d3js/trunk/examples/circle.html

    r96616 r98209  
    88<div class="circle_graph"></div>
    99
    10 <script src="../javascript/d3.v3.min.js"></script>
     10<script src="../javascript/d3.min.js"></script>
    1111<script>
    1212
  • _plugins_/d3js/trunk/examples/legend.html

    r96616 r98209  
    1 <script src="../javascript/d3.v3.min.js"></script>
    2 <script src="../javascript/d3-legend.min.js"></script>
     1<script src="../javascript/d3.min.js"></script>
     2<script src="../javascript/d3-legend.js"></script>
    33
    44<style>
  • _plugins_/d3js/trunk/examples/line.html

    r96616 r98209  
    77<div class="box_graph"></div>
    88
    9 <script src="../javascript/d3.v3.min.js"></script>
     9<script src="../javascript/d3.js"></script>
    1010
    1111<script type="text/javascript">
  • _plugins_/d3js/trunk/javascript/d3.js

    r96616 r98209  
    11!function() {
    22  var d3 = {
    3     version: "3.5.6"
     3    version: "3.5.17"
    44  };
    55  var d3_arraySlice = [].slice, d3_array = function(list) {
     
    221221    return pairs;
    222222  };
     223  d3.transpose = function(matrix) {
     224    if (!(n = matrix.length)) return [];
     225    for (var i = -1, m = d3.min(matrix, d3_transposeLength), transpose = new Array(m); ++i < m; ) {
     226      for (var j = -1, n, row = transpose[i] = new Array(n); ++j < n; ) {
     227        row[j] = matrix[j][i];
     228      }
     229    }
     230    return transpose;
     231  };
     232  function d3_transposeLength(d) {
     233    return d.length;
     234  }
    223235  d3.zip = function() {
    224     if (!(n = arguments.length)) return [];
    225     for (var i = -1, m = d3.min(arguments, d3_zipLength), zips = new Array(m); ++i < m; ) {
    226       for (var j = -1, n, zip = zips[i] = new Array(n); ++j < n; ) {
    227         zip[j] = arguments[j][i];
    228       }
    229     }
    230     return zips;
    231   };
    232   function d3_zipLength(d) {
    233     return d.length;
    234   }
    235   d3.transpose = function(matrix) {
    236     return d3.zip.apply(d3, matrix);
     236    return d3.transpose(arguments);
    237237  };
    238238  d3.keys = function(map) {
     
    621621    };
    622622  }
     623  var d3_nsXhtml = "http://www.w3.org/1999/xhtml";
    623624  var d3_nsPrefix = {
    624625    svg: "http://www.w3.org/2000/svg",
    625     xhtml: "http://www.w3.org/1999/xhtml",
     626    xhtml: d3_nsXhtml,
    626627    xlink: "http://www.w3.org/1999/xlink",
    627628    xml: "http://www.w3.org/XML/1998/namespace",
     
    632633    qualify: function(name) {
    633634      var i = name.indexOf(":"), prefix = name;
    634       if (i >= 0) {
    635         prefix = name.slice(0, i);
    636         name = name.slice(i + 1);
    637       }
     635      if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1);
    638636      return d3_nsPrefix.hasOwnProperty(prefix) ? {
    639637        space: d3_nsPrefix[prefix],
     
    809807    function create() {
    810808      var document = this.ownerDocument, namespace = this.namespaceURI;
    811       return namespace ? document.createElementNS(namespace, name) : document.createElement(name);
     809      return namespace === d3_nsXhtml && document.documentElement.namespaceURI === d3_nsXhtml ? document.createElement(name) : document.createElementNS(namespace, name);
    812810    }
    813811    function createNS() {
     
    846844        var nodeByKeyValue = new d3_Map(), keyValues = new Array(n), keyValue;
    847845        for (i = -1; ++i < n; ) {
    848           if (nodeByKeyValue.has(keyValue = key.call(node = group[i], node.__data__, i))) {
    849             exitNodes[i] = node;
    850           } else {
    851             nodeByKeyValue.set(keyValue, node);
     846          if (node = group[i]) {
     847            if (nodeByKeyValue.has(keyValue = key.call(node, node.__data__, i))) {
     848              exitNodes[i] = node;
     849            } else {
     850              nodeByKeyValue.set(keyValue, node);
     851            }
     852            keyValues[i] = keyValue;
    852853          }
    853           keyValues[i] = keyValue;
    854854        }
    855855        for (i = -1; ++i < m; ) {
     
    863863        }
    864864        for (i = -1; ++i < n; ) {
    865           if (nodeByKeyValue.get(keyValues[i]) !== true) {
     865          if (i in keyValues && nodeByKeyValue.get(keyValues[i]) !== true) {
    866866            exitNodes[i] = group[i];
    867867          }
     
    10551055      group.parentNode = d3_document.documentElement;
    10561056    } else {
    1057       group = nodes;
     1057      group = d3_array(nodes);
    10581058      group.parentNode = null;
    10591059    }
     
    12061206    function dragstart(id, position, subject, move, end) {
    12071207      return function() {
    1208         var that = this, target = d3.event.target, parent = that.parentNode, dispatch = event.of(that, arguments), dragged = 0, dragId = id(), dragName = ".drag" + (dragId == null ? "" : "-" + dragId), dragOffset, dragSubject = d3.select(subject(target)).on(move + dragName, moved).on(end + dragName, ended), dragRestore = d3_event_dragSuppress(target), position0 = position(parent, dragId);
     1208        var that = this, target = d3.event.target.correspondingElement || d3.event.target, parent = that.parentNode, dispatch = event.of(that, arguments), dragged = 0, dragId = id(), dragName = ".drag" + (dragId == null ? "" : "-" + dragId), dragOffset, dragSubject = d3.select(subject(target)).on(move + dragName, moved).on(end + dragName, ended), dragRestore = d3_event_dragSuppress(target), position0 = position(parent, dragId);
    12091209        if (origin) {
    12101210          dragOffset = origin.apply(that, arguments);
     
    12341234          if (!position(parent, dragId)) return;
    12351235          dragSubject.on(move + dragName, null).on(end + dragName, null);
    1236           dragRestore(dragged && d3.event.target === target);
     1236          dragRestore(dragged);
    12371237          dispatch({
    12381238            type: "dragend"
     
    12861286  var ρ = Math.SQRT2, ρ2 = 2, ρ4 = 4;
    12871287  d3.interpolateZoom = function(p0, p1) {
    1288     var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], ux1 = p1[0], uy1 = p1[1], w1 = p1[2];
    1289     var dx = ux1 - ux0, dy = uy1 - uy0, d2 = dx * dx + dy * dy, d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + ρ4 * d2) / (2 * w0 * ρ2 * d1), b1 = (w1 * w1 - w0 * w0 - ρ4 * d2) / (2 * w1 * ρ2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1), dr = r1 - r0, S = (dr || Math.log(w1 / w0)) / ρ;
    1290     function interpolate(t) {
    1291       var s = t * S;
    1292       if (dr) {
    1293         var coshr0 = d3_cosh(r0), u = w0 / (ρ2 * d1) * (coshr0 * d3_tanh(ρ * s + r0) - d3_sinh(r0));
     1288    var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], ux1 = p1[0], uy1 = p1[1], w1 = p1[2], dx = ux1 - ux0, dy = uy1 - uy0, d2 = dx * dx + dy * dy, i, S;
     1289    if (d2 < ε2) {
     1290      S = Math.log(w1 / w0) / ρ;
     1291      i = function(t) {
     1292        return [ ux0 + t * dx, uy0 + t * dy, w0 * Math.exp(ρ * t * S) ];
     1293      };
     1294    } else {
     1295      var d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + ρ4 * d2) / (2 * w0 * ρ2 * d1), b1 = (w1 * w1 - w0 * w0 - ρ4 * d2) / (2 * w1 * ρ2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
     1296      S = (r1 - r0) / ρ;
     1297      i = function(t) {
     1298        var s = t * S, coshr0 = d3_cosh(r0), u = w0 / (ρ2 * d1) * (coshr0 * d3_tanh(ρ * s + r0) - d3_sinh(r0));
    12941299        return [ ux0 + u * dx, uy0 + u * dy, w0 * coshr0 / d3_cosh(ρ * s + r0) ];
    1295       }
    1296       return [ ux0 + t * dx, uy0 + t * dy, w0 * Math.exp(ρ * s) ];
    1297     }
    1298     interpolate.duration = S * 1e3;
    1299     return interpolate;
     1300      };
     1301    }
     1302    i.duration = S * 1e3;
     1303    return i;
    13001304  };
    13011305  d3.behavior.zoom = function() {
     
    13671371        x: view.x,
    13681372        y: view.y,
    1369         k: +_
     1373        k: null
    13701374      };
     1375      scaleTo(+_);
    13711376      rescale();
    13721377      return zoom;
     
    14671472    }
    14681473    function mousedowned() {
    1469       var that = this, target = d3.event.target, dispatch = event.of(that, arguments), dragged = 0, subject = d3.select(d3_window(that)).on(mousemove, moved).on(mouseup, ended), location0 = location(d3.mouse(that)), dragRestore = d3_event_dragSuppress(that);
     1474      var that = this, dispatch = event.of(that, arguments), dragged = 0, subject = d3.select(d3_window(that)).on(mousemove, moved).on(mouseup, ended), location0 = location(d3.mouse(that)), dragRestore = d3_event_dragSuppress(that);
    14701475      d3_selection_interrupt.call(that);
    14711476      zoomstarted(dispatch);
     
    14771482      function ended() {
    14781483        subject.on(mousemove, null).on(mouseup, null);
    1479         dragRestore(dragged && d3.event.target === target);
     1484        dragRestore(dragged);
    14801485        zoomended(dispatch);
    14811486      }
     
    21142119  };
    21152120  d3.csv = d3.dsv(",", "text/csv");
    2116   d3.tsv = d3.dsv("     ", "text/tab-separated-values");
    2117   var d3_timer_queueHead, d3_timer_queueTail, d3_timer_interval, d3_timer_timeout, d3_timer_active, d3_timer_frame = this[d3_vendorSymbol(this, "requestAnimationFrame")] || function(callback) {
     2121  d3.tsv = d3.dsv(" ", "text/tab-separated-values");
     2122  var d3_timer_queueHead, d3_timer_queueTail, d3_timer_interval, d3_timer_timeout, d3_timer_frame = this[d3_vendorSymbol(this, "requestAnimationFrame")] || function(callback) {
    21182123    setTimeout(callback, 17);
    21192124  };
    2120   d3.timer = function(callback, delay, then) {
     2125  d3.timer = function() {
     2126    d3_timer.apply(this, arguments);
     2127  };
     2128  function d3_timer(callback, delay, then) {
    21212129    var n = arguments.length;
    21222130    if (n < 2) delay = 0;
     
    21252133      c: callback,
    21262134      t: time,
    2127       f: false,
    21282135      n: null
    21292136    };
     
    21352142      d3_timer_frame(d3_timer_step);
    21362143    }
    2137   };
     2144    return timer;
     2145  }
    21382146  function d3_timer_step() {
    21392147    var now = d3_timer_mark(), delay = d3_timer_sweep() - now;
     
    21542162  };
    21552163  function d3_timer_mark() {
    2156     var now = Date.now();
    2157     d3_timer_active = d3_timer_queueHead;
    2158     while (d3_timer_active) {
    2159       if (now >= d3_timer_active.t) d3_timer_active.f = d3_timer_active.c(now - d3_timer_active.t);
    2160       d3_timer_active = d3_timer_active.n;
     2164    var now = Date.now(), timer = d3_timer_queueHead;
     2165    while (timer) {
     2166      if (now >= timer.t && timer.c(now - timer.t)) timer.c = null;
     2167      timer = timer.n;
    21612168    }
    21622169    return now;
     
    21652172    var t0, t1 = d3_timer_queueHead, time = Infinity;
    21662173    while (t1) {
    2167       if (t1.f) {
    2168         t1 = t0 ? t0.n = t1.n : d3_timer_queueHead = t1.n;
    2169       } else {
     2174      if (t1.c) {
    21702175        if (t1.t < time) time = t1.t;
    21712176        t1 = (t0 = t1).n;
     2177      } else {
     2178        t1 = t0 ? t0.n = t1.n : d3_timer_queueHead = t1.n;
    21722179      }
    21732180    }
     
    21842191  d3.formatPrefix = function(value, precision) {
    21852192    var i = 0;
    2186     if (value) {
     2193    if (value = +value) {
    21872194      if (value < 0) value *= -1;
    21882195      if (precision) value = d3.round(value, d3_format_precision(value, precision));
     
    25342541        if ("p" in d) d.H = d.H % 12 + d.p * 12;
    25352542        var localZ = d.Z != null && d3_date !== d3_date_utc, date = new (localZ ? d3_date_utc : d3_date)();
    2536         if ("j" in d) date.setFullYear(d.y, 0, d.j); else if ("w" in d && ("W" in d || "U" in d)) {
     2543        if ("j" in d) date.setFullYear(d.y, 0, d.j); else if ("W" in d || "U" in d) {
     2544          if (!("w" in d)) d.w = "W" in d ? 1 : 0;
    25372545          date.setFullYear(d.y, 0, 1);
    25382546          date.setFullYear(d.y, 0, "W" in d ? (d.w + 6) % 7 + d.W * 7 - (date.getDay() + 5) % 7 : d.w + d.U * 7 - (date.getDay() + 6) % 7);
     
    35183526      }
    35193527    }
    3520     return (polarAngle < -ε || polarAngle < ε && d3_geo_areaRingSum < 0) ^ winding & 1;
     3528    return (polarAngle < -ε || polarAngle < ε && d3_geo_areaRingSum < ) ^ winding & 1;
    35213529  }
    35223530  function d3_geo_clipCircle(radius) {
     
    59865994  };
    59875995  d3.interpolateTransform = d3_interpolateTransform;
    5988   function d3_interpolateTransform(a, b) {
    5989     var s = [], q = [], n, A = d3.transform(a), B = d3.transform(b), ta = A.translate, tb = B.translate, ra = A.rotate, rb = B.rotate, wa = A.skew, wb = B.skew, ka = A.scale, kb = B.scale;
    5990     if (ta[0] != tb[0] || ta[1] != tb[1]) {
    5991       s.push("translate(", null, ",", null, ")");
     5996  function d3_interpolateTransformPop(s) {
     5997    return s.length ? s.pop() + "," : "";
     5998  }
     5999  function d3_interpolateTranslate(ta, tb, s, q) {
     6000    if (ta[0] !== tb[0] || ta[1] !== tb[1]) {
     6001      var i = s.push("translate(", null, ",", null, ")");
    59926002      q.push({
    5993         i: 1,
     6003        i: i - 4,
    59946004        x: d3_interpolateNumber(ta[0], tb[0])
    59956005      }, {
    5996         i: 3,
     6006        i: i - 2,
    59976007        x: d3_interpolateNumber(ta[1], tb[1])
    59986008      });
    59996009    } else if (tb[0] || tb[1]) {
    60006010      s.push("translate(" + tb + ")");
    6001     } else {
    6002       s.push("");
    6003     }
    6004     if (ra != rb) {
     6011    }
     6012  }
     6013  function d3_interpolateRotate(ra, rb, s, q) {
     6014    if (ra !== rb) {
    60056015      if (ra - rb > 180) rb += 360; else if (rb - ra > 180) ra += 360;
    60066016      q.push({
    6007         i: s.push(s.pop() + "rotate(", null, ")") - 2,
     6017        i: s.push(d3_interpolateTransformPop(s) + "rotate(", null, ")") - 2,
    60086018        x: d3_interpolateNumber(ra, rb)
    60096019      });
    60106020    } else if (rb) {
    6011       s.push(s.pop() + "rotate(" + rb + ")");
    6012     }
    6013     if (wa != wb) {
     6021      s.push(d3_interpolateTransformPop(s) + "rotate(" + rb + ")");
     6022    }
     6023  }
     6024  function d3_interpolateSkew(wa, wb, s, q) {
     6025    if (wa !== wb) {
    60146026      q.push({
    6015         i: s.push(s.pop() + "skewX(", null, ")") - 2,
     6027        i: s.push(d3_interpolateTransformPop(s) + "skewX(", null, ")") - 2,
    60166028        x: d3_interpolateNumber(wa, wb)
    60176029      });
    60186030    } else if (wb) {
    6019       s.push(s.pop() + "skewX(" + wb + ")");
    6020     }
    6021     if (ka[0] != kb[0] || ka[1] != kb[1]) {
    6022       n = s.push(s.pop() + "scale(", null, ",", null, ")");
     6031      s.push(d3_interpolateTransformPop(s) + "skewX(" + wb + ")");
     6032    }
     6033  }
     6034  function d3_interpolateScale(ka, kb, s, q) {
     6035    if (ka[0] !== kb[0] || ka[1] !== kb[1]) {
     6036      var i = s.push(d3_interpolateTransformPop(s) + "scale(", null, ",", null, ")");
    60236037      q.push({
    6024         i: n - 4,
     6038        i: i - 4,
    60256039        x: d3_interpolateNumber(ka[0], kb[0])
    60266040      }, {
    6027         i: n - 2,
     6041        i: i - 2,
    60286042        x: d3_interpolateNumber(ka[1], kb[1])
    60296043      });
    6030     } else if (kb[0] != 1 || kb[1] != 1) {
    6031       s.push(s.pop() + "scale(" + kb + ")");
    6032     }
    6033     n = q.length;
     6044    } else if (kb[0] !== 1 || kb[1] !== 1) {
     6045      s.push(d3_interpolateTransformPop(s) + "scale(" + kb + ")");
     6046    }
     6047  }
     6048  function d3_interpolateTransform(a, b) {
     6049    var s = [], q = [];
     6050    a = d3.transform(a), b = d3.transform(b);
     6051    d3_interpolateTranslate(a.translate, b.translate, s, q);
     6052    d3_interpolateRotate(a.rotate, b.rotate, s, q);
     6053    d3_interpolateSkew(a.skew, b.skew, s, q);
     6054    d3_interpolateScale(a.scale, b.scale, s, q);
     6055    a = b = null;
    60346056    return function(t) {
    6035       var i = -1, o;
     6057      var i = -1, n = q.length, o;
    60366058      while (++i < n) s[(o = q[i]).i] = o.x(t);
    60376059      return s.join("");
     
    61376159          startAngle: x0,
    61386160          endAngle: x,
    6139           value: (x - x0) / k
     6161          value: groupSums[di]
    61406162        };
    61416163        x += padding;
     
    62056227  };
    62066228  d3.layout.force = function() {
    6207     var force = {}, event = d3.dispatch("start", "tick", "end"), size = [ 1, 1 ], drag, alpha, friction = .9, linkDistance = d3_layout_forceLinkDistance, linkStrength = d3_layout_forceLinkStrength, charge = -30, chargeDistance2 = d3_layout_forceChargeDistance2, gravity = .1, theta2 = .64, nodes = [], links = [], distances, strengths, charges;
     6229    var force = {}, event = d3.dispatch("start", "tick", "end"), timer, size = [ 1, 1 ], drag, alpha, friction = .9, linkDistance = d3_layout_forceLinkDistance, linkStrength = d3_layout_forceLinkStrength, charge = -30, chargeDistance2 = d3_layout_forceChargeDistance2, gravity = .1, theta2 = .64, nodes = [], links = [], distances, strengths, charges;
    62086230    function repulse(node) {
    62096231      return function(quad, x1, _, x2) {
     
    62296251    force.tick = function() {
    62306252      if ((alpha *= .99) < .005) {
     6253        timer = null;
    62316254        event.end({
    62326255          type: "end",
     
    62466269          x *= l;
    62476270          y *= l;
    6248           t.x -= x * (k = s.weight / (t.weight + s.weight));
     6271          t.x -= x * (k = s.weight + t.weight ? s.weight / (s.weight + t.weight) : .5);
    62496272          t.y -= y * k;
    62506273          s.x += x * (k = 1 - k);
     
    63426365      x = +x;
    63436366      if (alpha) {
    6344         if (x > 0) alpha = x; else alpha = 0;
     6367        if (x > 0) {
     6368          alpha = x;
     6369        } else {
     6370          timer.c = null, timer.t = NaN, timer = null;
     6371          event.end({
     6372            type: "end",
     6373            alpha: alpha = 0
     6374          });
     6375        }
    63456376      } else if (x > 0) {
    63466377        event.start({
     
    63486379          alpha: alpha = x
    63496380        });
    6350         d3.timer(force.tick);
     6381        timer = d3_timer(force.tick);
    63516382      }
    63526383      return force;
     
    66026633      var n = data.length, values = data.map(function(d, i) {
    66036634        return +value.call(pie, d, i);
    6604       }), a = +(typeof startAngle === "function" ? startAngle.apply(this, arguments) : startAngle), da = (typeof endAngle === "function" ? endAngle.apply(this, arguments) : endAngle) - a, p = Math.min(Math.abs(da) / n, +(typeof padAngle === "function" ? padAngle.apply(this, arguments) : padAngle)), pa = p * (da < 0 ? -1 : 1), k = (da - n * pa) / d3.sum(values), index = d3.range(n), arcs = [], v;
     6635      }), a = +(typeof startAngle === "function" ? startAngle.apply(this, arguments) : startAngle), da = (typeof endAngle === "function" ? endAngle.apply(this, arguments) : endAngle) - a, p = Math.min(Math.abs(da) / n, +(typeof padAngle === "function" ? padAngle.apply(this, arguments) : padAngle)), pa = p * (da < 0 ? -1 : 1), sum = d3.sum(values), k = sum ? (da - n * pa) / sum : 0, index = d3.range(n), arcs = [], v;
    66056636      if (sort != null) index.sort(sort === d3_layout_pieSortByValue ? function(i, j) {
    66066637        return values[j] - values[i];
     
    73157346    function treemap(d) {
    73167347      var nodes = stickies || hierarchy(d), root = nodes[0];
    7317       root.x = 0;
    7318       root.y = 0;
    7319       root.dx = size[0];
    7320       root.dy = size[1];
     7348      root.x = root.y = 0;
     7349      if (root.value) root.dx = size[0], root.dy = size[1]; else root.dx = root.dy = 0;
    73217350      if (stickies) hierarchy.revalue(root);
    73227351      scale([ root ], root.dx * root.dy / root.value);
     
    75387567  }
    75397568  function d3_scale_linearNice(domain, m) {
    7540     return d3_scale_nice(domain, d3_scale_niceStep(d3_scale_linearTickRange(domain, m)[2]));
     7569    d3_scale_nice(domain, d3_scale_niceStep(d3_scale_linearTickRange(domain, m)[2]));
     7570    d3_scale_nice(domain, d3_scale_niceStep(d3_scale_linearTickRange(domain, m)[2]));
     7571    return domain;
    75417572  }
    75427573  function d3_scale_linearTickRange(domain, m) {
     
    76407671      if (!arguments.length) return d3_scale_logFormat;
    76417672      if (arguments.length < 2) format = d3_scale_logFormat; else if (typeof format !== "function") format = d3.format(format);
    7642       var k = Math.max(.1, n / scale.ticks().length), f = positive ? (e = 1e-12, Math.ceil) : (e = -1e-12,
    7643       Math.floor), e;
     7673      var k = Math.max(1, base * n / scale.ticks().length);
    76447674      return function(d) {
    7645         return d / pow(f(log(d) + e)) <= k ? format(d) : "";
     7675        var i = d / pow(Math.round(log(d)));
     7676        if (i * base < base - .5) i *= base;
     7677        return i <= k ? format(d) : "";
    76467678      };
    76477679    };
     
    79828014        x2 = y2 = 0;
    79838015      }
    7984       if ((rc = Math.min(Math.abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments))) > .001) {
     8016      if (da > ε && (rc = Math.min(Math.abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments))) > .001) {
    79858017        cr = r0 < r1 ^ cw ? 0 : 1;
    7986         var oc = x3 == null ? [ x2, y2 ] : x1 == null ? [ x0, y0 ] : d3_geom_polygonIntersect([ x0, y0 ], [ x3, y3 ], [ x1, y1 ], [ x2, y2 ]), ax = x0 - oc[0], ay = y0 - oc[1], bx = x1 - oc[0], by = y1 - oc[1], kc = 1 / Math.sin(Math.acos((ax * bx + ay * by) / (Math.sqrt(ax * ax + ay * ay) * Math.sqrt(bx * bx + by * by))) / 2), lc = Math.sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
     8018        var rc1 = rc, rc0 = rc;
     8019        if (da < π) {
     8020          var oc = x3 == null ? [ x2, y2 ] : x1 == null ? [ x0, y0 ] : d3_geom_polygonIntersect([ x0, y0 ], [ x3, y3 ], [ x1, y1 ], [ x2, y2 ]), ax = x0 - oc[0], ay = y0 - oc[1], bx = x1 - oc[0], by = y1 - oc[1], kc = 1 / Math.sin(Math.acos((ax * bx + ay * by) / (Math.sqrt(ax * ax + ay * ay) * Math.sqrt(bx * bx + by * by))) / 2), lc = Math.sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
     8021          rc0 = Math.min(rc, (r0 - lc) / (kc - 1));
     8022          rc1 = Math.min(rc, (r1 - lc) / (kc + 1));
     8023        }
    79878024        if (x1 != null) {
    7988           var rc1 = Math.min(rc, (r1 - lc) / (kc + 1)), t30 = d3_svg_arcCornerTangents(x3 == null ? [ x2, y2 ] : [ x3, y3 ], [ x0, y0 ], r1, rc1, cw), t12 = d3_svg_arcCornerTangents([ x1, y1 ], [ x2, y2 ], r1, rc1, cw);
     8025          var t30 = d3_svg_arcCornerTangents(x3 == null ? [ x2, y2 ] : [ x3, y3 ], [ x0, y0 ], r1, rc1, cw), t12 = d3_svg_arcCornerTangents([ x1, y1 ], [ x2, y2 ], r1, rc1, cw);
    79898026          if (rc === rc1) {
    79908027            path.push("M", t30[0], "A", rc1, ",", rc1, " 0 0,", cr, " ", t30[1], "A", r1, ",", r1, " 0 ", 1 - cw ^ d3_svg_arcSweep(t30[1][0], t30[1][1], t12[1][0], t12[1][1]), ",", cw, " ", t12[1], "A", rc1, ",", rc1, " 0 0,", cr, " ", t12[0]);
     
    79968033        }
    79978034        if (x3 != null) {
    7998           var rc0 = Math.min(rc, (r0 - lc) / (kc - 1)), t03 = d3_svg_arcCornerTangents([ x0, y0 ], [ x3, y3 ], r0, -rc0, cw), t21 = d3_svg_arcCornerTangents([ x2, y2 ], x1 == null ? [ x0, y0 ] : [ x1, y1 ], r0, -rc0, cw);
     8035          var t03 = d3_svg_arcCornerTangents([ x0, y0 ], [ x3, y3 ], r0, -rc0, cw), t21 = d3_svg_arcCornerTangents([ x2, y2 ], x1 == null ? [ x0, y0 ] : [ x1, y1 ], r0, -rc0, cw);
    79998036          if (rc === rc0) {
    80008037            path.push("L", t21[0], "A", rc0, ",", rc0, " 0 0,", cr, " ", t21[1], "A", r0, ",", r0, " 0 ", cw ^ d3_svg_arcSweep(t21[1][0], t21[1][1], t03[1][0], t03[1][1]), ",", 1 - cw, " ", t03[1], "A", rc0, ",", rc0, " 0 0,", cr, " ", t03[0]);
     
    80788115  }
    80798116  function d3_svg_arcCornerTangents(p0, p1, r1, rc, cw) {
    8080     var x01 = p0[0] - p1[0], y01 = p0[1] - p1[1], lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x1 = p0[0] + ox, y1 = p0[1] + oy, x2 = p1[0] + ox, y2 = p1[1] + oy, x3 = (x1 + x2) / 2, y3 = (y1 + y2) / 2, dx = x2 - x1, dy = y2 - y1, d2 = dx * dx + dy * dy, r = r1 - rc, D = x1 * y2 - x2 * y1, d = (dy < 0 ? -1 : 1) * Math.sqrt(r * r * d2 - D * D), cx0 = (D * dy - dx * d) / d2, cy0 = (-D * dx - dy * d) / d2, cx1 = (D * dy + dx * d) / d2, cy1 = (-D * dx + dy * d) / d2, dx0 = cx0 - x3, dy0 = cy0 - y3, dx1 = cx1 - x3, dy1 = cy1 - y3;
     8117    var x01 = p0[0] - p1[0], y01 = p0[1] - p1[1], lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x1 = p0[0] + ox, y1 = p0[1] + oy, x2 = p1[0] + ox, y2 = p1[1] + oy, x3 = (x1 + x2) / 2, y3 = (y1 + y2) / 2, dx = x2 - x1, dy = y2 - y1, d2 = dx * dx + dy * dy, r = r1 - rc, D = x1 * y2 - x2 * y1, d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)), cx0 = (D * dy - dx * d) / d2, cy0 = (-D * dx - dy * d) / d2, cx1 = (D * dy + dx * d) / d2, cy1 = (-D * dx + dy * d) / d2, dx0 = cx0 - x3, dy0 = cy0 - y3, dx1 = cx1 - x3, dy1 = cy1 - y3;
    80818118    if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;
    80828119    return [ [ cx0 - ox, cy0 - oy ], [ cx0 * r1 / r, cy0 * r1 / r ] ];
     
    81508187  });
    81518188  function d3_svg_lineLinear(points) {
    8152     return points.join("L");
     8189    return points.length > 1 ? points.join("L") : points + "Z";
    81538190  }
    81548191  function d3_svg_lineLinearClosed(points) {
    8155     return d3_svg_lineLinear(points) + "Z";
     8192    return points.join("L") + "Z";
    81568193  }
    81578194  function d3_svg_lineStep(points) {
     
    81758212  }
    81768213  function d3_svg_lineCardinalClosed(points, tension) {
    8177     return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite((points.push(points[0]),
     8214    return points.length < 3 ? d3_svg_lineLinearClosed(points) : points[0] + d3_svg_lineHermite((points.push(points[0]),
    81788215    points), d3_svg_lineCardinalTangents([ points[points.length - 2] ].concat(points, [ points[1] ]), tension));
    81798216  }
     
    86118648  function d3_selection_interruptNS(ns) {
    86128649    return function() {
    8613       var lock, active;
    8614       if ((lock = this[ns]) && (active = lock[lock.active])) {
    8615         if (--lock.count) delete lock[lock.active]; else delete this[ns];
     8650      var lock, activeId, active;
     8651      if ((lock = this[ns]) && (active = lock[activeId = lock.active])) {
     8652        active.timer.c = null;
     8653        active.timer.t = NaN;
     8654        if (--lock.count) delete lock[activeId]; else delete this[ns];
    86168655        lock.active += .5;
    86178656        active.event && active.event.interrupt.call(this, this.__data__, active.index);
     
    88688907      active: 0,
    88698908      count: 0
    8870     }), transition = lock[id];
     8909    }), transition = lock[id], time, timer, duration, ease, tweens;
     8910    function schedule(elapsed) {
     8911      var delay = transition.delay;
     8912      timer.t = delay + time;
     8913      if (delay <= elapsed) return start(elapsed - delay);
     8914      timer.c = start;
     8915    }
     8916    function start(elapsed) {
     8917      var activeId = lock.active, active = lock[activeId];
     8918      if (active) {
     8919        active.timer.c = null;
     8920        active.timer.t = NaN;
     8921        --lock.count;
     8922        delete lock[activeId];
     8923        active.event && active.event.interrupt.call(node, node.__data__, active.index);
     8924      }
     8925      for (var cancelId in lock) {
     8926        if (+cancelId < id) {
     8927          var cancel = lock[cancelId];
     8928          cancel.timer.c = null;
     8929          cancel.timer.t = NaN;
     8930          --lock.count;
     8931          delete lock[cancelId];
     8932        }
     8933      }
     8934      timer.c = tick;
     8935      d3_timer(function() {
     8936        if (timer.c && tick(elapsed || 1)) {
     8937          timer.c = null;
     8938          timer.t = NaN;
     8939        }
     8940        return 1;
     8941      }, 0, time);
     8942      lock.active = id;
     8943      transition.event && transition.event.start.call(node, node.__data__, i);
     8944      tweens = [];
     8945      transition.tween.forEach(function(key, value) {
     8946        if (value = value.call(node, node.__data__, i)) {
     8947          tweens.push(value);
     8948        }
     8949      });
     8950      ease = transition.ease;
     8951      duration = transition.duration;
     8952    }
     8953    function tick(elapsed) {
     8954      var t = elapsed / duration, e = ease(t), n = tweens.length;
     8955      while (n > 0) {
     8956        tweens[--n].call(node, e);
     8957      }
     8958      if (t >= 1) {
     8959        transition.event && transition.event.end.call(node, node.__data__, i);
     8960        if (--lock.count) delete lock[id]; else delete node[ns];
     8961        return 1;
     8962      }
     8963    }
    88718964    if (!transition) {
    8872       var time = inherit.time;
     8965      time = inherit.time;
     8966      timer = d3_timer(schedule, 0, time);
    88738967      transition = lock[id] = {
    88748968        tween: new d3_Map(),
    88758969        time: time,
     8970        timer: timer,
    88768971        delay: inherit.delay,
    88778972        duration: inherit.duration,
     
    88818976      inherit = null;
    88828977      ++lock.count;
    8883       d3.timer(function(elapsed) {
    8884         var delay = transition.delay, duration, ease, timer = d3_timer_active, tweened = [];
    8885         timer.t = delay + time;
    8886         if (delay <= elapsed) return start(elapsed - delay);
    8887         timer.c = start;
    8888         function start(elapsed) {
    8889           if (lock.active > id) return stop();
    8890           var active = lock[lock.active];
    8891           if (active) {
    8892             --lock.count;
    8893             delete lock[lock.active];
    8894             active.event && active.event.interrupt.call(node, node.__data__, active.index);
    8895           }
    8896           lock.active = id;
    8897           transition.event && transition.event.start.call(node, node.__data__, i);
    8898           transition.tween.forEach(function(key, value) {
    8899             if (value = value.call(node, node.__data__, i)) {
    8900               tweened.push(value);
    8901             }
    8902           });
    8903           ease = transition.ease;
    8904           duration = transition.duration;
    8905           d3.timer(function() {
    8906             timer.c = tick(elapsed || 1) ? d3_true : tick;
    8907             return 1;
    8908           }, 0, time);
    8909         }
    8910         function tick(elapsed) {
    8911           if (lock.active !== id) return 1;
    8912           var t = elapsed / duration, e = ease(t), n = tweened.length;
    8913           while (n > 0) {
    8914             tweened[--n].call(node, e);
    8915           }
    8916           if (t >= 1) {
    8917             transition.event && transition.event.end.call(node, node.__data__, i);
    8918             return stop();
    8919           }
    8920         }
    8921         function stop() {
    8922           if (--lock.count) delete lock[id]; else delete node[ns];
    8923           return 1;
    8924         }
    8925       }, 0, time);
    89268978    }
    89278979  }
     
    89779029    axis.ticks = function() {
    89789030      if (!arguments.length) return tickArguments_;
    8979       tickArguments_ = arguments;
     9031      tickArguments_ = d3_array(arguments);
    89809032      return axis;
    89819033    };
     
    94999551    return request.responseXML;
    95009552  });
    9501   if (typeof define === "function" && define.amd) define(d3); else if (typeof module === "object" && module.exports) module.exports = d3;
    9502   this.d3 = d3;
     9553  if (typeof define === "function" && define.amd) this.d3 = d3, define(d3); else if (typeof module === "object" && module.exports) module.exports = d3; else this.d3 = d3;
    95039554}();
  • _plugins_/d3js/trunk/paquet.xml

    r98182 r98209  
    22        prefix="d3js"
    33        categorie="outil"
    4         version="1.2.3"
     4        version="1.2.4"
    55        etat="stable"
    66        compatibilite="[3.0.0;3.1.*]"
Note: See TracChangeset for help on using the changeset viewer.