Maths Graphs?

311 views
Skip to first unread message

Ste Wilson

unread,
Jun 11, 2019, 1:27:16 PM6/11/19
to TiddlyWiki
I've just had a quick look through Dave's awesome curation bit.ly/tiddlytools for a graphing tool to let me do say y=sin x and get a nice graph but didn't spot anything.

Has any one done anything?

I don't suppose https://latex2js.com/ or http://www.jsgraph.org/ would be easy to pluginify?

Ste

Ste Wilson

unread,
Jun 14, 2019, 4:59:15 AM6/14/19
to TiddlyWiki
Think this might be in the blast from the past category but I think this might do what I want!

https://github.com/gt6796c/graph-tw5

Ste Wilson

unread,
Jun 14, 2019, 5:05:15 AM6/14/19
to TiddlyWiki

Mohammad

unread,
Jun 14, 2019, 6:02:12 AM6/14/19
to TiddlyWiki
This is amazing! Small and smart!!

On Friday, June 14, 2019 at 1:35:15 PM UTC+4:30, Ste Wilson wrote:
See also

https://gt6796c.github.io/

@TiddlyTweeter

unread,
Jun 14, 2019, 12:42:49 PM6/14/19
to TiddlyWiki
On Friday, 14 June 2019 10:59:15 UTC+2, Ste Wilson wrote:
Think this might be in the blast from the past category but I think this might do what I want!

https://github.com/gt6796c/graph-tw5


Its a super achievement in integrating JS libraries. Very elegant. I think its more in the "Gadzooks Batman! Category."


On Friday, 14 June 2019 12:02:12 UTC+2, Mohammad wrote:
This is amazing! Small and smart!!
 
Truly is. 

When it came out it didn't get much notice, which was a shame. 

The Mermaid diagramming part is incredibly flexible. It has a slight problem with text scaling in some cases.

Ste Wilson

unread,
Jun 15, 2019, 5:28:38 AM6/15/19
to TiddlyWiki
Dave or other tool maps peeps.. I think they should be added to the list!

bimlas

unread,
Jun 17, 2019, 7:59:45 AM6/17/19
to TiddlyWiki
Very useful plugin, thanks!

With a hidden option, we can even display data tiddlers:

- Create a new tiddler, name it "Coords" and set type to JSON data (application/json)
- Set the content to "[[3,2],[4,1],[2,5]]"
- Create another tiddler with the content

<$graph>
$tw.wiki.getTiddlerData("Coords")
1/x
Math.sin(x)
</$graph>

The first line causing the magic: it gets the (black) points from "Coords" data tiddler (the other lines are not needed, I just want to show that the `$tw.wiki...` is a same Javascript line as the others).

2019. június 14., péntek 11:05:15 UTC+2 időpontban Ste Wilson a következőt írta:
See also

https://gt6796c.github.io/

Ste Wilson

unread,
Apr 23, 2020, 10:48:11 AM4/23/20
to TiddlyWiki
Don't know why I didn't look at your thing before bimlas!  Thats very useful!
Would that method be extendable to say a range slider for say changing a variable....(drams of sliders and real time graph changes)..

bimlas

unread,
Apr 24, 2020, 6:27:10 AM4/24/20
to TiddlyWiki

Ste Wilson,

This solution works, but there are several bugs with it:

<$range tiddler="RangeDemo" min="0" max="10" default="5" increment=".01"/> {{RangeDemo}}

<$graph color='blue' thickness='1' minX="0" minY="-6" maxY="6" equation="
Math.sin(x) * parseFloat($tw.wiki.getTiddlerText('RangeDemo'))
"></$graph>


  • It can only display one function (equation parameter) because if you enter the statement between the <graph> tags, it will not work for some reason.
  • If you modify the slider, the graph will not change, but you will need to close and reopen the tiddler.

bimlas

unread,
Apr 24, 2020, 7:02:05 AM4/24/20
to TiddlyWiki
Ste Wilson,

You may be also interested in this:

http://graphs.tiddlyspot.com/

Note: I have no experience with this.

Ste Wilson

unread,
Apr 24, 2020, 11:40:55 AM4/24/20
to TiddlyWiki
:D with bugs...that's still pretty damm good!

Thanks!

Going onto and out of edit mode refreshes it too..must be able to get a button for that..

Thanks again.

Ste

bimlas

unread,
Apr 27, 2020, 2:48:32 AM4/27/20
to TiddlyWiki
You are right:

<$range tiddler="RangeDemo" min="0" max="10" default="5" increment=".01"/> {{RangeDemo}}

<$list filter="[{RangeDemo}]">

  <$graph color='blue' thickness='1' minX="0" minY="-6" maxY="6" equation="
    Math.sin(x) * parseFloat($tw.wiki.getTiddlerText('RangeDemo'))
  "></$graph>
</$list>


If the value changes, it refreshing the graph.

Ste Wilson

unread,
Apr 27, 2020, 5:20:28 AM4/27/20
to TiddlyWiki
You are AMAZING!!!  Thank you!!!!
Reply all
Reply to author
Forward
0 new messages