<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. However, your code appears to only toggle '</span><span style="font-size: 12pt; ">SelectionPointLabelVisibility' on/off. 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. I can do this easily interactively, but the python trace appears not to record all of the clicks. 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 <sebastien.jourdain@kitware.com><br> <b><span style="font-weight: bold;">To:</span></b> Jane Hickmott <jane.hickmott@yahoo.com> <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> if($(this).toggleClass("showLabel").hasClass("showLabel")) {<br> representation.setSelectionPointLabelVisibility(1);<br> } else {<br> representation.setSelectionPointLabelVisibility(0);<br> }<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 <<a ymailto="mailto:jane.hickmott@yahoo.com" href="mailto:jane.hickmott@yahoo.com">jane.hickmott@yahoo.com</a>> wrote:<br>> Thank you, Seb. Much appreciated. Sorry I'm a novice in Javascript. Here<br>>
is a python trace of what I would like to accomplish - can anyone please<br>> show me how to convert this to javascript? Many thanks.<br>> As an aside is there no way to call an external python module from within<br>> javascript? That would solve everything.<br>><br>> Jane.<br>><br>> try: paraview.simple<br>> except: from paraview.simple import *<br>> paraview.simple._DisableFirstRenderCameraReset()<br>><br>> Fluid_f2 = FindSource("Fluid_f2.vtk")<br>> DataRepresentation1 = GetDisplayProperties(Fluid_f2)<br>> RenderView1 = GetRenderView()<br>> DataRepresentation1.SelectionPointLabelVisibility = 1<br>><br>> RenderView1.InteractionMode = 'Selection'<br>><br>> RenderView1.CameraClippingRange = [19767.705902611211, 38094.489486240847]<br>> RenderView1.InteractionMode = '3D'<br>><br>> Render()<br>><br>> ________________________________<br>> From: Sebastien Jourdain <<a
ymailto="mailto:sebastien.jourdain@kitware.com" href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>><br>> To: Jane Hickmott <<a ymailto="mailto:jane.hickmott@yahoo.com" href="mailto:jane.hickmott@yahoo.com">jane.hickmott@yahoo.com</a>><br>> Cc: "<a ymailto="mailto:paraview@paraview.org" href="mailto:paraview@paraview.org">paraview@paraview.org</a>" <<a ymailto="mailto:paraview@paraview.org" href="mailto:paraview@paraview.org">paraview@paraview.org</a>><br>> Sent: Saturday, 7 April 2012, 19:29<br>> Subject: Re: [Paraview] Paraviewweb<br>><br>> Hi Jane,<br>><br>> The best thing to do to figure out what is needed in your use case, is<br>> to load your state inside ParaView and do the action that you want to<br>> achieve while the Python trace is recording your changes.<br>><br>> Once you get the trace of your actions you can either convert that<br>> code to JavaScript or
write a plugin that execute somehow the same<br>> action in Python as we are using python to write ParaViewWeb plugins.<br>><br>> The access of the trace mechanism is inside the Tools menu of ParaView.<br>><br>> If you need some help to figure out the conversion between Python and<br>> JS, just post the trace on the mailing list.<br>><br>> I'm glad you managed to produce your own first Web application using<br>> ParaViewWeb.<br>><br>> Seb<br>><br>> On Sat, Apr 7, 2012 at 6:44 AM, Jane Hickmott <<a ymailto="mailto:jane.hickmott@yahoo.com" href="mailto:jane.hickmott@yahoo.com">jane.hickmott@yahoo.com</a>><br>> wrote:<br>>> Hi Paraview community!<br>>> I am trying to develop a paraviewweb application that involves loading of<br>>> a<br>>> state file plus the creation of a 'button' to allow data labels to appear<br>>> on<br>>> the plot. I can load the state file but
have no idea how to create the<br>>> necessary button and functionality. I would be grateful to anyone kind<br>>> enough to give me a few pointers. Thank you.<br>>><br>>> Jane<br>>><br>>> _______________________________________________<br>>> Powered by www.kitware.com<br>>><br>>> Visit other Kitware open-source projects at<br>>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>>><br>>> Please keep messages on-topic and check the ParaView Wiki at:<br>>> <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>>><br>>> Follow this link to subscribe/unsubscribe:<br>>> <a href="http://www.paraview.org/mailman/listinfo/paraview"
target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>>><br>><br>><br><br><br> </div> </div> </div></body></html>