title: Dash plotly Datatable column filtering or cropping
body: <p>I have implemented a live-update datatable to correspond with a live-update graph. Functionally, both work very well. I do have a problem with filtering the datatable to include certain columns and exclude others. For ex. If the graph is zoomed in for certain x-value (09:00-10:00), is there any way I can also crop the corresponding datatable to represent columns from that same value? Perhaps add a button with a callback that deletes specific column ids? Is there a way to delete specific 'column' 'id' inputs through python with out using the GUI? As of now, I can only manually delete individual columns which is very tedious given the amount of columns. Thank you. I hope this question is not too open-ended.</p>
  <p><a href="https://i.stack.imgur.com/tVnNG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tVnNG.png" alt="enter image description here" /></a></p>
  <pre><code>table_contents = ['Propofol/Remi @ 6.5 ug/ml', 'Fentanyl (ug)', 'Propofol (mg)', 'Remi (ug)',
                    'Ketorolac (mg)']
  </code></pre>
  <pre><code>html.Div([dash_table.DataTable(
          id='editing-columns',
          columns=[{
              'name': 'Parameter',
              'id': 'column1',
              'deletable': True,
              'renamable': True
          }],
          data=[
              {'column1': j}
              for j in table_contents
          ],
          editable=True,
      )]),
  
  </code></pre>
  <pre><code># The callback stores the previous length of the csv file in dcc.store and appends new columns if new csv data uploaded
  @app.callback(Output('editing-columns', 'columns'),
               [Input('graph-update', 'n_intervals')],
                [State('editing-columns', 'columns')],
                [State('mystore', 'data')])
  def update_columns(n, btn, existing_columns, data):
     
              with open('temp.csv', 'r') as rf:
                  reader = csv.reader(rf)
                  for a in reader:
                      existing_columns.append({
                          'id': a[3], 'name': a[3],
                          'renamable': True, 'deletable': True
                  })
  
              return existing_columns, html.Div('Program running')
  
          else:
              check_length = []
              de_serialized = json.loads(data)
              with open('temp.csv', 'r') as rf:
                  reader = csv.reader(rf)
                  for a in reader:
                      check_length.append(a[3])
  
              if len(check_length) == 0:
                  return existing_columns, html.Div('Program running')
  
              elif len(check_length) &gt; len(de_serialized):
                  existing_columns.append({
                      'id': check_length[-1], 'name': check_length[-1],
                      'renamable': True, 'deletable': True
                  })
                  return existing_columns, html.Div('Program running')
  
              else:
                  return existing_columns, html.Div('Program running')
  </code></pre>
  <pre><code>#The graph is a bar and scatter graph that is updated with x,y values derived from the same csv as the datatable.
  @app.callback(
      dash.dependencies.Output('live-graph', 'figure'),
      [dash.dependencies.Input('graph-update-BP', 'n_intervals')],
  )
  def update_graph_scatter_1(btn, n):
          trace = []
          trace2 = []
  
          blood_pressure = []
          hr = []
   with open('temp.csv', 'r') as rf:
              reader_2 = csv.reader(rf)
              for a in reader_2:
                  blood_pressure.append(eval(a[4]))
                  time.append(a[3])
          for i in range(0, len(blood_pressure)):
              trace.append(go.Box(y=blood_pressure[i],
                                  x=triple_time[i],
                                  line=dict(color='#6a92ff'),
                                  hoverinfo='all'))
          for a in range(0, len(hr)):
              trace2.append(go.Scatter(y=coated_hr[a],
                                       x=coated_time[a],
                                       name='HR',
  </code></pre>