Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
5eb2b556
Commit
5eb2b556
authored
Jun 26, 2020
by
Piotr Gawron
Browse files
pathways with glyphs and z-index <0 are not clickable
parent
7874d5c0
Pipeline
#29022
passed with stage
in 13 minutes and 9 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
5eb2b556
...
...
@@ -21,7 +21,10 @@ minerva (15.1.0) unstable; urgency=medium
raised
if
images
are
not
referenced
in
coords
.
txt
file
(#
1308
)
*
Small
improvement
:
hitting
enter
after
filling
credentials
automatically
tries
to
log
in
(#
1312
)
*
Small
improvement
:
rest
API
provides
information
about
element
glyph
*
Small
improvement
:
rest
API
provides
information
about
element
glyph
and
z
index
*
Small
improvement
:
pathways
with
glyphs
and
z
index
below
0
are
not
clickable
(#
1314
)
*
Bug
fix
:
export
to
image
from
selected
polygon
contained
all
elements
inside
rectangle
bounded
by
the
polygon
coordinates
(#
1096
)
*
Bug
fix
:
continuous
refreshing
list
of
project
when
uploading
/
removing
...
...
frontend-js/src/main/js/map/data/Alias.js
View file @
5eb2b556
...
...
@@ -23,6 +23,7 @@ function Alias(javaObject) {
if
(
javaObject
.
bounds
!==
undefined
)
{
this
.
setX
(
javaObject
.
bounds
.
x
);
this
.
setY
(
javaObject
.
bounds
.
y
);
this
.
setZ
(
javaObject
.
bounds
.
z
);
this
.
setWidth
(
javaObject
.
bounds
.
width
);
this
.
setHeight
(
javaObject
.
bounds
.
height
);
}
...
...
@@ -79,8 +80,11 @@ Alias.prototype.update = function (javaObject) {
this
.
setInitialAmount
(
javaObject
.
getInitialAmount
());
this
.
setInitialConcentration
(
javaObject
.
getInitialConcentration
());
this
.
setGlyph
(
javaObject
.
getGlyph
());
this
.
setX
(
javaObject
.
getX
());
this
.
setY
(
javaObject
.
getY
());
this
.
setZ
(
javaObject
.
getZ
());
this
.
setWidth
(
javaObject
.
getWidth
());
this
.
setHeight
(
javaObject
.
getHeight
());
...
...
@@ -113,10 +117,12 @@ Alias.prototype.update = function (javaObject) {
this
.
setInitialAmount
(
javaObject
.
initialAmount
);
this
.
setInitialConcentration
(
javaObject
.
initialConcentration
);
this
.
setGlyph
(
javaObject
.
glyph
);
if
(
javaObject
.
bounds
!==
undefined
)
{
this
.
setX
(
javaObject
.
bounds
.
x
);
this
.
setY
(
javaObject
.
bounds
.
y
);
this
.
setZ
(
javaObject
.
bounds
.
z
);
this
.
setWidth
(
javaObject
.
bounds
.
width
);
this
.
setHeight
(
javaObject
.
bounds
.
height
);
}
...
...
@@ -256,6 +262,24 @@ Alias.prototype.getY = function () {
return
this
.
y
;
};
/**
*
* @param {number} z
*/
Alias
.
prototype
.
setZ
=
function
(
z
)
{
if
(
z
!==
undefined
)
{
this
.
z
=
z
;
}
};
/**
*
* @returns {number}
*/
Alias
.
prototype
.
getZ
=
function
()
{
return
this
.
z
;
};
/**
*
* @param {number} elementId
...
...
@@ -400,4 +424,20 @@ Alias.prototype.getCenter = function () {
return
new
Point
(
this
.
getX
()
+
this
.
getWidth
()
/
2
,
this
.
getY
()
+
this
.
getHeight
()
/
2
);
};
/**
*
* @returns {Object}
*/
Alias
.
prototype
.
getGlyph
=
function
()
{
return
this
.
_glyph
;
};
/**
*
* @param {Object} glyph
*/
Alias
.
prototype
.
setGlyph
=
function
(
glyph
)
{
this
.
_glyph
=
glyph
;
};
module
.
exports
=
Alias
;
frontend-js/src/main/js/map/overlay/SearchDbOverlay.js
View file @
5eb2b556
...
...
@@ -228,6 +228,17 @@ SearchDbOverlay.prototype.findCompartmentByCoordinates = function (coordinates,
}
});
}
}).
then
(
function
(
result
)
{
if
(
result
!==
undefined
)
{
return
model
.
getAliasById
(
result
.
getId
(),
true
).
then
(
function
(
alias
)
{
//pathways with glyph and z index below 0 should not be clickable
if
(
alias
.
getType
()
===
"
Pathway
"
&&
alias
.
getZ
()
<
0
&&
alias
.
getGlyph
()
!==
null
)
{
return
undefined
;
}
else
{
return
result
;
}
});
}
});
};
...
...
@@ -295,6 +306,13 @@ SearchDbOverlay.prototype.searchByCoordinates = function (params) {
searchResult
.
push
(
new
IdentifiedElement
(
reactionElements
[
i
]));
}
});
}
else
{
return
model
.
getAliasById
(
searchResult
[
0
].
getId
(),
true
).
then
(
function
(
alias
)
{
//pathways with glyph and z index below 0 should not be clickable
if
(
alias
.
getType
()
===
"
Pathway
"
&&
alias
.
getZ
()
<
0
&&
alias
.
getGlyph
()
!==
null
)
{
searchResult
=
[];
}
});
}
}
else
{
searchResult
=
[];
...
...
rest-api/src/main/java/lcsb/mapviewer/api/projects/models/bioEntities/elements/ElementsRestImpl.java
View file @
5eb2b556
...
...
@@ -212,7 +212,7 @@ public class ElementsRestImpl extends BaseRestImpl {
}
break
;
case
"bounds"
:
value
=
createBounds
(
element
.
getX
(),
element
.
getY
(),
element
.
getWidth
(),
element
.
getHeight
());
value
=
createBounds
(
element
.
getX
(),
element
.
getY
(),
element
.
getZ
(),
element
.
getWidth
(),
element
.
getHeight
());
break
;
case
"glyph"
:
value
=
createGlyph
(
element
.
getGlyph
());
...
...
@@ -321,10 +321,11 @@ public class ElementsRestImpl extends BaseRestImpl {
return
result
;
}
private
Map
<
String
,
Object
>
createBounds
(
Double
x
,
Double
y
,
Double
width
,
Double
height
)
{
private
Map
<
String
,
Object
>
createBounds
(
Double
x
,
Double
y
,
Integer
z
,
Double
width
,
Double
height
)
{
Map
<
String
,
Object
>
result
=
new
TreeMap
<>();
result
.
put
(
"x"
,
x
);
result
.
put
(
"y"
,
y
);
result
.
put
(
"z"
,
z
);
result
.
put
(
"width"
,
width
);
result
.
put
(
"height"
,
height
);
return
result
;
...
...
Write
Preview
Supports
Markdown
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!
Cancel
Please
register
or
sign in
to comment