|
@@ -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
|
|