{"action":"created","issue":{"url":"https://api.github.com/repos/theia-ide/sprotty/issues/145","repository_url":"https://api.github.com/repos/theia-ide/sprotty","labels_url":"https://api.github.com/repos/theia-ide/sprotty/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/theia-ide/sprotty/issues/145/comments","events_url":"https://api.github.com/repos/theia-ide/sprotty/issues/145/events","html_url":"https://github.com/theia-ide/sprotty/issues/145","id":241257758,"number":145,"title":"Add SVG export","user":{"login":"JanKoehnlein","id":377752,"avatar_url":"https://avatars2.githubusercontent.com/u/377752?v=3","gravatar_id":"","url":"https://api.github.com/users/JanKoehnlein","html_url":"https://github.com/JanKoehnlein","followers_url":"https://api.github.com/users/JanKoehnlein/followers","following_url":"https://api.github.com/users/JanKoehnlein/following{/other_user}","gists_url":"https://api.github.com/users/JanKoehnlein/gists{/gist_id}","starred_url":"https://api.github.com/users/JanKoehnlein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanKoehnlein/subscriptions","organizations_url":"https://api.github.com/users/JanKoehnlein/orgs","repos_url":"https://api.github.com/users/JanKoehnlein/repos","events_url":"https://api.github.com/users/JanKoehnlein/events{/privacy}","received_events_url":"https://api.github.com/users/JanKoehnlein/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"JanKoehnlein","id":377752,"avatar_url":"https://avatars2.githubusercontent.com/u/377752?v=3","gravatar_id":"","url":"https://api.github.com/users/JanKoehnlein","html_url":"https://github.com/JanKoehnlein","followers_url":"https://api.github.com/users/JanKoehnlein/followers","following_url":"https://api.github.com/users/JanKoehnlein/following{/other_user}","gists_url":"https://api.github.com/users/JanKoehnlein/gists{/gist_id}","starred_url":"https://api.github.com/users/JanKoehnlein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanKoehnlein/subscriptions","organizations_url":"https://api.github.com/users/JanKoehnlein/orgs","repos_url":"https://api.github.com/users/JanKoehnlein/repos","events_url":"https://api.github.com/users/JanKoehnlein/events{/privacy}","received_events_url":"https://api.github.com/users/JanKoehnlein/received_events","type":"User","site_admin":false},"assignees":[{"login":"JanKoehnlein","id":377752,"avatar_url":"https://avatars2.githubusercontent.com/u/377752?v=3","gravatar_id":"","url":"https://api.github.com/users/JanKoehnlein","html_url":"https://github.com/JanKoehnlein","followers_url":"https://api.github.com/users/JanKoehnlein/followers","following_url":"https://api.github.com/users/JanKoehnlein/following{/other_user}","gists_url":"https://api.github.com/users/JanKoehnlein/gists{/gist_id}","starred_url":"https://api.github.com/users/JanKoehnlein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanKoehnlein/subscriptions","organizations_url":"https://api.github.com/users/JanKoehnlein/orgs","repos_url":"https://api.github.com/users/JanKoehnlein/repos","events_url":"https://api.github.com/users/JanKoehnlein/events{/privacy}","received_events_url":"https://api.github.com/users/JanKoehnlein/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2017-07-07T13:04:43Z","updated_at":"2017-07-10T09:12:52Z","closed_at":null,"body":"Make it possible to export the diagram in SVG format.\r\n"},"comment":{"url":"https://api.github.com/repos/theia-ide/sprotty/issues/comments/314050507","html_url":"https://github.com/theia-ide/sprotty/issues/145#issuecomment-314050507","issue_url":"https://api.github.com/repos/theia-ide/sprotty/issues/145","id":314050507,"user":{"login":"JanKoehnlein","id":377752,"avatar_url":"https://avatars2.githubusercontent.com/u/377752?v=3","gravatar_id":"","url":"https://api.github.com/users/JanKoehnlein","html_url":"https://github.com/JanKoehnlein","followers_url":"https://api.github.com/users/JanKoehnlein/followers","following_url":"https://api.github.com/users/JanKoehnlein/following{/other_user}","gists_url":"https://api.github.com/users/JanKoehnlein/gists{/gist_id}","starred_url":"https://api.github.com/users/JanKoehnlein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanKoehnlein/subscriptions","organizations_url":"https://api.github.com/users/JanKoehnlein/orgs","repos_url":"https://api.github.com/users/JanKoehnlein/repos","events_url":"https://api.github.com/users/JanKoehnlein/events{/privacy}","received_events_url":"https://api.github.com/users/JanKoehnlein/received_events","type":"User","site_admin":false},"created_at":"2017-07-10T09:12:52Z","updated_at":"2017-07-10T09:12:52Z","body":"- [ ] currently all stylesheets are merged into the SVG. We should restrict that to the needed ones:\r\n\r\nThis is especially bad for the Xtext examples, which include huge CSS files that are not needed.\r\nThere is no good API to inspect which CSS rules have been applied to a given DOM element. The best I could find is [this](https://stackoverflow.com/a/22638396/6176337). A solution based on this would have high complexity (#rules times #elements) which doesn't sound very appealing.\r\n\r\nAnother solution could be based on `getComputedStyles` and inlining the result as style attributes on individual SVG elements. Once again, it doesn't seem to be (easily) possible to distinguish the computed styles from the default ones. Best algorithm here seems to be to create a new iframe add an element of the given type, read its properties using `getComputedStyles` and compare these against the styles form the original element. Not so appealing either.\r\n\r\nI'd go for a filtering approach: The implementor can programmatically filter which css files are exported."}}
{"actor":{"display_login":"JanKoehnlein"}}