So in pqChartRepresentation::setDefaultPropertyValues() we have a pointer to the vtkSMRepresentationProxy. This object will have a proxy property named "Input" which leads to a vtkSMSourceProxy pointer. This will be the source proxy for the vtk filter that is producing the table data. Maybe we could add a convention- if the source proxy has an information property named something like "XAxisHint", then we'll use that to determine the default x axis. I'm not sure what to do with the "Time" and "arc_length" hard coded values, maybe those would stay as-is.<br>
<br>Pat<br><br><div class="gmail_quote">On Mon, Nov 29, 2010 at 6:31 PM, pat marion <span dir="ltr"><<a href="mailto:pat.marion@kitware.com">pat.marion@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Take a look at pqChartRepresentation::setDefaultPropertyValues(). See where the x_array variable is assigned, and then the magic happens here:<br><br> if (!x_array.isEmpty())<br> {<br> vtkSMPropertyHelper(proxy, "XArrayName").Set(x_array.toAscii().data());<br>
vtkSMPropertyHelper(proxy, "UseIndexForXAxis").Set(0);<br> }<br><br>and then a little more magic a few lines later:<br><br> else if (!x_array.isNull() && (array == x_array))<br> {<br>
// No point in plotting the series used as the x-array.<br>
helper.SetStatus(array.toAscii().data(), 0);<br> }<br><br><br>I totally agree with you that it would be nice if there was a way to make this choice happen by default under the right conditions.<br><font color="#888888"><br>
Pat</font><div><div></div><div class="h5"><br>
<br><div class="gmail_quote">On Mon, Nov 29, 2010 at 5:24 PM, Michael Jackson <span dir="ltr"><<a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Yes, I can see the data in ParaView after I mess around digging in the "Display" tab, clicking some checkbox, taking guess about what needs to be enabled/disabled..<br>
I was hoping my use-case would fall into the "Default" use case where the first column represented the x-axis and subsequent columns were y-axis values but I guess not this time. Yes, I agree that it does only take a few clicks here and there but you first have to know _what_ to click which is where the user experience is falling apart for me. I have to teach a bunch of users to click here and there in order to show their data.<br>
Along those lines maybe I am not really understanding how a "Line Chart" works. Maybe what I am really after is an "XY Scatter Plot" of my data?<br>
What would help me out would be what source file is the default value of using the cell indices as the x-axis set? for my builds which I distribute to my users maybe I can just set this to the other value "Use Data Array" instead?<div>
<br>
<br>
Thanks<br>
___________________________________________________________<br>
Mike Jackson <a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a><br>
Principal Software Engineer <a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a><br>
BlueQuartz Software Dayton, Ohio<br>
<br>
<br>
<br></div><div><div></div><div>
On Nov 29, 2010, at 5:15 PM, pat marion wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
That's correct, the data objects at the vtk level cannot influence how the chart will be displayed. It all happens in the gui & servermanager level, at the proxy level. Are you at least able to see your data in the XY Line Chart? It only takes two clicks in the Display tab to assign the X axis.<br>
<br>
It would be convenient if there was some way for the data object to provide a hint to gui. Maybe we could make a rule that if an array name ends with "xaxis_hint" or something, that could clue the gui to use it automatically.<br>
<br>
Pat<br>
<br>
On Mon, Nov 29, 2010 at 4:47 PM, Michael Jackson <<a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a>> wrote:<br>
Thanks for more info.<br>
<br>
I do in fact have "Time" for one of my plots so that is easy to achieve. I just had to correctly set the name of the column from "Time Values" to "Time" and that should work. The other plots probably are more difficult at this point. I have Stress/Strain data where I need the Stress on the x-axis and strain on the y-axis. I do not think I am understanding how to set some value on the vtkTable class that when finally passed over to the GUI layer will set the some arbitrary column as the x-axis. I thought the proxy stuff was all done on the GUI side of things? I guess I need just a bit more hand holding.<br>
<br>
___________________________________________________________<br>
Mike Jackson <a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a><br>
Principal Software Engineer <a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a><br>
BlueQuartz Software Dayton, Ohio<br>
<br>
<br>
<br>
On Nov 29, 2010, at 4:31 PM, Marcus D. Hanwell wrote:<br>
<br>
Sorry, yes, I was in VTK world. There are a few column names with<br>
special meanings to ParaView that are hard coded in the proxy. You can<br>
get at the chart object if you wish to manipulate it directly, but you<br>
should be able to achieve everything you need to through the proxies.<br>
<br>
Marcus<br>
<br>
On Mon, Nov 29, 2010 at 4:28 PM, pat marion <<a href="mailto:pat.marion@kitware.com" target="_blank">pat.marion@kitware.com</a>> wrote:<br>
I think by default it will plot a line for each column in the table. It<br>
will use the cell value as the Y value, and the row index as the X value.<br>
To change the behavior, you have to change two representation properties:<br>
<br>
<br>
rep.UseIndexForXAxis = 0<br>
<br>
rep.XArrayName = 'foo'<br>
<br>
This will plot all all the columns, except use the "foo" column as the X<br>
values. That means the line for the "foo" column is still displayed, and it<br>
will be a diagonal line.<br>
<br>
I just looked, and Paraview has one cheat hard coded- if there is a column<br>
named "Time" or "arc_length" then it will be used automatically for the X<br>
axis.<br>
<br>
Pat<br>
<br>
On Mon, Nov 29, 2010 at 4:11 PM, Michael Jackson<br>
<<a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a>> wrote:<br>
<br>
Thanks for the idea. I was trying to figure out the flow from reading the<br>
data into displaying the data hoping to reveal some sort of default or<br>
something. I was going to generate some fake CSV data and see how that<br>
reader does things hoping the CSV reader takes the first column as the<br>
x-axis.<br>
___________________________________________________________<br>
Mike Jackson <a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a><br>
Principal Software Engineer <a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a><br>
BlueQuartz Software Dayton, Ohio<br>
<br>
<br>
<br>
On Nov 29, 2010, at 4:08 PM, pat marion wrote:<br>
<br>
Hi Mike,<br>
<br>
I'm not up to speed with the current chart api so I can't answer your<br>
question... but maybe you could try doing it in the gui with python trace<br>
enabled, then translate the generated python code into c++ for your plugin?<br>
Customizing the chart should be a matter of setting properties on the<br>
representation and view, the data object itself doesn't have much say.<br>
<br>
Pat<br>
<br>
On Mon, Nov 29, 2010 at 1:41 PM, Michael Jackson<br>
<<a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a>> wrote:<br>
I have some XY data that I would like to plot in ParaView. I currently<br>
have a plugin that reads the data from our HDF5 file and into vtkTable<br>
objects. Along the lines of a "Line Chart 101" question how do I<br>
programmatically set the x-axis and y-axis columns?<br>
<br>
Thanks<br>
___________________________________________________________<br>
Mike Jackson <a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a><br>
Principal Software Engineer <a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a><br>
BlueQuartz Software Dayton, Ohio<br>
<br>
<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><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>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><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>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><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>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <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: <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>
</blockquote>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <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: <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>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>