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
f70dc5a7
Commit
f70dc5a7
authored
Aug 18, 2023
by
Fabien Manière
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better phylo form, part 2
parent
07ecded6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
853 additions
and
773 deletions
+853
-773
ConfigForm.purs
...argantext/Components/PhyloExplorer/Config/ConfigForm.purs
+853
-773
No files found.
src/Gargantext/Components/PhyloExplorer/Config/ConfigForm.purs
View file @
f70dc5a7
...
...
@@ -165,6 +165,7 @@ component = R.hooksComponent "configForm" cpt where
H.div
{ className: intercalate " "
[ "form-group"
, "mb-1"
]
}
[
...
...
@@ -207,6 +208,7 @@ component = R.hooksComponent "configForm" cpt where
H.div
{ className: intercalate " "
[ "form-group"
, "mb-1"
, (fv.hasError' "period") ?
"form-group--error" $
mempty
...
...
@@ -243,6 +245,7 @@ component = R.hooksComponent "configForm" cpt where
H.div
{ className: intercalate " "
[ "form-group"
, "mb-1"
, (fv.hasError' "step") ?
"form-group--error" $
mempty
...
...
@@ -279,6 +282,7 @@ component = R.hooksComponent "configForm" cpt where
H.div
{ className: intercalate " "
[ "form-group"
, "mb-1"
, (fv.hasError' "matchingFrame") ?
"form-group--error" $
mempty
...
...
@@ -318,7 +322,10 @@ component = R.hooksComponent "configForm" cpt where
[
H.div
{ className: intercalate " "
[ "form-group my-1 text-center"
[ "form-group"
, "mt-0"
, "mb-1"
, "text-center"
, (fv.hasError' "quality") ?
"form-group--error" $
mempty
...
...
@@ -375,98 +382,24 @@ component = R.hooksComponent "configForm" cpt where
]
,
B.fieldset
{ className: "phylo-config-form__group"
, titleSlot: H.text "Clusterisation algorythm"
}
[
-- Support
H.div
{ className: intercalate " "
[ "form-group"
, (fv.hasError' "support") ?
"form-group--error" $
mempty
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Support" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formInput $
bindStateKey "support"
,
R2.when (fv.hasError' "support") $
H.div
{ className: "form-group__error" }
[
H.text "Please enter an `Int` value (eg. 3)"
]
]
]
,
-- Size
H.div
{ className: intercalate " "
[ "form-group"
, (fv.hasError' "size") ?
"form-group--error" $
mempty
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Size" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formInput $
bindStateKey "size"
,
R2.when (fv.hasError' "sjze") $
H.div
{ className: "form-group__error" }
[
H.text "Please enter an `Int` value (eg. 3)"
]
]
]
]
,
-- Clique
-- Clusterisation algo
B.fieldset
{ className: "phylo-config-form__group"
, titleSlot: H.text "Cl
ique
algorithm"
{ className: "phylo-config-form__group
mx-0
"
, titleSlot: H.text "Cl
usterisation
algorithm"
}
[
H.div
{ className: "phylo-config-form__row" }
[
H.div
{ className: "phylo-config-form__col" }
[
-- Clique type
-- Mode
H.div
{ className: intercalate " "
[ "form-group
"
[ "form-group text-center mb-2
"
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Typ
e" ]
H.label {} [ H.text "Mod
e" ]
]
,
H.div
...
...
@@ -486,7 +419,7 @@ component = R.hooksComponent "configForm" cpt where
""
}
[
H.text "FIS
"
H.text "Basic
"
]
,
B.button
...
...
@@ -498,23 +431,35 @@ component = R.hooksComponent "configForm" cpt where
""
}
[
H.text "MaxClique"
]
H.text "Expert"
]
]
]
]
,
-- TYPE::FIS_
H.div
{ className: "" }
[
-- Mode Basic / TYPE::FIS_
R2.when (state.cliqueType == show FIS_) $
H.div { className: "clustrisation-algorythm-basic form-group" }
[
-- Title FIS
H.div
{ className: "form-group__label text-center" }
[
H.label {} [ H.text "FIS" ]
]
,
H.div
{ className: "phylo-config-form__col
" }
{ className: "phylo-config-form__row justify-content-center
" }
[
-- Support
H.div
{ className: intercalate " "
[ "form-group
"
[ "form-group col-4 w-10 text-center mb-0
"
, (fv.hasError' "support") ?
"form-group--error" $
mempty
...
...
@@ -522,7 +467,7 @@ component = R.hooksComponent "configForm" cpt where
}
[
H.div
{ className: "form-group__label
" }
{ className: "
" }
[
H.label {} [ H.text "Support" ]
]
...
...
@@ -531,7 +476,8 @@ component = R.hooksComponent "configForm" cpt where
{ className: "form-group__field" }
[
B.formInput $
bindStateKey "support"
{ type: "number"
} `merge` bindStateKey "support"
,
R2.when (fv.hasError' "support") $
H.div
...
...
@@ -545,7 +491,7 @@ component = R.hooksComponent "configForm" cpt where
-- Size
H.div
{ className: intercalate " "
[ "form-group
"
[ "form-group col-4 w-10 text-center mb-0
"
, (fv.hasError' "size") ?
"form-group--error" $
mempty
...
...
@@ -553,7 +499,7 @@ component = R.hooksComponent "configForm" cpt where
}
[
H.div
{ className: "form-group__label
" }
{ className: "
" }
[
H.label {} [ H.text "Size" ]
]
...
...
@@ -562,9 +508,10 @@ component = R.hooksComponent "configForm" cpt where
{ className: "form-group__field" }
[
B.formInput $
bindStateKey "size"
{ type: "number"
} `merge` bindStateKey "size"
,
R2.when (fv.hasError' "sj
ze") $
R2.when (fv.hasError' "si
ze") $
H.div
{ className: "form-group__error" }
[
...
...
@@ -573,17 +520,31 @@ component = R.hooksComponent "configForm" cpt where
]
]
]
]
]
,
-- TYPE::MaxClique_
H.div
{ className: "" }
[
-- Mode Expert (part 1) / TYPE::MaxClique_
R2.when (state.cliqueType == show MaxClique_) $
H.div { className: "clustrisation-algorythm-expert form-group" }
[
-- Title MaxClique
H.div
{ className: "form-group__label text-center" }
[
H.label {} [ H.text "MaxClique" ]
]
,
H.div
{ className: "phylo-config-form__col
" }
{ className: "phylo-config-form__row justify-content-center
" }
[
-- Size
H.div
{ className: intercalate " "
[ "form-group
"
[ "form-group col-3 w-10 text-center mb-0
"
, (fv.hasError' "size") ?
"form-group--error" $
mempty
...
...
@@ -591,7 +552,7 @@ component = R.hooksComponent "configForm" cpt where
}
[
H.div
{ className: "form-group__label
" }
{ className: "
" }
[
H.label {} [ H.text "Size" ]
]
...
...
@@ -601,6 +562,9 @@ component = R.hooksComponent "configForm" cpt where
[
B.formInput $
{ type: "number"
, step: "1"
, min: "0"
, max: "10"
} `merge` bindStateKey "size"
,
R2.when (fv.hasError' "size") $
...
...
@@ -615,7 +579,7 @@ component = R.hooksComponent "configForm" cpt where
-- Treshold
H.div
{ className: intercalate " "
[ "form-group
"
[ "form-group col-4 w-10 text-center mb-0
"
, (fv.hasError' "threshold") ?
"form-group--error" $
mempty
...
...
@@ -623,7 +587,7 @@ component = R.hooksComponent "configForm" cpt where
}
[
H.div
{ className: "form-group__label
" }
{ className: "
" }
[
H.label {} [ H.text "Treshold" ]
]
...
...
@@ -633,6 +597,9 @@ component = R.hooksComponent "configForm" cpt where
[
B.formInput $
{ type: "number"
, step: "0.0001"
, min: "0.0001"
, max: "1"
} `merge` bindStateKey "threshold"
,
R2.when (fv.hasError' "threshold") $
...
...
@@ -647,12 +614,12 @@ component = R.hooksComponent "configForm" cpt where
-- Clique filter
H.div
{ className: intercalate " "
[ "form-grou
p"
[ "form-group col-5 w-10 text-center mb-0 text-nowra
p"
]
}
[
H.div
{ className: "form-group__label
" }
{ className: "
" }
[
H.label {} [ H.text "Filter type" ]
]
...
...
@@ -676,38 +643,23 @@ component = R.hooksComponent "configForm" cpt where
]
]
]
,
H.text "end new form"
]
]
]
]
,
let
form =
H.form
{ className: "phylo-config-form" }
[ H.div
{ className: "phylo-config-form__group" }
[
H.div
{ className: "phylo-config-form__row
" }
{ className: "
" }
[
-- Mode Expert (part 2) / TYPE::MaxClique_
R2.when (state.cliqueType == show MaxClique_) $
H.div
{ className: "phylo-config-form__col
" }
{ className: "phylo-config-form__row
" }
[
-- Proximity
H.div
{ className: intercalate " "
[ "form-group
"
[ "form-group col-3 w-10 text-center mb-0
"
, (fv.hasError' "proximity") ?
"form-group--error" $
mempty
...
...
@@ -725,6 +677,9 @@ component = R.hooksComponent "configForm" cpt where
[
B.formInput $
{ type: "number"
, step: "0.1"
, min: "0.1"
, max: "1"
} `merge` bindStateKey "proximity"
,
R2.when (fv.hasError' "proximity") $
...
...
@@ -735,15 +690,11 @@ component = R.hooksComponent "configForm" cpt where
]
]
]
]
,
H.div
{ className: "phylo-config-form__col" }
[
-- Synchrony
H.div
{ className: intercalate " "
[ "form-group
"
[ "form-group col-4 w-10 text-center mb-0
"
, (fv.hasError' "synchrony") ?
"form-group--error" $
mempty
...
...
@@ -755,46 +706,6 @@ component = R.hooksComponent "configForm" cpt where
[
H.label {} [ H.text "Synchrony" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formInput $
{ type: "number"
} `merge` bindStateKey "synchrony"
,
R2.when (fv.hasError' "synchrony") $
H.div
{ className: "form-group__error" }
[
H.text "Please enter a `Double` value (eg. 0.5)"
]
]
]
]
]
,
H.div
{ className: "phylo-config-form__row" }
[
H.div
{ className: "phylo-config-form__col" }
[
-- Quality
H.div
{ className: intercalate " "
[ "form-group"
, (fv.hasError' "quality") ?
"form-group--error" $
mempty
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Quality" ]
]
,
H.div
{ className: "form-group__field" }
...
...
@@ -802,11 +713,11 @@ component = R.hooksComponent "configForm" cpt where
B.formInput $
{ type: "number"
, step: "0.1"
, min: "0
"
, min: "0.1
"
, max: "1"
} `merge` bindStateKey "qualit
y"
} `merge` bindStateKey "synchron
y"
,
R2.when (fv.hasError' "qualit
y") $
R2.when (fv.hasError' "synchron
y") $
H.div
{ className: "form-group__error" }
[
...
...
@@ -814,15 +725,11 @@ component = R.hooksComponent "configForm" cpt where
]
]
]
]
,
H.div
{ className: "phylo-config-form__col" }
[
-- Export filter
-- Minimum branch size
H.div
{ className: intercalate " "
[ "form-grou
p"
[ "form-group col-5 w-10 text-center mb-0 text-nowra
p"
, (fv.hasError' "exportFilter") ?
"form-group--error" $
mempty
...
...
@@ -850,396 +757,567 @@ component = R.hooksComponent "configForm" cpt where
]
]
]
]
]
]
,
-- Time Unit
B.fieldset
{ className: "phylo-config-form__group"
, titleSlot: H.text "Time unit"
}
[
H.div
{ className: "phylo-config-form__row" }
[
H.div
{ className: "phylo-config-form__col" }
[
-- Granularity
H.div
{ className: intercalate " "
[ "form-group"
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Granularity" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formSelect
(bindStateKey "granularity")
[
H.option
{ value: show Year_ }
[ H.text "Year" ]
,
H.option
{ value: show Month_ }
[ H.text "Month" ]
,
H.option
{ value: show Week_ }
[ H.text "Week" ]
,
H.option
{ value: show Day_ }
[ H.text "Day" ]
]
]
]
]
,
H.div
{ className: "phylo-config-form__col" }
[
-- Period
H.div
{ className: intercalate " "
[ "form-group"
, (fv.hasError' "period") ?
"form-group--error" $
mempty
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Period" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formInput $
{ type: "number"
} `merge` bindStateKey "period"
,
R2.when (fv.hasError' "period") $
H.div
{ className: "form-group__error" }
[
H.text "Please enter an `Int` value (eg. 3)"
]
]
]
,
-- Step
H.div
{ className: intercalate " "
[ "form-group"
, (fv.hasError' "step") ?
"form-group--error" $
mempty
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Step" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formInput $
{ type: "number"
} `merge` bindStateKey "step"
,
R2.when (fv.hasError' "step") $
H.div
{ className: "form-group__error" }
[
H.text "Please enter an `Int` value (eg. 3)"
]
]
]
,
-- Matching frame
H.div
{ className: intercalate " "
[ "form-group"
, (fv.hasError' "matchingFrame") ?
"form-group--error" $
mempty
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Matching frame" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formInput $
{ type: "number"
} `merge` bindStateKey "matchingFrame"
,
R2.when (fv.hasError' "matchingFrame") $
H.div
{ className: "form-group__error" }
[
H.text "Please enter an `Int` value (eg. 3)"
]
]
]
]
]
]
,
-- Clique
B.fieldset
{ className: "phylo-config-form__group"
, titleSlot: H.text "Clique algorithm"
}
[
H.div
{ className: "phylo-config-form__row" }
[
H.div
{ className: "phylo-config-form__col" }
[
-- Clique type
H.div
{ className: intercalate " "
[ "form-group"
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Type" ]
]
,
H.div
{ className: "form-group__field" }
[
H.div
{ className: "btn-group"
, role: "group"
}
[
B.button
{ callback: \_ -> setter stateBox "cliqueType" $ show FIS_
-- , variant: OutlinedButtonVariant Secondary
, variant: ButtonVariant Light
, className: state.cliqueType == show FIS_ ?
"active" $
""
}
[
H.text "FIS"
]
,
B.button
{ callback: \_ -> setter stateBox "cliqueType" $ show MaxClique_
-- , variant: OutlinedButtonVariant Secondary
, variant: ButtonVariant Light
, className: state.cliqueType == show MaxClique_ ?
"active" $
""
}
[
H.text "MaxClique"
]
]
]
]
]
,
-- TYPE::FIS_
R2.when (state.cliqueType == show FIS_) $
H.div
{ className: "phylo-config-form__col" }
[
-- Support
H.div
{ className: intercalate " "
[ "form-group"
, (fv.hasError' "support") ?
"form-group--error" $
mempty
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Support" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formInput $
bindStateKey "support"
,
R2.when (fv.hasError' "support") $
H.div
{ className: "form-group__error" }
[
H.text "Please enter an `Int` value (eg. 3)"
]
]
]
,
-- Size
H.div
{ className: intercalate " "
[ "form-group"
, (fv.hasError' "size") ?
"form-group--error" $
mempty
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Size" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formInput $
bindStateKey "size"
,
R2.when (fv.hasError' "sjze") $
H.div
{ className: "form-group__error" }
[
H.text "Please enter an `Int` value (eg. 3)"
]
]
]
]
,
-- TYPE::MaxClique_
R2.when (state.cliqueType == show MaxClique_) $
H.div
{ className: "phylo-config-form__col" }
[
-- Size
H.div
{ className: intercalate " "
[ "form-group"
, (fv.hasError' "size") ?
"form-group--error" $
mempty
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Size" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formInput $
{ type: "number"
} `merge` bindStateKey "size"
,
R2.when (fv.hasError' "size") $
H.div
{ className: "form-group__error" }
[
H.text "Please enter an `Int` value (eg. 3)"
]
]
]
,
-- Treshold
H.div
{ className: intercalate " "
[ "form-group"
, (fv.hasError' "threshold") ?
"form-group--error" $
mempty
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Treshold" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formInput $
{ type: "number"
} `merge` bindStateKey "threshold"
,
R2.when (fv.hasError' "threshold") $
H.div
{ className: "form-group__error" }
[
H.text "Please enter a `Double` value (eg. 0.5)"
]
]
]
,
-- Clique filter
H.div
{ className: intercalate " "
[ "form-group"
]
}
[
H.div
{ className: "form-group__label" }
[
H.label {} [ H.text "Filter type" ]
]
,
H.div
{ className: "form-group__field" }
[
B.formSelect
( bindStateKey "cliqueFilter" )
[
H.option
{ value: show ByThreshold }
[ H.text "By threshold" ]
,
H.option
{ value: show ByNeighbours }
[ H.text "By neighbours" ]
]
]
]
]
]
]
]
-- let
-- form =
-- H.form
-- { className: "phylo-config-form" }
-- [ H.div
-- { className: "phylo-config-form__group" }
-- [
-- H.div
-- { className: "phylo-config-form__row" }
-- [
-- H.div
-- { className: "phylo-config-form__col" }
-- [
-- -- Proximity
-- H.div
-- { className: intercalate " "
-- [ "form-group"
-- , (fv.hasError' "proximity") ?
-- "form-group--error" $
-- mempty
-- ]
-- }
-- [
-- H.div
-- { className: "form-group__label" }
-- [
-- H.label {} [ H.text "Proximity" ]
-- ]
-- ,
-- H.div
-- { className: "form-group__field" }
-- [
-- B.formInput $
-- { type: "number"
-- } `merge` bindStateKey "proximity"
-- ,
-- R2.when (fv.hasError' "proximity") $
-- H.div
-- { className: "form-group__error" }
-- [
-- H.text "Please enter a `Double` value (eg. 0.5)"
-- ]
-- ]
-- ]
-- ]
-- ,
-- H.div
-- { className: "phylo-config-form__col" }
-- [
-- -- Synchrony
-- H.div
-- { className: intercalate " "
-- [ "form-group"
-- , (fv.hasError' "synchrony") ?
-- "form-group--error" $
-- mempty
-- ]
-- }
-- [
-- H.div
-- { className: "form-group__label" }
-- [
-- H.label {} [ H.text "Synchrony" ]
-- ]
-- ,
-- H.div
-- { className: "form-group__field" }
-- [
-- B.formInput $
-- { type: "number"
-- } `merge` bindStateKey "synchrony"
-- ,
-- R2.when (fv.hasError' "synchrony") $
-- H.div
-- { className: "form-group__error" }
-- [
-- H.text "Please enter a `Double` value (eg. 0.5)"
-- ]
-- ]
-- ]
-- ]
-- ]
-- ,
-- H.div
-- { className: "phylo-config-form__row" }
-- [
-- H.div
-- { className: "phylo-config-form__col" }
-- [
-- -- Quality
-- H.div
-- { className: intercalate " "
-- [ "form-group"
-- , (fv.hasError' "quality") ?
-- "form-group--error" $
-- mempty
-- ]
-- }
-- [
-- H.div
-- { className: "form-group__label" }
-- [
-- H.label {} [ H.text "Quality" ]
-- ]
-- ,
-- H.div
-- { className: "form-group__field" }
-- [
-- B.formInput $
-- { type: "number"
-- , step: "0.1"
-- , min: "0"
-- , max: "1"
-- } `merge` bindStateKey "quality"
-- ,
-- R2.when (fv.hasError' "quality") $
-- H.div
-- { className: "form-group__error" }
-- [
-- H.text "Please enter a `Double` value (eg. 0.5)"
-- ]
-- ]
-- ]
-- ]
-- ,
-- H.div
-- { className: "phylo-config-form__col" }
-- [
-- -- Export filter
-- H.div
-- { className: intercalate " "
-- [ "form-group"
-- , (fv.hasError' "exportFilter") ?
-- "form-group--error" $
-- mempty
-- ]
-- }
-- [
-- H.div
-- { className: "form-group__label" }
-- [
-- H.label {} [ H.text "Minimum branch size" ]
-- ]
-- ,
-- H.div
-- { className: "form-group__field" }
-- [
-- B.formInput $
-- { type: "number"
-- } `merge` bindStateKey "exportFilter"
-- ,
-- R2.when (fv.hasError' "exportFilter") $
-- H.div
-- { className: "form-group__error" }
-- [
-- H.text "Please enter a `Double` value (eg. 3.0)"
-- ]
-- ]
-- ]
-- ]
-- ]
-- ]
-- ,
-- -- Time Unit
-- B.fieldset
-- { className: "phylo-config-form__group"
-- , titleSlot: H.text "Time unit"
-- }
-- [
-- H.div
-- { className: "phylo-config-form__row" }
-- [
-- H.div
-- { className: "phylo-config-form__col" }
-- [
-- -- Granularity
-- H.div
-- { className: intercalate " "
-- [ "form-group"
-- ]
-- }
-- [
-- H.div
-- { className: "form-group__label" }
-- [
-- H.label {} [ H.text "Granularity" ]
-- ]
-- ,
-- H.div
-- { className: "form-group__field" }
-- [
-- B.formSelect
-- (bindStateKey "granularity")
-- [
-- H.option
-- { value: show Year_ }
-- [ H.text "Year" ]
-- ,
-- H.option
-- { value: show Month_ }
-- [ H.text "Month" ]
-- ,
-- H.option
-- { value: show Week_ }
-- [ H.text "Week" ]
-- ,
-- H.option
-- { value: show Day_ }
-- [ H.text "Day" ]
-- ]
-- ]
-- ]
-- ]
-- ,
-- H.div
-- { className: "phylo-config-form__col" }
-- [
-- -- Period
-- H.div
-- { className: intercalate " "
-- [ "form-group"
-- , (fv.hasError' "period") ?
-- "form-group--error" $
-- mempty
-- ]
-- }
-- [
-- H.div
-- { className: "form-group__label" }
-- [
-- H.label {} [ H.text "Period" ]
-- ]
-- ,
-- H.div
-- { className: "form-group__field" }
-- [
-- B.formInput $
-- { type: "number"
-- } `merge` bindStateKey "period"
-- ,
-- R2.when (fv.hasError' "period") $
-- H.div
-- { className: "form-group__error" }
-- [
-- H.text "Please enter an `Int` value (eg. 3)"
-- ]
-- ]
-- ]
-- ,
-- -- Step
-- H.div
-- { className: intercalate " "
-- [ "form-group"
-- , (fv.hasError' "step") ?
-- "form-group--error" $
-- mempty
-- ]
-- }
-- [
-- H.div
-- { className: "form-group__label" }
-- [
-- H.label {} [ H.text "Step" ]
-- ]
-- ,
-- H.div
-- { className: "form-group__field" }
-- [
-- B.formInput $
-- { type: "number"
-- } `merge` bindStateKey "step"
-- ,
-- R2.when (fv.hasError' "step") $
-- H.div
-- { className: "form-group__error" }
-- [
-- H.text "Please enter an `Int` value (eg. 3)"
-- ]
-- ]
-- ]
-- ,
-- -- Matching frame
-- H.div
-- { className: intercalate " "
-- [ "form-group"
-- , (fv.hasError' "matchingFrame") ?
-- "form-group--error" $
-- mempty
-- ]
-- }
-- [
-- H.div
-- { className: "form-group__label" }
-- [
-- H.label {} [ H.text "Matching frame" ]
-- ]
-- ,
-- H.div
-- { className: "form-group__field" }
-- [
-- B.formInput $
-- { type: "number"
-- } `merge` bindStateKey "matchingFrame"
-- ,
-- R2.when (fv.hasError' "matchingFrame") $
-- H.div
-- { className: "form-group__error" }
-- [
-- H.text "Please enter an `Int` value (eg. 3)"
-- ]
-- ]
-- ]
-- ]
-- ]
-- ]
-- ,
-- -- Clique
-- B.fieldset
-- { className: "phylo-config-form__group"
-- , titleSlot: H.text "Clique algorithm"
-- }
-- [
-- H.div
-- { className: "phylo-config-form__row" }
-- [
-- H.div
-- { className: "phylo-config-form__col" }
-- [
-- -- Clique type
-- H.div
-- { className: intercalate " "
-- [ "form-group"
-- ]
-- }
-- [
-- H.div
-- { className: "form-group__label" }
-- [
-- H.label {} [ H.text "Type" ]
-- ]
-- ,
-- H.div
-- { className: "form-group__field" }
-- [
-- H.div
-- { className: "btn-group"
-- , role: "group"
-- }
-- [
-- B.button
-- { callback: \_ -> setter stateBox "cliqueType" $ show FIS_
-- -- , variant: OutlinedButtonVariant Secondary
-- , variant: ButtonVariant Light
-- , className: state.cliqueType == show FIS_ ?
-- "active" $
-- ""
-- }
-- [
-- H.text "FIS"
-- ]
-- ,
-- B.button
-- { callback: \_ -> setter stateBox "cliqueType" $ show MaxClique_
-- -- , variant: OutlinedButtonVariant Secondary
-- , variant: ButtonVariant Light
-- , className: state.cliqueType == show MaxClique_ ?
-- "active" $
-- ""
-- }
-- [
-- H.text "MaxClique"
-- ]
-- ]
-- ]
-- ]
-- ]
-- ,
-- -- TYPE::FIS_
-- R2.when (state.cliqueType == show FIS_) $
-- H.div
-- { className: "phylo-config-form__col" }
-- [
-- -- Support
-- H.div
-- { className: intercalate " "
-- [ "form-group"
-- , (fv.hasError' "support") ?
-- "form-group--error" $
-- mempty
-- ]
-- }
-- [
-- H.div
-- { className: "form-group__label" }
-- [
-- H.label {} [ H.text "Support" ]
-- ]
-- ,
-- H.div
-- { className: "form-group__field" }
-- [
-- B.formInput $
-- bindStateKey "support"
-- ,
-- R2.when (fv.hasError' "support") $
-- H.div
-- { className: "form-group__error" }
-- [
-- H.text "Please enter an `Int` value (eg. 3)"
-- ]
-- ]
-- ]
-- ,
-- -- Size
-- H.div
-- { className: intercalate " "
-- [ "form-group"
-- , (fv.hasError' "size") ?
-- "form-group--error" $
-- mempty
-- ]
-- }
-- [
-- H.div
-- { className: "form-group__label" }
-- [
-- H.label {} [ H.text "Size" ]
-- ]
-- ,
-- H.div
-- { className: "form-group__field" }
-- [
-- B.formInput $
-- bindStateKey "size"
-- ,
-- R2.when (fv.hasError' "size") $
-- H.div
-- { className: "form-group__error" }
-- [
-- H.text "Please enter an `Int` value (eg. 3)"
-- ]
-- ]
-- ]
-- ]
-- ,
-- -- TYPE::MaxClique_
-- R2.when (state.cliqueType == show MaxClique_) $
-- H.div
-- { className: "phylo-config-form__col" }
-- [
-- -- Size
-- H.div
-- { className: intercalate " "
-- [ "form-group"
-- , (fv.hasError' "size") ?
-- "form-group--error" $
-- mempty
-- ]
-- }
-- [
-- H.div
-- { className: "form-group__label" }
-- [
-- H.label {} [ H.text "Size" ]
-- ]
-- ,
-- H.div
-- { className: "form-group__field" }
-- [
-- B.formInput $
-- { type: "number"
-- } `merge` bindStateKey "size"
-- ,
-- R2.when (fv.hasError' "size") $
-- H.div
-- { className: "form-group__error" }
-- [
-- H.text "Please enter an `Int` value (eg. 3)"
-- ]
-- ]
-- ]
-- ,
-- -- Treshold
-- H.div
-- { className: intercalate " "
-- [ "form-group"
-- , (fv.hasError' "threshold") ?
-- "form-group--error" $
-- mempty
-- ]
-- }
-- [
-- H.div
-- { className: "form-group__label" }
-- [
-- H.label {} [ H.text "Treshold" ]
-- ]
-- ,
-- H.div
-- { className: "form-group__field" }
-- [
-- B.formInput $
-- { type: "number"
-- } `merge` bindStateKey "threshold"
-- ,
-- R2.when (fv.hasError' "threshold") $
-- H.div
-- { className: "form-group__error" }
-- [
-- H.text "Please enter a `Double` value (eg. 0.5)"
-- ]
-- ]
-- ]
-- ,
-- -- Clique filter
-- H.div
-- { className: intercalate " "
-- [ "form-group"
-- ]
-- }
-- [
-- H.div
-- { className: "form-group__label" }
-- [
-- H.label {} [ H.text "Filter type" ]
-- ]
-- ,
-- H.div
-- { className: "form-group__field" }
-- [
-- B.formSelect
-- ( bindStateKey "cliqueFilter" )
-- [
-- H.option
-- { value: show ByThreshold }
-- [ H.text "By threshold" ]
-- ,
-- H.option
-- { value: show ByNeighbours }
-- [ H.text "By neighbours" ]
-- ]
-- ]
-- ]
-- ]
-- ]
-- ]
-- ]
let submit =
H.div { className: "phylo-config-form__submit" }
...
...
@@ -1261,7 +1339,7 @@ component = R.hooksComponent "configForm" cpt where
pure $ H.div {} [ modeChoice
, R2.when (state.defaultMode == show false) formAdvanced
, R2.when (state.defaultMode == show false) form
--
, R2.when (state.defaultMode == show false) form
, submit
]
...
...
@@ -1306,10 +1384,7 @@ formValidation :: Record FormData -> Effect VForm
formValidation r = foldl append mempty rules
where
rules
= [ FV.number "proximity" r.proximity
, FV.number "synchrony" r.synchrony
, FV.number "quality" r.quality
, FV.number "exportFilter" r.exportFilter
= [ FV.number "quality" r.quality
-- Time unit
, FV.int "period" r.period
, FV.int "step" r.step
...
...
@@ -1318,10 +1393,15 @@ formValidation r = foldl append mempty rules
-- Clique
<> if (r.cliqueType == show FIS_)
then
-- FIS_ (Basic mode)
[ FV.int "support" r.support
, FV.int "size" r.size
]
else
-- MaxClique_ (Expert mode)
[ FV.int "size" r.size
, FV.number "threshold" r.threshold
, FV.number "proximity" r.proximity
, FV.number "synchrony" r.synchrony
, FV.number "exportFilter" r.exportFilter
]
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