From 1b8ea9912913b11bb34d283ba492fe40eaced3d6 Mon Sep 17 00:00:00 2001 From: Andinus Date: Sun, 10 Oct 2021 19:35:59 +0530 Subject: Plot graph when plotly is ready --- src/algorithms/line-drawing/DDA.svelte | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/algorithms/line-drawing/DDA.svelte b/src/algorithms/line-drawing/DDA.svelte index bee2c16..b759cdc 100644 --- a/src/algorithms/line-drawing/DDA.svelte +++ b/src/algorithms/line-drawing/DDA.svelte @@ -5,7 +5,10 @@ let solved = false; let plotlyReady = false; - const plotlyLoaded = () => plotlyReady = true; + const plotlyLoaded = () => { + plotlyReady = true; + dda(); + } let x0 = 0, y0 = 0, x1 = 4, y1 = 4; let dx, dy; @@ -121,7 +124,7 @@

Graph

{#if plotlyReady === false} - {alert("Cannot plot graph: Plotly is not ready. Try again.")} +

Cannot plot graph: Plotly is not ready.

-- cgit 1.4.1-2-gfad0