diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 42fb4b7..4491dac 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v3.2.0
+ rev: v4.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
diff --git a/comparator.html b/comparator.html
index fee8fcd..bf67071 100755
--- a/comparator.html
+++ b/comparator.html
@@ -2,67 +2,100 @@
-
-
+
+
+
-
-
-
-
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/comparator_visualization.js b/comparator_visualization.js
index c73541d..61fe743 100644
--- a/comparator_visualization.js
+++ b/comparator_visualization.js
@@ -45,6 +45,24 @@ function deleteCallback() {
return false;
}
+function switchTree(TreeType, side) {
+ let [lType, rType] =
+ side == "left"
+ ? [TreeType, right.constructor]
+ : [left.constructor, TreeType];
+
+ left = new lType();
+ left.recorder = lRecorder;
+
+ right = new rType();
+ right.recorder = rRecorder;
+
+ for (let t of [left, right]) {
+ t.recorder.clear();
+ t.record();
+ }
+}
+
async function render() {
await Promise.all([
new Promise(() => lRecorder.render()),
diff --git a/index.html b/index.html
index 9df58c2..2fb3a9f 100755
--- a/index.html
+++ b/index.html
@@ -2,11 +2,6 @@
-
-