-
Notifications
You must be signed in to change notification settings - Fork 4
/
DynamicGraphCarousel.html
260 lines (209 loc) · 9.07 KB
/
DynamicGraphCarousel.html
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="Author" content="Leslie Bondaryk" />
<meta name="Owner" content="Pearson" />
<meta name="Copyright" content="Copyright (c) 2013 Pearson. All rights reserved." />
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<meta content="Carmen Santiago, Demo Book" name="description" />
<title class="setTitle"></title>
<!-- bootstrap_plus.css contains styling for the dropdown menu and other common core styles -->
<link href="css/bootstrap_plus.css" rel="stylesheet" media="screen">
<!-- widgets.css contains styling for the interactive brix -->
<link href="css/widgets.css" rel="stylesheet">
<!-- eCourse-master.css contains styling for all the navigation -->
<link href="css/eCourse-master.css" rel="stylesheet" media="screen">
<!-- content_styles.css contains styling for the narrative layout and responsive design -->
<link href="css/content_styles.css" rel="stylesheet" media="screen">
</head>
<body>
<!-- Body Content -->
<div class="container">
<div class="span12 lc_ec_page">
<section class="lc_ec_majorMinor lc_ec_pageInner">
<div class="lc_ec_content">
<h2 class="lc_ec_bHead"><span class='number setId'></span>
<span class="setTitle">LO 10.14 Explain racial and ethnic disparities on indicators related to health.</span>
</h2>
<div class="lc_ec_leading">
<p>Racial inequality is not just reflected in socioeconomic indicators such as income, wealth, and education; racial and ethnic groups also show large disparities on a variety of other indicators of well-being, in particular those related to health. To see examples, explore the graphs below in Figure 10.6 to discover more about some of the differences in health-related indicators for various groups. </p>
<div id="table0" ></div>
<figure id="graphGrouped"><p>Select mortality rates to see a comparitive chart for each.
</p>
</figure>
<div id="table1" style = 'width: 100%;'></div>
<p>Why is there such a big gap in health well-being? Many of these disparities in health are related to differences in healthcare coverage. According to the U.S. Census Bureau (2011), about 30 percent of Hispanics and 20 percent of African Americans lack health insurance or access to a regular source of healthcare, compared to less than 12 percent of whites. As a result, African Americans and Latinos are far more likely than whites to rely on emergency clinics for their usual source of health care (U.S. Department of Health and Human Services 2000). Additionally, the combination of lower household incomes and housing segregation has meant that it is far more likely that African Americans and Latinos live in higher-poverty, higher-crime neighborhoods (Sharkey 2013). The resulting stresses accumulated over a lifetime from living in more dangerous areas can be very damaging for an individual’s health.</p>
<div id="mcQuestion0"></div>
</div>
</div>
</section>
</div>
</div>
<script src="js/jquery-latest.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery-ui-1.10.2.custom.js"></script>
<script src="js/toc-structure.js"></script>
<script src="js/eCourse-master.js"></script>
<script src="js/d3.v3.min.js"></script>
<script src="js/brixlib-compiled.js"></script>
<script>
// local aliases for convenience
var SVGContainer = pearson.brix.SVGContainer;
var Callouts = pearson.brix.Callouts;
var BarChart = pearson.brix.BarChart;
var Legend = pearson.brix.Legend;
var LabelSelector = pearson.brix.LabelSelector;
var EventManager = pearson.utils.EventManager;
var SubmitManager = pearson.brix.SubmitManager;
var MultipleChoiceQuestion = pearson.brix.MultipleChoiceQuestion;
var SelectGroup = pearson.brix.SelectGroup;
var RadioGroup = pearson.brix.RadioGroup;
var sign = pearson.brix.utils.sign;
var eventManager = new EventManager();
var submitManager = new SubmitManager(eventManager);
var coronary = [
{ y: "Whites", x: 134.2},
{ y: "Blacks", x: 161.6},
{ y: "Hispanics", x: 106.4},
{ y: "Asians", x: 77.1},
];
var HIV = [
{ y: "Whites", x: 8.2},
{ y: "Blacks", x: 73.7},
{ y: "Hispanics", x: 25},
{ y: "Asians", x: 7.2},
];
var infant = [
{ y: "Whites", x: 5.58},
{ y: "Blacks", x: 13.36},
{ y: "Hispanics", x: 5.41},
{ y: "Asians", x: 4.55},
];
var homicide = [
{ y: "Whites", x: 2.7},
{ y: "Blacks", x: 23.1},
{ y: "Hispanics", x: 7.6},
{ y: "Asians", x: 2.4},
];
var svgGroup = new SVGContainer(
{node: d3.select("#graphGrouped"),
maxSize: { height: 400, width: 600}
}
);
var groupGraph = new BarChart ({
Data: [coronary],
xAxisFormat: {
type: "linear",
ticks: 4,
orientation: "bottom",
label: "Mortality Rate (deaths per 100,000/year)"},
yAxisFormat: { type: "ordinal",
orientation: "left",
yLabel: "Cause of Death"},
}, eventManager);
svgGroup.append(groupGraph, {topPercentOffset: .1, leftPercentOffset: 0, heightPercent: 1, widthPercent: 1});
/*
var legBar = new Legend({
xPos: "right", yPos: "top",
labels: [
{content: "White"},
{content: "Black"},
{content: "Hispanic"},
{content: "Asian"}
],
type: "box"
}, eventManager);
groupGraph.append(legBar);
*/
var labelButtons = new LabelSelector({
labels: ["Coronary Deaths", "HIV Deaths", "Infant Mortality", "Homicide"],
layout: "horizontal",
itemMargin: {top: 5, bottom: 5, left: 0, right: 0},
//type: "numbered"
}, eventManager);
svgGroup.append(labelButtons, {topPercentOffset: 0, leftPercentOffset: 0, heightPercent: 0.2, widthPercent: 1});
var graphReadout = new Callouts({
//show: "all",
headers: ["Deaths per 100,000/year", coronary[3].y, coronary[2].y, coronary[1].y, coronary[0].y ],
textBits: [
{cols: [ "Coronary Deaths", coronary[3].x, coronary[2].x, coronary[1].x, coronary[0].x ]},
{cols: [ "HIV Deaths", HIV[3].x, HIV[2].x, HIV[1].x, HIV[0].x ]},
{cols: [ "Infant Mortality", infant[3].x, infant[2].x, infant[1].x, infant[0].x ]},
{cols: [ "Homicide", homicide[3].x, homicide[2].x, homicide[1].x, homicide[0].x ]},
],
},eventManager);
var insTable = new Callouts({
//show: "all",
//headers: ["Mortality Rate", "Details" ],
textBits: [
{cols: ["Death Rates for Coronary Heart Disease in 2008", "Coronary heart disease is the leading cause of death in the United States, but African Americans are much more likely to die from this condition than any other racial group (Centers for Disease Control and Prevention 2011)."]},
{cols:["Rates of HIV Infection of Persons Over 13 Years of Age per 100,000 in 2008",
"Blacks have by far the highest rates of HIV infection among any racial or ethnic group in the United States. The rate of HIV infection among African Americans is about 10 times the rate for whites and Asians and about 3 times the rate for Hispanics. "]},
{cols: ["Rates of Infant Mortality per 100,000 in 2006", "African Americans have the highest rate of infant mortality in the United States, a rate that is more than double that of whites, Asians, and Hispanics."]},
{cols: ["Homicide Rates per 100,000 in 2007", "One of the most striking disparities in mortality is in the area of homicide. For example, in 2007 the homicide rate for black males was over 10 times the rate for white and Asian males and about 4 times the rate for Latinos and Native Americans."]},
],
},eventManager);
insTable.draw(d3.select("#table1"));
graphReadout.draw(d3.select("#table0"));
eventManager.subscribe(labelButtons.selectedEventId, liteUp);
//eventManager.subscribe(legBar.selectedEventId, liteUp);
liteUp({selectKey: "0"});
function liteUp (liteKey)
{
//groupGraph.lite(liteKey.selectKey);
switch(liteKey.selectKey)
{
case "0":
groupGraph.data = [coronary];
break;
case "1":
groupGraph.data = [HIV];
break;
case "2":
groupGraph.data = [infant];
break;
default:
groupGraph.data = [homicide];
break;
}
groupGraph.redraw();
insTable.lite(liteKey.selectKey);
//legBar.lite(liteKey.selectKey);
graphReadout.lite(liteKey.selectKey);
labelButtons.lite(liteKey.selectKey);
}
var Q0Choices = [
{
content: "differing socioeconomic and environmental conditions",
answerKey: "answer000"
},
{
content: "availability/affordability of insurance",
answerKey: "answer001"
},
{
content: "barriers to health literacy",
answerKey: "answer002"
},
{
content: "linguistic barriers",
answerKey: "answer003"
},
];
var Q0 = new MultipleChoiceQuestion({
questionId: "mortality",
question: "Disparities in health exist among racial groups because of ",
choices: Q0Choices,
order: "randomized",
widget: RadioGroup,
widgetConfig: {
numberFormat: "none",
question: true,
},
}, eventManager);
Q0.draw(d3.select("#mcQuestion0"));
submitManager.handleRequestsFrom(Q0);
</script>
</body>
</html>