mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
WIP: refactor so multiple graphs can be defined for a given slug WIP: fixed scale view but broke 'All Parent' graph WIP: working state. All views working properly WIP: Refactor graph_map into two collections; measure_level_graphs and scale_level_graphs WIP: refacter GroupedBarColumnPresenter to accept a 'construct' instead of specifying measure or scale WIP: fix scale graphs being shown on incorrect view WIP: Merge parents_by_language class with parents_by_language_by_scale so it can handle display of both measure-level and scale-level graphs
49 lines
2.4 KiB
Text
49 lines
2.4 KiB
Text
<g class="grouped-bar-column" data-for-construct-id="<%= column.construct_id %>">
|
|
<% score_label_y = [5, 10, 15, 5, 10, 15 ] %>
|
|
<% column.bars.each_with_index do |bar, index| %>
|
|
<rect
|
|
<% if column.show_popover? %>
|
|
data-bs-toggle="popover"
|
|
data-bs-placement="right"
|
|
data-bs-content="<%= column.popover_content(bar.academic_year) %>"
|
|
<% 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 %>
|
|
<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>
|