mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
move methods from analyze helper to background presenter
This commit is contained in:
parent
88339c729f
commit
c568e8bc06
10 changed files with 115 additions and 77 deletions
|
|
@ -1,48 +1,20 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module AnalyzeHelper
|
||||
def zone_label_width
|
||||
15
|
||||
end
|
||||
|
||||
def zone_label_x
|
||||
2
|
||||
end
|
||||
|
||||
def analyze_graph_height
|
||||
85
|
||||
end
|
||||
|
||||
def svg_height
|
||||
400
|
||||
end
|
||||
|
||||
def zone_label_width
|
||||
15
|
||||
end
|
||||
|
||||
def graph_width
|
||||
85
|
||||
end
|
||||
|
||||
def benchmark_y
|
||||
(analyze_zone_height * 2) - (benchmark_height / 2.0)
|
||||
end
|
||||
|
||||
def benchmark_height
|
||||
1
|
||||
end
|
||||
|
||||
def grouped_chart_column_width
|
||||
graph_width / data_sources
|
||||
end
|
||||
|
||||
def column_end_x(position)
|
||||
zone_label_width + (grouped_chart_column_width * position)
|
||||
end
|
||||
|
||||
def column_start_x(position)
|
||||
column_end_x(position - 1)
|
||||
end
|
||||
|
||||
def bar_label_height
|
||||
(100 - ((100 - analyze_graph_height) / 2))
|
||||
def analyze_graph_height
|
||||
85
|
||||
end
|
||||
|
||||
def analyze_zone_height
|
||||
|
|
@ -53,14 +25,6 @@ module AnalyzeHelper
|
|||
analyze_zone_height / 100.0
|
||||
end
|
||||
|
||||
def zone_label_y(position)
|
||||
8.5 * (position + position - 1)
|
||||
end
|
||||
|
||||
def data_sources
|
||||
3
|
||||
end
|
||||
|
||||
def analyze_category_link(district:, school:, academic_year:, category:)
|
||||
year = academic_year.range
|
||||
"/districts/#{district.slug}/schools/#{school.slug}/analyze?year=#{year}&academic_years=#{year}&category=#{category.category_id}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue