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