Refactor archematics to use JSXGraph for geometry constructions #80
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: glen/archematics#80
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Ultimately this should be a wholesale replacement; but for now, just have it replace the 3D constructions, since that's where the needed work in JSXGraph is, and also, that lets the worst parts of GeoGebra be removed.
OK, there is now a stub for this in branch jsx3d. However, the current difficulty with that branch is if you build and install the built browser plugin, and visit http://aleph0.clarku.edu/~djoyce/java/elements/bookXI/defXI9.html, the diagram grows without bound (in terms of the area it takes up on the page) and excessive CPU use occurs. One possibility Aaron and I discussed is that it's somehow trying to display the points that are placed way off screen, so I will comment out the line of code where points are actually inserted into the view3D.
@Vectornaut it turns out that even with the point creation code commented out, we still get the same behavior. I will try not creating a View3D.
OK, still get the expansion without a View3D, just it happens much more quickly and doesn't use anywhere near as much CPU. I have a hunch it may be due to the zoom controls; I will check that out.
No, that wasn't it. In fact, I have it pared down now so that the only JSXGraph function ever called by the plugin is
JSXGraph.initBoard(divID)
, with all default attributes, and it still grows without bound. Very strange! I pushed a commit with it pared down like this, in case you want to take a look. Any ideas?In most of the JSXGraph examples, the board div's styling includes something like
width: 500px; height: 500px; float: left
. If I use the Firefox inspector to add those properties to thejoyceApplet0
orjoyceApplet1
table data cell indefXI9.html
, the cell immediately stops expanding, and it takes on fixed dimensions slightly larger than the ones specified in the CSS.Removing the
width
orheight
property makes the cell starts expanding again along the dimension that's no longer specified. Removing thefloat
property, or setting its value outside a certain good set (which includesleft
,right
,inline-start
,inline-end
, but does not includenone
,unset
), causes the cell to start expanding along both dimensions.I'd like to see what happens if we make the canvas container a div rather than a table data cell, since every working example I've seen uses a div. Let me know if you try this, or if you have any tips on how to try it.
I forgot to mention: there's at least one JSXGraph example,
checkbox.html
, that doesn't set thefloat
property on the canvas div. That means there's still some unexplained difference between the working JSXGraph examples and the failing archematics examples, beyond thewidth
,height
,float
styling.The problem is using a table data cell as the canvas container! Here's a small demo. As written, the page puts a board in the green table data cell named
'td-box'
. This causes the cell to grow without bound.If you change the argument of
initBoard
to'div-box'
, board is placed in the blue div calleddiv-box
instead. Once the board is initialized, the div stays at a fixed size, as expected.exploding.html
Nice work! This sounds like a bug in JSXGraph. I will look to see if you have reported it; if not, I will create a JS Fiddle using your example and file an issue. Also, it seems like this Gitea server is not emailing notifications; I will try to look at the settings for that. Thanks so much!