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