abhsarma / milliways

MIT License
0 stars 0 forks source link

Joined CDF areas in Vis #54

Closed hwangkyle closed 1 year ago

hwangkyle commented 1 year ago

When joining options in the grid, sometimes, the CDFs in the Vis element have a protruding top. A simple procedure to visually see this is to join all of the options together. Upon joining all of the options for hurricane data with the outcome variable excess_deaths, this is the resulting density data:

[ [-1.4608,     0,     0.001   ],   [     -1.4119,     0,     0.0018   ],   [     -1.3631,     0,     0.0032   ],   [     -1.3142,     0,     0.0054   ],   [     -1.2654,     0,     0.0089   ],   [     -1.2165,     0,     0.0143   ],   [     -1.1676,     0,     0.0222   ],   [     -1.1188,     0,     0.0337   ],   [     -1.0699,     0,     0.0495   ],   [     -1.0211,     0,     0.0709   ],   [     -0.9722,     0,     0.0987   ],   [     -0.9233,     0,     0.1337   ],   [     -0.8745,     0,     0.1764   ],   [     -0.8256,     0,     0.2269   ],   [     -0.7768,     0,     0.2847   ],   [     -0.7279,     0,     0.3487   ],   [     -0.679,     0,     0.4174   ],   [     -0.6302,     0,     0.4886   ],   [     -0.5813,     0,     0.5   ],   [     -0.5325,     0,     0.5   ],   [     -0.4836,     0,     0.5   ],   [     -0.4347,     0,     0.5   ],   [     -0.3859,     0,     0.5   ],   [     -0.337,     0,     0.5   ],   [     -0.2882,     0,     0.5   ],   [     -0.2393,     0,     0.5   ],   [     -0.1904,     0,     0.5   ],   [     -0.1416,     0,     0.5   ],   [     -0.0927,     0,     0.5   ],   [     -0.0438,     0,     0.5   ],   [     0.005,     0,     0.5   ],   [     0.0539,     0,     0.5   ],   [     0.1027,     0,     0.5   ],   [     0.1516,     0,     0.5   ],   [     0.2005,     0,     0.5   ],   [     0.2493,     0,     0.5   ],   [     0.2982,     0,     0.5   ],   [     0.347,     0,     0.5   ],   [     0.3959,     0,     0.5   ],   [     0.4448,     0,     1   ],   [     0.4936,     0,     1   ],   [     0.5425,     0,     1   ],   [     0.5913,     0,     1   ],   [     0.6402,     0,     1   ],   [     0.6891,     0,     1   ],   [     0.7379,     0,     1   ],   [     0.7868,     0,     1   ],   [     0.8356,     0,     1   ],   [     0.8845,     0,     0.5   ],   [     0.9334,     0,     1   ],   [     0.9822,     0,     1   ],   [     1.0311,     0,     1   ],   [     1.0799,     0,     1   ],   [     1.1288,     0,     1   ],   [     1.1777,     0,     1   ],   [     1.2265,     0,     1   ],   [     1.2754,     0,     1   ],   [     1.3242,     0,     1   ],   [     1.3731,     0,     1   ],   [     1.422,     0,     0.5   ],   [     1.4708,     0,     0.5   ],   [     1.5197,     0,     0.5   ],   [     1.5685,     0,     0.5   ],   [     1.6174,     0,     0.5   ],   [     1.6663,     0,     0.5   ],   [     1.7151,     0,     0.5   ],   [     1.764,     0,     0.5   ],   [     1.8128,     0,     0.5   ],   [     1.8617,     0,     0.5   ],   [     1.9106,     0,     0.5   ],   [     1.9594,     0,     0.5   ],   [     2.0083,     0,     0.5   ],   [     2.0571,     0,     0.5   ],   [     2.106,     0,     0.5   ],   [     2.1549,     0,     0.5   ],   [     2.2037,     0,     0.5   ],   [     2.2526,     0,     0.5   ],   [     2.3014,     0,     0.5   ],   [     2.3503,     0,     0.5   ],   [     2.3992,     0,     0.5   ],   [     2.448,     0,     0.5   ],   [     2.4969,     0,     0.5   ],   [     2.5457,     0,     0.45409999999999995   ],   [     2.5946,     0,     0.38949999999999996   ],   [     2.6435,     0,     0.32789999999999997   ],   [     2.6923,     0,     0.27059999999999995   ],   [     2.7412,     0,     0.2188   ],   [     2.79,     0,     0.17320000000000002   ],   [     2.8389,     0,     0.13419999999999999   ],   [     2.8878,     0,     0.10170000000000001   ],   [     2.9366,     0,     0.07530000000000003   ],   [     2.9855,     0,     0.05449999999999999   ],   [     3.0343,     0,     0.03849999999999998   ],   [     3.0832,     0,     0.026599999999999957   ],   [     3.1321,     0,     0.017900000000000027   ],   [     3.1809,     0,     0.011800000000000033   ],   [     3.2298,     0,     0.007600000000000051   ],   [     3.2786,     0,     0.0047000000000000375   ],   [     3.3275,     0,     0.0029000000000000137   ],   [     3.3764,     0,     0.0017000000000000348   ],   [     3.4252,     0,     0.0010000000000000009   ] ]

If you plug this in directly into areaGeom as defined in Vis.svelte, you get this (the d value of path element):

M40,19.952L42.002,19.92L43.999,19.864L46.001,19.776L47.998,19.636L50,19.42L52.002,19.104L53.999,18.644L56.001,18.012L57.998,17.157L60,16.045L62.002,14.646L63.999,12.939L66.001,10.919L67.998,8.608L70,6.049L72.002,3.303L73.999,0.456L76.001,0L77.998,0L80,0L82.002,0L83.999,0L86.001,0L87.998,0L90,0L92.002,0L93.999,0L96.001,0L98.002,0L100,0L102.002,0L103.999,0L106.001,0L108.002,0L110,0L112.002,0L113.999,0L116.001,0L118.002,-19.992L120,-19.992L122.002,-19.992L123.999,-19.992L126.001,-19.992L128.002,-19.992L130,-19.992L132.002,-19.992L133.999,-19.992L136.001,0L138.002,-19.992L140,-19.992L142.002,-19.992L143.999,-19.992L146.001,-19.992L148.002,-19.992L150,-19.992L152.002,-19.992L153.999,-19.992L156.001,-19.992L158.002,0L160,0L162.002,0L163.999,0L166.001,0L168.002,0L170,0L172.002,0L173.999,0L176.001,0L178.002,0L180,0L182.002,0L183.999,0L186.001,0L188.002,0L190,0L192.002,0L193.999,0L196.001,0L198.002,0L200,0L202.002,0L203.999,1.835L206.001,4.418L208.002,6.881L210,9.172L212.002,11.243L213.999,13.067L216.001,14.626L218.002,15.925L220,16.981L222.002,17.813L223.999,18.452L226.001,18.928L228.002,19.276L230,19.52L232.002,19.688L233.999,19.804L236.001,19.876L238.002,19.924L240,19.952L240,19.992L238.002,19.992L236.001,19.992L233.999,19.992L232.002,19.992L230,19.992L228.002,19.992L226.001,19.992L223.999,19.992L222.002,19.992L220,19.992L218.002,19.992L216.001,19.992L213.999,19.992L212.002,19.992L210,19.992L208.002,19.992L206.001,19.992L203.999,19.992L202.002,19.992L200,19.992L198.002,19.992L196.001,19.992L193.999,19.992L192.002,19.992L190,19.992L188.002,19.992L186.001,19.992L183.999,19.992L182.002,19.992L180,19.992L178.002,19.992L176.001,19.992L173.999,19.992L172.002,19.992L170,19.992L168.002,19.992L166.001,19.992L163.999,19.992L162.002,19.992L160,19.992L158.002,19.992L156.001,19.992L153.999,19.992L152.002,19.992L150,19.992L148.002,19.992L146.001,19.992L143.999,19.992L142.002,19.992L140,19.992L138.002,19.992L136.001,19.992L133.999,19.992L132.002,19.992L130,19.992L128.002,19.992L126.001,19.992L123.999,19.992L122.002,19.992L120,19.992L118.002,19.992L116.001,19.992L113.999,19.992L112.002,19.992L110,19.992L108.002,19.992L106.001,19.992L103.999,19.992L102.002,19.992L100,19.992L98.002,19.992L96.001,19.992L93.999,19.992L92.002,19.992L90,19.992L87.998,19.992L86.001,19.992L83.999,19.992L82.002,19.992L80,19.992L77.998,19.992L76.001,19.992L73.999,19.992L72.002,19.992L70,19.992L67.998,19.992L66.001,19.992L63.999,19.992L62.002,19.992L60,19.992L57.998,19.992L56.001,19.992L53.999,19.992L52.002,19.992L50,19.992L47.998,19.992L46.001,19.992L43.999,19.992L42.002,19.992L40,19.992Z

This can be fixed manually if you change any instance where the third element of a sub-array is 1 to 0.5.