1 /* 2 Copyright 2008-2022 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 /*eslint no-unused-vars: "off"*/ 36 37 /* depends: 38 jxg 39 renderer/abstract 40 */ 41 42 /** 43 * @fileoverview JSXGraph can use various technologies to render the contents of a construction, e.g. 44 * SVG, VML, and HTML5 Canvas. To accomplish this, The rendering and the logic and control mechanisms 45 * are completely separated from each other. Every rendering technology has it's own class, called 46 * Renderer, e.g. SVGRenderer for SVG, the same for VML and Canvas. The common base for all available 47 * renderers is the class AbstractRenderer. 48 */ 49 50 define(['jxg', 'renderer/abstract'], function (JXG, AbstractRenderer) { 51 52 "use strict"; 53 54 /** 55 * This renderer draws nothing. It is intended to be used in environments where none of our rendering engines 56 * are available, e.g. WebWorkers. All methods are empty. 57 * 58 * @class JXG.NoRenderer 59 * @augments JXG.AbstractRenderer 60 * @see JXG.AbstractRenderer 61 */ 62 JXG.NoRenderer = function () { 63 /** 64 * If this property is set to <tt>true</tt> the visual properties of the elements are updated 65 * on every update. Visual properties means: All the stuff stored in the 66 * {@link JXG.GeometryElement#visProp} property won't be set if enhancedRendering is <tt>false</tt> 67 * @type Boolean 68 * @default true 69 */ 70 this.enhancedRendering = false; 71 72 /** 73 * This is used to easily determine which renderer we are using 74 * @example if (board.renderer.type === 'vml') { 75 * // do something 76 * } 77 * @type String 78 */ 79 this.type = 'no'; 80 }; 81 82 JXG.extend(JXG.NoRenderer.prototype, /** @lends JXG.NoRenderer.prototype */ { 83 /* ******************************** * 84 * Point drawing and updating * 85 * ******************************** */ 86 87 /** 88 * Draws a point on the {@link JXG.Board}. 89 * @param {JXG.Point} element Reference to a {@link JXG.Point} object that has to be drawn. 90 * @see Point 91 * @see JXG.Point 92 * @see JXG.AbstractRenderer#updatePoint 93 * @see JXG.AbstractRenderer#changePointStyle 94 */ 95 drawPoint: function (element) {}, 96 97 /** 98 * Updates visual appearance of the renderer element assigned to the given {@link JXG.Point}. 99 * @param {JXG.Point} element Reference to a {@link JXG.Point} object, that has to be updated. 100 * @see Point 101 * @see JXG.Point 102 * @see JXG.AbstractRenderer#drawPoint 103 * @see JXG.AbstractRenderer#changePointStyle 104 */ 105 updatePoint: function (element) { }, 106 107 /** 108 * Changes the style of a {@link JXG.Point}. This is required because the point styles differ in what 109 * elements have to be drawn, e.g. if the point is marked by a "x" or a "+" two lines are drawn, if 110 * it's marked by spot a circle is drawn. This method removes the old renderer element(s) and creates 111 * the new one(s). 112 * @param {JXG.Point} element Reference to a {@link JXG.Point} object, that's style is changed. 113 * @see Point 114 * @see JXG.Point 115 * @see JXG.AbstractRenderer#updatePoint 116 * @see JXG.AbstractRenderer#drawPoint 117 */ 118 changePointStyle: function (element) { }, 119 120 /* ******************************** * 121 * Lines * 122 * ******************************** */ 123 124 /** 125 * Draws a line on the {@link JXG.Board}. 126 * @param {JXG.Line} element Reference to a line object, that has to be drawn. 127 * @see Line 128 * @see JXG.Line 129 * @see JXG.AbstractRenderer#updateLine 130 */ 131 drawLine: function (element) { }, 132 133 /** 134 * Updates visual appearance of the renderer element assigned to the given {@link JXG.Line}. 135 * @param {JXG.Line} element Reference to the {@link JXG.Line} object that has to be updated. 136 * @see Line 137 * @see JXG.Line 138 * @see JXG.AbstractRenderer#drawLine 139 */ 140 updateLine: function (element) { }, 141 142 /** 143 * Creates a rendering node for ticks added to a line. 144 * @param {JXG.Line} element A arbitrary line. 145 * @see Line 146 * @see Ticks 147 * @see JXG.Line 148 * @see JXG.Ticks 149 * @see JXG.AbstractRenderer#updateTicks 150 */ 151 drawTicks: function (element) { }, 152 153 /** 154 * Update {@link Ticks} on a {@link JXG.Line}. This method is only a stub and has to be implemented 155 * in any descendant renderer class. 156 * @param {JXG.Line} element Reference of an line object, thats ticks have to be updated. 157 * @see Line 158 * @see Ticks 159 * @see JXG.Line 160 * @see JXG.Ticks 161 * @see JXG.AbstractRenderer#drawTicks 162 */ 163 updateTicks: function (element) { /* 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 or hides an 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 * @param {Boolean} value true to show the element, false to hide the element. 496 */ 497 display: function (element, value) { 498 if (element) { 499 element.visPropOld.visible = value; 500 } 501 }, 502 503 /** 504 * Shows a hidden element on the canvas; Only a stub, requires implementation in the derived renderer. 505 * 506 * Please use JXG.AbstractRenderer#display instead 507 * @param {JXG.GeometryElement} element Reference to the object that has to appear. 508 * @see JXG.AbstractRenderer#hide 509 * @deprecated 510 */ 511 show: function (element) { /* stub */ }, 512 513 /** 514 * Hides an element on the canvas; Only a stub, requires implementation in the derived renderer. 515 * 516 * Please use JXG.AbstractRenderer#display instead 517 * @param {JXG.GeometryElement} element Reference to the geometry element that has to disappear. 518 * @see JXG.AbstractRenderer#show 519 * @deprecated 520 */ 521 hide: function (element) { /* stub */ }, 522 523 /** 524 * Sets the buffering as recommended by SVGWG. Until now only Opera supports this and will be ignored by 525 * other browsers. Although this feature is only supported by SVG we have this method in {@link JXG.AbstractRenderer} 526 * because it is called from outside the renderer. 527 * @param {Node} node The SVG DOM Node which buffering type to update. 528 * @param {String} type Either 'auto', 'dynamic', or 'static'. For an explanation see 529 * {@link http://www.w3.org/TR/SVGTiny12/painting.html#BufferedRenderingProperty}. 530 */ 531 setBuffering: function (node, type) { /* stub */ }, 532 533 /** 534 * Sets an element's dash style. 535 * @param {JXG.GeometryElement} element An JSXGraph element. 536 */ 537 setDashStyle: function (element) { /* stub */ }, 538 539 /** 540 * Puts an object into draft mode, i.e. it's visual appearance will be changed. For GEONE<sub>x</sub>T backwards compatibility. 541 * @param {JXG.GeometryElement} element Reference of the object that is in draft mode. 542 */ 543 setDraft: function (element) { }, 544 545 /** 546 * Puts an object from draft mode back into normal mode. 547 * @param {JXG.GeometryElement} element Reference of the object that no longer is in draft mode. 548 */ 549 removeDraft: function (element) { }, 550 551 /** 552 * Sets up nodes for rendering a gradient fill. 553 * @param element 554 */ 555 setGradient: function (element) { /* stub */ }, 556 557 /** 558 * Updates the gradient fill. 559 * @param {JXG.GeometryElement} element An JSXGraph element with an area that can be filled. 560 */ 561 updateGradient: function (element) { /* stub */ }, 562 563 /** 564 * Sets the transition duration (in milliseconds) for fill color and stroke 565 * color and opacity. 566 * @param {JXG.GeometryElement} element Reference of the object that wants a 567 * new transition duration. 568 * @param {Number} duration (Optional) duration in milliseconds. If not given, 569 * element.visProp.transitionDuration is taken. This is the default. 570 */ 571 setObjectTransition: function (element, duration) { /* stub */ }, 572 573 /** 574 * Sets an objects fill color. 575 * @param {JXG.GeometryElement} element Reference of the object that wants a new fill color. 576 * @param {String} color Color in a HTML/CSS compatible format. If you don't want any fill color at all, choose 'none'. 577 * @param {Number} opacity Opacity of the fill color. Must be between 0 and 1. 578 */ 579 setObjectFillColor: function (element, color, opacity) { /* stub */ }, 580 581 /** 582 * Changes an objects stroke color to the given color. 583 * @param {JXG.GeometryElement} element Reference of the {@link JXG.GeometryElement} that gets a new stroke color. 584 * @param {String} color Color value in a HTML compatible format, e.g. <strong>#00ff00</strong> or <strong>green</strong> for green. 585 * @param {Number} opacity Opacity of the fill color. Must be between 0 and 1. 586 */ 587 setObjectStrokeColor: function (element, color, opacity) { /* stub */ }, 588 589 /** 590 * Sets an element's stroke width. 591 * @param {JXG.GeometryElement} element Reference to the geometry element. 592 * @param {Number} width The new stroke width to be assigned to the element. 593 */ 594 setObjectStrokeWidth: function (element, width) { /* stub */ }, 595 596 /** 597 * Sets the shadow properties to a geometry element. This method is only a stub, it is implemented in the actual renderers. 598 * @param {JXG.GeometryElement} element Reference to a geometry object, that should get a shadow 599 */ 600 setShadow: function (element) { /* stub */ }, 601 602 /** 603 * Highlights an object, i.e. changes the current colors of the object to its highlighting colors 604 * @param {JXG.GeometryElement} element Reference of the object that will be highlighted. 605 * @returns {JXG.AbstractRenderer} Reference to the renderer 606 */ 607 highlight: function (element) { }, 608 609 /** 610 * Uses the normal colors of an object, i.e. the opposite of {@link JXG.AbstractRenderer#highlight}. 611 * @param {JXG.GeometryElement} element Reference of the object that will get its normal colors. 612 * @returns {JXG.AbstractRenderer} Reference to the renderer 613 */ 614 noHighlight: function (element) { }, 615 616 617 /* ************************** 618 * renderer control 619 * **************************/ 620 621 /** 622 * Stop redraw. This method is called before every update, so a non-vector-graphics based renderer 623 * can use this method to delete the contents of the drawing panel. This is an abstract method every 624 * descendant renderer should implement, if appropriate. 625 * @see JXG.AbstractRenderer#unsuspendRedraw 626 */ 627 suspendRedraw: function () { /* stub */ }, 628 629 /** 630 * Restart redraw. This method is called after updating all the rendering node attributes. 631 * @see JXG.AbstractRenderer#suspendRedraw 632 */ 633 unsuspendRedraw: function () { /* stub */ }, 634 635 /** 636 * The tiny zoom bar shown on the bottom of a board (if showNavigation on board creation is true). 637 * @param {JXG.Board} board Reference to a JSXGraph board. 638 */ 639 drawZoomBar: function (board) { }, 640 641 /** 642 * Wrapper for getElementById for maybe other renderers which elements are not directly accessible by DOM methods like document.getElementById(). 643 * @param {String} id Unique identifier for element. 644 * @returns {Object} Reference to a JavaScript object. In case of SVG/VMLRenderer it's a reference to a SVG/VML node. 645 */ 646 getElementById: function (id) { 647 return null; 648 }, 649 650 /** 651 * Resizes the rendering element 652 * @param {Number} w New width 653 * @param {Number} h New height 654 */ 655 resize: function (w, h) { /* stub */}, 656 657 removeToInsertLater: function () { 658 return function () {}; 659 } 660 661 }); 662 663 /** 664 * @ignore 665 */ 666 JXG.NoRenderer.prototype = new AbstractRenderer(); 667 668 return JXG.NoRenderer; 669 }); 670