|
Clickmaps and mouseover labelsClickmaps (clickable image maps) allow browser users to click on a region in a graphic, which acts as a hyperlink to a new web page. Mouseover labels allow browser users to move the mouse over a data point or region (without clicking) and see a text bubble appear to give additional information. Ploticus 2.03+ can generate either server-side or client-side map files to accompany images (PNG, JPEG, or GIF); version 2.04+ supports clickable mapping in SVG. Version 2.11+ supports mouseover text labels via client-side maps for PNG, JPEG, or GIF images.
You can map
pie slice labels
,
bars
,
scatterplot points
,
annotations
,
arbitrary rectangular regions
,
legend entries
, and
the plotting area
(either as a grid, or in its entirety).
ExamplesA number of live examples are provided below.Server-side maps, client-side maps, and SVG
Mouseover text labelsMouseover text bubbles are done in a similar way to clickmaps, for most of the same types of plots. You must use a client-side image map (-csmap) to accompany a PNG, GIF, or JPEG image. Mouseover may be done alone or with clickability and URLs. In plotting procs, mouseover text bubble messages are specified similarly to URLs using an attribute called clickmaplabel. In situations where URLs are generated by way of embedded @variables, the text messages should be generated that way too. Here's a gallery example that uses a client-side imagemap to implement mouseover text labels (move your mouse over the bars).Generating map filesMap generation is triggered by the presence of the -map or -csmap command line option. If these aren't specified, then no map will be generated.You can use the -mapfile command line option (or proc page equivalent) to explicitly name your map file. Using -mapfile stdout will dump the map to standard output which can be useful in dynamic content situations. If -mapfile is not specified, the map file will have the same name as the accompanying graphic result file, except with a .map suffix. Usage examples:
Linking an HTML page with the generated image mapIn your web pages, you can use the following HTML construct to associate a server-side map file with an image: <a href="mypic.map"> <img src="mypic.png" ismap > </a> Here's an HTML example that uses an embedded client-side map for an image: <map name="map1"> ... the map content that pl generates will go here ... </map> <img src="mypic.png" usemap="#map1"> Note: When ploticus generates a client-side map, it leaves off the opening <map> and closing </map> tags.
For SVG, no special action is necessary; use the
normal construct.
TroubleshootingIf the -debug command line option is used the mapped regions will be displayed in bright green. If -debug is used in X11 mode, the regions are displayed but no map file is generated.
Note that if two generated mapped regions overlap, they are stacked in the order generated
(the last generated is on "top").
Specifying URLs and/or mouseover labelsPloticus will need to know how to build the URLs and/or mouseover labels that will be present in the image map result. For clickmaps, you will need to supply URLs (or arrange for URLs to be built from data fields) in your script or prefab, usually through an attribute called clickmapurl. For mouseover text messages, you will need to supply the text messages or arrange for them to be built, usually through an attribute called clickmaplabel...for pie graphs, bar graphs, and scatterplots
..for annotations and arbitrary rectangles
..for legend entries
..for the plotting area to be a single region
..for grid regions within the plotting area
To set a default URL for the entire image
Notes: Embedded spaces and newlines that turn up within URLs will be converted to underscores.
Grid mapping may not be used with more than one plotting area per image.
ExamplesMost of the following examples have been run with -debug to add the green overlay showing where clickable regions are. Try clicking on these images.. they are mapped to a live CGI program that will echo the passed parameters.clickmap_pie ![]() Click on pie slice labels. Click here to see a gallery example that uses a client-side imagemap with mouseover text labels (but no URLs)clickmap_annot ![]() Click on annotations. clickmap_leg ![]() Click on legend entries. clickmap_area2 ![]() Mapped plotting area grid. Numeric in X and Y. Click on plotting area. To try the SVG equivalent click here. clickmap_area3 ![]() Same as above, but with finer granularity. This is done by executing an invisible X axis and an invisible Y axis for the clickmap (in addition to the visible axes) using the automatically determined stub increment, divided by 4. snpmap1 ![]() Mapped plotting area grid. Numeric in X; categories in Y. Note that the mapped grid (Y) is influenced by stubslide. colorgrid ![]() Data points are mapped. Click on any data point. clickmap_area ![]() Mapped plotting area grid. Months in X, numeric in Y. Note that month format is controlled using proc axis clickmapvalformat. clickmap_log ![]() Mapped plotting area grid in Y. Log example. Click on plotting area. clickmap_time2 ![]() Mapped timeline bars. clickmap_mouse ![]() Mapped plotting area grid. Categories in X. Note that the X stubs are (mostly) included in the mapped regions. This is done using the proc xaxis clickmapextent attribute. clickmap_hit ![]() Mapped plotting area grid. Datetimes in X. The datetimes are mapped in 6 hour increments, even though stubs appear every 24 hours. This is done by executing an invisible X axis for the clickmap, using 6 hour increments. |
![]() data display engine Copyright Steve Grubb ![]() |