<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Hi Seb,</span></div><div><span>Thank you for your help. &nbsp;However, your code appears to only toggle '</span><span style="font-size: 12pt; ">SelectionPointLabelVisibility' on/off. &nbsp;What I really need is the equivalent of 'select points on' button as on the GUI that will enable me to interactively select an area on the plot to display labels on. &nbsp;I can do this easily interactively, but the python trace appears not to record all of the clicks. &nbsp;There is something I'm missing...</span></div><div><span style="font-size: 12pt; "><br></span></div><div><span style="font-size: 12pt; ">Frustrated... :(</span></div><div><span style="font-size: 12pt; "><br></span></div><div><span style="font-size: 12pt; ">Jane.</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"> <hr size="1">  <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 <br> <b><span style="font-weight: bold;">Sent:</span></b> Sunday, 8 April 2012, 14:44<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Paraview] Paraviewweb<br> </font> </div> <br>Hi Jane,<br><br>keep the prarview mailing list in the loop so anyone could contribute and learn.<br><br>In your case that will be pretty simple.<br>If you use jQuery as JavaScript library that could look like that:<br><br>var sourceProxy = paraview.FindSource({name:"Fluid_f2.vtk"});<br>var representation =
 paraview.GetDisplayProperties({proxy: sourceProxy});<br>$('.my-button-class').click(function() {<br>&nbsp; if($(this).toggleClass("showLabel").hasClass("showLabel")) {<br>&nbsp; &nbsp; representation.setSelectionPointLabelVisibility(1);<br>&nbsp; } else {<br>&nbsp; &nbsp; representation.setSelectionPointLabelVisibility(0);<br>&nbsp; }<br>});<br><br>Or you can create a python script on the server side that can be<br>called from the JavaScript.<br>For more details on that you can read the plugin documentation of<br>ParaViewWeb here.<br><br><a href="http://www.paraview.org/Wiki/ParaViewWeb_Plugins" target="_blank">http://www.paraview.org/Wiki/ParaViewWeb_Plugins</a><br><br>Seb<br><br>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; wrote:<br>&gt; Thank you, Seb. &nbsp;Much appreciated. &nbsp;Sorry I'm a novice in Javascript. &nbsp;Here<br>&gt;
 is a python trace of what I would like to accomplish - can anyone please<br>&gt; show me how to convert this to javascript? &nbsp;Many thanks.<br>&gt; As an aside is there no way to call an external python module from within<br>&gt; javascript? &nbsp;That would solve everything.<br>&gt;<br>&gt; Jane.<br>&gt;<br>&gt; try: paraview.simple<br>&gt; except: from paraview.simple import *<br>&gt; paraview.simple._DisableFirstRenderCameraReset()<br>&gt;<br>&gt; Fluid_f2 = FindSource("Fluid_f2.vtk")<br>&gt; DataRepresentation1 = GetDisplayProperties(Fluid_f2)<br>&gt; RenderView1 = GetRenderView()<br>&gt; DataRepresentation1.SelectionPointLabelVisibility = 1<br>&gt;<br>&gt; RenderView1.InteractionMode = 'Selection'<br>&gt;<br>&gt; RenderView1.CameraClippingRange = [19767.705902611211, 38094.489486240847]<br>&gt; RenderView1.InteractionMode = '3D'<br>&gt;<br>&gt; Render()<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>" &lt;<a ymailto="mailto:paraview@paraview.org" href="mailto:paraview@paraview.org">paraview@paraview.org</a>&gt;<br>&gt; Sent: Saturday, 7 April 2012, 19:29<br>&gt; Subject: Re: [Paraview] Paraviewweb<br>&gt;<br>&gt; Hi Jane,<br>&gt;<br>&gt; The best thing to do to figure out what is needed in your use case, is<br>&gt; to load your state inside ParaView and do the action that you want to<br>&gt; achieve while the Python trace is recording your changes.<br>&gt;<br>&gt; Once you get the trace of your actions you can either convert that<br>&gt; code to JavaScript or
 write a plugin that execute somehow the same<br>&gt; action in Python as we are using python to write ParaViewWeb plugins.<br>&gt;<br>&gt; The access of the trace mechanism is inside the Tools menu of ParaView.<br>&gt;<br>&gt; If you need some help to figure out the conversion between Python and<br>&gt; JS, just post the trace on the mailing list.<br>&gt;<br>&gt; I'm glad you managed to produce your own first Web application using<br>&gt; ParaViewWeb.<br>&gt;<br>&gt; Seb<br>&gt;<br>&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; wrote:<br>&gt;&gt; Hi Paraview community!<br>&gt;&gt; I am trying to develop a paraviewweb application that involves loading of<br>&gt;&gt; a<br>&gt;&gt; state file plus the creation of a 'button' to allow data labels to appear<br>&gt;&gt; on<br>&gt;&gt; the plot. &nbsp;I can load the state file but
 have no idea how to create the<br>&gt;&gt; necessary button and functionality. &nbsp;I would be&nbsp;grateful&nbsp;to anyone kind<br>&gt;&gt; enough to give me a few pointers. &nbsp;Thank you.<br>&gt;&gt;<br>&gt;&gt; Jane<br>&gt;&gt;<br>&gt;&gt; _______________________________________________<br>&gt;&gt; Powered by www.kitware.com<br>&gt;&gt;<br>&gt;&gt; Visit other Kitware open-source projects at<br>&gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>&gt;&gt;<br>&gt;&gt; Please keep messages on-topic and check the ParaView Wiki at:<br>&gt;&gt; <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>&gt;&gt;<br>&gt;&gt; Follow this link to subscribe/unsubscribe:<br>&gt;&gt; <a href="http://www.paraview.org/mailman/listinfo/paraview"
 target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>&gt;&gt;<br>&gt;<br>&gt;<br><br><br> </div> </div>  </div></body></html>