diff --git a/src/components/App.svelte b/src/components/App.svelte index 1972a91..bfa7794 100644 --- a/src/components/App.svelte +++ b/src/components/App.svelte @@ -1,32 +1,43 @@

Median Earnings by College Majors

+
diff --git a/src/components/GenderDist.svelte b/src/components/GenderDist.svelte new file mode 100644 index 0000000..ee3e57e --- /dev/null +++ b/src/components/GenderDist.svelte @@ -0,0 +1,118 @@ + + +
+ + + + + {#each stackedData as genders} + {#each genders as d, i} + { + hovered = i; + recorded_mouse_position = { + x: event.pageX, + y: event.pageY + } + }} + on:mouseout={(event) => {hovered = -1;}} + /> + {/each} + {/each} + + + + +
+ {#if hovered !== -1} + {genderData[hovered].Degree} +
+ number of males: {genderData[hovered].Male} ({(genderData[hovered].Male * 100.0 / + (genderData[hovered].Male + genderData[hovered].Female)).toFixed(1)}%) +
+ number of females: {genderData[hovered].Female} ({(genderData[hovered].Female * 100.0 / + (genderData[hovered].Male + genderData[hovered].Female)).toFixed(1)}%) + {/if} +
+ +
+ +