Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Benoit Barbot
GraphEditor
Commits
af88e59a
Commit
af88e59a
authored
Oct 05, 2020
by
Benoit Barbot
Browse files
progress
parent
88e3d480
Pipeline
#1739
failed with stage
in 26 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
TAEditor/ta_editor.ml
0 → 100644
View file @
af88e59a
open
Js_of_ocaml
open
UtilsWeb
module
TAGraphEd
=
GraphDrawing
.
GraphEditor
(
SimpleGraph
.
S
(
TAGraph
))
let
_
=
let
create_form
=
div
[]
in
let
canvas
=
let
ca
=
Dom_html
.(
createCanvas
document
)
in
ca
##.
width
:=
2048
;
ca
##.
height
:=
1024
;
ca
in
let
slider
=
let
sl
=
Dom_html
.(
createInput
~_
type
:
(
Js
.
string
"range"
)
document
)
in
sl
##.
value
:=
Js
.
string
"40"
;
sl
##.
id
:=
Js
.
string
"zoomslider"
;
sl
in
let
attribute_list_div
=
let
div
=
Dom_html
.(
createDiv
document
)
in
append_node
div
(
ul
~
id
:
"attributelist"
[]
);
div
in
let
attribute_div
=
div
~
class_
:
"attributelistdiv"
[
(
attribute_list_div
:>
Dom
.
node
Js
.
t
)
]
in
let
graph_editor
=
div
~
class_
:
"row jumbotron"
[
div
~
class_
:
"col-8"
[
create_form
;
div
~
class_
:
"container"
[
(
let
dr
=
div_raw
~
class_
:
"graph_editor_canvas"
[
(
canvas
:>
Dom
.
node
Js
.
t
)
]
in
(*dr##.oncontextmenu := (fun _ -> ());*)
(
dr
:>
Dom
.
node
Js
.
t
))
;
div
~
class_
:
"zoom_slider"
[
txt
"zoom: "
;
(
slider
:>
Dom
.
node
Js
.
t
)]
]];
div
~
class_
:
"col-4"
[
attribute_div
]
]
in
run
@@
fun
()
->
let
ed
=
TAGraphEd
.
init
canvas
attribute_list_div
create_form
slider
in
TAGraphEd
.
init_client
ed
;
graph_editor
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment