MathBox.js icon indicating copy to clipboard operation
MathBox.js copied to clipboard

Add support for custom labels

Open steren opened this issue 11 years ago • 4 comments

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.

steren avatar Dec 08 '13 23:12 steren

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"
})

fourplusone avatar Feb 03 '14 07:02 fourplusone

Nice work. That will be definitively helpful. Could you open a pull request on this repository with these changes?

steren avatar Feb 03 '14 15:02 steren

http://lzd.kopeisk.info/math/math2/examples/Empty.html my program is not work :( . Could you help me? please...

Jeegliputh avatar Mar 24 '14 14:03 Jeegliputh

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.

yugo-ren avatar Feb 14 '15 23:02 yugo-ren