Yesss !
I'm so happy it works
Thank you so much for giving the solution and also for all the details that
contribute to leverage my coding skill.
I can go on improving my plugin now...
Nicolas
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
Silverfox, I've tested both variants and they both work.
This is your widget with my changes:
/*\
title: $:/plugins/tiddlywiki/d3/CirclePackWidget.js
D3.js version: V5 plugin
type: application/javascript
module-type: widget
A widget for displaying Zoomable Circle Packing. Derived from
... I use "invokeActionString" if I pass actions to the widget from within
a tiddler like
<$mywidget actions="<$action-dosomething/>"/>
... and dispatchEvent() if I want to do what you're trying to accomplish.
just look at the widget.js tiddler. all the prototype functions are
accessible from
alternativelly, as I've looked at d3circlepackclick.js now where you
have: monAction = "<$action-navigate $to='" +d.data.name +"'/>";
you can use:
self.invokeActionString(monAction,self,d,null);
instead of dispatchEvent() if you have an action string like your
"monAction"
--
You received
I don't know if this works out-of-the-box but I'd try:
//this on top:
var self = this;
//here your code
//more code
//then this
.on("dblclick",function(d){
var targetTiddler = d.data.name;
self.dispatchEvent({type: "tm-navigate", navigateTo: targetTiddler)});
});
dispatchEvent() is defined
... From within your clicclic function you can also:
self.dispatchEvent({type: "tm-navigate", navigateTo: targetTiddler)});
--
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
Hi Silverfox,
I think there are different ways one can accomplish what you want to do.
First, I think "this.invokeActions(...)" in your code should be
"self.invokeActions(...)" and you should define a variable: var self = this
on top of the scope:
YourWidget.prototype.render =
Wahoo... thank you but honestly I'm a bit lost...
On Sunday, May 13, 2018 at 2:01:44 PM UTC+2, Jed Carty wrote:
>
> Now that I am looking at what I did with SnapSVG it isn't as simple as I
> had remembered.
>
> The simplest way would be to make a widget based on the button widget, for
> the
Now that I am looking at what I did with SnapSVG it isn't as simple as I
had remembered.
The simplest way would be to make a widget based on the button widget, for
the snapsvg plugin I made I created a new widget for it that was more
general.
Unfortunately neither of those is quick and both
My skills are definitely too limited...
Here is what I've done :
D3 double click entent activates a "cliclic" function
in this function I wrote :
> function cliclic(targetTiddler) {
// alert("node " + targetTiddler + " was double clicked");
Look at the handler inside the button widget for an example.
https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/widgets/button.js
or you can look at the invokeActions and invokeActionString in widget.js
starting on line 513
I'm still looking at a solution to make it work... but I'm stuck for many
days with it
There are actually 2 different actions systems I don't know how to connect.
D3 has it own event detector with instruction like this one:
> .on("dblclick",function(d){ cliclic(d.data.name); });
and
12 matches
Mail list logo