text: import dash
  import dash_core_components as dcc
  import dash_html_components as html
  from dash.dependencies import Input, Output
  from dash_dict_callback import DashDictCallbackPlugin
  import plotly.express as px
  
  import pandas as pd
  
  external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
  
  app = dash.Dash(__name__, external_stylesheets=external_stylesheets, plugins=[DashDictCallbackPlugin])
  
  df = pd.read_csv('https://plotly.github.io/datasets/country_indicators.csv')
  
  available_indicators = df['Indicator Name'].unique()
  
  app.layout = html.Div([
      html.Div([
  
          html.Div([
              dcc.Dropdown(
                  id='xaxis-column',
                  options=[{'label': i, 'value': i} for i in available_indicators],
                  value='Fertility rate, total (births per woman)'
              ),
              dcc.RadioItems(
                  id='xaxis-type',
                  options=[{'label': i, 'value': i} for i in ['Linear', 'Log']],
                  value='Linear',
                  labelStyle={'display': 'inline-block'}
              )
          ],
          style={'width': '48%', 'display': 'inline-block'}),
  
          html.Div([
              dcc.Dropdown(
                  id='yaxis-column',
                  options=[{'label': i, 'value': i} for i in available_indicators],
                  value='Life expectancy at birth, total (years)'
              ),
              dcc.RadioItems(
                  id='yaxis-type',
                  options=[{'label': i, 'value': i} for i in ['Linear', 'Log']],
                  value='Linear',
                  labelStyle={'display': 'inline-block'}
              )
          ],style={'width': '48%', 'float': 'right', 'display': 'inline-block'})
      ]),
  
      dcc.Graph(id='indicator-graphic'),
  
      dcc.Slider(
          id='year--slider',
          min=df['Year'].min(),
          max=df['Year'].max(),
          value=df['Year'].max(),
          marks={str(year): str(year) for year in df['Year'].unique()},
          step=None
      )
  ])
  
  @app.dict_callback(
      Output('indicator-graphic', 'figure'),
      Input('xaxis-column', 'value'),
      Input('yaxis-column', 'value'),
      Input('xaxis-type', 'value'),
      Input('yaxis-type', 'value'),
      Input('year--slider', 'value'))
  def update_graph(inputs,states):
      dff = df[df['Year'] == inputs['year--slider.value']]
  
      fig = px.scatter(x=dff[dff['Indicator Name'] == inputs['xaxis-column.value']]['Value'],
                       y=dff[dff['Indicator Name'] == inputs['yaxis-column.value']]['Value'],
                       hover_name=dff[dff['Indicator Name'] == inputs['yaxis-column.value']]['Country Name'])
  
      fig.update_layout(margin={'l': 40, 'b': 40, 't': 10, 'r': 0}, hovermode='closest')
  
      fig.update_xaxes(title=inputs['xaxis-column.value'],
                       type='linear' if inputs['xaxis-type.value'] == 'Linear' else 'log')
  
      fig.update_yaxes(title=inputs['yaxis-column.value'],
                       type='linear' if inputs['yaxis-type.value'] == 'Linear' else 'log')
  
      return {'indicator-graphic.figure': fig}
  
  
  if __name__ == '__main__':
      app.run_server(debug=True)
  