// Create the graph var heart = new CliGraph({ height: 40, width: 40 }); // Constants const K = 100 , STEP = 0.01 ; // Add points for (var i = -K; i <= K; i += STEP) { heart.addPoint( 16 * Math.pow(Math.sin(i), 3) , 13 * Math.cos(i) - 5 * Math.cos(2 * i) - 2 * Math.cos(3 * i) - Math.cos(4 * i) ); } // Export the graph window.__graph = heart.toString();