Hi,
With reference to my previous ideas regarding zoom search, I present here some of the implementation details of the project.
Implementation tags: php, jQuery, ajax
*Default View:*
Every database is first represented as a scatter of points based on its primary key values.
1. This is very intuitive if the primary key is a numeric value.
2. For varchar type primary keys we can always define ranges. For example the values based on initials can be clubbed together and represented as a graph. The following illustration shows it
C|
B|
A|___________________________________
Values with their relative order in the class->
Example: ‘AB’ and ‘AC’ will belong to the same class of A but ‘AC’ will lie to the right of ‘AB’.
Zooming into a class will result in more detail scale. Ex A on the y axis will become AA, AB etc.
3. If a primary key is represented as enum (which is very rare) then a pie chart can be formed.
*User defined:*
The user will be allowed to pick up 2 columns and then view them graphically. The allowed type will be based on the type on the data type of the 2 columns.
For example: A varchar and integer col can be represented as a graph with discrete classes (‘A’,’B’ etc) on the x axis and values at the y axis. And can be accordingly mapped.
At every zoom level we keep a track of the points displayed. The cool feature of this api will be as the user selects 2 columns to view at any zoom level. The points available at that zoom level get affected and form a scatter (or the graph depending on the selection).
*Some intuitive operation*
Once the data is graphically represented we can easily associate values with each point and manipulate them (update, delete).
Also a nice addition can be a graphical way of inserting data as we can map every single pixel easily using jQuery (even simple javascript also) we can register a click (when user is in the insert mode) and appropriately map the 2 columns displayed and provide a nice ajax pop up that will allow user to add information about other fields in the table.
These are the feature I find appropriate for a 13*40hr project. One of the hot trends on the mailing list was how to implement zooming feature.
*ZOOOoooooOM*
At this juncture I can think of a simple algorithm based on jQuery. The ui will listen to the mouse wheel. At every discrete step it will create a rectangle with center at the mouse pointer location. Every time we zoom in the rectangle will be reduced in its size. Since we will map every pixel in the ui we can easily find out the points that lie inside the region and hence appropriately show them.
One advantage of this is we can use simple limits for points and check what all qualifies. Also this will also allow us to provide an abstract view of level of zoom in the database also.
For example: A small section in the ui can show the database and a rectangle showing where we are right now.
Let me know your suggestions.