Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
195
Issues
195
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
gargantext
haskell-gargantext
Commits
b320e0f2
Verified
Commit
b320e0f2
authored
Aug 26, 2025
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[phylo] add 'Second' time unit
parent
01091149
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
1 deletion
+14
-1
Common.hs
bin/gargantext-cli/CLI/Phylo/Common.hs
+1
-0
Phylo.hs
src/Gargantext/Core/Viz/Phylo.hs
+4
-0
Tools.hs
src/Gargantext/Core/Viz/Phylo/API/Tools.hs
+5
-1
PhyloTools.hs
src/Gargantext/Core/Viz/Phylo/PhyloTools.hs
+4
-0
No files found.
bin/gargantext-cli/CLI/Phylo/Common.hs
View file @
b320e0f2
...
@@ -177,6 +177,7 @@ timeToLabel config = case (timeUnit config) of
...
@@ -177,6 +177,7 @@ timeToLabel config = case (timeUnit config) of
Day
p
s
f
->
(
"time_days"
<>
"_"
<>
(
show
p
)
<>
"_"
<>
(
show
s
)
<>
"_"
<>
(
show
f
))
Day
p
s
f
->
(
"time_days"
<>
"_"
<>
(
show
p
)
<>
"_"
<>
(
show
s
)
<>
"_"
<>
(
show
f
))
Hour
_p
_s
_f
->
panicTrace
"hours not implemented"
Hour
_p
_s
_f
->
panicTrace
"hours not implemented"
Minute
_p
_s
_f
->
panicTrace
"minutes not implemented"
Minute
_p
_s
_f
->
panicTrace
"minutes not implemented"
Second
_p
_s
_f
->
panicTrace
"seconds not implemented"
seaToLabel
::
PhyloConfig
->
[
Char
]
seaToLabel
::
PhyloConfig
->
[
Char
]
...
...
src/Gargantext/Core/Viz/Phylo.hs
View file @
b320e0f2
...
@@ -143,6 +143,10 @@ data TimeUnit =
...
@@ -143,6 +143,10 @@ data TimeUnit =
{
_minute_period
::
Int
{
_minute_period
::
Int
,
_minute_step
::
Int
,
_minute_step
::
Int
,
_minute_matchingFrame
::
Int
}
,
_minute_matchingFrame
::
Int
}
|
Second
{
_second_period
::
Int
,
_second_step
::
Int
,
_second_matchingFrame
::
Int
}
deriving
(
Show
,
Generic
,
Eq
,
NFData
,
ToExpr
)
deriving
(
Show
,
Generic
,
Eq
,
NFData
,
ToExpr
)
instance
ToSchema
TimeUnit
where
instance
ToSchema
TimeUnit
where
...
...
src/Gargantext/Core/Viz/Phylo/API/Tools.hs
View file @
b320e0f2
...
@@ -210,7 +210,10 @@ toHours :: UTCTimeR -> Date
...
@@ -210,7 +210,10 @@ toHours :: UTCTimeR -> Date
toHours
utcTimeR
=
toMinutes
utcTimeR
`
div
`
60
toHours
utcTimeR
=
toMinutes
utcTimeR
`
div
`
60
toMinutes
::
UTCTimeR
->
Date
toMinutes
::
UTCTimeR
->
Date
toMinutes
utcTimeR
=
floor
diffSeconds
`
div
`
60
toMinutes
utcTimeR
=
toSeconds
utcTimeR
`
div
`
60
toSeconds
::
UTCTimeR
->
Date
toSeconds
utcTimeR
=
floor
diffSeconds
where
where
diffSeconds
=
diffUTCTime
(
toUTCTime
utcTimeR
)
(
toUTCTime
defUTCTimeR
)
diffSeconds
=
diffUTCTime
(
toUTCTime
utcTimeR
)
(
toUTCTime
defUTCTimeR
)
...
@@ -223,6 +226,7 @@ toPhyloDate utcTimeR@(UTCTimeR { .. }) tu = case tu of
...
@@ -223,6 +226,7 @@ toPhyloDate utcTimeR@(UTCTimeR { .. }) tu = case tu of
Day
{}
->
toDays
(
Prelude
.
toInteger
year
)
month
day
Day
{}
->
toDays
(
Prelude
.
toInteger
year
)
month
day
Hour
{}
->
toHours
utcTimeR
Hour
{}
->
toHours
utcTimeR
Minute
{}
->
toMinutes
utcTimeR
Minute
{}
->
toMinutes
utcTimeR
Second
{}
->
toSeconds
utcTimeR
_
->
panic
"[G.C.V.P.API.Tools] toPhyloDate"
_
->
panic
"[G.C.V.P.API.Tools] toPhyloDate"
toPhyloDate'
::
UTCTimeR
->
TimeUnit
->
Text
toPhyloDate'
::
UTCTimeR
->
TimeUnit
->
Text
...
...
src/Gargantext/Core/Viz/Phylo/PhyloTools.hs
View file @
b320e0f2
...
@@ -177,6 +177,7 @@ getTimeScale p = case timeUnit $ getConfig p of
...
@@ -177,6 +177,7 @@ getTimeScale p = case timeUnit $ getConfig p of
Day
{}
->
"day"
Day
{}
->
"day"
Hour
{}
->
"hour"
Hour
{}
->
"hour"
Minute
{}
->
"minute"
Minute
{}
->
"minute"
Second
{}
->
"second"
-- | Get a regular & ascendante timeScale from a given list of dates
-- | Get a regular & ascendante timeScale from a given list of dates
...
@@ -195,6 +196,7 @@ getTimeStep time = case time of
...
@@ -195,6 +196,7 @@ getTimeStep time = case time of
Day
{
..
}
->
_day_step
Day
{
..
}
->
_day_step
Hour
{
..
}
->
_hour_step
Hour
{
..
}
->
_hour_step
Minute
{
..
}
->
_minute_step
Minute
{
..
}
->
_minute_step
Second
{
..
}
->
_second_step
getTimePeriod
::
TimeUnit
->
Int
getTimePeriod
::
TimeUnit
->
Int
getTimePeriod
time
=
case
time
of
getTimePeriod
time
=
case
time
of
...
@@ -205,6 +207,7 @@ getTimePeriod time = case time of
...
@@ -205,6 +207,7 @@ getTimePeriod time = case time of
Day
{
..
}
->
_day_period
Day
{
..
}
->
_day_period
Hour
{
..
}
->
_hour_period
Hour
{
..
}
->
_hour_period
Minute
{
..
}
->
_minute_period
Minute
{
..
}
->
_minute_period
Second
{
..
}
->
_second_period
getTimeFrame
::
TimeUnit
->
Int
getTimeFrame
::
TimeUnit
->
Int
getTimeFrame
time
=
case
time
of
getTimeFrame
time
=
case
time
of
...
@@ -215,6 +218,7 @@ getTimeFrame time = case time of
...
@@ -215,6 +218,7 @@ getTimeFrame time = case time of
Day
{
..
}
->
_day_matchingFrame
Day
{
..
}
->
_day_matchingFrame
Hour
{
..
}
->
_hour_matchingFrame
Hour
{
..
}
->
_hour_matchingFrame
Minute
{
..
}
->
_minute_matchingFrame
Minute
{
..
}
->
_minute_matchingFrame
Second
{
..
}
->
_second_matchingFrame
-------------
-------------
-- | Fis | --
-- | Fis | --
...
...
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