metafizzy / zdog

Flat, round, designer-friendly pseudo-3D engine for canvas & SVG
https://zzz.dog
10.38k stars 394 forks source link

v1.0.2 SVG rendering broken. checkFlatGraph is not a function #44

Closed desandro closed 5 years ago

desandro commented 5 years ago

v1.0.2 removed checkFlatGraph method, but renderGraphSvg still used it. I'll add a fix in v1.0.3. In the meantime, you can render with SVG by adding this duck punch. Add this code before your other Zdog code.

Zdog.Anchor.prototype.renderGraphSvg = function( svg ) {
  if ( !svg ) {
    throw new Error( 'svg is ' + svg + '. ' +
      'SVG required for render. Check .renderGraphSvg( svg ).' );
  }
  this.flatGraph.forEach( function( item ) {
    item.render( svg, Zdog.SvgRenderer );
  });
};
desandro commented 5 years ago

v1.1.0 has been released with this fix added. Closing this issue