Mark Hoffmann
1 min readMay 18, 2018

--

Thanks Elija for putting together all of these resources. I have bought and read the latest version of D3.js In Action and I really enjoyed it as well as learned a lot!

I have a quick question regarding the pattern of allowing React to control the DOM when using something a little more complicated like an axis or anything you would use a .call() extension for when letting D3 take control.

Essentially I’m trying to convert something like this:

select(node)
.selectAll(“svg”)
.data([0])
.enter()
.append(“g”)
.attr(“id”, “xAxisG”)
.call(xAxis)

Into something more along the lines of:

const xAxisPath = xAxis(<g id=”xAxisG” ></g>)

But am getting syntax errors in every permutation I try. (I’m not a frontend developer so sorry if the solution is very straight forward)

I see you do a similar pattern for rects and area charts, which I have been able to recreate just fine, but can’t find anywhere that you include one of these components to draw that requires the .call() functionality.

--

--

Mark Hoffmann
Mark Hoffmann

Written by Mark Hoffmann

AI Engineer — Meta | Previously Chief Architect — Ubiety, AI/ML — NASA Jet Propulsion Lab / DARPA || AI / Software Engineering / Systems

No responses yet