aboutsummaryrefslogtreecommitdiff
path: root/viz.js/worker.ml
diff options
context:
space:
mode:
Diffstat (limited to 'viz.js/worker.ml')
-rwxr-xr-xviz.js/worker.ml18
1 files changed, 18 insertions, 0 deletions
diff --git a/viz.js/worker.ml b/viz.js/worker.ml
new file mode 100755
index 0000000..c6ed6f5
--- /dev/null
+++ b/viz.js/worker.ml
@@ -0,0 +1,18 @@
+open Js_of_ocaml
+
+let () =
+ Worker.import_scripts
+ [ "viz.js"
+ ; "full.render.js"
+ ]
+
+let () = Worker.set_onmessage (fun content ->
+ let (viz: Process.viz Js.t Js.constr)
+ = Js.Unsafe.global##._Viz in
+
+ let _ = Process.do_action (new%js viz) content in
+ ()
+
+
+ )
+