Skip to content

Correct crossfilter2 dependency for AMD usage. #57

@shea-parkes

Description

@shea-parkes

The current ~UMD build doesn't correctly specify the crossfilter2 dependency for AMD style dependencies.

In particular, this is on the first line of the ~compiled reductio.js:

if("function"==typeof define&&define.amd)define([],e)

And then it later tries to load crossfilter via:

var crossfilter = (typeof window !== "undefined" ? window['crossfilter'] : typeof global !== "undefined" ? global['crossfilter'] : null);

I believe the dependency should be properly expressed via something like this:

if("function"==typeof define&&define.amd)define(['crossfilter2'],e)

I'm sure this is all supposed to be handled by the build tools, but their current settings are causing me to have to export crossfilter2 as a global to use in an AMD environment.

For what it's worth, dc.js works well in an AMD environment. Their ~compiled form includes this definition:

if(typeof define === "function" && define.amd) {
        define(["d3", "crossfilter2"], _dc);
    }

I realize this may not be a high priority for you, but I can always hope that it's an easy fix. Or at least I can warn other users (that might still be using an AMD environment).

Thanks for the nice tool. It's working very nicely in a 2-level aggregation scenario with a dc.js solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions