Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
metexplore
MetExploreViz
Commits
5b6fb0fb
Commit
5b6fb0fb
authored
Feb 21, 2020
by
maxchaza
Browse files
Merge branch 'hotfix/labels'
parents
2d878196
9d986db6
Changes
6
Show whitespace changes
Inline
Side-by-side
app.json
View file @
5b6fb0fb
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
/**
/**
*
The
version
of
the
application.
*
The
version
of
the
application.
*/
*/
"version"
:
"3.0.1
1
"
,
"version"
:
"3.0.1
2
"
,
/**
/**
*
The
relative
path
to
the
application's
markup
file
(html
,
jsp
,
asp
,
etc.).
*
The
relative
path
to
the
application's
markup
file
(html
,
jsp
,
asp
,
etc.).
...
...
app/view/form/label/labelController.js
View file @
5b6fb0fb
...
@@ -18,8 +18,15 @@ Ext.define('metExploreViz.view.form.label.LabelController', {
...
@@ -18,8 +18,15 @@ Ext.define('metExploreViz.view.form.label.LabelController', {
view
.
lookupReference
(
'
selectLabel
'
).
on
({
view
.
lookupReference
(
'
selectLabel
'
).
on
({
beforerender
:
function
(
c
)
{
beforerender
:
function
(
c
)
{
var
session
=
_metExploreViz
.
getSessionById
(
'
viz
'
);
var
session
=
_metExploreViz
.
getSessionById
(
'
viz
'
);
var
metabKeys
=
Object
.
keys
(
session
.
getD3Data
().
getNodes
().
filter
(
n
=>
n
.
getBiologicalType
()
===
"
metabolite
"
)[
0
])
;
var
metabKeys
;
metabKeys
=
Object
.
keys
(
session
.
getD3Data
().
getNodes
().
filter
(
n
=>
n
.
getBiologicalType
()
===
view
.
aStyleFormParent
.
biologicalType
)[
0
]);
metabKeys
=
metabKeys
.
filter
(
function
(
key
){
return
key
!==
"
isSideCompound
"
&&
key
!==
"
reactionReversibility
"
&&
key
!==
"
reactionReversibility
"
&&
key
!==
"
selected
"
&&
key
!==
"
duplicated
"
&&
key
!==
"
labelVisible
"
&&
key
!==
"
svg
"
&&
key
!==
"
svgWidth
"
&&
key
!==
"
svgHeight
"
&&
key
!==
"
pathways
"
&&
key
!==
"
compartment
"
&&
key
!==
"
mappingDatas
"
&&
key
!==
"
locked
"
&&
key
!==
"
label
"
&&
key
!==
"
labelFont
"
&&
key
!==
"
index
"
&&
key
!==
"
vy
"
&&
key
!==
"
vx
"
&&
key
!==
"
y
"
&&
key
!==
"
x
"
&&
key
!==
"
y
"
;
});
view
.
lookupReference
(
'
selectLabel
'
).
setStore
(
metabKeys
);
view
.
lookupReference
(
'
selectLabel
'
).
setStore
(
metabKeys
);
if
(
metabKeys
.
length
>
0
)
{
if
(
metabKeys
.
length
>
0
)
{
...
...
resources/lib/functions/D3Extention.js
View file @
5b6fb0fb
...
@@ -244,6 +244,8 @@ d3.selection.prototype.setLabelNodeText = function(style, label) {
...
@@ -244,6 +244,8 @@ d3.selection.prototype.setLabelNodeText = function(style, label) {
name
=
name
.
split
(
'
'
);
name
=
name
.
split
(
'
'
);
el
.
text
(
''
);
el
.
text
(
''
);
if
(
label
!==
"
hidden
"
){
for
(
var
i
=
0
;
i
<
name
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
name
.
length
;
i
++
)
{
var
nameDOMFormat
=
$
(
"
<div/>
"
).
html
(
name
[
i
]).
text
();
var
nameDOMFormat
=
$
(
"
<div/>
"
).
html
(
name
[
i
]).
text
();
var
tspan
=
el
.
append
(
'
tspan
'
).
text
(
nameDOMFormat
);
var
tspan
=
el
.
append
(
'
tspan
'
).
text
(
nameDOMFormat
);
...
@@ -264,6 +266,7 @@ d3.selection.prototype.setLabelNodeText = function(style, label) {
...
@@ -264,6 +266,7 @@ d3.selection.prototype.setLabelNodeText = function(style, label) {
tspan
.
attr
(
'
dy
'
,
style
.
getFontSize
());
tspan
.
attr
(
'
dy
'
,
style
.
getFontSize
());
}
}
}
}
}
})
})
};
};
...
...
resources/lib/functions/GraphPanel.js
View file @
5b6fb0fb
...
@@ -682,7 +682,22 @@ metExploreD3.GraphPanel = {
...
@@ -682,7 +682,22 @@ metExploreD3.GraphPanel = {
var
reactionStyle
;
var
reactionStyle
;
if
(
jsonParsed
.
reactionStyle
)
if
(
jsonParsed
.
reactionStyle
)
{
{
var
reactionStyle
=
new
ReactionStyle
(
jsonParsed
.
reactionStyle
.
backgroundColor
,
jsonParsed
.
reactionStyle
.
height
,
jsonParsed
.
reactionStyle
.
width
,
jsonParsed
.
reactionStyle
.
rx
,
jsonParsed
.
reactionStyle
.
ry
,
jsonParsed
.
reactionStyle
.
opacity
,
jsonParsed
.
reactionStyle
.
strokeColor
,
jsonParsed
.
reactionStyle
.
strokeWidth
,
jsonParsed
.
reactionStyle
.
fontColor
,
jsonParsed
.
reactionStyle
.
fontSize
,
jsonParsed
.
reactionStyle
.
labelOpacity
,
jsonParsed
.
reactionStyle
.
label
,
jsonParsed
.
reactionStyle
.
useAlias
);
var
reactionStyle
=
new
ReactionStyle
(
jsonParsed
.
reactionStyle
.
backgroundColor
,
jsonParsed
.
reactionStyle
.
height
,
jsonParsed
.
reactionStyle
.
width
,
jsonParsed
.
reactionStyle
.
rx
,
jsonParsed
.
reactionStyle
.
ry
,
jsonParsed
.
reactionStyle
.
opacity
,
jsonParsed
.
reactionStyle
.
strokeColor
,
jsonParsed
.
reactionStyle
.
strokeWidth
,
jsonParsed
.
reactionStyle
.
fontColor
,
jsonParsed
.
reactionStyle
.
fontSize
,
jsonParsed
.
reactionStyle
.
fontWeight
,
jsonParsed
.
reactionStyle
.
labelOpacity
,
jsonParsed
.
reactionStyle
.
label
,
jsonParsed
.
reactionStyle
.
useAlias
);
metExploreD3
.
setReactionStyle
(
reactionStyle
);
metExploreD3
.
setReactionStyle
(
reactionStyle
);
}
}
...
...
resources/lib/functions/GraphStyleEdition.js
View file @
5b6fb0fb
...
@@ -573,7 +573,7 @@ metExploreD3.GraphStyleEdition = {
...
@@ -573,7 +573,7 @@ metExploreD3.GraphStyleEdition = {
if
(
biologicalType
===
"
link
"
)
if
(
biologicalType
===
"
link
"
)
selection
=
d3
.
select
(
"
#viz
"
).
select
(
"
#D3viz
"
).
selectAll
(
"
.linkGroup
"
);
selection
=
d3
.
select
(
"
#viz
"
).
select
(
"
#D3viz
"
).
selectAll
(
"
.linkGroup
"
);
console
.
log
(
selection
);
selection
selection
.
selectAll
(
target
+
"
:not(.bypassed
"
+
attrType
+
attrName
+
biologicalType
+
"
)
"
+
"
:not(.mapped
"
+
attrType
+
attrName
+
biologicalType
+
"
)
"
)
.
selectAll
(
target
+
"
:not(.bypassed
"
+
attrType
+
attrName
+
biologicalType
+
"
)
"
+
"
:not(.mapped
"
+
attrType
+
attrName
+
biologicalType
+
"
)
"
)
.
setLabelNodeText
(
styleToUse
,
value
);
.
setLabelNodeText
(
styleToUse
,
value
);
...
...
resources/lib/model/ReactionStyle.js
View file @
5b6fb0fb
...
@@ -5,7 +5,21 @@
...
@@ -5,7 +5,21 @@
/**
/**
* draw a Reaction
* draw a Reaction
*/
*/
var
ReactionStyle
=
function
(
backgroundColor
,
height
,
width
,
rx
,
ry
,
opacity
,
strokeColor
,
strokeWidth
,
fontColor
,
fontSize
,
fontWeight
,
labelOpacity
,
displayNodeName
,
useAlias
){
var
ReactionStyle
=
function
(
backgroundColor
,
height
,
width
,
rx
,
ry
,
opacity
,
strokeColor
,
strokeWidth
,
fontColor
,
fontSize
,
fontWeight
,
labelOpacity
,
displayNodeName
,
useAlias
){
if
(
backgroundColor
)
if
(
backgroundColor
)
this
.
backgroundColor
=
backgroundColor
;
this
.
backgroundColor
=
backgroundColor
;
...
...
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