Skip to content

Instantly share code, notes, and snippets.

@fogonwater
Last active December 7, 2017 04:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fogonwater/a87b88cebb83af88ad963d9fa7efce02 to your computer and use it in GitHub Desktop.
Save fogonwater/a87b88cebb83af88ad963d9fa7efce02 to your computer and use it in GitHub Desktop.
nest tests
license: mit
height: 960
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3-annotation/2.1.0/d3-annotation.min.js"></script>
<style>
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; }
</style>
</head>
<body>
<textarea id="out1" rows="35" cols="90"></textarea>
<textarea id="out2" rows="35" cols="90"></textarea>
<script>
var q = d3.queue()
.defer(d3.csv, 'professions.csv')
.await(visualize);
function visualize(errors, data) {
//data = data.filter(function(d) { return d.Use === '1' })
var nested_data = d3.nest()
.key(function(d) { return d['Median pay']; })
.rollup(function(leaves) { return {
'count':leaves.length,
'label':leaves.map(function(d) {return d['Category'] + ' (' + d['Sector'] +')'}).join(', '),
'leaves':leaves
};})
.entries(data);
//.map(data);
d3.select("#out1").
text(JSON.stringify(nested_data, null, 4));
const annotations = nested_data.map(function(d, i){
return {
note: {
title: d.key,
label: d.value.label,
wrap: 214,
align: 'left'
},
connector: {end: 'dot'},
//x: x(d.a),
//y: y(d.b),
dy: 90,
dx: 100,
color: 'red'
};
})
d3.select("#out2")
.text(JSON.stringify(annotations, null, 4));
}
</script>
</body>
Sector Category Use Median pay Date Day of year Median pay raw Range Ignore
IT Architects 1 135,000 15 Apr 105.4 $135k $75k - $225k 39000
IT Management 1 125,000 23 Apr 113.9 $125k $65k - $225k
IT Data warehousing & BI 115,000 3 May 123.8 $115k $70k - $207k
IT Functional consultants 115,000 3 May 123.8 $115k $55k - $225k
IT Project management 1 115,000 3 May 123.8 $115k $55k - $225k
Construction & roading Project & contracts management 105,000 15 May 135.6 $105k $55k - $165k
IT Sales & pre-sales 105,000 15 May 135.6 $105k $42k - $184k
IT Security 105,000 15 May 135.6 $105k $52k - $184k
Accounting Finance managers & controllers 1 100,000 22 May 142.4 $100k $55k - $155k
Accounting Management 95,000 29 May 149.8 $95k $55k - $155k
Banking, finance & insurance Management 1 95,000 29 May 149.8 $95k $46k - $171k
Construction & roading Quantity surveying 95,000 29 May 149.8 $95k $55k - $135k
Construction & roading Site management 95,000 29 May 149.8 $95k $50k - $145k
Construction & roading Surveying 1 95,000 29 May 149.8 $95k $46k - $155k
Executive & general management Executive & general management 95,000 29 May 149.8 $95k $42k - $225k
IT Business & systems analysts 95,000 29 May 149.8 $95k $62k - $207k
IT Database 95,000 29 May 149.8 $95k $45k - $180k
IT Programming & development 95,000 29 May 149.8 $95k $55k - $192k
IT Testing 95,000 29 May 149.8 $95k $53k - $186k
Legal In-house counsel 1 95,000 29 May 149.8 $95k $40k - $165k
IT Networking & storage 90,000 7 Jun 158.2 $90k $45k - $195k
Accounting Analysts 1 85,000 16 Jun 167.5 $85k $55k - $132k
Architecture Architects 1 85,000 16 Jun 167.5 $85k $45k - $125k
Construction & roading Estimation 85,000 16 Jun 167.5 $85k $45k - $135k
Healthcare Management 85,000 16 Jun 167.5 $85k $55k - $136k
IT Systems engineers 85,000 16 Jun 167.5 $85k $55k - $173k
IT Web design 1 85,000 16 Jun 167.5 $85k $42k - $170k
Marketing, media & communications Management 85,000 16 Jun 167.5 $85k $50k - $135k
Property Facilities & commercial property management 85,000 16 Jun 167.5 $85k $47k - $143k
Sales Sales managers 85,000 16 Jun 167.5 $85k $45k - $185k
Retail Buying 1 80,000 26 Jun 177.9 $80k $42k - $115k
Accounting Accountants 1 75,000 8 Jul 189.8 $75k $40k - $120k
Banking, finance & insurance Analysts 1 75,000 8 Jul 189.8 $75k $45k - $105k
Construction & roading Health & safety 75,000 8 Jul 189.8 $75k $43k - $115k
Construction & roading Supervisors & forepersons 75,000 8 Jul 189.8 $75k $50k - $115k
Legal Private practice 75,000 8 Jul 189.8 $75k $40k - $125k
Manufacturing & operations Management 75,000 8 Jul 189.8 $75k $45k - $130k
Marketing, media & communications Brand & product management 75,000 8 Jul 189.8 $75k $40k - $115k
Marketing, media & communications Market research & analysis 75,000 8 Jul 189.8 $75k $45k - $125k
Property Consultancy & valuation 75,000 8 Jul 189.8 $75k $37k - $107k
Sales Business development manager 75,000 8 Jul 189.8 $75k $45k - $125k
Marketing, media & communications Communications & PR 1 72,000 16 Jul 197.7 $72k $45k - $125k
Retail Area managers 1 70,000 22 Jul 203.4 $70k $45k - $85k
Architecture Drafting 65,000 7 Aug 219.0 $65k $45k - $100k
Banking, finance & insurance Tellers & branch staff 65,000 7 Aug 219.0 $65k $40k - $105k
Government & council Central government 1 65,000 7 Aug 219.0 $65k $45k - $135k
Government & council Local & regional council 65,000 7 Aug 219.0 $65k $40k - $105k
Healthcare Nursing & midwifery 65,000 7 Aug 219.0 $65k $40k - $95k
Healthcare Occupational therapy 65,000 7 Aug 219.0 $65k $36k - $85k
Healthcare Physiotherapy 65,000 7 Aug 219.0 $65k $45k - $85k
HR & recruitment HR 65,000 7 Aug 219.0 $65k $42k - $115k
HR & recruitment Recruitment 65,000 7 Aug 219.0 $65k $40k - $120k
Marketing, media & communications Digital marketing 65,000 7 Aug 219.0 $65k $40k - $105k
Property Residential sales & management 65,000 7 Aug 219.0 $65k $40k - $115k
Sales Account management 65,000 7 Aug 219.0 $65k $40k - $105k
Transport & logistics Management 65,000 7 Aug 219.0 $65k $42k - $107k
Transport & logistics Supply chain & planning 65,000 7 Aug 219.0 $65k $40k - $121k
Architecture Interior design 1 62,000 17 Aug 229.6 $62k $37k - $105k
Trades & services Air con. & refrigeration 60,000 25 Aug 237.3 $60k $35k - $85k
Trades & services Electrical 60,000 25 Aug 237.3 $60k $40k - $85k
Trades & services Plumbing 1 60,000 25 Aug 237.3 $60k $37k - $75k
Accounting Accounts receivable 55,000 15 Sep 258.8 $55k $42k - $65k
Accounting Payroll 55,000 15 Sep 258.8 $55k $45k - $80k
Banking, finance & insurance Credit & lending 55,000 15 Sep 258.8 $55k $39k - $105k
Banking, finance & insurance Insurance 55,000 15 Sep 258.8 $55k $41k - $105k
Construction & roading Machine operators 55,000 15 Sep 258.8 $55k $40k - $70k
Customer service Management 55,000 15 Sep 258.8 $55k $35k - $95k
Education Tertiary 55,000 15 Sep 258.8 $55k $32k - $85k
Healthcare Psychology & counselling 55,000 15 Sep 258.8 $55k $40k - $85k
IT Service desk 55,000 15 Sep 258.8 $55k $37k - $95k
IT Telecommunications 55,000 15 Sep 258.8 $55k $37k - $115k
Manufacturing & operations Fitters & machining 55,000 15 Sep 258.8 $55k $32k - $85k
Manufacturing & operations Purchasing & inventory 55,000 15 Sep 258.8 $55k $36k - $109k
Manufacturing & operations Quality assurance 55,000 15 Sep 258.8 $55k $30k - $95k
Manufacturing & operations Supervisors & forepersons 55,000 15 Sep 258.8 $55k $35k - $75k
Marketing, media & communications Design 55,000 15 Sep 258.8 $55k $37k - $105k
Marketing, media & communications Journalism 55,000 15 Sep 258.8 $55k $40k - $87k
Sales Sales reps 55,000 15 Sep 258.8 $55k $35k - $100k
Science & technology Science & technology 55,000 15 Sep 258.8 $55k $35k - $115k
Trades & services Boat building 1 55,000 15 Sep 258.8 $55k $36k - $70k
Trades & services Building & carpentry 55,000 15 Sep 258.8 $55k $37k - $80k
Trades & services Roofing 55,000 15 Sep 258.8 $55k $32k - $75k
Trades & services Technicians 55,000 15 Sep 258.8 $55k $36k - $75k
Trades & services Boilermakers & welders 1 53,000 25 Sep 268.6 $53k $37k - $70k
Accounting Accounts administrators 50,000 11 Oct 284.7 $50k $37k - $65k
Accounting Accounts payable 50,000 11 Oct 284.7 $50k $40k - $65k
Agriculture, fishing & forestry Fishing 50,000 11 Oct 284.7 $50k $30k - $100k
Banking, finance & insurance Client services 50,000 11 Oct 284.7 $50k $37k - $85k
Education Secondary 1 50,000 11 Oct 284.7 $50k $25k - $85k
Trades & services Flooring 50,000 11 Oct 284.7 $50k $37k - $65k
Trades & services Glaziers 50,000 11 Oct 284.7 $50k $35k - $65k
Trades & services Painting 50,000 11 Oct 284.7 $50k $37k - $70k
Trades & services Sign writers 50,000 11 Oct 284.7 $50k $32k - $70k
Transport & logistics Freight forwarders 50,000 11 Oct 284.7 $50k $32k - $74k
Transport & logistics Import & export 50,000 11 Oct 284.7 $50k $35k - $74k
Transport & logistics Operations 50,000 11 Oct 284.7 $50k $35k - $85k
Trades & services Printing 1 48,000 23 Oct 296.6 $48k $35k - $92k
Agriculture, fishing & forestry Forestry 47,000 29 Oct 302.9 $47k $32k - $65k
Automotive Other 47,000 29 Oct 302.9 $47k $32k - $75k
Education Early childhood 47,000 29 Oct 302.9 $47k $25k - $65k
Education Primary 1 47,000 29 Oct 302.9 $47k $22k - $65k
Education Tutoring & training 47,000 29 Oct 302.9 $47k $40k - $109k
Healthcare Administration 47,000 29 Oct 302.9 $47k $32k - $75k
Healthcare Community & social services 47,000 29 Oct 302.9 $47k $35k - $75k
Healthcare Dentistry 47,000 29 Oct 302.9 $47k $35k - $80k
Healthcare Pharmacy 47,000 29 Oct 302.9 $47k $37k - $85k
Healthcare Veterinary 47,000 29 Oct 302.9 $47k $35k - $101k
Legal Secretarial 47,000 29 Oct 302.9 $47k $32k - $65k
Marketing, media & communications Marketing assistants & coordinators 47,000 29 Oct 302.9 $47k $37k - $65k
Office & administration EA, PA & secretarial 47,000 29 Oct 302.9 $47k $36k - $67k
Office & administration Office management 47,000 29 Oct 302.9 $47k $35k - $75k
Transport & logistics Drivers & couriers 47,000 29 Oct 302.9 $47k $35k - $70k
Agriculture, fishing & forestry Farming 45,000 12 Nov 316.3 $45k $30k - $80k
Construction & roading Labouring 1 45,000 12 Nov 316.3 $45k $35k - $65k
Healthcare Fitness & wellbeing 45,000 12 Nov 316.3 $45k $35k - $85k
Hospitality & tourism Travel consultants 45,000 12 Nov 316.3 $45k $35k - $55k
Retail Department managers 45,000 12 Nov 316.3 $45k $35k - $55k
Retail Management 45,000 12 Nov 316.3 $45k $32k - $105k
Retail Store managers 45,000 12 Nov 316.3 $45k $30k - $60k
Sales Sales support 45,000 12 Nov 316.3 $45k $32k - $65k
Trades & services Gardening & landscaping 1 45,000 12 Nov 316.3 $45k $35k - $65k
Trades & services Hairdressing 45,000 12 Nov 316.3 $45k $30k - $65k
Hospitality & tourism Management 42,000 4 Dec 338.9 $42k $30k - $75k
Trades & services Handy-persons 1 42,000 4 Dec 338.9 $42k $32k - $65k
Agriculture, fishing & forestry Horticulture 40,000 21 Dec 355.9 $40k $25k - $75k
Construction & roading Traffic management 40,000 21 Dec 355.9 $40k $32k - $70k
Customer service Call centre 40,000 21 Dec 355.9 $40k $32k - $55k
Customer service Customer-facing 40,000 21 Dec 355.9 $40k $30k - $55k
Office & administration Administration 40,000 21 Dec 355.9 $40k $30k - $55k
Sales Telesales 40,000 21 Dec 355.9 $40k $30k - $85k
Trades & services Beautician 40,000 21 Dec 355.9 $40k $32k - $60k
Trades & services Butchers & bakers 1 40,000 21 Dec 355.9 $40k $32k - $55k
Trades & services Security 40,000 21 Dec 355.9 $40k $32k - $70k
Hospitality & tourism Chefs 1 39,000 31 Dec 365.0 $39k $27k - $55k
Healthcare Caregiving 37,000 19 Jan 384.7 $37k $32k - $55k
Office & administration Data entry 37,000 19 Jan 384.7 $37k $28k - $47k
Retail Merchandising 37,000 19 Jan 384.7 $37k $28k - $115k
Trades & services Cleaning 37,000 19 Jan 384.7 $37k $30k - $60k
Trades & services Labourers 37,000 19 Jan 384.7 $37k $25k - $55k
Transport & logistics Warehouse & distribution 1 37,000 19 Jan 384.7 $37k $32k - $65k
Manufacturing & operations Machine operation 36,000 30 Jan 395.4 $36k $27k - $55k
Manufacturing & operations Storepersons & warehousing 36,000 30 Jan 395.4 $36k $27k - $67k
Office & administration Reception 1 36,000 30 Jan 395.4 $36k $27k - $47k
Hospitality & tourism Reception & front desk 35,000 10 Feb 406.7 $35k $25k - $45k
Hospitality & tourism Tourism & tour guides 35,000 10 Feb 406.7 $35k $25k - $60k
Hospitality & tourism Waiting staff 1 35,000 10 Feb 406.7 $35k $25k - $45k
Manufacturing & operations Process & assembly 35,000 10 Feb 406.7 $35k $25k - $57k
Retail Assistant store managers 35,000 10 Feb 406.7 $35k $30k - $47k
Hospitality & tourism Housekeeping 1 33,000 7 Mar 431.4 $33k $25k - $47k
Education Au pairs & nannies 32,000 20 Mar 444.8 $32k $25k - $45k
Hospitality & tourism Bar staff & baristas 32,000 20 Mar 444.8 $32k $25k - $45k
Hospitality & tourism Kitchen staff 32,000 20 Mar 444.8 $32k $25k - $42k
Retail Retail assistants 1 32,000 20 Mar 444.8 $32k $25k - $45k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment