Skip to content

Commit 9e3ca14

Browse files
committed
more upgrades
1 parent de44ea4 commit 9e3ca14

File tree

8 files changed

+2810
-1228
lines changed

8 files changed

+2810
-1228
lines changed

app/components/basic-tree.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
import Ember from 'ember';
22

3-
// Import the D3 packages we want to use
4-
import { select, event } from 'd3-selection';
5-
import { cluster, hierarchy } from 'd3-hierarchy';
6-
import { zoom, zoomIdentity } from 'd3-zoom';
3+
const {
4+
select,
5+
partition,
6+
hierarchy,
7+
min,
8+
max,
9+
range,
10+
scaleLinear,
11+
scaleQuantize,
12+
cluster,
13+
zoom,
14+
zoomIdentity
15+
} = self.d3;
716

817
const { run, get, inject } = Ember;
918

@@ -12,7 +21,7 @@ const DURATION = 500;
1221
// The offset amount (in px) from the left or right side of a node
1322
// box to offset lines between nodes, so the lines don't come right
1423
// up to the edge of the box.
15-
const NODE_OFFSET_SIZE = 50;
24+
const NODE_OFFSET_SIZE = 50;
1625

1726
// copied these functions temporarily from `broccoli-viz` here:
1827
// https://github.com/ember-cli/broccoli-viz/blob/master/lib/node-by-id.js
@@ -120,7 +129,7 @@ export default Ember.Component.extend({
120129
// for debugging
121130
self.root = root;
122131

123-
// Create the graph. The nodeSize() is [8,280] (width, height) because we
132+
// Create the graph. The nodeSize() is [8,280] (width, height) because we
124133
// want to change the orientation of the graph from top-down to left-right.
125134
// To do that we reverse X and Y for calculations and translations.
126135
let graph = cluster()
@@ -177,7 +186,7 @@ export default Ember.Component.extend({
177186
.style('fill', "#fff");
178187

179188
// Draw a box in a separate color for the first line as
180-
// a 'title'.
189+
// a 'title'.
181190
nodeEnter.append("rect")
182191
.attr('x', 0)
183192
.attr('y', '-2em')
@@ -258,7 +267,7 @@ export default Ember.Component.extend({
258267
.attr("d", function(d) {
259268
let sourceExitY = d.source.y + d.source.computedWidth + NODE_OFFSET_SIZE;
260269
let targetEntranceY = d.target.y - NODE_OFFSET_SIZE;
261-
270+
262271
return "M" + d.target.y + "," + d.target.x
263272
+ "L" + targetEntranceY + "," + d.target.x
264273
+ " " + sourceExitY + "," + d.target.x

app/components/slow-node-times.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export default Ember.Component.extend({
8585
}, {});
8686

8787
nodes = [];
88-
88+
8989
for (let pluginName in pluginNameMap) {
9090
nodes.push({
9191
groupedByPluginName: true,
@@ -112,7 +112,7 @@ export default Ember.Component.extend({
112112
// off the label as the plugin name. If not, we need
113113
// to create a map of the plugin names and return that.
114114
let pluginNames = [];
115-
115+
116116
if (nodes[0].groupedByPluginName === true) {
117117
pluginNames = nodes.map(node => node.label.name);
118118
} else {

app/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
{{content-for "head"}}
1111

12+
<script src="https://d3js.org/d3.v5.js"></script>
1213
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
1314
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/heimdalljs-visualizer.css">
1415

app/templates/components/slow-node-times.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
{{#if pluginNameFilter}}
1313
<option value="clearFilter">Clear Filter</option>
1414
{{/if}}
15-
</select>
15+
</select>
1616
</p>
1717
</div>
1818

app/utils/d3-flame-graphs-v4/d3-flame-graph.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
import { select, event } from 'd3-selection';
2-
import { scaleLinear, scaleQuantize } from 'd3-scale';
3-
import { min, max, range } from 'd3-array';
1+
const {
2+
select,
3+
event,
4+
partition,
5+
hierarchy,
6+
min,
7+
max,
8+
range,
9+
scaleLinear,
10+
scaleQuantize
11+
} = self.d3;
412
import d3Tip from 'd3-tip';
5-
import { partition, hierarchy } from 'd3-hierarchy';
6-
import 'd3-transition';
713

814
function getClassAndMethodName(fqdn) {
915
if (!fqdn) {

ember-cli-build.js

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,39 @@
1-
/*jshint node:true*/
2-
/* global require, module */
3-
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
4-
var MergeTrees = require('broccoli-merge-trees');
5-
var path = require('path');
6-
var Funnel = require('broccoli-funnel');
1+
'use strict';
2+
3+
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
4+
const MergeTrees = require('broccoli-merge-trees');
5+
const path = require('path');
6+
const Funnel = require('broccoli-funnel');
7+
8+
function resolveDirname(file) {
9+
return path.dirname(require.resolve(file));
10+
}
11+
12+
function npm(file, options) {
13+
return new Funnel(resolveDirname(file), {
14+
...options,
15+
})
16+
}
717

818
module.exports = function(defaults) {
9-
var flameTree = new Funnel(path.dirname(require.resolve('d3-flame-graphs/dist/d3-flame-graph.js')), {
19+
const flameTree = npm('d3-flame-graphs/dist/d3-flame-graph.js', {
1020
files: ['d3-flame-graph.js', 'd3-flame-graph.css'],
1121
destDir: 'd3-flame-graphs'
1222
});
1323

14-
var tipTree = new Funnel(path.dirname(require.resolve('d3-tip/index.js')), {
24+
const tipTree = npm('d3-tip/index.js', {
1525
files: ['index.js'],
1626
destDir: 'd3-tip'
1727
});
1828

19-
var app = new EmberApp(defaults, {
29+
const app = new EmberApp(defaults, {
2030
// Add options here
2131
vendorFiles: {
2232
'jquery.js': null
2333
},
2434
trees: {
2535
vendor: new MergeTrees([
26-
'node_modules/heimdalljs-graph',
27-
'node_modules/bulma',
36+
resolveDirname('bulma'),
2837
tipTree,
2938
flameTree,
3039
], { overwrite: true })
@@ -44,11 +53,9 @@ module.exports = function(defaults) {
4453
// please specify an object with the list of modules as keys
4554
// along with the exports of each module as its value.
4655

47-
app.import('vendor/dist/amd/heimdalljs-graph.js');
48-
49-
// app.import('vendor/d3-flame-graphs/d3-flame-graph.js', { using: [{ transformation: 'amd', as: 'd3-flame-graph' }] });
56+
app.import('vendor/d3-flame-graphs/d3-flame-graph.js', { using: [{ transformation: 'amd', as: 'd3-flame-graph' }] });
5057
app.import('vendor/d3-flame-graphs/d3-flame-graph.css');
51-
app.import('vendor/d3-tip/index.js', { using: [{ transformation: 'amd', as: 'd3-tip' }] });
58+
// app.import('vendor/d3-tip/index.js', { using: [{ transformation: 'amd', as: 'd3-tip' }] });
5259
app.import('vendor/css/bulma.css');
5360
return app.toTree();
5461
};

package.json

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
},
1919
"devDependencies": {
2020
"broccoli-asset-rev": "^3.0.0",
21-
"d3": "^4.9.0",
2221
"d3-tip": "github:vlascik/d3-tip#fix-offscreen-tooltips",
23-
"ember-cli": "^2.16.2",
22+
"ember-auto-import": "^1.2.20",
23+
"ember-cli": "^3.7.1",
2424
"ember-cli-app-version": "^3.2.0",
2525
"ember-cli-babel": "^7.4.2",
2626
"ember-cli-dependency-checker": "^3.1.0",
@@ -35,24 +35,28 @@
3535
"ember-cli-test-loader": "^2.2.0",
3636
"ember-load-initializers": "^2.0.0",
3737
"ember-resolver": "^5.1.1",
38-
"ember-source": "^2.16.2",
38+
"ember-source": "^3.7.1",
3939
"loader.js": "^4.7.0"
4040
},
4141
"engines": {
42-
"node": ">= 4"
42+
"node": ">= 10"
4343
},
4444
"private": true,
4545
"dependencies": {
4646
"broccoli-merge-trees": "^3.0.2",
4747
"bulma": "^0.3.1",
48+
"d3-array": "^2.0.3",
4849
"d3-flame-graphs": "^3.1.0",
49-
"ember-cli-babili": "^0.2.0",
50-
"ember-d3": "^0.3.2",
50+
"d3-hierarchy": "^1.1.8",
51+
"d3-scale": "^2.2.2",
52+
"d3-selection": "^1.4.0",
53+
"d3-transition": "^1.2.0",
54+
"d3-zoom": "^1.7.3",
5155
"ember-fetch": "^6.4.0",
5256
"ember-font-awesome": "^4.0.0-alpha.14",
53-
"ember-native-dom-event-dispatcher": "^0.6.3",
54-
"ember-truth-helpers": "^2.0.0",
55-
"heimdalljs-graph": "^0.3.5"
57+
"ember-native-dom-event-dispatcher": "^0.6.4",
58+
"ember-truth-helpers": "^2.1.0",
59+
"heimdalljs-graph": "^1.0.0"
5660
},
5761
"bugs": {
5862
"url": "https://github.com/rwjblue/heimdalljs-visualizer/issues"

0 commit comments

Comments
 (0)