Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
components
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Wandelwerk-Software
libraries
components
Commits
64c62698
Commit
64c62698
authored
Sep 22, 2020
by
Bruno Burke
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
component did update for scaled question
parent
359dadcb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
src/cljs/lernmeister/components/question_types/scaled/views/report.cljs
...eister/components/question_types/scaled/views/report.cljs
+11
-2
No files found.
src/cljs/lernmeister/components/question_types/scaled/views/report.cljs
View file @
64c62698
...
...
@@ -103,6 +103,16 @@
:plugins
[{
:afterDatasetsDraw
#
(
afterDraw
%
{
:mean
mean
:stdev
stdev
})}]
}))))
:component-did-update
(
fn
[
comp
]
(
let
[
bars
(
:bars
(
reagent/props
comp
))
freqs
(
:freqs
(
reagent/props
comp
))]
(
oset!
@
chart-instance
"data.labels"
(
clj->js
bars
))
(
oset!
@
chart-instance
"data.datasets.0.data"
(
clj->js
(
mapv
#
(
get
freqs
%
0
)
bars
)))
(
.update
@
chart-instance
)))
:component-will-unmount
(
fn
[]
(
when
@
chart-instance
...
...
@@ -120,7 +130,7 @@
(
defn
scale
[
question
&
{
:keys
[
answers
on-change
]}]
(
let
[
id
(
gensym
)]
(
fn
[
question
&
{
:keys
[
answer
on-change
]}]
(
fn
[
question
&
{
:keys
[
answer
s
on-change
]}]
(
let
[
abstention?
(
:abstention
question
)
freqs
(
frequencies
(
map
:value
answers
))
stats
(
freq/stats
(
dissoc
freqs
:abstention
))
...
...
@@ -142,7 +152,6 @@
(
str
"s="
(
gstring/format
"%.1f"
(
:stdev
stats
)))
[
:br
]
]
]]
))))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment