You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// if we consider the container for our radial node graph as a box encapsulating, half of this container width is essentially the radius of our radial node graph
123
+
124
+
// if we consider the container for our radial node graph as a box encapsulating, half of this container width is essentially the radius of our radial node graph
132
125
letradius=width/2;
133
126
134
127
// d3.hierarchy constructs a root node from the specified hierarchical data (our object titled dataset), which must be an object representing the root node
135
-
lethierarchy=d3.hierarchy(snapshotHierarchy);
128
+
lethierarchy=d3.hierarchy(root);
136
129
137
130
lettree=d3.tree()
138
131
// this assigns width of tree to be 2pi
139
132
.size([2*Math.PI,radius])
140
133
141
-
letroot=tree(hierarchy);
134
+
letd3root=tree(hierarchy);
142
135
143
-
console.log('children',root.descendants());
136
+
console.log('children',d3root.descendants());
144
137
145
138
g.selectAll('.link')
146
139
// root.links() gets an array of all the links, where each element is an object containing a source property, which represents the link's source node, and a target property, which represents the link's target node.
147
-
.data(root.links())
140
+
.data(d3root.links())
148
141
.enter()
149
142
.append('path')
150
143
.attr('class','link')
151
144
.attr("d",d3.linkRadial()
152
145
.angle(d=>d.x)
153
146
.radius(d=>d.y));
154
-
147
+
155
148
letnode=g.selectAll(".node")
156
149
// root.descendants gets an array of of all nodes
157
-
.data(root.descendants())
150
+
.data(d3root.descendants())
158
151
.enter()
159
152
.append("g")
160
153
.attr("class",function(d){
@@ -167,7 +160,8 @@ class Chart extends Component {
167
160
node.append("circle")
168
161
.attr("r",5.5)
169
162
170
-
node.append("text")
163
+
node
164
+
.append("text")
171
165
.attr("dy","0.1em")
172
166
.attr("x",function(d){
173
167
// this positions how far the text is from leaf nodes (ones without children)
@@ -177,7 +171,7 @@ class Chart extends Component {
Copy file name to clipboardExpand all lines: src/extension/background.js
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ function createTabObj(title) {
12
12
// snapshots is an array of ALL state snapshots for the reactime tab working on a specific user application
13
13
snapshots: [],
14
14
//* this is our pointer so we know what the current state the user is checking (this accounts for time travel aka when user clicks jump on the UI)
15
-
currentStatePointer: null,
15
+
currLocation: null,
16
16
//* inserting a new property to build out our hierarchy dataset for d3
17
17
hierarchy: null,
18
18
mode: {
@@ -64,18 +64,18 @@ function changeCurrLocation(tabObj, currNode, index) {
64
64
}
65
65
66
66
//! once state is modified (when user does something with app), a step appears in actionContainer.jsx column. That current state snapshot is added to our hierarchy object. That is what the buildHierarchy function is for. It takes in the entire tabObj, which has a hierarcy object as a property within it. Then we build this hierarchy object so that d3 can render graphs in our extension
67
-
// whenever we receive a snapshot from contentScript.js via message, we execute this function
68
-
//* if empty on extension UI is clicked hierarchy needs to be reset to an object
69
-
70
-
// each time a statesnapshot is added, this gets incremented otherwise it will be decremented
71
-
// we need to find a way to traverse through the object to know which node the user is on so we can add a new state snapshot in the right location
67
+
// whenever we receive a snapshot from contentScript.js via message, we execute this function
68
+
//* if empty on extension UI is clicked hierarchy needs to be reset to an object
69
+
70
+
// each time a statesnapshot is added, this gets incremented otherwise it will be decremented
71
+
// we need to find a way to traverse through the object to know which node the user is on so we can add a new state snapshot in the right location
72
72
// could we potentially have a variable in timejump function (timeJump.js in the package) that our function can work with --> contentScript.js has access to it --> we can access that variable message;
73
73
74
-
// create a helper function that groups all the snapshots underneath each other
75
-
// current state snapshot
76
-
// needs to be supplied by the UI
77
-
// also need to figure out how we would traverse through the big ass object to find the current state
78
-
// Create a new object with name,
74
+
// create a helper function that groups all the snapshots underneath each other
75
+
// current state snapshot
76
+
// needs to be supplied by the UI
77
+
// also need to figure out how we would traverse through the big ass object to find the current state
0 commit comments