API reference improvements

13 views
Skip to first unread message

Vlado Z

unread,
Dec 6, 2016, 8:45:03 AM12/6/16
to d3-js
It would also be very useful if we know what each function returns, whether is an object or a primitive value.

For example this explanation about the d3.json() function doesn't give a clue what it returns: https://github.com/d3/d3-request/blob/master/README.md#json

You can use YUIDoc for generating JS documentation.


Mike Bostock

unread,
Dec 6, 2016, 10:02:08 AM12/6/16
to d3-js
Sorry, but I don’t see how the documentation for d3.json is unclear? It explicitly states it creates a request instance, whose methods are documented above in the README:

https://github.com/d3/d3-request/blob/master/README.md#request

Perhaps I should link the word “request” in “creates a new request” to the above link? Or do I need to say “returns” rather than “creates”?
--
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.
For more options, visit https://groups.google.com/d/optout.

Vlado Z

unread,
Dec 6, 2016, 10:19:24 AM12/6/16
to d3-js, mi...@ocks.org
So d3.json() returns object of type d3.request() or?

And d3.request() returns a new asynchronous request, but how does it look like?
Is it like request = {/*request fields*/}; ?

Vlado Z

unread,
Dec 6, 2016, 10:23:44 AM12/6/16
to d3-js
Aham ok, so I guess these properties below are parts of a request object:

Vlado Z

unread,
Dec 6, 2016, 10:25:06 AM12/6/16
to d3-js
And this sort of object is returned from d3.json() as well, am I correct?

Mike Bostock

unread,
Dec 6, 2016, 12:42:34 PM12/6/16
to d3-js
Yes. I have polished the wording in the README to hopefully make this slightly more clear:


On Tue, Dec 6, 2016 at 7:25 AM Vlado Z <vlz...@gmail.com> wrote:
And this sort of object is returned from d3.json() as well, am I correct?

--
Reply all
Reply to author
Forward
0 new messages