1 /*
  2     Copyright 2008-2013
  3         Matthias Ehmann,
  4         Michael Gerhaeuser,
  5         Carsten Miller,
  6         Bianca Valentin,
  7         Alfred Wassermann,
  8         Peter Wilfahrt
  9 
 10     This file is part of JSXGraph.
 11 
 12     JSXGraph is free software dual licensed under the GNU LGPL or MIT License.
 13 
 14     You can redistribute it and/or modify it under the terms of the
 15 
 16       * GNU Lesser General Public License as published by
 17         the Free Software Foundation, either version 3 of the License, or
 18         (at your option) any later version
 19       OR
 20       * MIT License: https://github.com/jsxgraph/jsxgraph/blob/master/LICENSE.MIT
 21 
 22     JSXGraph is distributed in the hope that it will be useful,
 23     but WITHOUT ANY WARRANTY; without even the implied warranty of
 24     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 25     GNU Lesser General Public License for more details.
 26 
 27     You should have received a copy of the GNU Lesser General Public License and
 28     the MIT License along with JSXGraph. If not, see <http://www.gnu.org/licenses/>
 29     and <http://opensource.org/licenses/MIT/>.
 30  */
 31 
 32 
 33 /*global JXG: true, define: true, AMprocessNode: true, MathJax: true, document: true */
 34 /*jslint nomen: true, plusplus: true, newcap:true*/
 35 
 36 /* depends:
 37  jxg
 38  renderer/abstract
 39 */
 40 
 41 /**
 42  * @fileoverview JSXGraph can use various technologies to render the contents of a construction, e.g.
 43  * SVG, VML, and HTML5 Canvas. To accomplish this, The rendering and the logic and control mechanisms
 44  * are completely separated from each other. Every rendering technology has it's own class, called
 45  * Renderer, e.g. SVGRenderer for SVG, the same for VML and Canvas. The common base for all available
 46  * renderers is the class AbstractRenderer.
 47  */
 48 
 49 define(['jxg', 'renderer/abstract'], function (JXG, AbstractRenderer) {
 50 
 51     "use strict";
 52 
 53     /**
 54      * This renderer draws nothing. It is intended to be used in environments where none of our rendering engines
 55      * are available, e.g. WebWorkers.
 56      * @class JXG.AbstractRenderer
 57      */
 58     JXG.NoRenderer = function () {
 59         /**
 60          * If this property is set to <tt>true</tt> the visual properties of the elements are updated
 61          * on every update. Visual properties means: All the stuff stored in the
 62          * {@link JXG.GeometryElement#visProp} property won't be set if enhancedRendering is <tt>false</tt>
 63          * @type Boolean
 64          * @default true
 65          */
 66         this.enhancedRendering = false;
 67 
 68         /**
 69          * This is used to easily determine which renderer we are using
 70          * @example if (board.renderer.type === 'vml') {
 71          *     // do something
 72          * }
 73          * @type String
 74          */
 75         this.type = 'no';
 76     };
 77 
 78     JXG.extend(JXG.NoRenderer.prototype, /** @lends JXG.AbstractRenderer.prototype */ {
 79         /* ******************************** *
 80          *    Point drawing and updating    *
 81          * ******************************** */
 82 
 83         /**
 84          * Draws a point on the {@link JXG.Board}.
 85          * @param {JXG.Point} element Reference to a {@link JXG.Point} object that has to be drawn.
 86          * @see Point
 87          * @see JXG.Point
 88          * @see JXG.AbstractRenderer#updatePoint
 89          * @see JXG.AbstractRenderer#changePointStyle
 90          */
 91         drawPoint: function (element) {},
 92 
 93         /**
 94          * Updates visual appearance of the renderer element assigned to the given {@link JXG.Point}.
 95          * @param {JXG.Point} element Reference to a {@link JXG.Point} object, that has to be updated.
 96          * @see Point
 97          * @see JXG.Point
 98          * @see JXG.AbstractRenderer#drawPoint
 99          * @see JXG.AbstractRenderer#changePointStyle
100          */
101         updatePoint: function (element) { },
102 
103         /**
104          * Changes the style of a {@link JXG.Point}. This is required because the point styles differ in what
105          * elements have to be drawn, e.g. if the point is marked by a "x" or a "+" two lines are drawn, if
106          * it's marked by spot a circle is drawn. This method removes the old renderer element(s) and creates
107          * the new one(s).
108          * @param {JXG.Point} element Reference to a {@link JXG.Point} object, that's style is changed.
109          * @see Point
110          * @see JXG.Point
111          * @see JXG.AbstractRenderer#updatePoint
112          * @see JXG.AbstractRenderer#drawPoint
113          */
114         changePointStyle: function (element) { },
115 
116         /* ******************************** *
117          *           Lines                  *
118          * ******************************** */
119 
120         /**
121          * Draws a line on the {@link JXG.Board}.
122          * @param {JXG.Line} element Reference to a line object, that has to be drawn.
123          * @see Line
124          * @see JXG.Line
125          * @see JXG.AbstractRenderer#updateLine
126          */
127         drawLine: function (element) { },
128 
129         /**
130          * Updates visual appearance of the renderer element assigned to the given {@link JXG.Line}.
131          * @param {JXG.Line} element Reference to the {@link JXG.Line} object that has to be updated.
132          * @see Line
133          * @see JXG.Line
134          * @see JXG.AbstractRenderer#drawLine
135          */
136         updateLine: function (element) { },
137 
138         /**
139          * Creates a rendering node for ticks added to a line.
140          * @param {JXG.Line} element A arbitrary line.
141          * @see Line
142          * @see Ticks
143          * @see JXG.Line
144          * @see JXG.Ticks
145          * @see JXG.AbstractRenderer#updateTicks
146          */
147         drawTicks: function (element) { },
148 
149         /**
150          * Update {@link Ticks} on a {@link JXG.Line}. This method is only a stub and has to be implemented
151          * in any descendant renderer class.
152          * @param {JXG.Line} element Reference of an line object, thats ticks have to be updated.
153          * @param {Number} dxMaj Number of pixels a major tick counts in x direction.
154          * @param {Number} dyMaj Number of pixels a major tick counts in y direction.
155          * @param {Number} dxMin Number of pixels a minor tick counts in x direction.
156          * @param {Number} dyMin Number of pixels a minor tick counts in y direction.
157          * @see Line
158          * @see Ticks
159          * @see JXG.Line
160          * @see JXG.Ticks
161          * @see JXG.AbstractRenderer#drawTicks
162          */
163         updateTicks: function (element, dxMaj, dyMaj, dxMin, dyMin) { /* stub */ },
164 
165         /* **************************
166          *    Curves
167          * **************************/
168 
169         /**
170          * Draws a {@link JXG.Curve} on the {@link JXG.Board}.
171          * @param {JXG.Curve} element Reference to a graph object, that has to be plotted.
172          * @see Curve
173          * @see JXG.Curve
174          * @see JXG.AbstractRenderer#updateCurve
175          */
176         drawCurve: function (element) { },
177 
178         /**
179          * Updates visual appearance of the renderer element assigned to the given {@link JXG.Curve}.
180          * @param {JXG.Curve} element Reference to a {@link JXG.Curve} object, that has to be updated.
181          * @see Curve
182          * @see JXG.Curve
183          * @see JXG.AbstractRenderer#drawCurve
184          */
185         updateCurve: function (element) { },
186 
187         /* **************************
188          *    Circle related stuff
189          * **************************/
190 
191         /**
192          * Draws a {@link JXG.Circle}
193          * @param {JXG.Circle} element Reference to a {@link JXG.Circle} object that has to be drawn.
194          * @see Circle
195          * @see JXG.Circle
196          * @see JXG.AbstractRenderer#updateEllipse
197          */
198         drawEllipse: function (element) { },
199 
200         /**
201          * Updates visual appearance of a given {@link JXG.Circle} on the {@link JXG.Board}.
202          * @param {JXG.Circle} element Reference to a {@link JXG.Circle} object, that has to be updated.
203          * @see Circle
204          * @see JXG.Circle
205          * @see JXG.AbstractRenderer#drawEllipse
206          */
207         updateEllipse: function (element) { },
208 
209 
210         /* **************************
211          *   Polygon related stuff
212          * **************************/
213 
214         /**
215          * Draws a {@link JXG.Polygon} on the {@link JXG.Board}.
216          * @param {JXG.Polygon} element Reference to a Polygon object, that is to be drawn.
217          * @see Polygon
218          * @see JXG.Polygon
219          * @see JXG.AbstractRenderer#updatePolygon
220          */
221         drawPolygon: function (element) { },
222 
223         /**
224          * Updates properties of a {@link JXG.Polygon}'s rendering node.
225          * @param {JXG.Polygon} element Reference to a {@link JXG.Polygon} object, that has to be updated.
226          * @see Polygon
227          * @see JXG.Polygon
228          * @see JXG.AbstractRenderer#drawPolygon
229          */
230         updatePolygon: function (element) { },
231 
232         /* **************************
233          *    Text related stuff
234          * **************************/
235 
236         /**
237          * Shows a small copyright notice in the top left corner of the board.
238          * @param {String} str The copyright notice itself
239          * @param {Number} fontsize Size of the font the copyright notice is written in
240          */
241         displayCopyright: function (str, fontsize) { /* stub */ },
242 
243         /**
244          * An internal text is a {@link JXG.Text} element which is drawn using only
245          * the given renderer but no HTML. This method is only a stub, the drawing
246          * is done in the special renderers.
247          * @param {JXG.Text} element Reference to a {@link JXG.Text} object
248          * @see Text
249          * @see JXG.Text
250          * @see JXG.AbstractRenderer#updateInternalText
251          * @see JXG.AbstractRenderer#drawText
252          * @see JXG.AbstractRenderer#updateText
253          * @see JXG.AbstractRenderer#updateTextStyle
254          */
255         drawInternalText: function (element) { /* stub */ },
256 
257         /**
258          * Updates visual properties of an already existing {@link JXG.Text} element.
259          * @param {JXG.Text} element Reference to an {@link JXG.Text} object, that has to be updated.
260          * @see Text
261          * @see JXG.Text
262          * @see JXG.AbstractRenderer#drawInternalText
263          * @see JXG.AbstractRenderer#drawText
264          * @see JXG.AbstractRenderer#updateText
265          * @see JXG.AbstractRenderer#updateTextStyle
266          */
267         updateInternalText: function (element) { /* stub */ },
268 
269         /**
270          * Displays a {@link JXG.Text} on the {@link JXG.Board} by putting a HTML div over it.
271          * @param {JXG.Text} element Reference to an {@link JXG.Text} object, that has to be displayed
272          * @see Text
273          * @see JXG.Text
274          * @see JXG.AbstractRenderer#drawInternalText
275          * @see JXG.AbstractRenderer#updateText
276          * @see JXG.AbstractRenderer#updateInternalText
277          * @see JXG.AbstractRenderer#updateTextStyle
278          */
279         drawText: function (element) { },
280 
281         /**
282          * Updates visual properties of an already existing {@link JXG.Text} element.
283          * @param {JXG.Text} element Reference to an {@link JXG.Text} object, that has to be updated.
284          * @see Text
285          * @see JXG.Text
286          * @see JXG.AbstractRenderer#drawText
287          * @see JXG.AbstractRenderer#drawInternalText
288          * @see JXG.AbstractRenderer#updateInternalText
289          * @see JXG.AbstractRenderer#updateTextStyle
290          */
291         updateText: function (element) { },
292 
293         /**
294          * Updates CSS style properties of a {@link JXG.Text} node.
295          * @param {JXG.Text} element Reference to the {@link JXG.Text} object, that has to be updated.
296          * @param {Boolean} doHighlight
297          * @see Text
298          * @see JXG.Text
299          * @see JXG.AbstractRenderer#drawText
300          * @see JXG.AbstractRenderer#drawInternalText
301          * @see JXG.AbstractRenderer#updateText
302          * @see JXG.AbstractRenderer#updateInternalText
303          */
304         updateTextStyle: function (element, doHighlight) { },
305 
306         /**
307          * Set color and opacity of internal texts.
308          * SVG needs its own version.
309          * @private
310          * @see JXG.AbstractRenderer#updateTextStyle
311          * @see JXG.AbstractRenderer#updateInternalTextStyle
312          */
313         updateInternalTextStyle: function (element, strokeColor, strokeOpacity) { /* stub */ },
314 
315         /* **************************
316          *    Image related stuff
317          * **************************/
318 
319         /**
320          * Draws an {@link JXG.Image} on a board; This is just a template that has to be implemented by special renderers.
321          * @param {JXG.Image} element Reference to the image object that is to be drawn
322          * @see Image
323          * @see JXG.Image
324          * @see JXG.AbstractRenderer#updateImage
325          */
326         drawImage: function (element) { /* stub */ },
327 
328         /**
329          * Updates the properties of an {@link JXG.Image} element.
330          * @param {JXG.Image} element Reference to an {@link JXG.Image} object, that has to be updated.
331          * @see Image
332          * @see JXG.Image
333          * @see JXG.AbstractRenderer#drawImage
334          */
335         updateImage: function (element) { },
336 
337         /**
338          * Applies transformations on images and text elements. This method is just a stub and has to be implemented in all
339          * descendant classes where text and image transformations are to be supported.
340          * @param {JXG.Image|JXG.Text} element A {@link JXG.Image} or {@link JXG.Text} object.
341          * @param {Array} transformations An array of {@link JXG.Transformation} objects. This is usually the transformations property
342          * of the given element <tt>el</tt>.
343          */
344         transformImage: function (element, transformations) { /* stub */ },
345 
346         /**
347          * If the URL of the image is provided by a function the URL has to be updated during updateImage()
348          * @param {JXG.Image} element Reference to an image object.
349          * @see JXG.AbstractRenderer#updateImage
350          */
351         updateImageURL: function (element) { /* stub */ },
352 
353         /* **************************
354          * Render primitive objects
355          * **************************/
356 
357         /**
358          * Appends a node to a specific layer level. This is just an abstract method and has to be implemented
359          * in all renderers that want to use the <tt>createPrim</tt> model to draw.
360          * @param {Node} node A DOM tree node.
361          * @param {Number} level The layer the node is attached to. This is the index of the layer in
362          * {@link JXG.SVGRenderer#layer} or the <tt>z-index</tt> style property of the node in VMLRenderer.
363          */
364         appendChildPrim: function (node, level) { /* stub */ },
365 
366         /**
367          * Stores the rendering nodes. This is an abstract method which has to be implemented in all renderers that use
368          * the <tt>createPrim</tt> method.
369          * @param {JXG.GeometryElement} element A JSXGraph element.
370          * @param {String} type The XML node name. Only used in VMLRenderer.
371          */
372         appendNodesToElement: function (element, type) { /* stub */ },
373 
374         /**
375          * Creates a node of a given type with a given id.
376          * @param {String} type The type of the node to create.
377          * @param {String} id Set the id attribute to this.
378          * @returns {Node} Reference to the created node.
379          */
380         createPrim: function (type, id) {
381             /* stub */
382             return null;
383         },
384 
385         /**
386          * Removes an element node. Just a stub.
387          * @param {Node} node The node to remove.
388          */
389         remove: function (node) { /* stub */ },
390 
391         /**
392          * Can be used to create the nodes to display arrows. This is an abstract method which has to be implemented
393          * in any descendant renderer.
394          * @param {JXG.GeometryElement} element The element the arrows are to be attached to.
395          */
396         makeArrows: function (element) { /* stub */ },
397 
398         /**
399          * Updates an ellipse node primitive. This is an abstract method which has to be implemented in all renderers
400          * that use the <tt>createPrim</tt> method.
401          * @param {Node} node Reference to the node.
402          * @param {Number} x Centre X coordinate
403          * @param {Number} y Centre Y coordinate
404          * @param {Number} rx The x-axis radius.
405          * @param {Number} ry The y-axis radius.
406          */
407         updateEllipsePrim: function (node, x, y, rx, ry) { /* stub */ },
408 
409         /**
410          * Refreshes a line node. This is an abstract method which has to be implemented in all renderers that use
411          * the <tt>createPrim</tt> method.
412          * @param {Node} node The node to be refreshed.
413          * @param {Number} p1x The first point's x coordinate.
414          * @param {Number} p1y The first point's y coordinate.
415          * @param {Number} p2x The second point's x coordinate.
416          * @param {Number} p2y The second point's y coordinate.
417          * @param {JXG.Board} board
418          */
419         updateLinePrim: function (node, p1x, p1y, p2x, p2y, board) { /* stub */ },
420 
421         /**
422          * Updates a path element. This is an abstract method which has to be implemented in all renderers that use
423          * the <tt>createPrim</tt> method.
424          * @param {Node} node The path node.
425          * @param {String} pathString A string formatted like e.g. <em>'M 1,2 L 3,1 L5,5'</em>. The format of the string
426          * depends on the rendering engine.
427          * @param {JXG.Board} board Reference to the element's board.
428          */
429         updatePathPrim: function (node, pathString, board) { /* stub */ },
430 
431         /**
432          * Builds a path data string to draw a point with a face other than <em>rect</em> and <em>circle</em>. Since
433          * the format of such a string usually depends on the renderer this method
434          * is only an abstract method. Therefore, it has to be implemented in the descendant renderer itself unless
435          * the renderer does not use the createPrim interface but the draw* interfaces to paint.
436          * @param {JXG.Point} element The point element
437          * @param {Number} size A positive number describing the size. Usually the half of the width and height of
438          * the drawn point.
439          * @param {String} type A string describing the point's face. This method only accepts the shortcut version of
440          * each possible face: <tt>x, +, <>, ^, v, >, <
441          */
442         updatePathStringPoint: function (element, size, type) { /* stub */ },
443 
444         /**
445          * Builds a path data string from a {@link JXG.Curve} element. Since the path data strings heavily depend on the
446          * underlying rendering technique this method is just a stub. Although such a path string is of no use for the
447          * CanvasRenderer, this method is used there to draw a path directly.
448          * @param element
449          */
450         updatePathStringPrim: function (element) { /* stub */ },
451 
452         /**
453          * Builds a path data string from a {@link JXG.Curve} element such that the curve looks like
454          * hand drawn.
455          * Since the path data strings heavily depend on the
456          * underlying rendering technique this method is just a stub. Although such a path string is of no use for the
457          * CanvasRenderer, this method is used there to draw a path directly.
458          * @param element
459          */
460         updatePathStringBezierPrim: function (element) { /* stub */ },
461 
462 
463         /**
464          * Update a polygon primitive.
465          * @param {Node} node
466          * @param {JXG.Polygon} element A JSXGraph element of type {@link JXG.Polygon}
467          */
468         updatePolygonPrim: function (node, element) { /* stub */ },
469 
470         /**
471          * Update a rectangle primitive. This is used only for points with face of type 'rect'.
472          * @param {Node} node The node yearning to be updated.
473          * @param {Number} x x coordinate of the top left vertex.
474          * @param {Number} y y coordinate of the top left vertex.
475          * @param {Number} w Width of the rectangle.
476          * @param {Number} h The rectangle's height.
477          */
478         updateRectPrim: function (node, x, y, w, h) { /* stub */ },
479 
480         /* **************************
481          *  Set Attributes
482          * **************************/
483 
484         /**
485          * Sets a node's attribute.
486          * @param {Node} node The node that is to be updated.
487          * @param {String} key Name of the attribute.
488          * @param {String} val New value for the attribute.
489          */
490         setPropertyPrim: function (node, key, val) { /* stub */ },
491 
492         /**
493          * Shows a hidden element on the canvas; Only a stub, requires implementation in the derived renderer.
494          * @param {JXG.GeometryElement} element Reference to the object that has to appear.
495          * @see JXG.AbstractRenderer#hide
496          */
497         show: function (element) { /* stub */ },
498 
499         /**
500          * Hides an element on the canvas; Only a stub, requires implementation in the derived renderer.
501          * @param {JXG.GeometryElement} element Reference to the geometry element that has to disappear.
502          * @see JXG.AbstractRenderer#show
503          */
504         hide: function (element) { /* stub */ },
505 
506         /**
507          * Sets the buffering as recommended by SVGWG. Until now only Opera supports this and will be ignored by
508          * other browsers. Although this feature is only supported by SVG we have this method in {@link JXG.AbstractRenderer}
509          * because it is called from outside the renderer.
510          * @param {Node} node The SVG DOM Node which buffering type to update.
511          * @param {String} type Either 'auto', 'dynamic', or 'static'. For an explanation see
512          *   {@link http://www.w3.org/TR/SVGTiny12/painting.html#BufferedRenderingProperty}.
513          */
514         setBuffering: function (node, type) { /* stub */ },
515 
516         /**
517          * Sets an element's dash style.
518          * @param {JXG.GeometryElement} element An JSXGraph element.
519          */
520         setDashStyle: function (element) { /* stub */ },
521 
522         /**
523          * Puts an object into draft mode, i.e. it's visual appearance will be changed. For GEONE<sub>x</sub>T backwards compatibility.
524          * @param {JXG.GeometryElement} element Reference of the object that is in draft mode.
525          */
526         setDraft: function (element) { },
527 
528         /**
529          * Puts an object from draft mode back into normal mode.
530          * @param {JXG.GeometryElement} element Reference of the object that no longer is in draft mode.
531          */
532         removeDraft: function (element) { },
533 
534         /**
535          * Sets up nodes for rendering a gradient fill.
536          * @param element
537          */
538         setGradient: function (element) { /* stub */ },
539 
540         /**
541          * Updates the gradient fill.
542          * @param {JXG.GeometryElement} element An JSXGraph element with an area that can be filled.
543          */
544         updateGradient: function (element) { /* stub */ },
545 
546         /**
547          * Sets an objects fill color.
548          * @param {JXG.GeometryElement} element Reference of the object that wants a new fill color.
549          * @param {String} color Color in a HTML/CSS compatible format. If you don't want any fill color at all, choose 'none'.
550          * @param {Number} opacity Opacity of the fill color. Must be between 0 and 1.
551          */
552         setObjectFillColor: function (element, color, opacity) { /* stub */ },
553 
554         /**
555          * Changes an objects stroke color to the given color.
556          * @param {JXG.GeometryElement} element Reference of the {@link JXG.GeometryElement} that gets a new stroke color.
557          * @param {String} color Color value in a HTML compatible format, e.g. <strong>#00ff00</strong> or <strong>green</strong> for green.
558          * @param {Number} opacity Opacity of the fill color. Must be between 0 and 1.
559          */
560         setObjectStrokeColor: function (element, color, opacity) { /* stub */ },
561 
562         /**
563          * Sets an element's stroke width.
564          * @param {JXG.GeometryElement} element Reference to the geometry element.
565          * @param {Number} width The new stroke width to be assigned to the element.
566          */
567         setObjectStrokeWidth: function (element, width) { /* stub */ },
568 
569         /**
570          * Sets the shadow properties to a geometry element. This method is only a stub, it is implemented in the actual renderers.
571          * @param {JXG.GeometryElement} element Reference to a geometry object, that should get a shadow
572          */
573         setShadow: function (element) { /* stub */ },
574 
575         /**
576          * Highlights an object, i.e. changes the current colors of the object to its highlighting colors
577          * @param {JXG.GeometryElement} element Reference of the object that will be highlighted.
578          * @returns {JXG.AbstractRenderer} Reference to the renderer
579          */
580         highlight: function (element) { },
581 
582         /**
583          * Uses the normal colors of an object, i.e. the opposite of {@link JXG.AbstractRenderer#highlight}.
584          * @param {JXG.GeometryElement} element Reference of the object that will get its normal colors.
585          * @returns {JXG.AbstractRenderer} Reference to the renderer
586          */
587         noHighlight: function (element) { },
588 
589 
590         /* **************************
591          * renderer control
592          * **************************/
593 
594         /**
595          * Stop redraw. This method is called before every update, so a non-vector-graphics based renderer
596          * can use this method to delete the contents of the drawing panel. This is an abstract method every
597          * descendant renderer should implement, if appropriate.
598          * @see JXG.AbstractRenderer#unsuspendRedraw
599          */
600         suspendRedraw: function () { /* stub */ },
601 
602         /**
603          * Restart redraw. This method is called after updating all the rendering node attributes.
604          * @see JXG.AbstractRenderer#suspendRedraw
605          */
606         unsuspendRedraw: function () { /* stub */ },
607 
608         /**
609          * The tiny zoom bar shown on the bottom of a board (if showNavigation on board creation is true).
610          * @param {JXG.Board} board Reference to a JSXGraph board.
611          */
612         drawZoomBar: function (board) { },
613 
614         /**
615          * Wrapper for getElementById for maybe other renderers which elements are not directly accessible by DOM methods like document.getElementById().
616          * @param {String} id Unique identifier for element.
617          * @returns {Object} Reference to a JavaScript object. In case of SVG/VMLRenderer it's a reference to a SVG/VML node.
618          */
619         getElementById: function (id) {
620             return null;
621         },
622 
623         /**
624          * Resizes the rendering element
625          * @param {Number} w New width
626          * @param {Number} h New height
627          */
628         resize: function (w, h) { /* stub */},
629 
630         removeToInsertLater: function () {
631             return function () {};
632         }
633 
634     });
635 
636     JXG.NoRenderer.prototype = new AbstractRenderer();
637 
638     return JXG.NoRenderer;
639 });
640