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