To use d3.js methods, Does data need to be in Json format?

30 views
Skip to first unread message

datavisu

unread,
Jan 7, 2017, 6:58:55 PM1/7/17
to d3-js

I am new to js & d3.js. please keep this in mind while reading. Currently i am converting csv data to javascript array using papa parse library rather than inbuilt d3.csv() method.

d3.csv() is converting data to array of objects and many d3 methods like nest() using the key value notation.

How can i use methods like nest() with data in array of arrays format rather than array of objects ?

Reason i am not converting data to json is data is not known before and i cannot take the attributes until the file is parsed.

For instance, accessing values with d.name is not possible for me as data i am accessing is by index value d[0].

I read here, http://learnjsdata.com/getting_started.html, D3's functions for reading data require you be running the page from a server. currently, i am doing visualization from client side with no server involved. Should i use server ?

Thank you for your help,

Seemant Kulleen

unread,
Jan 8, 2017, 2:58:06 AM1/8/17
to d3-js
Hi,

Welcome to d3.js :)  Do you have any example data that you can use to illustrate what you're trying to achieve?

Cheers,
Seemant


--
Oakland Finish Up Weekend
Be Amazed.  Be Amazing.
Get Mentored | Get Inspired | Finish Up
http://oaklandfinishup.com


--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

datavisu

unread,
Jan 8, 2017, 2:37:22 PM1/8/17
to d3-js

Hi seemantk,

yes,  My current data format: http://imgur.com/a/w54Un. where array[46] is array of 46 columns with each containing around 16000 rows of csv file. 

i am tring to plot one column over other column. 

i want to access particular attribute upon user input of csv file. As i donot know the attribute names until user uploads the file, i cannot use d.name rather access with index values. 

Is it possible to use d3 methods without using the notation d.name ?

thank you,
Reply all
Reply to author
Forward
0 new messages