Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reactive notebook Button/Input #135

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kungfooman
Copy link
Contributor

I enjoy the new notebook feature and I would like to introduce an addition:

// make it a notebook
notebook()

var i = 100;
var j = 200;
var k = 300;
var str = 'hai';

// use markdown with latex (escape backslashes!!)
md(`# Welcome !\nNotebooks with $\\LaTeX$`)

md(() => `$i = ${i}$`);
md(() => `$j = ${j}$`);
md(() => `$k = ${k}$`);
md(() => `$str = ${str}$`);

var button_i = Button("i++", () => i++);
var button_j = Button("j++", () => j++);
var button_k = Button("k++", () => k++);

var input = Input(str, newValue => str = newValue);

// Interleave with ganja.js graphs.
Algebra(2,0,1,()=>this.graph([1e1,1e2]));

This could makes it feel more like Ganja examples and it looks like this:

reactiveNotebook

Feedback very welcome, a demo (with more code, because PR is not merged): https://enkimute.github.io/ganja.js/examples/coffeeshop.html#IOmRNwGSa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant