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).

No comments:

Post a Comment