Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
memiescape
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
Quentin Lobbé
memiescape
Commits
32ded042
Commit
32ded042
authored
May 21, 2021
by
qlobbe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add the epoch
parent
d4a32540
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
12 deletions
+48
-12
index.html
index.html
+31
-9
ressources.js
ressources.js
+17
-3
No files found.
index.html
View file @
32ded042
...
@@ -256,11 +256,21 @@
...
@@ -256,11 +256,21 @@
var
from
=
yearToDate
(
p
.
from
),
var
from
=
yearToDate
(
p
.
from
),
to
=
yearToDate
(
p
.
to
);
to
=
yearToDate
(
p
.
to
);
if
(
p
.
strFrom
!=
undefined
)
if
(
p
.
strFrom
!=
undefined
)
{
if
(
window
.
timeScale
==
"epoch"
)
{
from
=
utcStringToDate
(
p
.
strFrom
)
}
else
{
from
=
stringToDate
(
p
.
strFrom
)
from
=
stringToDate
(
p
.
strFrom
)
}
}
if
(
p
.
strTo
!=
undefined
)
if
(
p
.
strTo
!=
undefined
)
{
if
(
window
.
timeScale
==
"epoch"
)
{
to
=
utcStringToDate
(
p
.
strTo
)
}
else
{
to
=
stringToDate
(
p
.
strTo
)
to
=
stringToDate
(
p
.
strTo
)
}
}
return
{
from
:
from
,
return
{
from
:
from
,
to
:
to
,
to
:
to
,
...
@@ -273,7 +283,9 @@
...
@@ -273,7 +283,9 @@
var
groups
=
json
.
objects
.
filter
(
node
=>
node
.
nodeType
==
"group"
).
map
(
function
(
g
){
var
groups
=
json
.
objects
.
filter
(
node
=>
node
.
nodeType
==
"group"
).
map
(
function
(
g
){
if
(
g
.
weight
!=
undefined
)
console
.
log
(
g
.
weight
)
if
((
g
.
weight
!=
undefined
)
&&
(
g
.
weight
!=
"Nothing"
))
window
.
weighted
=
true
;
window
.
weighted
=
true
;
var
keys
=
(
g
.
foundation
.
slice
(
1
,
g
.
foundation
.
length
-
1
)).
split
(
'|'
)
var
keys
=
(
g
.
foundation
.
slice
(
1
,
g
.
foundation
.
length
-
1
)).
split
(
'|'
)
...
@@ -298,11 +310,21 @@
...
@@ -298,11 +310,21 @@
weight
=
0
;
weight
=
0
;
source
=
[];
source
=
[];
if
(
g
.
strFrom
!=
undefined
)
if
(
g
.
strFrom
!=
undefined
)
{
if
(
window
.
timeScale
==
"epoch"
)
{
from
=
utcStringToDate
(
g
.
strFrom
)
}
else
{
from
=
stringToDate
(
g
.
strFrom
)
from
=
stringToDate
(
g
.
strFrom
)
}
}
if
(
g
.
strTo
!=
undefined
)
if
(
g
.
strTo
!=
undefined
)
{
if
(
window
.
timeScale
==
"epoch"
)
{
to
=
utcStringToDate
(
g
.
strTo
)
}
else
{
to
=
stringToDate
(
g
.
strTo
)
to
=
stringToDate
(
g
.
strTo
)
}
}
if
(
g
.
source
!=
undefined
)
if
(
g
.
source
!=
undefined
)
source
=
intArrToArr
(
g
.
source
);
source
=
intArrToArr
(
g
.
source
);
...
...
ressources.js
View file @
32ded042
...
@@ -22,6 +22,16 @@ function stringToDate(str) {
...
@@ -22,6 +22,16 @@ function stringToDate(str) {
return
d
;
return
d
;
}
}
function
utcStringToDate
(
str
)
{
var
arr
=
((
str
.
replace
(
'"'
,
''
)).
replace
(
' UTC'
,
''
)).
split
(
/
[\s
-:
]
+/
);
var
d
=
new
Date
();
d
.
setYear
(
parseInt
(
arr
[
0
]));
d
.
setMonth
(
parseInt
(
arr
[
1
]));
d
.
setDate
(
parseInt
(
arr
[
2
]));
d
.
setHours
(
parseInt
(
arr
[
3
]),
parseInt
(
arr
[
4
]),
parseInt
(
arr
[
5
]))
return
d
;
}
function
stringArrToArr
(
str
)
{
function
stringArrToArr
(
str
)
{
var
arr
=
((
str
.
replace
(
'["'
,
''
)).
replace
(
'"]'
,
''
)).
split
(
'","'
);
var
arr
=
((
str
.
replace
(
'["'
,
''
)).
replace
(
'"]'
,
''
)).
split
(
'","'
);
return
arr
;
return
arr
;
...
@@ -163,8 +173,6 @@ function removeDays(date, days) {
...
@@ -163,8 +173,6 @@ function removeDays(date, days) {
function
setYDomain
(
labels
)
{
function
setYDomain
(
labels
)
{
console
.
log
(
labels
)
var
inf
=
(
labels
[
0
]).
from
,
var
inf
=
(
labels
[
0
]).
from
,
sup
=
(
labels
[
labels
.
length
-
1
]).
to
;
sup
=
(
labels
[
labels
.
length
-
1
]).
to
;
...
@@ -180,6 +188,9 @@ function setYDomain(labels) {
...
@@ -180,6 +188,9 @@ function setYDomain(labels) {
}
else
if
(
window
.
timeScale
==
"year"
)
{
}
else
if
(
window
.
timeScale
==
"year"
)
{
inf
=
removeDays
(
inf
,
365
)
inf
=
removeDays
(
inf
,
365
)
sup
=
addDays
(
sup
,
365
)
sup
=
addDays
(
sup
,
365
)
}
else
if
(
window
.
timeScale
==
"epoch"
)
{
inf
=
inf
sup
=
sup
}
else
{
}
else
{
inf
=
new
Date
((
inf
.
getFullYear
()
-
1
),
0
,
0
);
inf
=
new
Date
((
inf
.
getFullYear
()
-
1
),
0
,
0
);
sup
=
new
Date
((
sup
.
getFullYear
()
+
1
),
0
,
0
);
sup
=
new
Date
((
sup
.
getFullYear
()
+
1
),
0
,
0
);
...
@@ -797,6 +808,8 @@ function drawPhylo(branches, periods, groups, links, aLinks, bLinks, frame) {
...
@@ -797,6 +808,8 @@ function drawPhylo(branches, periods, groups, links, aLinks, bLinks, frame) {
function
setGroup
(
g
)
{
function
setGroup
(
g
)
{
console
.
log
(
window
.
weighted
)
if
(
window
.
weighted
==
true
)
{
if
(
window
.
weighted
==
true
)
{
var
radius
=
wScale
(
g
.
weight
)
var
radius
=
wScale
(
g
.
weight
)
}
else
{
}
else
{
...
@@ -908,7 +921,8 @@ function drawPhylo(branches, periods, groups, links, aLinks, bLinks, frame) {
...
@@ -908,7 +921,8 @@ function drawPhylo(branches, periods, groups, links, aLinks, bLinks, frame) {
yAxis
.
call
(
d3
.
axisLeft
(
scale
)
yAxis
.
call
(
d3
.
axisLeft
(
scale
)
.
tickFormat
(
function
(
d
){
.
tickFormat
(
function
(
d
){
if
(
d3
.
timeYear
(
d
)
<
d
)
{
if
(
d3
.
timeYear
(
d
)
<
d
)
{
return
d3
.
timeFormat
(
'%b'
)(
d
);
// '%B'
return
d3
.
timeFormat
(
'%B'
)(
d
);
}
else
{
}
else
{
return
d3
.
timeFormat
(
'%Y'
)(
d
);
return
d3
.
timeFormat
(
'%Y'
)(
d
);
}
}
...
...
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