Skip to content

Commit

Permalink
Merge pull request #23 from vasgat/staging
Browse files Browse the repository at this point in the history
updates on sankey chart
  • Loading branch information
vasgat authored Jan 9, 2025
2 parents c05189d + 1edadde commit 97a7cb4
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 119 deletions.
55 changes: 27 additions & 28 deletions dist/msa-dashboard/assets/charts/shankey-chart.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"width": 500,
"height": 400,
"padding": {
"bottom": 20,
"left": 20,
"right": 20,
"top": 20
"bottom": 10,
"left": 5,
"right": 10,
"top": 10
},
"signals": [
{
Expand Down Expand Up @@ -36,49 +36,49 @@
"category": "Modern slavery",
"stack": 2,
"sort": 1,
"labels": "left",
"labels": "right",
"gap": 10
},
{
"category": "Recruitment fees",
"stack": 2,
"sort": 2,
"labels": "left",
"labels": "right",
"gap": 10
},
{
"category": "Freedom of movement",
"stack": 2,
"sort": 3,
"labels": "left",
"labels": "right",
"gap": 10
},
{
"category": "Wages and benefits",
"stack": 2,
"sort": 4,
"labels": "left",
"labels": "right",
"gap": 10
},
{
"category": "Working Hours",
"stack": 2,
"sort": 5,
"labels": "left",
"labels": "right",
"gap": 10
},
{
"category": "Working conditions",
"stack": 2,
"sort": 6,
"labels": "left",
"labels": "right",
"gap": 10
},
{
"category": "Other incidents",
"stack": 2,
"sort": 7,
"labels": "left",
"labels": "right",
"gap": 10
},
{
Expand Down Expand Up @@ -515,13 +515,15 @@
"name": "color",
"type": "ordinal",
"range": [
"#000014",
"#00001C",
"#000022",
"#000029",
"#333355",
"#666680",
"#9999AA"
"#FF5C45",
"#FFEE99",
"#FFDC00",
"#FFC400",
"#FFB000",
"#FF9A00",
"#FF7A30",
"#FF6338"

],
"domain": {
"data": "stacks",
Expand Down Expand Up @@ -558,7 +560,7 @@
"field": "name"
},
"fillOpacity": {
"value": 0.9
"value": 0.95
},
"strokeWidth": {
"value": 0
Expand Down Expand Up @@ -671,7 +673,7 @@
"value": -2
},
"text": {
"field": "name"
"signal": "datum.stack > 1 ? datum.name : ''"
},
"lineBreak": {
"value": "\n"
Expand Down Expand Up @@ -700,7 +702,7 @@
"signal": "datum.stack > 1 ? 17 : 55"
},
"text": {
"signal": "format(datum.labeledValue, '') + '%'"
"signal": "datum.stack > 1 ? format(datum.labeledValue, '') + '%' : ''"
},
"align": {
"signal": "datum.labels=='left'?'right':'left'"
Expand All @@ -719,7 +721,7 @@
"update": {
"x": {
"field": "bounds.x1",
"offset": -38
"offset": -5
},
"x2": {
"field": "bounds.x2",
Expand All @@ -734,10 +736,7 @@
"offset": 8
},
"fill": {
"value": "white"
},
"opacity": {
"value": 0.6
"value": "transparent"
},
"cornerRadius": {
"value": 5
Expand All @@ -751,8 +750,8 @@
"stroke": "transparent"
},
"text": {
"fontSize": 15,
"fill": "#333333",
"fontSize": 18,
"fill": "#000029",
"font": "Rubik",
"fontWeight": 400
}
Expand Down
56 changes: 32 additions & 24 deletions dist/msa-dashboard/assets/reports_per_sector.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
[{
"title":"Renewable Energy",
"description":"A review of statements produced by Renewable Energy Companies under the UK adnd Australian Modern Slavery Act.",
"image":"https://dq06ugkuram52.cloudfront.net/files/15958724/42746867-large.png",
"href":"https://dq06ugkuram52.cloudfront.net/files/15958720/42746861.pdf"
},
{
"title":"Garment",
"description":"Assessing UK and Australian Modern Slavery Act statements produced by the garment industry and its investors",
"image":"https://dq06ugkuram52.cloudfront.net/files/13009495/40065491-large.png",
"href":"https://dq06ugkuram52.cloudfront.net/files/13009496/33519894.pdf"
},
{
"title":"Finance",
"description":"A review of statements produced by asset managers under the UK Modern Slavery Act",
"image":"https://dq06ugkuram52.cloudfront.net/files/13009707/40066709-large.png",
"href":"https://dq06ugkuram52.cloudfront.net/files/13009668/33520645.pdf"
},
{
"title":"Hospitality",
"description":"A review of statements produced by the Hospitality Sector under the UK Modern Slavery Act",
"image":"https://dq06ugkuram52.cloudfront.net/files/13009708/40066637-large.png",
"href":"https://cdn.walkfree.org/content/uploads/2020/10/06163448/2632_MSA-statements.V8_FNL.pdf"
}]
[
{
"title": "Electronics",
"description": "A review of statements produced by Electronics Companies under the UK and Australian Modern Slavery Act.",
"image": "https://wikirate-production-storage.fra1.cdn.digitaloceanspaces.com/files/20266642/49862489-large.png",
"href": "https://wikirate-production-storage.fra1.cdn.digitaloceanspaces.com/files/20266644/49862490.pdf"
},
{
"title": "Renewable Energy",
"description": "A review of statements produced by Renewable Energy Companies under the UK and Australian Modern Slavery Act.",
"image": "https://wikirate-production-storage.fra1.cdn.digitaloceanspaces.com/files/15958724/42746867-large.png",
"href": "https://wikirate-production-storage.fra1.cdn.digitaloceanspaces.com/files/15958720/42746861.pdf"
},
{
"title": "Garment",
"description": "Assessing UK and Australian Modern Slavery Act statements produced by the garment industry and its investors",
"image": "https://wikirate-production-storage.fra1.cdn.digitaloceanspaces.com/files/13009495/40065491-large.png",
"href": "https://wikirate-production-storage.fra1.cdn.digitaloceanspaces.com/files/13009496/33519894.pdf"
},
{
"title": "Finance",
"description": "A review of statements produced by asset managers under the UK Modern Slavery Act",
"image": "https://wikirate-production-storage.fra1.cdn.digitaloceanspaces.com/files/13009707/40066709-large.png",
"href": "https://wikirate-production-storage.fra1.cdn.digitaloceanspaces.com/files/13009668/33520645.pdf"
},
{
"title": "Hospitality",
"description": "A review of statements produced by the Hospitality Sector under the UK Modern Slavery Act",
"image": "https://wikirate-production-storage.fra1.cdn.digitaloceanspaces.com/files/13009708/40066637-large.png",
"href": "https://cdn.walkfree.org/content/uploads/2020/10/06163448/2632_MSA-statements.V8_FNL.pdf"
}
]
2 changes: 1 addition & 1 deletion dist/msa-dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@
<app-root></app-root>
<script src="https://use.fontawesome.com/eacca44f89.js"></script>
<script type="text/javascript" src="https://js.createsend1.com/javascript/copypastesubscribeformlogic.js"></script>
<script src="runtime.4d9be08b5519a318.js" type="module"></script><script src="polyfills.9b667fdefd80ddcd.js" type="module"></script><script src="scripts.b92344386afd2268.js" defer></script><script src="main.5e0fb6d2c69e1091.js" type="module"></script>
<script src="runtime.4d9be08b5519a318.js" type="module"></script><script src="polyfills.9b667fdefd80ddcd.js" type="module"></script><script src="scripts.b92344386afd2268.js" defer></script><script src="main.fde5d8e7a5e2db8a.js" type="module"></script>

</body></html>
1 change: 0 additions & 1 deletion dist/msa-dashboard/main.5e0fb6d2c69e1091.js

This file was deleted.

1 change: 1 addition & 0 deletions dist/msa-dashboard/main.fde5d8e7a5e2db8a.js

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions src/app/about/about.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,43 @@ export class AboutComponent implements OnInit {
contributors = [
{
"contributor": "Australian National University",
"logo": "https://dq06ugkuram52.cloudfront.net/files/5295432/20444349-medium.png"
"logo": "https://wikirate-production-storage.fra1.cdn.digitaloceanspaces.com/files/5295432/20444349-medium.png"
},
{
"contributor": "ESCP Europe",
"logo": "https://dq06ugkuram52.cloudfront.net/files/1779114/12602972-medium.png"
"logo": "https://wikirate-production-storage.fra1.cdn.digitaloceanspaces.com/files/1779114/12602972-medium.png"
},
{
"contributor": "John Hopkins University",
"logo": "https://dq06ugkuram52.cloudfront.net/files/2749557/12774885-medium.jpg"
"logo": "https://wikirate-production-storage.fra1.cdn.digitaloceanspaces.com/files/2749557/12774885-medium.jpg"
},
{
"contributor": "Lancaster University Management School",
"logo": "https://dq06ugkuram52.cloudfront.net/files/12639475/33117884-medium.png"
"logo": "https://wikirate-production-storage.fra1.cdn.digitaloceanspaces.com/files/12639475/33117884-medium.png"
},
{
"contributor": "School of International and Public Affairs at Columbia University",
"logo": "https://dq06ugkuram52.cloudfront.net/files/12639482/33117897-medium.png"
"logo": "https://wikirate-production-storage.fra1.cdn.digitaloceanspaces.com/files/12639482/33117897-medium.png"
},
{
"contributor": "University of Amsterdam",
"logo": "https://dq06ugkuram52.cloudfront.net/files/5759131/21999891-medium.png"
"logo": "https://wikirate-production-storage.fra1.cdn.digitaloceanspaces.com/files/5759131/21999891-medium.png"
},
{
"contributor": "University of British Columbia",
"logo": "https://dq06ugkuram52.cloudfront.net/files/2877117/13099211-medium.png"
"logo": "https://wikirate-production-storage.fra1.cdn.digitaloceanspaces.com/files/2877117/13099211-medium.png"
},
{
"contributor": "University of Connecticut",
"logo": "https://dq06ugkuram52.cloudfront.net/files/2877060/13099154-medium.png"
"logo": "https://wikirate-production-storage.fra1.cdn.digitaloceanspaces.com/files/2877060/13099154-medium.png"
},
{
"contributor": "University of Nottingham",
"logo": "https://dq06ugkuram52.cloudfront.net/files/3149947/13561221-medium.png"
"logo": "https://wikirate-production-storage.fra1.cdn.digitaloceanspaces.com/files/3149947/13561221-medium.png"
},
{
"contributor": "University of Western Australia",
"logo": "https://dq06ugkuram52.cloudfront.net/files/2549359/12602502-medium.jpeg"
"logo": "https://wikirate-production-storage.fra1.cdn.digitaloceanspaces.com/files/2549359/12602502-medium.jpeg"
}];

constructor(private route: ActivatedRoute, private sectorProvider: SectorProvider,private scroll: ViewportScroller) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ <h6 class="fst-italic" *ngIf="sector !== 'all-sectors'">{{getSectorName()}} Sect
supply chains. This stark gap reveals a critical need for better reporting and transparency.
</p>
</div>
<div class="col-12 d-flex justify-content-center justify-items-center pt-1">
</div>
<div class="row mt-4 align-items-center g-md-0">
<div class="col-md-3">
<h6 class="ms-1 text-end fst-5"><span class="h4">{{companies_reporting_msi | percentageFormat}}</span><br> of companies disclosing violations report incidents in the following categories</h6>
</div>
<div class="col-md-9">
<div id="incidents-chart" class="chart-wrapper"></div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export class HighlightMetricComponent implements OnInit {
year: string = ''
legislation: string = 'both'
incidents_url: string = "#"
companies_reporting_msi!: number

constructor(private dataProvider: DataProvider, private modalService: NgbModal,
private route: ActivatedRoute, private sectorProvider: SectorProvider, private chartsService: ChartsService) {
Expand Down Expand Up @@ -131,19 +132,20 @@ export class HighlightMetricComponent implements OnInit {
msa_incidents_response = msa_incidents_response.filter((item: any) => assessed_response.find((o: any) => o.company == item.company && o.year == item.year))

var values = []
this.companies_reporting_msi = Math.round((msa_incidents_response.length) * 100 / assessed_response.length)
values.push({
"category": "Companies reporting\nmodern slavery\nincidents",
"stack": 1,
"sort": 1,
"labels": "left",
"labeledValue": Math.round((msa_incidents_response.length) * 100 / assessed_response.length)
"labeledValue": this.companies_reporting_msi
})
for (var i = 0; i < accepted_values.length; i++) {
values.push({
"category": accepted_values[i] == 'Yes' ? 'Modern slavery' : accepted_values[i],
"stack": 2,
"sort": i + 1,
"labels": "left",
"labels": "right",
"gap": 10
})
}
Expand Down
Loading

0 comments on commit 97a7cb4

Please sign in to comment.