0

I would like to create a projection like:

var p1 = d3.geo.cylindricalEqualArea()
  .scale(200)
  .translate([0, 30]);

then clone that:

var p2 = someCloneFunction(p1)
  .scale(600)
  .translate([-10, 0]);

and leave p1 unaffected.

trebor
  • 73
  • 7
  • [This question](http://stackoverflow.com/questions/122102/what-is-the-most-efficient-way-to-clone-an-object) should help. – Lars Kotthoff Dec 04 '14 at 09:45
  • the projection object is a function and some properties and thus i think special code needs to be written. this: var clone = $.extend(true, {}, projection); does not work. – trebor Dec 05 '14 at 01:58
  • Have you tried the approach that converts it to JSON and back? – Lars Kotthoff Dec 05 '14 at 09:23
  • @LarsKotthoff ya, i ran though all the different ideas in that question. some pretty creative stuff, but no luck. – trebor Dec 05 '14 at 19:00

0 Answers0