Re: [tw] [TW5] How to make transcluded /generated with macro data tiddlers as JSONTiddlers?

2016-04-22 Thread Jeremy Ruston
Hi Martian

Just to expand on Mario’s answer: the D3 plugin is little more than a tech demo 
to show how a third party library can be integrated with TiddlyWiki. In 
particular, the way that data is passed to it doesn’t easily permit the data to 
be created dynamically. I agree that the best way forwards for your use case is 
likely to involve improving the D3 widget itself.

Best wishes

Jeremy

> On 22 Apr 2016, at 13:11, PMario  wrote:
> 
> On Friday, April 22, 2016 at 12:34:51 PM UTC+2, Martian wrote:
> I am playing with D3 plugin examples 
> .
> 
> ok
>  
> my idea was to create a tiddlers with Title and Text = city names and add 
> field "size". I tagged these tiddlers with tag "Cities"
> 
> then I created a tiddler "toJSON" with macro as in 
> $:/core/templates/exporters/JsonFile
> 
> \define renderContent()
> <$text text=<>/>
> \end
> <>
> 
> 
> good idea and imo you are at the right way. But it seems the <$d3cloud> 
> widget has a very exact idea, how the data has to be presented. ... I had a 
> very fast look at the code. So it seems the data parameter can only handle 
> tiddlers with the type application/json. I thought it would be more flexible 
> and also allows a "json formatted text stream". ... It doesn't :/
>  
> then tried to use these tiddler "toJSON" as source for D3 macros as 
> This is a demo of TiddlyWiki5 incorporating a plugin for the [[D3.js]] 
> visualization library.
> 
> ! Word Cloud
> 
> <$d3cloud data="toJSON" spiral={{$:/spiral}}/>
> 
> but it doesn't work because [[toJSON]] don't have "application/json". 
> 
> But then I manually copied [[toJSON]] content to tiddler [[toJSON2]] typed 
> with "application/json" and put it into data="toJSON2" to $d3cloud - then it 
> works ok and showed me Word Cloud.
> 
> Yea. That's the workflow it would need. You need to create a button, that 
> uses the output of <> and creates a new 
> tiddler type application/json that can be fed into the widget. So no "one 
> click" but a "two click" solution and a bit cumbersome. if you modify the 
> "city" tiddlers or create a new on, you'll also need to create a new "data 
> set" the the $d3cloud widget can understand. That's sub-optimal. 
> 
> IMO the better way would be to extend the widget, so it can be called like 
> this:
> 
> <$d3cloud data=<> spiral={{$:/spiral}}/>
> 
> -
> 
> The problem is, that I don't have a fast solution. 
> 
> The button to create a data tiddler that works looks like this: 
> 
> 
> <$button>
> <$action-sendmessage $message="tm-new-tiddler" title="citiesCloudData" 
> type="application/json" text=<>/>
> createCouldData
> 
> 
> 
> Some remarks: 
> 
> I would use city as a tag for a city and not the plural. It just looks 
> stange. (most of the time my tags are lower case. So I can remember how to 
> write them :) 
> 
> And I would rewrite the d3cloud widget. It seems the examples are the minimum 
> required functionality to show something. .. Imo they are there to show, how 
> the library can be used. The widgets are very simple examples and imo not 
> production ready. 
> 
> have fun!
> Mario
> 
> 
> 
> -- 
> 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 tiddlywiki+unsubscr...@googlegroups.com 
> .
> To post to this group, send email to tiddlywiki@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/tiddlywiki 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/2243e137-da57-49ad-9020-6437be89c1b5%40googlegroups.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/792D11C1-31AA-4554-A770-A5665FA06601%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[tw] [TW5] How to make transcluded /generated with macro data tiddlers as JSONTiddlers?

2016-04-21 Thread Martian
Hello!
As I understand, to be able to get {{##datafield}} a tiddler have to be 
marked as 'application/json' type.

But since I mark a tiddler with this type then neither transclude {{}} nor 
macros <<>> is not working inside it.
And I am going to generate JSON content with a  macro. 

Is there any way to turn tiddler with macro/transclude content into 
JSONTiddler ?

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/42595ba6-10a7-4320-8255-6ad9b9c3411a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.