This repository has been archived by the owner on Oct 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
109 lines (93 loc) · 2.45 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
'use strict';
const UnwatchedDir = require('broccoli-source').UnwatchedDir;
const mergeTrees = require('broccoli-merge-trees');
const funnel = require('broccoli-funnel');
const path = require('path');
let d3Node;
let d3TipNode;
let dcNode;
let dcAddonsNode;
let crossfilterNode;
module.exports = {
name: require('./package').name,
included() {
this._super(...arguments);
d3Node = new UnwatchedDir(path.dirname(require.resolve('d3')));
d3TipNode = new UnwatchedDir(path.dirname(require.resolve('d3-tip')));
dcNode = new UnwatchedDir(path.dirname(require.resolve('dc')));
dcAddonsNode = new UnwatchedDir(path.dirname(require.resolve('dc-addons-bubble-chart')));
crossfilterNode = new UnwatchedDir(path.dirname(require.resolve('crossfilter')));
this.importDependencies();
},
importDependencies() {
this.import(
{
development: 'vendor/d3/d3.js',
production: 'vendor/d3/d3.min.js'
},
{
prepend: true
}
);
this.import(
{
development: 'vendor/crossfilter/crossfilter.js',
production: 'vendor/crossfilter/crossfilter.min.js'
},
{
prepend: true
}
);
this.import(
{
development: 'vendor/dc/dc.js',
production: 'vendor/dc/dc.min.js'
}
);
this.import('vendor/shims/d3-shim.js');
this.import('vendor/shims/dc-shim.js');
this.import('vendor/shims/crossfilter-shim.js');
this.import('vendor/d3-tip/index.js');
this.import('vendor/dc-addons-bubble-chart/dc-bubble-cloud.js');
},
treeForVendor() {
let trees = [];
trees.push(
funnel(path.join(__dirname, 'vendor', 'shims'), {
destDir: path.join('shims'),
files: ['dc-shim.js', 'd3-shim.js', 'crossfilter-shim.js']
})
);
trees.push(
funnel(d3Node, {
destDir: 'd3',
files: ['d3.js', 'd3.min.js']
})
);
trees.push(
funnel(d3TipNode, {
destDir: 'd3-tip',
files: ['index.js']
})
);
trees.push(
funnel(dcNode, {
destDir: 'dc',
files: ['dc.js', 'dc.min.js', 'dc.js.map']
})
);
trees.push(
funnel(dcAddonsNode, {
destDir: 'dc-addons-bubble-chart',
files: ['dc-bubble-cloud.js']
})
);
trees.push(
funnel(crossfilterNode, {
destDir: 'crossfilter',
files: ['crossfilter.js', 'crossfilter.min.js']
})
);
return mergeTrees(trees);
}
};