Skip to content

Commit edf6e70

Browse files
committed
merging dev files into d3 implementation
2 parents 6596121 + f33ca15 commit edf6e70

File tree

5 files changed

+9
-19
lines changed

5 files changed

+9
-19
lines changed

src/app/components/Chart.jsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import * as d3 from 'd3';
88
import d3Tip from "d3-tip";
99

1010
let root = {};
11-
let duration = 750;
1211
class Chart extends Component {
1312
constructor(props) {
1413
super(props);
@@ -17,15 +16,13 @@ class Chart extends Component {
1716
this.removed3Tree = this.removed3Tree.bind(this);
1817
}
1918
componentDidMount() {
20-
const { snapshot, hierarchy } = this.props;
21-
console.log('initial props', this.props)
19+
const { hierarchy } = this.props;
2220
root = JSON.parse(JSON.stringify(hierarchy));
2321
this.maked3Tree();
2422
}
2523

2624
componentDidUpdate() {
27-
const { snapshot, hierarchy } = this.props;
28-
console.log('updated props', this.props)
25+
const { hierarchy } = this.props;
2926
root = JSON.parse(JSON.stringify(hierarchy));
3027
this.maked3Tree();
3128
}

src/app/components/StateRoute.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const StateRoute = ({ snapshot, hierarchy }) => (
1818
</NavLink>
1919
</div>
2020
<Switch>
21-
<Route path="/chart" render={() => <Chart snapshot={snapshot} hierarchy={hierarchy} />} />
21+
<Route path="/chart" render={() => <Chart hierarchy={hierarchy} />} />
2222
<Route path="/" render={() => <Tree snapshot={snapshot} />} />
2323
</Switch>
2424
</Router>

src/app/containers/MainContainer.jsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ function MainContainer() {
2424
// listen for a message containing snapshots from the background script
2525
port.onMessage.addListener(message => {
2626
const { action, payload, sourceTab } = message;
27-
console.log('action message', action);
28-
console.log('payload message', message)
2927
switch (action) {
3028
case 'deleteTab': {
3129
dispatch(deleteTab(payload));
@@ -68,7 +66,6 @@ function MainContainer() {
6866
);
6967
}
7068
const { viewIndex, sliderIndex, snapshots, hierarchy } = tabs[currentTab];
71-
console.log('main container', tabs[currentTab]);
7269

7370
// if viewIndex is -1, then use the sliderIndex instead
7471
const snapshotView = viewIndex === -1 ? snapshots[sliderIndex] : snapshots[viewIndex];

src/app/containers/StateContainer.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import DiffRoute from '../components/DiffRoute';
88

99

1010
const StateContainer = ({ snapshot, hierarchy }) => {
11-
console.log('passing?', hierarchy);
1211
const [Text, setText] = useState('State');
1312
return (
1413
<Router>

src/extension/background.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function createTabObj(title) {
1111
title,
1212
// snapshots is an array of ALL state snapshots for the reactime tab working on a specific user application
1313
snapshots: [],
14-
index: 0,
14+
index: -1,
1515
//* 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)
1616
currLocation: null,
1717
//* inserting a new property to build out our hierarchy dataset for d3
@@ -68,7 +68,7 @@ chrome.runtime.onConnect.addListener(port => {
6868
if (Object.keys(tabsObj).length > 0) {
6969
port.postMessage({
7070
action: 'initialConnectSnapshots',
71-
payload: { ...tabsObj, msg: 'connection to devgools made' },
71+
payload: tabsObj,
7272
});
7373
}
7474

@@ -104,7 +104,7 @@ chrome.runtime.onConnect.addListener(port => {
104104
// reassigning pointer to the appropriate node to branch off of
105105
tabsObj[tabId].currLocation = tabsObj[tabId].hierarchy;
106106
// reset index
107-
tabsObj[tabId].index = 1;
107+
tabsObj[tabId].index = 0;
108108
return;
109109
case 'setLock':
110110
tabsObj[tabId].mode.locked = payload;
@@ -124,7 +124,6 @@ chrome.runtime.onConnect.addListener(port => {
124124

125125
// background.js recieves message from contentScript.js
126126
chrome.runtime.onMessage.addListener((request, sender) => {
127-
console.log('received request', request);
128127
// IGNORE THE AUTOMATIC MESSAGE SENT BY CHROME WHEN CONTENT SCRIPT IS FIRST LOADED
129128
if (request.type === 'SIGN_CONNECT') return;
130129
const tabTitle = sender.tab.title;
@@ -146,12 +145,10 @@ chrome.runtime.onMessage.addListener((request, sender) => {
146145

147146
switch (action) {
148147
case 'jumpToSnap': {
149-
console.log("im triggered")
150148
changeCurrLocation(tabsObj[tabId], tabsObj[tabId].hierarchy, index);
151149
break;
152150
}
153151
case 'tabReload': {
154-
console.log("tabreload triggered")
155152
tabsObj[tabId].mode.locked = false;
156153
tabsObj[tabId].mode.paused = false;
157154
// dont remove snapshots if persisting
@@ -162,12 +159,12 @@ chrome.runtime.onMessage.addListener((request, sender) => {
162159
// reassigning pointer to the appropriate node to branch off of
163160
tabsObj[tabId].currLocation = tabsObj[tabId].hierarchy;
164161
// reset index
165-
tabsObj[tabId].index = 1;
162+
tabsObj[tabId].index = 0;
166163

167164
// send a message to devtools
168165
portsArr.forEach(bg => bg.postMessage({
169166
action: 'initialConnectSnapshots',
170-
payload: { ...tabsObj, msg: 'reload' },
167+
payload: tabsObj,
171168
}));
172169
}
173170

@@ -189,7 +186,7 @@ chrome.runtime.onMessage.addListener((request, sender) => {
189186
if (portsArr.length > 0) {
190187
portsArr.forEach(bg => bg.postMessage({
191188
action: 'initialConnectSnapshots',
192-
payload: {...tabsObj, msg: 'firstsnapshotreceived'},
189+
payload: tabsObj,
193190
}));
194191
}
195192
break;

0 commit comments

Comments
 (0)