get datatypes using d3

28 views
Skip to first unread message

tge...@gmail.com

unread,
Jul 24, 2016, 9:59:41 PM7/24/16
to d3-js
If my data has many attributes and some of them are numbers, some are strings and some other types of data. Now I want to know which type of data each attribute is, how can I do that?

Fingerling

unread,
Jul 25, 2016, 9:01:26 AM7/25/16
to d3-js
You can use "typeof" to determine the data types for each property.

Curran

unread,
Jul 25, 2016, 11:23:07 AM7/25/16
to d3-js
This is beyond the scope of D3, but there is another great library called Datalib that does type inference on data table attributes for you. I believe the inferAll function will do what you are looking for.

Regards,
Curran

tge...@gmail.com

unread,
Jul 25, 2016, 11:28:25 AM7/25/16
to d3-js
Thanks! I was just thinking what D3 can do, but forgot what js provides...
Reply all
Reply to author
Forward
0 new messages