var key = R.prop('key') var value = R.prop('value') var window2 = R.aperture(2) function bind0(rootSelection, cssClass, element, dataFlow) { element = element || 'g' // fixme switch from variadic to curried dataFlow = typeof dataFlow === 'function' ? dataFlow : (dataFlow === void(0) ? function(d) {return [d]} : R.always(dataFlow)) var binding = rootSelection.selectAll('.' + cssClass).data(dataFlow, key) binding.entered = binding.enter().append(element) binding.entered.classed(cssClass, true) return binding } function bind(object, key) { var result = bind0.apply(null, arguments) object[key] = result return result } function translate(funX, funY) { return function(d, i) { var x = typeof funX === 'function' ? funX(d, i) : funX var y = typeof funY === 'function' ? funY(d, i) : funY if(isNaN(x)) throw Error('x is NaN') if(isNaN(y)) throw Error('y is NaN') return 'translate(' + x + ',' + y + ')' } } function translateX(funX) { return function(d, i) { return 'translate(' + (typeof funX === 'function' ? funX(d, i) : funX) + ', 0)' } } function translateY(funY) { return function(d, i) { return 'translate(0, ' + (typeof funY === 'function' ? funY(d, i) : funY) + ')' } }