From ddea5bc7050ecae2081cb7ed7a7c2ee206a53e8f Mon Sep 17 00:00:00 2001 From: karishmarajput Date: Tue, 26 Oct 2021 10:40:16 +0530 Subject: translated points table added --- package-lock.json | 5 +++++ package.json | 1 + src/algorithms/2d-transformations/Translation.svelte | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+) diff --git a/package-lock.json b/package-lock.json index 3d045f1..854382a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -336,6 +336,11 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, + "install": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/install/-/install-0.13.0.tgz", + "integrity": "sha512-zDml/jzr2PKU9I8J/xyZBQn8rPCAY//UOYNmR01XwNwyfhEWObo2SWfSl1+0tm1u6PhxLwDnfsT/6jB7OUxqFA==" + }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", diff --git a/package.json b/package.json index e603567..8b88b43 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "svelte": "^3.0.0" }, "dependencies": { + "install": "^0.13.0", "plotly.js-basic-dist-min": "^2.5.1", "sirv-cli": "^1.0.0" } diff --git a/src/algorithms/2d-transformations/Translation.svelte b/src/algorithms/2d-transformations/Translation.svelte index 9ce71da..1fff3e9 100644 --- a/src/algorithms/2d-transformations/Translation.svelte +++ b/src/algorithms/2d-transformations/Translation.svelte @@ -108,6 +108,24 @@ {/each} +

Translation Points

+ + + + + + + + + + {#each translatedPointsArray.x as _, i} + + + + + {/each} + +
xy
{translatedPointsArray.x[i]}{translatedPointsArray.y[i]}
{/if}
-- cgit 1.4.1-2-gfad0 From 1e32d683ea9006617fc0d69270d6d501773564d6 Mon Sep 17 00:00:00 2001 From: karishmarajput Date: Tue, 26 Oct 2021 10:47:03 +0530 Subject: uninstalled install --- package-lock.json | 5 ----- package.json | 1 - 2 files changed, 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 854382a..3d045f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -336,11 +336,6 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "install": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/install/-/install-0.13.0.tgz", - "integrity": "sha512-zDml/jzr2PKU9I8J/xyZBQn8rPCAY//UOYNmR01XwNwyfhEWObo2SWfSl1+0tm1u6PhxLwDnfsT/6jB7OUxqFA==" - }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", diff --git a/package.json b/package.json index 8b88b43..e603567 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ "svelte": "^3.0.0" }, "dependencies": { - "install": "^0.13.0", "plotly.js-basic-dist-min": "^2.5.1", "sirv-cli": "^1.0.0" } -- cgit 1.4.1-2-gfad0 From 68f660b33890ab8fc9db1552ae71dff0dd9c2c45 Mon Sep 17 00:00:00 2001 From: karishmarajput Date: Tue, 26 Oct 2021 11:18:51 +0530 Subject: Make translatedPointsArray global --- src/algorithms/2d-transformations/Translation.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/algorithms/2d-transformations/Translation.svelte b/src/algorithms/2d-transformations/Translation.svelte index 4ae0ef7..0416f2b 100644 --- a/src/algorithms/2d-transformations/Translation.svelte +++ b/src/algorithms/2d-transformations/Translation.svelte @@ -22,10 +22,13 @@ function deletePoint(id) { points = points.filter(item => item.id !== Number(id)); } +let translatedPointsArray = {x: [], y: []}; function translatePoints() { + // Reset values. + translatedPointsArray = {x: [], y: []}; + let pointsArray = {x: [], y: []}; - let translatedPointsArray = {x: [], y: []}; // Store the points in a matrix like array. for (const point of points) { -- cgit 1.4.1-2-gfad0