Button to draw new random path

3 views
Skip to first unread message

Alasdair McAndrew

unread,
Apr 19, 2026, 2:05:06 AM (9 days ago) Apr 19
to JSXGraph
Hello,

If I've done this before, I certainly can't remember how (nor track down the relevant file).  Anyway, I'm drawing random grid paths (subject to various constraints), and I want a button which, when pressed, will erase the current path and draw a new one.

I'm assuming that this will require setting the "visible" element of the path to something which is based on the button press.  But I can't quite work out the logic.

If I could be pointed in the direction of an example, I'd be very happy.

Thanks,
Alasdair

Alasdair McAndrew

unread,
Apr 19, 2026, 4:02:29 AM (8 days ago) Apr 19
to JSXGraph
Dammit - I found the answer almost immediately after posting this.  I simply gave a variable name to the polygonal chain which defined the path.  Then the button set the visibility attribute of that path to false, and drew another path.  Couldn't have been simpler or more obvious!

Sorry for wasting time and bandwidth,
Alasdair

Reply all
Reply to author
Forward
0 new messages