-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
98 additions
and
22 deletions.
There are no files selected for viewing
20 changes: 10 additions & 10 deletions
20
Frontend/algoverse/src/components/infoContainer/applications.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
import React from 'react'; | ||
import React from "react"; | ||
import "./Applications.css"; | ||
import { useSearchParams } from "react-router-dom"; | ||
import algorithmTexts from "./applicationsText.json" | ||
|
||
import algorithmApplicationsTexts from "./applicationsText.json"; | ||
|
||
function Applications() { | ||
const [searchParams] = useSearchParams(); | ||
const algorithm = searchParams.get("algorithm"); | ||
|
||
|
||
const applicationsText = algorithmTexts[algorithm] || "Default"; | ||
|
||
let applicationsText = | ||
algorithmApplicationsTexts[algorithm]?.applications || "Default"; | ||
|
||
return ( | ||
<> | ||
<div className='applicationsContainer'> | ||
{applicationsText} | ||
</div> | ||
<div className="applicationsContainer"> | ||
<h1> PseudoCode </h1> | ||
{applicationsText.map((step, index) => ( | ||
<p key={index}>{step}</p> | ||
))} | ||
</div> | ||
</> | ||
); | ||
} | ||
|
||
export default Applications; | ||
|
45 changes: 41 additions & 4 deletions
45
Frontend/algoverse/src/components/infoContainer/applicationsText.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,44 @@ | ||
{ | ||
"Dijkstra": "This is the text content for Algorithm 1. It can be as long or as short as you need it to be.", | ||
"BFS": "Text content for Algorithm 2 goes here. You can include detailed descriptions, instructions, or any other relevant information.", | ||
"DFS": "Here's the text for Algorithm 3. Remember, you can customize this text to suit your application's needs.", | ||
"AStar": "This is default text to be shown when no specific algorithm is selected or if the algorithm is not found in this list." | ||
"Dijkstra": { | ||
"description": "Finds the shortest paths from a source to all vertices in the given graph", | ||
"applications": [ | ||
"apple", | ||
"banana", | ||
"cherry" | ||
] | ||
}, | ||
"BFS": { | ||
"description": "Finds the shortest paths from a source to all vertices in the given graph", | ||
"applications": [ | ||
"apple", | ||
"banana", | ||
"cherry" | ||
] | ||
}, | ||
"DFS": { | ||
"description": "Finds the shortest paths from a source to all vertices in the given graph", | ||
"applications": [ | ||
"apple", | ||
"banana", | ||
"cherry" | ||
] | ||
}, | ||
"AStar": { | ||
"description": "Finds the shortest paths from a source to all vertices in the given graph", | ||
"applications": [ | ||
"apple", | ||
"banana", | ||
"cherry" | ||
] | ||
}, | ||
"BubbleSort": { | ||
"description": "A simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order.", | ||
"steps": [ | ||
"apple", | ||
"banana", | ||
"cherry" | ||
] | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 42 additions & 4 deletions
46
Frontend/algoverse/src/components/infoContainer/pseudoCodeText.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,44 @@ | ||
{ | ||
"Dijkstra": "This is the text content for Algorithm 1. It can be as long or as short as you need it to be.", | ||
"BFS": "Text content for Algorithm 2 goes here. You can include detailed descriptions, instructions, or any other relevant information.", | ||
"DFS": "Here's the text for Algorithm 3. Remember, you can customize this text to suit your application's needs.", | ||
"AStar": "This is default text to be shown when no specific algorithm is selected or if the algorithm is not found in this list." | ||
"Dijkstra": { | ||
"description": "Finds the shortest paths from a source to all vertices in the given graph", | ||
"steps": [ | ||
"apple", | ||
"banana", | ||
"cherry" | ||
] | ||
}, | ||
"BFS": { | ||
"description": "Finds the shortest paths from a source to all vertices in the given graph", | ||
"steps": [ | ||
"apple", | ||
"banana", | ||
"cherry" | ||
] | ||
}, | ||
"DFS": { | ||
"description": "Finds the shortest paths from a source to all vertices in the given graph", | ||
"steps": [ | ||
"apple", | ||
"banana", | ||
"cherry" | ||
] | ||
}, | ||
"AStar": { | ||
"description": "Finds the shortest paths from a source to all vertices in the given graph", | ||
"steps": [ | ||
"apple", | ||
"banana", | ||
"cherry" | ||
] | ||
}, | ||
"BubbleSort": { | ||
"description": "A simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order.", | ||
"steps": [ | ||
"apple", | ||
"banana", | ||
"cherry" | ||
] | ||
} | ||
|
||
} | ||
|