{"action":"created","issue":{"url":"https://api.github.com/repos/plotly/dash/issues/296","repository_url":"https://api.github.com/repos/plotly/dash","labels_url":"https://api.github.com/repos/plotly/dash/issues/296/labels{/name}","comments_url":"https://api.github.com/repos/plotly/dash/issues/296/comments","events_url":"https://api.github.com/repos/plotly/dash/issues/296/events","html_url":"https://github.com/plotly/dash/issues/296","id":343029641,"node_id":"MDU6SXNzdWUzNDMwMjk2NDE=","number":296,"title":"error in tutorial","user":{"login":"CinnamonJP","id":29792957,"node_id":"MDQ6VXNlcjI5NzkyOTU3","avatar_url":"https://avatars1.githubusercontent.com/u/29792957?v=4","gravatar_id":"","url":"https://api.github.com/users/CinnamonJP","html_url":"https://github.com/CinnamonJP","followers_url":"https://api.github.com/users/CinnamonJP/followers","following_url":"https://api.github.com/users/CinnamonJP/following{/other_user}","gists_url":"https://api.github.com/users/CinnamonJP/gists{/gist_id}","starred_url":"https://api.github.com/users/CinnamonJP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CinnamonJP/subscriptions","organizations_url":"https://api.github.com/users/CinnamonJP/orgs","repos_url":"https://api.github.com/users/CinnamonJP/repos","events_url":"https://api.github.com/users/CinnamonJP/events{/privacy}","received_events_url":"https://api.github.com/users/CinnamonJP/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-20T09:07:13Z","updated_at":"2018-07-23T20:49:29Z","closed_at":"2018-07-23T20:49:29Z","author_association":"NONE","body":"In the 3rd chapter of the Dash Tutorial, there is the bug in the content \"Multiple Outputs\".\r\nhttps://dash.plot.ly/getting-started-part-2\r\n\r\n```{python3}\r\n@app.callback(\r\n    dash.dependencies.Output('cities-dropdown', 'value'),\r\n    [dash.dependencies.Input('cities-dropdown', 'options')])\r\ndef set_cities_value(available_options):\r\n    return available_options[0]['value']\r\n```\r\nbut ```available_options``` is dictionary, not list.\r\nProbably the following is collect.\r\n```{python3}\r\n@app.callback(\r\n    Output('cities-dropdown', 'value'),\r\n    [Input('countries-dropdown', 'value')])\r\ndef set_cities_value(available_options):\r\n    return all_options[available_options][0]\r\n```"},"comment":{"url":"https://api.github.com/repos/plotly/dash/issues/comments/407196304","html_url":"https://github.com/plotly/dash/issues/296#issuecomment-407196304","issue_url":"https://api.github.com/repos/plotly/dash/issues/296","id":407196304,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNzE5NjMwNA==","user":{"login":"chriddyp","id":1280389,"node_id":"MDQ6VXNlcjEyODAzODk=","avatar_url":"https://avatars3.githubusercontent.com/u/1280389?v=4","gravatar_id":"","url":"https://api.github.com/users/chriddyp","html_url":"https://github.com/chriddyp","followers_url":"https://api.github.com/users/chriddyp/followers","following_url":"https://api.github.com/users/chriddyp/following{/other_user}","gists_url":"https://api.github.com/users/chriddyp/gists{/gist_id}","starred_url":"https://api.github.com/users/chriddyp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriddyp/subscriptions","organizations_url":"https://api.github.com/users/chriddyp/orgs","repos_url":"https://api.github.com/users/chriddyp/repos","events_url":"https://api.github.com/users/chriddyp/events{/privacy}","received_events_url":"https://api.github.com/users/chriddyp/received_events","type":"User","site_admin":false},"created_at":"2018-07-23T20:49:29Z","updated_at":"2018-07-23T20:49:29Z","author_association":"MEMBER","body":"> but `available_options` is dictionary, not list.\r\n\r\nI think you are confusing this with the `all_options` variable. `available_options` _is_ a list, it's the input argument of the function and so it is the list of options that the previous callback defined:\r\n\r\n```python\r\n@app.callback(\r\n    dash.dependencies.Output('cities-dropdown', 'options'),\r\n    [dash.dependencies.Input('countries-dropdown', 'value')])\r\ndef set_cities_options(selected_country):\r\n    return [{'label': i, 'value': i} for i in all_options[selected_country]]\r\n```"}}
{"actor":{"display_login":"chriddyp"}}