chore: show analyze page without errors

This commit is contained in:
Nelson Jovel 2024-01-26 19:07:15 -08:00
parent e4e6a5c7fb
commit b47f8d2f61
84 changed files with 2243 additions and 1792 deletions

View file

@ -7,7 +7,6 @@ module Dashboard
def show def show
@categories = Category.sorted.map { |category| CategoryPresenter.new(category:) } @categories = Category.sorted.map { |category| CategoryPresenter.new(category:) }
puts params
@category = CategoryPresenter.new(category: Category.find_by_slug(params[:id])) @category = CategoryPresenter.new(category: Category.find_by_slug(params[:id]))
end end
end end

View file

@ -45,7 +45,7 @@ module Dashboard
@empty_dataset ||= Hash.new do |memo, (school, academic_year)| @empty_dataset ||= Hash.new do |memo, (school, academic_year)|
memo[[school, academic_year]] = measures.none? do |measure| memo[[school, academic_year]] = measures.none? do |measure|
response_rate = measure.subcategory.response_rate(school:, academic_year:) response_rate = measure.subcategory.response_rate(school:, academic_year:)
response_rate.meets_student_threshold || response_rate.meets_teacher_threshold || measure.sufficient_admin_data?(school:, academic_year:) response_rate.meets_student_threshold? || response_rate.meets_teacher_threshold? || measure.sufficient_admin_data?(school:, academic_year:)
end end
end end
@ -56,7 +56,7 @@ module Dashboard
@empty_survey_dataset ||= Hash.new do |memo, (school, academic_year)| @empty_survey_dataset ||= Hash.new do |memo, (school, academic_year)|
memo[[school, academic_year]] = measures.none? do |measure| memo[[school, academic_year]] = measures.none? do |measure|
response_rate = measure.subcategory.response_rate(school:, academic_year:) response_rate = measure.subcategory.response_rate(school:, academic_year:)
response_rate.meets_student_threshold || response_rate.meets_teacher_threshold response_rate.meets_student_threshold? || response_rate.meets_teacher_threshold?
end end
end end
@empty_survey_dataset[[school, academic_year]] @empty_survey_dataset[[school, academic_year]]

View file

@ -3,16 +3,16 @@
module Dashboard module Dashboard
module HeaderHelper module HeaderHelper
def link_to_overview(district:, school:, academic_year:) def link_to_overview(district:, school:, academic_year:)
"/districts/#{district.slug}/schools/#{school.slug}/overview?year=#{academic_year.range}" district_school_overview_index_path(district, school, year: academic_year.range)
end end
def link_to_browse(district:, school:, academic_year:) def link_to_browse(district:, school:, academic_year:)
"/districts/#{district.slug}/schools/#{school.slug}/browse/teachers-leadership?year=#{academic_year.range}" district_school_category_path(district, school, { year: academic_year.range, id: "teachers-leadership" })
end end
def link_to_analyze(district:, school:, academic_year:) def link_to_analyze(district:, school:, academic_year:)
year = academic_year.range year = academic_year.range
"/districts/#{district.slug}/schools/#{school.slug}/analyze?year=#{year}&category=1&academic_years=#{year}" district_school_analyze_index_path(district, school, { year:, category: 1, academic_years: year })
end end
def district_url_for(district:, academic_year:) def district_url_for(district:, academic_year:)

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
class BarPresenter class BarPresenter
include AnalyzeHelper include AnalyzeHelper
@ -83,3 +84,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
class AllData class AllData
@ -18,3 +19,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -37,3 +38,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -31,3 +32,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -45,3 +46,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -40,3 +41,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -31,3 +32,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,3 +1,6 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -16,3 +19,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -24,7 +25,8 @@ module Analyze
end end
def ell def ell
::Ell.find_by_slug "not-ell" Ell.find_by_slug "not-ell"
end
end end
end end
end end

View file

@ -1,3 +1,6 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -40,3 +43,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -24,7 +25,8 @@ module Analyze
end end
def ell def ell
::Ell.find_by_slug "unknown" Ell.find_by_slug "unknown"
end
end end
end end
end end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -31,3 +32,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,3 +1,6 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -16,3 +19,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -31,3 +32,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -31,3 +32,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,3 +1,6 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -40,3 +43,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -31,3 +32,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -31,3 +32,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -31,3 +32,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -31,3 +32,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -31,3 +32,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,3 +1,6 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -16,3 +19,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -31,3 +32,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -31,3 +32,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,3 +1,6 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -40,3 +43,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -31,3 +32,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -31,3 +32,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -31,3 +32,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -31,3 +32,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -31,3 +32,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -31,3 +32,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -31,3 +32,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -170,3 +171,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -27,3 +28,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,3 +1,6 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -16,3 +19,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -27,3 +28,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,3 +1,6 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -40,3 +43,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -27,3 +28,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -27,3 +28,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -27,3 +28,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -27,3 +28,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -27,3 +28,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -28,3 +29,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -27,3 +28,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,3 +1,6 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -18,3 +21,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -27,3 +28,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -27,3 +28,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,3 +1,6 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -38,3 +41,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -32,3 +33,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,3 +1,6 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -40,3 +43,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -32,3 +33,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,3 +1,6 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -16,3 +19,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
module Column module Column
@ -32,3 +33,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,15 +1,16 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
class StudentsAndTeachers class StudentsAndTeachers
include Analyze::Graph::Column include Analyze::Graph::Column
def to_s def to_s
'Students & Teachers' "Students & Teachers"
end end
def slug def slug
'students-and-teachers' "students-and-teachers"
end end
def columns def columns
@ -18,3 +19,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
class StudentsByEll class StudentsByEll
@ -42,3 +43,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
class StudentsByGender class StudentsByGender
@ -43,3 +44,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
class StudentsByGrade class StudentsByGrade
@ -51,3 +52,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
class StudentsByIncome class StudentsByIncome
@ -40,3 +41,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
class StudentsByRace class StudentsByRace
@ -45,3 +46,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Graph module Graph
class StudentsBySped class StudentsBySped
@ -41,3 +42,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,3 +1,6 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Group module Group
class Ell class Ell
@ -11,3 +14,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,12 +1,16 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Group module Group
class Gender class Gender
def name def name
'Gender' "Gender"
end end
def slug def slug
'gender' "gender"
end
end end
end end
end end

View file

@ -1,12 +1,16 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Group module Group
class Grade class Grade
def name def name
'Grade' "Grade"
end end
def slug def slug
'grade' "grade"
end
end end
end end
end end

View file

@ -1,12 +1,16 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Group module Group
class Income class Income
def name def name
'Income' "Income"
end end
def slug def slug
'income' "income"
end
end end
end end
end end

View file

@ -1,12 +1,16 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Group module Group
class Race class Race
def name def name
'Race' "Race"
end end
def slug def slug
'race' "race"
end
end end
end end
end end

View file

@ -1,3 +1,6 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Group module Group
class Sped class Sped
@ -11,3 +14,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,3 +1,4 @@
module Dashboard
module Analyze module Analyze
class Presenter class Presenter
attr_reader :params, :school, :academic_year attr_reader :params, :school, :academic_year
@ -120,8 +121,12 @@ module Analyze
end end
def groups def groups
@groups = [Analyze::Group::Ell.new, Analyze::Group::Gender.new, Analyze::Group::Grade.new, Analyze::Group::Income.new, @groups = [Analyze::Group::Ell.new,
Analyze::Group::Race.new, Analyze::Group::Sped.new] Analyze::Group::Gender.new,
Analyze::Group::Grade.new,
Analyze::Group::Income.new,
Analyze::Group::Race.new,
Analyze::Group::Sped.new]
end end
def group def group
@ -198,3 +203,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,12 +1,15 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Slice module Slice
class AllData class AllData
def to_s def to_s
'All Data' "All Data"
end end
def slug def slug
'all-data' "all-data"
end end
def graphs def graphs
@ -15,3 +18,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,12 +1,15 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Slice module Slice
class StudentsAndTeachers class StudentsAndTeachers
def to_s def to_s
'Students & Teachers' "Students & Teachers"
end end
def slug def slug
'students-and-teachers' "students-and-teachers"
end end
def graphs def graphs
@ -15,3 +18,4 @@ module Analyze
end end
end end
end end
end

View file

@ -1,3 +1,6 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Slice module Slice
class StudentsByGroup class StudentsByGroup
@ -9,15 +12,17 @@ module Analyze
end end
def to_s def to_s
'Students by Group' "Students by Group"
end end
def slug def slug
'students-by-group' "students-by-group"
end end
def graphs def graphs
[Analyze::Graph::StudentsByRace.new(races:), Analyze::Graph::StudentsByGrade.new(grades:)] [Analyze::Graph::StudentsByRace.new(races:),
Analyze::Graph::StudentsByGrade.new(grades:)]
end
end end
end end
end end

View file

@ -1,3 +1,6 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Source module Source
class AllData class AllData
@ -10,11 +13,12 @@ module Analyze
end end
def to_s def to_s
'All Data' "All Data"
end end
def slug def slug
'all-data' "all-data"
end
end end
end end
end end

View file

@ -1,3 +1,6 @@
# frozen_string_literal: true
module Dashboard
module Analyze module Analyze
module Source module Source
class SurveyData class SurveyData
@ -10,11 +13,12 @@ module Analyze
end end
def to_s def to_s
'Survey Data Only' "Survey Data Only"
end end
def slug def slug
'survey-data-only' "survey-data-only"
end
end end
end end
end end

View file

@ -0,0 +1,17 @@
<div class="d-flex align-items-center mx-5">
<input
id="<%= id %>"
class="m-3 <%= name %>-checkbox form-check-input"
type="checkbox"
name="<%= name %>-checkbox"
value="<%= base_url %>"
data-action="click->analyze#refresh"
<%= selected_items.include?(item) ? "checked" : "" %>
<%= @presenter.graph.slug == 'students-and-teachers' || @presenter.source.slug == 'all-data' ? "disabled" : "" %>
<%= @presenter.group.slug == name ? "" : "hidden" %>>
<label for="<%= id %>"
<%= @presenter.group.slug == name ? "" : "hidden" %>>
<%= label_text %>
</label>
</div>

View file

@ -0,0 +1,41 @@
<h3 class="sub-header-4 mt-5">Data Filters</h3>
<div class="bg-gray p-3" data-controller="analyze">
<% @presenter.sources.each do |source| %>
<input type="radio"
id="<%= source.slug %>"
class="form-check-input"
name="source"
value="<%= base_url %>"
data-action="click->analyze#refresh"
<%= source.slug == @presenter.source.slug ? "checked" : "" %>>
<label for="<%= source.slug %>"><%= source.to_s %></label>
<% source.slices.each do | slice | %>
<div class="mx-3">
<input type="radio"
id="<%= slice.slug %>"
class="form-check-input"
name="slice"
value="<%= base_url %>"
data-action="click->analyze#refresh"
<%= slice.slug == @presenter.slice.slug ? "checked" : "" %>
<%= slice.slug == "all-data" ? "hidden" : "" %>>
<label for="<%= slice.slug %>"
<%= slice.slug == "all-data" ? "hidden" : "" %>>
<%= slice.to_s %></label>
</div>
<% end %>
<% end %>
<%= render partial: "group_selectors" %>
</div>
<script>
window.source = "<%= @presenter.source.slug %>";
window.slice = "<%= @presenter.slice.slug %>";
window.group = "<%= @presenter.group.slug %>";
window.graph = "<%= @presenter.graph.slug %>";
</script>

View file

@ -0,0 +1,14 @@
<h3 class="sub-header-4">Focus Area</h3>
<p>Select a category & subcategory to analyze measure-level results</p>
<select id="select-category" class="mx-3 form-select" data-id="category-dropdown" data-action="analyze#refresh">
<% categories.each do |category| %>
<option value="<%= analyze_category_link(district: district, school: school, academic_year: academic_year, category: category) %>" <%= category.id == @presenter.category.id ? "selected": "" %>><%= "#{category.category_id}: #{category.name}" %></option>
<% end %>
</select>
<select id="select-subcategory" class="mx-3 form-select mt-3" data-id="subcategory-dropdown" data-action="analyze#refresh">
<% subcategories.each do |subcategory| %>
<option value="<%= analyze_subcategory_link(district: district, school: school, academic_year: academic_year, category: category, subcategory: subcategory) %>" <%= subcategory.subcategory_id == @presenter.subcategory.subcategory_id ? "selected": "" %>>
<%= "#{subcategory.subcategory_id}: #{subcategory.name}" %>
</option>
<% end %>
</select>

View file

@ -0,0 +1,30 @@
<g id="graph-background">
<rect x="0" y="0" width="100%" height="<%= background.analyze_zone_height * 2 %>%" fill="#edecf0" />
<rect x="0" y="<%= background.analyze_zone_height * 2 %>%" width="100%" height="<%= background.analyze_zone_height * 3 %>%" fill="#fffaee" />
<rect x="0" y="0" width="100%" height="<%= background.analyze_graph_height %>%" fill="none" stroke="grey" />
<rect x="0" y="<%= background.benchmark_y %>%" width="100%" height="<%= background.benchmark_height %>%" fill="black" />
<g id="zone-dividers" stroke-width="1">
<line x1="0" y1="17%" x2="100%" y2="17%" stroke="white" />
<line x1="0" y1="51%" x2="100%" y2="51%" stroke="#edecf0" />
<line x1="0" y1="68%" x2="100%" y2="68%" stroke="#edecf0" />
</g>
<g id="zone-labels">
<text class="zone-header" x="<%= background.zone_label_x %>%" y="<%= background.zone_label_y(1) %>%" text-anchor="start" dominant-baseline="middle">
Ideal
</text>
<text class="zone-header" x="<%= background.zone_label_x %>%" y="<%= background.zone_label_y(2) %>%" text-anchor="start" dominant-baseline="middle">
Approval
</text>
<text class="zone-header" x="<%= background.zone_label_x %>%" y="<%= background.zone_label_y(3) %>%" text-anchor="start" dominant-baseline="middle">
Growth
</text>
<text class="zone-header" x="<%= background.zone_label_x %>%" y="<%= background.zone_label_y(4) %>%" text-anchor="start" dominant-baseline="middle">
Watch
</text>
<text class="zone-header" x="<%= background.zone_label_x %>%" y="<%= background.zone_label_y(5) %>%" text-anchor="start" dominant-baseline="middle">
Warning
</text>
</g>
</g>

View file

@ -0,0 +1,31 @@
<select id="select-group" name="group" class="mx-4 form-select" data-id="group-dropdown" data-action="analyze#refresh">
<% @presenter.groups.each do |group| %>
<option id="<%= group.slug %>" name="group-option" value="<%= base_url %>" <%= group.slug == @presenter.group.slug ? "Selected": "" %>><%= group.name %> </option>
<% end %>
</select>
<p class="sub-header-5 mx-4 mt-3 font-size-14"> Select a group </p>
<% @presenter.races.each do |race| %>
<%= render(partial: "checkboxes", locals: {id: "race-#{race.slug}", item: race, selected_items: @presenter.selected_races, name: "race", label_text: race.designation}) %>
<% end %>
<% @presenter.grades.each do |grade| %>
<%= render(partial: "checkboxes", locals: {id: "grade-#{grade}", item: grade, selected_items: @presenter.selected_grades, name: "grade", label_text: grade}) %>
<% end %>
<% @presenter.genders.each do |gender| %>
<%= render(partial: "checkboxes", locals: {id: "gender-#{gender.designation}", item: gender, selected_items: @presenter.selected_genders, name: "gender", label_text: gender.designation}) %>
<% end %>
<% @presenter.incomes.each do |income| %>
<%= render(partial: "checkboxes", locals: {id: "income-#{income.slug}", item: income, selected_items: @presenter.selected_incomes, name: "income", label_text: income.label}) %>
<% end %>
<% @presenter.ells.each do |ell| %>
<%= render(partial: "checkboxes", locals: {id: "ell-#{ell.slug}", item: ell, selected_items: @presenter.selected_ells, name: "ell", label_text: ell.designation}) %>
<% end %>
<% @presenter.speds.each do |sped| %>
<%= render(partial: "checkboxes", locals: {id: "sped-#{sped.slug}", item: sped, selected_items: @presenter.selected_speds, name: "sped", label_text: sped.designation}) %>
<% end %>

View file

@ -0,0 +1,10 @@
<svg width="100%" height="<%= svg_height %>">
<%= render partial: "graph_background", locals: {background: @background} %>
<% number_of_columns = @presenter.graph.columns.length %>
<% @presenter.graph.columns.each_with_index do |column, index| %>
<% p = column.new(measure: measure, school: @school, academic_years: @presenter.selected_academic_years, position: index , number_of_columns:) %>
<%= render partial: "grouped_bar_column", locals: {column: p} %>
<% end %>
</svg>

After

Width:  |  Height:  |  Size: 493 B

View file

@ -0,0 +1,53 @@
<g class="grouped-bar-column" data-for-measure-id="<%= column.measure.measure_id %>">
<% score_label_y = [5, 10, 15, 5, 10, 15 ] %>
<% column.bars.each_with_index do |bar, index| %>
<% if column.sufficient_data?(index) %>
<rect
<% if column.show_popover? %>
data-bs-toggle="popover"
data-bs-placement="right"
data-bs-content="<%= column.popover_content(index) %>"
<% end %>
data-for-academic-year="<%= bar.academic_year.range %>"
x="<%= bar.x_position %>%"
y="<%= bar.y_offset %>%"
width="<%= column.bar_width %>%"
height="<%= bar.bar_height_percentage %>%"
fill="<%= bar.color %>" />
<% if ENV["SCORES"].present? && ENV["SCORES"].upcase == "SHOW" %>
<text x="<%= bar.x_position + (column.bar_width * 0.5) %>%" y="<%= score_label_y[index] %>%" text-anchor="middle" dominant-baseline="middle">
<%= bar.average %>
</text>
<% end %>
<% end %>
<% end %>
<line x1="<%= column.column_start_x %>%" y1="0" x2="<%= column.column_start_x %>%" y2="85%" stroke="grey" stroke-width="1" stroke-dasharray="5,2" />
<% words = column.label %>
<% words.each_with_index do | line, index | %>
<text class="graph-footer" x="<%= column.column_midpoint %>%" y="<%= column.bar_label_height + (index * 5) %>%" text-anchor="middle" dominant-baseline="middle" data-grouped-bar-label="<%= column.label %>">
<%= line %>
</text>
<% end %>
<% if column.show_irrelevancy_message? %>
<rect x="<%= column.message_x %>%" y="<%= column.message_y %>%" rx="15" ry="15" width="<%= column.message_width %>%" height="<%= column.message_height %>%" fill="white" stroke="gray" />
<text x="<%= column.column_midpoint %>%" y="<%= 20 %>%" text-anchor="middle">
<tspan x="<%= column.column_midpoint %>%" y="29%">measure not</tspan>
<tspan x="<%= column.column_midpoint %>%" y="34%">based on</tspan>
<tspan x="<%= column.column_midpoint %>%" y="39%"><%= column.basis %></tspan>
</text>
<% elsif column.show_insufficient_data_message? %>
<rect x="<%= column.message_x %>%" y="<%= column.message_y %>%" rx="15" ry="15" width="<%= column.message_width %>%" height="<%= column.message_height %>%" fill="white" stroke="gray" />
<text x="<%= column.column_midpoint %>%" y="<%= 20 %>%" text-anchor="middle">
<% column.insufficiency_message.each_with_index do |line, index| %>
<% offset = 29 + index * 5 %>
<tspan x='<%= column.column_midpoint %>%' y='<%= offset %>%'><%= line %></tspan>
<% end %>
</text>
<% end %>
</g>

View file

@ -0,0 +1,34 @@
<h3 class="sub-header-4 mt-5">School Years</h3>
<% available_academic_years.each_with_index do | year, index | %>
<div class="d-flex justify-content-start align-items-center mt-1" data-controller="analyze">
<input type="checkbox"
class="form-check-input"
id="<%= year.range %>"
name="year-checkbox"
value="<%= analyze_subcategory_link(district: district, school: school, academic_year: academic_year, category: category, subcategory: subcategory) %>"
<%= selected_academic_years.include?(year) ? "checked" : "" %>
data-action="click->analyze#refresh"
<% empty_dataset = empty_dataset?(measures: measures, school: school, academic_year: year) %>
<% empty_survey_dataset = empty_survey_dataset?(measures: measures, school: school, academic_year: year) %>
<% if graph.slug == 'all-data' %>
<%= empty_dataset ? "disabled" : "" %>
<% else %>
<%= empty_survey_dataset ? "disabled" : "" %>
<% end %>
>
<label class="px-3" for="<%= year.range %>"><%= year.range %></label><br>
<div class="bg-color-blue px-3" style="width:20px;height:20px;background-color:<%= colors[index] %>;"></div>
<% if graph.slug == 'all-data' && empty_dataset %>
<i class="fa-solid fa-circle-exclamation px-3"
data-bs-toggle="popover" data-bs-placement="right"
data-bs-content="No admin data OR teacher and student survey response rates below <%= Dashboard::ResponseRate::TEACHER_RATE_THRESHOLD %>%">
</i>
<% end %>
<% if graph.slug != 'all-data' && empty_survey_dataset %>
<i class="fa-solid fa-circle-exclamation px-3"
data-bs-toggle="popover" data-bs-placement="right"
data-bs-content="Teacher and student survey response rates below <%= Dashboard::ResponseRate::TEACHER_RATE_THRESHOLD %>%">
</i>
<% end %>
</div>
<% end %>

View file

@ -0,0 +1,27 @@
<% content_for :title do %>
<h1 class="sub-header-2 color-white m-0"> Analysis of <%= @school.name %> </h1>
<% end %>
<div class="graph-content">
<div class="breadcrumbs sub-header-4">
<%= @presenter.category.category_id %>:<%= @presenter.category.name %> > <%= @presenter.subcategory.subcategory_id %>:<%= @presenter.subcategory.name %>
</div>
<hr>
</div>
<div class="d-flex flex-row pt-5 row">
<div class="d-flex flex-column flex-grow-6 bg-color-white col-3 px-5" data-controller="analyze">
<%= render partial: "focus_area", locals: {categories: @presenter.categories, district: @district, school: @school, academic_year: @academic_year, category: @presenter.category, subcategories: @presenter.subcategories} %>
<%= render partial: "school_years", locals: {available_academic_years: @presenter.academic_years, selected_academic_years: @presenter.selected_academic_years, district: @district, school: @school, academic_year: @academic_year, category: @presenter.category, subcategory: @presenter.subcategory, measures: @presenter.measures, graph: @presenter.graph} %>
<%= render partial: "data_filters", locals: {district: @district, school: @school, academic_year: @academic_year, category: @presenter.category, subcategory: @presenter.subcategory} %>
</div>
<% cache [@school, @presenter.cache_objects] do %>
<div class="bg-color-white flex-grow-1 col-9">
<% @presenter.measures.each do |measure| %>
<section class="mb-6">
<p class="construct-id">Measure <%= measure.measure_id %></p>
<h2> <%= measure.name %> </h2>
<%= render partial: "grouped_bar_chart" , locals: { measure: measure} %>
</section>
<% end %>
</div>
<% end %>
</div>