{"action":"created","issue":{"url":"https://api.github.com/repos/IRkernel/IRkernel/issues/145","labels_url":"https://api.github.com/repos/IRkernel/IRkernel/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/IRkernel/IRkernel/issues/145/comments","events_url":"https://api.github.com/repos/IRkernel/IRkernel/issues/145/events","html_url":"https://github.com/IRkernel/IRkernel/issues/145","id":83550314,"number":145,"title":"Rendering of graphs in R kernel Notebooks on GitHub","user":{"login":"cfljam","id":268441,"avatar_url":"https://avatars.githubusercontent.com/u/268441?v=3","gravatar_id":"","url":"https://api.github.com/users/cfljam","html_url":"https://github.com/cfljam","followers_url":"https://api.github.com/users/cfljam/followers","following_url":"https://api.github.com/users/cfljam/following{/other_user}","gists_url":"https://api.github.com/users/cfljam/gists{/gist_id}","starred_url":"https://api.github.com/users/cfljam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfljam/subscriptions","organizations_url":"https://api.github.com/users/cfljam/orgs","repos_url":"https://api.github.com/users/cfljam/repos","events_url":"https://api.github.com/users/cfljam/events{/privacy}","received_events_url":"https://api.github.com/users/cfljam/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":31,"created_at":"2015-06-01T15:07:08Z","updated_at":"2015-07-24T07:58:11Z","closed_at":null,"body":"Hi\r\nI have been making some example notebooks about use of the kernel and R2Py for R authoring in Jupyter but have struck some inconsistencies in notebook rendering on GitHub. \r\n\r\nWhereas my python kernel notebook using R2py displays fine https://github.com/cfljam/pyRat/blob/master/Notebooks/Using%20R2Py%20in%20Jupyter%20NOtebooks.ipynb\r\n\r\nbut the same code using IRKernel doesnt display them https://github.com/cfljam/pyRat/blob/master/Notebooks/Jupyter%20Notebooks%20with%20the%20R%20kernel.ipynb\r\n\r\nMy apologies  if this is off-topic and should direct this to Github but I would be grateful of any suggestions. The automatic rendering of Jupyter notebooks in GitHub is a huge attraction and so a major motivation for using this kernel.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/IRkernel/IRkernel/issues/comments/124410890","html_url":"https://github.com/IRkernel/IRkernel/issues/145#issuecomment-124410890","issue_url":"https://api.github.com/repos/IRkernel/IRkernel/issues/145","id":124410890,"user":{"login":"flying-sheep","id":291575,"avatar_url":"https://avatars.githubusercontent.com/u/291575?v=3","gravatar_id":"","url":"https://api.github.com/users/flying-sheep","html_url":"https://github.com/flying-sheep","followers_url":"https://api.github.com/users/flying-sheep/followers","following_url":"https://api.github.com/users/flying-sheep/following{/other_user}","gists_url":"https://api.github.com/users/flying-sheep/gists{/gist_id}","starred_url":"https://api.github.com/users/flying-sheep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flying-sheep/subscriptions","organizations_url":"https://api.github.com/users/flying-sheep/orgs","repos_url":"https://api.github.com/users/flying-sheep/repos","events_url":"https://api.github.com/users/flying-sheep/events{/privacy}","received_events_url":"https://api.github.com/users/flying-sheep/received_events","type":"User","site_admin":false},"created_at":"2015-07-24T07:58:11Z","updated_at":"2015-07-24T07:58:11Z","body":"hmm, your linked notebook shows that SVGs are handled via `<img src=\"data:...\">`, right? that should already eliminate the problem. the problem should only occur if we embed SVG nodes inline.\r\n\r\nthe problem is pretty simple, and independent from R. it comes from the way id references are handled in the browser, and the R-emitted SVGs using those.\r\n\r\n1. R uses cairo for SVGs\r\n2. cairo-emitted SVGs use [`<symbol/>`s](https://developer.mozilla.org/de/docs/Web/SVG/Element/symbol) for text, i.e. all glyphs are defined once and reused wherever needed instead of either relying on the SVG renderer to render the text (using `<text/>`) or duplicating the glyph paths.\r\n3. if such an SVG is embedded inline, firefox has problems. maybe due to this:\r\n\r\n\t```html\r\n\t<body>\r\n\t\t<svg>\r\n\t\t\t<defs><symbol id=\"a\">...</symbol></defs>\r\n\t\t\t...\r\n\t\t</svg>\r\n\t\t<svg>\r\n\t\t\t<defs><symbol id=\"a\">...</symbol></defs>\r\n\t\t\t<!-- will this use the first sybol#a or the second? -->\r\n\t\t\t<use xlink:href=\"#a\" />\r\n\t\t</svg>\r\n\t</body>\r\n\t```\r\n\r\n4. if the  SVG  is in an `<iframe>` or linked to in an `<img>, there should be no problem."}}