Skip to content

Commit 230856e

Browse files
committed
Merge branch 'staging' of https://github.com/oslabs-beta/Chronos
2 parents 47c6edf + b40dce7 commit 230856e

5 files changed

Lines changed: 108 additions & 55 deletions

File tree

app/charts/route-trace.jsx

Lines changed: 28 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
11
import * as d3 from 'd3';
2-
3-
let text = [{
4-
t: 'reverseproxy',
5-
}, {
6-
t: 'books',
7-
}, {
8-
t: 'orders',
9-
}, {
10-
t: 'customers'
11-
}]
122
class RouteTrace {
133
containerEl;
144
props;
@@ -27,7 +17,6 @@ class RouteTrace {
2717
this.updateDatapoints();
2818
}
2919

30-
3120
updateDatapoints = () => {
3221
const { svg, props: { data, width, height } } = this;
3322
console.log('data: ', data)
@@ -36,61 +25,59 @@ class RouteTrace {
3625

3726
console.log('1st data point: ', data[0][0])
3827
console.log('4th data point: ', data[0][3])
39-
4028

4129
var simulation = d3.forceSimulation(data[0])
42-
  .force('link', d3.forceLink())
43-
  .force('charge', d3.forceManyBody())
30+
.force('link', d3.forceLink())
31+
.force('charge', d3.forceManyBody())
4432
.force('center', d3.forceCenter(width / 2, height / 2))
45-
46-
const node = svg
47-
.selectAll('circle')
33+
34+
const link = svg.append("g")
35+
.attr("class", "links")
36+
.selectAll("line")
37+
.data(data[1])
38+
.enter()
39+
.append("line")
40+
.style('stroke', 'black')
41+
42+
const node = svg.append("g")
43+
.attr("class", "nodes")
44+
.selectAll("g")
4845
.data(data[0])
4946
.enter()
50-
.append('circle')
47+
.append("g")
48+
49+
const circles = node.append("circle")
50+
.attr("r", 20)
51+
.attr("fill", '#00eda0')
5152
.on('mouseover', () => d3.select(this).text(d.id))
52-
53-
const circleAttr = node
54-
.attr('r', 20)
55-
.attr('cx', 200)
56-
.attr('cy', 200)
57-
.style('fill', '#00eda0')
5853
.on('mouseup', (d, i, nodes) => this.setActiveDatapoint(d, nodes[i]))
5954

60-
const text = svg.selectAll('text')
61-
.data(data[0]).enter().append('text')
62-
63-
const textLabels = text
55+
const lables = node.append("text")
56+
.text(d => d.id)
6457
.attr('x', d => d.x)
6558
.attr('y', d => d.y)
66-
.attr('dx', 100)
67-
.attr('dy','10em')
68-
.text(d => d.id);
6959

70-
const link = svg
71-
.selectAll('line')
72-
.data(data[1])
73-
.enter()
74-
.append('line')
75-
.style('stroke', 'black')
60+
node.append("title")
61+
.text(d => d.id)
7662

7763
simulation
7864
.nodes(data[0])
7965
.on('tick', ticked);
8066

8167
simulation.force('link')
82-
.links(link);
68+
// .links(data[1]); // error: cannot create property vx on books
8369

8470
function ticked() {
8571
link
8672
.attr('x1', function(d) { return d.source.x; })
8773
.attr('y1', function(d) { return d.source.y; })
8874
.attr('x2', function(d) { return d.target.x; })
8975
.attr('y2', function(d) { return d.target.y; });
90-
76+
9177
node
92-
.attr('cx', function(d) { return d.x; })
93-
.attr('cy', function(d) { return d.y; });
78+
.attr("transform", function(d) {
79+
return "translate(" + d.x + "," + d.y + ")";
80+
})
9481
}
9582
}
9683

app/components/AddService.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ const AddService = () => {
3333

3434
return (
3535
<div className="mainContainer">
36-
<img src="app/assets/logo2.png" alt="logo" id="addServiceLogo" />
3736
<h2 className="signUpHeader">
3837
Enter Your Database Information
3938
</h2>
40-
<form>
39+
<form className="inputForm">
4140
Database Type:
4241
<select id="dbType" onChange={() => setDbType(document.getElementById('dbType').value)}>
4342
<option value="SQL">SQL</option>

app/components/DeleteService.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ const DeleteService = (props) => {
3737

3838
/* Iterates over the serviceList to create a button for each service. Each button is pushed into the databaseButtons array as the button is created. Each button has an onclick function that invokes the window confirm function with a warning message (ex:'Are you sure you want to delete this service?') and stores the result of invoking confirm into a constant moveForward. If the moveForward is true, then onDelete function is invoked with the index of where the service is stored within the serviceList*/
3939
for(let i = 0; i<serviceList.length; i++){
40-
databaseButtons.push(<button className="microserviceBtn deleteMicroservice" key ={"delete"+i} onClick={()=>{
40+
databaseButtons.push(<button className="deleteMicroservice" key ={"delete"+i} onClick={()=>{
4141
const moveForward = confirm(`Are you sure you want to delete ${serviceList[i]}? \n If "YES" press the "OK" button, else press the "Cancel" button`);
4242
if (moveForward){onDelete(i)}
4343

4444
}}>{serviceList[i]}</button>)
4545
}
4646
// returns the title of the page with all of the services that can be deleted as buttons
4747
return (
48-
<div className="mainContainer">
49-
<h1 className='overviewTitle'>Press on the Database You Want to Delete</h1>
48+
<div className="deleteMainContainer">
49+
<h1 className='overviewTitle'>Select Database To Delete</h1>
5050
<div className="servicesList">{databaseButtons}</div>
5151
</div>
5252
);

app/stylesheets/AddService.css

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans&family=Nunito:wght@200&family=Quicksand:wght@300&display=swap');
2+
13
#addServiceLogo {
24
margin-bottom: 0px;
35
}
@@ -10,16 +12,39 @@ form {
1012
font-size: 2vh;
1113
}
1214

15+
.mainContainer {
16+
font-family: 'Nunito', sans-serif;
17+
display: grid;
18+
justify-content: center;
19+
align-items: center;
20+
align-self: center;
21+
}
22+
23+
#addServiceLogo {
24+
display: grid;
25+
justify-items: center;
26+
justify-content: center;
27+
}
28+
29+
.inputForm {
30+
color: black;
31+
}
32+
33+
.dbType {
34+
color: black;
35+
}
36+
1337
.userInput {
1438
width: 70%;
15-
border: 2px solid rgb(255, 206, 9);
39+
border: 2px solid rgb(0, 0, 0);
1640
border-radius: 45px;
1741
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
1842
text-align: center;
1943
height: 50%;
2044
font-size: 2vh;
2145
padding-left: 0.25%;
2246
margin: 15px auto 30px auto;
47+
font-family: 'Nunito', sans-serif;
2348
}
2449

2550
::placeholder {
@@ -34,17 +59,18 @@ form {
3459
height: 40px;
3560
color: white;
3661
font-size: 2vh;
37-
border: 1px solid rgb(255, 206, 9);
38-
background-color: #333;
62+
border: 1px solid rgb(0, 0, 0);
63+
background-color: black;
3964
transition: 0.25s;
65+
border-radius: 10px
4066
}
4167

4268
.submitBtn:hover {
43-
font-weight: 700;
69+
font-size: 2vh;
4470
cursor: pointer;
4571
border-radius: 10px;
46-
color: #333;
47-
background-color: rgb(255, 206, 9);
72+
color: white;
73+
background-color: #494FEE;
4874
}
4975

5076
.signUpHeader {
@@ -61,7 +87,7 @@ select {
6187
font-size: 1.75vh;
6288
font-weight: 400;
6389
/* background-color: rgb(196, 196, 196); */
64-
border: 2px solid rgb(255, 206, 9);
90+
border: 2px solid black;
6591
margin-top: 1%;
6692
margin-bottom: 2.5%;
6793
}

app/stylesheets/DeleteServices.css

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,46 @@
1-
.deleteMicroservice{
1+
.deleteMicroservice {
22
padding: 10px;
33
margin: 10px;
4-
4+
}
5+
6+
.overviewTitle {
7+
font-weight: 300;
8+
font-size: 5.5vh;
9+
}
10+
11+
.deleteMainContainer {
12+
display: grid;
13+
justify-content: center;
14+
align-items: center;
15+
align-self: center;
16+
font-family: 'Nunito', sans-serif;
17+
width: 100%;
18+
}
19+
20+
.servicesList {
21+
display: flex;
22+
justify-content: center;
23+
align-self: flex-start;
24+
width: 100%;
25+
}
26+
27+
.deleteMicroservice {
28+
margin-top: 6%;
29+
margin-bottom: 10%;
30+
width: 50%;
31+
height: 40px;
32+
color: white;
33+
font-size: 2vh;
34+
border: 1px solid rgb(0, 0, 0);
35+
background-color: black;
36+
transition: 0.25s;
37+
border-radius: 10px
38+
}
39+
40+
.deleteMicroservice:hover {
41+
font-size: 2vh;
42+
cursor: pointer;
43+
border-radius: 10px;
44+
color: white;
45+
background-color: #494FEE;
546
}

0 commit comments

Comments
 (0)