govuk_publishing_components 44.3.0 → 44.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/components/chart.js +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_chart.scss +44 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +28 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +15 -0
- data/app/views/govuk_publishing_components/components/_chart.html.erb +151 -0
- data/app/views/govuk_publishing_components/components/_contents_list.html.erb +7 -3
- data/app/views/govuk_publishing_components/components/_organisation_logo.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/docs/chart.yml +238 -0
- data/app/views/govuk_publishing_components/components/docs/contents_list.yml +32 -0
- data/app/views/govuk_publishing_components/components/docs/organisation_logo.yml +11 -1
- data/config/locales/ar.yml +3 -0
- data/config/locales/az.yml +3 -0
- data/config/locales/be.yml +3 -0
- data/config/locales/bg.yml +3 -0
- data/config/locales/bn.yml +3 -0
- data/config/locales/cs.yml +3 -0
- data/config/locales/cy.yml +3 -0
- data/config/locales/da.yml +3 -0
- data/config/locales/de.yml +3 -0
- data/config/locales/dr.yml +3 -0
- data/config/locales/el.yml +3 -0
- data/config/locales/en.yml +3 -0
- data/config/locales/es-419.yml +3 -0
- data/config/locales/es.yml +3 -0
- data/config/locales/et.yml +3 -0
- data/config/locales/fa.yml +3 -0
- data/config/locales/fi.yml +3 -0
- data/config/locales/fr.yml +3 -0
- data/config/locales/gd.yml +3 -0
- data/config/locales/gu.yml +3 -0
- data/config/locales/he.yml +3 -0
- data/config/locales/hi.yml +3 -0
- data/config/locales/hr.yml +3 -0
- data/config/locales/hu.yml +3 -0
- data/config/locales/hy.yml +3 -0
- data/config/locales/id.yml +3 -0
- data/config/locales/is.yml +3 -0
- data/config/locales/it.yml +3 -0
- data/config/locales/ja.yml +3 -0
- data/config/locales/ka.yml +3 -0
- data/config/locales/kk.yml +3 -0
- data/config/locales/ko.yml +3 -0
- data/config/locales/lt.yml +3 -0
- data/config/locales/lv.yml +3 -0
- data/config/locales/ms.yml +3 -0
- data/config/locales/mt.yml +3 -0
- data/config/locales/nl.yml +3 -0
- data/config/locales/no.yml +3 -0
- data/config/locales/pa-pk.yml +3 -0
- data/config/locales/pa.yml +3 -0
- data/config/locales/pl.yml +3 -0
- data/config/locales/ps.yml +3 -0
- data/config/locales/pt.yml +3 -0
- data/config/locales/ro.yml +3 -0
- data/config/locales/ru.yml +3 -0
- data/config/locales/si.yml +3 -0
- data/config/locales/sk.yml +3 -0
- data/config/locales/sl.yml +3 -0
- data/config/locales/so.yml +3 -0
- data/config/locales/sq.yml +3 -0
- data/config/locales/sr.yml +3 -0
- data/config/locales/sv.yml +3 -0
- data/config/locales/sw.yml +3 -0
- data/config/locales/ta.yml +3 -0
- data/config/locales/th.yml +3 -0
- data/config/locales/tk.yml +3 -0
- data/config/locales/tr.yml +3 -0
- data/config/locales/uk.yml +3 -0
- data/config/locales/ur.yml +3 -0
- data/config/locales/uz.yml +3 -0
- data/config/locales/vi.yml +3 -0
- data/config/locales/zh-hk.yml +3 -0
- data/config/locales/zh-tw.yml +3 -0
- data/config/locales/zh.yml +3 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/chartkick/LICENSE.txt +22 -0
- data/node_modules/chartkick/README.md +593 -0
- data/node_modules/chartkick/chart.js/chart.esm.js +5 -0
- data/node_modules/chartkick/chart.js/package.json +6 -0
- data/node_modules/chartkick/dist/chartkick.esm.js +2562 -0
- data/node_modules/chartkick/dist/chartkick.js +2570 -0
- data/node_modules/chartkick/dist/chartkick.min.js +2 -0
- data/node_modules/chartkick/highcharts/highcharts.esm.js +4 -0
- data/node_modules/chartkick/highcharts/package.json +6 -0
- data/node_modules/chartkick/package.json +50 -0
- metadata +31 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03e23c3d08539cc78a6885528be7099e0b51ecb14cf07bbdbba63423efa7dab5
|
4
|
+
data.tar.gz: 3c73f4b0792536700425c873c987154e63fd4effa58df6942c9906b0f19fdd81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 370b141dcced2433adeaefa9a367e1f9d42c3b4df99893849fdbc5e99611bd57cde80aa23f81a6e0833336183239f26da717589c6eb864739bb58eb1beb7b833
|
7
|
+
data.tar.gz: 1378a24ec8d2042c698857de2eed671348cb09b42d6a44fcad8bca34433295ff6cf2ad8e6da74468c4d5eedde925f75775a67ff99987eff4f79dabde3662a1d3
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require chartkick
|
@@ -0,0 +1,44 @@
|
|
1
|
+
@import "govuk_publishing_components/individual_component_support";
|
2
|
+
|
3
|
+
.gem-c-chart {
|
4
|
+
// slight hack to hide the table automatically added by the charts JS
|
5
|
+
// not needed as we already output the table manually in the component
|
6
|
+
svg + div:has(table) {
|
7
|
+
display: none;
|
8
|
+
}
|
9
|
+
|
10
|
+
.google-visualization-tooltip {
|
11
|
+
background-color: govuk-colour("black");
|
12
|
+
box-shadow: none;
|
13
|
+
border: 0;
|
14
|
+
|
15
|
+
span {
|
16
|
+
color: govuk-colour("white");
|
17
|
+
@include govuk-font($size: 16, $weight: bold);
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
.gem-c-chart__table-wrapper {
|
23
|
+
overflow: auto;
|
24
|
+
}
|
25
|
+
|
26
|
+
.gem-c-chart__table {
|
27
|
+
margin-top: govuk-spacing(3);
|
28
|
+
|
29
|
+
.govuk-table {
|
30
|
+
margin: 0;
|
31
|
+
}
|
32
|
+
|
33
|
+
.govuk-table .govuk-table__header {
|
34
|
+
text-align: center;
|
35
|
+
}
|
36
|
+
|
37
|
+
.govuk-table .govuk-table__cell {
|
38
|
+
text-align: center;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
.gem-c-chart__accessibility-message {
|
43
|
+
@include govuk-visually-hidden;
|
44
|
+
}
|
@@ -27,13 +27,13 @@
|
|
27
27
|
}
|
28
28
|
|
29
29
|
.gem-c-contents-list__link {
|
30
|
-
.gem-c-contents-list__list-item--parent > & {
|
31
|
-
font-weight: bold;
|
32
|
-
}
|
33
|
-
|
34
30
|
@include govuk-template-link-focus-override;
|
35
31
|
}
|
36
32
|
|
33
|
+
.gem-c-contents-list__list-item--parent > .gem-c-contents-list__link {
|
34
|
+
font-weight: $govuk-font-weight-bold;
|
35
|
+
}
|
36
|
+
|
37
37
|
.gem-c-contents-list__list-item {
|
38
38
|
padding-top: govuk-spacing(2);
|
39
39
|
line-height: 1.3;
|
@@ -50,7 +50,7 @@
|
|
50
50
|
padding-left: $contents-spacing;
|
51
51
|
padding-right: $contents-spacing;
|
52
52
|
|
53
|
-
|
53
|
+
.gem-c-contents-list__list-item-dash::before {
|
54
54
|
content: "—";
|
55
55
|
position: absolute;
|
56
56
|
left: 0;
|
@@ -76,6 +76,29 @@
|
|
76
76
|
}
|
77
77
|
}
|
78
78
|
|
79
|
+
.gem-c-contents-list--alternative-line-style {
|
80
|
+
.gem-c-contents-list__title {
|
81
|
+
margin-bottom: govuk-spacing(3);
|
82
|
+
}
|
83
|
+
|
84
|
+
.gem-c-contents-list__list-item {
|
85
|
+
padding: govuk-spacing(2) 0;
|
86
|
+
margin: 0;
|
87
|
+
}
|
88
|
+
|
89
|
+
.gem-c-contents-list__list-item-dash::before {
|
90
|
+
display: none;
|
91
|
+
}
|
92
|
+
|
93
|
+
.gem-c-contents-list__list-item--active {
|
94
|
+
padding: govuk-spacing(1) govuk-spacing(2);
|
95
|
+
margin: govuk-spacing(1) 0;
|
96
|
+
border-left: 4px solid govuk-colour("blue");
|
97
|
+
color: govuk-colour("blue");
|
98
|
+
font-weight: $govuk-font-weight-bold;
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
79
102
|
@include govuk-media-query($media-type: print) {
|
80
103
|
// Override default browser indentation
|
81
104
|
.gem-c-contents-list__list,
|
@@ -82,6 +82,21 @@
|
|
82
82
|
}
|
83
83
|
}
|
84
84
|
|
85
|
+
.gem-c-organisation-logo--inverse {
|
86
|
+
.gem-c-organisation-logo__container {
|
87
|
+
border-color: govuk-colour("white");
|
88
|
+
@include govuk-link-style-inverse;
|
89
|
+
}
|
90
|
+
|
91
|
+
.gem-c-organisation-logo__crest {
|
92
|
+
filter: brightness(0) invert(1);
|
93
|
+
|
94
|
+
&:focus {
|
95
|
+
filter: none;
|
96
|
+
}
|
97
|
+
}
|
98
|
+
}
|
99
|
+
|
85
100
|
@mixin crest($crest, $xpos:0, $ypos:0) {
|
86
101
|
background: url("govuk_publishing_components/crests/#{$crest}_18px_x2.png") no-repeat $xpos $ypos;
|
87
102
|
background-size: auto 32px;
|
@@ -0,0 +1,151 @@
|
|
1
|
+
<%
|
2
|
+
add_gem_component_stylesheet("chart")
|
3
|
+
add_gem_component_stylesheet("table")
|
4
|
+
add_gem_component_stylesheet("details")
|
5
|
+
add_gem_component_stylesheet("heading")
|
6
|
+
|
7
|
+
chart_heading ||= nil
|
8
|
+
chart_heading_level ||= 2
|
9
|
+
table_direction ||= "horizontal"
|
10
|
+
h_axis_title ||= nil
|
11
|
+
v_axis_title ||= nil
|
12
|
+
rows ||= []
|
13
|
+
keys ||= []
|
14
|
+
chart_overview ||= nil
|
15
|
+
hide_legend ||= false
|
16
|
+
link ||= false
|
17
|
+
|
18
|
+
chart_id = "chart-id-#{SecureRandom.hex(4)}"
|
19
|
+
table_id = "table-id-#{SecureRandom.hex(4)}"
|
20
|
+
|
21
|
+
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
22
|
+
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
23
|
+
component_helper.add_class("gem-c-chart")
|
24
|
+
component_helper.add_class(shared_helper.get_margin_bottom)
|
25
|
+
|
26
|
+
require "chartkick"
|
27
|
+
Chartkick.options[:html] = '<div id="%{id}"><noscript><p class="govuk-body">Our charts are built using JavaScript but all the data is also available in the table below.</p></noscript></div>'
|
28
|
+
# config options are here: https://developers.google.com/chart/interactive/docs/gallery/linechart
|
29
|
+
font_16 = { color: '#000', fontName: 'GDS Transport', fontSize: '16', italic: false }
|
30
|
+
font_19 = { color: '#000', fontName: 'GDS Transport', fontSize: '19', italic: false }
|
31
|
+
legend = 'none'
|
32
|
+
legend = { position: 'top', textStyle: font_16 } unless hide_legend
|
33
|
+
|
34
|
+
chart_library_options = {
|
35
|
+
chartArea: { width: '80%', height: '60%' },
|
36
|
+
crosshair: { orientation: 'vertical', trigger: 'both', color: '#ccc' },
|
37
|
+
curveType: 'none',
|
38
|
+
legend: legend,
|
39
|
+
pointSize: 10,
|
40
|
+
height: 400,
|
41
|
+
tooltip: { isHtml: true },
|
42
|
+
hAxis: {
|
43
|
+
textStyle: font_16,
|
44
|
+
format: 'd MMM Y', # https://developers.google.com/chart/interactive/docs/reference#dateformatter
|
45
|
+
title: h_axis_title,
|
46
|
+
titleTextStyle: font_19,
|
47
|
+
},
|
48
|
+
vAxis: {
|
49
|
+
format: '#,###,###',
|
50
|
+
textStyle: font_16,
|
51
|
+
title: v_axis_title,
|
52
|
+
titleTextStyle: font_19,
|
53
|
+
},
|
54
|
+
}
|
55
|
+
|
56
|
+
if rows.length > 0 && keys.length > 0
|
57
|
+
chart_format_data = rows.map do |row|
|
58
|
+
{
|
59
|
+
name: row[:label],
|
60
|
+
linewidth: 10,
|
61
|
+
data: keys.zip(row[:values])
|
62
|
+
}
|
63
|
+
end
|
64
|
+
end
|
65
|
+
%>
|
66
|
+
<% if rows.length > 0 && keys.length > 0 %>
|
67
|
+
<%= javascript_include_tag "https://www.gstatic.com/charts/loader.js" %>
|
68
|
+
<%= tag.div(**component_helper.all_attributes) do %>
|
69
|
+
<% if chart_heading %>
|
70
|
+
<%= render "govuk_publishing_components/components/heading", {
|
71
|
+
text: chart_heading,
|
72
|
+
heading_level: chart_heading_level,
|
73
|
+
margin_bottom: 2,
|
74
|
+
} %>
|
75
|
+
<% end %>
|
76
|
+
|
77
|
+
<div class="gem-c-chart__chart" id="<%= chart_id %>">
|
78
|
+
<div class="gem-c-chart__accessibility-message">
|
79
|
+
<%= t("components.chart.accessibility_html", table_id: table_id) %>
|
80
|
+
<%= content_tag :span, chart_overview, class: "gem-c-chart__overview" if chart_overview %>
|
81
|
+
</div>
|
82
|
+
<%= line_chart(chart_format_data, library: chart_library_options) %>
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div class="gem-c-chart__table" id="<%= table_id %>">
|
86
|
+
<%= render("govuk_publishing_components/components/details",
|
87
|
+
title: t("components.chart.table_dropdown")
|
88
|
+
) do %>
|
89
|
+
<div tabindex="0" class="gem-c-chart__table-wrapper">
|
90
|
+
<table class="govuk-table">
|
91
|
+
<% if table_direction == "horizontal" %>
|
92
|
+
<thead class="govuk-table__head">
|
93
|
+
<tr class="govuk-table__row">
|
94
|
+
<td class="govuk-table__cell"></td>
|
95
|
+
<% keys.each do |key| %>
|
96
|
+
<th class="govuk-table__header scope="col">
|
97
|
+
<%= key %>
|
98
|
+
</th>
|
99
|
+
<% end %>
|
100
|
+
</tr>
|
101
|
+
</thead>
|
102
|
+
<tbody class="govuk-table__body">
|
103
|
+
<% rows.each do |row| %>
|
104
|
+
<tr class="govuk-table__row">
|
105
|
+
<th class="govuk-table__header" scope="row"><%= row[:label] %></th>
|
106
|
+
<% row[:values].each do |value| %>
|
107
|
+
<td class="govuk-table__cell govuk-table__cell--numeric">
|
108
|
+
<%= number_with_delimiter value %>
|
109
|
+
</td>
|
110
|
+
<% end %>
|
111
|
+
</tr>
|
112
|
+
<% end %>
|
113
|
+
</tbody>
|
114
|
+
<% else %>
|
115
|
+
<thead class="govuk-table__head">
|
116
|
+
<tr class="govuk-table__row">
|
117
|
+
<td class="govuk-table__cell"></td>
|
118
|
+
<% rows.each do |row| %>
|
119
|
+
<th class="govuk-table__header govuk-table__header--stacked" scope="row">
|
120
|
+
<%= row[:label] %>
|
121
|
+
</th>
|
122
|
+
<% end %>
|
123
|
+
</tr>
|
124
|
+
</thead>
|
125
|
+
<tbody class="govuk-table__body">
|
126
|
+
<% keys.each_with_index do |key, index| %>
|
127
|
+
<tr>
|
128
|
+
<th class="govuk-table__header scope="row">
|
129
|
+
<%= key %>
|
130
|
+
</th>
|
131
|
+
<% rows.each do |row| %>
|
132
|
+
<td class="govuk-table__cell govuk-table__cell--numeric">
|
133
|
+
<%= number_with_delimiter row[:values][index] %>
|
134
|
+
</td>
|
135
|
+
<% end %>
|
136
|
+
</tr>
|
137
|
+
<% end %>
|
138
|
+
</tbody>
|
139
|
+
<% end %>
|
140
|
+
</table>
|
141
|
+
</div>
|
142
|
+
<% end %>
|
143
|
+
</div>
|
144
|
+
|
145
|
+
<% if link %>
|
146
|
+
<p class="govuk-body">
|
147
|
+
<%= link_to "Download chart data", link, class: "govuk-link" %>
|
148
|
+
</p>
|
149
|
+
<% end %>
|
150
|
+
<% end %>
|
151
|
+
<% end %>
|
@@ -4,6 +4,8 @@
|
|
4
4
|
cl_helper = GovukPublishingComponents::Presenters::ContentsListHelper.new(local_assigns)
|
5
5
|
underline_links ||= false
|
6
6
|
format_numbers ||= false
|
7
|
+
alternative_line_style ||= false
|
8
|
+
title ||= nil
|
7
9
|
brand ||= false
|
8
10
|
brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
|
9
11
|
title_fallback = t("components.contents_list.contents", locale: I18n.locale, fallback: false, default: "en")
|
@@ -22,6 +24,8 @@
|
|
22
24
|
local_assigns[:aria] ||= {}
|
23
25
|
component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
|
24
26
|
component_helper.add_class("gem-c-contents-list #{brand_helper.brand_class}")
|
27
|
+
component_helper.add_class("gem-c-contents-list--alternative-line-style") if alternative_line_style
|
28
|
+
component_helper.add_class("gem-c-contents-list--custom-title") if title
|
25
29
|
component_helper.add_data_attribute({ module: "ga4-link-tracker" }) unless disable_ga4
|
26
30
|
component_helper.add_aria_attribute({ label: t("components.contents_list.contents") }) unless local_assigns[:aria][:label]
|
27
31
|
component_helper.add_role("navigation")
|
@@ -33,14 +37,14 @@
|
|
33
37
|
title_fallback == "en" ? {:lang => "en",} : {}
|
34
38
|
)
|
35
39
|
) do %>
|
36
|
-
<%= t("components.contents_list.contents") %>
|
40
|
+
<%= title || t("components.contents_list.contents") %>
|
37
41
|
<% end %>
|
38
42
|
|
39
43
|
<ol class="gem-c-contents-list__list">
|
40
44
|
<% index_link = 1 unless disable_ga4 %>
|
41
45
|
<% contents.each do |contents_item| %>
|
42
46
|
<li class="<%= cl_helper.list_item_classes(contents_item, false) %>" <%= "aria-current=true" if contents_item[:active] %>>
|
43
|
-
<span aria-hidden="true"></span>
|
47
|
+
<span class="gem-c-contents-list__list-item-dash" aria-hidden="true"></span>
|
44
48
|
<% link_text = format_numbers ? cl_helper.wrap_numbers_with_spans(contents_item[:text]) : cl_helper.clean_string(contents_item[:text])
|
45
49
|
unless disable_ga4
|
46
50
|
ga4_data[:event_name] = cl_helper.get_ga4_event_name(contents_item[:href]) if contents_item[:href]
|
@@ -58,7 +62,7 @@
|
|
58
62
|
<ol class="gem-c-contents-list__nested-list">
|
59
63
|
<% contents_item[:items].each do |nested_contents_item| %>
|
60
64
|
<li class="<%= cl_helper.list_item_classes(nested_contents_item, true) %>" <%= "aria-current=true" if nested_contents_item[:active] %>>
|
61
|
-
<span aria-hidden="true"></span>
|
65
|
+
<span class="gem-c-contents-list__list-item-dash" aria-hidden="true"></span>
|
62
66
|
<%
|
63
67
|
unless disable_ga4
|
64
68
|
ga4_data[:event_name] = cl_helper.get_ga4_event_name(nested_contents_item[:href]) if nested_contents_item[:href]
|
@@ -7,6 +7,7 @@
|
|
7
7
|
organisation ||= {}
|
8
8
|
heading_level ||= false
|
9
9
|
inline ||= false
|
10
|
+
inverse ||= false
|
10
11
|
|
11
12
|
# Check if `heading_level` is an appropriate number:
|
12
13
|
use_heading = [*1..6].include?(heading_level)
|
@@ -16,6 +17,7 @@
|
|
16
17
|
|
17
18
|
wrapper_classes = %w[gem-c-organisation-logo]
|
18
19
|
wrapper_classes << brand_helper.brand_class
|
20
|
+
wrapper_classes << "gem-c-organisation-logo--inverse" if inverse
|
19
21
|
|
20
22
|
container_classes = [
|
21
23
|
logo_helper.logo_container_class,
|
@@ -0,0 +1,238 @@
|
|
1
|
+
name: Chart (experimental)
|
2
|
+
description: The chart component presents a data chart and a tabular version of the same data
|
3
|
+
part_of_admin_layout: true
|
4
|
+
body: |
|
5
|
+
This component takes a set of data and presents it as a line graph and a table with one or more rows and lines.
|
6
|
+
The chart relies upon chartkick and renders using JavaScript, so the table is provided as a fallback for a lack of JavaScript,
|
7
|
+
an accessible view on the data for screenreaders, and a simple view of the raw data for all users.
|
8
|
+
|
9
|
+
The `overview` option can be used to provide an explanation for screen reader users of what the graph shows.
|
10
|
+
accessibility_criteria: |
|
11
|
+
Charts must:
|
12
|
+
|
13
|
+
- use line colours with a contrast ratio higher than 4.5:1 against the background colour to meet WCAG AA
|
14
|
+
shared_accessibility_criteria:
|
15
|
+
- link
|
16
|
+
uses_component_wrapper_helper: true
|
17
|
+
examples:
|
18
|
+
default:
|
19
|
+
data:
|
20
|
+
chart_heading: Page views chart
|
21
|
+
h_axis_title: Day
|
22
|
+
v_axis_title: Views
|
23
|
+
overview: This chart shows page views for January 2015.
|
24
|
+
hide_legend: true
|
25
|
+
keys:
|
26
|
+
- "2015-01-01"
|
27
|
+
- "2015-01-02"
|
28
|
+
- "2015-01-03"
|
29
|
+
- "2015-01-04"
|
30
|
+
- "2015-01-05"
|
31
|
+
- "2015-01-06"
|
32
|
+
- "2015-01-07"
|
33
|
+
- "2015-01-08"
|
34
|
+
- "2015-01-09"
|
35
|
+
- "2015-01-10"
|
36
|
+
rows:
|
37
|
+
- label: January 2015
|
38
|
+
values:
|
39
|
+
- 500
|
40
|
+
- 1190
|
41
|
+
- 740
|
42
|
+
- 820
|
43
|
+
- 270
|
44
|
+
- 450
|
45
|
+
- 110
|
46
|
+
- 210
|
47
|
+
- 670
|
48
|
+
- 430
|
49
|
+
multiple rows of data:
|
50
|
+
description: Where more than one series is shown on a chart, do not hide the legend.
|
51
|
+
data:
|
52
|
+
chart_heading: Page views chart
|
53
|
+
h_axis_title: Day
|
54
|
+
v_axis_title: Views
|
55
|
+
keys:
|
56
|
+
- 1st
|
57
|
+
- 2nd
|
58
|
+
- 3rd
|
59
|
+
- 4th
|
60
|
+
- 5th
|
61
|
+
- 6th
|
62
|
+
- 7th
|
63
|
+
- 8th
|
64
|
+
- 9th
|
65
|
+
- 10th
|
66
|
+
rows:
|
67
|
+
- label: January 2015
|
68
|
+
values:
|
69
|
+
- 5
|
70
|
+
- 119
|
71
|
+
- 74
|
72
|
+
- 82
|
73
|
+
- 27
|
74
|
+
- 45
|
75
|
+
- 11
|
76
|
+
- 21
|
77
|
+
- 67
|
78
|
+
- 43
|
79
|
+
- label: January 2016
|
80
|
+
values:
|
81
|
+
- 5
|
82
|
+
- 8
|
83
|
+
- 37
|
84
|
+
- 50
|
85
|
+
- 43
|
86
|
+
- 29
|
87
|
+
- 67
|
88
|
+
- 61
|
89
|
+
- 14
|
90
|
+
- 91
|
91
|
+
- label: January 2017
|
92
|
+
values:
|
93
|
+
- 31
|
94
|
+
- 81
|
95
|
+
- 12
|
96
|
+
- 15
|
97
|
+
- 52
|
98
|
+
- 61
|
99
|
+
- 143
|
100
|
+
- 27
|
101
|
+
- 18
|
102
|
+
- 34
|
103
|
+
vertical table:
|
104
|
+
description: Reorient the table to better suit the output of some data sets.
|
105
|
+
data:
|
106
|
+
chart_heading: Page views chart
|
107
|
+
table_direction: vertical
|
108
|
+
h_axis_title: Day
|
109
|
+
v_axis_title: Views
|
110
|
+
keys:
|
111
|
+
- 1st
|
112
|
+
- 2nd
|
113
|
+
- 3rd
|
114
|
+
- 4th
|
115
|
+
- 5th
|
116
|
+
- 6th
|
117
|
+
- 7th
|
118
|
+
rows:
|
119
|
+
- label: January 2015
|
120
|
+
values:
|
121
|
+
- 5
|
122
|
+
- 119
|
123
|
+
- 74
|
124
|
+
- 117
|
125
|
+
- 33
|
126
|
+
- 89
|
127
|
+
- 79
|
128
|
+
- label: January 2016
|
129
|
+
values:
|
130
|
+
- 3
|
131
|
+
- 8
|
132
|
+
- 37
|
133
|
+
- 82
|
134
|
+
- 118
|
135
|
+
- 85
|
136
|
+
- 80
|
137
|
+
with_a_different_heading_level:
|
138
|
+
description: Use a different heading level for the chart heading. It defaults to a H2.
|
139
|
+
data:
|
140
|
+
chart_heading: Page views chart
|
141
|
+
chart_heading_level: 4
|
142
|
+
h_axis_title: Day
|
143
|
+
v_axis_title: Views
|
144
|
+
keys:
|
145
|
+
- 1st
|
146
|
+
- 2nd
|
147
|
+
- 3rd
|
148
|
+
- 4th
|
149
|
+
- 5th
|
150
|
+
- 6th
|
151
|
+
- 7th
|
152
|
+
rows:
|
153
|
+
- label: January 2015
|
154
|
+
values:
|
155
|
+
- 5
|
156
|
+
- 119
|
157
|
+
- 74
|
158
|
+
- 117
|
159
|
+
- 33
|
160
|
+
- 89
|
161
|
+
- 79
|
162
|
+
- label: January 2016
|
163
|
+
values:
|
164
|
+
- 3
|
165
|
+
- 8
|
166
|
+
- 37
|
167
|
+
- 82
|
168
|
+
- 118
|
169
|
+
- 85
|
170
|
+
- 80
|
171
|
+
with_a_download_link:
|
172
|
+
description: Add a download link to the original data. Doesn't do anything clever, just creates a link to the URL passed.
|
173
|
+
data:
|
174
|
+
chart_heading: Page views chart
|
175
|
+
h_axis_title: Day
|
176
|
+
v_axis_title: Views
|
177
|
+
link: 'https://www.gov.uk'
|
178
|
+
keys:
|
179
|
+
- 1st
|
180
|
+
- 2nd
|
181
|
+
- 3rd
|
182
|
+
- 4th
|
183
|
+
- 5th
|
184
|
+
- 6th
|
185
|
+
- 7th
|
186
|
+
rows:
|
187
|
+
- label: January 2015
|
188
|
+
values:
|
189
|
+
- 5
|
190
|
+
- 119
|
191
|
+
- 74
|
192
|
+
- 117
|
193
|
+
- 33
|
194
|
+
- 89
|
195
|
+
- 79
|
196
|
+
- label: January 2016
|
197
|
+
values:
|
198
|
+
- 3
|
199
|
+
- 8
|
200
|
+
- 37
|
201
|
+
- 82
|
202
|
+
- 118
|
203
|
+
- 85
|
204
|
+
- 80
|
205
|
+
with_margin_bottom:
|
206
|
+
description: The component accepts a number for margin bottom from `0` to `9` (`0px` to `60px`) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having a bottom margin of 15px.
|
207
|
+
data:
|
208
|
+
chart_heading: Page views chart
|
209
|
+
h_axis_title: Day
|
210
|
+
v_axis_title: Views
|
211
|
+
margin_bottom: 9
|
212
|
+
keys:
|
213
|
+
- 1st
|
214
|
+
- 2nd
|
215
|
+
- 3rd
|
216
|
+
- 4th
|
217
|
+
- 5th
|
218
|
+
- 6th
|
219
|
+
- 7th
|
220
|
+
rows:
|
221
|
+
- label: January 2015
|
222
|
+
values:
|
223
|
+
- 5
|
224
|
+
- 119
|
225
|
+
- 74
|
226
|
+
- 117
|
227
|
+
- 33
|
228
|
+
- 89
|
229
|
+
- 79
|
230
|
+
- label: January 2016
|
231
|
+
values:
|
232
|
+
- 3
|
233
|
+
- 8
|
234
|
+
- 37
|
235
|
+
- 82
|
236
|
+
- 118
|
237
|
+
- 85
|
238
|
+
- 80
|
@@ -193,6 +193,38 @@ examples:
|
|
193
193
|
text: 2. Numbers not parsed
|
194
194
|
- href: "#third-thing"
|
195
195
|
text: 3. Numbers are just text
|
196
|
+
with_alternative_line_style:
|
197
|
+
description: With this option, the individual lines get different styling. The left hand indent and dashes are removed, there's more vertical space between each list item and the active links are styled with a vertical left hand border.
|
198
|
+
data:
|
199
|
+
alternative_line_style: true
|
200
|
+
contents:
|
201
|
+
- href: "#first-thing"
|
202
|
+
text: First page title link
|
203
|
+
- href: "#second-thing"
|
204
|
+
text: Second page title link
|
205
|
+
- href: "#third-thing"
|
206
|
+
text: Third page title link
|
207
|
+
active: true
|
208
|
+
- href: "#fourth-thing"
|
209
|
+
text: Fourth page title link
|
210
|
+
- href: "#fifth-thing"
|
211
|
+
text: Fifth page title link
|
212
|
+
with_custom_title:
|
213
|
+
description: With this option, the 'Contents' title is replaced with the supplied alternate title. This should only be used when using this component as a navigation element on landing pages. Typically used with `alternative_line_style`.
|
214
|
+
data:
|
215
|
+
title: "An alternate title"
|
216
|
+
contents:
|
217
|
+
- href: "#first-thing"
|
218
|
+
text: First page title link
|
219
|
+
- href: "#second-thing"
|
220
|
+
text: Second page title link
|
221
|
+
- href: "#third-thing"
|
222
|
+
text: Third page title link
|
223
|
+
active: true
|
224
|
+
- href: "#fourth-thing"
|
225
|
+
text: Fourth page title link
|
226
|
+
- href: "#fifth-thing"
|
227
|
+
text: Fifth page title link
|
196
228
|
without_ga4_tracking:
|
197
229
|
description: Disables GA4 link tracking on the list. Tracking is enabled by default.
|
198
230
|
data:
|
@@ -75,7 +75,7 @@ examples:
|
|
75
75
|
name: "Prime Minister's Office,<br>10 Downing Street"
|
76
76
|
url: '/government/organisations/prime-ministers-office-10-downing-street'
|
77
77
|
brand: 'prime-ministers-office-10-downing-street'
|
78
|
-
crest: '
|
78
|
+
crest: 'eo'
|
79
79
|
office_of_the_advocate_general_for_scotland:
|
80
80
|
data:
|
81
81
|
organisation:
|
@@ -182,3 +182,13 @@ examples:
|
|
182
182
|
brand: cabinet-office
|
183
183
|
crest: 'single-identity'
|
184
184
|
inline: true
|
185
|
+
on_a_dark_background:
|
186
|
+
data:
|
187
|
+
organisation:
|
188
|
+
name: "Prime Minister's Office,<br>10 Downing Street"
|
189
|
+
url: '/government/organisations/prime-ministers-office-10-downing-street'
|
190
|
+
brand: 'prime-ministers-office-10-downing-street'
|
191
|
+
crest: 'eo'
|
192
|
+
inverse: true
|
193
|
+
context:
|
194
|
+
dark_background: true
|
data/config/locales/ar.yml
CHANGED
data/config/locales/az.yml
CHANGED
data/config/locales/be.yml
CHANGED