-
Notifications
You must be signed in to change notification settings - Fork 0
/
project_schema.txt
138 lines (109 loc) · 2.42 KB
/
project_schema.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
State Tree
{
currStateShown: {
id: 5,
name: California,
pellGrantPercent: {
2011: 57,
2012: 62,
2013: 75,
2014: 67,
2015: 32
},
numStudentsK12: {
2011: 57000,
2012: 62000,
2013: 75000,
2014: 67000,
2015: 32000
}
...
}
stateList:[
{
id: 1
name: California
},
{
id: 2
name: Alabama
},
{
id: 3
name: Louisiana
},
],
currInstitutionShown: {...}
institutionList:[...],
}
Questions:
- should the actual data for each state or institution be stored in the state tree?
-Yes: single api call instead of repeating same api call every time it needs the data
-No: that's gunna be so much data (10,000+ entries, each with 30+ properties) to store
Probably not, but it does make sense to store the stateList and institutionList so that there will be a single api call to get them all and can be prepopulated for all search boxes, when selected can then call api to load full data for single state/institution
- does it make more sense to store multiyear data as flat entries -
{
...
pellGrantPercent2011:30,
pellGrantPercent2012:31,
pellGrantPercent2013:40,
...
}
or nested? -
{
...
pellGrantPercent: {
2011: 57,
2012: 62,
2013: 75,
2014: 67,
2015: 32
},
...
}
-flat: all the tutorials talk about how much easier it is to manipulate flat state trees, but won't actually be manipulating at all (should probably not store except for the current state/inst anyway)
-nested: a bit more difficult to get the data in the database into this state -> lookup functions to manipulate the mongo db
Probably nested
Actions
// called when first page (any type) is loaded, see redux async
GetStateList
GetInstitutionList
// called when state or institution profile page is loaded, async api call to get single state/inst
ChangeCurrentStateShown
ChangeCurrentInstitutionShown
Component Structure
LandingPage
Menu
SearchBox
TopNav
Menu
ExpandableSearchBox
Footer
StateProfile
SectionNav
ProfileSection
ProfileSection
ProfileSection
ProfileSection
ProfileSection
InstitutionProfile
SectionNav
ProfileSection
ProfileSection
ProfileSection
ProfileSection
ProfileSection
Profile Section(title, description)
DataBlock
DataBlock
...
DataBlock
DataBlock(title)
Description
Graph
Description(text - annotated somehow with data references?)
DataReference
DataReference
...
DataReference
Graph(graphType, whichVariables)