Giter VIP home page Giter VIP logo

moodleformulas_jsxgraph's Introduction

JSXGraph

JavaScript library for interactive math visualizations in the web browser.

About

JSXGraph is a cross-browser library for interactive geometry, function plotting, charting, and data visualization in a web browser. It is implemented completely in JavaScript, does not rely on any other library, and uses SVG, canvas, or even the venerable VML. JSXGraph is easy to embed and has a small footprint: approx. 160 KByte if embedded in a web page. No plug-ins are required! Special care has been taken to optimize the performance.

JSXGraph supports multi-touch events and runs on all major browsers, even on very old IEs.

JSXGraph is developed at the Lehrstuhl für Mathematik und ihre Didaktik University of Bayreuth, Germany

Website

<script type="text/javascript" charset="UTF-8"
 src="https://cdn.jsdelivr.net/npm/jsxgraph/distrib/jsxgraphcore.js"></script>
<link rel="stylesheet"
 type="text/css" href="https://cdn.jsdelivr.net/npm/jsxgraph/distrib/jsxgraph.css" />

or

<script type="text/javascript" charset="UTF-8"
 src="//cdnjs.cloudflare.com/ajax/libs/jsxgraph/1.4.6/jsxgraphcore.js"></script>
<link rel="stylesheet"
 type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/jsxgraph/1.4.6/jsxgraph.css" />

Please report bugs to our issue tracking system found at https://github.com/jsxgraph/jsxgraph/issues

Usage

Include

  • jsxgraphcore.js and
  • jsxgraph.css and,
  • if required, one or more file readers

from a CDN or a local version in your HTML file.

HTML template:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>JSXGraph template</title>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
    <link href="https://cdn.jsdelivr.net/npm/jsxgraph/distrib/jsxgraph.css" rel="stylesheet" type="text/css" />
    <script src="https://cdn.jsdelivr.net/npm/jsxgraph/distrib/jsxgraphcore.js" charset="UTF-8"></script>

    <!-- The next line is optional: MathJax -->
    <script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js" id="MathJax-script" async></script>
  </head>
  <body>

  <div id="jxgbox" class="jxgbox" style="max-width:800px; aspect-ratio: 1/1;"></div>

  <script>
    var board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-8, 8, 8, -8]});
    var p = board.create('point', [1, 3], {name: 'point'});
  </script>

  </body>
</html>

For developing content, it is recommended to include jsxgraphsrc.js (jsxgraphcore.js is the minified version of jsxgraphsrc.js). For further usage instructions please consult our wiki especially our tutorials or the API reference docs.

Build and develop JSXGraph

  1. Clone this repository or download the zip file.
  2. To build and develop JSXGraph you need node.js v0.6+. First, install all dependencies required to build JSXGraph using npm in the JSXGraph root directory: $ npm install. This will create a new subdirectory node_modules in the JSXGraph root directory which holds all tools and libraries required to build jsxgraphcore.js.
  3. To build JSXGraph run $ npm run buildCore. This will output an non-minified version jsxgraphsrc.js and the minified version jsxgraphcore.js into the folder distrib.
  4. Develop JSXGraph:
  • Edit the source files in the folder src
  • Write unit tests in folder test
  • Run $ npm run eslint and $ npm run test to check for errors
  • Run $ npm run check-format to check the formatting of the source code
  • Submit a pull request

License

JSXGraph is free software dual licensed under the GNU LGPL or MIT License.

You can redistribute it and/or modify it under the terms of the

  • GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version

or

JSXGraph is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License and the MIT License along with JSXGraph. If not, see https://www.gnu.org/licenses/ and https://opensource.org/licenses/MIT/.

ITEMS Cofunded by the Erasmus+ programme of the European union

moodleformulas_jsxgraph's People

Contributors

alfredwassermann avatar andreas-web avatar

Watchers

 avatar  avatar  avatar

Forkers

ffo-twe

moodleformulas_jsxgraph's Issues

Purpose of method `getAllValues`

I am wondering about the purpose of the method getAllValues.

First, in the README.md, it says that the method is of type {void}, which seems wrong to me as it actually is supposed to return an array of values.

Second, in the given example, it is used as [t1, t2, t3, t4] = question.getAllValues(4, 0);. Should the argument not be an array in order to properly set defaultValues? With this line in place, all initial values [t1, t2, t3, t4] are set to 4.

Third, even when the method is called without any arguments, [t1, t2, t3, t4] are not initialized to [y1, y2, y3, y4] provided in the "Answer" field. (Is this what is meant by "Fetch all values from the formulas input fields."?)

Fourth, what would even be the purpose of initializing [t1, t2, t3, t4] to the correct solutions?

Example question not working for me.

Hello,
I want to use jsxgraph with my formulas type questions using jsxgraph filter. I have installed Moodle on my computer and everything works fine. I tried the example shown here but when I hit preview, I only see the code (from <jsxgraph...> to . I set the plain text editor everywhere (both editor preferences and manage editors). The filter works fine when I try it on content like a page or a label though.
Can you please help me figure out what I did wrong? I watched the videos on youtube and even went on moodle.itemspro.eu, but unfortunately, they did not show how to write a complete question step by step from scratch, but rather how to edit an existing one. I thought the example here would be a good start. I don't know anything about coding and all, but I can follow the instructions on how to get something done (I have installed moodle on my own :-) )
Thank you for your help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.