<s> from __future__ import print_function <EOL> from bokeh . core . properties import String <EOL> from bokeh . document import Document <EOL> from bokeh . embed import file_html <EOL> from bokeh . models . callbacks import Callback <EOL> from bokeh . models . glyphs import Circle <EOL> from bokeh . models import Plot , DataRange1d , LinearAxis , ColumnDataSource , PanTool , WheelZoomTool , TapTool <EOL> from bokeh . models . layouts import HBox <EOL> from bokeh . resources import INLINE <EOL> from bokeh . util . browser import view <EOL> class Popup ( Callback ) : <EOL> __implementation__ = """<STR_LIT>""" <EOL> message = String ( "<STR_LIT>" , help = """<STR_LIT>""" ) <EOL> class MyHBox ( HBox ) : <EOL> __implementation__ = """<STR_LIT>""" <EOL> source = ColumnDataSource ( <EOL> data = dict ( <EOL> x = [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:5> ] , <EOL> y = [ <NUM_LIT:5> , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:2> , <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT> ] , <EOL> color = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] <EOL> ) <EOL> ) <EOL> xdr = DataRange1d ( ) <EOL> ydr = DataRange1d ( ) <EOL> plot = Plot ( x_range = xdr , y_range = ydr ) <EOL> circle = Circle ( x = "<STR_LIT:x>" , y = "<STR_LIT:y>" , radius = <NUM_LIT> , fill_color = "<STR_LIT>" , line_color = "<STR_LIT>" ) <EOL> circle_renderer = plot . add_glyph ( source , circle ) <EOL> plot . add_layout ( LinearAxis ( ) , '<STR_LIT>' ) <EOL> plot . add_layout ( LinearAxis ( ) , '<STR_LIT:left>' ) <EOL> tap = TapTool ( renderers = [ circle_renderer ] , callback = Popup ( message = "<STR_LIT>" ) ) <EOL> plot . add_tools ( PanTool ( ) , WheelZoomTool ( ) , tap ) <EOL> doc = Document ( ) <EOL> doc . add_root ( MyHBox ( children = [ plot ] ) ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> filename = "<STR_LIT>" <EOL> with open ( filename , "<STR_LIT:w>" ) as f : <EOL> f . write ( file_html ( doc , INLINE , "<STR_LIT>" ) ) <EOL> print ( "<STR_LIT>" % filename ) <EOL> view ( filename ) </s>
