[TW5] - Help creating macro / widget for an existing javascript tool

92 views
Skip to first unread message

Ankit Mittal

unread,
Jul 23, 2019, 7:46:11 AM7/23/19
to TiddlyWikiDev
I am trying but with no joy to include the following javascript library on tiddlywiki with the hope of passing the json to be used by it included on another tiddler and then passing that tiddler in this javascript as a parameter to generate the gantt. Any changes done on the gantt then are on orginal solution sent back to backend but here can be saved to the tiddler with json in it.


To explain more clearly what I am trying to achieve:

1. Create a tiddler "ganttdata" with json
2. Create a new tiddler "ganttdisplay" that calls the macro / widget for the above gantt tool which expects a tiddler as parameter ("ganttdata" in this example)
3. The "ganttdisplay" then displays the gantt and as per the tool is editable and any edits made on it can then be saved back to "ganttdata" tiddler.

After a bit of hair pulling I have come to realise I don't have the smarts to make this happen and was hoping someone can help me get started on this hence the cry for help here.

Thanks in advance for any help that might come this way. :)

PMario

unread,
Jul 23, 2019, 10:25:11 AM7/23/19
to TiddlyWikiDev
Hi,

jQuery and TiddlyWiki 5 won't work well together, because they follow fundamentally different philosophies.

jQuery manipulates the DOM and uses it, to store prgramm state.

TiddlyWiki manipulates the wiki store, which triggers a "change" event. Every widget listens to this event and updates the DOM if needed. Doing so it will remove the jQuery state.

So I doubt, that you will be happy with a jquery plugin.

-m


PMario

unread,
Jul 23, 2019, 10:56:11 AM7/23/19
to TiddlyWikiDev
Hi,
I did have a short look about other js gantt libraries. .. There are several of them. .. I think it would be easier to get going with one of them.


It still would be quite some work to do, but at least jQuery won't step on your foot all the time.

-m

Ankit Mittal

unread,
Jul 24, 2019, 7:28:17 AM7/24/19
to tiddly...@googlegroups.com
Thanks for this. Yeah I could possibly use this one if it is easier to implement... although not quite sure how to proceed even on this one. Do I create a javascript tiddler and then use macro to pass the tiddler with json? Any example of similar javascript implemented in TW that you could point me to will be immensely helpful.

Walt Ludwick

unread,
Jun 2, 2021, 7:04:20 AM6/2/21
to TiddlyWikiDev
Hey @ank.m... Long time no action in this discussion thread, but i'm curious: Have you managed to get something working that satisfies your need? 
It was via this more recent discussion thread in the TW Users group that i learned of the vis.js Timeline plugin, and that is what brought me here... 
But as elaborated in that other thread, there be some issues w/r/t that vis.js solution, while that js library Mario pointed out above is way better from usability perspective, IMHO... 
So if there be any way to implement that as a TW plugin, i would love to hear all about it! 
?

/walt

Walt Ludwick

unread,
Jun 2, 2021, 7:04:43 AM6/2/21
to TiddlyWikiDev
Hey Mario: Following your pointer to that "Open Source Javascript Gantt" library, I have to say that this is the slickest implementation of interactive Gantt chart functionality i've been able to find anywhere.  
That's me speaking from naive user perspective, of course... But i would be very curious to hear from developer perspective, what lies behind your "quite some work to do" disclaimer. 
I ask because i am now having to consider a monthly subscription to some "ransomware," mainly to enjoy such functionality... But before jumping into that boat, i'd like to know if it could be implemented as a TW plugin, and if so, what would be involved (however roughly speaking) in terms of development effort. 
Any insight would be most appreciated!

/walt
Reply all
Reply to author
Forward
0 new messages