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
df73c87f
Commit
df73c87f
authored
Oct 24, 2020
by
qlobbe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a wikipedia search
parent
d916d9a1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
10 deletions
+22
-10
index.html
index.html
+2
-2
qlobbe.css
lib/css/qlobbe.css
+5
-2
ressources.js
ressources.js
+15
-6
No files found.
index.html
View file @
df73c87f
...
...
@@ -187,7 +187,7 @@
for
(
var
i
=
0
;
i
<
keys
.
length
;
i
++
)
{
if
(
!
(
keys
[
i
]
in
window
.
freq
))
{
window
.
freq
[
keys
[
i
]
]
=
parseFloat
(
values
[
i
])
window
.
freq
[
(
keys
[
i
]).
trim
()
]
=
parseFloat
(
values
[
i
])
}
}
}
...
...
@@ -252,7 +252,7 @@
class
phyloHow
extends
React
.
Component
{
render
()
{
return
<
div
className
=
"phylo-how"
id
=
"phyloHow"
>
<
a
href
=
"./documentation.html"
target
=
"_blank"
>
<
a
id
=
"phyloSearch"
href
=
"./documentation.html"
target
=
"_blank"
>
<
div
className
=
"switch"
>
<
i
className
=
"far fa-question-circle how"
><
/i>
<
i
className
=
"fa fa-question-circle how"
>
...
...
lib/css/qlobbe.css
View file @
df73c87f
...
...
@@ -63,7 +63,7 @@ body {
font-size
:
14px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
right
;
justify-content
:
right
;
}
.phylo-corpus-info
{
...
...
@@ -132,7 +132,10 @@ body {
/* ---------- icons ---------- */
a
{
color
:
inherit
;
}
a
{
color
:
inherit
;
cursor
:
pointer
;
}
.how
{
cursor
:
pointer
;
...
...
ressources.js
View file @
df73c87f
...
...
@@ -138,7 +138,7 @@ function setYDomain(labels) {
var
inf
=
findInf
(
labels
),
sup
=
findSup
(
labels
);
inf
=
new
Date
((
inf
-
1
),
6
,
0
);
// inf = new Date((19
6
0 - 1),6,0);
// inf = new Date((19
5
0 - 1),6,0);
sup
=
new
Date
((
sup
+
1
),
0
,
0
);
return
[
inf
,
sup
];
}
...
...
@@ -390,7 +390,8 @@ function drawPhylo(branches, periods, groups, links, aLinks, bLinks, frame) {
panel
.
selectAll
(
".y-highlight"
).
attr
(
"transform"
,
d3
.
event
.
transform
);
panel
.
selectAll
(
".ngrams"
).
attr
(
"transform"
,
d3
.
event
.
transform
);
panel
.
selectAll
(
".term-path"
).
attr
(
"transform"
,
d3
.
event
.
transform
);
panel
.
selectAll
(
".emergence"
).
attr
(
"transform"
,
d3
.
event
.
transform
);
panel
.
selectAll
(
".emergence"
).
attr
(
"transform"
,
d3
.
event
.
transform
);
panel
.
selectAll
(
".header"
).
attr
(
"transform"
,
d3
.
event
.
transform
);
showPeak
()
}
...
...
@@ -480,6 +481,8 @@ function drawPhylo(branches, periods, groups, links, aLinks, bLinks, frame) {
let
y
=
((
emergences
[
k
]).
y
).
reduce
(
arraySum
)
/
((
emergences
[
k
]).
y
).
length
;
let
bid
=
Array
.
from
(
new
Set
(
branchByGroup
[
k
]));
var
freq
=
0
;
// console.log(k)
// console.log(window.freq)
if
(
k
in
window
.
freq
)
{
freq
=
window
.
freq
[
k
];
}
...
...
@@ -487,6 +490,7 @@ function drawPhylo(branches, periods, groups, links, aLinks, bLinks, frame) {
.
attr
(
"x"
,
x
+
(
rdm
()
*
Math
.
random
()
*
10
))
.
attr
(
"y"
,
y
+
(
rdm
()
*
Math
.
random
()
*
10
))
.
attr
(
"fdt"
,
k
)
.
attr
(
"id"
,
"head"
+
k
)
.
attr
(
"mem-size"
,
fontScale
(
freq
))
.
attr
(
"mem-opac"
,
opacityScale
(
freq
))
.
attr
(
"bid"
,(
emergences
[
k
]).
bid
)
...
...
@@ -499,7 +503,7 @@ function drawPhylo(branches, periods, groups, links, aLinks, bLinks, frame) {
.
text
((
emergences
[
k
]).
label
)
.
on
(
"click"
,
function
(){
showLabel
()
termClick
((
emergences
[
k
]).
label
,
k
,
this
.
getAttribute
(
"transform"
)
);
termClick
((
emergences
[
k
]).
label
,
k
,
k
,
"head"
);
});
});
...
...
@@ -637,7 +641,7 @@ function drawPhylo(branches, periods, groups, links, aLinks, bLinks, frame) {
d3
.
selectAll
(
".term"
)
.
on
(
"click"
,
function
(){
termClick
(
this
.
textContent
,
this
.
getAttribute
(
"fdt"
),
this
.
getAttribute
(
"
transform"
)
);
termClick
(
this
.
textContent
,
this
.
getAttribute
(
"fdt"
),
this
.
getAttribute
(
"
gid"
),
"group"
);
})
// .on("mouseover",function(){
// d3.selectAll(".term").classed("term-unfocus",true);
...
...
@@ -746,17 +750,22 @@ function drawPhylo(branches, periods, groups, links, aLinks, bLinks, frame) {
return
(
Array
.
from
(
new
Set
(
branches
))).
length
;
}
function
termClick
(
txt
,
idx
,
transform
)
{
function
termClick
(
txt
,
idx
,
nodeId
,
typeNode
)
{
// remove old focus
initPath
()
// catch the last transformations
// var transform = d3.select("#group" + this.getAttribute("gid")).node().getAttribute("transform");
if
(
typeNode
==
"group"
)
{
var
transform
=
d3
.
select
(
"#group"
+
nodeId
).
node
().
getAttribute
(
"transform"
);
}
else
{
var
transform
=
d3
.
select
(
"#head"
+
nodeId
).
node
().
getAttribute
(
"transform"
);
}
// focus
document
.
querySelector
(
"#phyloPhylo"
).
innerHTML
=
txt
;
document
.
querySelector
(
"#phyloPhylo"
).
classList
.
add
(
"phylo-focus"
);
document
.
querySelector
(
"#phyloSearch"
).
setAttribute
(
"href"
,
'https://en.wikipedia.org/w/index.php?search="'
+
txt
+
'"'
)
// find the relevant links
...
...
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