Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
pdbe
web-components
pdb-ligand-env
Commits
056c570a
Commit
056c570a
authored
Jul 27, 2020
by
Lukas Pravda
Browse files
do not overlap labels and bonds
parent
2d7c33d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
5 deletions
+22
-5
src/plugin/depiction.ts
src/plugin/depiction.ts
+22
-5
No files found.
src/plugin/depiction.ts
View file @
056c570a
...
...
@@ -154,8 +154,14 @@ class Depiction {
* @memberof Depiction
*/
private
appendTexts
():
void
{
let
data
=
this
.
atoms
.
filter
(
x
=>
x
.
labels
.
length
>
0
)
?.
map
(
x
=>
x
.
labels
)
?.
reduce
((
a
,
b
)
=>
a
.
concat
(
b
));
this
.
structure
.
selectAll
()
.
data
(
this
.
atoms
.
filter
(
x
=>
Object
.
keys
(
x
.
labels
).
length
!==
0
).
map
(
x
=>
x
.
labels
).
reduce
((
a
,
b
)
=>
a
.
concat
(
b
))
)
.
data
(
data
)
.
enter
()
.
append
(
'
text
'
)
.
attr
(
'
style
'
,
(
x
:
any
)
=>
x
.
style
)
...
...
@@ -180,13 +186,24 @@ class Depiction {
* @memberof Depiction
*/
private
appendClarityNodes
():
void
{
let
data
=
this
.
atoms
.
filter
(
x
=>
x
.
labels
.
length
>
0
)
?.
map
(
x
=>
x
.
labels
)
?.
reduce
((
a
,
b
)
=>
a
.
concat
(
b
));
this
.
structure
.
selectAll
()
.
data
(
this
.
atoms
.
filter
(
x
=>
Object
.
keys
(
x
.
labels
).
length
!=
0
)
)
.
data
(
data
)
.
enter
().
append
(
'
circle
'
)
.
classed
(
'
pdb-lig-env-svg-shadow-node
'
,
true
)
.
attr
(
'
cx
'
,
(
x
:
any
)
=>
x
.
position
.
x
)
.
attr
(
'
cy
'
,
(
x
:
any
)
=>
x
.
position
.
y
)
.
attr
(
'
r
'
,
15
);
.
attr
(
'
cx
'
,
(
x
:
any
)
=>
x
.
x
)
.
attr
(
'
cy
'
,
(
x
:
any
)
=>
x
.
y
)
.
attr
(
'
r
'
,
(
x
:
any
)
=>
{
let
intermediate
=
x
.
style
.
match
(
/font-size:
\d
+
\.{0,1}\d
*px/g
)[
0
];
let
nmb
=
intermediate
.
match
(
/
\d
+/g
)[
0
];
return
isNaN
(
nmb
)
?
15
:
parseInt
(
nmb
);
});
}
...
...
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