I have a NodeTemplate
that has the following form:
var recttemplate = GO(go.Node, "Horizontal",
GO(go.Shape, "Rectangle",
new go.Binding("fill", "fill"),
new go.Binding("width", "width"),
new go.Binding("height", "height")
),
{
mouseEnter: function(e, node){
//alert("key on mouse Over is :" + node.data.key);
var nextRowObject = RowSeatRef_array[node.data.key];
var msg = "Row " + nextRowObject.RowNum + " in Section: " + nextRowObject.Section + " $" + nextRowObject.Price + " has " + nextRowObject.NumSeatsAvail + " available. Right-Click to select seats on this row.";
var xpos = node.location.x;
var ypos = node.location.y;
setMapInfoBoxOverlay(msg, xpos, ypos);
},
mouseLeave: function(e, node){
clearMapInfoBoxOverlay();
},
contextClick: function(e, node){
CurrentParentClickedOnRef = RowSeatRef_array[node.data.key];
displayRowContextMenu();
}
},
new go.Binding("angle", "rotation"),
new go.Binding("location", "shapePosition")
)
And I create nodes of the above category
in my Diagram which is initialized with the following parameters:
SeatingMapGraphicsRef = GO(go.Diagram, 'seatingMapPanelGoJSDiagram', {
allowResize: true,
allowZoom: false,
allowHorizontalScroll: false,
allowVerticalScroll: false,
scrollMode: go.Diagram.InfiniteScroll,
autoScrollRegion: new go.Margin(0, 0, 0, 0),
initialContentAlignment: go.Spot.Center
initialAutoScale:go.Diagram.Uniform
});
I currently am having the following behavior. Currently, I can drag Nodes
to say the upper left corner of my gojs Diagram
. When I have an alert()
message which tells me the node.location.x
and node.location.y
coordinates I start to get negative values for both the x and y coordinates, with my GraphObject being well within the boundaries of the diagram. THe only way that seems possible is if I had set up the diagram to somehow display the negative portions of the x and y axis , or if the visual part of the GraphObject somehow has a lot of invisible padding around which make invisible portions go off the grid. Is there anyway I can force all objects wihin the bounds of my Diagram to never have negative x and y location values? Thank you!
Ryan.