jsxgraph | Interactive Geometry , plotting , visualization , svn repo | Data Visualization library
kandi X-RAY | jsxgraph Summary
kandi X-RAY | jsxgraph Summary
mirror of JSXGraph: Interactive Geometry, plotting, visualization, svn repo: https://jsxgraph.svn.sourceforge.net/svnroot/jsxgraph, see:
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of jsxgraph
jsxgraph Key Features
jsxgraph Examples and Code Snippets
Community Discussions
Trending Discussions on jsxgraph
QUESTION
I want to draw multiple-graphs inside for loop using JSXGraph code. Everthing seems ok, working but when I click a point or a tangent line, they all disappears since they under for loop. What I understood is that I need to put them inside a paint function (and update somewhere) like in Java, but I could not success to find it. What is the proper way to draw persistence multiple graphs using for loop? Thanks. This is my code :
...ANSWER
Answered 2021-Feb-01 at 21:10Your example code is completely correct beside a few subleties regarding let
and var
. The trick is to define i
and m
with let
in the for-loop block that creates the derivative function graphs, but to define the arrays containing the slopes (ms
) and constant values (co
) with var
. The latter makes the arrays persisent and the former is equivalent to define the functions "by hand" like
QUESTION
I have created a Moodle Formulas questions in the field of kinematics with two boards. While I managed to get simpler questions with only one board to work flawlessly, the problem with this question is that the bound values are not inserted into formula's input entry fields. Consequently, the student cannot submit an answer because, effectively, nothing has been filled out. The rest of the question works though, as can be seen when the correct answers are filled in the question's preview.
I provide a Moodle XML file to make it easier to reproduce the problem: questions_formulas_JSXGraph_2boards.xml
You need a current version of Moodle with JSXGraph
filter and question type Formulas
installed.
The main JSXGraph code is this:
...ANSWER
Answered 2020-Dec-15 at 16:40In fact, it is correct that our filter in combination with formulas does not work correctly with multiple boards. At the moment, only one board ID is transferred to the JSXQuestion object and thus and thus it (and formulas) does not know anything about the second board. That is also one of the problems your example raises.
In addition, the boards actually have to be initialized with the JSXQuestion.initBoard() method for the bindInput() method to work. In the end, that's the root problem why your example doesn't work.
I will dedicate myself to this issue after the Christmas holidays and will be releasing a new version of the Moodle filter in January. Maybe there will be something new from JSXGraph by then, too.
Unfortunately, I can't offer you a dirty hack until then, as it requires a few basic changes to the filter.
I hope to be able to tell you more in January. Have a nice Christmas and stay healthy!
Andreas
QUESTION
I would like to have two graphs, a x(t)-graph and a v(t)-graph. Students shall be able to move some points around in the v(t)-graph. At the same time, gliders in the x(t)-graph should be synchronized such that their time coordinates are bound to the points in the v(t)-graph.
I have got most of it working, see jsfiddle. The x(t)-graph, however, only updates when some element in it is touched. But I would like the gliders to move together with the points in the v(t)-graph. Is this possible?
HTML code:
...ANSWER
Answered 2020-Dec-10 at 21:22It suffices to set
QUESTION
I use JSXGraph in Moodle and would like to render text with MathJax. Could someone provide an example of how this can be done? I have tried all kinds of combinations I could think of based on these sources:
https://jsxgraph.org/wiki/index.php/Using_MathJax
https://jsxgraph.org/docs/symbols/Text.html#useMathJax
ANSWER
Answered 2020-Dec-08 at 13:09If you want to use the MathJax filter from Moodle, the order of the filters is important. Here is a link: https://github.com/jsxgraph/moodle-filter_jsxgraph/blob/master/README.md#using-mathjax-within-the-board You can also find an example there.
QUESTION
I tried my best to copy this example here from the JSXGraph website: https://jsxgraph.uni-bayreuth.de/wiki/index.php/Using_CSS_styles
Here's the abbreviated HTML:
...ANSWER
Answered 2020-Nov-09 at 10:24Indeed, the example in the wiki is outdated. The priorities of CSS classes, default CSS styles and JSXGraph are a little bit delicate.Please, have a look at the API docs: https://jsxgraph.org/docs/symbols/Text.html#cssDefaultStyle.
If you want to overwrite font-family, you have to set cssDefaultStyle
to the empty string:
QUESTION
I can see on https://jsxgraph.uni-bayreuth.de/docs/symbols/Integral.html that the value of the integral is displayed as part of the integral object created.
Can someone please tell me how to access this value (or the text object which is displayed as the label)? I did not find this information in the documentation.
I am aware of the similar question: How to access value of integral with JSXGraph?. Please do not mark my question as a duplicate unless you answer that other question. The answer there is not really an answer. It tells how to use numerical integration to find this value (so practically tells to calculate the integral again). It does not tell how to access the value without this redundant calculation. The integral is already calculated and displayed, I would like to know how to access this information without calculating it again.
...ANSWER
Answered 2020-Sep-26 at 19:42There are two ways to access the value of the integral. One is to call the method Value()
of the integral element. The other method is to read from the integral element's label element:
QUESTION
The problem is how to make an arc draggable. hasInnerPoints:true doesn't seem to do the job.
Using a group I can use the centerpoint to drag the arc around while still being able to change the radius and angle.
As you see when executing the script, the straight vectors can be dragged around using the blue line as handle. I want this also for the curved arrows.
...ANSWER
Answered 2020-Sep-21 at 16:02The missing attribute to make arcs draggable is fixed:false
:
QUESTION
I have a JSXGraph project in which I created a point (A) on the x.axis and a line that is perpendicular to the x-axis and runs through (A). When moving (A) the line should follow the point. That worked fine so far.
However at the press of a button I would like to remove the line and the point and free the variables that contained the line and the point.
Here is where my problem lies. After removing the point/line and freeing the variables the update() function still calls the function that was used to define the line, which results in an error, as the variable in the function no longer exists.
Any idea how to solve this problem?
Thanks!
Link to fiddle: https://jsfiddle.net/t9rcva1x/1/
...ANSWER
Answered 2020-Aug-30 at 09:23Indeed, there is a problem with dependencies between objects. If a line is created from two coordinates arrays like
QUESTION
There are several javascript libraries which render svg images on the client side.
Example
Screenshot
It's easy to make a screenshot of the svg image but is it possible to download the image as a svg file from the client side?
A possible workaround
On the server side it is possible, so maybe by downloading the page and modifying the source code (add var svg = new XMLSerializer().serializeToString(board.renderer.svgRoot);
and FileSaverJS) it can be done?! Isn't there an easier solution?
ANSWER
Answered 2020-Jul-29 at 19:30Indeed, new XMLSerializer().serializeToString(board.renderer.svgRoot);
returns the SVG code. Alternatively, JSXGraph offers the method board.renderer.dumpToDataURI(ignoreTexts)
which returns a base64 encoded data URI of the SVG code. If called with the parameter ignoreTexts==false, those JSXGraph elements which are displayed as HTML elements, like some texts, will be enclosed in a foreignObject
tag in the SVG.
So, if you want to use board.renderer.dumpToDataURI
to get SVG source code, you have to base64 decode it like this:
QUESTION
In the default board axes (eg. https://jsfiddle.net/dr63zumf/1/), screenshot and code below, how can I change the thickness or width of the gridlines to make them thicker? There doesn't seem to be an option for this in the documentation.
Thanks,
Rob
...ANSWER
Answered 2020-Apr-28 at 19:39Answering the comment by Rob:
It is not possible to have different widths for minorTicks
and majorTicks
, since internally a ticks-element of one axis is one SVG path. However, there are several workarounds possible:
1) Do not show minorTicks
at all:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install jsxgraph
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page