{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaGizmos/Interact.jl/issues/225","repository_url":"https://api.github.com/repos/JuliaGizmos/Interact.jl","labels_url":"https://api.github.com/repos/JuliaGizmos/Interact.jl/issues/225/labels{/name}","comments_url":"https://api.github.com/repos/JuliaGizmos/Interact.jl/issues/225/comments","events_url":"https://api.github.com/repos/JuliaGizmos/Interact.jl/issues/225/events","html_url":"https://github.com/JuliaGizmos/Interact.jl/issues/225","id":323055963,"node_id":"MDU6SXNzdWUzMjMwNTU5NjM=","number":225,"title":"add `throttle` option to `@manipulate`","user":{"login":"ssfrr","id":734386,"node_id":"MDQ6VXNlcjczNDM4Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/734386?v=4","gravatar_id":"","url":"https://api.github.com/users/ssfrr","html_url":"https://github.com/ssfrr","followers_url":"https://api.github.com/users/ssfrr/followers","following_url":"https://api.github.com/users/ssfrr/following{/other_user}","gists_url":"https://api.github.com/users/ssfrr/gists{/gist_id}","starred_url":"https://api.github.com/users/ssfrr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssfrr/subscriptions","organizations_url":"https://api.github.com/users/ssfrr/orgs","repos_url":"https://api.github.com/users/ssfrr/repos","events_url":"https://api.github.com/users/ssfrr/events{/privacy}","received_events_url":"https://api.github.com/users/ssfrr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-15T03:41:52Z","updated_at":"2018-05-31T17:34:06Z","closed_at":null,"author_association":"NONE","body":"I was testing with the following code:\r\n\r\n```julia\r\nusing Plots\r\nusing Interact\r\ngr()\r\n\r\n@manipulate for row in 1:100, col in 1:100\r\n    data = zeros(100,100)\r\n    data[row,col] = 1\r\n    heatmap(data)\r\nend\r\n```\r\n\r\nIt's awesome that it was so easy to get it working. Unfortunately often the rendering can't keep up with all the signals being sent, so things get backed up and it makes the sliders jump erratically, and the plots flash quite a bit. Throttling the slider signals helps substantially, but then you can't just use `@manipulate` any more. Here's what I changed it to:\r\n\r\n```julia\r\nrowslider = slider(1:100)\r\ncolslider = slider(1:100)\r\ndisplay.([rowslider, colslider])\r\nmap(throttle(0.2, signal(rowslider)), throttle(0.2, signal(colslider))) do row, col\r\n    data = zeros(100,100)\r\n    data[row,col] = 1\r\n    heatmap(data)\r\nend\r\n```\r\n\r\nThe plot still flashes a bit, but it's overall a smoother experience. It would be cool to have a `throttle` option, to handle this use-case. something like:\r\n\r\n```julia\r\n@manipulate for row in 1:100, col in 1:100, throttle=0.2\r\n    data = zeros(100,100)\r\n    data[row,col] = 1\r\n    heatmap(data)\r\nend\r\n```"},"comment":{"url":"https://api.github.com/repos/JuliaGizmos/Interact.jl/issues/comments/393612175","html_url":"https://github.com/JuliaGizmos/Interact.jl/issues/225#issuecomment-393612175","issue_url":"https://api.github.com/repos/JuliaGizmos/Interact.jl/issues/225","id":393612175,"node_id":"MDEyOklzc3VlQ29tbWVudDM5MzYxMjE3NQ==","user":{"login":"ssfrr","id":734386,"node_id":"MDQ6VXNlcjczNDM4Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/734386?v=4","gravatar_id":"","url":"https://api.github.com/users/ssfrr","html_url":"https://github.com/ssfrr","followers_url":"https://api.github.com/users/ssfrr/followers","following_url":"https://api.github.com/users/ssfrr/following{/other_user}","gists_url":"https://api.github.com/users/ssfrr/gists{/gist_id}","starred_url":"https://api.github.com/users/ssfrr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssfrr/subscriptions","organizations_url":"https://api.github.com/users/ssfrr/orgs","repos_url":"https://api.github.com/users/ssfrr/repos","events_url":"https://api.github.com/users/ssfrr/events{/privacy}","received_events_url":"https://api.github.com/users/ssfrr/received_events","type":"User","site_admin":false},"created_at":"2018-05-31T17:34:06Z","updated_at":"2018-05-31T17:34:06Z","author_association":"NONE","body":"For my usage throttling would be better. I want to be able to slide the slider back and forth and see the visualization update. The issue is just when the rendering process is slower than the rate at which the signal updates, so it gets backed up.\r\n\r\nYou can check the `throttle` implementation for details, but basically it should rate-limit the output by creating a refractory period after an update. The first update gets sent immediately, but then subsequent updates only get sent when the refractory period expires. So an example `Signal{Int}` sequence might look like this (with time running left-to-right):\r\n\r\n```\r\ninput:   1   2  34  5              6 7 \r\noutput:  1    2    4    5          6    7\r\n```"}}
{"actor":{"display_login":"ssfrr"}}