Sunday 31 July 2011

GSoC 2011: Week 10

I made a lot of changes to the edit feature this week. Main objective was to avoid replot of charts on edit and to replot only the points which gets changed. Progess this week:
  • Optimizations to edit feature.
  • Edit support when using strings as fields (only replot of chart , query generation remains the same)
  • Minor changes like validations, some bugs.
Also I was working on using ajax to get a selected point's data row, rather than posting the whole data on submission of input criteria. The edit feature also changes accordingly along with some events, so its getting a little complicated. This was in my to-do list of 10th week but it stalled. I'll try to finish it in this week and continue on to work on more optimizations.

Sunday 24 July 2011

GSoC 2011: Week 9

This week I worked on two major issues:
  • Changing the display of the data point content  from a form based interface to a dialog based display.
  • Providing support for plotting of other data-types like strings.
Using the jQuery-UI plugin the first issue was rather straight forward. On point click/select just open a dialog which will contain the HTML of the dataDisplay form. This helped in cleaning up the interface. It adjusts well to different resolutions which the previous work did not.

The second issue was a little complex. Direct plotting of strings is not well supported in Highcharts, it is usually through 'categories' option of xAxis/yAxis. The data points are plotted corresponding to each of category values in this case. In our case, a field may have duplicates so in categories, the labels are repeated on the axes. So instead of using categories I assigned each distinct string (for a field) an integer value (eg. 1,2,3...), mapped the corresponding string values to integer values and formatted the labels to show the string values instead of the integer map. This helped to solve the following issues:
  • Duplicate labels in the axes are removed (as opposed to categories)
  • Can now plot them as simple integer values
  • In addition to above sorting the array containing the distinct values (inbuilt sort for now) solves the issue where we have a large number of labels and their text get mixed up. What happens now is like integer labels some divisions are created on the axes and when we zoom in the divisions get smaller and labels within that division are show. 
For the next week, compatibility issues still need to be fixed for different browsers. Also, the update feature needs to be modified to support the replotting of strings.

Monday 18 July 2011

GSoC 2011: Week 8

This week's work was to fix bugs and test the interface. Some pending issues were fixed like:
  • The display field of a table is the defualt selected value for DataLabel and if not selected it defaults to the display field also.
  • The edit functionality was malfunctioning, there were issues with null values on fileds. The Datapoint display form now includes a null checkbox to indicate null value. 
  I ran some tests on the interface to check response timings and also asked some users to try and give suggestions. Some of the things that came up were:
  • The input phase, when we select the two fields; on selection of a field the data-type,operators and value field change and it takes some time. I was suggested to improve upon the response time there.
  • The plot generation process also slow according to some users. If we are accessing the database locally (on the same system) it is relatively fine but when accessed on a remote server, it slows down. 
  • Depending on the resolution, the plot and the Data point display form can appear adjacent to each other or one below the other (the plot up and the form below it)
  • One of the user reported that his chrome browser crashed once on the plot generation phase.
  • Some users suggested that the divs are not alligned properly. For example, for a higher resolution when the plot and form appear adjacent to each other, the plot div is slightly higher than the form div. So it did not look good.
  • Some users were more interested in have the plot of text fields( fields that are strings and not only numeric), which is not currently available in the interface.
So looking at the response I got from these tests, I have to focus on response timings more and include the plot functions of strings next. Also, the positioning of the Data-point form and plot is a problem. It could well be fixed as Marc suggested, by having a dialogue box type form which appears at the center of the screen when we click a point and disappears after we edit/view and not always have it on the screen.  The input phase can be improved by passing the entire table information(field type, collation, operators and value field) as json and using jQuery to update it onChange.

Sunday 10 July 2011

GSoC 2011: Week 7

I spent this week implementing the edit feature in zoom-search. The edit feature included updating the plot(client side) on edit and also updating the database(server side).

On the client side, first the data row is updated on submit. If either of the column values or the data label is edited, it should be reflected in the plot as well. The margins also had to be updated/resized if required. For highcharts, I just needed to update the series data and redraw the chart. It was mentioned in option reference that this is done automatically(on data/axis extreme modification) or we can use chart.redraw() function, which redraws parts of the chart which have changed and not the entire plot.

Next part was to update the database. To avoid reloading the form each time an edit is done, the database update is done asynchronously using AJAX. In my original php cone(tbl_zoom_select.php) I included a unique condition (where clause) for every data row in the query result of the input criteria. This might be helpful in future if we want to speed-up the interface by generating the query not like SELECT * from table but SELECT xColumn,yColumn from table and the rest of data about the row can be fetched by using this unique condition (where clause).

For the edit feature, I use this unique condition as where clause in generating the UPDATE query for the row under consideration. After generating the UPDATE query, i post it to sql.php which executes this query and sends back the data and message. I append these responses to the <sqlqueryresults> div to show the UPDATE query executed and some statistics.  There are many areas of this code which can be optimized as this is a basic/raw implementation.

Apart from these I fixed some small issues and bugs like changing the 'How to use?' (help) link text, making it disappear on click, removed the mode feature. This week I will work on optimizing the code for better response time, bug fixes and hopefully panning feature (if released from Highcharts).

Monday 4 July 2011

GSoC 2011: Week 6

This past week I spent most of my time reorganizing my code and tried to use ajax in some parts. I redesigned my interface into two parts (forms), one form for taking in the input criteria(zoom_select_form) for generating the plot and the other form where the user can view/edit the data points(zoom_display_result). 

By doing so, once the input criteria is submitted I can show/hide the form just like the table search page. So more of code reuse and the interface also looks similar to the table search. Next, I tried to use ajax to post the details from the zoom_display_result so that an update query can be issued without interference. I got stuck here for some time but I've stated fresh now.

I did some more fixes like functioning of the modes: In browse mode the zoom_display_result fields are disabled so they cannot be edited and active again on edit mode, added the link for 'How to use', renaming of configuration directives.

Tasks for this week: Fix the default label feature, handle submit of zoom_display_result form.