I am working on converting the widgets in my MathyThing plugin to 
action-widgets so they don't violate the rule about modifying tiddlers by 
being rendered.
I would still like to have a version that updates whenever one of the 
inputs changes the way the non-action widgets I have made currently work, 
so I am working on making a daemon that will run in the background and 
update the outputs whenever an input changes. 

The part I am wondering about is if anyone has suggestions on how to 
express the equations you want evaluated. My current idea is to use a 
configuration tiddler to define tags that indicate that a tiddler has 
equations that should be evaluated in it and how they should be evaluated, 
each one of the tagged tiddlers would only contain equations or parameters 
for a function to be evaluated. The expressions in these tiddlers are 
parsed by the daemon and evaluated based on their tags, updating the output 
whenever an input changes.

I am not sure how the equations should be expressed. 

The most straight forward way for simple equations would probably be 
something like this:

'TiddlerName1!!field_name1'='TiddlerName2!!field_name2'+'TiddlerName3!!field_name3'*10;

Where each line defines a different equation and the expressions use normal 
math symbols. This has the advantage of being simple and straightforward to 
use and it uses inputs that are consistent with the rest of tiddlywiki.

Often I think that people will want to be able to say 'sum all the values 
in field foo of all the tiddlers returned by this filter', which is what 
the sumfield widget in MathyThing currently does, but when converted to a 
daemon the widget input syntax isn't available. I have a working version 
that, instead of taking arguments like a widget, uses fields to take inputs 
(a filter to return a list of tiddlers, the field in each tiddler to sum 
and the field and tiddler to store the output in). This is unwieldy, but it 
works.

This could probably be done by having each operation be defined in its own 
data tiddler that is tagged to indicate that it should be this sort of sum 
and with the text field containing 'attribute name:input value' pairs like 
this (Using the inputs for the sumfield widget for this example 
http://inmysocks.tiddlyspot.com/#MathyThing%20-%20sumfield%20Widget)

Filter:<<somefilter>>
SumField1:some_field
SumField2:some_other_field
StoreTiddler:SomeTiddler
StoreField:yet_another_field

which could then be taken by the daemon to calculate the desired result. 
Hopefully the index values would be able to be text references so that more 
complex operations could be done.

That is what I am currently trying to make, does anyone have any 
suggestions on a better way to give the inputs? Does this seem reasonable? 
I think that the most difficult part would be the parsing for the simple 
equations.

I don't currently have any examples of the daemon working in a wiki, but 
sumfield-daemon.js shows some basic code for the new version of sumfield. I 
am trying to get a good idea of what the end result should be before 
putting too much effort into it.

Current MathyThing plugin: 
http://inmysocks.tiddlyspot.com/#MathyThing%20Plugin

Github link: https://github.com/inmysocks/TW5-MathyThing

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Reply via email to