<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Hi Utkarsh,</span></div><div><span>Seb has indicated that you may be able to help with an issue of trying to create an interactive selection with labels (see below). &nbsp;I'm totally stuck. &nbsp;Any help will be much appreciated.</span></div><div><span>Thanks.</span></div><div><span>Jane&nbsp;</span></div><div><br></div>  <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <div dir="ltr"> <font size="2" face="Arial"> ----- Forwarded Message -----<br>  <b><span style="font-weight:bold;">From:</span></b> Sebastien Jourdain &lt;sebastien.jourdain@kitware.com&gt;<br> <b><span style="font-weight: bold;">To:</span></b> Jane Hickmott &lt;jane.hickmott@yahoo.com&gt; <br><b><span style="font-weight:
 bold;">Cc:</span></b> "paraview@paraview.org" &lt;paraview@paraview.org&gt;; Utkarsh Ayachit &lt;utkarsh.ayachit@kitware.com&gt; <br> <b><span style="font-weight: bold;">Sent:</span></b> Sunday, 8 April 2012, 19:15<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Paraview] Paraviewweb<br> </font> </div> <br>Ok, I miss understood your goal.<br><br>Then, the missing part should be something like that.<br><br>var view = paraview.GetRenderView(); // this is optional if you<br>already have a reference to the view...<br>view.setInteractionMode(2);<br><br>Although, I've quickly tried it online with firebug and I did not<br>manage to see the selection. I'm wondering if we are both missing<br>something here... Like the creation of a selection proxy that is<br>created to get the selected screen area and convert it to a set of<br>cellId...<br><br>Utkarsh might have a better insight on that selection part.<br><br>Seb<br><br>PS: Here is the mapping
 based on the string values<br><br>file: ParaView-SRC/ParaViewCore/ServerImplementation/Resources/views_and_representations.xml<br><br>&lt;IntVectorProperty name="InteractionMode"<br>&nbsp; &nbsp; &nbsp;  command="SetInteractionMode"<br>&nbsp; &nbsp; &nbsp;  number_of_elements="1"<br>&nbsp; &nbsp; &nbsp;  default_values="0"&gt;<br>&nbsp; &nbsp; &nbsp;  &lt;EnumerationDomain name="enum"&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp;  &lt;Entry text="3D" value="0" /&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp;  &lt;Entry text="2D" value="1" /&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp;  &lt;Entry text="Selection" value="2" /&gt;<br>&nbsp; &nbsp; &nbsp;  &lt;/EnumerationDomain&gt;<br>&nbsp; &nbsp;  &lt;/IntVectorProperty&gt;<br><br>On Sun, Apr 8, 2012 at 12:43 PM, Jane Hickmott &lt;<a ymailto="mailto:jane.hickmott@yahoo.com" href="mailto:jane.hickmott@yahoo.com">jane.hickmott@yahoo.com</a>&gt; wrote:<br>&gt; Hi Seb,<br>&gt; Thank you for your help. &nbsp;However, your code appears to
 only toggle<br>&gt; 'SelectionPointLabelVisibility' on/off. &nbsp;What I really need is the<br>&gt; equivalent of 'select points on' button as on the GUI that will enable me to<br>&gt; interactively select an area on the plot to display labels on. &nbsp;I can do<br>&gt; this easily interactively, but the python trace appears not to record all of<br>&gt; the clicks. &nbsp;There is something I'm missing...<br>&gt;<br>&gt; Frustrated... :(<br>&gt;<br>&gt; Jane.<br>&gt;<br>&gt; ________________________________<br>&gt; From: Sebastien Jourdain &lt;<a ymailto="mailto:sebastien.jourdain@kitware.com" href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>&gt;<br>&gt; To: Jane Hickmott &lt;<a ymailto="mailto:jane.hickmott@yahoo.com" href="mailto:jane.hickmott@yahoo.com">jane.hickmott@yahoo.com</a>&gt;<br>&gt; Cc: <a ymailto="mailto:paraview@paraview.org" href="mailto:paraview@paraview.org">paraview@paraview.org</a><br>&gt; Sent: Sunday, 8
 April 2012, 14:44<br>&gt; Subject: Re: [Paraview] Paraviewweb<br>&gt;<br>&gt; Hi Jane,<br>&gt;<br>&gt; keep the prarview mailing list in the loop so anyone could contribute and<br>&gt; learn.<br>&gt;<br>&gt; In your case that will be pretty simple.<br>&gt; If you use jQuery as JavaScript library that could look like that:<br>&gt;<br>&gt; var sourceProxy = paraview.FindSource({name:"Fluid_f2.vtk"});<br>&gt; var representation = paraview.GetDisplayProperties({proxy: sourceProxy});<br>&gt; $('.my-button-class').click(function() {<br>&gt; &nbsp; if($(this).toggleClass("showLabel").hasClass("showLabel")) {<br>&gt; &nbsp; &nbsp; representation.setSelectionPointLabelVisibility(1);<br>&gt; &nbsp; } else {<br>&gt; &nbsp; &nbsp; representation.setSelectionPointLabelVisibility(0);<br>&gt; &nbsp; }<br>&gt; });<br>&gt;<br>&gt; Or you can create a python script on the server side that can be<br>&gt; called from the JavaScript.<br>&gt; For more details on that you can
 read the plugin documentation of<br>&gt; ParaViewWeb here.<br>&gt;<br>&gt; <a href="http://www.paraview.org/Wiki/ParaViewWeb_Plugins" target="_blank">http://www.paraview.org/Wiki/ParaViewWeb_Plugins</a><br>&gt;<br>&gt; Seb<br>&gt;<br>&gt; On Sun, Apr 8, 2012 at 4:10 AM, Jane Hickmott &lt;<a ymailto="mailto:jane.hickmott@yahoo.com" href="mailto:jane.hickmott@yahoo.com">jane.hickmott@yahoo.com</a>&gt;<br>&gt; wrote:<br>&gt;&gt; Thank you, Seb. &nbsp;Much appreciated. &nbsp;Sorry I'm a novice in Javascript.<br>&gt;&gt; &nbsp;Here<br>&gt;&gt; is a python trace of what I would like to accomplish - can anyone please<br>&gt;&gt; show me how to convert this to javascript? &nbsp;Many thanks.<br>&gt;&gt; As an aside is there no way to call an external python module from within<br>&gt;&gt; javascript? &nbsp;That would solve everything.<br>&gt;&gt;<br>&gt;&gt; Jane.<br>&gt;&gt;<br>&gt;&gt; try: paraview.simple<br>&gt;&gt; except: from paraview.simple import
 *<br>&gt;&gt; paraview.simple._DisableFirstRenderCameraReset()<br>&gt;&gt;<br>&gt;&gt; Fluid_f2 = FindSource("Fluid_f2.vtk")<br>&gt;&gt; DataRepresentation1 = GetDisplayProperties(Fluid_f2)<br>&gt;&gt; RenderView1 = GetRenderView()<br>&gt;&gt; DataRepresentation1.SelectionPointLabelVisibility = 1<br>&gt;&gt;<br>&gt;&gt; RenderView1.InteractionMode = 'Selection'<br>&gt;&gt;<br>&gt;&gt; RenderView1.CameraClippingRange = [19767.705902611211, 38094.489486240847]<br>&gt;&gt; RenderView1.InteractionMode = '3D'<br>&gt;&gt;<br>&gt;&gt; Render()<br>&gt;&gt;<br>&gt;&gt; ________________________________<br>&gt;&gt; From: Sebastien Jourdain &lt;<a ymailto="mailto:sebastien.jourdain@kitware.com" href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>&gt;<br>&gt;&gt; To: Jane Hickmott &lt;<a ymailto="mailto:jane.hickmott@yahoo.com" href="mailto:jane.hickmott@yahoo.com">jane.hickmott@yahoo.com</a>&gt;<br>&gt;&gt; Cc: "<a
 ymailto="mailto:paraview@paraview.org" href="mailto:paraview@paraview.org">paraview@paraview.org</a>" &lt;<a ymailto="mailto:paraview@paraview.org" href="mailto:paraview@paraview.org">paraview@paraview.org</a>&gt;<br>&gt;&gt; Sent: Saturday, 7 April 2012, 19:29<br>&gt;&gt; Subject: Re: [Paraview] Paraviewweb<br>&gt;&gt;<br>&gt;&gt; Hi Jane,<br>&gt;&gt;<br>&gt;&gt; The best thing to do to figure out what is needed in your use case, is<br>&gt;&gt; to load your state inside ParaView and do the action that you want to<br>&gt;&gt; achieve while the Python trace is recording your changes.<br>&gt;&gt;<br>&gt;&gt; Once you get the trace of your actions you can either convert that<br>&gt;&gt; code to JavaScript or write a plugin that execute somehow the same<br>&gt;&gt; action in Python as we are using python to write ParaViewWeb plugins.<br>&gt;&gt;<br>&gt;&gt; The access of the trace mechanism is inside the Tools menu of ParaView.<br>&gt;&gt;<br>&gt;&gt; If
 you need some help to figure out the conversion between Python and<br>&gt;&gt; JS, just post the trace on the mailing list.<br>&gt;&gt;<br>&gt;&gt; I'm glad you managed to produce your own first Web application using<br>&gt;&gt; ParaViewWeb.<br>&gt;&gt;<br>&gt;&gt; Seb<br>&gt;&gt;<br>&gt;&gt; On Sat, Apr 7, 2012 at 6:44 AM, Jane Hickmott &lt;<a ymailto="mailto:jane.hickmott@yahoo.com" href="mailto:jane.hickmott@yahoo.com">jane.hickmott@yahoo.com</a>&gt;<br>&gt;&gt; wrote:<br>&gt;&gt;&gt; Hi Paraview community!<br>&gt;&gt;&gt; I am trying to develop a paraviewweb application that involves loading of<br>&gt;&gt;&gt; a<br>&gt;&gt;&gt; state file plus the creation of a 'button' to allow data labels to appear<br>&gt;&gt;&gt; on<br>&gt;&gt;&gt; the plot. &nbsp;I can load the state file but have no idea how to create the<br>&gt;&gt;&gt; necessary button and functionality. &nbsp;I would be&nbsp;grateful&nbsp;to anyone kind<br>&gt;&gt;&gt; enough to give me a
 few pointers. &nbsp;Thank you.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Jane<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; _______________________________________________<br>&gt;&gt;&gt; Powered by www.kitware.com<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Visit other Kitware open-source projects at<br>&gt;&gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Please keep messages on-topic and check the ParaView Wiki at:<br>&gt;&gt;&gt; <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Follow this link to subscribe/unsubscribe:<br>&gt;&gt;&gt; <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>&gt;&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt;<br>&gt;<br><br><br> </div> </div>  </div></body></html>