Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure data tables work with new data structure #309

Open
milafrerichs opened this issue Apr 12, 2021 · 0 comments
Open

Make sure data tables work with new data structure #309

milafrerichs opened this issue Apr 12, 2021 · 0 comments

Comments

@milafrerichs
Copy link
Contributor

milafrerichs commented Apr 12, 2021

old structure:

was in indicator.subindicators

"{"Afrikaans":{"count":5552965,"children":{"MP":224006,"WC":2367353,"FS":264216,"NC":497171,"NW":250076,"LIM":93817,"KZN":116836,"GT":1172377,"EC":567117}},
"English":{"count":4184295,"children":{"MP":119090,"WC":928904,"FS":78993,"NC":35394,"NW":122021,"LIM":83073,"KZN":1145096,"GT":1369819,"EC":301904}},
"isiXhosa":{"count":7789250,"children":{"MP":53441,"WC":1606007,"FS":191987,"NC":53275,"NW":195259,"LIM":24422,"KZN":390653,"GT":857150,"EC":4417048}},
"isiZulu":{"count":11382674,"children":{"MP":901191,"WC":31101,"FS":113461,"NC":8518,"NW":83006,"LIM":62283,"KZN":7638535,"GT":2513051,"EC":31498}},
"Sepedi":{"count":4552952,"children":{"MP":372305,"WC":9550,"FS":8113,"NC":2429,"NW":81349,"LIM":2625199,"KZN":20096,"GT":1420846,"EC":13067}},
"Sesotho":{"count":3707940,"children":{"MP":132829,"WC":78717,"FS":1621568,"NC":14092,"NW":190120,"LIM":73747,"KZN":85495,"GT":1368524,"EC":142853}},
"Setswana":{"count":3708136,"children":{"MP":64272,"WC":25543,"FS":128982,"NC":344977,"NW":1910894,"LIM":100751,"KZN":49744,"GT":1071225,"EC":11748}},
"Siswati":{"count":1362088,"children":{"MP":1151852,"WC":3909,"FS":2386,"NC":705,"NW":12401,"LIM":25240,"KZN":11099,"GT":152591,"EC":1846}},
"Tshivenda":{"count":1239261,"children":{"MP":13651,"WC":5580,"FS":3344,"NC":1225,"NW":18187,"LIM":850376,"KZN":4908,"GT":337620,"EC":4325}},
"Xitsonga":{"count":2416713,"children":{"MP":422024,"WC":12706,"FS":9064,"NC":1548,"NW":132236,"LIM":888020,"KZN":11909,"GT":934761,"EC":4430}},
"Other":{"count":1087011,"children":{"MP":52415,"WC":163537,"FS":20752,"NC":13227,"NW":82548,"LIM":128549,"KZN":92676,"GT":483120,"EC":50166}},
"isIndebele":{"count":1103005,"children":{"MP":371412,"WC":17349,"FS":9694,"NC":5858,"NW":43417,"LIM":97388,"KZN":107996,"GT":435589,"EC":14299}},
"Sign Language":{"count":228215,"children":{"MP":8836,"WC":23075,"FS":31670,"NC":3495,"NW":14157,"LIM":7853,"KZN":48543,"GT":53882,"EC":36672}}}"

new structure

now in indicator.data

{"age":"15-19","race":"Black african","count":"3599.3753699998","gender":"Female","language":"Afrikaans"},
 {"age":"15-19","race":"Black african","count":"8665.81757999899","gender":"Female","language":"English"},
 {"age":"15-19","race":"Black african","count":"689.044740000004","gender":"Female","language":"Isindebele"},
{"age":"15-19","race":"Black african","count":"288126.247378975","gender":"Female","language":"Isixhosa"},
 {"age":"15-19","race":"Black african","count":"1580.03236000003","gender":"Female","language":"Isizulu"},
{"age":"15-19","race":"Black african","count":"481.094529999998","gender":"Female","language":"Other"},
 {"age":"15-19","race":"Black african","count":"852.672980000009","gender":"Female","language":"Sepedi"},
 {"age":"15-19","race":"Black african","count":"9004.21762999894","gender":"Female","language":"Sesotho"},
 {"age":"15-19","race":"Black african","count":"497.376719999998","gender":"Female","language":"Setswana"},
{"age":"15-19","race":"Black african","count":"2371.97078","gender":"Female","language":"Sign language"},
 {"age":"15-19","race":"Black african","count":"74.68626","gender":"Female","language":"Siswati"},
{"age":"15-19","race":"Black african","count":"136.13609","gender":"Female","language":"Tshivenda"},
{"age":"15-19","race":"Black african","count":"74.79752","gender":"Female","language":"Xitsonga"},
{ "age": "15-24 (Intl)", "race": "Indian or asian", "count": "344.09527", "gender": "Male", "language": "Sepedi" },
{ "age": "15-24 (Intl)", "race": "Indian or asian", "count": "481.354600000001", "gender": "Male", "language": "Sesotho" },
 { "age": "15-24 (Intl)", "race": "Indian or asian", "count": "509.12947", "gender": "Male", "language": "Setswana" },
{ "age": "15-24 (Intl)", "race": "Indian or asian", "count": "350.68013", "gender": "Male", "language": "Sign language" }

take a look at #290 and #197 for reference

you can and should use the data from the Vega PR and you can get the data via this.vegaView.data("data_filtered")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant