Skip to content

Commit 7c8a06e

Browse files
committed
Merge pull request #311 from plotly/patch-image-export
Patch image export
2 parents 81dcfd9 + 1af0ec8 commit 7c8a06e

File tree

4 files changed

+7453
-1
lines changed

4 files changed

+7453
-1
lines changed

src/snapshot/tosvg.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ module.exports = function toSVG(gd, format) {
104104

105105
svg.selectAll('text')
106106
.attr({'data-unformatted': null})
107+
.style({
108+
'-webkit-user-select': null,
109+
'-moz-user-select': null,
110+
'-ms-user-select': null
111+
})
107112
.each(function() {
108113
// hidden text is pre-formatting mathjax, the browser ignores it but it can still confuse batik
109114
var txt = d3.select(this);

test/image/baselines/text_export.png

86.4 KB
Loading

test/image/export_test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ function runAll() {
5050
var fileNames = [
5151
'0.json',
5252
'geo_first.json',
53-
'gl3d_z-range.json'
53+
'gl3d_z-range.json',
54+
'text_export.json'
5455
];
5556

5657
t.plan(fileNames.length * FORMATS.length);

0 commit comments

Comments
 (0)