title: Plotly Ipywidgets - Interactive - Accessing cross sample for figure output
body: <p>I am new to plotly and ipywidgets</p>
  <p>I want to create a <code>fig</code> that has two board of controllers, called <code>control1</code> and <code>control2</code>. In which, <code>control1</code> is a set of widgets allow me to modify to data. Then in <code>control2</code> I want to access the data in <code>control1</code> for further analysis and display.</p>
  <p>The simple solution for this is to combine <code>control1</code> and <code>control2</code> as a single <code>control</code> board. However, I have many filter and this makes it does not look very nice so I want to separate them.</p>
  <p>Let me illustrate with a simple data:</p>
  <pre><code>   comp  year  val1  val2
  0     a  2000    89    19
  1     a  2001    47    91
  2     a  2002    50    25
  3     a  2003    63     5
  4     a  2004    40    28
  5     a  2005    79    53
  6     b  2000    26    57
  7     b  2001    19    75
  8     b  2002    72    89
  9     b  2003    74     7
  10    b  2004    49    11
  11    c  2000    35    62
  12    c  2001    50    23
  13    c  2002    32    40
  14    c  2003    83    60
  15    d  2000    91    71
  16    d  2001    61    64
  17    d  2002    29    80
  18    d  2003   100    48
  19    d  2004    38    41
  20    d  2005    75    38
  </code></pre>
  <p>Creating figure by:</p>
  <pre><code>import ipywidgets as widgets
  import pandas as pd
  import plotly.graph_objects as go
  
  # Import data
  df = pd.read_csv('test_interactive.csv')
  
  # Creating figure
  data = go.Scattergl(x=df['val1'],
                      y=df['val2'],
                      mode='markers')
  layout = go.Layout(title='Some Title')
  fig = go.FigureWidget(data=data, layout=layout)
  
  # Create `control1` board:
  def graph_filter(comp, year):
      # filter by 'comp' and 'year':
      tem = df[(df['comp'] == comp) &amp; (df['year'] == year)]
      
      fig.data[0].x = tem['val1']
      fig.data[0].y = tem['val2']
      
  control1 = widgets.interactive(
      graph_filter,
      comp=widgets.Dropdown(
          options=df['comp'].unique(),
          value='a',
          disabeled=False,
          description='Select Comp'),
      year=widgets.Dropdown(
          options=df['year'].unique(),
          value=2000,
          description='Select Year',
          disabeled=False)
  )
  </code></pre>
  <p>Now I want to create another <code>control2</code> which I can access data filter after <code>control1</code> for further analysis but I don't know how to.</p>
  <pre><code>control2 = ???
  </code></pre>
  <p>Thank you</p>