# how to unselect an item in data table?

**URL:** <https://discourse.bokeh.org/t/how-to-unselect-an-item-in-data-table/1288>\
**Category:** Community Support\
**Created:** [June 13, 2016, 12:29pm UTC](https://discourse.bokeh.org/t/how-to-unselect-an-item-in-data-table/1288 "2016-06-13T12:29:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bo\_Qiang](https://discourse.bokeh.org/letter_avatar_proxy/v4/letter/b/c68b51/32.png) [@Bo\_Qiang](https://discourse.bokeh.org/u/Bo_Qiang)\
**Post date:** [June 13, 2016, 12:29pm UTC](https://discourse.bokeh.org/t/how-to-unselect-an-item-in-data-table/1288/1 "2016-06-13T12:29:09Z")

</div>

Hi,

I am working on a “rect” plot and its entries are linked with a data table. When I click an entry in the table, the plot will highlight the corresponding area. This works fine. But I don’t know how to unselect the entry in the table. In another words, how to return to the state when nothing been highlighted.

# -_- coding: utf-8 -_-

“”"

Football chart example.

@author: qianbo01

“”"

import numpy as np

from bokeh.plotting import figure, show, output\_file

from bokeh.models import HoverTool, ColumnDataSource

from bokeh.models.widgets import DataTable, TableColumn

from bokeh.models.widgets.layouts import HBox

from bokeh.plotting import gridplot

hours =

for i1 in range(24):

hours.append(“%02d”%(i1))

minutes =

for i1 in range(60):

minutes.append(“%02d”%(i1))

xname =

yname =

values =

colors =

for i1 in range(24):

for i2 in range(60):

xname.append(minutes[i2])

yname.append(hours[i1])

values.append(np.random.rand())

colors.append(“#66FFFF”)

source = ColumnDataSource(data = dict(xname = xname,

yname = yname,

values = values,

colors = colors))

p = figure(title = “Football Chart Example”,

x\_axis\_location = “above”,

y\_axis\_location = “left”,

tools=“hover,save”,

x\_range = minutes,

y\_range = list(reversed(hours)))

p.plot\_width = 1000

p.plot\_height = int(p.plot\_width\*24/60)

p.grid.grid\_line\_color = None

p.axis.axis\_line\_color = None

p.axis.major\_tick\_line\_color = None

p.axis.major\_label\_text\_font\_size = “9pt”

p.axis.major\_label\_standoff = 0

p.xaxis.major\_label\_orientation = np.pi/2

p.rect(‘xname’, ‘yname’, 0.9, 0.9,

source = source,

color = ‘colors’,

line\_color = None)

p.select\_one(HoverTool).tooltips = [(‘Time ‘,’@yname: @xname’)]

columns = [TableColumn(field=“values”, title=“Value”)]

data\_table = DataTable(source=source, columns=columns, width=400, height=280)

output\_file(“football.html”, title=“football chart example”)

tot = HBox(data\_table, gridplot([[p]]))

show(tot)

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads.bokeh.org/original/2X/1/14eb24f9e10e4e9b78e3f10f66c04ffa96446e5a.svg) [@system](https://discourse.bokeh.org/u/system)\
**Post date:** [July 21, 2021, 9:08pm UTC](https://discourse.bokeh.org/t/how-to-unselect-an-item-in-data-table/1288/2 "2021-07-21T21:08:33Z")

</div>


