d3-mitch-tree newbie problem

73 views
Skip to first unread message

Mr C

unread,
Sep 11, 2020, 11:31:26 AM9/11/20
to d3-js
Hi,
I've just started using the d3-mitch-tree library for displaying our data, but I've hit a snag with the text formatting and I'd be very grateful if anyone here could help. The issue is that all whitespace is stripped out from within the text of a textbox, so for example, the following node:

var data = {
    "id":1,
    "name": "AN19CUK051836",
    "type": "Root",
    "status": "Dead",
    "description": "Implanted: 16/08/2020;         Culled: 17/08/2020",
    "children": []
};

would have all white space before "Culled" removed. HTML tags are also stripped, and I can't find anywhere in the library's documentation how to override this behavior. This is making text formatting impossible, but since it's such a core necessity then I must be missing something. I've been through the library's code and found how to force the text to be left justified (rather than the default centred), but even this seems a crude approach since it should be possible to do this via a (undocumented?) API call. Any help with the white space and/or HTML issues would be really appreciated.

Patricia Warwick

unread,
Sep 11, 2020, 12:21:08 PM9/11/20
to d3...@googlegroups.com
This is probably a dumb question but have you tried inserting  ?

--


You received this message because you are subscribed to the Google Groups "d3-js" group.


To unsubscribe from this group and stop receiving emails from it, send an email to d3-js+un...@googlegroups.com.


To view this discussion on the web visit https://groups.google.com/d/msgid/d3-js/8dfc3dc2-5111-4332-9941-521bb9f2c0abn%40googlegroups.com.


--
Patricia
patr...@waremail.ca

I'm charting the federal, provincial and Toronto COVID-19 deaths and cases https://www.waremail.ca/covid-19-charts

Mr C

unread,
Sep 11, 2020, 12:53:29 PM9/11/20
to d3-js
Hi Patricia,

Thanks for your response, but all that does is just echo the raw text "&nbsp;" , whereas something like "<br>" gets stripped out completely.

:-(
Reply all
Reply to author
Forward
0 new messages