Skip to content

Fix Firefox toImage failures #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 14, 2015
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/plots/layout_attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var extendFlat = Plotly.Lib.extendFlat;
module.exports = {
font: {
family: extendFlat({}, fontAttrs.family, {
dflt: '"Open sans", verdana, arial, sans-serif'
dflt: '"Open Sans", verdana, arial, sans-serif'
}),
size: extendFlat({}, fontAttrs.size, {
dflt: 12
Expand Down
4 changes: 2 additions & 2 deletions src/plots/plots.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ plots.addLinks = function(gd) {
linkContainer.enter().append('text')
.classed('js-plot-link-container', true)
.style({
'font-family':'"Open Sans",Arial,sans-serif',
'font-size':'12px',
'font-family':'"Open Sans", Arial, sans-serif',
'font-size': '12px',
'fill': Plotly.Color.defaultLine,
'pointer-events': 'all'
})
Expand Down
2 changes: 1 addition & 1 deletion src/snapshot/tosvg.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ module.exports = function toSVG(gd, format) {
// Is this an IE thing? Any other attributes or style elements that can have quotes in them?
// TODO: this looks like a noop right now - what happened to it?
var ff = txt.style('font-family');
if(ff && ff.indexOf('"') !== -1) txt.style('font-family', ff.replace(/"/g, '"'));
if(ff && ff.indexOf('"') !== -1) txt.style('font-family', ff.replace(/"/g, '\\\''));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexcjohnson could you comment of the comment above this line?

This patch makes toImage work in FF 42.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets put a lot of comments here . I would link the codepen example and bug issue and even this PR # in the code. In one year when something else goes wrong here we will be glad of it :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking this was needed for when we passed svg to the back end for image gen... Then we turned it to a noop when we started doing this same fix on the back end... Then it became moot when we started passing json.

});

if(format === 'pdf' || format === 'eps') {
Expand Down