Double click action on a plot

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Double click action on a plot

Jordan Ilott
Can anybody tell me how to capture a double click action on a DataView? I have a grid of small plots and I'd like to be able to double click on one and have a new window appear with a larger version.

Thanks

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Double click action on a plot

Jordan Ilott-2
I thought I would follow this up with a minimal example. I've attached an archive of 3 files, they contain the code and a data file. I have based the data model(data_frame_model.py) on the PandasPlotData code that Peter Wang created. The application displays the iris data as a scatter plot matrix. Lasso-selection allows brushing of points in a given plot panel. The data model takes care of propagating the brushed selection to all of the other data sources.

The view is a grid container of DataView instances. I would like to be able to double click on any of the DataView instances and open a new window to display the double-clicked DataView. By using the same instance of the DataView object, I believe any brushing or other interaction with the plot will be propagated to the plot grid through the data model.

Hopefully this sample code an improved description of my goal will make it easier for someone to offer some advice. Thanks a lot.

Jordan

On Tue, Feb 26, 2013 at 9:04 PM, Jordan Ilott <[hidden email]> wrote:
Can anybody tell me how to capture a double click action on a DataView? I have a grid of small plots and I'd like to be able to double click on one and have a new window appear with a larger version.

Thanks


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

irisScatterExample.zip (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Double click action on a plot

Peter Wang-2
Hey Jordan,

What an interesting example!  I'm attaching a modified version of the viewBasedSPLOM.py file, with modifications to do the popping-out feature.  I also fixed the pan and zoom, by attaching the tools to the renderer itself and not the DataView.  Also, I fixed a subtle bug in the ScatterPlot() constructor call - instead of storing the old mappers, you should create a new LinearMapper for each plot.

So now the interactions are:
- left drag to select region
- left doubleclick to open new plot window
- right drag to pan
- shift + right drag to create zoom box
- mousewheel up and down to zoom in and out


-Peter


On Wed, Feb 27, 2013 at 8:32 AM, Jordan Ilott <[hidden email]> wrote:
I thought I would follow this up with a minimal example. I've attached an archive of 3 files, they contain the code and a data file. I have based the data model(data_frame_model.py) on the PandasPlotData code that Peter Wang created. The application displays the iris data as a scatter plot matrix. Lasso-selection allows brushing of points in a given plot panel. The data model takes care of propagating the brushed selection to all of the other data sources.

The view is a grid container of DataView instances. I would like to be able to double click on any of the DataView instances and open a new window to display the double-clicked DataView. By using the same instance of the DataView object, I believe any brushing or other interaction with the plot will be propagated to the plot grid through the data model.

Hopefully this sample code an improved description of my goal will make it easier for someone to offer some advice. Thanks a lot.

Jordan


On Tue, Feb 26, 2013 at 9:04 PM, Jordan Ilott <[hidden email]> wrote:
Can anybody tell me how to capture a double click action on a DataView? I have a grid of small plots and I'd like to be able to double click on one and have a new window appear with a larger version.

Thanks


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

viewBasedSPLOM.py (10K) Download Attachment