diff --git a/fluents/navigator.py b/fluents/navigator.py index 4b37c81..9c980a4 100644 --- a/fluents/navigator.py +++ b/fluents/navigator.py @@ -240,6 +240,11 @@ class NavigatorMenu(gtk.Menu): self.plot_menu.append(self.plot_scatter_item) self.plot_scatter_item.show() + self.plot_line_item = gtk.MenuItem('Line view') + self.plot_line_item.connect('activate', self.on_plot_line, navigator) + self.plot_menu.append(self.plot_line_item) + self.plot_line_item.show() + self.plot_item = gtk.MenuItem('Plot') self.append(self.plot_item) self.plot_item.set_submenu(self.plot_menu) @@ -334,6 +339,17 @@ class NavigatorMenu(gtk.Menu): plot.set_selection_listener(project.set_selection) project._selection_observers.append(plot) + def on_plot_line(self, item, navigator): + project = main.project + ds = self.dataset + dims = ds.get_dim_name() + ids = ds.get_identifiers(dims[1]) + plot = plots.LineViewPlot(ds, name='Line (%s)' % ds.get_name()) + icon = fluents.icon_factory.get("line_plot") + project.data_tree_insert(self.tree_iter, 'Line view', plot, None, "black", icon) + plot.set_selection_listener(project.set_selection) + project._selection_observers.append(plot) + def on_transpose(self, item, navigator): project = main.project ds = self.dataset.transpose() diff --git a/fluents/plots.py b/fluents/plots.py index f61e16c..426fc1c 100644 --- a/fluents/plots.py +++ b/fluents/plots.py @@ -1135,6 +1135,20 @@ class PlotThresholder: self.set_threshold(min, max) +#class PlotContextMenu(gtk.Menu): +# def __init__(self, plot): +# gtk.Menu(self) +# self._plot = plot +# +# # Populate main menu +## self.color_item = gtk.MenuItem('Color') +# self.append(self.color_item) +# self.color_item.set_submenu(self.build_dataset_menu()): +# +# def build_dataset_menu(self): +# return gtk.Menu() + + # Create zoom-changed signal gobject.signal_new('zoom-changed', Plot, gobject.SIGNAL_RUN_LAST, None, (gobject.TYPE_PYOBJECT,))