Currently, I am utilizing D3.js V4 with the module and my goal is to import multiple modules into a singular namespace. The code snippet provided below showcases my current approach, but I am curious if there is a more efficient method available.
const d3 = Object.assign(
{},
require('d3-axis'),
require('d3-selection'),
require('d3-format')
)
Whenever I require something, I simply use it as shown below:
d3.format('.5s')
// OR
d3.select(something)
I am wondering if there exists a cleaner way to consolidate all imports under a single d3
namespace?