Sha256: 321b4da20ae702121c11367cc45de0b1c9d10ea7b8340ab606d478a1d385c469

Contents?: true

Size: 599 Bytes

Versions: 5

Compression:

Stored size: 599 Bytes

Contents

// Copies a variable number of methods from source to target.
d3.rebind = function(target, source) {
  var i = 1, n = arguments.length, method;
  while (++i < n) target[method = arguments[i]] = d3_rebind(target, source, source[method]);
  return target;
};

// Method is assumed to be a standard D3 getter-setter:
// If passed with no arguments, gets the value.
// If passed with arguments, sets the value and returns the target.
function d3_rebind(target, source, method) {
  return function() {
    var value = method.apply(source, arguments);
    return value === source ? target : value;
  };
}

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
mdarray-sol-0.1.0-java node_modules/dc/node_modules/d3/src/core/rebind.js
stripchart-0.0.3 lib/stripchart/public/components/d3/src/core/rebind.js
stripmem-0.0.3 lib/stripmem/public/components/d3/src/core/rebind.js
stripmem-0.0.2 lib/stripmem/public/components/d3/src/core/rebind.js
stripmem-0.0.1 lib/stripmem/public/components/d3/src/core/rebind.js