Who did try to insert latest d3.js into tw5?

81 views
Skip to first unread message

kvg0...@gmail.com

unread,
Jan 1, 2019, 4:01:01 PM1/1/19
to TiddlyWiki
I am trying by example demo d3. But latest version not working. It need docomentOwner property to be availabel by parentnode, But tw5 does not provide it to widget render function.

BurningTreeC

unread,
Jan 1, 2019, 4:20:44 PM1/1/19
to TiddlyWiki

I am trying by example demo d3. But latest version not working. It need docomentOwner property to be availabel by parentnode, But tw5 does not provide it to widget render function.

Hi , if I understand you right, you want to access the ownerDocument of the widget's parentNode?

I tried the barwidget's render function. There's "this.parentDomNode = parent" on top. I can access the ownerDocument by this.parentDomNode.ownerDocument without problems. What are you trying, where do you need help?

BTC

BurningTreeC

unread,
Jan 1, 2019, 4:23:35 PM1/1/19
to TiddlyWiki
If you cannot access the parentDomNode, then it may be that on top of your render function "this.parentDomNode = parent;" is missing

... ?

kvg0...@gmail.com

unread,
Jan 1, 2019, 11:50:54 PM1/1/19
to TiddlyWiki
In the demo this code works


.attr("viewBox", "0 0 960 500")
.attr("preserveAspectRatio", "xMinYMin meet")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom);
var svgElement = d3.select(parent).insert("svg",function() {return nextSibling;})

In latest d3.js this code gives ownerDocument is undefined. It is given inside d3.js in function W(t). Arg "parent" does not have such field as ownerDocument but it is needed

среда, 2 января 2019 г., 0:23:35 UTC+3 пользователь BurningTreeC написал:

BurningTreeC

unread,
Jan 2, 2019, 12:56:36 AM1/2/19
to TiddlyWiki

In the demo this code works


.attr("viewBox", "0 0 960 500")
.attr("preserveAspectRatio", "xMinYMin meet")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom);
var svgElement = d3.select(parent).insert("svg",function() {return nextSibling;})

d3.select(this.parentDomNode).insert ... maybe?

kvg0...@gmail.com

unread,
Jan 2, 2019, 1:31:13 AM1/2/19
to tiddl...@googlegroups.com
I just copied code from here https://github.com/Jermolene/TiddlyWiki5/blob/master/plugins/tiddlywiki/d3/cloudwidget.js which works. But I will try yours variant.
UPD
the same result

среда, 2 января 2019 г., 8:56:36 UTC+3 пользователь BurningTreeC написал:
Reply all
Reply to author
Forward
0 new messages