MathBox.js
MathBox.js copied to clipboard
Add support for custom labels
Axes can have numerical labels, but there is a need to display axes names or any custom labels in space with a given style (color, size, but also left,right or centered alignment).
For example, compare this MathBox animation with this video where labels have been added on top of a screengrab of the webpage animation.
I've added experimental label support in my branch of mathbox.js: https://github.com/fourplusone/MathBox.js/tree/feature/labels Syntax is
.label({
position: [x,y,z],
text: "a^3+x"
})
Nice work. That will be definitively helpful. Could you open a pull request on this repository with these changes?
http://lzd.kopeisk.info/math/math2/examples/Empty.html my program is not work :( . Could you help me? please...
Is it possible to add an 'id' field and control the position of the label dynamically?
I tried addind id: 'foo'
to JSON, and I can access and change position, text, etc. fields using mathbox.set("#foo")
, but nothing changes in the box. I looked at the commit and couldn't really figure out if the labels refresh upon change.