Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Maintenance - Mise à jour mensuelle Lundi 6 Février entre 7h00 et 9h00
Open sidebar
genotoul-bioinfo
jvenn
Commits
e330eaf3
Commit
e330eaf3
authored
Mar 30, 2015
by
Jerome Mariette
Browse files
export png ok
parent
65d07231
Changes
1
Show whitespace changes
Inline
Side-by-side
src/jvenn.js
View file @
e330eaf3
...
@@ -2058,13 +2058,21 @@
...
@@ -2058,13 +2058,21 @@
$
(
this
).
css
(
'
border-color
'
,
"
white
"
);
$
(
this
).
css
(
'
border-color
'
,
"
white
"
);
});
});
select_form
.
hide
();
select_form
.
hide
();
alert
(
"
TODO
"
)
var
export_canvas
=
document
.
createElement
(
"
canvas
"
);
/*html2canvas($("#frame")).then(function(canvas) {
export_ctx
=
export_canvas
.
getContext
(
"
2d
"
);
var img = canvas.toDataURL("image/png");
export_canvas
.
width
=
__canvasWidth
;
$('#data-export').attr("href", img);
export_canvas
.
height
=
__canvasHeight
;
var
img
=
document
.
createElement
(
"
img
"
);
img
.
setAttribute
(
"
src
"
,
"
data:image/svg+xml;base64,
"
+
window
.
btoa
(
__context
.
getSerializedSvg
(
true
)));
img
.
setAttribute
(
'
height
'
,
'
700px
'
);
img
.
setAttribute
(
'
width
'
,
'
500px
'
);
img
.
onload
=
function
()
{
export_ctx
.
drawImage
(
img
,
0
,
0
);
var
export_img
=
export_canvas
.
toDataURL
(
"
image/png
"
);
$
(
'
#data-export
'
).
attr
(
"
href
"
,
export_img
);
$
(
'
#data-export
'
).
attr
(
"
download
"
,
"
jVenn_chart.png
"
);
$
(
'
#data-export
'
).
attr
(
"
download
"
,
"
jVenn_chart.png
"
);
$
(
'
#data-export
'
)[
0
].
click
();
$
(
'
#data-export
'
)[
0
].
click
();
}
);*/
}
;
});
});
$
(
"
#format-svg
"
).
click
(
function
(
event
)
{
$
(
"
#format-svg
"
).
click
(
function
(
event
)
{
$
(
"
#canvasExport
"
).
css
(
'
background
'
,
ceColorOri
);
$
(
"
#canvasExport
"
).
css
(
'
background
'
,
ceColorOri
);
...
@@ -2078,7 +2086,7 @@
...
@@ -2078,7 +2086,7 @@
$
(
this
).
css
(
'
border-color
'
,
"
white
"
);
$
(
this
).
css
(
'
border-color
'
,
"
white
"
);
});
});
select_form
.
hide
();
select_form
.
hide
();
var
svgContent
=
"
data:image/svg+xml;base64,
"
+
window
.
btoa
(
__context
.
getSerializedSvg
(
true
)),
var
svgContent
=
"
data:image/svg+xml;base64,
"
+
window
.
btoa
(
__context
.
getSerializedSvg
(
true
)),
encodedUri
=
encodeURI
(
svgContent
);
encodedUri
=
encodeURI
(
svgContent
);
$
(
'
#data-export
'
).
attr
(
"
href
"
,
encodedUri
);
$
(
'
#data-export
'
).
attr
(
"
href
"
,
encodedUri
);
$
(
'
#data-export
'
).
attr
(
"
download
"
,
"
jVenn_chart.svg
"
);
$
(
'
#data-export
'
).
attr
(
"
download
"
,
"
jVenn_chart.svg
"
);
...
...
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