# Network - rendering

Handles the rendering aspect of vis. It governs the render loop, it draws the nodes and edges and provides events to allow users to hook into the drawing.

### Options

The options for the rendering have to be contained in an object titled 'rendering'.

Click on the options shown to show how these options are supposed to be used.

    var options = {
      rendering:{
        hideEdgesOnDrag: true,
        hideNodesOnDrag: false
      }
    }

    network.setOptions(options);

All of the individual options are explained here:

name | type | default | description
hideEdgesOnDrag | Boolean | `false` | When true, the edges are not drawn when dragging the view. This can greatly speed up responsiveness on dragging, improving user experience.
hideNodesOnDrag | Boolean | `false` | When true, the nodes are not drawn when dragging the view. This can greatly speed up responsiveness on dragging, improving user experience.

### Methods

This is a list of all the methods in the public API. Options can be set directly to the module or you can use the setOptions method of the network itself and use the module name as an object name.

name | returns | description
redraw() | none | Redraw the network.

### Events

These events are fired by the renderer and can be used to move and draw custom elements on the same canvas as the rest of the network.

name | properties | description
initRedraw | none | Fired before the redrawing begins. The simulation step has completed at this point. Can be used to move custom elements before starting drawing the new frame.
beforeDrawing | `canvas context` | Fired after the canvas has been cleared, scaled and translated to the viewing position but before all edges and nodes are drawn. Can be used to draw behind the network.
initRedraw | `canvas context` | Fired after drawing on the canvas has been completed. Can be used to draw on top of the network.