APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

2D Trace in EJsS post and replies

Return to the 2D Trace in EJsS thread
Login to post to this thread

Unable to display marker for 2D trace in EJsS
Spencer Wheaton
6 Posts

Hi there!

I am having trouble displaying a marker in the 2D trace object in javascript. The attached code shows my problem. Am I being silly?

Attached File: TraceTest.zip


Replies to Unable to display marker for 2D trace in EJsS

Re: Unable to display marker for 2D trace in EJsS -
Wolfgang
146 Posts

In the JavaScript version of EjsS, the marker size must be an array with two elements.  Change the Marker Size property to [8,8] to set the width and height of the markers.

Paco and Felix are working on better Element documentation.  But Trace properties are well documented and you can access this documentation by clicking on the small information icon in the upper left hand corner of the Trace inspector.



Re: Re: Unable to display marker for 2D trace in EJsS -
Spencer Wheaton
6 Posts

Dear Wolfgang

Thank you for the earlier reply, but it seems that my problem persists.

I am using addPoint(x,y) in a function that is called by the initialisation page to add points to a trace. It appears that doing this causes EJS to ignore the instruction to draw markers.

If I move the same function that adds the points to the trace inside the evolution, then my problem disappears and the markers are there.

The attached ejss file replicates the problem.

Regards
Spencer

P.S. I can code around this apparent issue, but I would like to understand what I am doing wrong.

Attached File: TraceTest1.zip



Re: Re: Re: Unable to display marker for 2D trace in EJsS -
Francisco Esquembre
228 Posts

Dear Spencer,

You found a very subtle bug in EjsS. (Thanks for this.)

I am working on this right now.

Paco



Re: Re: Re: Unable to display marker for 2D trace in EJsS -
Francisco Esquembre
228 Posts

Dear Spencer,

I was finally able to fix this problem.

A new, experimental EjsS is here: http://fem.um.es/EjsWiki/uploads/Download/EJS_5.1_150125.zip

New official releases will include this fix.

Thanks for reporting the bug!

Paco



Re: Re: Re: Re: Unable to display marker for 2D trace in EJsS -
Spencer Wheaton
6 Posts

Thanks, Paco!



OSP Projects:
Open Source Physics - EJS Modeling
Tracker
Physlet Physics
Physlet Quantum Physics
STP Book