Skip to content

Commit c976cc4

Browse files
committed
Adding source, spec, and built files
1 parent 3d4e24d commit c976cc4

8 files changed

+197
-0
lines changed

crossfilter-ma.js

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*!
2+
* dc 1.0.0-dev
3+
* http://dc-js.github.io/dc.js/
4+
* Copyright 2012 Nick Zhu and other contributors
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
(function() { function _crossfilterMA(d3, crossfilter) {
20+
'use strict';
21+
22+
/**
23+
* crossfilter.ma is a crossfilter group modifier (in reductio-like fashion) to calculate moving averages.
24+
*
25+
* Version: 1.0.0-dev
26+
* Author: Jasmine Hegman
27+
*/
28+
29+
var crossfilterMA = {
30+
version: '1.0.0-dev',
31+
constants: {
32+
CHART_CLASS: 'dc-chart',
33+
DEBUG_GROUP_CLASS: 'debug',
34+
STACK_CLASS: 'stack',
35+
DESELECTED_CLASS: 'deselected',
36+
SELECTED_CLASS: 'selected',
37+
NODE_INDEX_NAME: '__index__',
38+
GROUP_INDEX_NAME: '__group_index__',
39+
DEFAULT_CHART_GROUP: '__default_chart_group__',
40+
EVENT_DELAY: 40,
41+
NEGLIGIBLE_NUMBER: 1e-10
42+
},
43+
_renderlet: null
44+
};
45+
46+
crossfilterMA[ 'crossfilter-ma' ] = function() {
47+
return 'hello world';
48+
};
49+
50+
51+
52+
// Expose d3 and crossfilter, so that clients in browserify
53+
// case can obtain them if they need them.
54+
crossfilterMA.d3 = d3;
55+
crossfilterMA.crossfilter = crossfilter;
56+
57+
return crossfilterMA;}
58+
if(typeof define === "function" && define.amd) {
59+
define(["d3", "crossfilter"], _crossfilterMA);
60+
} else if(typeof module === "object" && module.exports) {
61+
var _d3 = require('d3');
62+
var _crossfilter = require('crossfilter');
63+
// When using npm + browserify, 'crossfilter' is a function,
64+
// since package.json specifies index.js as main function, and it
65+
// does special handling. When using bower + browserify,
66+
// there's no main in bower.json (in fact, there's no bower.json),
67+
// so we need to fix it.
68+
if (typeof _crossfilter !== "function") {
69+
_crossfilter = _crossfilter.crossfilter;
70+
}
71+
module.exports = _crossfilterMA(_d3, _crossfilter);
72+
} else {
73+
this['crossfilter-ma'] = _crossfilterMA(d3, crossfilter);
74+
}
75+
}
76+
)();

crossfilter-ma.min.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crossfilter-ma.min.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Import DC and dependencies
2+
3+
d3 = require("d3");
4+
crossfilter = require("crossfilter");
5+
module.exports = require("./crossfilter-ma");

spec/crossfilter-ma-spec.js

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
describe('crossfilter-ma', function() {
2+
3+
var global,
4+
crossfilterMa;
5+
6+
beforeEach(function() {
7+
global = (function() { return this; })();
8+
crossfilterMa = global['crossfilter-ma'];
9+
});
10+
11+
afterEach(function() {
12+
global = null;
13+
crossfilterMa = null;
14+
});
15+
16+
it('is a function', function() {
17+
18+
var meh = crossfilterMa['crossfilter-ma'];
19+
20+
expect( typeof meh ).toBe( 'function' );
21+
22+
});
23+
24+
it('says hello', function() {
25+
26+
var response = crossfilterMa['crossfilter-ma']();
27+
28+
expect( response ).toBe('hello world');
29+
});
30+
31+
xit('takes a crossfilter group', function() {
32+
33+
});
34+
35+
it('calculates a moving average', function() {
36+
37+
});
38+
39+
});

src/banner.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*!
2+
* dc %VERSION%
3+
* http://dc-js.github.io/dc.js/
4+
* Copyright 2012 Nick Zhu and other contributors
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
(function() { function _crossfilterMA(d3, crossfilter) {
20+
'use strict';

src/crossfilter-ma.js

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* crossfilter.ma is a crossfilter group modifier (in reductio-like fashion) to calculate moving averages.
3+
*
4+
* Version: %VERSION%
5+
* Author: Jasmine Hegman
6+
*/
7+
8+
var crossfilterMA = {
9+
version: '%VERSION%',
10+
constants: {
11+
CHART_CLASS: 'dc-chart',
12+
DEBUG_GROUP_CLASS: 'debug',
13+
STACK_CLASS: 'stack',
14+
DESELECTED_CLASS: 'deselected',
15+
SELECTED_CLASS: 'selected',
16+
NODE_INDEX_NAME: '__index__',
17+
GROUP_INDEX_NAME: '__group_index__',
18+
DEFAULT_CHART_GROUP: '__default_chart_group__',
19+
EVENT_DELAY: 40,
20+
NEGLIGIBLE_NUMBER: 1e-10
21+
},
22+
_renderlet: null
23+
};
24+
25+
crossfilterMA[ 'crossfilter-ma' ] = function() {
26+
return 'hello world';
27+
};

src/footer.js

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
3+
// Expose d3 and crossfilter, so that clients in browserify
4+
// case can obtain them if they need them.
5+
crossfilterMA.d3 = d3;
6+
crossfilterMA.crossfilter = crossfilter;
7+
8+
return crossfilterMA;}
9+
if(typeof define === "function" && define.amd) {
10+
define(["d3", "crossfilter"], _crossfilterMA);
11+
} else if(typeof module === "object" && module.exports) {
12+
var _d3 = require('d3');
13+
var _crossfilter = require('crossfilter');
14+
// When using npm + browserify, 'crossfilter' is a function,
15+
// since package.json specifies index.js as main function, and it
16+
// does special handling. When using bower + browserify,
17+
// there's no main in bower.json (in fact, there's no bower.json),
18+
// so we need to fix it.
19+
if (typeof _crossfilter !== "function") {
20+
_crossfilter = _crossfilter.crossfilter;
21+
}
22+
module.exports = _crossfilterMA(_d3, _crossfilter);
23+
} else {
24+
this['crossfilter-ma'] = _crossfilterMA(d3, crossfilter);
25+
}
26+
}
27+
)();

0 commit comments

Comments
 (0)