Commit 41b2021e authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[Graph] RangeSlider calls the onChange event now

parent ab6b490c
...@@ -76,7 +76,7 @@ type SigmaSettings = ...@@ -76,7 +76,7 @@ type SigmaSettings =
, defaultHoverLabelColor :: String , defaultHoverLabelColor :: String
, defaultLabelColor :: String , defaultLabelColor :: String
-- , defaultLabelHoverColor :: String -- , defaultLabelHoverColor :: String
-- , defaultLabelSize :: String , defaultLabelSize :: Number
, defaultNodeBorderColor :: String , defaultNodeBorderColor :: String
, defaultNodeColor :: String , defaultNodeColor :: String
-- , defaultNodeHoverColor :: String -- , defaultNodeHoverColor :: String
...@@ -112,7 +112,6 @@ type SigmaSettings = ...@@ -112,7 +112,6 @@ type SigmaSettings =
-- , labelHoverColor :: String -- , labelHoverColor :: String
-- , labelHoverShadow :: String -- , labelHoverShadow :: String
-- , labelHoverShadowColor :: String -- , labelHoverShadowColor :: String
, labelMaxSize :: Number
, labelSize :: String , labelSize :: String
, labelSizeRatio :: Number , labelSizeRatio :: Number
, labelThreshold :: Number , labelThreshold :: Number
...@@ -165,6 +164,7 @@ sigmaSettings = ...@@ -165,6 +164,7 @@ sigmaSettings =
, defaultHoverLabelBGColor: "#fff" , defaultHoverLabelBGColor: "#fff"
, defaultHoverLabelColor: "#000" , defaultHoverLabelColor: "#000"
, defaultLabelColor: "#000" -- labels text color , defaultLabelColor: "#000" -- labels text color
, defaultLabelSize: 3.0 -- (old tina: showLabelsIfZoom)
, defaultNodeBorderColor: "black" -- <- if nodeBorderColor = 'default' , defaultNodeBorderColor: "black" -- <- if nodeBorderColor = 'default'
, defaultNodeColor: "#ddd" , defaultNodeColor: "#ddd"
, drawEdgeLabels: true , drawEdgeLabels: true
...@@ -176,7 +176,6 @@ sigmaSettings = ...@@ -176,7 +176,6 @@ sigmaSettings =
, font: "Droid Sans" -- font params , font: "Droid Sans" -- font params
, fontStyle: "bold" , fontStyle: "bold"
, hideEdgesOnMove: true , hideEdgesOnMove: true
, labelMaxSize: 3.0 -- (old tina: showLabelsIfZoom)
, labelSize : "proportional" , labelSize : "proportional"
, labelSizeRatio: 2.0 -- label size in ratio of node size , labelSizeRatio: 2.0 -- label size in ratio of node size
, labelThreshold: 2.0 -- min node cam size to start showing label , labelThreshold: 2.0 -- min node cam size to start showing label
......
...@@ -44,10 +44,10 @@ controlsToSigmaSettings { cursorSize: (cursorSize /\ _) ...@@ -44,10 +44,10 @@ controlsToSigmaSettings { cursorSize: (cursorSize /\ _)
, labelSize: (labelSize /\ _) , labelSize: (labelSize /\ _)
, nodeSize: (Range.Closed { min: nodeSizeMin, max: nodeSizeMax } /\ _) , nodeSize: (Range.Closed { min: nodeSizeMin, max: nodeSizeMax } /\ _)
, showEdges: (showEdges /\ _)} = Graph.sigmaSettings { , showEdges: (showEdges /\ _)} = Graph.sigmaSettings {
drawEdges = showEdges defaultLabelSize = labelSize
, drawEdges = showEdges
, drawEdgeLabels = showEdges , drawEdgeLabels = showEdges
, hideEdgesOnMove = not showEdges , hideEdgesOnMove = not showEdges
, labelMaxSize = labelSize
, maxEdgeSize = if showEdges then 1.0 else 0.0 , maxEdgeSize = if showEdges then 1.0 else 0.0
, minEdgeSize = if showEdges then 1.0 else 0.0 , minEdgeSize = if showEdges then 1.0 else 0.0
, maxNodeSize = nodeSizeMax , maxNodeSize = nodeSizeMax
......
...@@ -12,12 +12,12 @@ import Data.Nullable (Nullable, null, toMaybe) ...@@ -12,12 +12,12 @@ import Data.Nullable (Nullable, null, toMaybe)
import Data.Traversable (traverse_) import Data.Traversable (traverse_)
import Data.Tuple.Nested ((/\)) import Data.Tuple.Nested ((/\))
import DOM.Simple as DOM import DOM.Simple as DOM
import DOM.Simple.Console (log, log2)
import DOM.Simple.Document (document) import DOM.Simple.Document (document)
import DOM.Simple.Element as Element import DOM.Simple.Element as Element
import DOM.Simple.Event as Event
import DOM.Simple.EventListener as EL import DOM.Simple.EventListener as EL
import DOM.Simple.Types (DOMRect, Element) import DOM.Simple.Types (DOMRect, Element)
import DOM.Simple.Event as Event
import DOM.Simple.Console (log, log2)
import Effect (Effect) import Effect (Effect)
import Effect.Class (liftEffect) import Effect.Class (liftEffect)
import Effect.Uncurried (EffectFn1, mkEffectFn1) import Effect.Uncurried (EffectFn1, mkEffectFn1)
...@@ -122,9 +122,10 @@ rangeSliderCpt = R.hooksComponent "RangeSlider" cpt ...@@ -122,9 +122,10 @@ rangeSliderCpt = R.hooksComponent "RangeSlider" cpt
case reproject drag scalePos props.bounds (R2.domMousePosition event) of case reproject drag scalePos props.bounds (R2.domMousePosition event) of
Just val -> do Just val -> do
--log2 "reproject val" val --log2 "reproject val" val
setKnob knob setValue value val setKnob knob setValue value $ round props.epsilon props.bounds val
Nothing -> destroy unit Nothing -> destroy unit
let onMouseUp = EL.callback $ \(_event :: Event.MouseEvent) -> do let onMouseUp = EL.callback $ \(_event :: Event.MouseEvent) -> do
props.onChange value
setDragKnob $ const Nothing setDragKnob $ const Nothing
destroy unit destroy unit
--log "RangeSlider: Creating event handlers" --log "RangeSlider: Creating event handlers"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment