Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript Realtime Render?

    So, I was wondering if the following is possible..


    I want to use MathML or maybe javascript graphics and essentially create a real-time math preview. So I want to have a text box where you insert your source code, and I want the preview box to update automatically.

    For example, say I want the preview box to refresh every time the user enters a space character. Is there a way to get only the new source code entered to render in the preview box without having to re-render the entire preview every time?

    For example, if a user types 2x^3, I want the math equivalent to show up in the preview window. If a user then types in " + 2x" I want just the " + 2x" part to be drawn right next to the already-drawn "2x^3".

    Is this possible? Or is the only way to re-render the entire preview every time the user types in a new term? I would like to only change what the user has edited. If a user edits the middle of the math, then I have no choice and have to re-render everything after what the user has just edited, but when the user is editing the math at the very end, can I not just tag it on to the end and render just that little piece?

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    Are you talking about what is essentially a graphing calculator????

    If that's the case, then y=2x^3 versus y=2x^3 + 2x are two very different graphs. I don't see how it makes sense to say
    I want just the " + 2x" part to be drawn right next to the already-drawn "2x^3"
    If you aren't talking about drawing graphs, then how *DO* you want to display the "math"??

  • #3
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,184
    Thanks
    10
    Thanked 569 Times in 550 Posts
    just render the whole thing each time; it shouldn't take that long...
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/1/19) IE7:0.2, IE8:6.7, IE11:7.4, IE9:3.8, IE10:4.4, FF:18.3, CH:43.6, SF:7.8, MOBILE:27.5


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •