Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bioviz-js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Remi PLANEL
bioviz-js
Commits
90fa582d
Commit
90fa582d
authored
Jun 15, 2019
by
Remi PLANEL
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add phylotree layout
parent
8e8c3089
Pipeline
#12588
failed with stage
in 38 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
0 deletions
+47
-0
src/scripts/layout/cladogram.ts
src/scripts/layout/cladogram.ts
+40
-0
src/scripts/layout/phylotree.ts
src/scripts/layout/phylotree.ts
+7
-0
No files found.
src/scripts/layout/cladogram.ts
0 → 100644
View file @
90fa582d
import
{
hierarchy
,
cluster
}
from
"
d3-hierarchy
"
;
import
{
RawPhyloTreeNode
,
PhyloTreeNode
}
from
"
../types
"
;
import
{
defaultSeparation
}
from
"
./phylotree
"
;
export
default
function
()
{
let
dx
=
1
;
let
dy
=
1
;
let
nodeSize
:
boolean
|
null
=
null
;
let
separation
=
defaultSeparation
;
function
cladogram
(
data
:
RawPhyloTreeNode
)
{
// Apply the layout hierarchy.
cluster
()
.
separation
(
separation
)
(
hierarchy
(
data
))
return
data
;
}
// PUBLIC
cladogram
.
nodeSize
=
function
(
size
:
[
number
,
number
])
{
nodeSize
=
true
;
dx
=
+
size
[
0
];
dy
=
+
size
[
1
];
return
cladogram
;
};
cladogram
.
size
=
function
(
size
:
[
number
,
number
])
{
dx
=
+
size
[
0
];
dy
=
+
size
[
1
];
return
cladogram
;
}
cladogram
.
separation
=
function
<
T
>
(
separationCb
:
(
a
:
d3
.
HierarchyNode
<
T
>
,
b
:
d3
.
HierarchyNode
<
T
>
)
=>
number
)
{
separation
=
separationCb
;
}
return
cladogram
;
}
\ No newline at end of file
src/scripts/layout/phylotree.ts
0 → 100644
View file @
90fa582d
export
function
defaultSeparation
<
T
>
(
a
:
d3
.
HierarchyPointNode
<
T
>
,
b
:
d3
.
HierarchyPointNode
<
T
>
):
number
{
return
1
;
// return (a && b && a.parent === b.parent) ? 1 : 2;
}
\ No newline at end of file
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