Skip to content

Commit 6d7f2b8

Browse files
committed
coding out helper function to build hierarchy
1 parent d1ece17 commit 6d7f2b8

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/app/components/Chart.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Chart extends Component {
3636

3737
maked3Tree() {
3838
// this.removed3Tree();
39-
const dataset = {
39+
const snapshotHierarchy = {
4040
name: "rootNode",
4141
diffState: {},
4242
children: [
@@ -132,7 +132,7 @@ class Chart extends Component {
132132
let radius = width / 2;
133133

134134
// 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-
let hierarchy = d3.hierarchy(dataset);
135+
let hierarchy = d3.hierarchy(snapshotHierarchy);
136136

137137
let tree = d3.tree()
138138
// this assigns width of tree to be 2pi

src/extension/background.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ function createTabObj(title) {
88
return {
99
title,
1010
snapshots: [],
11+
//* inserting a new property
12+
snapshotHierarchy: {},
1113
mode: {
1214
persist: false,
1315
locked: false,
@@ -16,6 +18,13 @@ function createTabObj(title) {
1618
};
1719
}
1820

21+
function buildHierarchy() {
22+
// if empty is clicked hierarchy needs to be reset to an object
23+
24+
// once state is modified (when user does something with app), a step appears in actionContainer.jsx column
25+
// that current state snapshot is added to our hierarchy object
26+
27+
}
1928
// create a helper function that groups all the snapshots underneath each other
2029
// current state snapshot
2130
// needs to be supplied by the UI
@@ -81,7 +90,7 @@ chrome.runtime.onConnect.addListener(port => {
8190

8291
// background.js recieves message from contentScript.js
8392
chrome.runtime.onMessage.addListener((request, sender) => {
84-
// IGNORE THE AUTOMTAIC MESSAGE SENT BY CHROME WHEN CONTENT SCRIPT IS FIRST LOADED
93+
// IGNORE THE AUTOMATIC MESSAGE SENT BY CHROME WHEN CONTENT SCRIPT IS FIRST LOADED
8594
if (request.type === 'SIGN_CONNECT') return;
8695
const tabTitle = sender.tab.title;
8796
const tabId = sender.tab.id;

0 commit comments

Comments
 (0)