Commit ab6b490c authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[Graph] more RangeSlider styling, removed debug logging

parent dfc80e93
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
cursor: pointer; cursor: pointer;
} }
.range-slider .knob .button { .range-slider .knob .button {
top: -7px; margin-top: -3px;
background: #f00; background: #f00;
width: 10px; width: 10px;
height: 10px; height: 10px;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
cursor: pointer cursor: pointer
.button .button
top: -7px margin-top: -3px
background: #f00 background: #f00
width: 10px width: 10px
......
...@@ -49,8 +49,8 @@ controlsToSigmaSettings { cursorSize: (cursorSize /\ _) ...@@ -49,8 +49,8 @@ controlsToSigmaSettings { cursorSize: (cursorSize /\ _)
, hideEdgesOnMove = not showEdges , hideEdgesOnMove = not showEdges
, labelMaxSize = labelSize , labelMaxSize = labelSize
, maxEdgeSize = if showEdges then 1.0 else 0.0 , maxEdgeSize = if showEdges then 1.0 else 0.0
, maxNodeSize = nodeSizeMax
, minEdgeSize = if showEdges then 1.0 else 0.0 , minEdgeSize = if showEdges then 1.0 else 0.0
, maxNodeSize = nodeSizeMax
, minNodeSize = nodeSizeMin , minNodeSize = nodeSizeMin
} }
......
...@@ -55,8 +55,8 @@ rangeSliderCpt :: R.Component Props ...@@ -55,8 +55,8 @@ rangeSliderCpt :: R.Component Props
rangeSliderCpt = R.hooksComponent "RangeSlider" cpt rangeSliderCpt = R.hooksComponent "RangeSlider" cpt
where where
cpt props _ = do cpt props _ = do
R.useEffect' $ do --R.useEffect' $ do
liftEffect $ log2 "Props: " props -- liftEffect $ log2 "Props: " props
-- scale bar -- scale bar
scaleElem <- (R.useRef null) :: R.Hooks (R.Ref (Nullable DOM.Element)) -- dom ref scaleElem <- (R.useRef null) :: R.Hooks (R.Ref (Nullable DOM.Element)) -- dom ref
...@@ -80,7 +80,7 @@ rangeSliderCpt = R.hooksComponent "RangeSlider" cpt ...@@ -80,7 +80,7 @@ rangeSliderCpt = R.hooksComponent "RangeSlider" cpt
mouseMoveHandler <- (R.useRef $ Nothing) :: R.Hooks (R.Ref (Maybe (EL.Callback Event.MouseEvent))) mouseMoveHandler <- (R.useRef $ Nothing) :: R.Hooks (R.Ref (Maybe (EL.Callback Event.MouseEvent)))
mouseUpHandler <- (R.useRef $ Nothing) :: R.Hooks (R.Ref (Maybe (EL.Callback Event.MouseEvent))) mouseUpHandler <- (R.useRef $ Nothing) :: R.Hooks (R.Ref (Maybe (EL.Callback Event.MouseEvent)))
let destroy = \_ -> do let destroy = \_ -> do
log "RangeSlider: Destroying event handlers" --log "RangeSlider: Destroying event handlers"
destroyEventHandler "mousemove" mouseMoveHandler destroyEventHandler "mousemove" mouseMoveHandler
destroyEventHandler "mouseup" mouseUpHandler destroyEventHandler "mouseup" mouseUpHandler
R.setRef mouseMoveHandler $ Nothing R.setRef mouseMoveHandler $ Nothing
...@@ -121,14 +121,14 @@ rangeSliderCpt = R.hooksComponent "RangeSlider" cpt ...@@ -121,14 +121,14 @@ 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 val
Nothing -> destroy unit Nothing -> destroy unit
let onMouseUp = EL.callback $ \(_event :: Event.MouseEvent) -> do let onMouseUp = EL.callback $ \(_event :: Event.MouseEvent) -> do
setDragKnob $ const Nothing setDragKnob $ const Nothing
destroy unit destroy unit
log "RangeSlider: Creating event handlers" --log "RangeSlider: Creating event handlers"
log2 "Clamp: " $ Range.clamp props.bounds value'.min --log2 "Clamp: " $ Range.clamp props.bounds value'.min
EL.addEventListener document "mousemove" onMouseMove EL.addEventListener document "mousemove" onMouseMove
EL.addEventListener document "mouseup" onMouseUp EL.addEventListener document "mouseup" onMouseUp
R.setRef mouseMoveHandler $ Just onMouseMove R.setRef mouseMoveHandler $ Just onMouseMove
......
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