Skip to content

Commit bb9732c

Browse files
committed
resolved merge conflicts
2 parents 3d8e98d + a2b5286 commit bb9732c

File tree

10 files changed

+59
-28
lines changed

10 files changed

+59
-28
lines changed

src/app/components/Action.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const Action = props => {
1818
dispatch(changeView(index));
1919
}}
2020
role="presentation"
21-
style={index > sliderIndex ? { color: '#5f6369' } : {}}
21+
style={index >= sliderIndex ? { color: '#5f6369' } : {}}
2222
tabIndex={index}
2323
>
2424
<div className="action-component-text">

src/app/components/Chart.jsx

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
import React, { Component } from 'react';
1515
import * as d3 from 'd3';
1616

17+
const colors = ['#2C4870','#519331','#AA5039','#8B2F5F','#C5B738','#858DFF', '#FF8D02','#FFCD51','#ACDAE6','#FC997E','#CF93AD','#AA3939','#AA6C39','#226666',]
18+
1719
let root = {};
1820
class Chart extends Component {
1921
constructor(props) {
@@ -25,14 +27,12 @@ class Chart extends Component {
2527

2628
componentDidMount() {
2729
const { hierarchy } = this.props;
28-
// console.log('this is hierarchy on didMount chart', hierarchy)
2930
root = JSON.parse(JSON.stringify(hierarchy));
3031
this.maked3Tree();
3132
}
3233

3334
componentDidUpdate() {
3435
const { hierarchy } = this.props;
35-
// console.log('this is hierarchy on didUpdate chart', hierarchy)
3636
root = JSON.parse(JSON.stringify(hierarchy));
3737
this.maked3Tree();
3838
}
@@ -54,7 +54,6 @@ class Chart extends Component {
5454
};
5555
const width = 600 - margin.right - margin.left;
5656
const height = 700 - margin.top - margin.bottom;
57-
// console.log('this is this.chartRef.current on chart', this.chartRef.current)
5857
const chartContainer = d3.select(this.chartRef.current)
5958
.append('svg') // chartContainer is now pointing to svg
6059
.attr('width', width)
@@ -92,7 +91,6 @@ class Chart extends Component {
9291
.attr('class', 'link')
9392
.attr('d', d3.linkRadial()
9493
.angle(d => {
95-
console.log('d on line 92 chart', d)
9694
return d.x
9795
})
9896
.radius(d => d.y));
@@ -102,10 +100,23 @@ class Chart extends Component {
102100
.data(d3root.descendants())
103101
.enter()
104102
.append('g')
105-
// assigning class to the node based on whether node has children or not
106-
.attr('class', function (d) {
107-
return 'node' + (d.children ? ' node--internal' : ' node--leaf');
103+
.style('fill', function (d) {
104+
if(d.data.branch < colors.length){
105+
return colors[d.data.branch]
106+
} else {
107+
let indexColors = d.data.branch - colors.length;
108+
while(indexColors > colors.length){
109+
indexColors = indexColors - colors.length;
110+
}
111+
return colors[indexColors]
112+
}
108113
})
114+
.attr('class', 'node--internal')
115+
// })
116+
// assigning class to the node based on whether node has children or not
117+
// .attr('class', function (d) {
118+
// return 'node' + (d.children ? ' node--internal' : ' node--leaf');
119+
// })
109120
.attr('transform', function (d) {
110121
return 'translate(' + reinfeldTidierAlgo(d.x, d.y) + ')';
111122
});
@@ -151,8 +162,6 @@ class Chart extends Component {
151162
// this arranges the angle of the text
152163
.attr('transform', function (d) { return 'rotate(' + (d.x < Math.PI ? d.x - Math.PI / 2 : d.x + Math.PI / 2) * 1 / Math.PI + ')'; })
153164
.text(function (d) {
154-
// console.log('this is d from text char line 148', d)
155-
// save d.data.index to variable
156165
// gabi and nate :: display the name of of specific patch
157166
return `${d.data.name}.${d.data.branch}`;
158167
});

src/app/containers/ActionContainer.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,16 @@ function ActionContainer() {
3838
});
3939
}
4040
}
41+
<<<<<<< HEAD
4142
};
4243
// gabi :: the hierarchy get set on the first click in the page, when page in refreshed we don't have a hierarchy so we need to check if hierarchy was inicialize involk displayArray to display the hierarchy
4344
if (hierarchy) displayArray(hierarchy);
4445
// console.log('this is hierarchyArr', hierarchyArr)
46+
=======
47+
}
48+
// gabi :: the hierarchy get set on the first click in the page, when page in refreshed we don't have a hierarchy so we need to check if hierarchy was inicialize involk displayArray to display the hierarchy
49+
if (hierarchy) displayArray(hierarchy)
50+
>>>>>>> master
4551

4652
// Edwin: handles keyboard presses, function passes an event and index of each action-component
4753
function handleOnKeyDown(e, i) {

src/app/containers/MainContainer.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,22 @@ import { useStoreContext } from '../store';
1313
function MainContainer() {
1414
const [store, dispatch] = useStoreContext();
1515
const { tabs, currentTab, port: currentPort } = store;
16-
// console.log('entered MainContainer');
1716

1817
// add event listeners to background script
1918
useEffect(() => {
2019
// only open port once
2120
if (currentPort) return;
2221
// open connection with background script
23-
// console.log('opening connection with background script');
2422
const port = chrome.runtime.connect();
25-
// console.log('connection opened?');
2623

2724
// listen for a message containing snapshots from the background script
2825
port.onMessage.addListener(message => {
29-
// console.log('this is message from port', message)
3026
const { action, payload, sourceTab } = message;
27+
let maxTab
28+
if(!sourceTab){
29+
let tabsArray = Object.keys(payload)
30+
maxTab = Math.max(...tabsArray)
31+
}
3132
switch (action) {
3233
case 'deleteTab': {
3334
dispatch(deleteTab(payload));
@@ -44,8 +45,8 @@ function MainContainer() {
4445
break;
4546
}
4647
case 'initialConnectSnapshots': {
48+
dispatch(setTab(maxTab));
4749
dispatch(initialConnect(payload));
48-
dispatch(setTab(sourceTab));
4950
break;
5051
}
5152
default:

src/app/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ import ReactDOM from 'react-dom';
44
import App from './components/App';
55
import './styles/main.scss';
66

7-
console.log('entered index.js, rendering App')
87
ReactDOM.render(<App />, document.getElementById('root'));

src/app/reducers/mainReducer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ export default (state, action) => produce(state, draft => {
214214
break;
215215
}
216216
case types.SET_TAB: {
217-
// console.log('this is SET_TAB action.payload', action.payload)
218217
if (typeof action.payload === 'number') {
219218
draft.currentTab = action.payload;
220219
break;

src/app/styles/components/d3graph.css

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,43 @@ body {
66

77
.node {
88
cursor: pointer;
9+
fill-opacity: 0.8;
910
}
1011

1112
/* this represents leaf nodes aka nodes with no children */
12-
.node circle {
13+
/* .node circle {
1314
fill: #5249f7;
14-
}
15+
} */
1516

1617
/* .node circle:hover {
1718
fill: #320a5c;
1819
} */
1920

2021
.node text {
22+
fill: #fae6e4;
2123
font-size: 10px;
2224
font-family: "Overpass Mono", monospace;
2325
}
2426

2527

2628
/* this represents text for leaf nodes aka the ones with no children */
27-
.node--leaf {
29+
/* .node--leaf {
2830
fill: #71e9e1;
2931
fill-opacity: 0.8;
30-
}
32+
} */
3133

3234
/* this represents those nodes that have children */
33-
.node--internal circle {
35+
/* .node--internal circle {
3436
fill: #d317c9;
35-
}
37+
} */
3638
/* modifies text of parent nodes (has children) */
3739
.node--internal text {
38-
fill: #fae6e4;
40+
fill: white;
3941
font-size: 10px;
4042
}
4143
.link {
4244
fill: none;
43-
stroke: #3853ea;
45+
stroke:#fae6e4;;
4446
stroke-opacity: 0.4;
4547
stroke-width: 3px;
4648
}

src/extension/background.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const reloaded = {};
99
const firstSnapshotReceived = {};
1010
// there will be the same number of objects in here as there are reactime tabs open for each user application being worked on
1111
const tabsObj = {};
12-
console.log('entered background.js');
1312

1413
function createTabObj(title) {
1514
// update tabsObj
@@ -53,8 +52,11 @@ class Node {
5352
this.branch = tabObj.currBranch;
5453
this.stateSnapshot = obj;
5554
this.children = [];
55+
<<<<<<< HEAD
5656
//console.log('created node in background.js constructor');
5757
//console.log('tabsObj is: ', tabsObj);
58+
=======
59+
>>>>>>> master
5860
}
5961
}
6062

@@ -153,7 +155,13 @@ chrome.runtime.onConnect.addListener(port => {
153155
// gabi :: reset snapshots to page last state recorded
154156
tabsObj[tabId].snapshots = [tabsObj[tabId].snapshots[tabsObj[tabId].snapshots.length - 1] ];
155157
// gabi :: record hierarchy of page initial state
158+
<<<<<<< HEAD
156159
tabsObj[tabId].initialHierarchy = { ...tabsObj[tabId].hierarchy, children: [] };
160+
=======
161+
// tabsObj[tabId].initialHierarchy = {...tabsObj[tabId].hierarchy};
162+
// tabsObj[tabId].initialHierarchy.children = [];
163+
tabsObj[tabId].initialHierarchy = {...tabsObj[tabId].hierarchy, children: []};
164+
>>>>>>> master
157165
// gabi :: reset hierarchy
158166
tabsObj[tabId].hierarchy.children = [];
159167
// gabi :: reset hierarchy to page last state recorded
@@ -187,10 +195,16 @@ chrome.runtime.onConnect.addListener(port => {
187195
// background.js recieves message from contentScript.js
188196
chrome.runtime.onMessage.addListener((request, sender) => {
189197
// IGNORE THE AUTOMATIC MESSAGE SENT BY CHROME WHEN CONTENT SCRIPT IS FIRST LOADED
198+
<<<<<<< HEAD
190199
if (request.type === 'SIGN_CONNECT') {
191200
console.log('in SIGN_CONNECT');
192201
return true;
193202
};
203+
=======
204+
if (request.type === 'SIGN_CONNECT'){
205+
return true;
206+
}
207+
>>>>>>> master
194208
const tabTitle = sender.tab.title;
195209
const tabId = sender.tab.id;
196210
const { action, index, name } = request;
@@ -337,7 +351,10 @@ chrome.tabs.onRemoved.addListener(tabId => {
337351
// when tab is view change, put the tabid as the current tab
338352
chrome.tabs.onActivated.addListener(info => {
339353
// tell devtools which tab to be the current
354+
<<<<<<< HEAD
340355
console.log('this is info.tabId from chrome.tabs.onActivated.addListener', info);
356+
=======
357+
>>>>>>> master
341358
if (portsArr.length > 0) {
342359
portsArr.forEach(bg =>
343360
bg.postMessage({

src/extension/build/devtools.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
console.log('devtools.js, creating panel');
21
chrome.devtools.panels.create('Reactime', null, 'panel.html', () => {});

src/extension/contentScript.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,4 @@ chrome.runtime.onMessage.addListener(request => { // seems to never fire
4040
return true; // attempt to fix port closing console error
4141
});
4242

43-
console.log('sending contentScriptStarted message to window');
4443
window.postMessage({ action: 'contentScriptStarted' });

0 commit comments

Comments
 (0)