Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Info Visualisation Students performance in exams
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Edward Sabinus
Info Visualisation Students performance in exams
Commits
bd5bc264
Commit
bd5bc264
authored
3 years ago
by
Edward Sabinus
Browse files
Options
Downloads
Patches
Plain Diff
Added new data type
parent
3bf0e614
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Programm/src/StudentsPerformanceInExams.elm
+17
-7
17 additions, 7 deletions
Programm/src/StudentsPerformanceInExams.elm
with
17 additions
and
7 deletions
Programm/src/StudentsPerformanceInExams.elm
+
17
−
7
View file @
bd5bc264
...
...
@@ -38,7 +38,7 @@ main =
-- MODEL
type
alias
Model
=
{
httpState
:
HttpState
,
fullTexts
:
List
{
description
:
String
,
data
:
String
}
,
data
:
List
Data
,
data
:
List
Old
Data
,
error
:
String
}
...
...
@@ -51,7 +51,17 @@ type Arrangement
=
Line_By_Line
|
Forth_Loop
type
alias
Data
=
{
description
:
String
,
data
:
List
(
String
,
Maybe
Float
)}
type
alias
OldData
=
{
description
:
String
,
data
:
List
(
String
,
Maybe
Float
)}
type
alias
Data
=
{
gender
:
String
,
race
:
String
,
parentEducation
:
String
,
lunch
:
String
,
testPreparation
:
String
,
mathScore
:
String
,
readingScore
:
String
,
writingScore
:
String
}
filesToLoad
=
[
"
StudentsPerformance.csv"
...
...
@@ -93,7 +103,7 @@ updateModel msg model =
,
fullTexts
=
checkedFullTexts
,
data
=
prepareData
<|
List
.
map
(
\
data
->
Data
data
.
description
<|
csvString_to_data
data
.
data
)
(
\
data
->
Old
Data
data
.
description
<|
csvString_to_data
data
.
data
)
checkedFullTexts
}
else
{
model
|
httpState
=
Loading
(
filesLeft
-
1
)
...
...
@@ -180,14 +190,14 @@ viewArrangement arrangement drawList =
)
(
coordsListToListOfLines
drawList
)
]
viewDataWithDescription
:
(
Int
,
Int
)
->
List
(
Int
,
Int
)
->
Data
->
Html
Msg
viewDataWithDescription
:
(
Int
,
Int
)
->
List
(
Int
,
Int
)
->
Old
Data
->
Html
Msg
viewDataWithDescription
(
w
,
h
)
drawList
zeitreihe
=
Html
.
div
[]
[
Html
.
h4
[]
[
Html
.
text
zeitreihe
.
description
]
,
viewData
(
w
,
h
)
drawList
zeitreihe
]
viewData
:
(
Int
,
Int
)
->
List
(
Int
,
Int
)
->
Data
->
Html
Msg
viewData
:
(
Int
,
Int
)
->
List
(
Int
,
Int
)
->
Old
Data
->
Html
Msg
viewData
(
w
,
h
)
drawList
zeitreihe
=
Html
.
div
[]
[
svg
[
viewBox
0
0
(
toFloat
w
)
(
toFloat
h
)
,
TypedSvg
.
Attributes
.
width
<|
TypedSvg
.
Types
.
Percent
100
...
...
@@ -267,7 +277,7 @@ decodeStockDay =
)
)
prepareData
:
List
Data
->
List
Data
prepareData
:
List
Old
Data
->
List
Old
Data
prepareData
rawData
=
let
startDate
=
Date
.
fromCalendarDate
1980
Dec
23
untilDate
=
Date
.
fromCalendarDate
2011
Jun
9
...
...
@@ -299,7 +309,7 @@ dataToString dataList =
<|
List
.
map
(
\
elem
->
(
Tuple
.
first
elem
)
++
"
"
++
(
let
rightString
=
String
.
fromFloat
<|
Maybe
.
withDefault
-
1234879231
<|
Tuple
.
second
elem
in
if
rightString
==
"
-1234879231"
then
"
No Data"
else
rightString
in
if
rightString
==
"
-1234879231"
then
"
No
Old
Data"
else
rightString
)
++
"
\
n"
)
dataList
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment