diff --git a/area-stacked-sm/config.js b/area-stacked-sm/config.js index 9adf203..44f70b4 100644 --- a/area-stacked-sm/config.js +++ b/area-stacked-sm/config.js @@ -1,7 +1,6 @@ config = { "graphicDataURL": "data.csv", "colourPalette": ONSpalette, - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "xDomain": "auto", "yDomain": "auto", diff --git a/area-stacked-sm/index.html b/area-stacked-sm/index.html index 72f28e5..4d94bc0 100644 --- a/area-stacked-sm/index.html +++ b/area-stacked-sm/index.html @@ -25,10 +25,6 @@
- -
-
- diff --git a/area-stacked-sm/script.js b/area-stacked-sm/script.js index a3e6289..d23cf1e 100644 --- a/area-stacked-sm/script.js +++ b/area-stacked-sm/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, calculateChartWidth, addChartTitleLabel, addAxisLabel, addSource } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, calculateChartWidth, addChartTitleLabel, addAxisLabel} from "../lib/helpers.js"; let pymChild = null; let graphic = d3.select('#graphic'); @@ -223,9 +223,6 @@ function drawGraphic() { drawChart(d3.select(this), key, value, i); }); - //create link to source - addSource('source', config.sourceText); - // Send the height to the parent frame if (pymChild) { pymChild.sendHeight(); diff --git a/area-stacked/config.js b/area-stacked/config.js index 1f0d0ce..42f1a02 100644 --- a/area-stacked/config.js +++ b/area-stacked/config.js @@ -1,7 +1,6 @@ config = { "graphicDataURL": "data.csv", "colourPalette": ONSpalette, - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "xDomain": "auto", "yDomain": "auto", diff --git a/area-stacked/index.html b/area-stacked/index.html index b19a7e5..b2184c5 100644 --- a/area-stacked/index.html +++ b/area-stacked/index.html @@ -25,10 +25,6 @@
- -
-
- diff --git a/area-stacked/script.js b/area-stacked/script.js index 5ba1c24..d5e5720 100644 --- a/area-stacked/script.js +++ b/area-stacked/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, addAxisLabel, addSource } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, addAxisLabel} from "../lib/helpers.js"; let graphic = d3.select('#graphic'); let legend = d3.select('#legend'); @@ -157,9 +157,6 @@ function drawGraphic() { wrapWidth: chartWidth }); - //create link to source - addSource('source', config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/bar-chart-clustered-sm/config.js b/bar-chart-clustered-sm/config.js index 3b32fb6..0aa9942 100644 --- a/bar-chart-clustered-sm/config.js +++ b/bar-chart-clustered-sm/config.js @@ -1,7 +1,6 @@ config = { "graphicDataURL": "data.csv", "colourPalette": ONSpalette, - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "dataLabels": { "show": true, diff --git a/bar-chart-clustered-sm/index.html b/bar-chart-clustered-sm/index.html index a6a7aaf..a3bdedf 100644 --- a/bar-chart-clustered-sm/index.html +++ b/bar-chart-clustered-sm/index.html @@ -26,10 +26,6 @@
- -
-
- diff --git a/bar-chart-clustered-sm/script.js b/bar-chart-clustered-sm/script.js index 89ee97d..d338e4f 100644 --- a/bar-chart-clustered-sm/script.js +++ b/bar-chart-clustered-sm/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, calculateChartWidth, addDataLabels, addChartTitleLabel, addAxisLabel, addSource } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, calculateChartWidth, addDataLabels, addChartTitleLabel, addAxisLabel} from "../lib/helpers.js"; let graphic = d3.select('#graphic'); let legend = d3.select('#legend'); @@ -209,9 +209,6 @@ function drawGraphic() { drawChart(d3.select(this), value, i); }); - //create link to source - addSource('source', config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/bar-chart-clustered/config.js b/bar-chart-clustered/config.js index 20ed0b6..7725486 100644 --- a/bar-chart-clustered/config.js +++ b/bar-chart-clustered/config.js @@ -2,7 +2,6 @@ config = { "graphicDataURL": "data.csv", "legendLabels": ["Category 1 goes here", "Category 2 goes here"], "colourPalette": ONSpalette, - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "dataLabels": { "show": true, diff --git a/bar-chart-clustered/index.html b/bar-chart-clustered/index.html index d929235..8f9c1df 100644 --- a/bar-chart-clustered/index.html +++ b/bar-chart-clustered/index.html @@ -26,10 +26,6 @@
- -
-
- diff --git a/bar-chart-clustered/script.js b/bar-chart-clustered/script.js index ef3d263..6e6c384 100644 --- a/bar-chart-clustered/script.js +++ b/bar-chart-clustered/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, addDataLabels, addAxisLabel, addSource } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, addDataLabels, addAxisLabel} from "../lib/helpers.js"; let graphic = d3.select('#graphic'); let legend = d3.select('#legend'); @@ -157,9 +157,6 @@ function drawGraphic() { wrapWidth: chartWidth }); - //create link to source - addSource('source', config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/bar-chart-grouped-clustered/config.js b/bar-chart-grouped-clustered/config.js index 24ce3fa..016d9da 100644 --- a/bar-chart-grouped-clustered/config.js +++ b/bar-chart-grouped-clustered/config.js @@ -2,7 +2,6 @@ config = { "graphicDataURL": "data.csv", "legendLabels": ["Category 1 goes here", "Category 2 goes here"], "colourPalette": ONSpalette, - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "dataLabels": { "show": true, diff --git a/bar-chart-grouped-clustered/index.html b/bar-chart-grouped-clustered/index.html index c94aa8b..1df1074 100644 --- a/bar-chart-grouped-clustered/index.html +++ b/bar-chart-grouped-clustered/index.html @@ -26,10 +26,6 @@
- -
-
- diff --git a/bar-chart-grouped-clustered/script.js b/bar-chart-grouped-clustered/script.js index 12d8e4a..a1efe8a 100644 --- a/bar-chart-grouped-clustered/script.js +++ b/bar-chart-grouped-clustered/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, addDataLabels, addAxisLabel, addSource } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, addDataLabels, addAxisLabel} from "../lib/helpers.js"; let graphic = d3.select('#graphic'); let legend = d3.select('#legend'); @@ -180,8 +180,6 @@ function drawGraphic() { return d[0]; }); - addSource('source', config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/bar-chart-grouped/config.js b/bar-chart-grouped/config.js index 78a4c66..859cfd7 100644 --- a/bar-chart-grouped/config.js +++ b/bar-chart-grouped/config.js @@ -3,7 +3,6 @@ config={ "legendLabels": {"min":"2015-2019", "max":"2020"}, //the keys match the column names "colourPalette": ONScolours.oceanBlue, - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "dataLabels":{ "show":true, diff --git a/bar-chart-grouped/index.html b/bar-chart-grouped/index.html index 05a5a20..bae3a3a 100644 --- a/bar-chart-grouped/index.html +++ b/bar-chart-grouped/index.html @@ -26,10 +26,6 @@
- -
-
- diff --git a/bar-chart-grouped/script.js b/bar-chart-grouped/script.js index 11b8052..b9afe55 100644 --- a/bar-chart-grouped/script.js +++ b/bar-chart-grouped/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, addAxisLabel, addSource } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, addAxisLabel } from "../lib/helpers.js"; let graphic = d3.select('#graphic'); let pymChild = null; @@ -151,11 +151,6 @@ function drawGraphic() { }) - - - //create link to source - addSource('source', config.sourceText) - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/bar-chart-sm/config.js b/bar-chart-sm/config.js index b20d898..dc62656 100644 --- a/bar-chart-sm/config.js +++ b/bar-chart-sm/config.js @@ -1,7 +1,6 @@ config = { "graphicDataURL": "data.csv", "colourPalette": ONScolours.oceanBlue, - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "dataLabels": { "show": 1, diff --git a/bar-chart-sm/index.html b/bar-chart-sm/index.html index 6a550b1..265b03f 100644 --- a/bar-chart-sm/index.html +++ b/bar-chart-sm/index.html @@ -26,10 +26,6 @@
- -
-
- diff --git a/bar-chart-sm/script.js b/bar-chart-sm/script.js index 4765c83..faf4843 100644 --- a/bar-chart-sm/script.js +++ b/bar-chart-sm/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, calculateChartWidth, addDataLabels, addChartTitleLabel, addAxisLabel,addSource } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, calculateChartWidth, addDataLabels, addChartTitleLabel, addAxisLabel} from "../lib/helpers.js"; let graphic = d3.select('#graphic'); let pymChild = null; @@ -172,9 +172,6 @@ function drawGraphic() { drawChart(d3.select(this), key, value, i); }); - //create link to source - addSource('source', config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/bar-chart-stacked-grouped/config.js b/bar-chart-stacked-grouped/config.js index 8a1a084..29dc84a 100644 --- a/bar-chart-stacked-grouped/config.js +++ b/bar-chart-stacked-grouped/config.js @@ -1,7 +1,6 @@ config={ "graphicDataURL": "data.csv", "colourPalette": ONSpalette, - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "xDomain":"auto", // either "auto" or an array for the x domain e.g. [0,100] diff --git a/bar-chart-stacked-grouped/index.html b/bar-chart-stacked-grouped/index.html index 03953e7..88782da 100644 --- a/bar-chart-stacked-grouped/index.html +++ b/bar-chart-stacked-grouped/index.html @@ -26,10 +26,6 @@
- -
-
- diff --git a/bar-chart-stacked-grouped/script.js b/bar-chart-stacked-grouped/script.js index 05ce522..d481c04 100644 --- a/bar-chart-stacked-grouped/script.js +++ b/bar-chart-stacked-grouped/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, addAxisLabel, addSource } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, addAxisLabel} from "../lib/helpers.js"; let graphic = d3.select('#graphic'); let legend = d3.select('#legend'); @@ -157,9 +157,6 @@ function drawGraphic() { .attr('class', 'legend--text') .html((d) => d[0]); - //create link to source - addSource('source', config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/bar-chart-stacked-sm/config.js b/bar-chart-stacked-sm/config.js index 09f462c..a8dee74 100644 --- a/bar-chart-stacked-sm/config.js +++ b/bar-chart-stacked-sm/config.js @@ -1,7 +1,6 @@ config = { "graphicDataURL": "data.csv", "colourPalette": ONSdivPlatte, - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "xAxisTickFormat": { "sm": ".0f", diff --git a/bar-chart-stacked-sm/index.html b/bar-chart-stacked-sm/index.html index 49a0ada..8700a72 100644 --- a/bar-chart-stacked-sm/index.html +++ b/bar-chart-stacked-sm/index.html @@ -26,10 +26,6 @@
- -
-
- diff --git a/bar-chart-stacked-sm/script.js b/bar-chart-stacked-sm/script.js index 82a479e..bf45809 100644 --- a/bar-chart-stacked-sm/script.js +++ b/bar-chart-stacked-sm/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, calculateChartWidth, addChartTitleLabel, addAxisLabel, addSource, addAnnotationRangeHorizontal } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, calculateChartWidth, addChartTitleLabel, addAxisLabel, addAnnotationRangeHorizontal } from "../lib/helpers.js"; let graphic = d3.select('#graphic'); let legend = d3.select('#legend'); @@ -222,9 +222,6 @@ function drawGraphic() { .style('grid-template-columns', `repeat(${config.legendColumns}, 1fr)`); } - //create source text - addSource('source', config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/bar-chart-stacked/config.js b/bar-chart-stacked/config.js index 551a840..1e9ac14 100644 --- a/bar-chart-stacked/config.js +++ b/bar-chart-stacked/config.js @@ -3,7 +3,6 @@ config = { "colourPalette": ONSpalette, "drawLegend": true, // set to false to remove the legend (still working on this) "someOtherVariable": "someOtherValue", - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "xDomain": "auto", // either "auto" or an array for the x domain e.g. [0,100] diff --git a/bar-chart-stacked/index.html b/bar-chart-stacked/index.html index cebcdb0..86b12f4 100644 --- a/bar-chart-stacked/index.html +++ b/bar-chart-stacked/index.html @@ -26,10 +26,6 @@
- -
-
- diff --git a/bar-chart-stacked/script.js b/bar-chart-stacked/script.js index 66f875c..8357593 100644 --- a/bar-chart-stacked/script.js +++ b/bar-chart-stacked/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, addAxisLabel, addSource } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, addAxisLabel} from "../lib/helpers.js"; let graphic = d3.select('#graphic'); let legend = d3.select('#legend'); @@ -138,9 +138,6 @@ function drawGraphic() { wrapWidth: chartWidth }); - //create link to source - addSource('source', config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/bar-chart-with-dropdown/config.js b/bar-chart-with-dropdown/config.js index 8c34a5c..47b27c3 100644 --- a/bar-chart-with-dropdown/config.js +++ b/bar-chart-with-dropdown/config.js @@ -1,8 +1,6 @@ config = { - "graphicDataURL": "data.csv", "colourPalette": ONScolours.oceanBlue, - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "dataLabels": { "show": true, diff --git a/bar-chart-with-dropdown/index.html b/bar-chart-with-dropdown/index.html index ae4e793..0c68768 100644 --- a/bar-chart-with-dropdown/index.html +++ b/bar-chart-with-dropdown/index.html @@ -27,10 +27,6 @@
- -
-
- diff --git a/bar-chart-with-dropdown/script.js b/bar-chart-with-dropdown/script.js index df8aa85..119bf05 100644 --- a/bar-chart-with-dropdown/script.js +++ b/bar-chart-with-dropdown/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, addDataLabels, addAxisLabel, addSource } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, addDataLabels, addAxisLabel} from "../lib/helpers.js"; let graphic = d3.select('#graphic'); let select = d3.select('#select'); @@ -255,9 +255,6 @@ function drawGraphic() { wrapWidth: chartWidth }); - //create link to source - addSource('source', config.sourceText); - $('#optionsSelect').val(config.defaultOption).trigger('chosen:updated'); changeData(config.defaultOption) // updateLegend("Agriculture, forestry and fishing", 0) diff --git a/bar-chart/config.js b/bar-chart/config.js index b66c289..9c5d882 100644 --- a/bar-chart/config.js +++ b/bar-chart/config.js @@ -1,7 +1,6 @@ config = { "graphicDataURL": "data.csv", "colourPalette": ONScolours.oceanBlue, - "sourceText": "Office for National Statistics", "accessibleSummary": "This chart has been hidden from screen readers. The main message of the chart is summarised in the chart title.", "dataLabels": { "show": true, diff --git a/bar-chart/index.html b/bar-chart/index.html index f3d1413..c2e8655 100644 --- a/bar-chart/index.html +++ b/bar-chart/index.html @@ -26,10 +26,6 @@
- -
-
- diff --git a/bar-chart/script.js b/bar-chart/script.js index 8b27764..1fd98ec 100644 --- a/bar-chart/script.js +++ b/bar-chart/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, addAxisLabel, addDataLabels, addSource } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, addAxisLabel, addDataLabels} from "../lib/helpers.js"; let graphic = d3.select("#graphic"); let pymChild = null; @@ -115,10 +115,6 @@ function drawGraphic() { wrapWidth: chartWidth }); - - //create link to source - addSource('source', config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/beeswarm/config.js b/beeswarm/config.js index cdd32e2..73a180a 100644 --- a/beeswarm/config.js +++ b/beeswarm/config.js @@ -1,7 +1,6 @@ config = { "graphicDataURL": "dataethnicity.csv", "colourPalette": ONScolours.oceanBlue, - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "xAxisFormat": ".0f", "topXAxis":true, diff --git a/beeswarm/index.html b/beeswarm/index.html index d01035e..264c848 100644 --- a/beeswarm/index.html +++ b/beeswarm/index.html @@ -26,9 +26,6 @@
- -
-
diff --git a/beeswarm/script.js b/beeswarm/script.js index b47a27e..6241a2d 100644 --- a/beeswarm/script.js +++ b/beeswarm/script.js @@ -3,7 +3,6 @@ import { addSvg, addAxisLabel, createDelaunayOverlay, - addSource, removeSpaces, AccurateBeeswarm } from "../lib/helpers.js"; @@ -88,7 +87,7 @@ function drawGraphic() { mode: "default", idKey: "id", labelKey: "label", - hideLabel:true, + hideLabel: true, groupKey: config.multiHighlight ? "" : "group", onChange: (selectedValue) => { overlay.clearHighlight(); @@ -325,7 +324,7 @@ function drawGraphic() { highlightFillColour: ONScolours.highlightOrange }); - + addAxisLabel({ svgContainer: chart, @@ -336,9 +335,6 @@ function drawGraphic() { wrapWidth: chartWidth, }); - //create link to source - addSource("source", config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/column-chart-ci-bands/config.js b/column-chart-ci-bands/config.js index f3fd20c..7d5f2ca 100644 --- a/column-chart-ci-bands/config.js +++ b/column-chart-ci-bands/config.js @@ -2,7 +2,6 @@ config = { "graphicDataURL": "data.csv", "colourPalette": ONScolours.oceanBlue, "lineColour": ONScolours.nightBlue, - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "xAxisTickFormat": { "sm": "%Y", diff --git a/column-chart-ci-bands/index.html b/column-chart-ci-bands/index.html index 706e307..d356b64 100644 --- a/column-chart-ci-bands/index.html +++ b/column-chart-ci-bands/index.html @@ -24,8 +24,6 @@
-
- diff --git a/column-chart-ci-bands/script.js b/column-chart-ci-bands/script.js index e456285..3f9d344 100644 --- a/column-chart-ci-bands/script.js +++ b/column-chart-ci-bands/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, addAxisLabel, addSource, customTemporalAxis } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, addAxisLabel, customTemporalAxis } from "../lib/helpers.js"; let graphic = d3.select('#graphic'); let pymChild = null; @@ -217,10 +217,6 @@ function drawGraphic() { .attr('class', 'legend--text') .html(config.legendEstimateText); - - //create link to source - addSource('source', config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/column-chart-stacked-optional-line-sm/config.js b/column-chart-stacked-optional-line-sm/config.js index fb5f9da..23411ff 100644 --- a/column-chart-stacked-optional-line-sm/config.js +++ b/column-chart-stacked-optional-line-sm/config.js @@ -4,7 +4,6 @@ config = { showLine: true, colourPalette: ONSpalette, lineColour: ONScolours.black, - sourceText: "Office for National Statistics", accessibleSummary: "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", xAxisTickFormat: { sm: "%b", diff --git a/column-chart-stacked-optional-line-sm/index.html b/column-chart-stacked-optional-line-sm/index.html index df9b7cb..89a2765 100644 --- a/column-chart-stacked-optional-line-sm/index.html +++ b/column-chart-stacked-optional-line-sm/index.html @@ -1,46 +1,35 @@ - - - - - Column And Line Small Multiple Chart Template - - - - - - - - - - - - -
- - - - - -
- - - - - - - - + + + + + Column And Line Small Multiple Chart Template + + + + + + + + + + + + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/column-chart-stacked-optional-line-sm/script.js b/column-chart-stacked-optional-line-sm/script.js index c5cde8f..f49d41e 100644 --- a/column-chart-stacked-optional-line-sm/script.js +++ b/column-chart-stacked-optional-line-sm/script.js @@ -386,9 +386,6 @@ function drawGraphic() { ); } - //create link to source - d3.select("#source").text("Source: " + config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/column-chart-stacked-optional-line/config.js b/column-chart-stacked-optional-line/config.js index 2e841ca..919cacd 100644 --- a/column-chart-stacked-optional-line/config.js +++ b/column-chart-stacked-optional-line/config.js @@ -6,7 +6,6 @@ config = { //line will only be shown if the markers are also shown colourPalette: ONSpalette, lineColour: ONScolours.black, - sourceText: "Office for National Statistics", accessibleSummary: "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", xAxisTickFormat: { sm: "%b %Y", diff --git a/column-chart-stacked-optional-line/index.html b/column-chart-stacked-optional-line/index.html index 04b2c55..c1d94c2 100644 --- a/column-chart-stacked-optional-line/index.html +++ b/column-chart-stacked-optional-line/index.html @@ -1,46 +1,35 @@ - - - - - Column and Line Chart Template - - - - - - - - - - - - -
- - - - - -
- - - - - - - - + + + + + Column and Line Chart Template + + + + + + + + + + + + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/column-chart-stacked-optional-line/script.js b/column-chart-stacked-optional-line/script.js index f17d9a3..bc0c6f9 100644 --- a/column-chart-stacked-optional-line/script.js +++ b/column-chart-stacked-optional-line/script.js @@ -317,9 +317,6 @@ function drawGraphic() { wrapWidth: chart_width, }); - //create link to source - d3.select("#source").text("Source: " + config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/column-chart/config.js b/column-chart/config.js index 0c88c88..58ad41e 100644 --- a/column-chart/config.js +++ b/column-chart/config.js @@ -1,8 +1,6 @@ config = { - "graphicDataURL": "data.csv", "colourPalette": ONScolours.oceanBlue, - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "xAxisTickFormat": { "sm": "%Y", @@ -53,12 +51,12 @@ config = { }, "addFirstDate": false, "addFinalDate": false, - "labelSpans":{ - "enabled":true, - timeUnit:"month",//set to "day","month",'quarter' or 'year' - secondaryTimeUnit:"auto",//can be 'auto', false to disable or override with "day","month",'quarter' or 'year' - yearStartMonth:3,//0 indexed so the year start in April - prefix:"FY ",//prefix for secondary label + "labelSpans": { + "enabled": true, + timeUnit: "month",//set to "day","month",'quarter' or 'year' + secondaryTimeUnit: "auto",//can be 'auto', false to disable or override with "day","month",'quarter' or 'year' + yearStartMonth: 3,//0 indexed so the year start in April + prefix: "FY ",//prefix for secondary label }, "elements": { "select": 0, "nav": 0, "legend": 0, "titles": 0 } }; diff --git a/column-chart/index.html b/column-chart/index.html index 5b41863..85d3d3b 100644 --- a/column-chart/index.html +++ b/column-chart/index.html @@ -26,10 +26,6 @@
- -
-
- diff --git a/column-chart/script.js b/column-chart/script.js index 70b033e..65b406a 100644 --- a/column-chart/script.js +++ b/column-chart/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, addAxisLabel, addSource, customTemporalAxis, prefixYearFormatter } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, addAxisLabel, customTemporalAxis, prefixYearFormatter } from "../lib/helpers.js"; let graphic = d3.select('#graphic'); let pymChild = null; @@ -142,9 +142,6 @@ function drawGraphic() { wrapWidth: chartWidth }); - //create link to source - addSource('source', config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/doughnut/config.js b/doughnut/config.js index 6a64bc9..cbe1410 100644 --- a/doughnut/config.js +++ b/doughnut/config.js @@ -1,7 +1,6 @@ config = { "graphicDataURL": "data.csv", "colourPalette": ONSpalette, - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "dataLabels": { "show": true, diff --git a/doughnut/index.html b/doughnut/index.html index 0ea2c3b..bdb2b8d 100644 --- a/doughnut/index.html +++ b/doughnut/index.html @@ -29,9 +29,6 @@
-
-
- diff --git a/doughnut/script.js b/doughnut/script.js index d24eb83..507adc9 100644 --- a/doughnut/script.js +++ b/doughnut/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSource } from "../lib/helpers.js"; +import { initialise, wrap} from "../lib/helpers.js"; var graphic = d3.select('#graphic'); var legend = d3.select('#legend'); @@ -192,10 +192,6 @@ function drawGraphic() { .attr('text-anchor', 'middle') .call(wrap, radius / 2); - - //create link to source - addSource('source', config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/heatmap/config.js b/heatmap/config.js index 495ae20..3f5fb8b 100644 --- a/heatmap/config.js +++ b/heatmap/config.js @@ -3,7 +3,6 @@ config = { "graphicDataURL": "data.csv", "colourPalette": "YlGnBu", // colour brewer palette or custom array of colours - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "dataLabelsNumberFormat": ".0f", "xAxisLabel": "x axis label", diff --git a/heatmap/index.html b/heatmap/index.html index bca0a52..b257f41 100644 --- a/heatmap/index.html +++ b/heatmap/index.html @@ -13,7 +13,7 @@ - + @@ -25,10 +25,6 @@
- -
-
- @@ -39,4 +35,4 @@
- + \ No newline at end of file diff --git a/heatmap/script.js b/heatmap/script.js index 84da687..4b0cd77 100644 --- a/heatmap/script.js +++ b/heatmap/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, addSource } from "../lib/helpers.js"; +import { initialise, wrap, addSvg} from "../lib/helpers.js"; const graphic = d3.select('#graphic'); const legend = d3.select('#legend'); @@ -263,9 +263,6 @@ function drawGraphic() { .text((d) => d3.format(config.dataLabelsNumberFormat)(d.value)) .attr('pointer-events', 'none'); - //create link to source - addSource('source', config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/line-chart-dropdown-options/config.js b/line-chart-dropdown-options/config.js index 315726f..f563aa5 100644 --- a/line-chart-dropdown-options/config.js +++ b/line-chart-dropdown-options/config.js @@ -2,7 +2,6 @@ config = { "graphicDataURL": "data.csv", "colourPalette": ONSlinePalette, "drawLegend": "auto", // true = always show, false = never show, "auto" = show only at sm size - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "lineCurveType": "curveLinear", // Set the default line curve type // Examples of line curve types diff --git a/line-chart-dropdown-options/index.html b/line-chart-dropdown-options/index.html index cb2297d..eb9228e 100644 --- a/line-chart-dropdown-options/index.html +++ b/line-chart-dropdown-options/index.html @@ -25,10 +25,6 @@
- -
-
- diff --git a/line-chart-dropdown-options/script.js b/line-chart-dropdown-options/script.js index f68f721..deb0551 100644 --- a/line-chart-dropdown-options/script.js +++ b/line-chart-dropdown-options/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, addAxisLabel, addSource, createDirectLabels, getXAxisTicks, calculateAutoBounds, customTemporalAxis, drawIndexedLegendShape, drawIndexedLineEndMarker, expandCustomTemporalAxisDomain } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, addAxisLabel, createDirectLabels, getXAxisTicks, calculateAutoBounds, customTemporalAxis, drawIndexedLegendShape, drawIndexedLineEndMarker, expandCustomTemporalAxisDomain } from "../lib/helpers.js"; import { EnhancedSelect } from "../lib/enhancedSelect.js"; let graphic = d3.select('#graphic'); @@ -406,9 +406,6 @@ function drawGraphic() { wrapWidth: chartWidth }); - //create link to source - addSource('source', config.sourceText); - //if there is a default option, set it if (config.defaultOption) { const defaultOption = dropdownData.find((option) => option.id === config.defaultOption); diff --git a/line-chart-sm-focus/config.js b/line-chart-sm-focus/config.js index 5434900..b23055d 100644 --- a/line-chart-sm-focus/config.js +++ b/line-chart-sm-focus/config.js @@ -9,7 +9,6 @@ config = { "referenceCategory": "England",// Highlighted on each chart and doesn't get it's own chart - leave blank to turn off "legendLabel": "selected group", "allLabel": "all other groups", - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "lineCurveType": "curveLinear", // Set the default line curve type // Examples of line curve types diff --git a/line-chart-sm-focus/index.html b/line-chart-sm-focus/index.html index 61464eb..3edd340 100644 --- a/line-chart-sm-focus/index.html +++ b/line-chart-sm-focus/index.html @@ -24,10 +24,6 @@
- -
-
- diff --git a/line-chart-sm-focus/script.js b/line-chart-sm-focus/script.js index 2e79471..53e297f 100644 --- a/line-chart-sm-focus/script.js +++ b/line-chart-sm-focus/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, calculateChartWidth, addChartTitleLabel, addAxisLabel, addSource, getXAxisTicks, calculateAutoBounds, customTemporalAxis, drawShapeMarker, expandCustomTemporalAxisDomain } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, calculateChartWidth, addChartTitleLabel, addAxisLabel, getXAxisTicks, calculateAutoBounds, customTemporalAxis, drawShapeMarker, expandCustomTemporalAxisDomain } from "../lib/helpers.js"; let graphic = d3.select('#graphic'); let legend = d3.select('#legend'); @@ -427,11 +427,6 @@ function drawGraphic() { return d[0]; }); - - //create link to source - addSource('source', config.sourceText); - - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/line-chart-sm-multiseries/config.js b/line-chart-sm-multiseries/config.js index e0edd7d..eed96a8 100644 --- a/line-chart-sm-multiseries/config.js +++ b/line-chart-sm-multiseries/config.js @@ -1,7 +1,6 @@ config = { "graphicDataURL": "datanumeric.csv", "colourPalette": ONSlinePalette, - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "lineCurveType": "curveLinear", // Set the default line curve type // Examples of line curve types diff --git a/line-chart-sm-multiseries/index.html b/line-chart-sm-multiseries/index.html index 76ee8d0..905181b 100644 --- a/line-chart-sm-multiseries/index.html +++ b/line-chart-sm-multiseries/index.html @@ -24,10 +24,6 @@
- -
-
- diff --git a/line-chart-sm-multiseries/script.js b/line-chart-sm-multiseries/script.js index 89061d4..18398f4 100644 --- a/line-chart-sm-multiseries/script.js +++ b/line-chart-sm-multiseries/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, calculateChartWidth, addChartTitleLabel, addAxisLabel, addSource, getXAxisTicks, customTemporalAxis, calculateAutoBounds, drawIndexedLegendShape, drawIndexedLineEndMarker, expandCustomTemporalAxisDomain } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, calculateChartWidth, addChartTitleLabel, addAxisLabel, getXAxisTicks, customTemporalAxis, calculateAutoBounds, drawIndexedLegendShape, drawIndexedLineEndMarker, expandCustomTemporalAxisDomain } from "../lib/helpers.js"; let graphic = d3.select('#graphic'); @@ -356,9 +356,6 @@ function drawGraphic() { }); } - //create link to source - addSource('source', config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/line-chart-with-ci-area-sm/config.js b/line-chart-with-ci-area-sm/config.js index c9a7c03..8d34b30 100644 --- a/line-chart-with-ci-area-sm/config.js +++ b/line-chart-with-ci-area-sm/config.js @@ -5,7 +5,6 @@ config = { ONScolours.beetrootPurple, ONScolours.emeraldGreen ], - "sourceText": "Office for National Statistics ", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "lineCurveType": "curveLinear", // Set the default line curve type // Examples of line curve types diff --git a/line-chart-with-ci-area-sm/index.html b/line-chart-with-ci-area-sm/index.html index ef3928c..0305ce2 100644 --- a/line-chart-with-ci-area-sm/index.html +++ b/line-chart-with-ci-area-sm/index.html @@ -24,10 +24,6 @@
- -
-
- diff --git a/line-chart-with-ci-area-sm/script.js b/line-chart-with-ci-area-sm/script.js index 40fb16d..176559c 100644 --- a/line-chart-with-ci-area-sm/script.js +++ b/line-chart-with-ci-area-sm/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, calculateChartWidth, addChartTitleLabel, addAxisLabel, addDirectionArrow, addElbowArrow, addSource, getXAxisTicks, calculateAutoBounds, customTemporalAxis, drawIndexedLegendShape, drawIndexedLineEndMarker, getCiAreaOverlapFlags, expandCustomTemporalAxisDomain } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, calculateChartWidth, addChartTitleLabel, addAxisLabel, addDirectionArrow, addElbowArrow, getXAxisTicks, calculateAutoBounds, customTemporalAxis, drawIndexedLegendShape, drawIndexedLineEndMarker, getCiAreaOverlapFlags, expandCustomTemporalAxisDomain } from "../lib/helpers.js"; let graphic = d3.select('#graphic'); let legend = d3.select('#legend'); @@ -293,7 +293,7 @@ function drawGraphic() { .append('div') .attr('class', 'legend--item'); - legenditem.each(function(d, i) { + legenditem.each(function (d, i) { const item = d3.select(this); const useLines = config.addEndMarkers === false; const svg = item.append('svg') @@ -377,9 +377,6 @@ function drawGraphic() { } - //create link to source - addSource('source', config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/line-chart-with-ci-area/config.js b/line-chart-with-ci-area/config.js index d4ccd2f..317bc60 100644 --- a/line-chart-with-ci-area/config.js +++ b/line-chart-with-ci-area/config.js @@ -6,7 +6,6 @@ config = { ONScolours.emeraldGreen ], "drawLegend": "auto", // true = always show, false = never show, "auto" = show only at sm size - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "lineCurveType": "curveLinear", // Set the default line curve type // Examples of line curve types diff --git a/line-chart-with-ci-area/index.html b/line-chart-with-ci-area/index.html index ebab8e6..b220243 100644 --- a/line-chart-with-ci-area/index.html +++ b/line-chart-with-ci-area/index.html @@ -24,10 +24,6 @@
- -
-
- diff --git a/line-chart-with-ci-area/script.js b/line-chart-with-ci-area/script.js index 38331c1..a207d5b 100644 --- a/line-chart-with-ci-area/script.js +++ b/line-chart-with-ci-area/script.js @@ -1,5 +1,5 @@ //Note: see data.csv for the required data format - the template is quite paticular on the columns ending with _lowerCI and _upperCI -import { initialise, wrap, addSvg, addAxisLabel, addDirectionArrow, addElbowArrow, addSource, createDirectLabels, getXAxisTicks, calculateAutoBounds, customTemporalAxis, drawIndexedLegendShape, drawIndexedLineEndMarker, getCiAreaOverlapFlags, expandCustomTemporalAxisDomain } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, addAxisLabel, addDirectionArrow, addElbowArrow, createDirectLabels, getXAxisTicks, calculateAutoBounds, customTemporalAxis, drawIndexedLegendShape, drawIndexedLineEndMarker, getCiAreaOverlapFlags, expandCustomTemporalAxisDomain } from "../lib/helpers.js"; let graphic = d3.select('#graphic'); let legend = d3.selectAll('#legend') @@ -325,9 +325,6 @@ function drawGraphic() { wrapWidth: chartWidth }); - //create link to source - addSource('source', config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/line-chart/config.js b/line-chart/config.js index aed6e24..bccdc83 100644 --- a/line-chart/config.js +++ b/line-chart/config.js @@ -2,7 +2,6 @@ config = { "graphicDataURL": "data.csv", "colourPalette": ONSlinePalette, "drawLegend": "auto", // true = always show, false = never show, "auto" = show only at sm size - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "lineCurveType": "curveLinear", // Set the default line curve type // Examples of line curve types diff --git a/line-chart/index.html b/line-chart/index.html index 84d7781..4702289 100644 --- a/line-chart/index.html +++ b/line-chart/index.html @@ -24,10 +24,6 @@
- -
-
- diff --git a/line-chart/script.js b/line-chart/script.js index af574f9..16395d0 100644 --- a/line-chart/script.js +++ b/line-chart/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, addAxisLabel, addSource, createDirectLabels, getXAxisTicks, calculateAutoBounds, customTemporalAxis, drawIndexedLegendShape, drawIndexedLineEndMarker, expandCustomTemporalAxisDomain } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, addAxisLabel, createDirectLabels, getXAxisTicks, calculateAutoBounds, customTemporalAxis, drawIndexedLegendShape, drawIndexedLineEndMarker, expandCustomTemporalAxisDomain } from "../lib/helpers.js"; let graphic = d3.select('#graphic'); let legend = d3.select('#legend'); @@ -341,9 +341,6 @@ function drawGraphic() { wrapWidth: chartWidth }); - //create link to source - addSource('source', config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/population-pyramid/config.js b/population-pyramid/config.js index 1eeb33d..4432ddb 100644 --- a/population-pyramid/config.js +++ b/population-pyramid/config.js @@ -42,9 +42,6 @@ const config = { // Legend legend: ["Current population", "Comparison population"], - // Source - sourceText: "Census data 2021", - // accessible summary accessibleSummary: "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", diff --git a/population-pyramid/index.html b/population-pyramid/index.html index 40a0171..2eed801 100644 --- a/population-pyramid/index.html +++ b/population-pyramid/index.html @@ -29,9 +29,6 @@
- -
-
diff --git a/population-pyramid/script.js b/population-pyramid/script.js index fb0d690..67bf62e 100644 --- a/population-pyramid/script.js +++ b/population-pyramid/script.js @@ -1,5 +1,5 @@ -import { initialise, wrap, addSvg, addAxisLabel, addSource } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, addAxisLabel} from "../lib/helpers.js"; import { EnhancedSelect } from "../lib/enhancedSelect.js" const graphic = d3.select('#graphic'); @@ -47,8 +47,6 @@ function drawGraphic() { // Create chart createChart(margin); - // Create source link - addSource('source', config.sourceText) // Use pym to calculate chart dimensions if (pymChild) { diff --git a/range-arrow-dot-bar-reference-sm/config.js b/range-arrow-dot-bar-reference-sm/config.js index fcb3a15..aa1f3be 100644 --- a/range-arrow-dot-bar-reference-sm/config.js +++ b/range-arrow-dot-bar-reference-sm/config.js @@ -7,7 +7,6 @@ config = { //default stroke is none. Can be added for contrast or emphasis colourPaletteArrows: [ONScolours.oceanBlue, ONScolours.coralPink], colourPaletteBar: [ONScolours.skyBlue], - sourceText: "Office for National Statistics", accessibleSummary: "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", dataLabels: { show: true, diff --git a/range-arrow-dot-bar-reference-sm/index.html b/range-arrow-dot-bar-reference-sm/index.html index 90e5114..8c9d226 100644 --- a/range-arrow-dot-bar-reference-sm/index.html +++ b/range-arrow-dot-bar-reference-sm/index.html @@ -1,46 +1,35 @@ - - - - - Small Multiple Range/Arrow/Dot/Bar and reference plot - - - - - - - - - - - - -
- - - - - -
- - - - - - - - + + + + + Small Multiple Range/Arrow/Dot/Bar and reference plot + + + + + + + + + + + + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/range-arrow-dot-bar-reference-sm/script.js b/range-arrow-dot-bar-reference-sm/script.js index 68565e0..30f54ae 100644 --- a/range-arrow-dot-bar-reference-sm/script.js +++ b/range-arrow-dot-bar-reference-sm/script.js @@ -753,9 +753,6 @@ function drawGraphic() { }); } - //create link to source - d3.select("#source").text("Source: " + config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/range-arrow-dot-bar-reference/config.js b/range-arrow-dot-bar-reference/config.js index 08b7d0a..39cd6d3 100644 --- a/range-arrow-dot-bar-reference/config.js +++ b/range-arrow-dot-bar-reference/config.js @@ -8,7 +8,6 @@ config = { colourPaletteArrows: [ONScolours.oceanBlue, ONScolours.coralPink, ONScolours.grey50], // [increase, decrease, no change] colourPaletteBar: [ONScolours.skyBlue], - sourceText: "Office for National Statistics", accessibleSummary: "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", numberFormat: ".0f", xAxisTickFormat: ".0f", diff --git a/range-arrow-dot-bar-reference/index.html b/range-arrow-dot-bar-reference/index.html index 03e6c62..b906f13 100644 --- a/range-arrow-dot-bar-reference/index.html +++ b/range-arrow-dot-bar-reference/index.html @@ -1,46 +1,35 @@ - - - - - Range/Arrow/Dot/Bar and reference plot - - - - - - - - - - - - -
- - - - - -
- - - - - - - - + + + + + Range/Arrow/Dot/Bar and reference plot + + + + + + + + + + + + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/range-arrow-dot-bar-reference/script.js b/range-arrow-dot-bar-reference/script.js index 9cc4530..a1be6f1 100644 --- a/range-arrow-dot-bar-reference/script.js +++ b/range-arrow-dot-bar-reference/script.js @@ -714,9 +714,6 @@ function drawGraphic() { }); } - //create link to source - d3.select("#source").text("Source: " + config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/range-ci-area-grouped/config.js b/range-ci-area-grouped/config.js index 4f93079..2b1ac4a 100644 --- a/range-ci-area-grouped/config.js +++ b/range-ci-area-grouped/config.js @@ -1,7 +1,6 @@ config = { "graphicDataURL": "data.csv", "colourPalette": ONSpalette, - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "xAxisTickFormat": ".0f", "xAxisLabel": "x axis label", diff --git a/range-ci-area-grouped/index.html b/range-ci-area-grouped/index.html index 67ae9af..6b645d3 100644 --- a/range-ci-area-grouped/index.html +++ b/range-ci-area-grouped/index.html @@ -26,10 +26,6 @@
- -
-
- diff --git a/range-ci-area-grouped/script.js b/range-ci-area-grouped/script.js index bfc02b6..15780bb 100644 --- a/range-ci-area-grouped/script.js +++ b/range-ci-area-grouped/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, addAxisLabel, addDirectionArrow, addElbowArrow, addSource } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, addAxisLabel, addDirectionArrow, addElbowArrow} from "../lib/helpers.js"; let graphic = d3.select('#graphic'); let legend = d3.select('#legend'); @@ -280,10 +280,6 @@ function drawGraphic() { ) } - - //create link to source - addSource('source', config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/scatter-bubble-plot/config.js b/scatter-bubble-plot/config.js index 32174c7..607fdf0 100644 --- a/scatter-bubble-plot/config.js +++ b/scatter-bubble-plot/config.js @@ -1,7 +1,6 @@ config={ "graphicDataURL": "data.csv", "colourPalette": [ONScolours.oceanBlue,ONScolours.springGreen,ONScolours.coralPink,ONScolours.skyBlue], - "sourceText": "Office for National Statistics", "accessibleSummary":"The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "xDomain":[0,1], "yDomain":[-0.14,1], // either "auto" or an array for the x/y domain e.g. [0,100] diff --git a/scatter-bubble-plot/index.html b/scatter-bubble-plot/index.html index 35c8dc1..4a3a03d 100644 --- a/scatter-bubble-plot/index.html +++ b/scatter-bubble-plot/index.html @@ -29,9 +29,6 @@
- -
-
diff --git a/scatter-bubble-plot/script.js b/scatter-bubble-plot/script.js index 07067fd..825878e 100644 --- a/scatter-bubble-plot/script.js +++ b/scatter-bubble-plot/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap2, addSvg, addAxisLabel, diamondShape, createDelaunayOverlay, addSource } from "../lib/helpers.js"; +import { initialise, wrap2, addSvg, addAxisLabel, diamondShape, createDelaunayOverlay } from "../lib/helpers.js"; import { EnhancedSelect } from "../lib/enhancedSelect.js"; let graphic = d3.select('#graphic'); @@ -82,11 +82,11 @@ function drawGraphic() { .style('margin-bottom', '5px'); sizeLegendItems.append('svg') - .attr('width', d => Math.round(Math.sqrt(sizeScale(d) / Math.PI)*2)+2) - .attr('height', d => Math.round(Math.sqrt(sizeScale(d) / Math.PI)*2)+2) + .attr('width', d => Math.round(Math.sqrt(sizeScale(d) / Math.PI) * 2) + 2) + .attr('height', d => Math.round(Math.sqrt(sizeScale(d) / Math.PI) * 2) + 2) .append('circle') - .attr('cx', d => Math.round(Math.sqrt(sizeScale(d) / Math.PI))+0.5) - .attr('cy', d => Math.round(Math.sqrt(sizeScale(d) / Math.PI))+0.5) + .attr('cx', d => Math.round(Math.sqrt(sizeScale(d) / Math.PI)) + 0.5) + .attr('cy', d => Math.round(Math.sqrt(sizeScale(d) / Math.PI)) + 0.5) .attr('r', d => Math.round(Math.sqrt(sizeScale(d) / Math.PI))) .attr('fill', config.colourPalette[0]) .attr('fill-opacity', 0.75) @@ -97,50 +97,50 @@ function drawGraphic() { .style('margin-left', '5px') .style('margin-right', '15px') .style('font-size', '12px') - .text(d => d3.format(config.sizeConfig.sizeLabelFormat)(d)+` ${config.sizeConfig.sizeLabel}`); - }else{ - - - let legenditem = legend.selectAll('div.legend-item') - .data(groups) - .enter() - .append('div') - .attr('class', 'legend--item') - .style('display', 'flex') - .style('align-items', 'center'); - - legenditem.append('svg') - .attr('width', 20) - .attr('height', 20) - .append('path') - .attr('stroke-width', '1px') - .attr('d', d => { - switch (shape(d)) { - case 'circle': return d3.symbol().type(d3.symbolCircle).size(circleSize)(); - case 'square': return d3.symbol().type(d3.symbolSquare).size(squareSize)(); - case 'triangle': return d3.symbol().type(d3.symbolTriangle).size(triangleSize)(); - case 'diamond': return diamondShape(diamondSize / 10); // Use the custom diamond shape - } - }) - .attr('transform', 'translate(10,10)') - .attr('fill', d => colour(d)) - .attr('stroke', '#fff'); - - legenditem.append('p') - .attr('class', 'legend--text') - .style('margin-left', '5px') - .text(d => d); + .text(d => d3.format(config.sizeConfig.sizeLabelFormat)(d) + ` ${config.sizeConfig.sizeLabel}`); + } else { + + + let legenditem = legend.selectAll('div.legend-item') + .data(groups) + .enter() + .append('div') + .attr('class', 'legend--item') + .style('display', 'flex') + .style('align-items', 'center'); + + legenditem.append('svg') + .attr('width', 20) + .attr('height', 20) + .append('path') + .attr('stroke-width', '1px') + .attr('d', d => { + switch (shape(d)) { + case 'circle': return d3.symbol().type(d3.symbolCircle).size(circleSize)(); + case 'square': return d3.symbol().type(d3.symbolSquare).size(squareSize)(); + case 'triangle': return d3.symbol().type(d3.symbolTriangle).size(triangleSize)(); + case 'diamond': return diamondShape(diamondSize / 10); // Use the custom diamond shape + } + }) + .attr('transform', 'translate(10,10)') + .attr('fill', d => colour(d)) + .attr('stroke', '#fff'); + + legenditem.append('p') + .attr('class', 'legend--text') + .style('margin-left', '5px') + .text(d => d); } // set up dropdown const dropdownData = graphicData - .slice() // Create copy to avoid mutating original - .sort((a, b) => (a.name || '').localeCompare(b.name || '')) - .map((point) => ({ - id: point.originalId, // Use stable ID - label: point.name || `Point ${point.originalId + 1}`, - group: point.group - })); + .slice() // Create copy to avoid mutating original + .sort((a, b) => (a.name || '').localeCompare(b.name || '')) + .map((point) => ({ + id: point.originalId, // Use stable ID + label: point.name || `Point ${point.originalId + 1}`, + group: point.group + })); const select = new EnhancedSelect({ containerId: 'select', @@ -225,9 +225,9 @@ function drawGraphic() { } svg.append('g').selectAll('path') - .data(graphicData.sort((a, b) => { - if (sizeScale) { - return d3.descending(a[config.sizeConfig.sizeField],b[config.sizeConfig.sizeField]) + .data(graphicData.sort((a, b) => { + if (sizeScale) { + return d3.descending(a[config.sizeConfig.sizeField], b[config.sizeConfig.sizeField]) } else { return 0 } @@ -259,9 +259,9 @@ function drawGraphic() { // Create Delaunay overlay for tooltips (Basic version) overlayCleanup = createDelaunayOverlay({ svgContainer: svg, - data: graphicData.sort((a, b) => { - if (sizeScale) { - return d3.descending(a[config.sizeConfig.sizeField],b[config.sizeConfig.sizeField]) + data: graphicData.sort((a, b) => { + if (sizeScale) { + return d3.descending(a[config.sizeConfig.sizeField], b[config.sizeConfig.sizeField]) } else { return 0 } @@ -299,11 +299,11 @@ function drawGraphic() { .attr('fill', '#404142') .text(d => d.name) .style('font-weight', '600') - .each(function(d){ - if(sizeScale){ - wrap2(d3.select(this),100,Math.round(Math.sqrt(sizeScale(d[config.sizeConfig.sizeField]) / Math.PI))/14+1,1,1.05,1,true,'middle') + .each(function (d) { + if (sizeScale) { + wrap2(d3.select(this), 100, Math.round(Math.sqrt(sizeScale(d[config.sizeConfig.sizeField]) / Math.PI)) / 14 + 1, 1, 1.05, 1, true, 'middle') } else { - wrap2(d3.select(this),100,1.5,1,1.05,1,true,'middle') + wrap2(d3.select(this), 100, 1.5, 1, 1.05, 1, true, 'middle') } }); @@ -328,12 +328,6 @@ function drawGraphic() { }); - //create link to source - - addSource('source', config.sourceText) - - - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); @@ -341,7 +335,7 @@ function drawGraphic() { } -d3.csv(config.graphicDataURL,d3.autoType) +d3.csv(config.graphicDataURL, d3.autoType) .then(data => { // Add unique IDs based on original data order graphicData = data.map((d, index) => ({ diff --git a/slope-chart/config.js b/slope-chart/config.js index f72117e..ae4accf 100644 --- a/slope-chart/config.js +++ b/slope-chart/config.js @@ -1,7 +1,6 @@ config = { "graphicDataURL": "data.csv", "colourPalette": ONSlinePalette, - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "lineCurveType": "curveLinear", "yDomainMin": "auto", diff --git a/slope-chart/index.html b/slope-chart/index.html index 242159b..1d365a8 100644 --- a/slope-chart/index.html +++ b/slope-chart/index.html @@ -24,10 +24,6 @@
- -
-
- diff --git a/slope-chart/script.js b/slope-chart/script.js index fea9587..f257f81 100644 --- a/slope-chart/script.js +++ b/slope-chart/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, addSource, calculateAutoBounds, adjustColorForContrast } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, calculateAutoBounds, adjustColorForContrast } from "../lib/helpers.js"; let graphic = d3.select('#graphic'); //console.log(`Graphic selected: ${graphic}`); @@ -233,10 +233,6 @@ function drawGraphic() { // .tickFormat(d3.format(config.yAxisNumberFormat))) // .attr('transform', "translate(" + margin.left + ", 0)"); - //create link to source - addSource('source', config.sourceText); - // console.log(`Link to source created`); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/waterfall/config.js b/waterfall/config.js index 6009ea2..f1fd781 100644 --- a/waterfall/config.js +++ b/waterfall/config.js @@ -5,7 +5,6 @@ config = { ONScolours.coralPink, ONScolours.grey50, ], - sourceText: "Office for National Statistics", accessibleSummary: "This chart has been hidden from screen readers. The main message is summarised in the chart title and data is available to download below.", // options are "ascending", "descending", "auto" (to order based on whether total is ascending or descending), or "none" diff --git a/waterfall/index.html b/waterfall/index.html index f1741d3..29239d6 100644 --- a/waterfall/index.html +++ b/waterfall/index.html @@ -26,10 +26,6 @@
- -
-
- diff --git a/waterfall/script.js b/waterfall/script.js index 51fb944..f67c42b 100644 --- a/waterfall/script.js +++ b/waterfall/script.js @@ -787,9 +787,6 @@ function drawGraphic() { } } - //create link to source - d3.select("#source").text("Source: " + config.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/z-annotation-bar-example/config.js b/z-annotation-bar-example/config.js index ecdcb4c..562e83b 100644 --- a/z-annotation-bar-example/config.js +++ b/z-annotation-bar-example/config.js @@ -1,8 +1,7 @@ config = { "graphic_data_url": "data.csv", "colour_palette": "#206095", - "sourceText": "Office for National Statistics", - "accessibleSummary": "Here is the screenreader text describing the chart.", + "accessibleSummary": "This chart has been hidden from screen readers. The main message is summarised in the chart title and data is available to download below.", "dataLabels": { "show": true, "numberFormat": ".0%" diff --git a/z-annotation-bar-example/index.html b/z-annotation-bar-example/index.html index e9a10d1..d6575a6 100644 --- a/z-annotation-bar-example/index.html +++ b/z-annotation-bar-example/index.html @@ -26,8 +26,6 @@
-
-
diff --git a/z-annotation-bar-example/script.js b/z-annotation-bar-example/script.js index 0a537d0..009ed1d 100644 --- a/z-annotation-bar-example/script.js +++ b/z-annotation-bar-example/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, addDataLabels, addAxisLabel, setupArrowhead, addSource, addAnnotation, createAnnotationToolbar } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, addDataLabels, addAxisLabel, setupArrowhead, addAnnotation, createAnnotationToolbar } from "../lib/helpers.js"; let graphic = d3.select('#graphic'); let pymChild = null; @@ -178,9 +178,6 @@ function drawGraphic() { mobile:{enabled:isMobile,letter:"D"} }) - //create link to source - addSource('source', config.sourceText) - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/z-annotation-column-example/config.js b/z-annotation-column-example/config.js index 4e73734..635904c 100644 --- a/z-annotation-column-example/config.js +++ b/z-annotation-column-example/config.js @@ -2,8 +2,7 @@ config = { "essential": { "graphic_data_url": "data.csv", "colour_palette": "#206095", - "sourceText": "Office for National Statistics", - "accessibleSummary": "Here is the screenreader text describing the chart.", + "accessibleSummary": "This chart has been hidden from screen readers. The main message is summarised in the chart title and data is available to download below.", "xAxisTickFormat": { "sm": "%Y", "md": "%Y", diff --git a/z-annotation-column-example/index.html b/z-annotation-column-example/index.html index 1dc3887..ca0291c 100644 --- a/z-annotation-column-example/index.html +++ b/z-annotation-column-example/index.html @@ -26,10 +26,6 @@
- -
-
- diff --git a/z-annotation-column-example/script.js b/z-annotation-column-example/script.js index 84e2acd..f141ec4 100644 --- a/z-annotation-column-example/script.js +++ b/z-annotation-column-example/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, addAxisLabel, addSource, addAnnotation, setupMobileAnnotations } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, addAxisLabel, addAnnotation, setupMobileAnnotations } from "../lib/helpers.js"; let graphic = d3.select('#graphic'); let pymChild = null; @@ -162,9 +162,6 @@ function drawGraphic() { }) - //create link to source - addSource('source', config.essential.sourceText); - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/z-annotation-load-from-file/config.js b/z-annotation-load-from-file/config.js index 6ba2dc9..8b043e0 100644 --- a/z-annotation-load-from-file/config.js +++ b/z-annotation-load-from-file/config.js @@ -1,7 +1,6 @@ config = { "graphicDataURL": "data.csv", "colourPalette": ONScolours.oceanBlue, - "sourceText": "Office for National Statistics", "accessibleSummary": "The chart canvas is hidden from screen readers. The main message is summarised by the chart title and the data behind the chart is available to download below.", "dataLabels": { "show": true, diff --git a/z-annotation-load-from-file/index.html b/z-annotation-load-from-file/index.html index f8567dc..41401d0 100644 --- a/z-annotation-load-from-file/index.html +++ b/z-annotation-load-from-file/index.html @@ -28,8 +28,6 @@
-
-
diff --git a/z-annotation-load-from-file/script.js b/z-annotation-load-from-file/script.js index 74ee234..b051441 100644 --- a/z-annotation-load-from-file/script.js +++ b/z-annotation-load-from-file/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, addDataLabels, addAxisLabel, setupArrowhead, addSource, loadAnnotationsFromJson, setupMobileAnnotations } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, addDataLabels, addAxisLabel, setupArrowhead, loadAnnotationsFromJson, setupMobileAnnotations } from "../lib/helpers.js"; let graphic = d3.select('#graphic'); let pymChild = null; @@ -112,9 +112,6 @@ function drawGraphic() { loadAnnotationsFromJson("./annotations-1759314061962.json",svg, {xScale:x,yScale:y},isMobile) - //create link to source - addSource('source', config.sourceText) - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight(); diff --git a/z-annotation-toolbar/config.js b/z-annotation-toolbar/config.js index ecdcb4c..562e83b 100644 --- a/z-annotation-toolbar/config.js +++ b/z-annotation-toolbar/config.js @@ -1,8 +1,7 @@ config = { "graphic_data_url": "data.csv", "colour_palette": "#206095", - "sourceText": "Office for National Statistics", - "accessibleSummary": "Here is the screenreader text describing the chart.", + "accessibleSummary": "This chart has been hidden from screen readers. The main message is summarised in the chart title and data is available to download below.", "dataLabels": { "show": true, "numberFormat": ".0%" diff --git a/z-annotation-toolbar/index.html b/z-annotation-toolbar/index.html index e911b4d..4c8c6bf 100644 --- a/z-annotation-toolbar/index.html +++ b/z-annotation-toolbar/index.html @@ -26,9 +26,6 @@
-
-
- diff --git a/z-annotation-toolbar/script.js b/z-annotation-toolbar/script.js index aa52191..a8978e7 100644 --- a/z-annotation-toolbar/script.js +++ b/z-annotation-toolbar/script.js @@ -1,4 +1,4 @@ -import { initialise, wrap, addSvg, addDataLabels, addAxisLabel, setupArrowhead, addSource, addAnnotation, createAnnotationToolbar } from "../lib/helpers.js"; +import { initialise, wrap, addSvg, addDataLabels, addAxisLabel, setupArrowhead, addAnnotation, createAnnotationToolbar } from "../lib/helpers.js"; let graphic = d3.select('#graphic'); let pymChild = null; @@ -110,9 +110,6 @@ function drawGraphic() { createAnnotationToolbar(d3.select('svg'),svg,{xScale:x,yScale:y},margin, chartWidth,height) - //create link to source - addSource('source', config.sourceText) - //use pym to calculate chart dimensions if (pymChild) { pymChild.sendHeight();