Implements an outline (aka overview) for a graph. Set updateOnPan to true to enable updates while the source graph is panning.
var outline = new mxOutline(graph, div);
If the selection border in the outline appears behind the contents of the graph, then you can use the following code. (This may happen when using a transparent container for the outline in IE.)
mxOutline.prototype.graphRenderHint = mxConstants.RENDERING_HINT_EXACT;
To move the graph to the top, left corner the following code can be used.
var scale = graph.view.scale; var bounds = graph.getGraphBounds(); graph.view.setTranslate(-bounds.x / scale, -bounds.y / scale);
To toggle the suspended mode, the following can be used.
outline.suspended = !outln.suspended; if (!outline.suspended) { outline.update(true); }
mxOutline | Implements an outline (aka overview) for a graph. |
Functions | |
mxOutline | Constructs a new outline for the specified graph inside the given container. |
source | Reference to the source mxGraph. |
outline | Reference to the outline mxGraph. |
graphRenderHint | Renderhint to be used for the outline graph. |
Variables | |
enabled | Specifies if events are handled. |
showViewport | Specifies a viewport rectangle should be shown. |
border | Border to be added at the bottom and right. |
enabled | Specifies the size of the sizer handler. |
updateOnPan | Specifies if update should be called for mxEvent.PAN in the source graph. |
sizerImage | Optional mxImage to be used for the sizer. |
suspended | Optional boolean flag to suspend updates. |
Functions | |
init | Initializes the outline inside the given container. |
isEnabled | Returns true if events are handled. |
setEnabled | Enables or disables event handling. |
setZoomEnabled | Enables or disables the zoom handling by showing or hiding the respective handle. |
refresh | Invokes update and revalidate the outline. |
createSizer | Creates the shape used as the sizer. |
getSourceContainerSize | Returns the size of the source container. |
getOutlineOffset | Returns the offset for drawing the outline graph. |
update | Updates the outline. |
mouseDown | Handles the event by starting a translation or zoom. |
mouseMove | Handles the event by previewing the viewrect in <graph> and updating the rectangle that represents the viewrect in the outline. |
mouseUp | Handles the event by applying the translation or zoom to <graph>. |
destroy | Destroy this outline and removes all listeners from source. |
function mxOutline( source, container )
Constructs a new outline for the specified graph inside the given container.
source | mxGraph to create the outline for. |
container | DOM node that will contain the outline. |
Reference to the source mxGraph.
Reference to the outline mxGraph.
mxOutline.prototype.updateOnPan
Specifies if update should be called for mxEvent.PAN in the source graph. Default is false.
mxOutline.prototype.sizerImage
Optional mxImage to be used for the sizer. Default is null.
mxOutline.prototype.isEnabled = function()
Returns true if events are handled. This implementation returns enabled.
mxOutline.prototype.setEnabled = function( value )
Enables or disables event handling. This implementation updates enabled.
value | Boolean that specifies the new enabled state. |
mxOutline.prototype.refresh = function()
Invokes update and revalidate the outline. This method is deprecated.
mxOutline.prototype.destroy = function()
Destroy this outline and removes all listeners from source.
Constructs a new outline for the specified graph inside the given container.
function mxOutline( source, container )
Specifies if events are handled.
mxOutline.prototype.enabled
Specifies a viewport rectangle should be shown.
mxOutline.prototype.showViewport
Border to be added at the bottom and right.
mxOutline.prototype.border
Specifies if update should be called for mxEvent.PAN in the source graph.
mxOutline.prototype.updateOnPan
Updates the outline.
mxOutline.prototype.update = function( revalidate )
Optional mxImage to be used for the sizer.
mxOutline.prototype.sizerImage
Optional boolean flag to suspend updates.
mxOutline.prototype.suspended
Initializes the outline inside the given container.
mxOutline.prototype.init = function( container )
Returns true if events are handled.
mxOutline.prototype.isEnabled = function()
Enables or disables event handling.
mxOutline.prototype.setEnabled = function( value )
Enables or disables the zoom handling by showing or hiding the respective handle.
mxOutline.prototype.setZoomEnabled = function( value )
Invokes update and revalidate the outline.
mxOutline.prototype.refresh = function()
Creates the shape used as the sizer.
mxOutline.prototype.createSizer = function()
Returns the size of the source container.
mxOutline.prototype.getSourceContainerSize = function()
Returns the offset for drawing the outline graph.
mxOutline.prototype.getOutlineOffset = function()
Handles the event by starting a translation or zoom.
mxOutline.prototype.mouseDown = function( sender, me )
Handles the event by previewing the viewrect in graph and updating the rectangle that represents the viewrect in the outline.
mxOutline.prototype.mouseMove = function( sender, me )
Handles the event by applying the translation or zoom to graph.
mxOutline.prototype.mouseUp = function( sender, me )
Destroy this outline and removes all listeners from source.
mxOutline.prototype.destroy = function()