-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcell0.js
141 lines (117 loc) · 30 KB
/
cell0.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
var w = 900;
var h = 600;
//to prevent graph clipping
var padding = 40;
//oscillator to make sounds
var osc;
//var fft;
//var filter;
//var noise;
//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, -61.18926971033493], [64, -6.758364079284608], [65, 14.43589289399152], [66, -12.992498150919284], [67, -8.789238783632364], [68, -10.740315304658415], [69, -13.323720323755852], [70, -8.246763359462282], [71, -8.618386236902976], [72, -10.173586407772891], [73, -15.726756592420246], [74, -18.737453215491467], [75, -20.962353627692565], [76, -23.22961195383606], [77, -25.66616854924624], [78, -28.246131862108722], [79, -30.91528564601743], [80, -33.626322155860905], [81, -36.34932236596609], [82, -39.07062481209082], [83, -41.78222160532414], [84, -44.46488399534742], [85, -47.07454694000428], [86, -49.550501035752276], [87, -51.84369579622073], [88, -53.94044312382416], [89, -55.854443286129616], [90, -57.60756351307102], [91, -59.21712591931227], [92, -60.69371838147157], [93, -62.043081768163546], [94, -63.267278916758805], [95, -64.36674462087271], [96, -65.34255681677053], [97, -66.19707362820742], [98, -66.93465275331228], [99, -67.56249501193535], [100, 4.123835580962273], [101, -3.9220407484703173], [102, -9.272261229043355], [103, -13.578695045661263], [104, -17.419646405425535], [105, -21.014950386572583], [106, -24.453037393448376], [107, -27.763318641744544], [108, -30.95400157914439], [109, -34.03352345995179], [110, -37.01858399787355], [111, -39.92965580385209], [112, -42.77677829300402], [113, -45.54248450992622], [114, -48.177697035079504], [115, -50.62625219477374], [116, -48.49500246498644], [117, -47.36019228854111], [118, -49.587959748875384], [119, -52.92440636861879], [120, -55.65336642898798], [121, -57.730985778880225], [122, -2.3265377030298353], [123, -9.928143145109019], [124, -14.250097543450606], [125, -17.165899413208617], [126, -19.933966180104385], [127, -22.739847947912214], [128, -10.547445216420318], [129, -10.338750129288112], [130, -11.8912071759859], [131, -14.079262594858228], [132, -16.631351687239835], [133, -19.4253796106066], [134, -22.376594723785317], [135, -25.41124496817749], [136, -28.46523047802742], [137, -31.490989747953375], [138, -34.46320427545291], [139, -37.377628580130754], [140, -40.24100970965086], [141, -43.05348410197043], [142, -45.79028455958976], [143, -48.39847331404413], [144, -50.82108597745323], [145, -53.03234899806528], [146, -55.04137470690309], [147, -7.133779088078587], [148, -5.451257929133801], [149, -9.037484321313329], [150, -12.456438467566588], [151, -15.833846476538213], [152, -19.192448514579176], [153, -22.523939578566534], [154, -25.80622265055449], [155, -29.0142944731525], [156, -32.13165199542229], [157, -35.15720809156285], [158, -38.103570334505854], [159, -40.98587810123325], [160, -43.80398576172042], [161, -46.52711143543062], [162, -49.09867057591039], [163, -51.469402143341185], [164, -53.62511348624654], [165, -55.58342821410224], [166, -57.37067143301838], [167, -59.00765718460893], [168, -60.50813339632627], [169, -1.9602811256179944], [170, -3.9229552684638995], [171, -8.465264235490599], [172, -12.327255494232482], [173, -15.730548755061038], [174, -19.111587984214054], [175, -22.469427434443396], [176, -25.773349365371136], [177, -28.99668441601296], [178, -37.977572764146146], [179, -43.7019514003391], [180, -45.49116432801993], [181, -46.673415242178784], [182, -47.933321013818905], [183, -11.587336851517902], [184, -8.383423730771868], [185, -10.73634517400704], [186, -13.55660551194872], [187, -16.57177297133575], [188, -19.689570969736497], [189, -22.853900697878256], [190, -26.01803599393383], [191, -29.142334528726185], [192, -32.200427378108024], [193, -35.183938554080605], [194, -38.10000545840503], [195, -40.96005300035895], [196, -43.762031403435216], [197, -46.47465619786114], [198, -9.403561011997057], [199, -7.8698994377322], [200, -10.349851561907677], [201, -13.23866930344531], [202, -16.31909590542949], [203, -19.502587121893466], [204, -22.72937668292272], [205, -25.94873967045021], [206, -29.118805056185327], [207, -32.2130439836334], [208, -35.224455354615316], [209, -38.16209761836759], [210, -41.03883945167023], [211, -43.85288228801698], [212, -46.57226042302645], [213, -49.139874972016706], [214, -51.50648498474046], [215, -53.65846901839432], [216, -55.61363837945666], [217, -57.39822493907805], [218, -59.03288218725703], [219, -60.531155451525805], [220, -52.67271656673382], [221, -45.77011148080036], [222, -36.63438516550536], [223, -23.016106202284718], [224, -46.915091385155165], [225, -66.54325385765492], [226, -66.3928599474357], [227, -66.38950977047008], [228, -66.61281600812109], [229, -66.97236474206419], [230, -67.39373607554084], [231, -67.82457171462879], [232, -68.2320965993401], [233, -7.249041509765579], [234, 1.8059416414181344], [235, -5.455210016123683], [236, -10.479679851634428], [237, -14.650668594002134], [238, -18.42182304596577], [239, -21.973708461808037], [240, -25.3773296953147], [241, -28.654982816501505], [242, -31.814165465890387], [243, -34.86571512740221], [244, -13.448807347396924], [245, -9.305093121784441], [246, -10.863656647161319], [247, -13.266546111450994], [248, -16.046211264021306], [249, -19.039120710922262], [250, -22.14996782525028], [251, -25.30564830843432], [252, -28.447386085854326], [253, -31.534731085626397], [254, -34.54959707745391], [255, -37.493910469393505], [256, -40.37862835384243], [257, -43.20558720776712], [258, -45.949433716072264], [259, -8.363404893404997], [260, -8.274192954051559], [261, -10.760958945956029], [262, -13.643179541981308], [263, -16.718162680067067], [264, -19.896783887682727], [265, -12.701254404549486], [266, -9.42266769565273], [267, -10.503924447085524], [268, -12.510412830497163], [269, -14.977130657684501], [270, -17.737408185534907], [271, -20.691312797634], [272, -23.75716483152076], [273, -26.86288634753705], [274, -29.95088515627261], [275, -32.98519501112724], [276, -10.84583381884987], [277, -9.721326376879926], [278, -11.456078173617716], [279, -13.893727078274717], [280, -20.090105183383923], [281, -25.01838267952682], [282, -27.492768358725986], [283, -13.601000937747893], [284, -10.988264718768438], [285, -12.074604735861898], [286, -14.062653676322013], [287, -16.32439493500443], [288, -18.91363589929217], [289, -21.750097814950628], [290, -24.718226084370094], [291, -27.73590053640131], [292, -30.74479202194337], [293, -33.71097290243308], [294, -36.62366420416318], [295, -39.486969298808816], [296, -42.30395825231375], [297, -45.05738102870789], [298, -47.70061639516717], [299, -50.17439048410638], [300, -52.44154333415043], [301, -54.5024514843191], [302, -56.37968615406493], [303, -58.09713906330022], [304, -59.67218205951628], [305, -61.114642171073726], [306, -62.42916617899966], [307, -63.617403801326844], [308, -64.68046113494539], [309, -65.61978560748197], [310, 1.5054149056256305], [311, -5.259903475868968], [312, -10.038425632583614], [313, -14.080749788574765], [314, -17.791583680694774], [315, -21.320145598494456], [316, -24.721665373823758], [317, -28.00975398134439], [318, -31.185376004478137], [319, -34.25408746434429], [320, -37.23149005228307], [321, -40.13702549026251], [322, -42.97880978467677], [323, -45.73679471735198], [324, -48.36035381924933], [325, -50.79378353602796], [326, -6.047315352615169], [327, -8.015364495400968], [328, -10.965622529610995], [329, -14.084542166502022], [330, -17.29751098034394], [331, -20.556397556121546], [332, -23.81899807495277], [333, -27.04517925300697], [334, -30.202664484544055], [335, -33.27478157044933], [336, -36.263000005101205], [337, -9.686450911180264], [338, -9.793797707043918], [339, -11.82218780370696], [340, -14.416514454943984], [341, -17.096269503971516], [342, -20.016963868180028], [343, -23.10672527136209], [344, -26.251064266302325], [345, -29.67519771508599], [346, -13.724428835303232], [347, -13.297103312708803], [348, -14.635704388314034], [349, -16.65039137403825], [350, -19.047523511652635], [351, -21.68905509481288], [352, -24.485000687273903], [353, -27.36377533381567], [354, -30.267939553065915], [355, -33.15809950713215], [356, -36.015396668647625], [357, -38.837322874795454], [358, -20.445910252601173], [359, -8.77279785538575], [360, -10.331680746919908], [361, -12.80009345325557], [362, -15.631889540216346], [363, -18.661131105414324], [364, -21.796696916706498], [365, -24.97027303375016], [366, -28.12638958086918], [367, -32.41775634751229], [368, -42.67367119762521], [369, -45.13671927083329], [370, -46.38392182564898], [371, -47.57419770514586], [372, -48.95619277191586], [373, -50.53662700073592], [374, -7.08322875771295], [375, -7.981876055237481], [376, -10.858194870645642], [377, -13.929514183208857], [378, -17.097307335646192], [379, -20.313253367634136], [380, -23.538667603681198], [381, -26.736133251137556], [382, -29.873697957801234], [383, -32.93279564245313], [384, -35.9121188443514], [385, -10.335465573415306], [386, -9.590624998161081], [387, -11.481856740713392], [388, -14.01582443864813], [389, -16.867264000637515], [390, -19.901007915541772], [391, -19.26485732397964], [392, -9.562202312832857], [393, -10.185653515201638], [394, -12.03087796186251], [395, -14.409122477633138], [396, -9.226955603933114], [397, -8.766596724388185], [398, -10.093108309927725], [399, -12.073796620635106], [400, -14.45641575393071], [401, -17.129947199735305], [402, -20.014661750896853], [403, -23.035483791857427], [404, -26.119640378660392], [405, -29.204382967886087], [406, -32.24638839354843], [407, -41.51685335560308], [408, -47.36303190624043], [409, -48.93712875859342], [410, -49.87642376994373], [411, -50.88911505741641], [412, -52.10678059436204], [413, -53.503694691072575], [414, -55.00688428506366], [415, -56.54162249855188], [416, -58.051141962389565], [417, -59.500829853504385], [418, -60.869631987400126], [419, -62.145483840812595], [420, 0.9655404043368063], [421, -3.937521788928462], [422, -8.728353140654697], [423, -12.72555859221503], [424, -16.407509315064864], [425, -19.92633957028125], [426, -23.336019686144912], [427, -26.647577937622376], [428, -29.85646424880995], [429, -39.78440052793414], [430, -44.560825566062974], [431, -46.16197361984596], [432, -47.29972157895474], [433, -48.546250778045604], [434, -50.00225393521986], [435, -51.626615174850635], [436, -53.33453700033958], [437, -55.04462916775773], [438, -56.702760152662414], [439, -58.27996045523486], [440, -59.76191530197784], [441, -1.3690682575528634], [442, -6.166718209745753], [443, -10.220920925479875], [444, -13.897248907405963], [445, -17.415555563879803], [446, -20.84252064173001], [447, -24.19363001796821], [448, -27.461274008427264], [449, -30.633357517079467], [450, -33.70641061068336], [451, -14.130424361850473], [452, -9.384074588197256], [453, -10.814645708871717], [454, -13.05518587247698], [455, -15.749044143829178], [456, -18.69243683299499], [457, -21.775775374597693], [458, -24.919184547822766], [459, -28.05926181729603], [460, -31.15130742668219], [461, -34.17337953006664], [462, -37.12469607745236], [463, -40.01558577097965], [464, -42.850009454067475], [465, -45.6067580772751], [466, -58.50084219292418], [467, -60.03996084216956], [468, -25.33067574044572], [469, -6.8876396444292185], [470, -9.755483175518453], [471, -12.905180150497047], [472, -9.729893259475409], [473, -8.59828985462185], [474, -9.824425378833022], [475, -11.752571625630502], [476, -14.084481374509696], [477, -16.705483321637676], [478, -19.540886318479664], [479, -22.521396435712845], [480, -25.577762170085467], [481, -28.647262662271924], [482, -31.68352857858612], [483, -34.66284004024968], [484, -37.58246064815686], [485, -40.449739640154235], [486, -43.263839918452376], [487, -45.99753344941717], [488, -48.59647004481544], [489, -51.005246836379236], [490, -53.20132698655095], [491, -55.196123612428856], [492, -57.01516241796855], [493, -58.681192685108606], [494, -60.208641385501714], [495, -61.60507227891149], [496, -62.87417639148768], [497, -64.01747321053051], [498, -65.03573453577107], [499, -72.16635052656855], [500, -72.45424454778028], [501, 0.5333901695569753], [502, -5.127676237502865], [503, -10.147288048831225], [504, -7.821793909307642], [505, -8.222590897500831], [506, -9.82255677519385], [507, -11.914088306170934], [508, -14.330630413131827], [509, -16.997466405060262], [510, -19.85636916284258], [511, -22.845955399938646], [512, -25.901565709595772], [513, -28.964021567890484], [514, -31.990169925073648], [515, -34.959018205348244], [516, -37.869487726980374], [517, -40.728918642253014], [518, -43.53454864132602], [519, -46.25613161806982], [520, -48.8372222073726], [521, -51.22520789488035], [522, -53.40038557766981], [523, -55.37687247066861], [524, -57.18026604504814], [525, -58.83218219515172], [526, -60.34689390508894], [527, -61.73091812744546], [528, -62.98804636095345], [529, -64.11942234524625], [530, 0.30881616296024794], [531, -5.802135976742673], [532, -10.302098086286806], [533, -14.21053845767162], [534, -17.853829700281054], [535, -21.347757094187163], [536, -24.73145626065587], [537, -28.01043741362272], [538, -31.181467189577347], [539, -34.24789861647949], [540, -37.22417858928603], [541, -40.12917042235833], [542, -42.97075690679297], [543, -45.72884767374889], [544, -48.35279039356068], [545, -50.786799455553556], [546, -53.00590924557483], [547, -55.020306798793534], [548, -56.855784489272324], [549, -58.53603148654215], [550, -60.076039373858364], [551, -61.48466863647416], [552, -62.76540195084835], [553, -63.920119327933044], [554, -57.76290953865585], [555, 0.7408697849453161], [556, -5.652107819734686], [557, -5.7859595441121785], [558, -6.932099986782851], [559, -8.742916280645337], [560, -10.916780624734558], [561, -13.371639933370185], [562, -16.062800230810215], [563, -18.945370755451478], [564, -21.96391934050443], [565, -25.055113180028552], [566, -28.157742508821112], [567, -31.224572947795284], [568, -34.23028644286001], [569, -37.17120774427241], [570, -40.05548581637921], [571, -42.88546987033561], [572, -45.63878175732806], [573, -48.26352535183826], [574, -50.70238536211385], [575, -52.92783667975351], [576, -54.948585792863156], [577, -56.78988857601466], [578, -58.475391808249015], [579, -51.74755998131948], [580, -47.2065434303401], [581, -47.335285747718615], [582, -54.047545493534585], [583, -59.0384818158772], [584, -60.87051008988404], [585, -1.3478756955615736], [586, -3.5578846181848274], [587, -4.68095046004636], [588, -6.4131223350721225], [589, -8.442735311113427], [590, -10.720215724820807], [591, -13.226695483973106], [592, -17.89949263539415], [593, -24.030283893370257], [594, -26.686537301708025], [595, -28.855328092521237], [596, -31.079907336642115], [597, -33.429582100329924], [598, -35.87955187204787], [599, -38.39808618563967], [600, -40.960537203122335], [601, -43.54151968980348], [602, -46.09984720109872], [603, -48.57536913035767], [604, -50.90698879471001], [605, -53.060590186883985], [606, -5.26650723249314], [607, -8.017088525692103], [608, -11.18247682168845], [609, -14.414617376156858], [610, -17.69059781201525], [611, -20.98238017364034], [612, -24.25809212194486], [613, -27.484185576254795], [614, -30.633804883974246], [615, -33.69496067181741], [616, -36.67252081420289], [617, -39.58117645941559], [618, -42.430027283511244], [619, -45.20394005358829], [620, -47.856207356814274], [621, -50.32939353768647], [622, -52.58967416996422], [623, -54.64166055646849], [624, -6.132342118864437], [625, -11.727162087619174], [626, -14.562486195044723], [627, -17.206593275335102], [628, -19.940795301619396], [629, -22.768245032932118], [630, -25.654181950854923], [631, -28.560210763800235], [632, -31.453834334884075], [633, -34.31511026587902], [634, -37.13874209271876], [635, -39.9285254888141], [636, -42.684017339726125], [637, -41.53346013305876], [638, -7.948579024812925], [639, -9.69032852114346], [640, -12.30334475407178], [641, -15.229249087307712], [642, -18.320990571179216], [643, -21.498541082941568], [644, -24.701262595412476], [645, -27.87868485499149], [646, -13.812423955812601], [647, -9.677313387302805], [648, -10.884825342743081], [649, -12.972849114262347], [650, -15.550164558643004], [651, -18.408762152880144], [652, -21.43511714338426], [653, -24.54473673515054], [654, -27.668800149069497], [655, -30.75673583289708], [656, -33.78102240973993], [657, -36.73667459715428], [658, -39.63226933098129], [659, -42.473111486420855], [660, -45.24164320193946], [661, -47.88963583947944], [662, -50.35909173909622], [663, -52.61611126069703], [664, -54.66541189520405], [665, -56.53143008006477], [666, -58.23842356096287], [667, -59.80305888661082], [668, -61.23546977971875], [669, -62.539543106239925], [670, -63.71725487755951], [671, -64.76965986225558], [672, -65.69833297216735], [673, -66.50666832982027], [674, -67.2002581154737], [675, -67.78663590353186], [676, -68.27626652067916], [677, -68.67919795341284], [678, -69.00758182739632], [679, -69.27184167757568], [680, -69.48249301198963], [681, -69.64917034184906], [682, -69.77998536281244], [683, -69.88187698228612], [684, -69.96067387372169], [685, -70.02117629628688], [686, -70.06720612100037], [687, -70.10204595406505], [688, -72.34777113942836], [689, -73.82940940491433], [690, -73.71660659194309], [691, -73.47398923263194], [692, -73.17809691728225], [693, -72.85345655127765], [694, -72.5156147650138], [695, -72.17872667462046], [696, -71.85569730495739], [697, -71.55705084254396], [698, -71.29069529346759], [699, -71.06073186677757], [700, -70.8677382423966], [701, -70.70967791839581], [702, -70.58325560658781], [703, -70.48406246669038], [704, -70.40748467536667], [705, -70.34917623033712], [706, 12.577555714375348], [707, 3.149372835628909], [708, -5.298748777143739], [709, -10.983447248311123], [710, -15.46282117518898], [711, -19.36350090469726], [712, -9.585874000768463], [713, -9.531710797707413], [714, -11.154843725360811], [715, -16.739064485344993], [716, -20.47109673201267], [717, -22.81310302893567], [718, -25.072643086939628], [719, -27.46852865163517], [720, -29.994419334887326], [721, -32.60390660945327], [722, -10.694602495712635], [723, -10.336148062876463], [724, -12.11493655054682], [725, -14.535143022250493], [726, -17.287512663852887], [727, -20.23841241463175], [728, -23.300416900812913], [729, -26.403000613572758], [730, -29.49016080087832], [731, -32.5256013182767], [732, -35.49550927667369], [733, -38.403886106314395], [734, -40.04466504122612], [735, -41.06735836876161], [736, -43.51867480555169], [737, -46.400948553877626], [738, -49.197561548583394], [739, -51.70486523617211], [740, -53.91257839603583], [741, -55.879031743872574], [742, -57.65714087770611], [743, -59.278799842281884], [744, -60.76043055855742], [745, -62.11073489138197], [746, -63.33293334910333], [747, -64.42851416115019], [748, -65.39919138390648], [749, -66.2478360720669], [750, -66.97921298457999], [751, -67.60081072329316], [752, -68.1219831077068], [753, -68.55269484815253], [754, -68.90488675917754], [755, 8.274909607251917], [756, -0.5728971296279555], [757, -7.160502407110475], [758, -11.994355036141446], [759, -18.102448700825494], [760, -25.584025593600735], [761, -28.565952245059393], [762, -30.83789820579878], [763, -33.08650514296172], [764, -35.424613333157666], [765, -10.304963398553902], [766, -10.743898102297624], [767, -12.733845850105041], [768, -15.259679016077035], [769, -18.070872621235335], [770, -21.050650839075075], [771, -24.1191543787918], [772, -27.211524867814056], [773, -30.277838122513838], [774, -33.28825059252404], [775, -36.23438846280806], [776, -9.497241779570256], [777, -10.042914891979972], [778, -6.90702128359854], [779, -7.567803754185591], [780, -9.10646519704538], [781, -11.100175082345514], [782, -13.429732974091625], [783, -16.033435467394124], [784, -18.85618537124034], [785, -21.83559636096085], [786, -24.903104105263537], [787, -27.99315966411216], [788, -31.054710531986604], [789, -34.059188478882504], [790, -37.00058007474118], [791, -39.88601085224219], [792, -42.71831679386407], [793, -45.47667411047146], [794, -48.110254649908576], [795, -50.561339951673574], [796, -52.799480889171846], [797, -54.83181876584224], [798, -9.581623388303496], [799, -5.197200955815189], [800, -8.787834814370369], [801, -12.20713238198825], [802, -15.583202995715764], [803, -18.941594811083935], [804, -22.274942495042914], [805, -25.561424691883097], [806, -28.775632089059375], [807, -31.084784362413856], [808, -33.644548053640555], [809, -36.527067005780985], [810, -39.4606899520154], [811, -25.745608216839955], [812, -8.506770967367602], [813, -10.08917617960343], [814, -7.351035703281936], [815, -7.610756727616997], [816, -9.062655509040487], [817, -11.03244924350298], [818, -13.35753209455172], [819, -15.962939100522183], [820, -23.45035805220707], [821, -27.19229604110913], [822, -29.416588701795504], [823, -31.512762743261423], [824, -33.72583281227765], [825, -36.06524204449556], [826, -38.5002160414849], [827, -41.000716871518144], [828, -43.536164140234554], [829, -46.062364880722335], [830, -48.517676899265986], [831, -50.83889273618223], [832, -52.98885952760696], [833, -54.962863686493684], [834, -56.77506550022753], [835, -58.44216963774451], [836, -59.97549604289059], [837, -61.382407744766574], [838, -62.66491486348841], [839, -63.82413149284047], [840, -64.86030822462622], [841, -65.77462734010417], [842, -66.57030001952097], [843, -67.25285096345856], [844, -67.82964499185914], [845, -68.3110381500999], [846, -68.70707096813008], [847, -69.02972039758353], [848, -69.28920444451356], [849, -69.49602689006234], [850, -69.65962768532958], [851, -69.78799293113055], [852, -69.88795232271659], [853, -69.96523856951454], [854, -70.02456407135335], [855, -70.06969023858396], [856, -70.10384528453102], [857, -70.1295188290446], [858, -67.08990291145884], [859, -40.063058362782435], [860, 23.722222687309678], [861, -20.514777202855797], [862, -65.1489041878048], [863, -69.3959348690459], [864, -68.658487317722], [865, -7.23180142712604], [866, -6.555125585783868], [867, -7.079754598533943], [868, -8.58861373606089], [869, -10.484981547848475], [870, -12.65826438548578], [871, -15.071834564096243], [872, -17.69913470289843], [873, -20.503377136353148], [874, -23.433597440848196], [875, -26.43086591851966], [876, -29.43964290011025], [877, -32.41919402710887], [878, -35.34975266022672], [879, -38.22999707172867], [880, -41.065234706380004], [881, -43.84903880235927], [882, -46.547374754844576], [883, -49.102104530241576], [884, -51.462544841342776], [885, -53.61256426032263], [886, -5.8186600588593125], [887, -6.399022312694326], [888, -9.708704943873125], [889, -13.00254371920978], [890, -16.313572379565542], [891, -19.633097776037587], [892, -22.938817218842168], [893, -26.201255072680855], [894, -29.39208472436817], [895, -32.49423900719667], [896, -35.50725149751073], [897, -44.45188542012874], [898, -51.21747407109883], [899, -52.634017788606826], [900, -53.335987588460334], [901, -54.08878853332841], [902, -55.030089284981855], [903, -56.148386858628754], [904, -57.38712216875386], [905, -58.68275070731583], [906, -44.60821137213876], [907, -2.318689077884155], [908, -7.1345232228664095], [909, -11.098183433319509], [910, -14.738692683142942], [911, -18.232913642798884], [912, -21.637654910245047], [913, -24.964453935593678], [914, -28.204952582702237], [915, -31.348833960522597], [916, -34.395786568234485], [917, -37.35804560696136], [918, -47.29593460489579], [919, -53.13486605499561], [920, -54.301978737610575], [921, -54.896996880189384], [922, -55.56318687250429], [923, -51.25344104476166], [924, -50.46781378346875], [925, -51.94331804836848], [926, -54.32272181268306], [927, -56.54905422305136], [928, -58.41648404000878], [929, -60.03025138716119], [930, -61.46545503442602], [931, -62.753113650911985], [932, -63.90695630137804], [933, -64.93322698800431], [934, -65.83623373645496], [935, -66.62083608359694], [936, -67.29339317069773], [937, -67.86154752433129], [938, -68.33566800778344], [939, -68.72580044284987], [940, -69.04372391881148], [941, -69.29944156062541], [942, -69.50336180299915], [943, -69.66473446861075], [944, -69.79141101971243], [945, -69.89010937460114], [946, -69.9664696372697], [947, -70.02512737425472], [948, -70.06978552948746], [949, -70.10362392689122], [950, -70.12909299360696], [951, 9.931321638069079], [952, 2.7976236863786363], [953, -5.3656291904312425], [954, -10.900051325205007], [955, -15.315303504545613], [956, -19.192804823576626], [957, -9.149719529997492], [958, -9.679272448681344], [959, -6.894886758393683], [960, -7.412024146312228], [961, -8.820282443694069], [962, -10.697386265319027], [963, -12.925382443785328], [964, -15.444817760842383], [965, -18.202874610276865], [966, -21.138669365151397], [967, -24.18328475276803], [968, -27.268164655157303], [969, -30.336851134408846], [970, -33.35435500069148], [971, -36.30930455154862], [972, -39.20670474305531], [973, -42.05201200386803], [974, -44.8312594367292], [975, -47.50009010101876], [976, -49.998518555531625], [977, -52.28802738473542], [978, -54.367269623679874], [979, -54.302839789450445], [980, -48.60771463563394], [981, -48.5759969514589], [982, -52.3983185437004], [983, -56.29818694134851], [984, -58.64898442720821], [985, -60.377829524220786], [986, -61.8505918725835], [987, -63.14693850479086], [988, -64.29074187021942], [989, -65.2942697802325], [990, -66.16632304035399], [991, -66.9151043481307], [992, -67.55013376891112], [993, -68.0817398868276], [994, -68.52083011164075], [995, -68.87965819834847], [996, -69.16975355480443], [997, -69.401511154381], [998, -69.585396243455], [999, -69.73012973767598], [1000, -69.84317057363712]
];
//p5 setup
function setup() {
osc = new p5.SinOsc(); //new oscillator
//.attr("id", "graph1");
//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(["#0099cc", "#80002a"]);
//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]); });
//the graph
var svg = d3.select("#dataContainer")
.append("svg") // append new group element
.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
playing = true; // play noise when hover on circle
//osc.amp(.5, .02);
//noise.start();
//osc.scale(0, h, 20, 440);
osc.start();
var freq = map(yScale(d[1]), h, 0, 20, 888);
osc.freq(freq);
//var amp = map(xScale(d[0], 0, w, 0, 1));
//osc.amp(amp);
console.log(freq);
//var freq = map(mouseY, 0, w, 20, 440);
//filter.freq(freq);
//filter.res(50);
})
.on("mouseout", function(d) {
d3.select(this)
.transition()
.duration(250)
.attr("r", 5);
playing = false;
//osc.amp(0, .05);
osc.stop();
//noise.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);
}