Skip to content

Commit fd4a8c6

Browse files
committed
added colors and styling to the History, ComponentMap and console log removed from background.js
> > 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]>  
1 parent 77cd849 commit fd4a8c6

File tree

6 files changed

+30
-64
lines changed

6 files changed

+30
-64
lines changed

src/app/components/ComponentMap.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,16 @@ 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 = 65;
129+
const height = 25;
130+
131131

132132
let top: number;
133133
let left: number;
@@ -149,7 +149,7 @@ export default function ComponentMap({
149149
<circle
150150
r={12}
151151
fill="url('#links-gradient')"
152-
stroke="#e7e7e7"
152+
stroke="#ff6569"
153153
onClick={() => {
154154
node.data.isExpanded = !node.data.isExpanded;
155155
// console.log(node);
@@ -164,11 +164,11 @@ export default function ComponentMap({
164164
width={width}
165165
y={-height / 2}
166166
x={-width / 2}
167-
fill='#272b4d'
168-
stroke={node.children ? '#62d6fb' : '#F5F47E'}
167+
fill= {node.children ? '#161521' : '#62d6fb'}
168+
stroke={node.children ? '#62d6fb' : '#161521'}
169169
strokeWidth={1}
170170
strokeDasharray={node.children ? '0' : '2,2'}
171-
strokeOpacity={node.children ? 1 : 0.6}
171+
strokeOpazcity='1'
172172
rx={node.children ? 4 : 10}
173173
onClick={() => {
174174
node.data.isExpanded = !node.data.isExpanded;
@@ -194,16 +194,16 @@ export default function ComponentMap({
194194
{/* Display text inside of each component node */}
195195
<text
196196
dy='.33em'
197-
fontSize={9}
197+
fontSize={8}
198198
fontFamily='Roboto'
199199
textAnchor='middle'
200200
style={{ pointerEvents: 'none' }}
201201
fill={
202202
node.depth === 0
203-
? '#71248e'
203+
? '#161521'
204204
: node.children
205-
? '#B1EDE8'
206-
: '#F5F47E'
205+
? 'white'
206+
: '#161521'
207207
}
208208
>
209209
{node.data.name}

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/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/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)