Jump to content
We've recently updated our Privacy Statement, available here ×

Changing Custom Visualization Component Method Signatures?


genuinesmile29

Recommended Posts

I'm trying to build a custom visualization component that uses d3 and nv.d3 (a chart library build on top of d3). Below is my build.js file:

({
    baseUrl: '',
    paths: {
'd3': 'd3.min',
'nvd3': 'nv.d3.min',
'SpectrumBarChart': 'SpectrumBarChart'
    },
    name: "SpectrumBarChart",
    out: "SpectrumBarChart.min.js"
})

Insice my CVC's js file we have this format taken from the Wiki:

define(['d3'], function (d3) { return function (instanceData) { //code goes here }; });

I need to pull in the nv.ds object so I can utilize the library but I'm not sure how to go about it. I think I understand how to express teh dependencies but how can I pull extra arguments into the function:? This doesn't work:

define(['d3', 'nvd3'], function (d3, nvd3) { return function (instanceData) { d3.doStuff(); nvd3.doStuff(); //code goes here }; });

Link to comment
Share on other sites

  • 9 months later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...