Exemplo n.º 1
0
 def test_define_customize_method(self):
     hvplot = hvPlotTabular(self.df, {'scatter': {'width': 42, 'height': 42}})
     custom_scatter = hvplot.scatter(y='y')
     curve = hvplot.line(y='y')
     custom_opts = Store.lookup_options('bokeh', custom_scatter, 'plot')
     opts = Store.lookup_options('bokeh', curve, 'plot')
     self.assertEqual(custom_opts.options.get('width'), 42)
     self.assertEqual(custom_opts.options.get('height'), 42)
     self.assertNotEqual(opts.options.get('width'), 42)
     self.assertNotEqual(opts.options.get('height'), 42)
Exemplo n.º 2
0
 def test_attempt_to_override_kind_on_method(self):
     hvplot = hvPlotTabular(self.df, {'scatter': {'kind': 'line'}})
     self.assertIsInstance(hvplot.scatter(y='y'), Scatter)
Exemplo n.º 3
0
 def test_define_default_options(self):
     hvplot = hvPlotTabular(self.df, width=42, height=42)
     curve = hvplot(y='y')
     opts = Store.lookup_options('bokeh', curve, 'plot')
     self.assertEqual(opts.options.get('width'), 42)
     self.assertEqual(opts.options.get('height'), 42)
Exemplo n.º 4
0
 def test_pandas_query_metadata(self):
     hvplot = hvPlotTabular(self.df, query='x>2')
     assert len(hvplot._data) == 2