2 Commits

Author SHA1 Message Date
  Carla Ramos 0391c6ce32 Cambios nuevos 1 year ago
  Carla Ramos 504d39d366 Changes colors and styles in app 1 year ago
2 changed files with 73 additions and 53 deletions
  1. 48
    53
      App.js
  2. 25
    0
      yarn.lock

+ 48
- 53
App.js View File

@@ -19,18 +19,39 @@ var information = "data goes here"
19 19
 
20 20
 function organize(){
21 21
 	
22
-	var stringDiv = JSON.parse(information)
23
-	var csv = parse(stringDiv)
24
-	console.log(csv)
22
+	var stringDiv = JSON.stringify(information)
23
+	stringDiv = stringDiv.replace('[[', '');
24
+	stringDiv = stringDiv.replace(']]', '');
25
+	stringDiv = stringDiv.split(',')
26
+	//create smaller array variables
27
+	let variables = []
28
+	let value = []
29
+	let est = []
25 30
 	
26
-	//var csv is the variable with the thing you just pulled
27
-	//put function and data cleaning here
28
-	//just make sure you change the return value in 'getInfo()'
29
-	//so it returns the actual organized table
30
-	//or make getInfo() organize the table as well
31
-	//and return that organized table
32
-	//i leave this to you
33 31
 	
32
+	//theres a better way to do this but im not fixing it rn
33
+	for(let i = 0; i<stringDiv.length; i++){
34
+		if(i<stringDiv.length/3)
35
+		{variables.push(stringDiv[i])}
36
+		else if(i<stringDiv.length/3*2)
37
+		{value.push(stringDiv[i])}
38
+		else{est.push(stringDiv[i])}
39
+	}
40
+	
41
+	//anyways this to format it
42
+	
43
+	console.log("vars:",variables)
44
+	console.log("val:",value)
45
+	console.log("est:",est)
46
+	//organizedData = JSON.parse(information)
47
+	//console.log(stringDiv)
48
+	
49
+}
50
+
51
+function json_2_csv(information){
52
+	const csv = parse(obj);
53
+
54
+	console.log(csv);
34 55
 }
35 56
 
36 57
 //fix
@@ -96,15 +117,14 @@ const styles = StyleSheet.create({
96 117
 	  margin: 30,
97 118
 	  borderColor: "white",
98 119
 	  borderRadius: 8,
99
-	  paddingVertical: 15,
100
-	  paddingHorizontal: 30,
101
-	  backgroundColor: "#008CBA",
120
+	  padding: (30, 16),
121
+	  backgroundColor: "black",
102 122
 	  marginTop: 0
103 123
   }, 
104 124
   buttonContainer: {
105 125
     flexDirection: 'column',
106 126
     backgroundColor: 'black',
107
-    // alignItems: 'center',
127
+    alignItems: 'center',
108 128
     justifyContent: 'center',
109 129
 	paddingTop:5,
110 130
 	marginTop: 30,
@@ -112,7 +132,7 @@ const styles = StyleSheet.create({
112 132
   container: {
113 133
     flexDirection: 'column',
114 134
 	justifyContent: 'center',
115
-    backgroundColor: 'black',
135
+    backgroundColor: '#f0f8ff',
116 136
     alignItems: 'center',
117 137
     justifyContent: 'center',
118 138
 	paddingTop:20,
@@ -120,11 +140,11 @@ const styles = StyleSheet.create({
120 140
   },
121 141
   containerbackground:{
122 142
 	
123
-    backgroundColor: '#063970'
143
+    backgroundColor: '#f0f8ff'
124 144
   },
125 145
   intro: {
126 146
 	  fontWeight: "bold",
127
-      color:"#beb2c8",
147
+      color:"#black",
128 148
 	  fontSize: 30,
129 149
   },
130 150
   intro2: {
@@ -134,14 +154,14 @@ const styles = StyleSheet.create({
134 154
 },
135 155
 
136 156
   sub: {
137
-	color:"#beb2c8",  
157
+	color:"#black",  
138 158
 	fontWeight: "bold",
139 159
 	fontSize: 15,
140 160
 	paddingBottom:10,
141 161
 },
142 162
 
143 163
   Navsub: {
144
-      color:"#beb2c8",  
164
+      color:"#black",  
145 165
 	  fontWeight: "bold",
146 166
 	  fontSize: 30,
147 167
 	  paddingBottom:10,
@@ -171,6 +191,7 @@ const styles = StyleSheet.create({
171 191
 });
172 192
 
173 193
 
194
+
174 195
 //default button press
175 196
 
176 197
 const handlePress = () => false
@@ -315,10 +336,6 @@ function Picker() {
315 336
 	{label: 'Yauco', value: '153'}
316 337
   ]);
317 338
   
318
-  //add a thing here to select year to take info from
319
-  
320
-
321
-//add a dropdown in here 
322 339
 
323 340
   return (
324 341
   <View>
@@ -356,8 +373,6 @@ function Picker() {
356 373
 	  searchPlaceholder="Busqueda..."
357 374
     />
358 375
 	
359
-	
360
-	
361 376
 	</View>
362 377
   );
363 378
 
@@ -390,37 +405,22 @@ class App extends React.Component {
390 405
 	//the text at the end of a page gets cut off if anyone knows how to fix that?
391 406
 	vars = {
392 407
 		welcome:
408
+
409
+		<View style = {styles.containerbackground}>
410
+		<ScrollView style={styles.scrollView}>
393 411
 			<View style = {styles.containerbackground}>
394 412
 		
395 413
 		  	<View style = {styles.container}>
396
-		  
397
-		  
398
-				<Text style={styles.intro}>BIENVENIDO!!!!</Text>
399
-	
400
-				<Image source={require('./Logo.jpeg')} />
414
+				<Text style={styles.intro}>Bienvenido!</Text>
401 415
 			</View>
402 416
 			<View style = {styles.container}>
403 417
 				<Text style={styles.sub}>Aqui podra mantenerse al tanto con las 
404 418
 					ultimas noticias relacionadas al censo y tambien verificar 
405 419
 					las tablas por municipio.</Text>
406 420
 		   </View>
407
-		   <View style = {styles.container}>
408
-				<Text style={styles.intro2}>Contactenos:</Text>
409
-				<Text style={styles.sub}>Prof: Hernando Mattei Torres
410
-				<Button onPress={() => Linking.openURL('mailto:hernando.mattei@upr.edu') }
411
-      			title="e-mail" /></Text>
412
-				<Text style={styles.sub}>Angelica Rosario Santos
413
-				<Button onPress={() => Linking.openURL('mailto:angelica.rosario2@upr.edu') }
414
-      			title="e-mail" /></Text>
415
-				<Text style={styles.sub}>Data from:</Text>
416
-				<Image source={require('./census-logos.png')} />
417
-				<Button onPress={() => Linking.openURL('https://data.census.gov/profile?q=United+States&g=0100000US') }
418
-      			title="United States Census page" />
419
-		   </View>
420
-		  
421
-		</View>
422
-		
423
-		,
421
+		  </ScrollView>
422
+		</View>,
423
+		 
424 424
 		newsView:
425 425
 		<View style = {styles.containerbackground}>
426 426
 		<ScrollView style={styles.scrollView}>
@@ -429,9 +429,6 @@ class App extends React.Component {
429 429
 			<Text style={styles.intro}>Noticias</Text>
430 430
 			
431 431
 			<Image source={require('./Logo.jpeg')} />
432
-		  
433
-			 
434
-			
435 432
 			
436 433
 		 </View>
437 434
 		</ScrollView>
@@ -442,12 +439,10 @@ class App extends React.Component {
442 439
 		<ScrollView nestedScrollEnabled = {true} style={styles.scrollView}>
443 440
 		 <View style = {styles.container}>
444 441
 			
445
-		  
446 442
 			<Text style={styles.intro}>DATA VIEWING PROJECT</Text>		
447 443
 				
448 444
 			<Picker />
449
-			
450
-			<Image source={require('./testimg.gif')} />
445
+
451 446
 				
452 447
 			<DataButton />
453 448
 			

+ 25
- 0
yarn.lock View File

@@ -2799,6 +2799,13 @@
2799 2799
   "resolved" "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz"
2800 2800
   "version" "2.2.0"
2801 2801
 
2802
+"bindings@^1.5.0":
2803
+  "integrity" "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ=="
2804
+  "resolved" "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz"
2805
+  "version" "1.5.0"
2806
+  dependencies:
2807
+    "file-uri-to-path" "1.0.0"
2808
+
2802 2809
 "bl@^4.1.0":
2803 2810
   "integrity" "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w=="
2804 2811
   "resolved" "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz"
@@ -5394,6 +5401,19 @@
5394 5401
   "resolved" "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
5395 5402
   "version" "1.0.0"
5396 5403
 
5404
+"fsevents@^1.2.7":
5405
+  "integrity" "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw=="
5406
+  "resolved" "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz"
5407
+  "version" "1.2.13"
5408
+  dependencies:
5409
+    "bindings" "^1.5.0"
5410
+    "nan" "^2.12.1"
5411
+
5412
+"fsevents@^2.1.2", "fsevents@~2.3.2":
5413
+  "integrity" "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA=="
5414
+  "resolved" "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz"
5415
+  "version" "2.3.2"
5416
+
5397 5417
 "function-bind@^1.1.1":
5398 5418
   "integrity" "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
5399 5419
   "resolved" "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz"
@@ -7643,6 +7663,11 @@
7643 7663
     "object-assign" "^4.0.1"
7644 7664
     "thenify-all" "^1.0.0"
7645 7665
 
7666
+"nan@^2.12.1":
7667
+  "integrity" "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ=="
7668
+  "resolved" "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz"
7669
+  "version" "2.17.0"
7670
+
7646 7671
 "nanomatch@^1.2.9":
7647 7672
   "integrity" "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA=="
7648 7673
   "resolved" "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz"