Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
276db39a
Commit
276db39a
authored
Sep 11, 2019
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Graph] range slider styling fixes
parent
4b83e30d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
7 deletions
+40
-7
range-slider.css
dist/styles/range-slider.css
+11
-1
range-slider.sass
dist/styles/range-slider.sass
+12
-3
RangeControl.purs
src/Gargantext/Components/GraphExplorer/RangeControl.purs
+1
-1
RangeSlider.purs
src/Gargantext/Components/RangeSlider.purs
+16
-2
No files found.
dist/styles/range-slider.css
View file @
276db39a
...
@@ -6,7 +6,16 @@
...
@@ -6,7 +6,16 @@
}
}
.range
.range-slider
.scale
{
.range
.range-slider
.scale
{
position
:
absolute
;
position
:
absolute
;
background-color
:
#555
;
width
:
100%
;
height
:
3px
;
margin-top
:
2px
;
background-color
:
#d8d8d8
;
}
.range
.range-slider
.scale-sel
{
position
:
absolute
;
background-color
:
#27c470
;
width
:
100%
;
height
:
7px
;
}
}
.range
.range-slider
.knob
{
.range
.range-slider
.knob
{
position
:
absolute
;
position
:
absolute
;
...
@@ -16,6 +25,7 @@
...
@@ -16,6 +25,7 @@
-ms-user-select
:
none
;
-ms-user-select
:
none
;
user-select
:
none
;
user-select
:
none
;
-o-user-select
:
none
;
-o-user-select
:
none
;
margin-top
:
-2px
;
}
}
.range
.range-slider
.knob
.button
{
.range
.range-slider
.knob
.button
{
margin-top
:
-3px
;
margin-top
:
-3px
;
...
...
dist/styles/range-slider.sass
View file @
276db39a
...
@@ -6,7 +6,16 @@
...
@@ -6,7 +6,16 @@
.scale
.scale
position
:
absolute
position
:
absolute
background-color
:
#555
width
:
100%
height
:
3px
margin-top
:
2px
background-color
:
#d8d8d8
.scale-sel
position
:
absolute
background-color
:
rgb
(
39
,
196
,
112
)
width
:
100%
height
:
7px
.knob
.knob
position
:
absolute
position
:
absolute
...
@@ -17,11 +26,11 @@
...
@@ -17,11 +26,11 @@
user-select
:
none
user-select
:
none
-o-user-select
:
none
-o-user-select
:
none
margin-top
:
-2px
.button
.button
margin-top
:
-3px
margin-top
:
-3px
//background: #f00
background
:
#eee
background
:
#eee
width
:
30px
width
:
30px
height
:
20px
height
:
20px
//border-radius: 50%
src/Gargantext/Components/GraphExplorer/RangeControl.purs
View file @
276db39a
...
@@ -29,7 +29,7 @@ rangeControlCpt = R.hooksComponent "RangeButton" cpt
...
@@ -29,7 +29,7 @@ rangeControlCpt = R.hooksComponent "RangeButton" cpt
where
where
cpt {caption, sliderProps} _ = do
cpt {caption, sliderProps} _ = do
pure $
pure $
H.span {className: "range"}
H.span {className: "range
text-center
"}
[ H.label {} [ H.text caption ]
[ H.label {} [ H.text caption ]
, RS.rangeSlider sliderProps
, RS.rangeSlider sliderProps
]
]
...
...
src/Gargantext/Components/RangeSlider.purs
View file @
276db39a
...
@@ -65,6 +65,8 @@ rangeSliderCpt = R.hooksComponent "RangeSlider" cpt
...
@@ -65,6 +65,8 @@ rangeSliderCpt = R.hooksComponent "RangeSlider" cpt
-- 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
-- scale sel bar
scaleSelElem <- (R.useRef null) :: R.Hooks (R.Ref (Nullable DOM.Element)) -- dom ref
-- low knob
-- low knob
lowElem <- (R.useRef null) :: R.Hooks (R.Ref (Nullable DOM.Element)) -- a dom ref to the low knob
lowElem <- (R.useRef null) :: R.Hooks (R.Ref (Nullable DOM.Element)) -- a dom ref to the low knob
-- high knob
-- high knob
...
@@ -109,6 +111,7 @@ rangeSliderCpt = R.hooksComponent "RangeSlider" cpt
...
@@ -109,6 +111,7 @@ rangeSliderCpt = R.hooksComponent "RangeSlider" cpt
Nothing -> destroy unit
Nothing -> destroy unit
pure $ H.div { className, aria }
pure $ H.div { className, aria }
[ renderScale scaleElem props value
[ renderScale scaleElem props value
, renderScaleSel scaleSelElem props value
, renderKnob MinKnob lowElem value props.bounds setDragKnob precision
, renderKnob MinKnob lowElem value props.bounds setDragKnob precision
, renderKnob MaxKnob highElem value props.bounds setDragKnob precision
, renderKnob MaxKnob highElem value props.bounds setDragKnob precision
]
]
...
@@ -145,11 +148,22 @@ getDragScale knob scalePos lowPos highPos = do
...
@@ -145,11 +148,22 @@ getDragScale knob scalePos lowPos highPos = do
renderScale :: R.Ref (Nullable DOM.Element) -> Record Props -> Range.NumberRange -> R.Element
renderScale :: R.Ref (Nullable DOM.Element) -> Record Props -> Range.NumberRange -> R.Element
renderScale ref {width,height} (Range.Closed {min, max}) =
renderScale ref {width,height} (Range.Closed {min, max}) =
H.div { ref, className, width, height, aria
, style
} []
H.div { ref, className, width, height, aria } []
where
where
className = "scale"
className = "scale"
aria = { label: "Scale running from " <> show min <> " to " <> show max }
aria = { label: "Scale running from " <> show min <> " to " <> show max }
style = { width: "100%", height: "3px" }
renderScaleSel :: R.Ref (Nullable DOM.Element) -> Record Props -> Range.NumberRange -> R.Element
renderScaleSel ref props (Range.Closed {min, max}) =
H.div { ref, className, style} []
where
className = "scale-sel"
style = {left: computeLeft, width: computeWidth}
percOffsetMin = Range.normalise props.bounds min
percOffsetMax = Range.normalise props.bounds max
computeLeft = (show $ 100.0 * percOffsetMin) <> "%"
computeWidth = (show $ 100.0 * (percOffsetMax - percOffsetMin)) <> "%"
renderKnob :: Knob -> R.Ref (Nullable DOM.Element) -> Range.NumberRange -> Bounds -> R2.StateSetter (Maybe Knob) -> Int -> R.Element
renderKnob :: Knob -> R.Ref (Nullable DOM.Element) -> Range.NumberRange -> Bounds -> R2.StateSetter (Maybe Knob) -> Int -> R.Element
renderKnob knob ref (Range.Closed value) bounds set precision =
renderKnob knob ref (Range.Closed value) bounds set precision =
...
...
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