-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path1052028-change-node-rendering.patch
58 lines (49 loc) · 2.18 KB
/
1052028-change-node-rendering.patch
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
From 5dc82c0f6cd691f63f3bb90c21ead857752e8a27 Mon Sep 17 00:00:00 2001
From: Jordan Santell <[email protected]>
Date: Wed, 13 Aug 2014 10:42:49 -0700
Subject: Bug 1052028 - Remove 'Node' from displayed node names in web audio editor. r=vp
---
browser/devtools/webaudioeditor/webaudioeditor-view.js | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/browser/devtools/webaudioeditor/webaudioeditor-view.js b/browser/devtools/webaudioeditor/webaudioeditor-view.js
index 124defe..cbd402d 100644
--- a/browser/devtools/webaudioeditor/webaudioeditor-view.js
+++ b/browser/devtools/webaudioeditor/webaudioeditor-view.js
@@ -151,17 +151,21 @@ let WebAudioGraphView = {
// Clear out previous SVG information
this.clearGraph();
let graph = new dagreD3.Digraph();
let edges = [];
AudioNodes.forEach(node => {
// Add node to graph
- graph.addNode(node.id, { label: node.type, id: node.id });
+ graph.addNode(node.id, {
+ type: node.type, // Just for storing type data
+ label: node.type.replace(/Node$/, ""), // Displayed in SVG node
+ id: node.id // Identification
+ });
// Add all of the connections from this node to the edge array to be added
// after all the nodes are added, otherwise edges will attempted to be created
// for nodes that have not yet been added
AudioNodeConnections.get(node, new Set()).forEach(dest => edges.push([node, dest]));
});
edges.forEach(([node, dest]) => graph.addEdge(null, node.id, dest.id, {
@@ -172,17 +176,17 @@ let WebAudioGraphView = {
let renderer = new dagreD3.Renderer();
// Post-render manipulation of the nodes
let oldDrawNodes = renderer.drawNodes();
renderer.drawNodes(function(graph, root) {
let svgNodes = oldDrawNodes(graph, root);
svgNodes.attr("class", (n) => {
let node = graph.node(n);
- return "audionode type-" + node.label;
+ return "audionode type-" + node.type;
});
svgNodes.attr("data-id", (n) => {
let node = graph.node(n);
return node.id;
});
return svgNodes;
});
--
1.8.4.2