{"action":"created","issue":{"url":"https://api.github.com/repos/nengo/nengo_gui/issues/404","labels_url":"https://api.github.com/repos/nengo/nengo_gui/issues/404/labels{/name}","comments_url":"https://api.github.com/repos/nengo/nengo_gui/issues/404/comments","events_url":"https://api.github.com/repos/nengo/nengo_gui/issues/404/events","html_url":"https://github.com/nengo/nengo_gui/pull/404","id":87595343,"number":404,"title":"HTMLView component for custom visualizations","user":{"login":"tcstewar","id":2380772,"avatar_url":"https://avatars.githubusercontent.com/u/2380772?v=3","gravatar_id":"","url":"https://api.github.com/users/tcstewar","html_url":"https://github.com/tcstewar","followers_url":"https://api.github.com/users/tcstewar/followers","following_url":"https://api.github.com/users/tcstewar/following{/other_user}","gists_url":"https://api.github.com/users/tcstewar/gists{/gist_id}","starred_url":"https://api.github.com/users/tcstewar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcstewar/subscriptions","organizations_url":"https://api.github.com/users/tcstewar/orgs","repos_url":"https://api.github.com/users/tcstewar/repos","events_url":"https://api.github.com/users/tcstewar/events{/privacy}","received_events_url":"https://api.github.com/users/tcstewar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-12T03:55:05Z","updated_at":"2015-06-13T23:30:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nengo/nengo_gui/pulls/404","html_url":"https://github.com/nengo/nengo_gui/pull/404","diff_url":"https://github.com/nengo/nengo_gui/pull/404.diff","patch_url":"https://github.com/nengo/nengo_gui/pull/404.patch"},"body":"This lets a Node output arbitrary HTML to nengo_gui.\r\n\r\nThis lets you do this sort of thing:\r\n\r\n```python\r\nimport nengo\r\nmodel = nengo.Network()\r\nwith model:\r\n    def my_node(t, x):\r\n        my_node.html = '<h1>%1.3f %1.3f</h1>' % (x[0], x[1])\r\n    node = nengo.Node(my_node, size_in=2)    \r\n    values = nengo.Node([0,0])\r\n    nengo.Connection(values, node)\r\n```\r\n\r\nThe HTML can be anything you want, including SVG, making it possible to create visualizations of the 3-link arm, or of the Spaun brain, or of the task, anything else we want.\r\n\r\nThe basic idea is that if the output of a Node has a ```.html``` attribute, then you'll be able to make an HTMLView plot.  After the Node is run, the value of that ```html``` attribute is sent to the visualizer."},"comment":{"url":"https://api.github.com/repos/nengo/nengo_gui/issues/comments/111760246","html_url":"https://github.com/nengo/nengo_gui/pull/404#issuecomment-111760246","issue_url":"https://api.github.com/repos/nengo/nengo_gui/issues/404","id":111760246,"user":{"login":"jgosmann","id":850157,"avatar_url":"https://avatars.githubusercontent.com/u/850157?v=3","gravatar_id":"","url":"https://api.github.com/users/jgosmann","html_url":"https://github.com/jgosmann","followers_url":"https://api.github.com/users/jgosmann/followers","following_url":"https://api.github.com/users/jgosmann/following{/other_user}","gists_url":"https://api.github.com/users/jgosmann/gists{/gist_id}","starred_url":"https://api.github.com/users/jgosmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgosmann/subscriptions","organizations_url":"https://api.github.com/users/jgosmann/orgs","repos_url":"https://api.github.com/users/jgosmann/repos","events_url":"https://api.github.com/users/jgosmann/events{/privacy}","received_events_url":"https://api.github.com/users/jgosmann/received_events","type":"User","site_admin":false},"created_at":"2015-06-13T23:30:05Z","updated_at":"2015-06-13T23:30:05Z","body":"I like `._nengo_html_`, it's similar to `._ipython_display_`."}}