This Visualisation was developed by Ankit Sharma as LearnTrees. See the repo
The Logic is being developed by Agha Muhammad Aslam and Team. It is being intended for the Portfolio project of Algorithm and Data Structure.
This project is a tool for visualizing binary trees effectively. It provides insight into how binary trees are constructed, modified, and traversed, offering a detailed view of their structure. This tool is particularly helpful for learning and teaching purposes, as it includes a feature set tailored to guide users through the complexities of binary tree operations.
- Visualize binary trees with clear and interactive diagrams.
- Track history changes to see how nodes are added and removed incrementally.
- Provides full modification history for analyzing the evolution of a tree structure.
- Track individual node changes step by step.
- Replay modifications to learn tree operations visually and intuitively.
This project introduces real-time interaction with a history-tracking feature.
- Animation for each step in the history of tree changes. This would enable a fully interactive and visually engaging experience for users.
- Dynamic resizing of the pane and nodes to prevent overlaps and maintain a clear layout, regardless of tree size.
- JDK 23 (not only a Java Runtime Environment). The Maven compiler configuration targets Java 23; Java 27 does not work with this project's JavaFX 23 WebView dependency.
- Apache Maven.
- Graphviz (
dot) for tree-image rendering. On macOS, install it withbrew install graphvizif rendering reports that no Graphviz engine could be initialized.
On macOS, select JDK 23 in the Terminal session (if you installed a JDK archive manually, set JAVA_HOME to its Contents/Home directory instead):
export JAVA_HOME=$(/usr/libexec/java_home -v 23)
export PATH="$JAVA_HOME/bin:$PATH"
java -version
mvn -versionClone and run the application:
git clone https://github.com/MusLead/BinaryTreeHSF_Visualisation.git
cd BinaryTreeHSF_Visualisation
mvn clean javafx:runRun Maven from the directory containing pom.xml. Maven downloads the JavaFX dependencies on the first run.
These commands build an .app using JDK 23 and the Maven dependencies. Run them from a local project directory outside iCloud Drive: Finder metadata on an app generated inside iCloud Drive can make macOS code signing fail. Confirm "$JAVA_HOME/bin/java" -version reports 23 before building.
mvn clean package dependency:copy-dependencies \
-DincludeScope=runtime \
-DoutputDirectory=target/app-input
mkdir -p target/app-mods
cp target/BinaryTreeVis-1.0-SNAPSHOT.jar target/app-mods/
find target/app-input -maxdepth 1 -type f -name '*.jar' \
! -name 'javafx-*.jar' -exec cp {} target/app-mods/ \;
cp target/app-input/javafx-*-mac-aarch64.jar target/app-mods/
"$JAVA_HOME/bin/jpackage" \
--type app-image \
--name BinaryTreeVis \
--app-version 1.0.0 \
--module-path "$PWD/target/app-mods" \
--module de.hsfd.binarytreevis/de.hsfd.binarytreevis.Main \
--runtime-image "$JAVA_HOME" \
--dest targetThe app will be at target/BinaryTreeVis.app. It includes a Java runtime, so users of the packaged app do not need to install a JDK. This build is for Apple Silicon Macs; build separately for other platforms. Test the launcher and tree rendering before sharing:
./target/BinaryTreeVis.app/Contents/MacOS/BinaryTreeVisIf Finder opens no window, this Terminal command displays the launch error. The app bundle has not yet been verified as a distributable release.
After the app works, compress the entire .app bundle (it is a directory) into a ZIP file:
ditto -c -k --keepParent target/BinaryTreeVis.app BinaryTreeVis-macos-arm64-v1.0.0.zipCreate a GitHub Release for a version tag such as v1.0.0 and attach the ZIP as a release asset. Share the release link; GitHub's automatically generated “Source code” ZIP contains the source, not the compiled app. Do not commit target/ or the app bundle to the Git repository (target/ is already ignored). Compressing the app reduces download size and keeps its bundle together, but you still need to compile once per version or whenever the code changes. Users can download the ZIP and run that built version without compiling it.
An ad hoc signed app may be stopped by macOS Gatekeeper after download. For smooth public distribution, sign with an Apple Developer ID and notarize the app before publishing the ZIP.
This project is licensed under the MIT License. See the LICENSE file for details.
- SLF4J, SLF4J-NOP MavenRep solving the Warning because using the WebView
- Graphviz for showing the tree image in the WebView
- Markdown based for java dependency. txtmark GitHub
- Markdown-pd-fx is an example how to implement the markdown dependency in the WebView.
- StackOverflow idea, for showing image in the WebView rather than using the TextArea
- BinaryTreeHSF the logic behind the Binary Tree Implementations such as RB-Tree, AVL-Tree, and Binary Search Tree