Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pdb-ligand-env
Manage
Activity
Members
Labels
Plan
Issues
5
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pdbe
web-components
pdb-ligand-env
Commits
7a57dbde
Commit
7a57dbde
authored
9 months ago
by
Marcelo Querino Lima Alfonso
Browse files
Options
Downloads
Patches
Plain Diff
interactions and dynamic zoom fixes
parent
4f01a771
No related branches found
No related tags found
1 merge request
!5
Refactored code for diplaying aggregated ligand interactions
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
package-lock.json
+2
-2
2 additions, 2 deletions
package-lock.json
src/plugin/depiction.ts
+13
-8
13 additions, 8 deletions
src/plugin/depiction.ts
src/plugin/manager.ts
+13
-6
13 additions, 6 deletions
src/plugin/manager.ts
with
28 additions
and
16 deletions
package-lock.json
+
2
−
2
View file @
7a57dbde
{
"name": "pdb-ligand-env",
"version": "
1
.0.0",
"version": "
2
.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "pdb-ligand-env",
"version": "
1
.0.0",
"version": "
2
.0.0",
"license": "Apache License 2.0",
"dependencies": {
"@types/d3": "^5.16.3",
This diff is collapsed.
Click to expand it.
src/plugin/depiction.ts
+
13
−
8
View file @
7a57dbde
...
...
@@ -190,13 +190,18 @@ class Depiction {
.
data
(
data
)
.
enter
()
.
append
(
'
circle
'
)
.
attr
(
"
class
"
,
x
=>
`
${
x
.
name
}
_Circles weightCircles`
)
.
attr
(
"
cx
"
,
x
=>
x
.
position
.
x
)
.
attr
(
"
cy
"
,
x
=>
x
.
position
.
y
)
.
attr
(
"
r
"
,
x
=>
firstScale
.
radiusScale
(
x
.
value
))
.
attr
(
"
fill
"
,
x
=>
firstScale
.
colorScale
(
x
.
value
))
.
attr
(
"
fill-opacity
"
,
"
0.5
"
)
.
on
(
'
mouseenter
'
,
(
x
:
Atom
,
i
:
number
,
g
:
any
)
=>
this
.
atomMouseEnterEventHandler
(
x
,
g
[
i
],
false
))
.
on
(
'
mouseleave
'
,
(
_
:
Atom
,
i
:
number
,
g
:
any
)
=>
this
.
atomMouseLeaveEventHandler
(
g
[
i
],
false
));
.
on
(
'
mouseenter
'
,
(
x
:
Atom
,
i
:
number
,
g
:
any
)
=>
{
this
.
atomMouseEnterEventHandler
(
x
,
g
[
i
],
false
);
})
.
on
(
'
mouseleave
'
,
(
_x
:
Atom
,
_i
:
number
,
_g
:
any
)
=>
{
this
.
atomMouseLeaveEventHandler
(
false
);
});
}
...
...
@@ -303,15 +308,15 @@ class Depiction {
return
newMap
;
}
private
highlightAtom
(
element
){
private
highlightAtom
(
element
)
{
d3
.
select
(
element
)
.
style
(
"
stroke
"
,
"
#FBBD1D
"
)
.
style
(
"
stroke-width
"
,
5
);
}
private
removeHighlight
(
element
){
d3
.
select
(
element
).
style
(
"
stroke
"
,
null
);
private
removeHighlight
s
(){
d3
.
select
All
(
"
.weightCircles
"
)
.
style
(
"
stroke
"
,
null
);
}
// #region event handlers
...
...
@@ -336,8 +341,8 @@ class Depiction {
* @param {boolean} propagation if event should be triggered on external components
* @memberof Depiction
*/
public
atomMouseLeaveEventHandler
(
element
:
any
,
propagation
:
boolean
){
this
.
removeHighlight
(
element
);
public
atomMouseLeaveEventHandler
(
propagation
:
boolean
){
this
.
removeHighlight
s
();
this
.
fireExternalNullEvent
(
propagation
,
Config
.
LigandHideAtomEvent
);
}
// #endregion
...
...
This diff is collapsed.
Click to expand it.
src/plugin/manager.ts
+
13
−
6
View file @
7a57dbde
...
...
@@ -91,8 +91,9 @@ class Visualization {
private
getZoomHandler
()
{
return
d3
.
zoom
()
.
scaleExtent
([
1
/
10
,
10
])
.
on
(
'
zoom
'
,
()
=>
this
.
canvas
.
attr
(
'
transform
'
,
d3
.
event
.
transform
));
.
on
(
'
zoom
'
,
()
=>
{
this
.
canvas
.
attr
(
'
transform
'
,
d3
.
event
.
transform
)
});
}
...
...
@@ -124,16 +125,21 @@ class Visualization {
if
(
this
.
depiction
===
undefined
)
return
;
const
atomName
=
e
.
detail
.
name
;
// CustomEvent
const
atom
=
this
.
depiction
.
atoms
.
filter
(
x
=>
x
.
value
>
0
&&
x
.
name
===
atomName
);
const
selection
=
d3
.
select
(
`.
${
atomName
}
_Circles`
);
const
nodes
=
selection
.
nodes
();
const
lastElement
=
nodes
[
nodes
.
length
-
1
];
if
(
atom
.
length
>
0
)
{
this
.
depiction
.
atomMouseEnterEventHandler
(
atom
[
0
],
e
.
currentTarge
t
,
true
);
this
.
depiction
.
atomMouseEnterEventHandler
(
atom
[
0
],
lastElemen
t
,
true
);
}
else
{
this
.
depiction
.
atomMouseLeaveEventHandler
(
e
.
currentTarget
,
false
);
this
.
depiction
.
atomMouseLeaveEventHandler
(
false
);
}
}
private
ligHeatmapMouseoutEventHandler
(
e
:
any
)
{
private
ligHeatmapMouseoutEventHandler
(
_
e
:
any
)
{
if
(
this
.
depiction
===
undefined
)
return
;
this
.
depiction
.
atomMouseLeaveEventHandler
(
e
.
currentTarget
,
true
);
this
.
depiction
.
atomMouseLeaveEventHandler
(
true
);
}
...
...
@@ -358,6 +364,7 @@ class Visualization {
public
toggleZoom
(
active
:
boolean
)
{
this
.
zoomHandler
=
active
?
this
.
getZoomHandler
()
:
undefined
;
this
.
zoomHandler
(
this
.
svg
,
d3
.
zoomIdentity
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment