Re: [PHP] How to point at a spot and get relevant information?

2003-08-14 Thread David Otton
On Thu, 7 Aug 2003 10:59:01 -0500 , you wrote:

Thank you for your reponses. The problem is there are thousands of spots on
the plot.
The locations are random. 

This may be one of those you can't get there from here problems, and
you'll have to rethink the presentation of your data. What's the
application?

I would have suggested an image and Javascript picking up mouse X and Y, but
thousands of points sounds like a lot of data to throw out to the client,
and a big array for Javascript to do lookups against.

Thoughts:

a) Try compressing the data before it's sent. Describe several adjacent,
similar points with a single polygon instead.

b) Zoom in, and pan across the plot. That way there's less data on each
page.

c) Flash? Java? They should have better response times than Javascript. A
regular desktop app would be best, of course.

e) Embed the label into the plot in some way. Charts on paper don't need
hovering labels, maybe you don't either.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] How to point at a spot and get relevant information?

2003-08-14 Thread Robert Cummings
Since PHP plots the data according to the information in the database
then you know about where the data is located in the image. If PHP works
on a single plot coordinate then you need to increase the acceptable
clickable region and use this to find your point (otherwise people will
need to click on the exact coordinate pixel.

For instance:

To go back to my earlier Ottawa example. You have a coordinate in
your database for Ottawa, let's imagine it is 1030, 720. To make an
acceptable clickable region we could decide that 5 pixels on either side
is acceptable for retrieving the information. By doing so we define a
bounding box for the location of the data. The rectangle would be:

   ottawa.x - 5, ottawa.y - 5, ottawa.x + 5, ottawa.y + 5

Now, since you want the information when the cursor is pointed at the
coordinate and not when the user clicks the coordinate you are
restricted to using a client side technology to determine what data to
display to the user (Javascript, Java, whatever else). This also means
you will need to send all of the information about locations in the
image to the user (possibly dynamically produced Javascript code). If
this is to be done then you are probably better off to calculate the
bounding box constraints at the client side, rather than on the server
and sending the extra data.

HTH,
Rob.


On Thu, 2003-08-07 at 12:38, Yao, Minghua wrote:
 Sorry I didn't ask the question clearly.
 
 I have a large table stored in a db. PHP plots the data in the table.
 I'd like the user to be able to get the relevant info of the spot when his
 cursor 
 points at that spot on the plot.
 
 -MY

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] How to point at a spot and get relevant information?

2003-08-14 Thread Robert Cummings
The ability to determine relevant information strongly depends on what
you know about the information you are displaying to the user. I'm
assuming you know about the information you are presenting to the user
and so it should be possible to map the coordinate system that the user
interacts with, to a global coordinate system for which you have
information about given aspects of the map. If you don't already have a
relationship between the graphics you are working with and the relevant
information, then this is probably your starting point. For instance if
it were a map of a city that occupied a rectangle of space on the
graphics (this is simplified since it could be any polygon), you would
probably have two coordinates that indicate a bounding box for that city
on the global map.

0,0
.---.
|   |
|   |
|   |
| * Ottawa  |
| [1024,718 to 1035,726]|
|   |
|   |
`---'
 2500,1500

Thus a coordinate where the following holds:

(x = 1024  x = 1035  y = 718  y = 726)

would correspond to the city of Ottawa. These coordinates could easily
be stored in a database for easy lookup by your PHP application.

Anyways I hope I'm understanding your problem correctly.

Cheers,
Rob.


On Thu, 2003-08-07 at 11:59, Yao, Minghua wrote:
 Robert and skate,
 
 Thank you for your reponses. The problem is there are thousands of spots on
 the plot.
 The locations are random. 
  
 -MY
 -Original Message-
 From: Robert Cummings [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 07, 2003 11:00 AM
 To: skate
 Cc: Yao, Minghua; [EMAIL PROTECTED]
 Subject: Re: [PHP] How to point at a spot and get relevant information?
 
 
 ou should be able to use an image map form input widget to get the
 coordinates that the user selects from some image you display to them.
 Then the determination of relevant information can occur server side via
 PHP. I don't have experience with this, but it appears to be how
 mapquest works:
 
 input type=image name=mqmap border=0 src=http://mq-mapgen ...
 
 HTH,
 Rob.
 
 
 On Thu, 2003-08-07 at 11:52, skate wrote:
  
  
  
Dear all,
   
Anybody knows how to write a graphic plotting code such that when
 users
point
at that spot, they can get the information relevant to that spot?
 Thanks
in advance.
   
  
  
  that'd be pretty intense. to do this feasbly with PHP, you'd have to
 analyse
  the picture first with the GD library. but to allow the user to interact
  with this, your gonna have to store all values into JavaScript. the users
  interaction can't be done with PHP, as that's all client side.
  
  this would result in possibly huge amounts of code to download, and fairly
  high processing time. i don't know if there's a javascript alternative, or
  maybe some other technology someone's made. this wouldn't be so hard in
  flash tho...
  
  
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 
 -- 
 .-.
 | Worlds of Carnage - http://www.wocmud.org   |
 :-:
 | Come visit a world of myth and legend where |
 | fantastical creatures come to life and the  |
 | stuff of nightmares grasp for your soul.|
 `-'
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] How to point at a spot and get relevant information?

2003-08-14 Thread Yao, Minghua
Sorry I didn't ask the question clearly.

I have a large table stored in a db. PHP plots the data in the table.
I'd like the user to be able to get the relevant info of the spot when his
cursor 
points at that spot on the plot.

-MY

-Original Message-
From: David Otton [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 07, 2003 11:31 AM
To: Yao, Minghua
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] How to point at a spot and get relevant information?


On Thu, 7 Aug 2003 10:59:01 -0500 , you wrote:

Thank you for your reponses. The problem is there are thousands of spots on
the plot.
The locations are random. 

This may be one of those you can't get there from here problems, and
you'll have to rethink the presentation of your data. What's the
application?

I would have suggested an image and Javascript picking up mouse X and Y, but
thousands of points sounds like a lot of data to throw out to the client,
and a big array for Javascript to do lookups against.

Thoughts:

a) Try compressing the data before it's sent. Describe several adjacent,
similar points with a single polygon instead.

b) Zoom in, and pan across the plot. That way there's less data on each
page.

c) Flash? Java? They should have better response times than Javascript. A
regular desktop app would be best, of course.

e) Embed the label into the plot in some way. Charts on paper don't need
hovering labels, maybe you don't either.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to point at a spot and get relevant information?

2003-08-14 Thread Robert Cummings
ou should be able to use an image map form input widget to get the
coordinates that the user selects from some image you display to them.
Then the determination of relevant information can occur server side via
PHP. I don't have experience with this, but it appears to be how
mapquest works:

input type=image name=mqmap border=0 src=http://mq-mapgen ...

HTH,
Rob.


On Thu, 2003-08-07 at 11:52, skate wrote:
 
 
 
   Dear all,
  
   Anybody knows how to write a graphic plotting code such that when users
   point
   at that spot, they can get the information relevant to that spot? Thanks
   in advance.
  
 
 
 that'd be pretty intense. to do this feasbly with PHP, you'd have to analyse
 the picture first with the GD library. but to allow the user to interact
 with this, your gonna have to store all values into JavaScript. the users
 interaction can't be done with PHP, as that's all client side.
 
 this would result in possibly huge amounts of code to download, and fairly
 high processing time. i don't know if there's a javascript alternative, or
 maybe some other technology someone's made. this wouldn't be so hard in
 flash tho...
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to point at a spot and get relevant information?

2003-08-14 Thread skate



  Dear all,
 
  Anybody knows how to write a graphic plotting code such that when users
  point
  at that spot, they can get the information relevant to that spot? Thanks
  in advance.
 


that'd be pretty intense. to do this feasbly with PHP, you'd have to analyse
the picture first with the GD library. but to allow the user to interact
with this, your gonna have to store all values into JavaScript. the users
interaction can't be done with PHP, as that's all client side.

this would result in possibly huge amounts of code to download, and fairly
high processing time. i don't know if there's a javascript alternative, or
maybe some other technology someone's made. this wouldn't be so hard in
flash tho...



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] How to point at a spot and get relevant information?

2003-08-07 Thread Yao, Minghua
Robert and skate,

Thank you for your reponses. The problem is there are thousands of spots on
the plot.
The locations are random. 
 
-MY
-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 07, 2003 11:00 AM
To: skate
Cc: Yao, Minghua; [EMAIL PROTECTED]
Subject: Re: [PHP] How to point at a spot and get relevant information?


ou should be able to use an image map form input widget to get the
coordinates that the user selects from some image you display to them.
Then the determination of relevant information can occur server side via
PHP. I don't have experience with this, but it appears to be how
mapquest works:

input type=image name=mqmap border=0 src=http://mq-mapgen ...

HTH,
Rob.


On Thu, 2003-08-07 at 11:52, skate wrote:
 
 
 
   Dear all,
  
   Anybody knows how to write a graphic plotting code such that when
users
   point
   at that spot, they can get the information relevant to that spot?
Thanks
   in advance.
  
 
 
 that'd be pretty intense. to do this feasbly with PHP, you'd have to
analyse
 the picture first with the GD library. but to allow the user to interact
 with this, your gonna have to store all values into JavaScript. the users
 interaction can't be done with PHP, as that's all client side.
 
 this would result in possibly huge amounts of code to download, and fairly
 high processing time. i don't know if there's a javascript alternative, or
 maybe some other technology someone's made. this wouldn't be so hard in
 flash tho...
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php