Code Monkey home page Code Monkey logo

Comments (3)

rowanc1 avatar rowanc1 commented on September 27, 2024 1

Hey @lrq3000 - I am going to leave it open a bit longer and will close when we make another pass on the docs to address this more specifically. Glad you got it sorted 10min after you posted. :)

I am not sure if you have or not already - but you should signup for iooxa.com. Still in beta, but the editor for this is coming along nicely. You will likely still have to host some of these custom calculators on your own until we fully support all of the open source stuff. But for writing text and the variables, etc. I think it is nicer than raw HTML - and can mix with it. e.g. see about 1.5 min into this: https://www.loom.com/share/19d7bae166d845f783b370c9db02abb1

Would be really excited to get your feedback over there as well. :)

from runtime.

lrq3000 avatar lrq3000 commented on September 27, 2024

AHHHHH I just found that you already implemented this @rowanc1 ! I just needed to use :value instead of value !

Concrete working example:

<script src="https://unpkg.com/@iooxa/article"></script>
<link rel="stylesheet" href="https://unpkg.com/@iooxa/article/dist/iooxa.css">

<div style="display: flex; flex-direction: column">
<r-var name="a" value="1" type="Number"></r-var>
<r-var name="b" value="10" type="Number"></r-var>
<r-var name="c" value="100" type="Number"></r-var>
<r-var name="sum" :value="a+b+c" type="Number"></r-var>
<r-var name="sumsquared" :value="sum**2" type="Number"></r-var>

<r-input label="a" :value="a" :change="{a: parseFloat(value)}"></r-input>
<r-input label="b" :value="b" :change="{b: parseFloat(value)}"></r-input>
<r-input label="c" :value="c" :change="{c: parseFloat(value)}"></r-input>
<r-input label="Sum" :value="sum" :change="{a: value-b-c}"></r-input> <!-- Simply change one variable so that the input sum is correct -->
<r-input label="Sum squared" bind="sumsquared"></r-input>
</div>

THAT IS AWESOME!!! Please close this issue, but I would strongly suggest to add this in the documentation, this is a MAJOR FEATURE to allow for the writing of complex documents with intermediate results/aggregate reactive variables (or maybe it's in the doc and I'm a big dumb dumb and I didn't see it? 😅 ). I will now rewrite my calculator to train myself with this approach :-D

from runtime.

lrq3000 avatar lrq3000 commented on September 27, 2024

Awesome! Thank you very much @rowanc1 ! Honestly I'm convinced you got gold there with this tool, you made a fantastic piece of software! :D

So I have finished rewriting the calculator with reactive variables, it's much more concise and easy to read indeed :-) I also published the examples above but tidied and commented. Please feel free to reuse them as you want!

https://github.com/lrq3000/expexp

Yes I saw iooxa.com was live and I'm excited to try it :D I just didn't come around it yet as I was making this calculator as a test to get accustomed to the new iooxa API :-) I will definitely check it out!

Next also (but not right now) I will try to make an interactive visualization combining iooxa with Brython, I had some code snippet working with ink-components already so I see no reason it wouldn't work with iooxa, and with all the improvements to access variables and reactive variables it should be easier than ever :D I'll let you know when I'll have this example ready & published online!

from runtime.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.