{"action":"created","issue":{"url":"https://api.github.com/repos/clientIO/joint/issues/177","labels_url":"https://api.github.com/repos/clientIO/joint/issues/177/labels{/name}","comments_url":"https://api.github.com/repos/clientIO/joint/issues/177/comments","events_url":"https://api.github.com/repos/clientIO/joint/issues/177/events","html_url":"https://github.com/clientIO/joint/issues/177","id":105972719,"number":177,"title":"toJSON should not include the link’s selectors","user":{"login":"nomeata","id":148037,"avatar_url":"https://avatars.githubusercontent.com/u/148037?v=3","gravatar_id":"","url":"https://api.github.com/users/nomeata","html_url":"https://github.com/nomeata","followers_url":"https://api.github.com/users/nomeata/followers","following_url":"https://api.github.com/users/nomeata/following{/other_user}","gists_url":"https://api.github.com/users/nomeata/gists{/gist_id}","starred_url":"https://api.github.com/users/nomeata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomeata/subscriptions","organizations_url":"https://api.github.com/users/nomeata/orgs","repos_url":"https://api.github.com/users/nomeata/repos","events_url":"https://api.github.com/users/nomeata/events{/privacy}","received_events_url":"https://api.github.com/users/nomeata/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-11T09:10:00Z","updated_at":"2015-09-11T10:55:37Z","closed_at":null,"body":"`graph.toJSON` is supposed to be used for serialization and persistence. Nevertheless, I find that it contains code like\r\n```\r\n\"target\":{\"id\":\"04a59ab3-eccb-417e-9ccd-4d855a056100\",\"selector\":\"g:nth-child(1) > path:nth-child(3)\",\"port\":\"in1\"}\r\n```\r\nThe content of the `selector` is not a model value, but rather an implementation detail of the `View`, and it worries me that I might not be able to load back a persisted graph after I have changed the my views for the element.\r\n\r\n`joint.dia.link` contains a function `makeSelector` that recovers the selector from the `port`, it seems, so it would make sense to *not* include `selector` in the serialization and use that in `fromJSON`."},"comment":{"url":"https://api.github.com/repos/clientIO/joint/issues/comments/139515372","html_url":"https://github.com/clientIO/joint/issues/177#issuecomment-139515372","issue_url":"https://api.github.com/repos/clientIO/joint/issues/177","id":139515372,"user":{"login":"nomeata","id":148037,"avatar_url":"https://avatars.githubusercontent.com/u/148037?v=3","gravatar_id":"","url":"https://api.github.com/users/nomeata","html_url":"https://github.com/nomeata","followers_url":"https://api.github.com/users/nomeata/followers","following_url":"https://api.github.com/users/nomeata/following{/other_user}","gists_url":"https://api.github.com/users/nomeata/gists{/gist_id}","starred_url":"https://api.github.com/users/nomeata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomeata/subscriptions","organizations_url":"https://api.github.com/users/nomeata/orgs","repos_url":"https://api.github.com/users/nomeata/repos","events_url":"https://api.github.com/users/nomeata/events{/privacy}","received_events_url":"https://api.github.com/users/nomeata/received_events","type":"User","site_admin":false},"created_at":"2015-09-11T10:55:37Z","updated_at":"2015-09-11T10:55:37Z","body":"Ok, I was somehow expecting that the port attribute is optional and hence this behaviour.\r\n\r\nIncidentially, I am right now writing my own custom View with custom port shapes, by overriding `renderMarkup`. It felt too wrong to have view-related data (`markup`, `attrs`) in the model..."}}