-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcell40.js
125 lines (104 loc) · 29.3 KB
/
cell40.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
var w = 900;
var h = 600;
//to prevent graph clipping
var padding = 40;
//oscillator to make sounds
var osc;
//cell 40 voltage data
var dataset = [
[1, -70.37771018997273], [2, -70.55195283668208], [3, -70.48753646836445], [4, -70.42815221254875], [5, -70.3815251230974], [6, -70.34494353498839], [7, -70.31601439223807], [8, -70.29296143804784], [9, -70.2744668561427], [10, -70.2595422087026], [11, -70.24743751590324], [12, -70.2375774130791], [13, -70.2295159332658], [14, -70.22290413893785], [15, -70.2174666861099], [16, -70.21298465597361], [17, -70.20928282961096], [18, -70.20622014680596], [19, -70.20368247242068], [20, -70.20157705417252], [21, -70.19982823426993], [22, -70.19837410092869], [23, -70.1971638520291], [24, -70.19615570392511], [25, -70.19531522162632], [26, -70.19461397761452], [27, -70.19402846908433], [28, -70.19353923991673], [29, -70.19313016593472], [30, -70.1927878711538], [31, -70.1925012496712], [32, -70.19226107313179], [33, -70.19205966778948], [34, -70.19189064835885], [35, -70.19174869834089], [36, -70.19162938847478], [37, -70.19152902653262], [38, -70.19144453292694], [39, -70.19137333760874], [40, -70.19131329454947], [41, -70.19126261076069], [42, -70.19121978734576], [43, -70.19118357051697], [44, -70.19115291087259], [45, -70.19112692952554], [46, -70.19110488991683], [47, -70.19108617435046], [48, -70.19107026444925], [49, -70.19105672486997], [50, -70.19104518972773], [51, -70.1910353512744], [52, -70.19102695045174], [53, -70.19101976900592], [54, -70.19101362290118], [55, -70.19100835681685], [56, -70.19100383954618], [57, -70.19099996014766], [58, -70.1909966247237], [59, -70.19099375372286], [60, -70.19099127967905], [61, -70.1909891453158], [62, -70.19098730195557], [63, -70.19098570818376], [64, -70.19098432872643], [65, -70.19098313350622], [66, -70.1909820968479], [67, -70.19098119680906], [68, -73.89841744764792], [69, -74.05361892544671], [70, -73.89343253111457], [71, -73.6534716326999], [72, -73.3679636233729], [73, -74.30510262338564], [74, -74.5266784413637], [75, -74.4506359027548], [76, -74.31285402286494], [77, -74.13305125738691], [78, -73.91451321724674], [79, -73.65853784362872], [80, -73.36832133257684], [81, -73.05022169623756], [82, -72.71379307299746], [83, -72.3711593297152], [84, -72.03551411319106], [85, -71.71882534504194], [86, -71.43076056898651], [87, -71.17777138037586], [88, -70.96248317746576], [89, -70.78403010902073], [90, -70.63985334049947], [91, -70.52593587793329], [92, -70.43758401731455], [93, -70.37014530139379], [94, -70.31937923004288], [95, -70.28163278051372], [96, -70.25388399983278], [97, -70.23370696358145], [98, -70.21919800110345], [99, -70.20888922240933], [100, -70.20166426081948], [101, -70.19668348482651], [102, -70.19332123019176], [103, -70.19111502065724], [104, -70.18972551841296], [105, -70.18890550792297], [106, -70.18847619714785], [107, -70.18830929440107], [108, -70.18831356172872], [109, -70.18842479247732], [110, -70.18859838248419], [111, -70.18880385102177], [112, -70.18902081871194], [113, -70.18923606879184], [114, -70.18944141046948], [115, -70.1896321338005], [116, -70.18980589914572], [117, -70.1899619446809], [118, -48.551665185560125], [119, 32.95746499025313], [120, -23.477491414974143], [121, -71.9055398524467], [122, -71.75761582289985], [123, -71.41978990356226], [124, -71.10960631721598], [125, -73.00383375485394], [126, -73.26884810508179], [127, -73.16515221345922], [128, -72.97720998157665], [129, -72.7531696112084], [130, -72.50745554476302], [131, -72.24832082527806], [132, -71.98387226767508], [133, -71.7227335848188], [134, -71.47367810096961], [135, -71.24428817370284], [136, -71.03999251209073], [137, -70.86355433916025], [138, -70.71538667250178], [139, -70.59422758880963], [140, -70.49733608706286], [141, -70.42130463415741], [142, -70.36258518732414], [143, -70.31783489100734], [144, -70.28410602353632], [145, -70.25891840981126], [146, -70.24025586655986], [147, -70.2265211126559], [148, -70.21647327588863], [149, -70.20916277517223], [150, -70.20387141705446], [151, -70.2000610342277], [152, -70.19733137364439], [153, -70.19538659964888], [154, -70.19400921452427], [155, -70.1930400682164], [156, -70.19236321278517], [157, -70.19189452899123], [158, -70.19157324478967], [159, -73.51246910127144], [160, -74.06803531182858], [161, -73.93841508832357], [162, -73.71192523375531], [163, -73.4351785627749], [164, -73.12459732798513], [165, -72.7922469474778], [166, -72.45064391013783], [167, -72.11316274681216], [168, -71.7922166645554], [169, -71.4978831727365], [170, -62.37525658862257], [171, -35.944257673949124], [172, 23.163054169283253], [173, -20.20125161231657], [174, -65.58190263774257], [175, -69.88734432419899], [176, -69.13728548872446], [177, -68.66863640150201], [178, -68.45656553472443], [179, -68.44102831171121], [180, -68.55445830488772], [181, -72.84579772286816], [182, -73.59701563625967], [183, -73.50803561752704], [184, -73.30245570385783], [185, -73.04876576843316], [186, -72.7672003374457], [187, -72.4695922155198], [188, -72.16700348092245], [189, -71.87051729148381], [190, -71.59022695325054], [191, -73.78013387668078], [192, -74.06782631973286], [193, -73.93119924052336], [194, -73.70754949582219], [195, -73.43593046728525], [196, -73.13078172662574], [197, -72.803255097809], [198, -72.46533798119589], [199, -72.13013933219898], [200, -71.81007852128823], [201, -71.51539110891767], [202, -71.25361188728152], [203, -71.02846187828172], [204, -70.8401394720322], [205, -70.68649453642621], [206, -70.56405013179585], [207, -70.46832147977717], [208, -70.39468766528377], [209, -70.33883421225582], [210, -70.29697951618581], [211, -70.26595385976069], [212, -70.24318610673713], [213, -70.22664137290747], [214, -70.21473918750915], [215, -70.2062698404635], [216, -73.81895391970883], [217, -74.0594244377831], [218, -67.81863132190102], [219, -64.85029094174067], [220, -63.97165313408892], [221, -63.90242535601525], [222, -64.20895727182929], [223, -64.70595341409627], [224, -65.29971755914708], [225, -65.92696479805693], [226, -66.5467401861665], [227, -67.12983768839136], [228, -67.65744658441653], [229, -68.12199527995013], [230, -68.5199481007622], [231, -68.85488423614348], [232, -69.13215077660689], [233, -69.357810068263], [234, -73.16345509352286], [235, -73.92932992024942], [236, -73.82040865044672], [237, -73.60372797120222], [238, -73.33590374792438], [239, -74.2259902573794], [240, -74.16549619229454], [241, -73.99202923957252], [242, -73.7638534892223], [243, -73.49505627576787], [244, -73.19365639812108], [245, -72.86856483290961], [246, -72.53080465594606], [247, -72.19325393141095], [248, -71.86862376094619], [249, -71.56761044228573], [250, -71.29847990253869], [251, -71.06569854926562], [252, -70.87013148455478], [253, -70.70990019585645], [254, -70.58180088308454], [255, -70.48142232373236], [256, -70.4040940774099], [257, -70.3453893040479], [258, -70.30138898581461], [259, -70.26878550244022], [260, -70.24488295478362], [261, -70.22754067240635], [262, -70.21509238296176], [263, -70.20626098636325], [264, -70.20007959691065], [265, -70.19582347802495], [266, -70.19295397144887], [267, -70.1910737004798], [268, -70.18989154433339], [269, -70.18919567880428], [270, -70.18883306773935], [271, -70.18869400205985], [272, -65.21739728070878], [273, -31.474414347203155], [274, 21.056497948729362], [275, -22.651759752185693], [276, -66.9552711839677], [277, -69.52118326911936], [278, -68.77643232833086], [279, -68.33671511264161], [280, -68.16652424613383], [281, -68.19669098380484], [282, -68.35384691086277], [283, -68.57670621257307], [284, -68.82128822520458], [285, -69.05970101729821], [286, -69.27610189961358], [287, -69.46405728400661], [288, -69.62222476847495], [289, -69.75214779924426], [290, -69.85687016546734], [291, -69.93998658235792], [292, -71.24543750952948], [293, -74.29944516021357], [294, -74.43655808502008], [295, -74.34029330342005], [296, -74.18176081123349], [297, -73.98000039123691], [298, -73.73941798434389], [299, -73.4631744673665], [300, -73.83121650466921], [301, -74.23585760966542], [302, -74.12749430845867], [303, -73.93166327066183], [304, -73.68582650152197], [305, -73.4016259909164], [306, -73.08755994604782], [307, -72.75358476451929], [308, -72.4117447055216], [309, -72.07525415381232], [310, -71.75632299896046], [311, -71.46487025194811], [312, -71.20780563200864], [313, -70.98818873598658], [314, -70.805544764926], [315, -70.65745618987343], [316, -70.5400924727519], [317, -70.44881465585378], [318, -70.37896047113279], [319, -70.32624300785106], [320, -70.2869459482702], [321, -70.2579803525511], [322, -70.23685730861317], [323, -70.22161786871095], [324, -70.21074774956897], [325, -70.20309281473797], [326, -70.19778333463556], [327, -70.19417002464147], [328, -70.19177207512442], [329, -70.19023603151112], [330, -60.52852319631642], [331, 0.5546810923605552], [332, 13.411779009091596], [333, -29.67010145750264], [334, -69.497112362635], [335, -69.37701955483816], [336, -68.68409334596379], [337, -68.29417451984685], [338, -68.16320630041238], [339, -68.2196574397831], [340, -68.39148216833449], [341, -68.62025766165603], [342, -68.86497126849625], [343, -69.10010475957078], [344, -73.47585771351551], [345, -73.82856321320732], [346, -73.69903198882002], [347, -73.4758149950998], [348, -73.20663213008162], [349, -72.90823341674881], [350, -72.59232349239132], [351, -72.27088628534366], [352, -71.95608470583855], [353, -73.99290444850483], [354, -74.08425425265541], [355, -73.92554510391255], [356, -73.6929740236358], [357, -73.41568695327993], [358, -73.1062963528631], [359, -72.77571203885714], [360, -72.43606043033995], [361, -72.10052393486137], [362, -71.78140325213977], [363, -71.48874673021255], [364, -71.22974067252264], [365, -71.00774226791447], [366, -70.82259136227248], [367, -70.67199129367678], [368, -70.55228655600773], [369, -70.45891991260399], [370, -70.38725933966946], [371, -70.33301527122707], [372, -70.29244954164254], [373, -70.26244224723182], [374, -70.24047101058056], [375, -70.22454477724811], [376, -70.21312045007747], [377, -70.20501908853359], [378, -70.19935018764438], [379, -70.1954473801888], [380, -70.19281598520674], [381, -70.1910913786628], [382, -70.19000659230487], [383, -70.1893674534974], [384, -70.18903371553307], [385, -70.18890485413594], [386, -70.18890944765913], [387, -68.74362437408656], [388, -42.266831352791094], [389, 27.109761847135253], [390, -16.49378972868892], [391, -61.486455379767506], [392, -69.65341840465766], [393, -68.86567769174057], [394, -68.38174910778453], [395, -68.17569105432874], [396, -68.18110914429073], [397, -73.18947742598598], [398, -73.35191552155025], [399, -73.2073819007412], [400, -72.98543238770108], [401, -72.7289960290216], [402, -72.45368818222498], [403, -72.17012871503353], [404, -72.98096182844682], [405, -74.04345769372412], [406, -73.96172602743205], [407, -73.7651951986189], [408, -73.51463540999917], [409, -73.22710575475755], [410, -72.91321305323179], [411, -72.58382099276415], [412, -72.2513714327724], [413, -71.92850307621188], [414, -71.62621355714627], [415, -71.35334135626584], [416, -71.11519033652857], [417, -70.91350753963737], [418, -70.74695568134595], [419, -70.6128075773666], [420, -70.50696715210303], [421, -70.42489645674085], [422, -70.36219014076872], [423, -70.31488348901487], [424, -70.27958914013307], [425, -70.25351981892426], [426, -70.23444524284625], [427, -70.22061819590384], [428, -70.21069203091997], [429, -70.20364202064742], [430, -70.19869636371514], [431, -70.195278671444], [432, -70.19296162190038], [433, -70.19143048378528], [434, -70.19045489220134], [435, -53.924308052886005], [436, 36.49848485541274], [437, 0.9142350296883148], [438, -41.32234725581964], [439, -69.98010337360334], [440, -69.14645662196483], [441, -68.54000264535911], [442, -68.22926796429198], [443, -68.1589560843336], [444, -68.25513638486348], [445, -68.44862995014883], [446, -68.68580660313945], [447, -68.93032042665136], [448, -69.1602286814502], [449, -69.36427668781889], [450, -71.17871844850363], [451, -73.89917323008333], [452, -73.84700812365402], [453, -73.6491617644331], [454, -73.3928117043341], [455, -73.10054645448842], [456, -72.7849682615831], [457, -72.45791197420115], [458, -72.13194930952702], [459, -71.81913023317594], [460, -72.98880264656636], [461, -74.10182809865447], [462, -74.0057512915243], [463, -73.7981130722956], [464, -73.53628394984753], [465, -73.23736584101188], [466, -72.9126942333414], [467, -72.57391847137725], [468, -72.23412724253608], [469, -71.90627619873464], [470, -71.60131711188663], [471, -71.32781893035555], [472, -71.09059536634838], [473, -73.54626286616609], [474, -74.08616556604842], [475, -73.95999468776388], [476, -73.73726163753376], [477, -73.463941717973], [478, -73.15596708680957], [479, -72.82504240108973], [480, -72.48342802358893], [481, -72.14448960475939], [482, -71.82087002719318], [483, -71.52294158095394], [484, -71.25837430268771], [485, -71.03095072160865], [486, -70.84086796904884], [487, -70.68592482554931], [488, -70.56259063534125], [489, -70.46630467506161], [490, -70.39236955776451], [491, -70.33640234242627], [492, -70.29456442126305], [493, -70.26364116333168], [494, -70.24102760846739], [495, -70.22466439750592], [496, -70.21295402311526], [497, -70.20467540757619], [498, -70.19890612651682], [499, -70.19495606935736], [500, -70.19231317207198], [501, -70.19060027220776], [502, -70.18954149290187], [503, -70.18893643570205], [504, -70.18864058732663], [505, -70.18855057167033], [506, -70.18859312514407], [507, -70.18871690259863], [508, -70.18888641763691], [509, -70.18907758209508], [510, -72.9487916982425], [511, -74.07015385868938], [512, -73.96177165962226], [513, -73.74352288885007], [514, -73.4719261254912], [515, -73.1648683061506], [516, -72.83455158006768], [517, -72.4933382083139], [518, -72.15459408667213], [519, -71.8309618628587], [520, -71.53280260550954], [521, -71.26780396760358], [522, -71.03978728941132], [523, -70.84901683183875], [524, -70.69330505422114], [525, -70.56917557519249], [526, -70.47210647505894], [527, -70.39742733270242], [528, -70.34077274842981], [529, -70.29831364350582], [530, -70.26683870646457], [531, -70.24374189848129], [532, -54.575880307531996], [533, 36.52392509732784], [534, 2.567776338948945], [535, -39.638920188102645], [536, -72.28655564748873], [537, -72.45342845549487], [538, -72.235490747604], [539, -71.96058532343271], [540, -71.68980683871516], [541, -71.43919222944903], [542, -71.2133709652496], [543, -71.01404330581808], [544, -70.84180987322357], [545, -70.69654034916398], [546, -70.57716275840566], [547, -70.48157026642309], [548, -70.40691077731384], [549, -70.34993247458907], [550, -70.30733548626732], [551, -70.27604907318246], [552, -70.25340131029522], [553, -70.23718762913441], [554, -70.22566486852453], [555, -70.2175013063179], [556, -70.21170771009794], [557, -70.20756611695343], [558, -70.20456552272309], [559, -70.20234827480488], [560, -70.2006677109802], [561, -72.78274119890544], [562, -74.0659081623447], [563, -73.96287922230358], [564, -73.74677107299821], [565, -73.4766697858012], [566, -73.17082430688707], [567, -72.84145537073782], [568, -72.50087105477242], [569, -72.16239748154247], [570, -71.83869216727533], [571, -71.54015731368038], [572, -71.27455581457883], [573, -71.04580010193227], [574, -70.85425050284591], [575, -70.69776201551986], [576, -70.57290816516942], [577, -70.47519362749384], [578, -70.39995760209524], [579, -70.34283381224121], [580, -74.02712545729736], [581, -74.02690673734706], [582, -73.84079443012014], [583, -73.5879882816171], [584, -73.29389885373263], [585, -72.97165213562421], [586, -72.63320998616065], [587, -72.29167526606048], [588, -71.96024093377366], [589, -71.65026697118704], [590, -71.37077045464721], [591, -71.12717430576203], [592, -70.92120125689033], [593, -70.75136791366508], [594, -70.6148043469622], [595, -70.50726254060068], [596, -70.42404834179155], [597, -70.36061927116165], [598, -70.31289741457307], [599, -70.27740590926312], [600, -70.25128904061657], [601, -70.23226560081297], [602, -70.21855136860705], [603, -70.20877340047163], [604, -74.02423877238598], [605, -74.02494115728918], [606, -73.83860684140569], [607, -73.58545184007886], [608, -68.13848280491312], [609, -60.31071028096625], [610, -57.71200601348881], [611, -57.17365002840524], [612, -58.51933493871905], [613, -60.87745949950892], [614, -62.798607197696356], [615, -64.20791812895291], [616, -65.33326772564405], [617, -66.2631398531828], [618, -67.03425418837328], [619, -67.67078943701807], [620, -68.1928220935498], [621, -68.6165728661595], [622, -68.9586154550362], [623, -69.23214184407952], [624, -69.44904581984383], [625, -69.62026027772829], [626, -69.75455970872432], [627, -71.69547050110455], [628, -73.99602613375932], [629, -73.92412938437981], [630, -73.71916210460907], [631, -73.45686912712144], [632, -73.15800036633593], [633, -74.2033204858106], [634, -74.16173288768506], [635, -73.98873236817253], [636, -73.75753910162202], [637, -73.48482105332887], [638, -73.17957384599669], [639, -72.85125914975917], [640, -72.51126874483143], [641, -72.1726669782814], [642, -71.84814065325253], [643, -71.54823968508111], [644, -71.2809608441503], [645, -71.05045118325184], [646, -70.85726296873136], [647, -70.69935349573876], [648, -70.57336211704266], [649, -70.474800912342], [650, -70.39898159584122], [651, -70.34149380501987], [652, -70.29845305960825], [653, -70.26659290845764], [654, -70.24325820584694], [655, -70.22634492171966], [656, -70.21421783985029], [657, -70.20562516890249], [658, -70.19962008913674], [659, -70.1954934607402], [660, -70.19271857198522], [661, -47.81515699209498], [662, 32.3295051027938], [663, -10.004814727100502], [664, -53.607458577457855], [665, -69.80663171406924], [666, -68.97869926876142], [667, -68.44662022702771], [668, -68.19991765675572], [669, -68.17612459185219], [670, -68.3009336212105], [671, -68.50844929370115], [672, -70.24787449420815], [673, -73.64401051434083], [674, -73.63350482988105], [675, -73.44957590547709], [676, -73.20494066059736], [677, -72.92649338839698], [678, -72.62722851304135], [679, -72.31850006649816], [680, -72.01184658980839], [681, -71.718183654864], [682, -71.4469588391275], [683, -71.20500986007549], [684, -70.99591508944418], [685, -73.81659577804804], [686, -74.0638473499164], [687, -73.91823277376922], [688, -74.27321886132904], [689, -74.31960655627917], [690, -74.18727564634197], [691, -73.99253760017075], [692, -73.75350310365383], [693, -73.47688398424637], [694, -73.1691061754611], [695, -72.8389971499594], [696, -72.49786645650197], [697, -72.15879422625987], [698, -71.83442640274228], [699, -71.53523558859143], [700, -71.26907570723448], [701, -71.03992550490426], [702, -70.8481639024206], [703, -70.69166900892398], [704, -70.5669879403442], [705, -70.46958566512562], [706, -70.39475832464736], [707, -70.33809913225684], [708, -70.29573811765563], [709, -70.26442827926682], [710, -70.2415349627258], [711, -70.22497344391438], [712, -70.21312556158648], [713, -70.2047539871213], [714, -70.19892383503051], [715, -70.19493563137296], [716, -70.19227039328085], [717, -70.19054592011564], [718, -70.18948271612032], [719, -70.18887781880565], [720, -70.18858492486201], [721, -70.18849942963418], [722, -70.18854724387174], [723, -72.38999403214945], [724, -74.0685250508365], [725, -73.97495375301789], [726, -73.76199202387428], [727, -73.49362071556399], [728, -73.18878167741684], [729, -72.85979280806951], [730, -72.51892906968848], [731, -72.17953605903607], [732, -71.85437952047236], [733, -71.55399129248575], [734, -71.2863252937884], [735, -71.05548189148872], [736, -70.86198371013333], [737, -70.70374580608572], [738, -70.57740435258623], [739, -70.47847608942263], [740, -70.40228208619507], [741, -70.34442337822045], [742, -70.30102602098916], [743, -70.26883171985303], [744, -70.2451906706473], [745, -70.22800158044129], [746, -70.21562987232265], [747, -73.7454033961952], [748, -74.06297968499662], [749, -71.35074352971985], [750, -65.20121054455927], [751, -63.3522054600095], [752, -62.964521180642876], [753, -63.2143918674315], [754, -63.77067545529933], [755, -64.47027524421134], [756, -65.21597949510611], [757, -65.94891480381688], [758, -66.63430354486172], [759, -67.25210270711172], [760, -67.79235793187189], [761, -68.25522955640544], [762, -68.64320274564363], [763, -68.9642638468082], [764, -69.22593326472757], [765, -69.43661178021198], [766, -69.60500787945796], [767, -69.7385069521691], [768, -69.84357499770108], [769, -69.92574381864893], [770, -73.62552869928491], [771, -74.02037563117199], [772, -73.88453290502329], [773, -73.65609641828931], [774, -73.37912340182139], [775, -73.06968831746653], [776, -72.73976094329416], [777, -74.1006157564538], [778, -74.14335838042588], [779, -73.98280027795009], [780, -73.75382413742498], [781, -73.48066868620786], [782, -73.17431144910029], [783, -72.8448825518465], [784, -72.50404519766404], [785, -72.16497708599965], [786, -71.84037593901745], [787, -71.54075502976796], [788, -71.2740304259072], [789, -71.04424718463424], [790, -70.85184971235074], [791, -70.69474247760758], [792, -70.56950633101323], [793, -70.47162114343064], [794, -70.39638600013754], [795, -70.33939014077832], [796, -70.29675590611092], [797, -70.26522716054988], [798, -70.24216010219085], [799, -70.22546162806665], [800, -70.21350630821199], [801, -70.20505072921033], [802, -70.19915503425614], [803, -70.19511575597221], [804, -70.1924107414303], [805, -56.20167020562737], [806, 33.651448737132036], [807, 5.524573190385993], [808, -36.839005188649615], [809, -69.99371373884267], [810, -69.23838481366528], [811, -68.59853340801699], [812, -68.25746438513832], [813, -68.16397014545973], [814, -68.24490830257724], [815, -68.42995287030396], [816, -68.66365109771749], [817, -73.38997884871085], [818, -73.68831499215455], [819, -73.55800505922534], [820, -73.33641160738748], [821, -73.07149951591643], [822, -72.78001859484652], [823, -72.47352449793564], [824, -72.16351657450295], [825, -71.86145518119451], [826, -71.57754928565994], [827, -73.02431954855834], [828, -74.07996904189845], [829, -73.9819216386253], [830, -73.77296686373585], [831, -73.56998409462959], [832, -74.27787772296514], [833, -74.20160985390166], [834, -74.0252036658125], [835, -73.79623761451417], [836, -73.526826403785], [837, -73.22442733610184], [838, -72.89777695468283], [839, -72.55785395874902], [840, -72.21760932406997], [841, -71.88993059735355], [842, -71.5856876727133], [843, -71.3133417026398], [844, -71.07754735716277], [845, -70.87931432188955], [846, -70.71679236086166], [847, -70.58680720614377], [848, -70.48493235935038], [849, -70.4064529931637], [850, -70.3468873238631], [851, -70.30226043872395], [852, -59.38349780643777], [853, 12.21860284506258], [854, 12.015078550678059], [855, -30.855948875807997], [856, -69.71387883039525], [857, -69.39640695946828], [858, -68.71023991090522], [859, -68.32430923730698], [860, -68.1945217119233], [861, -68.24992454086727], [862, -68.41923109853957], [863, -68.64471444209458], [864, -68.88588856066484], [865, -69.11755139636465], [866, -69.32589898475476], [867, -69.50576380307547], [868, -73.7242784419734], [869, -73.912140266853], [870, -73.7613692746867], [871, -73.52805731547994], [872, -73.25053647826923], [873, -72.94398636258639], [874, -72.620113705187], [875, -72.29127469895617], [876, -71.97001549986827], [877, -71.66746902692788], [878, -71.39269646570132], [879, -71.15146869066929], [880, -70.94604510805456], [881, -70.77548290814794], [882, -70.63732884346564], [883, -70.52773947540389], [884, -70.4423011090429], [885, -70.37665739650674], [886, -70.32684287901391], [887, -70.28944013221594], [888, -70.26161747299707], [889, -70.24109570891584], [890, -70.22608002372358], [891, -70.21518048012543], [892, -70.20733458433227], [893, -70.20173846421474], [894, -70.19778898166112], [895, -70.19503677005356], [896, -70.19314907423004], [897, -70.19188086721506], [898, -70.1910526928933], [899, -70.19053383557277], [900, -70.1902296330971], [901, -70.19007197140748], [902, -70.19001219843133], [903, -70.19001586432655], [904, -70.19005883257879], [905, -70.19012441531028], [906, -70.19020127084464], [907, -70.19028186663756], [908, -70.19036136021779], [909, -70.19043678824771], [910, -70.1905064819946], [911, -70.19056964862916], [912, -70.19062607354189], [913, -70.19067591062375], [914, -70.19071953618983], [915, -70.19075744870324], [916, -74.04205830840984], [917, -74.01486288843978], [918, -73.8217161339449], [919, -73.56483134682897], [920, -72.09406820372482], [921, -63.07420329696528], [922, -68.82806565774465], [923, -69.0579016982201], [924, -68.98130883657838], [925, -68.89308218218103], [926, -68.8377578673874], [927, -68.82149584110697], [928, -68.84344841409704], [929, -68.9002485714909], [930, -68.98628117935263], [931, -69.09386490774885], [932, -69.21444489496238], [933, -69.3398836242067], [934, -69.46308682233179], [935, -69.57872101012838], [936, -69.68336459281709], [937, -69.77531383022153], [938, -69.85420708432147], [939, -69.92060627964699], [940, -69.97562405783611], [941, -70.02061536913801], [942, -70.05693979646863], [943, -70.08608680463057], [944, -70.10932059047954], [945, -70.12772607831475], [946, -70.14222650695578], [947, -70.15359358318446], [948, -70.16246315015523], [949, -70.16935328113833], [950, -70.17468236613502], [951, -70.17878586860935], [952, -70.18193115537026], [953, -70.18433023194929], [954, -70.18615045225039], [955, -70.18752338836322], [956, -70.18855209278573], [957, -70.1893169917512], [958, -70.1898806338873], [959, -70.19029149437145], [960, -70.190587007584], [961, -73.97871481130917], [962, -74.04052399361566], [963, -73.8664616292124], [964, -73.6197090370666], [965, -73.32967336293345], [966, -73.01013065739767], [967, -72.6730484719339], [968, -72.33139085340186], [969, -71.99841502893635], [970, -71.6857476318056], [971, -71.40265265177835], [972, -71.15498448290188], [973, -70.9448613365697], [974, -70.77106512253103], [975, -70.63087689483092], [976, -70.52017776025113], [977, -70.4343014442578], [978, -70.36868312011617], [979, -70.31919510712792], [980, -70.28229944963078], [981, -70.25507842875815], [982, -70.23519375651588], [983, -70.22081168763202], [984, -70.21051795582522], [985, -70.2032360099612], [986, -70.19815495256383], [987, -70.19466929482859], [988, -73.3334090409697], [989, -74.06932610671628], [990, -73.9477714778398], [991, -73.72450399142409], [992, -73.44977714532733], [993, -73.1405586563765], [994, -72.80896074440328], [995, -72.46743902556094], [996, -72.12937332530173], [997, -71.80727749013852], [998, -71.51134887516245], [999, -70.92629851799667], [1000, -50.51118565403743]
];
//p5 setup
function setup() {
osc = new p5.TriOsc(); //new oscillator
//scale for x
var x = d3.scale.linear()
.range([padding, w-padding]);
//scale for y
var y = d3.scale.linear()
.range([h-padding, padding]);
//to draw the line through the data points
var lines = d3.svg.line()
.x(function(d) {return x(d); })
.y(function(d) {return y(d); });
//gradient for data across x axis
var color = d3.scale.linear()
.domain([0, d3.max(dataset, function(d) {return d[0]; })]) //use max and min to be more flexible
.range(["red", "blue"]);
//scaling the graph
var xScale = d3.scale.linear()
.domain([0, d3.max(dataset, function(d) {return d[0]; })]) //use max and min to be more flexible
//.range([d3.min(dataset, function(d) {return d[0];}) , w]); //set to min value and svg width
.range([padding*2, w-padding]);
var yScale = d3.scale.linear()
.domain([d3.min(dataset, function(d) {return d[1]}), d3.max(dataset, function(d) {return d[1]; })]) //use max and min to be more flexible
//.range([d3.min(dataset, function(d) {return d[1];}), h]);//set to min value and svg width
.range([h-padding*2, padding]);
//create the x axis for graph
var xAxis = d3.svg.axis()
.scale(xScale)
.orient("bottom")
.ticks(6); //set number of ticks
// .style("")
//create the y axis
var yAxis = d3.svg.axis()
.scale(yScale)
.orient("left")
.ticks(7); //set number of ticks
//make a line
var valueline = d3.svg.line()
.x(function(d) { return xScale(d[0]); })
.y(function(d) { return yScale(d[1]); });
//make the svg element
var svg = d3.select("#dataContainer") //put graph in this dataContainer
.append("svg")
.attr("width", w)
.attr("height", h);
svg.append("path")
.attr("class", "line")
.attr("d", valueline(dataset));
svg.selectAll("circle")
.data(dataset)
//.transition()
.enter()
.append("circle")
.style("fill", function(d) {
return color(d[0]);
})
//.style("stroke", "white")
.attr("cx", function(d) {
return xScale(d[0]);
})
.attr("cy", function(d) {
return yScale(d[1]);
})
.attr("r", 5)
.on("mouseover", function(d) {
d3.select(this)
.transition() //make it transition nicely
.duration(50) // transition duration
.attr("r", 20); //enlarges the circle on hover
osc.freq(880);
osc.amp(.5, 1);
playing = true; // play noise when hover on circle
osc.start();
var freq = map(yScale(d[1]), h, 0, 40, 660);
osc.freq(freq);
})
.on("mouseout", function(d) {
d3.select(this)
.transition()
.duration(250)
.attr("r", 5);
playing = false;
osc.stop();
});
svg.append("g")
.attr("class", "axis") //assign axis class
.attr("transform", "translate(0," + (h-padding) + ")")
.call(xAxis);
svg.append("g")
.attr("class", "axis") //assign axis class
.attr("transform", "translate(" + padding + ",0)")
.call(yAxis);
}