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
248eddb6
Commit
248eddb6
authored
Oct 27, 2020
by
Lukas Pravda
Browse files
code polish
parent
85fbacc3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
11 deletions
+8
-11
src/plugin/manager.ts
src/plugin/manager.ts
+7
-9
src/plugin/model.ts
src/plugin/model.ts
+1
-2
No files found.
src/plugin/manager.ts
View file @
248eddb6
...
...
@@ -66,7 +66,7 @@ class Visualization {
this
.
nodesRoot
=
this
.
canvas
.
append
(
'
g
'
).
attr
(
'
id
'
,
'
nodes
'
);
if
(
uiParameters
.
zoom
)
this
.
zoomHandler
=
this
.
getZoomHandler
();
document
.
addEventListener
(
Config
.
molstarClickEvent
,
e
=>
this
.
molstarClickEventHandler
(
e
));
document
.
addEventListener
(
Config
.
molstarMouseoverEvent
,
e
=>
this
.
molstarClickEventHandler
(
e
));
document
.
addEventListener
(
Config
.
molstarMouseoutEvent
,
()
=>
this
.
molstarMouseoutEventHandler
());
...
...
@@ -212,7 +212,7 @@ class Visualization {
let
url
=
Resources
.
carbohydratePolymerAPI
(
pdbid
,
bmId
,
entityId
,
this
.
environment
);
d3
.
json
(
url
)
.
catch
(
e
=>
this
.
processError
(
e
,
'
No interactions
to display
'
))
.
catch
(
e
=>
this
.
processError
(
e
,
'
No interactions
data are available.
'
))
.
then
((
data
:
any
)
=>
this
.
addBoundMoleculeInteractions
(
data
,
bmId
))
.
then
(()
=>
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
1500
)))
.
then
(()
=>
this
.
centerScene
());
...
...
@@ -385,7 +385,7 @@ class Visualization {
let
dataBlob
=
new
Blob
([
JSON
.
stringify
(
this
.
interactionsData
,
null
,
4
)],
{
type
:
'
application/json
'
});
downloadLink
.
href
=
URL
.
createObjectURL
(
dataBlob
);
downloadLink
.
download
=
this
.
interactionsData
===
undefined
?
'
no
name.json
'
:
`
${
this
.
pdbId
}
_
${
this
.
presentBindingSite
.
bmId
}
_interactions.json`
;
downloadLink
.
download
=
this
.
interactionsData
===
undefined
?
'
no
_
name.json
'
:
`
${
this
.
pdbId
}
_
${
this
.
presentBindingSite
.
bmId
}
_interactions.json`
;
document
.
body
.
appendChild
(
downloadLink
);
downloadLink
.
click
();
document
.
body
.
removeChild
(
downloadLink
);
...
...
@@ -452,8 +452,8 @@ class Visualization {
private
computeBoundingBox
(
minX
:
number
,
maxX
:
number
,
minY
:
number
,
maxY
:
number
)
{
// The width and the height of the graph
let
molWidth
=
maxX
-
minX
;
let
molHeight
=
maxY
-
minY
;
let
molWidth
=
(
maxX
-
minX
)
+
1
;
// +1 to avoid 0 division
let
molHeight
=
(
maxY
-
minY
)
+
1
;
// how much larger the drawing area is than the width and the height
let
widthRatio
=
this
.
parent
.
offsetWidth
/
molWidth
;
...
...
@@ -479,8 +479,7 @@ class Visualization {
let
translation
=
d3
.
zoomIdentity
.
translate
(
xTrans
,
yTrans
).
scale
(
minRatio
);
this
.
zoomHandler
?.
transform
(
this
.
svg
,
translation
);
};
}
// #endregion menu functions
...
...
@@ -805,8 +804,7 @@ class Visualization {
.
on
(
'
tick
'
,
()
=>
this
.
simulationStep
());
this
.
dragHandler
(
this
.
nodes
);
if
(
this
.
zoomHandler
)
this
.
zoomHandler
(
this
.
svg
);
if
(
this
.
zoomHandler
!==
undefined
)
this
.
zoomHandler
(
this
.
svg
,
d3
.
zoomIdentity
);
}
...
...
src/plugin/model.ts
View file @
248eddb6
...
...
@@ -370,8 +370,7 @@ namespace Model {
let
bgnNode
=
this
.
processResidueInteractionPartner
(
x
.
begin
);
let
endNode
=
this
.
processResidueInteractionPartner
(
x
.
end
);
let
link
=
new
ResidueResidueLink
(
bgnNode
,
endNode
,
x
.
interactions
)
let
link
=
new
ResidueResidueLink
(
bgnNode
,
endNode
,
x
.
interactions
);
this
.
links
.
push
(
link
);
});
...
...
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