Saturday, 31 July 2010

GSoC 2010 Week #10 report

Hello,

well I spent this week fixing various bugs and polishing some details. One of the more significant achievement was more sophisticated tooltip generation. Now it should work on any pie chart. Even on one with only one piece.

I have solved the base64 image length problem that I described in my last post. I decided to slice the chart image vertically into as many as 20 parts. In such way one part of a very big chart is under the limit of the base64 image length so it is displayed properly. This added some difficulties for the user when saving the chart to the hard disk. Therefore I have also added an option which allows to output a chart in one single piece.

I have tested various trivial cases for tables and checked if query results work on them. There was some tweaking to be done for these cases.

I also documented some work I have done in the wiki. You can find it here. There is also a format documented that is accepted for query results charts. You can see the preparations that need to be done for your data if you want to put it to the chart.

I have also merged master to my fork. There was only one minor conflict. This actually means that I am not changing PMA code much. I am just adding some new.

Next week I will continue polishing and fixing bugs if any.

Thursday, 22 July 2010

GSoC 2010 Week #8-#9 report

Hello,

first of all sorry I missed the report of the week #7, but I was ill that week so nothing much happened. This week I have started adding JS to the charts. So this is how it went.

The PHP library that I use (pChart) for chart generation has some ImageMap functionality. What it basically does is return some data to JS where a tooltip must be shown. That data is only coordinates of two points. That script allows to show tooltips only above rectangles. Well, pie charts and radars charts consist of not only rectangles but we want tooltips on them too.

So I started this week by writing some PHP code which calculates the areas where a tooltip should be on a chart and then JS had to be improved to cope with more complicated figures. There was some interesting math involved in this. Now we have tooltips over pie and radar maps too.

Well with JS sometimes comes compatibility issues. So when I started writing JS I also have started testing my work on other browsers. Only now I have noticed that IE 8 (I haven't even tested it on older ones) does not always show base64 encoded images. Some images which have long base64 strings are not shown. This is a little show stopper because I have no idea how to fix this without scrapping base64 images.

Talking about charts (: I was thinking about and looking at flot library for charts. It is not really suitable for this. It does better job while rendering plots than charts. pChart does render really good looking charts and no other library can do it better. I am not sure if PMA needs another implementation (JS) for charts. I think now I will do my best to add some convenience JS functionality and it will be much better than completely different JS charts implementation.

Now I am going back to tinker around with details and some bugs that are still there.

BTW. You can test out the chart functionality here. Just go the the status page and you will see nice looking pie chart. It is harder to test query results charts because you need some data which script does understand.

Sunday, 11 July 2010

GSoC 2010 Week #7 report

Hey everybody,

quite a lot have happened this week. Let me have a peek to the commit list...

Aha. First of all I have found one serious bug that was present in the demo server. There was no GD extension installed there. Not quite a bug you may say, but it took me some hours to figure that out. So then I implemented some error checking and notification.

Besides error checking I changed the structure of some classes responsible for charts. This helped me to introduce new chart types quite easily. Now you can choose among bar, line, radar and pie charts for query results chart. I am still not quite happy with the new structure. There are some places where I would like to use multiple inheritance. But this only says that the design is not perfect.

Next week I will start the implementation of JS charts using flot. So for now static image chart code will stay as it is. I believe I will have to change it in some way or another because I would like to have image and JS charts looking similar, but JS charts having interactivity. I am really looking forward to this part. JS is always somewhat challenging to me. (:

See you after week!

Tuesday, 6 July 2010

GSoC 2010 Week #6 report

Hello,

as I said earlier I was away for the whole previous week. Now I am back ready for some coding action.

This week I will iron out the problems that the demo server has with the charts. I have tried to do this old-fashioned way and by now I believe that there is something to do with different GD versions. Because of this I will also add some version checking and error message generation to the code. It is always good to do this before any errors happen or you can loose some time while hunting bugs as I have.

After this I think I will be ready for JS chart implementation.

Take care,
Martynas