{
let width = 40;
let height = 100;
let leaf = Array.from([0, 10, 95, 180, 185, 270, 360], (val, i) => {
let angle = (Math.PI/180) * val;
return [ angle,
(val >= 85 && val <= 95 || val >= 265 && val < 274) ? width/2 : height/2 ];
});
let leaf2 = Array.from([0, 20, 85, 180, 185, 270, 360], (val, i) => {
let angle = (Math.PI/180) * val;
return [ angle,
(val >= 85 && val <= 95 || val >= 265 && val < 274) ? width/2 : height/2 ];
});
let leaf3 = Array.from([10, 20, 85, 180, 185, 270, 370], (val, i) => {
let angle = (Math.PI/180) * val;
return [ angle,
(val >= 85 && val <= 95 || val >= 265 && val < 274) ? width/2 : height/2 ];
});
let leaf4 = Array.from([10, 20, 85, 160, 170, 270, 340, 370], (val, i) => {
let angle = (Math.PI/180) * val;
return [ angle,
(val >= 85 && val <= 95 || val >= 265 && val < 274) ? width/2 : height/2 ];
});
let leaf5 = Array.from([0, 10, 20, 90, 180, 270, 360], (val, i) => {
let angle = (Math.PI/180) * val;
return [ angle,
(val >= 85 && val <= 95 || val >= 265 && val < 276) ? width/2 : height/2 ];
});
let leaf6 = Array.from([0, 45, 90, 125, 180, 270, 360], (val, i) => {
let angle = (Math.PI/180) * val;
return [ angle,
(val >= 45 && val <= 95 || val >= 265 && val < 276) ? width/2 * (10 / (7 - 4 * Math.cos(angle))) : height/2 ];
});
let radialCurve = d3.lineRadial().curve(d3.curveNatural)
return svg`<svg width=600 height=200>
<path d="${radialCurve(leaf)}" fill="none" stroke="green" stroke-width="2" transform="translate(50,100)"/>
<path d="${radialCurve(leaf2)}" fill="none" stroke="green" stroke-width="2" transform="translate(150,100)"/>
<path d="${radialCurve(leaf3)}" fill="none" stroke="green" stroke-width="2" transform="translate(250,100)"/>
<path d="${radialCurve(leaf4)}" fill="none" stroke="green" stroke-width="2" transform="translate(350,100)"/>
<path d="${radialCurve(leaf5)}" fill="none" stroke="green" stroke-width="2" transform="translate(450,100)"/>
<path d="${radialCurve(leaf6)}" fill="none" stroke="blue" stroke-width="2" transform="translate(550,100)"/>`;
}