Skip to content

Commit

Permalink
Clean up first showcase of tree term structure #209
Browse files Browse the repository at this point in the history
  • Loading branch information
Freymaurer committed Aug 1, 2022
1 parent 2d86dfc commit 231c649
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
6 changes: 2 additions & 4 deletions src/Client/CustomComponents/AutocompleteSearch.fs
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@ let createAutocompleteSuggestions
td [] [
Button.list [Button.List.IsRight] [
Button.a [
Button.Props [Title "Show Term Tree"]
Button.Size IsSmall
Button.Color IsBlack
Button.Color IsSuccess
Button.IsInverted
Button.OnClick(fun e ->
e.preventDefault()
Expand Down Expand Up @@ -215,8 +216,6 @@ let createAutocompleteSuggestions
]
]
]
//td [] [
//]
]
tr [
OnClick (fun e -> e.stopPropagation())
Expand Down Expand Up @@ -286,7 +285,6 @@ let autocompleteDropdownComponent (dispatch:Msg -> unit) (colorMode:ColorMode) (
OverflowY OverflowOptions.Auto
BorderWidth "0 0.5px 0.5px 0.5px"
BorderStyle "solid"

]
] [
Table.table [Table.IsFullWidth; Table.Props [ colorControl colorMode ]] [
Expand Down
4 changes: 3 additions & 1 deletion src/Client/JsBindings/Cytoscape.fs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ module JS =
abstract member fit: unit -> unit
abstract member layout: options:obj -> ILayout
abstract member bind: event:string -> element:string -> (Browser.Types.MouseEvent -> unit) -> unit
//[<Emit("$0.use($1)")>] // did not get this to work
//abstract member useJs: obj -> unit

open Types

Expand Down Expand Up @@ -66,5 +68,5 @@ module JS =
let createEdge id source target =
{|data = {|id = id; source = source; target = target|}|} |> box

[<ImportDefault("Cytoscape")>]
[<ImportDefault("cytoscape")>]
let cy(options:obj): ICytoscape = jsNative
1 change: 1 addition & 0 deletions src/Client/Pages/Cytoscape/CytoscapeGraph.fs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ module Graph =
wheelSensitivity = 0.5
|})
cy <- Some cy_ele
//cy.Value.useJS(Cytoscape.JS.cxtMenu)
centerOn(model.TargetAccession)
createClickEvent(fun e -> Browser.Dom.console.log( e.target?position() ) )
updateLayout()
Expand Down
34 changes: 18 additions & 16 deletions src/Client/Pages/Cytoscape/CytoscapeView.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,23 @@ let view (model:Model) (dispatch:Messages.Msg -> unit) =
Box.box' [] [
div [Id "cy"] []
]
Box.box' [] [
Button.a [
Button.OnClick (fun e ->
()
)
] [
str "Add Cy"
]
Button.a [
Button.OnClick (fun e ->
()
)
] [
str "Update layout"
]
]
// Box.box' [] [
// Button.a [
// Button.OnClick (fun e ->
// Browser.Dom.console.log ("")
// ()
// )
// ] [
// str "Add Cy"
// ]
// Button.a [
// Button.OnClick (fun e ->
// Cytoscape.Graph.cy.Value.center()
// ()
// )
// ] [
// str "Update layout"
// ]
// ]
]
]

0 comments on commit 231c649

Please sign in to comment.