Skip to content

Commit 39a60c2

Browse files
caitlinchan23Nkmailind-taniartviner
committed
fixed link when no react app found, commented out some console logs
Co-authored-by: Nkmai <[email protected]> Co-authored-by: lind-tania <[email protected]> Co-authored-by: rtviner <[email protected]> Co-authored-by: caitlinchan23 <[email protected]>
2 parents e319002 + f4bd354 commit 39a60c2

File tree

9 files changed

+41
-70
lines changed

9 files changed

+41
-70
lines changed

src/app/components/ComponentMap.tsx

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ interface TreeNode {
2929

3030
type HierarchyNode = HierarchyPointNode<TreeNode>;
3131

32-
const defaultMargin = { top: 30, left: 30, right: 30, bottom: 70 };
32+
const defaultMargin = { top: 30, left: 30, right: 55, bottom: 70 };
3333

3434
export type LinkTypesProps = {
3535
width: number;
@@ -118,16 +118,22 @@ export default function ComponentMap({
118118
key={i}
119119
data={link}
120120
percent={stepPercent}
121-
// stroke='rgb(254,110,158,0.6)'
122121
stroke='#ff6569'
123122
strokeWidth='1'
124123
fill='none'
125124
/>
126125
))}
127126

128127
{tree.descendants().map((node, key) => {
129-
const width = 55;
130-
const height = 20;
128+
// const width = (node.data.name.length) + 70;
129+
const widthFunc = (name) => {
130+
let nodeLength = name.length;
131+
if (nodeLength < 5) return nodeLength + 40;
132+
if (nodeLength < 10) return nodeLength + 60;
133+
return nodeLength + 70;
134+
}
135+
const width = widthFunc(node.data.name);
136+
const height = 25;
131137

132138
let top: number;
133139
let left: number;
@@ -149,7 +155,7 @@ export default function ComponentMap({
149155
<circle
150156
r={12}
151157
fill="url('#links-gradient')"
152-
stroke="#e7e7e7"
158+
stroke="#ff6569"
153159
onClick={() => {
154160
node.data.isExpanded = !node.data.isExpanded;
155161
// console.log(node);
@@ -164,11 +170,11 @@ export default function ComponentMap({
164170
width={width}
165171
y={-height / 2}
166172
x={-width / 2}
167-
fill='#272b4d'
168-
stroke={node.children ? '#62d6fb' : '#F5F47E'}
173+
fill= {node.children ? '#161521' : '#62d6fb'}
174+
stroke={node.children ? '#62d6fb' : '#161521'}
169175
strokeWidth={1}
170176
strokeDasharray={node.children ? '0' : '2,2'}
171-
strokeOpacity={node.children ? 1 : 0.6}
177+
strokeOpazcity='1'
172178
rx={node.children ? 4 : 10}
173179
onClick={() => {
174180
node.data.isExpanded = !node.data.isExpanded;
@@ -194,16 +200,16 @@ export default function ComponentMap({
194200
{/* Display text inside of each component node */}
195201
<text
196202
dy='.33em'
197-
fontSize={9}
203+
fontSize={10}
198204
fontFamily='Roboto'
199205
textAnchor='middle'
200206
style={{ pointerEvents: 'none' }}
201207
fill={
202208
node.depth === 0
203-
? '#71248e'
209+
? '#161521'
204210
: node.children
205-
? '#B1EDE8'
206-
: '#F5F47E'
211+
? 'white'
212+
: '#161521'
207213
}
208214
>
209215
{node.data.name}

src/app/components/Diff.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function Diff(props: DiffProps) {
7373
else formatters.html.hideUnchanged();
7474

7575
if (previous === undefined || delta === undefined) {
76-
return <div className="no-data-message"> No state change detected. Trigger an event to change state </div>;
76+
return <div className="no-data-message"> No state change detected. Trigger an event to change state. </div>;
7777
}
7878
return <div>{ReactHtmlParser(html)}</div>;
7979
}

src/app/components/History.tsx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
1+
// @ts-nocheck
22
import React, { Component, useEffect, useState } from 'react';
33
import * as d3 from 'd3';
44
import LegendKey from './legend';
5-
// import { changeView, changeSlider } from '../actions/actions';
5+
//added back line 6 , 160- 12
6+
import { changeView, changeSlider } from '../actions/actions';
67
/**
78
* @var colors: Colors array for the diffrerent node branches, each color is for a different branch
89
*/
910
const colors = [
10-
'#95B6B7',
11-
'#475485',
12-
'#519331',
13-
'#AA5039',
14-
'#8B2F5F',
11+
'#eb4d70',
12+
'#f19938',
13+
'#6ce18b',
14+
'#78f6ef',
15+
'#9096f8',
1516
'#C5B738',
1617
'#858DFF',
1718
'#FF8D02',
@@ -151,9 +152,9 @@ function History(props: Record<string, unknown>) {
151152
d3.select(this).transition(90).duration(18).attr('r', 21);
152153
})
153154
.on('click', function (d: `Record<string, unknown>`) {
154-
// const index = parseInt(`${d.data.name}.${d.data.branch}`);
155-
// dispatch(changeSlider(index));
156-
// dispatch(changeView(index));
155+
const index = parseInt(`${d.data.name}.${d.data.branch}`);
156+
dispatch(changeSlider(index));
157+
dispatch(changeView(index));
157158
})
158159
// think about how I can convert this any to typescript
159160
.on('mouseout', function () {
@@ -183,8 +184,6 @@ function History(props: Record<string, unknown>) {
183184
.text(function (d: { data: { name: number; branch: number } }) {
184185
// display the name of the specific patch
185186
// return `${d.data.name}.${d.data.branch}`;
186-
console.log('D.DATA.NAME: ', d.data.name);
187-
console.log('D.DATA.BRANCH:', d.data.branch);
188187
return `${d.data.name}.${d.data.branch}`;
189188
});
190189

src/app/components/PerformanceVisx.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ const PerformanceVisx = (props: BarStackProps) => {
163163
nice: true,
164164
});
165165

166+
166167
const colorScale = scaleOrdinal<string>({
167168
domain: keys,
168169
range: schemeSet3,

src/app/components/legend.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ export default function LegendKey(props: any) {
6767
const ordinalColorScale = scaleOrdinal<number, string>({
6868
domain: snap,
6969
range: [
70-
'#95B6B7',
71-
'#475485',
72-
'#519331',
73-
'#AA5039',
74-
'#8B2F5F',
70+
'#eb4d70',
71+
'#f19938',
72+
'#6ce18b',
73+
'#78f6ef',
74+
'#9096f8',
7575
'#C5B738',
7676
'#858DFF',
7777
'#FF8D02',

src/app/containers/MainContainer.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* eslint-disable @typescript-eslint/ban-types */
22
/* eslint-disable @typescript-eslint/no-explicit-any */
33
/* eslint-disable max-len */
4-
// @ts-nocheck
54
import React, { useEffect } from 'react';
65
import HeadContainer from './HeadContainer';
76
import ActionContainer from './ActionContainer';
@@ -112,7 +111,7 @@ function MainContainer(): any {
112111
return (
113112
<div className="error-container">
114113
<a
115-
href="reactime.io"
114+
href="https://reactime.io/"
116115
target="_blank"
117116
rel="noopener noreferrer"
118117
>

src/app/styles/layout/_stateContainer.scss

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
justify-content: flex-start;
1717
align-items: center;
1818
height: 30px;
19+
position: static;
1920
}
2021

2122
.state-container .main-navbar {
@@ -110,7 +111,7 @@
110111
background-color: $navbar-color;
111112
display: flex;
112113
flex-direction: row;
113-
justify-content: space-evenly;
114+
justify-content: start;
114115
align-items: center;
115116
height: 30px;
116117
}
@@ -138,14 +139,6 @@
138139
}
139140
}
140141

141-
.navbar {
142-
// prevent navbar from scrolling with state/tree display
143-
top: 0px;
144-
left: 0px;
145-
z-index: 1;
146-
@extend %disable-highlight;
147-
}
148-
149142
.no-data-message {
150143
color: $text-color;
151144
font: normal 13px $text-font-stack;

src/backend/linkFiber.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ function createTree(
313313
// We then store them along with the corresponding memoizedState.queue,
314314
// which includes the dispatch() function we use to change their state.
315315
const hooksStates = traverseRecoilHooks(memoizedState, memoizedProps);
316-
console.log("hookStates: ", hooksStates);
316+
// console.log("hookStates: ", hooksStates);
317317
hooksStates.forEach((state, i) => {
318318
hooksIndex = componentActionsRecord.saveNew(
319319
state.state,
@@ -356,7 +356,7 @@ function createTree(
356356
isRecoil === false
357357
) {
358358
if (memoizedState.queue) {
359-
console.log("line 357...")
359+
// console.log("line 357...")
360360
// Hooks states are stored as a linked list using memoizedState.next,
361361
// so we must traverse through the list and get the states.
362362
// We then store them along with the corresponding memoizedState.queue,

src/extension/background.js

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -50,43 +50,16 @@ class Node {
5050
}
5151
}
5252

53-
// class NewNode {
54-
// constructor(obj, tabObj) {
55-
// // continues the order of number of total state changes
56-
// this.index = tabObj.index++;
57-
// // continues the order of number of states changed from that parent
58-
// this.name = tabObj.currParent;
59-
// // marks from what branch this node is originated
60-
// this.branch = tabObj.currBranch += 1;
61-
// this.stateSnapshot = obj;
62-
// this.children = [];
63-
// }
64-
// }
65-
6653
function sendToHierarchy(tabObj, newNode) {
6754
if (!tabObj.currLocation) {
68-
console.log('tabObj.currLocation does not exist');
6955
tabObj.currLocation = newNode;
7056
tabObj.hierarchy = newNode;
7157
} else {
72-
console.log(
73-
'tabObj.currLocation exist' + Object.entries(tabObj.currLocation)
74-
);
7558
tabObj.currLocation.children.push(newNode);
76-
console.log(
77-
'tabObj.currLocation.children ' +
78-
Object.entries(tabObj.currLocation.children)
79-
);
80-
console.log(
81-
'tabObj.currLocation.children.length ' +
82-
tabObj.currLocation.children.length
83-
);
8459
// if the node's children's array is empty
8560
if (tabObj.currLocation.children.length > 1) {
86-
console.log('tabObj.currLocation exist and children is more than one');
8761
// increment the value of the nodes branch by 1
8862
newNode.branch += 1;
89-
9063
// reassign value of current branch as the newNode branch value
9164
tabObj.currBranch = newNode.branch;
9265
}

0 commit comments

Comments
 (0)