Based on this part of your "limited question" above:
"I am trying to get the geometries of graphics that are grouped"
I assume you are using the esri ClusterLayer as described here: https://developers.arcgis.com/javascript/jssamples/layers_point_clustering.html
If so then right here we go:
Mouse over will not be ideal at all the reason is that the cluster images are simply PictureMarkerSymbols which are set against a new esri.renderer.ClassBreaksRenderer at different break points for example:
var renderer = new esri.renderer.ClassBreaksRenderer(mapManager.pointFeatureSymbol, "clusterCount");
var blue = new esri.symbol.PictureMarkerSymbol("images/BluePin1LargeB.png", 32, 32).setOffset(0, 15);
var green = new esri.symbol.PictureMarkerSymbol("images/GreenPin1LargeB.png", 64, 64).setOffset(0, 15);
var red = new esri.symbol.PictureMarkerSymbol("images/RedPin1LargeB.png", 72, 72).setOffset(0, 15);
renderer.addBreak(0, 2, blue);
renderer.addBreak(2, 200, green);
renderer.addBreak(200, 1001, red);
You can click on the image rather and get the graphics inside by doing something like the following:
Now assuming you have a cluster layer object somewhere: lets say var clusterLayer = new ClusterLayer
you can attach an event
dojo.connect(map, "onClick", function (evt)
{
var mp = evt.mapPoint;
var cl= map.getLayer("Points");
for (var g in cl.graphics)
{
var graphic = cl.graphics[g];
if (graphic.geometry != null && graphic.geometry.type == "point")
{
var toleranceInPixel = 10;
// now create a buffer around the current graphic and basically build a polygon for it and get its extent
var extentPoly = pointToPolygon(graphic.geometry, toleranceInPixel);
// then see if this buffered point polygon contans the mp
if (extentPoly .contains(mp))
{
// add all points that are within your buffered polygon to some array and access their geometries from there
}
}
}
});
Method to build a polygon from point - Note there may be updated esri libraries which has this build in
function pointToPolygon (point, toleranceInPixel)
{
//calculate map coords represented per pixel
var pixelWidth = mapManager.map.extent.getWidth() / mapManager.map.width;
//calculate map coords for tolerance in pixel
var toleraceInMapCoords = toleranceInPixel * pixelWidth;
//calculate & return computed extent
var extent = esri.geometry.Extent(point.x - toleraceInMapCoords,
point.y - toleraceInMapCoords,
point.x + toleraceInMapCoords,
point.y + toleraceInMapCoords,
map.spatialReference);
return (convertExtentToPolygon(extent, map.spatialReference));
}
Method to build an extent from polygon - Note there may be updated esri libraries which has this build in
function convertExtentToPolygon (extent, spatialRef)
{
var xmin = extent.xmin;
var xmax = extent.xmax;
var ymin = extent.ymin;
var ymax = extent.ymax;
var topLeft = new esri.geometry.Point(xmin, ymax, spatialRef);
var topRight = new esri.geometry.Point(xmax, ymax, spatialRef);
var bottomRight = new esri.geometry.Point(xmax, ymin, spatialRef);
var bottomLeft = new esri.geometry.Point(xmin, ymin, spatialRef);
var rings = new Array(topLeft, topRight, bottomRight, bottomLeft, topLeft);
var newPolygon = new esri.geometry.Polygon(spatialRef);
newPolygon.addRing(rings);
return newPolygon;
}
You can adjust the tolerance as needed - there may be newer esri libraries to do this better but this is similar to what used some time ago.