Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
UniProt
Front End
QuickGoFE
Commits
61165540
Commit
61165540
authored
Aug 28, 2020
by
Mahdi Mahmoudy
Browse files
Merge branch 'master' of
https://github.com/ebi-uniprot/QuickGoFE
parents
757ea481
2baef969
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
app/directives/chart.html
app/directives/chart.html
+1
-0
app/directives/chart.js
app/directives/chart.js
+30
-0
No files found.
app/directives/chart.html
View file @
61165540
...
...
@@ -28,6 +28,7 @@
<input
type=
"checkbox"
ng-model=
"$parent.showChildren"
>
Show children
</label>
<a
class=
"button small"
ng-click=
"applyOptions();$close()"
>
Apply
</a>
<a
class=
"button small"
ng-click=
"downloadChart();$close()"
>
Download Chart
</a>
</pane>
</dropdown-toggle>
</div>
...
...
app/directives/chart.js
View file @
61165540
...
...
@@ -22,6 +22,36 @@ angular
scope
.
applyOptions
=
function
(){
that
.
drawChart
(
scope
);
};
scope
.
downloadChart
=
function
()
{
if
(
!
scope
.
termBoxHeight
)
{
return
;
}
if
(
!
scope
.
termBoxWidth
)
{
return
;
}
// Requesting a larger chart from the service
var
chartPromise
=
chartService
.
getChart
(
scope
.
ids
,
scope
.
showIds
,
scope
.
showKey
,
Math
.
round
(
scope
.
termBoxWidth
*
2.5
),
Math
.
round
(
scope
.
termBoxHeight
*
2.5
),
Math
.
round
(
scope
.
fontSize
*
2.5
),
scope
.
showSlimColours
,
scope
.
showChildren
,
);
chartPromise
.
then
(
function
(
d
)
{
var
a
=
document
.
createElement
(
"
a
"
);
a
.
href
=
"
data:image/png;base64,
"
+
d
.
data
;
a
.
download
=
scope
.
title
+
"
.png
"
;
a
.
click
();
});
}
this
.
drawChart
(
scope
);
},
drawChart
:
function
(
scope
)
{
...
...
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