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
e4008b1f
Commit
e4008b1f
authored
11 months ago
by
Marcelo Querino Lima Alfonso
Browse files
Options
Downloads
Patches
Plain Diff
added possible propagation to external events on mouse enter, leave
parent
44b2d00a
No related branches found
No related tags found
2 merge requests
!5
Refactored code for diplaying aggregated ligand interactions
,
!4
Added features for aggregated ligand interaction view and interactivity with heat map
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugin/depiction.ts
+16
-10
16 additions, 10 deletions
src/plugin/depiction.ts
src/plugin/manager.ts
+3
-3
3 additions, 3 deletions
src/plugin/manager.ts
with
19 additions
and
13 deletions
src/plugin/depiction.ts
+
16
−
10
View file @
e4008b1f
...
...
@@ -196,8 +196,8 @@ class Depiction {
.
attr
(
"
r
"
,
x
=>
firstScale
.
radiusScale
(
x
.
value
))
.
attr
(
"
fill
"
,
x
=>
firstScale
.
colorScale
(
x
.
value
))
.
attr
(
"
fill-opacity
"
,
"
0.5
"
)
.
on
(
'
mouseenter
'
,
(
x
:
Atom
)
=>
this
.
atomMouseEnterEventHandler
(
x
))
.
on
(
'
mouseleave
'
,
()
=>
this
.
atomMouseLeaveEventHandler
());
.
on
(
'
mouseenter
'
,
(
x
:
Atom
)
=>
this
.
atomMouseEnterEventHandler
(
x
,
true
))
.
on
(
'
mouseleave
'
,
()
=>
this
.
atomMouseLeaveEventHandler
(
true
));
}
...
...
@@ -310,21 +310,23 @@ class Depiction {
* depicting their weights
* @public
* @param {Atom} atom object
* @param {boolean} propagation if event should be triggered on external components
* @memebrof Depiction
*/
public
atomMouseEnterEventHandler
(
x
:
Atom
){
this
.
fireExternalAtomEvent
(
x
,
Config
.
LigandShowAtomEvent
);
public
atomMouseEnterEventHandler
(
x
:
Atom
,
propagation
:
boolean
){
this
.
fireExternalAtomEvent
(
x
,
propagation
,
Config
.
LigandShowAtomEvent
);
}
/**
* Mouse leave event handler for circlea round atoms
* depicting their weights
* @public
* @param {boolean} propagation if event should be triggered on external components
* @memberof Depiction
*/
public
atomMouseLeaveEventHandler
(){
this
.
fireExternalNullEvent
(
Config
.
LigandHideAtomEvent
);
public
atomMouseLeaveEventHandler
(
propagation
:
boolean
){
this
.
fireExternalNullEvent
(
propagation
,
Config
.
LigandHideAtomEvent
);
}
// #endregion
...
...
@@ -337,11 +339,12 @@ class Depiction {
* @param {string} eventName name of event
* @memeberof Depiction
*/
private
fireExternalAtomEvent
(
atom
:
Atom
,
eventName
:
string
){
private
fireExternalAtomEvent
(
atom
:
Atom
,
propagation
:
boolean
,
eventName
:
string
){
const
e
=
new
CustomEvent
(
eventName
,
{
bubbles
:
true
,
detail
:
{
tooltip
:
atom
.
toTooltip
()
tooltip
:
atom
.
toTooltip
(),
external
:
propagation
}
});
this
.
parent
.
dispatchEvent
(
e
);
...
...
@@ -350,13 +353,16 @@ class Depiction {
/**
* Dispatches event to hide tooltip on mouse leave
* @private
* @param {boolean} propagation if event should be triggered on external components
* @param {string} eventName name of event
* @memeberof Depiction
*/
private
fireExternalNullEvent
(
eventName
:
string
)
{
private
fireExternalNullEvent
(
propagation
:
boolean
,
eventName
:
string
)
{
const
e
=
new
CustomEvent
(
eventName
,
{
bubbles
:
true
,
detail
:
{}
detail
:
{
external
:
propagation
}
});
this
.
parent
.
dispatchEvent
(
e
);
...
...
This diff is collapsed.
Click to expand it.
src/plugin/manager.ts
+
3
−
3
View file @
e4008b1f
...
...
@@ -127,14 +127,14 @@ class Visualization {
const
atomName
=
e
.
detail
.
name
;
// CustomEvent
const
atom
=
this
.
depiction
.
atoms
.
filter
(
x
=>
x
.
value
>
0
&&
x
.
name
===
atomName
);
if
(
atom
.
length
>
0
)
{
this
.
depiction
.
atomMouseEnterEventHandler
(
atom
[
0
]);
this
.
depiction
.
atomMouseEnterEventHandler
(
atom
[
0
]
,
true
);
}
else
{
this
.
depiction
.
atomMouseLeaveEventHandler
();
this
.
depiction
.
atomMouseLeaveEventHandler
(
false
);
}
}
private
ligHeatmapMouseoutEventHandler
()
{
this
.
depiction
.
atomMouseLeaveEventHandler
();
this
.
depiction
.
atomMouseLeaveEventHandler
(
true
);
}
...
...
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