2

I am exploring dc.js which would provide great feature to my data quality analysis application. But I am getting crazy about how to setup the libraries to get it fully operational:

  • D3 is installed thanks to the d3-rails gem
  • Installation of dc.js with npm install dc simply returns dc@2.1.6 ../../../node_modules/dc, but brings no feature.
  • Referencing dc.js by

    <script src="https://dc-js.github.io/dc.js/js/crossfilter.js" 
    

    et

    <script src="https://dc-js.github.io/dc.js/js/dc.js"></script>
    

generates errors such as d3.time is undefined. (does dc only relies on D3 3.x ?).

Finally, which is the clean, lean recommended way of implementing dc.js ?

Thanks.

user1185081
  • 1,898
  • 2
  • 21
  • 46
  • 1
    As I commented in your other question, there is no one clean lean recommended way of dealing with modules in Javascript - there are lots and lots of solutions and a lot of vehement opinions about them. I agree with @davcs86 that the old way, setting up scripts to copy Javascript files out of `node_modules` into the deployment directory (e.g. with grunt or make), is probably the easiest to grok, even though it requires manual configuration. – Gordon May 29 '17 at 18:46

1 Answers1

1
  1. dc.js is only fully compatible with d3 v3, more info here and here.

  2. IMHO, the easiest way is the old-school one (copy the libraries locally).

    2.1. Cloudflare doesn't provide the up-to-date code since you asks a specific version in the URL (in your case, 2.0.0).

davcs86
  • 3,926
  • 2
  • 18
  • 30