tlienart / JSXGraph.jl

[wip] Julia bridge to JSXGraph for interactive plots
Other
17 stars 2 forks source link

segment added #7

Open caseykneale opened 4 years ago

caseykneale commented 4 years ago

So... This probably isn't exactly what you want syntax-wise. But I did my best. I think at least the skeleton of what I wrote should be okay. Not sure what unit tests to add (I don't know JS!)

But I got a simple example of the form:

using JSXGraph
b = board("brd", xlim=[-2,2], ylim=[-2,2])
b ++ point(-1, 0, name="hello")
b ++ point(1, 0, name="world")
b ++ segment("hello", "world", name="segment")

to work at least.

tlienart commented 4 years ago

Hey thanks for giving this a stab!! especially when there's 0 documentation and the code is probably not very clear at this point...

So I believe that both ends of a segment should have similar properties as a Point where a and b would be subtybe of this FR (which is a union type of <:Real and <:JSFun).

Indeed you should be able to assign the value of the end of a segment to a slider for instance.

You could give this a shot, otherwise I'll have a shot sometimes this week from your PR :-)

caseykneale commented 4 years ago

I don't have time to do this today, but maybe around wed I can take another try. I did think about making FR support another type, but realized it was a little risky of a move to do not knowing the code so well. Actually your code is pretty well documented, seen far far worse.

codecov-io commented 3 years ago

Codecov Report

Merging #7 (8a98daf) into master (8c52976) will decrease coverage by 2.47%. The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #7      +/-   ##
==========================================
- Coverage   78.94%   76.47%   -2.48%     
==========================================
  Files           9        9              
  Lines         152      153       +1     
==========================================
- Hits          120      117       -3     
- Misses         32       36       +4     
Impacted Files Coverage Δ
src/JSXGraph.jl 80.00% <ø> (ø)
src/objects/geom.jl 46.66% <0.00%> (-40.84%) :arrow_down:
src/jsfun.jl 92.59% <0.00%> (-3.84%) :arrow_down:
src/objects/curves.jl 100.00% <0.00%> (ø)
src/objects/extras.jl 0.00% <0.00%> (ø)
src/display.jl 35.00% <0.00%> (+1.66%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8c52976...8a98daf. Read the comment docs.