Skip to content

Commit 63a7e04

Browse files
authored
Merge pull request #24 from kevinfey/styling
Styling update for 5.0
2 parents 39a1a6f + 429cf9d commit 63a7e04

File tree

11 files changed

+124
-27
lines changed

11 files changed

+124
-27
lines changed

src/app/components/AtomsRelationship.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function AtomsRelationship(props) {
1414

1515

1616
return (
17-
<div className="history-d3-container">
17+
<div className="history-d3-container" id="atomsContainer">
1818
{atomsRel && (
1919
<Chart
2020
width={'100%'}
@@ -41,12 +41,12 @@ function AtomsRelationship(props) {
4141
'#5fdaed',
4242
],
4343

44-
label: { color: '#fff', fontSize: '14' },
44+
label: { color: '#fff', fontSize: '13', fontName: 'Monaco', },
4545
nodePadding: 50,
4646
width: 15,
4747
},
4848
},
49-
tooltip: { textStyle: { color: 'gray', fontSize: 12 }},
49+
tooltip: { textStyle: { color: 'white', fontSize: 0.1, }},
5050
}}
5151
loader={<div>Loading Chart</div>}
5252
data={[['Atom', 'Selector', ''], ...atomsRel]}

src/app/components/ComponentMap.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ const ComponentMap = (props: componentMapProps) => {
2424
else lastSnap = viewIndex;
2525

2626
//external constants
27-
const width: number = 900;
28-
const height: number = 600;
27+
const width: any = '100vw';
28+
const height: any = '100vh';
2929
let data: Object = snapshots[lastSnap];
3030

3131
useEffect(() => {
@@ -123,7 +123,7 @@ const ComponentMap = (props: componentMapProps) => {
123123
nodeEnter
124124
.append('circle')
125125
.attr('r', 10)
126-
.attr('fill', (d) => (d._children ? '#46edf2' : '#95B6B7'))
126+
.attr('fill', (d) => (d._children ? '#4e9dcc' : '#95B6B7'))
127127
.attr('stroke-width', 10)
128128
.attr('stroke-opacity', 1);
129129

@@ -135,7 +135,7 @@ const ComponentMap = (props: componentMapProps) => {
135135
.attr('y', '-5')
136136
.attr('text-anchor', 'end')
137137
.text((d: any) => d.data.name.slice(0, 14)) // Limits Characters in Display
138-
.style('font-size', `.6rem`)
138+
.style('font-size', `.7rem`)
139139
.style('fill', 'white')
140140
.clone(true)
141141
.lower()
@@ -250,7 +250,7 @@ const ComponentMap = (props: componentMapProps) => {
250250
);
251251

252252
return (
253-
<div id="map-canvas-container" data-testid="canvas">
253+
<div data-testid="canvas" id="componentMapContainer">
254254
<svg id="canvas"></svg>
255255
</div>
256256
);

src/app/components/History.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ function History(props) {
5757
*/
5858
let maked3Tree = function () {
5959
removed3Tree();
60-
const width: number = 800;
61-
const height: number = 600;
60+
const width: any = 800;
61+
const height: any = 600;
6262
const svgContainer = d3
6363
.select(HistoryRef.current)
6464
.append('svg') // svgContainer is now pointing to svg
@@ -68,7 +68,7 @@ function History(props) {
6868
const g = svgContainer
6969
.append('g')
7070
// this is changing where the graph is located physically
71-
.attr('transform', `translate(${width / 2 + 4}, ${height / 2 + 2})`);
71+
.attr('transform', `translate(${width / 2 + 4}, ${height / 2 + 2})`)
7272

7373
// d3.hierarchy constructs a root node from the specified hierarchical data
7474
// (our object titled dataset), which must be an object representing the root node
@@ -83,6 +83,7 @@ function History(props) {
8383

8484
const d3root = tree(hierarchy);
8585

86+
8687
g.selectAll('.link')
8788
// root.links() gets an array of all the links,
8889
// where each element is an object containing a
@@ -112,7 +113,7 @@ function History(props) {
112113

113114
if (loadTime !== undefined) {
114115
if (loadTime > 16) {
115-
return '#ff0000';
116+
return '#d62b2b';
116117
}
117118
}
118119

@@ -249,9 +250,9 @@ function History(props) {
249250
};
250251

251252
return (
252-
<div className="history-d3-container">
253-
<div ref={HistoryRef} className="history-d3-div" />
254-
</div>
253+
<>
254+
<div ref={HistoryRef} className="history-d3-div" id="historyContainer"/>
255+
</>
255256
);
256257
}
257258

src/app/components/StateRoute.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const StateRoute = (props: StateRouteProps) => {
4949
const [{ x, y, k }, setZoomState]: any = useState({
5050
x: 150,
5151
y: 250,
52-
k: 0.75,
52+
k: 1,
5353
});
5454

5555
//Map
@@ -135,7 +135,7 @@ const StateRoute = (props: StateRouteProps) => {
135135
</NavLink>
136136

137137
{isRecoil && <NavLink className="router-link" activeClassName="is-active" to="/relationship">
138-
Atoms Relationship
138+
Relationships
139139
</NavLink>}
140140

141141
<NavLink

src/app/components/Tree.tsx

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,43 @@
66
import React from 'react';
77
import JSONTree from 'react-json-tree';
88

9+
10+
11+
12+
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
24+
25+
const colors = {
26+
scheme: 'paraiso',
27+
author: 'jan t. sott',
28+
base00: '#2f1e2e',
29+
base01: '#41323f',
30+
base02: '#4f424c',
31+
base03: '#776e71',
32+
base04: '#8d8687',
33+
base05: '#a39e9b',
34+
base06: '#b9b6b0',
35+
base07: '#e7e9db',
36+
base08: '#ef6155',
37+
base09: '#f99b15',
38+
base0A: '#fec418',
39+
base0B: '#48b685',
40+
base0C: '#5bc4bf',
41+
base0D: '#06b6ef',
42+
base0E: '#815ba4',
43+
base0F: '#e96ba8'
44+
};
45+
946
const getItemString = (type, data:{state?:object|string, name:string, children:[]}) => {
1047
if (data && data.name) {
1148
return <span>{data.name}</span>;
@@ -25,7 +62,7 @@ const Tree = (props:TreeProps) => {
2562
{snapshot && (
2663
<JSONTree
2764
data={snapshot}
28-
theme={{ tree: () => ({ className: 'json-tree' }) }}
65+
theme={{ extend: colors, tree: () => ({ className: 'json-tree' }) }}
2966
shouldExpandNode={() => true}
3067
getItemString={getItemString}
3168
labelRenderer={(raw:any[]) => {

src/app/styles/abstracts/_variables.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/// fontFamily: 'monaco, Consolas, Lucida Console, monospace'
22
/// @type List
3-
$text-font-stack: monaco, Consolas, 'Lucida Console', monospace, Arial,
3+
$text-font-stack: Monaco, Consolas, 'Lucida Console', monospace, Arial,
44
sans-serif !default;
55

66
/// @type Color
77
$text-color: rgb(231, 231, 231);
88

99
/// @type Color
10-
$brand-color: #2a2f3a !default;
10+
$brand-color: #242529 !default;
1111

1212
/// Light grey
1313
/// @type Color
@@ -22,7 +22,7 @@ $light-grey-three: rgb(101, 104, 110) !default;
2222
$navbar-color: rgb(68, 72, 78) !default;
2323

2424
/// @type Color
25-
$head-color: #353b46 !default;
25+
$head-color: #242529 !default;
2626

2727
/// @type Color
2828
$border-color: rgba(190, 190, 190, 0.5) !default;

src/app/styles/base/_base.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
html {
2+
margin: 0;
3+
padding: 0;
24
height: 100%;
35
}
46

src/app/styles/components/_jsonTree.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.json-tree {
2+
overflow: auto;
23
margin: 10px;
34
padding: 0;
45
width: 900px;

src/app/styles/components/_rc-slider.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
.rc-slider-rail {
1717
position: absolute;
1818
width: 100%;
19-
background-color: #e9e9e9;
19+
background-color: #ebf2fa;
2020
height: 4px;
2121
border-radius: 6px;
2222
}
@@ -25,7 +25,7 @@
2525
left: 0;
2626
height: 4px;
2727
border-radius: 6px;
28-
background-color: #78909C;
28+
background-color: #427aa1;
2929
}
3030
.rc-slider-handle {
3131
position: absolute;
@@ -38,7 +38,7 @@
3838
cursor: grab;
3939
border-radius: 50%;
4040
// border: solid 2px #96dbfa;
41-
background-color: #78909B;
41+
background-color: #427aa1;
4242
-ms-touch-action: pan-x;
4343
touch-action: pan-x;
4444
}

src/app/styles/layout/_headContainer.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
.tab-select__menu {
2525
border-style: none;
2626
width: 300px;
27-
background-color: $light-grey-one;
27+
background-color: $brand-color;
2828
z-index: 2;
2929
@extend %disable-highlight;
3030
}

0 commit comments

Comments
 (0)