Browse Source

Changes colors and styles in app

Carla Ramos 1 year ago
parent
commit
504d39d366
2 changed files with 73 additions and 44 deletions
  1. 48
    44
      App.js
  2. 25
    0
      yarn.lock

+ 48
- 44
App.js View File

@@ -2,7 +2,7 @@ import { StatusBar } from 'expo-status-bar';
2 2
 import React, {useState, useEffect} from 'react';
3 3
 import { View, Image, StyleSheet, Text, Button, ScrollView, Pressable} from 'react-native';
4 4
 import DropDownPicker from 'react-native-dropdown-picker';
5
-import { parse } from 'json2csv';
5
+
6 6
 
7 7
 //import JSON;
8 8
 //import { Dataframe, readJSON } from "danfojs";
@@ -19,20 +19,41 @@ 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 = []
30
+	
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
25 42
 	
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
43
+	console.log("vars:",variables)
44
+	console.log("val:",value)
45
+	console.log("est:",est)
46
+	//organizedData = JSON.parse(information)
47
+	//console.log(stringDiv)
33 48
 	
34 49
 }
35 50
 
51
+function json_2_csv(information){
52
+	const csv = parse(obj);
53
+
54
+	console.log(csv);
55
+}
56
+
36 57
 //fix
37 58
 
38 59
 DropDownPicker.setListMode("SCROLLVIEW")
@@ -97,12 +118,12 @@ const styles = StyleSheet.create({
97 118
 	  borderColor: "grey",
98 119
 	  borderRadius: 8,
99 120
 	  padding: (30, 16),
100
-	  backgroundColor: "#008CBA",
121
+	  backgroundColor: "black",
101 122
 	  marginTop: 0
102 123
   }, 
103 124
   buttonContainer: {
104 125
     flexDirection: 'column',
105
-    backgroundColor: 'black',
126
+    backgroundColor: '#f0f8ff',
106 127
     alignItems: 'center',
107 128
     justifyContent: 'center',
108 129
 	paddingTop:100,
@@ -111,7 +132,7 @@ const styles = StyleSheet.create({
111 132
   container: {
112 133
     flexDirection: 'column',
113 134
 	justifyContent: 'center',
114
-    backgroundColor: 'black',
135
+    backgroundColor: '#f0f8ff',
115 136
     alignItems: 'center',
116 137
     justifyContent: 'center',
117 138
 	paddingTop:20,
@@ -119,23 +140,23 @@ const styles = StyleSheet.create({
119 140
   },
120 141
   containerbackground:{
121 142
 	
122
-    backgroundColor: '#063970'
143
+    backgroundColor: '#f0f8ff'
123 144
   },
124 145
   intro: {
125 146
 	  fontWeight: "bold",
126
-      color:"#beb2c8",
147
+      color:"#black",
127 148
 	  fontSize: 30,
128 149
   },
129 150
 
130 151
   sub: {
131
-	color:"#beb2c8",  
152
+	color:"#black",  
132 153
 	fontWeight: "bold",
133 154
 	fontSize: 15,
134 155
 	paddingBottom:10,
135 156
 },
136 157
 
137 158
   Navsub: {
138
-      color:"#beb2c8",  
159
+      color:"#black",  
139 160
 	  fontWeight: "bold",
140 161
 	  fontSize: 30,
141 162
 	  paddingBottom:10,
@@ -164,6 +185,7 @@ const styles = StyleSheet.create({
164 185
 });
165 186
 
166 187
 
188
+
167 189
 //default button press
168 190
 
169 191
 const handlePress = () => false
@@ -303,10 +325,6 @@ function Picker() {
303 325
 	{label: 'Yauco', value: '153'}
304 326
   ]);
305 327
   
306
-  //add a thing here to select year to take info from
307
-  
308
-
309
-//add a dropdown in here 
310 328
 
311 329
   return (
312 330
   <View>
@@ -344,8 +362,6 @@ function Picker() {
344 362
 	  searchPlaceholder="Busqueda..."
345 363
     />
346 364
 	
347
-	
348
-	
349 365
 	</View>
350 366
   );
351 367
 }
@@ -359,21 +375,17 @@ class App extends React.Component {
359 375
 //the text at the end of a page gets cut off if anyone knows how to fix that?
360 376
 vars = {
361 377
 		welcome:
362
-		  
363 378
 
364 379
 		<View style = {styles.containerbackground}>
365 380
 		<ScrollView style={styles.scrollView}>
366 381
 		  	<View style = {styles.container}>
367
-		  
368
-		  
369
-				<Text style={styles.intro}>BIENVENIDO!!!!</Text>
370
-	
371
-				<Image source={require('./Logo.jpeg')} />
382
+				<Text style={styles.intro}>Bienvenido!</Text>
372 383
 			</View>
373 384
 			<View style = {styles.container}>
374
-				<Text style={styles.sub}>Aqui podra mantenerse al tanto con las 
375
-					ultimas noticias relacionadas al censo y tambien verificar 
376
-					las tablas por municipio.</Text>
385
+				<Text style={styles.sub}>Aquí podra mantenerse al tanto con las 
386
+					últimas noticias relacionadas al Censo y tener acceso a los  
387
+					los Demographic Data Profiles de cada municipio de
388
+					Puerto Rico.</Text>
377 389
 		   </View>
378 390
 		  </ScrollView>
379 391
 		</View>,
@@ -386,9 +398,6 @@ vars = {
386 398
 			<Text style={styles.intro}>Noticias</Text>
387 399
 			
388 400
 			<Image source={require('./Logo.jpeg')} />
389
-		  
390
-			 
391
-			
392 401
 			
393 402
 		 </View>
394 403
 		</ScrollView></View>,
@@ -398,12 +407,10 @@ vars = {
398 407
 		<ScrollView nestedScrollEnabled = {true} style={styles.scrollView}>
399 408
 		 <View style = {styles.container}>
400 409
 			
401
-		  
402 410
 			<Text style={styles.intro}>DATA VIEWING PROJECT</Text>		
403 411
 				
404 412
 			<Picker />
405
-			
406
-			<Image source={require('./testimg.gif')} />
413
+
407 414
 				
408 415
 			<DataButton />
409 416
 			
@@ -438,19 +445,16 @@ setNews = () => this.setState({ current: this.vars.newsView })
438 445
 			<View style = {styles.containerbackground}>
439 446
 				<View style = {styles.buttonContainer}>
440 447
 					<Text style={styles.Navsub}> Demographic Data Viewer</Text>
441
-						<Text style={styles.sub}> Navegador</Text>
442 448
 							<View style = {styles.buttons}>
443
-							
444 449
 			 		 			<Button
445 450
 								onPress = {this.setNews}
446 451
 				 				title = "Noticias"
447
-				 				color = "rgba(255, 0, 0, 0)"
452
+				 				color = "white"
448 453
 			  					/>
449
-			  
450 454
 			  					<Button
451 455
 								 onPress = {this.setData}
452 456
 								 title = "Datos"
453
-								 color = "rgba(255, 0, 0, 0)"
457
+								 color = "white"
454 458
 			  					/>
455 459
 							</View>
456 460
 						

+ 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"