mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
column can by given on the fly (dependency injection). Show Parent graphs on analyze page.
38 lines
703 B
Ruby
38 lines
703 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Analyze
|
|
module Graph
|
|
class StudentsByIncome
|
|
attr_reader :incomes
|
|
|
|
def initialize(incomes:)
|
|
@incomes = incomes
|
|
end
|
|
|
|
def to_s
|
|
"Students by income"
|
|
end
|
|
|
|
def slug
|
|
"students-by-income"
|
|
end
|
|
|
|
def columns
|
|
[].tap do |array|
|
|
incomes.each do |income|
|
|
array << Analyze::Graph::Column::Income.new(income:)
|
|
end
|
|
array << Analyze::Graph::Column::AllStudent.new
|
|
end
|
|
end
|
|
|
|
def source
|
|
Analyze::Source::SurveyData.new(slices: nil)
|
|
end
|
|
|
|
def slice
|
|
Analyze::Slice::StudentsByGroup.new
|
|
end
|
|
end
|
|
end
|
|
end
|