| 48 | |
| 49 | |
| 50 | def test_explorer_plot_code(): |
| 51 | explorer = hvplot.explorer(df) |
| 52 | |
| 53 | explorer.param.update( |
| 54 | kind='scatter', |
| 55 | x='bill_length_mm', |
| 56 | y_multi=['bill_depth_mm'], |
| 57 | by=['species'], |
| 58 | ) |
| 59 | |
| 60 | hvplot_code = explorer.plot_code() |
| 61 | |
| 62 | assert hvplot_code == ( |
| 63 | 'df.hvplot(\n' |
| 64 | " by=['species'],\n" |
| 65 | " kind='scatter',\n" |
| 66 | " x='bill_length_mm',\n" |
| 67 | " y=['bill_depth_mm'],\n" |
| 68 | " legend='bottom_right',\n" |
| 69 | " widget_location='bottom',\n" |
| 70 | ')' |
| 71 | ) |
| 72 | |
| 73 | hvplot_code = explorer.plot_code(var_name='othername') |
| 74 | |
| 75 | assert hvplot_code == ( |
| 76 | 'othername.hvplot(\n' |
| 77 | " by=['species'],\n" |
| 78 | " kind='scatter',\n" |
| 79 | " x='bill_length_mm',\n" |
| 80 | " y=['bill_depth_mm'],\n" |
| 81 | " legend='bottom_right',\n" |
| 82 | " widget_location='bottom',\n" |
| 83 | ')' |
| 84 | ) |
| 85 | |
| 86 | |
| 87 | def test_explorer_hvplot(): |