From db20c66b3634e43049e1339ce8a0d51ee5944780 Mon Sep 17 00:00:00 2001 From: pommicket Date: Sun, 16 Oct 2016 16:04:51 -0400 Subject: Added legend to RPN --- js/complexfunctions.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'js/complexfunctions.js') diff --git a/js/complexfunctions.js b/js/complexfunctions.js index f71c23b..9703b5d 100644 --- a/js/complexfunctions.js +++ b/js/complexfunctions.js @@ -79,7 +79,7 @@ function draw() function makeCanvas(w, h) { - $("#canvas").html(); + $("#canvas").html(""); var canvas = createCanvas(w, h); canvas.parent("canvas"); domainPoints = []; @@ -104,8 +104,14 @@ $(function() animating = false; var funcs = $("#function").val().split(","); colors = []; + $("#legend").html(""); for (var i = 0; i < funcs.length; i++) + { colors.push([Math.random() * 255, Math.random() * 255, Math.random() * 255]); + $("#legend").append("
" + funcs[i] + "
"); + } drawFuncs(funcs); }); $(".form-control").keydown(function(e) -- cgit v1.2.3