pv.html 72 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <meta name="generator" content="JsDoc Toolkit" />
  7. <title>JsDoc Reference - pv</title>
  8. <style type="text/css">
  9. /* default.css */
  10. body
  11. {
  12. font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
  13. width: 800px;
  14. }
  15. .header
  16. {
  17. clear: both;
  18. background-color: #ccc;
  19. padding: 8px;
  20. }
  21. h1
  22. {
  23. font-size: 150%;
  24. font-weight: bold;
  25. padding: 0;
  26. margin: 1em 0 0 .3em;
  27. }
  28. hr
  29. {
  30. border: none 0;
  31. border-top: 1px solid #7F8FB1;
  32. height: 1px;
  33. }
  34. pre.code
  35. {
  36. display: block;
  37. padding: 8px;
  38. border: 1px dashed #ccc;
  39. }
  40. #index
  41. {
  42. margin-top: 24px;
  43. float: left;
  44. width: 160px;
  45. position: absolute;
  46. left: 8px;
  47. background-color: #F3F3F3;
  48. padding: 8px;
  49. }
  50. #content
  51. {
  52. margin-left: 190px;
  53. width: 600px;
  54. }
  55. .classList
  56. {
  57. list-style-type: none;
  58. padding: 0;
  59. margin: 0 0 0 8px;
  60. font-family: arial, sans-serif;
  61. font-size: 1em;
  62. overflow: auto;
  63. }
  64. .classList li
  65. {
  66. padding: 0;
  67. margin: 0 0 8px 0;
  68. }
  69. .summaryTable { width: 100%; }
  70. h1.classTitle
  71. {
  72. font-size:170%;
  73. line-height:130%;
  74. }
  75. h2 { font-size: 110%; }
  76. caption, div.sectionTitle
  77. {
  78. background-color: #7F8FB1;
  79. color: #fff;
  80. font-size:130%;
  81. text-align: left;
  82. padding: 2px 6px 2px 6px;
  83. border: 1px #7F8FB1 solid;
  84. }
  85. div.sectionTitle { margin-bottom: 8px; }
  86. .summaryTable thead { display: none; }
  87. .summaryTable td
  88. {
  89. vertical-align: top;
  90. padding: 4px;
  91. border-bottom: 1px #7F8FB1 solid;
  92. border-right: 1px #7F8FB1 solid;
  93. }
  94. /*col#summaryAttributes {}*/
  95. .summaryTable td.attributes
  96. {
  97. border-left: 1px #7F8FB1 solid;
  98. width: 140px;
  99. text-align: right;
  100. }
  101. td.attributes, .fixedFont
  102. {
  103. line-height: 15px;
  104. color: #002EBE;
  105. font-family: "Courier New",Courier,monospace;
  106. font-size: 13px;
  107. }
  108. .summaryTable td.nameDescription
  109. {
  110. text-align: left;
  111. font-size: 13px;
  112. line-height: 15px;
  113. }
  114. .summaryTable td.nameDescription, .description
  115. {
  116. line-height: 15px;
  117. padding: 4px;
  118. padding-left: 4px;
  119. }
  120. pre
  121. {
  122. border-left: solid 10px #ddd;
  123. padding-left: 1.5em;
  124. }
  125. .summaryTable { margin-bottom: 8px; }
  126. ul.inheritsList
  127. {
  128. list-style: square;
  129. margin-left: 20px;
  130. padding-left: 0;
  131. }
  132. .detailList {
  133. margin-left: 20px;
  134. line-height: 15px;
  135. }
  136. .detailList dt { margin-left: 20px; }
  137. .detailList .heading
  138. {
  139. font-weight: bold;
  140. padding-bottom: 6px;
  141. margin-left: 0;
  142. }
  143. .light, td.attributes, .light a:link, .light a:visited
  144. {
  145. color: #777;
  146. font-style: italic;
  147. }
  148. .fineprint
  149. {
  150. text-align: right;
  151. font-size: 10px;
  152. }
  153. </style>
  154. </head>
  155. <body>
  156. <!-- ============================== header ================================= -->
  157. <!-- begin static/header.html -->
  158. <div id="header">
  159. </div>
  160. <!-- end static/header.html -->
  161. <!-- ============================== classes index ============================ -->
  162. <div id="index">
  163. <!-- begin publish.classesIndex -->
  164. <div align="center"><a href="../index.html">Class Index</a>
  165. | <a href="../files.html">File Index</a></div>
  166. <hr />
  167. <h2>Classes</h2>
  168. <ul class="classList">
  169. <li><i><a href="../symbols/_global_.html">_global_</a></i></li>
  170. <li><a href="../symbols/Array.html">Array</a></li>
  171. <li><a href="../symbols/Date.html">Date</a></li>
  172. <li><a href="../symbols/pv.html">pv</a></li>
  173. <li><a href="../symbols/pv.Anchor.html">pv.Anchor</a></li>
  174. <li><a href="../symbols/pv.Area.html">pv.Area</a></li>
  175. <li><a href="../symbols/pv.Bar.html">pv.Bar</a></li>
  176. <li><a href="../symbols/pv.Color.html">pv.Color</a></li>
  177. <li><a href="../symbols/pv.Color.Hsl.html">pv.Color.Hsl</a></li>
  178. <li><a href="../symbols/pv.Color.Rgb.html">pv.Color.Rgb</a></li>
  179. <li><a href="../symbols/pv.Colors.html">pv.Colors</a></li>
  180. <li><a href="../symbols/pv.Dot.html">pv.Dot</a></li>
  181. <li><a href="../symbols/pv.Flatten.html">pv.Flatten</a></li>
  182. <li><a href="../symbols/pv.Image.html">pv.Image</a></li>
  183. <li><a href="../symbols/pv.Label.html">pv.Label</a></li>
  184. <li><a href="../symbols/pv.Layout.grid.html">pv.Layout.grid</a></li>
  185. <li><a href="../symbols/pv.Layout.icicle.html">pv.Layout.icicle</a></li>
  186. <li><a href="../symbols/pv.Layout.stack.html">pv.Layout.stack</a></li>
  187. <li><a href="../symbols/pv.Layout.sunburst.html">pv.Layout.sunburst</a></li>
  188. <li><a href="../symbols/pv.Layout.treemap.html">pv.Layout.treemap</a></li>
  189. <li><a href="../symbols/pv.Line.html">pv.Line</a></li>
  190. <li><a href="../symbols/pv.Mark.html">pv.Mark</a></li>
  191. <li><a href="../symbols/pv.Nest.html">pv.Nest</a></li>
  192. <li><a href="../symbols/pv.ns.html">pv.ns</a></li>
  193. <li><a href="../symbols/pv.Panel.html">pv.Panel</a></li>
  194. <li><a href="../symbols/pv.Rule.html">pv.Rule</a></li>
  195. <li><a href="../symbols/pv.Scale.linear.html">pv.Scale.linear</a></li>
  196. <li><a href="../symbols/pv.Scale.log.html">pv.Scale.log</a></li>
  197. <li><a href="../symbols/pv.Scale.ordinal.html">pv.Scale.ordinal</a></li>
  198. <li><a href="../symbols/pv.Tree.html">pv.Tree</a></li>
  199. <li><a href="../symbols/pv.Vector.html">pv.Vector</a></li>
  200. <li><a href="../symbols/pv.version.html">pv.version</a></li>
  201. <li><a href="../symbols/pv.Wedge.html">pv.Wedge</a></li>
  202. </ul>
  203. <hr />
  204. <!-- end publish.classesIndex -->
  205. </div>
  206. <div id="content">
  207. <!-- ============================== class title ============================ -->
  208. <h1 class="classTitle">
  209. Namespace pv
  210. </h1>
  211. <!-- ============================== class summary ========================== -->
  212. <p class="description">
  213. The top-level Protovis namespace, <tt>pv</tt>.
  214. <br /><i>Defined in: </i> <a href="../symbols/src/pv.js.html">pv.js</a>.
  215. </p>
  216. <!-- ============================== constructor summary ==================== -->
  217. <table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class pv.">
  218. <caption>Namespace Summary</caption>
  219. <thead>
  220. <tr>
  221. <th scope="col">Constructor Attributes</th>
  222. <th scope="col">Constructor Name and Description</th>
  223. </tr>
  224. </thead>
  225. <tbody>
  226. <tr>
  227. <td class="attributes">&nbsp;</td>
  228. <td class="nameDescription" >
  229. <div class="fixedFont">
  230. <b><a href="../symbols/pv.html#constructor">pv</a></b>
  231. </div>
  232. <div class="description">The top-level Protovis namespace.</div>
  233. </td>
  234. </tr>
  235. </tbody>
  236. </table>
  237. <!-- ============================== properties summary ===================== -->
  238. <!-- ============================== methods summary ======================== -->
  239. <table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class pv.">
  240. <caption>Method Summary</caption>
  241. <thead>
  242. <tr>
  243. <th scope="col">Method Attributes</th>
  244. <th scope="col">Method Name and Description</th>
  245. </tr>
  246. </thead>
  247. <tbody>
  248. <tr>
  249. <td class="attributes">&lt;static&gt; &nbsp;</td>
  250. <td class="nameDescription">
  251. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.blend">blend</a></b>(arrays)
  252. </div>
  253. <div class="description">Given the specified array of arrays, concatenates the arrays into a single
  254. array.</div>
  255. </td>
  256. </tr>
  257. <tr>
  258. <td class="attributes">&lt;static&gt; &nbsp;</td>
  259. <td class="nameDescription">
  260. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.child">child</a></b>()
  261. </div>
  262. <div class="description">Returns <tt>this.childIndex</tt>.</div>
  263. </td>
  264. </tr>
  265. <tr>
  266. <td class="attributes">&lt;static&gt; &nbsp;</td>
  267. <td class="nameDescription">
  268. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.color">color</a></b>(format)
  269. </div>
  270. <div class="description">Returns the <a href="../symbols/pv.Color.html">pv.Color</a> for the specified color format string.</div>
  271. </td>
  272. </tr>
  273. <tr>
  274. <td class="attributes">&lt;static&gt; &nbsp;</td>
  275. <td class="nameDescription">
  276. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.colors">colors</a></b>()
  277. </div>
  278. <div class="description">Returns a new categorical color encoding using the specified colors.</div>
  279. </td>
  280. </tr>
  281. <tr>
  282. <td class="attributes">&lt;static&gt; &nbsp;</td>
  283. <td class="nameDescription">
  284. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.cross">cross</a></b>(a, b)
  285. </div>
  286. <div class="description">Given two arrays <tt>a</tt> and <tt>b</tt>, <style
  287. type="text/css">sub{line-height:0}</style> returns an array of all possible
  288. pairs of elements [a<sub>i</sub>, b<sub>j</sub>].</div>
  289. </td>
  290. </tr>
  291. <tr>
  292. <td class="attributes">&lt;static&gt; &nbsp;</td>
  293. <td class="nameDescription">
  294. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.dict">dict</a></b>(keys, f)
  295. </div>
  296. <div class="description">Returns a map constructed from the specified <tt>keys</tt>, using the
  297. function <tt>f</tt> to compute the value for each key.</div>
  298. </td>
  299. </tr>
  300. <tr>
  301. <td class="attributes">&lt;static&gt; &nbsp;</td>
  302. <td class="nameDescription">
  303. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.entries">entries</a></b>(map)
  304. </div>
  305. <div class="description">Returns all of the entries (key-value pairs) of the specified object (a
  306. map).</div>
  307. </td>
  308. </tr>
  309. <tr>
  310. <td class="attributes">&lt;static&gt; &nbsp;</td>
  311. <td class="nameDescription">
  312. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.flatten">flatten</a></b>(map)
  313. </div>
  314. <div class="description">Returns a <a href="../symbols/pv.Flatten.html">pv.Flatten</a> operator for the specified map.</div>
  315. </td>
  316. </tr>
  317. <tr>
  318. <td class="attributes">&lt;static&gt; &nbsp;</td>
  319. <td class="nameDescription">
  320. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.hsl">hsl</a></b>(h, s, l, a)
  321. </div>
  322. <div class="description">Constructs a new HSL color with the specified values.</div>
  323. </td>
  324. </tr>
  325. <tr>
  326. <td class="attributes">&lt;static&gt; &nbsp;</td>
  327. <td class="nameDescription">
  328. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.identity">identity</a></b>(x)
  329. </div>
  330. <div class="description">Returns the passed-in argument, <tt>x</tt>; the identity function.</div>
  331. </td>
  332. </tr>
  333. <tr>
  334. <td class="attributes">&lt;static&gt; &nbsp;</td>
  335. <td class="nameDescription">
  336. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.index">index</a></b>()
  337. </div>
  338. <div class="description">Returns <tt>this.index</tt>.</div>
  339. </td>
  340. </tr>
  341. <tr>
  342. <td class="attributes">&lt;static&gt; &nbsp;</td>
  343. <td class="nameDescription">
  344. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.keys">keys</a></b>(map)
  345. </div>
  346. <div class="description">Returns all of the property names (keys) of the specified object (a map).</div>
  347. </td>
  348. </tr>
  349. <tr>
  350. <td class="attributes">&lt;static&gt; &nbsp;</td>
  351. <td class="nameDescription">
  352. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.log">log</a></b>(x, b)
  353. </div>
  354. <div class="description">Returns the logarithm with a given base value.</div>
  355. </td>
  356. </tr>
  357. <tr>
  358. <td class="attributes">&lt;static&gt; &nbsp;</td>
  359. <td class="nameDescription">
  360. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.logAdjusted">logAdjusted</a></b>(x, b)
  361. </div>
  362. <div class="description">Computes a zero-symmetric logarithm, with adjustment to values between zero
  363. and the logarithm base.</div>
  364. </td>
  365. </tr>
  366. <tr>
  367. <td class="attributes">&lt;static&gt; &nbsp;</td>
  368. <td class="nameDescription">
  369. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.logCeil">logCeil</a></b>(x, b)
  370. </div>
  371. <div class="description">Rounds an input value up according to its logarithm.</div>
  372. </td>
  373. </tr>
  374. <tr>
  375. <td class="attributes">&lt;static&gt; &nbsp;</td>
  376. <td class="nameDescription">
  377. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.logFloor">logFloor</a></b>(x, b)
  378. </div>
  379. <div class="description">Rounds an input value down according to its logarithm.</div>
  380. </td>
  381. </tr>
  382. <tr>
  383. <td class="attributes">&lt;static&gt; &nbsp;</td>
  384. <td class="nameDescription">
  385. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.logSymmetric">logSymmetric</a></b>(x, b)
  386. </div>
  387. <div class="description">Computes a zero-symmetric logarithm.</div>
  388. </td>
  389. </tr>
  390. <tr>
  391. <td class="attributes">&lt;static&gt; &nbsp;</td>
  392. <td class="nameDescription">
  393. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.max">max</a></b>(array, f)
  394. </div>
  395. <div class="description">Returns the maximum value of the specified array.</div>
  396. </td>
  397. </tr>
  398. <tr>
  399. <td class="attributes">&lt;static&gt; &nbsp;</td>
  400. <td class="nameDescription">
  401. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.mean">mean</a></b>(array, f)
  402. </div>
  403. <div class="description">Returns the arithmetic mean, or average, of the specified array.</div>
  404. </td>
  405. </tr>
  406. <tr>
  407. <td class="attributes">&lt;static&gt; &nbsp;</td>
  408. <td class="nameDescription">
  409. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.median">median</a></b>(array, f)
  410. </div>
  411. <div class="description">Returns the median of the specified array.</div>
  412. </td>
  413. </tr>
  414. <tr>
  415. <td class="attributes">&lt;static&gt; &nbsp;</td>
  416. <td class="nameDescription">
  417. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.min">min</a></b>(array, f)
  418. </div>
  419. <div class="description">Returns the minimum value of the specified array of numbers.</div>
  420. </td>
  421. </tr>
  422. <tr>
  423. <td class="attributes">&lt;static&gt; &nbsp;</td>
  424. <td class="nameDescription">
  425. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.naturalOrder">naturalOrder</a></b>(a, b)
  426. </div>
  427. <div class="description">The comparator function for natural order.</div>
  428. </td>
  429. </tr>
  430. <tr>
  431. <td class="attributes">&lt;static&gt; &nbsp;</td>
  432. <td class="nameDescription">
  433. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.nest">nest</a></b>(array)
  434. </div>
  435. <div class="description">Returns a <a href="../symbols/pv.Nest.html">pv.Nest</a> operator for the specified array.</div>
  436. </td>
  437. </tr>
  438. <tr>
  439. <td class="attributes">&lt;static&gt; &nbsp;</td>
  440. <td class="nameDescription">
  441. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.normalize">normalize</a></b>(array, f)
  442. </div>
  443. <div class="description">Returns a normalized copy of the specified array, such that the sum of the
  444. returned elements sum to one.</div>
  445. </td>
  446. </tr>
  447. <tr>
  448. <td class="attributes">&lt;static&gt; &nbsp;</td>
  449. <td class="nameDescription">
  450. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.numerate">numerate</a></b>(keys, f)
  451. </div>
  452. <div class="description">Returns a map from key to index for the specified <tt>keys</tt> array.</div>
  453. </td>
  454. </tr>
  455. <tr>
  456. <td class="attributes">&lt;static&gt; &nbsp;</td>
  457. <td class="nameDescription">
  458. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.parent">parent</a></b>()
  459. </div>
  460. <div class="description">Returns <tt>this.parent.index</tt>.</div>
  461. </td>
  462. </tr>
  463. <tr>
  464. <td class="attributes">&lt;static&gt; &nbsp;</td>
  465. <td class="nameDescription">
  466. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.permute">permute</a></b>(array, indexes, f)
  467. </div>
  468. <div class="description">Returns a permutation of the specified array, using the specified array of
  469. indexes.</div>
  470. </td>
  471. </tr>
  472. <tr>
  473. <td class="attributes">&lt;static&gt; &nbsp;</td>
  474. <td class="nameDescription">
  475. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.ramp">ramp</a></b>(start, end)
  476. </div>
  477. <div class="description">Returns a linear color ramp from the specified <tt>start</tt> color to the
  478. specified <tt>end</tt> color.</div>
  479. </td>
  480. </tr>
  481. <tr>
  482. <td class="attributes">&lt;static&gt; &nbsp;</td>
  483. <td class="nameDescription">
  484. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.random">random</a></b>(min, max, step)
  485. </div>
  486. <div class="description">Returns a random number in the range [<tt>min</tt>, <tt>max</tt>) that is a
  487. multiple of <tt>step</tt>.</div>
  488. </td>
  489. </tr>
  490. <tr>
  491. <td class="attributes">&lt;static&gt; &nbsp;</td>
  492. <td class="nameDescription">
  493. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.range">range</a></b>(start, stop, step)
  494. </div>
  495. <div class="description">Returns an array of numbers, starting at <tt>start</tt>, incrementing by
  496. <tt>step</tt>, until <tt>stop</tt> is reached.</div>
  497. </td>
  498. </tr>
  499. <tr>
  500. <td class="attributes">&lt;static&gt; &nbsp;</td>
  501. <td class="nameDescription">
  502. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.repeat">repeat</a></b>(a, n)
  503. </div>
  504. <div class="description">Concatenates the specified array with itself <i>n</i> times.</div>
  505. </td>
  506. </tr>
  507. <tr>
  508. <td class="attributes">&lt;static&gt; &nbsp;</td>
  509. <td class="nameDescription">
  510. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.reverseOrder">reverseOrder</a></b>(a, b)
  511. </div>
  512. <div class="description">The comparator function for reverse natural order.</div>
  513. </td>
  514. </tr>
  515. <tr>
  516. <td class="attributes">&lt;static&gt; &nbsp;</td>
  517. <td class="nameDescription">
  518. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.rgb">rgb</a></b>(r, g, b, a)
  519. </div>
  520. <div class="description">Constructs a new RGB color with the specified channel values.</div>
  521. </td>
  522. </tr>
  523. <tr>
  524. <td class="attributes">&lt;static&gt; &nbsp;</td>
  525. <td class="nameDescription">
  526. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.search">search</a></b>(array, value, f)
  527. </div>
  528. <div class="description">Searches the specified array of numbers for the specified value using the
  529. binary search algorithm.</div>
  530. </td>
  531. </tr>
  532. <tr>
  533. <td class="attributes">&lt;static&gt; &nbsp;</td>
  534. <td class="nameDescription">
  535. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.sum">sum</a></b>(array, f)
  536. </div>
  537. <div class="description">Returns the sum of the specified array.</div>
  538. </td>
  539. </tr>
  540. <tr>
  541. <td class="attributes">&lt;static&gt; &nbsp;</td>
  542. <td class="nameDescription">
  543. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.transpose">transpose</a></b>(arrays)
  544. </div>
  545. <div class="description">Given the specified array of arrays, <style
  546. type="text/css">sub{line-height:0}</style> transposes each element
  547. array<sub>ij</sub> with array<sub>ji</sub>.</div>
  548. </td>
  549. </tr>
  550. <tr>
  551. <td class="attributes">&lt;static&gt; &nbsp;</td>
  552. <td class="nameDescription">
  553. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.tree">tree</a></b>(array)
  554. </div>
  555. <div class="description">Returns a <a href="../symbols/pv.Tree.html">pv.Tree</a> operator for the specified array.</div>
  556. </td>
  557. </tr>
  558. <tr>
  559. <td class="attributes">&lt;static&gt; &nbsp;</td>
  560. <td class="nameDescription">
  561. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.values">values</a></b>(map)
  562. </div>
  563. <div class="description">Returns all of the values (attribute values) of the specified object (a
  564. map).</div>
  565. </td>
  566. </tr>
  567. <tr>
  568. <td class="attributes">&lt;static&gt; &nbsp;</td>
  569. <td class="nameDescription">
  570. <div class="fixedFont">pv.<b><a href="../symbols/pv.html#.vector">vector</a></b>(x, y)
  571. </div>
  572. <div class="description">Returns a <a href="../symbols/pv.Vector.html">pv.Vector</a> for the specified <i>x</i> and <i>y</i>
  573. coordinate.</div>
  574. </td>
  575. </tr>
  576. </tbody>
  577. </table>
  578. <!-- ============================== events summary ======================== -->
  579. <!-- ============================== constructor details ==================== -->
  580. <div class="details"><a name="constructor"> </a>
  581. <div class="sectionTitle">
  582. Namespace Detail
  583. </div>
  584. <div class="fixedFont">
  585. <b>pv</b>
  586. </div>
  587. <div class="description">
  588. The top-level Protovis namespace. All public methods and fields should be
  589. registered on this object. Note that core Protovis source is surrounded by an
  590. anonymous function, so any other declared globals will not be visible outside
  591. of core methods. This also allows multiple versions of Protovis to coexist,
  592. since each version will see their own <tt>pv</tt> namespace.
  593. </div>
  594. </div>
  595. <!-- ============================== field details ========================== -->
  596. <!-- ============================== method details ========================= -->
  597. <div class="sectionTitle">
  598. Method Detail
  599. </div>
  600. <a name=".blend"> </a>
  601. <div class="fixedFont">&lt;static&gt;
  602. <span class="light">{array}</span>
  603. <span class="light">pv.</span><b>blend</b>(arrays)
  604. </div>
  605. <div class="description">
  606. Given the specified array of arrays, concatenates the arrays into a single
  607. array. If the individual arrays are explicitly known, an alternative to blend
  608. is to use JavaScript's <tt>concat</tt> method directly. These two equivalent
  609. expressions:<ul>
  610. <li><tt>pv.blend([[1, 2, 3], ["a", "b", "c"]])</tt>
  611. <li><tt>[1, 2, 3].concat(["a", "b", "c"])</tt>
  612. </ul>return [1, 2, 3, "a", "b", "c"].
  613. </div>
  614. <dl class="detailList">
  615. <dt class="heading">Parameters:</dt>
  616. <dt>
  617. <span class="light fixedFont">{array[]}</span> <b>arrays</b>
  618. </dt>
  619. <dd>an array of arrays.</dd>
  620. </dl>
  621. <dl class="detailList">
  622. <dt class="heading">Returns:</dt>
  623. <dd><span class="light fixedFont">{array}</span> an array containing all the elements of each array in
  624. <tt>arrays</tt>.</dd>
  625. </dl>
  626. <hr />
  627. <a name=".child"> </a>
  628. <div class="fixedFont">&lt;static&gt;
  629. <span class="light">pv.</span><b>child</b>()
  630. </div>
  631. <div class="description">
  632. Returns <tt>this.childIndex</tt>. This method is provided for convenience for
  633. use with scales. For example, to color bars by their child index, say:
  634. <pre>.fillStyle(pv.Colors.category10().by(pv.child))</pre>
  635. This method is equivalent to <tt>function() this.childIndex</tt>, but more
  636. succinct.
  637. </div>
  638. <dl class="detailList">
  639. <dt class="heading">See:</dt>
  640. <dd>pv.Scale</dd>
  641. <dd><a href="../symbols/pv.Mark.html#childIndex">pv.Mark#childIndex</a></dd>
  642. </dl>
  643. <hr />
  644. <a name=".color"> </a>
  645. <div class="fixedFont">&lt;static&gt;
  646. <span class="light">{<a href="../symbols/pv.Color.html">pv.Color</a>}</span>
  647. <span class="light">pv.</span><b>color</b>(format)
  648. </div>
  649. <div class="description">
  650. Returns the <a href="../symbols/pv.Color.html">pv.Color</a> for the specified color format string. Colors
  651. may have an associated opacity, or alpha channel. Color formats are specified
  652. by CSS Color Modular Level 3, using either in RGB or HSL color space. For
  653. example:<ul>
  654. <li>#f00 // #rgb
  655. <li>#ff0000 // #rrggbb
  656. <li>rgb(255, 0, 0)
  657. <li>rgb(100%, 0%, 0%)
  658. <li>hsl(0, 100%, 50%)
  659. <li>rgba(0, 0, 255, 0.5)
  660. <li>hsla(120, 100%, 50%, 1)
  661. </ul>The SVG 1.0 color keywords names are also supported, such as "aliceblue"
  662. and "yellowgreen". The "transparent" keyword is supported for a
  663. fully-transparent color.
  664. <p>If the <tt>format</tt> argument is already an instance of <tt>Color</tt>,
  665. the argument is returned with no further processing.
  666. <br />
  667. <i>Defined in: </i> <a href="../symbols/src/color_Color.js.html">Color.js</a>.
  668. </div>
  669. <dl class="detailList">
  670. <dt class="heading">Parameters:</dt>
  671. <dt>
  672. <span class="light fixedFont">{string}</span> <b>format</b>
  673. </dt>
  674. <dd>the color specification string, such as "#f00".</dd>
  675. </dl>
  676. <dl class="detailList">
  677. <dt class="heading">Returns:</dt>
  678. <dd><span class="light fixedFont">{<a href="../symbols/pv.Color.html">pv.Color</a>}</span> the corresponding <tt>Color</tt>.</dd>
  679. </dl>
  680. <dl class="detailList">
  681. <dt class="heading">See:</dt>
  682. <dd><a href="http://www.w3.org/TR/SVG/types.html#ColorKeywords">SVG color
  683. keywords</a></dd>
  684. <dd><a href="http://www.w3.org/TR/css3-color/">CSS3 color module</a></dd>
  685. </dl>
  686. <hr />
  687. <a name=".colors"> </a>
  688. <div class="fixedFont">&lt;static&gt;
  689. <span class="light">{<a href="../symbols/pv.Scale.ordinal.html">pv.Scale.ordinal</a>}</span>
  690. <span class="light">pv.</span><b>colors</b>()
  691. </div>
  692. <div class="description">
  693. Returns a new categorical color encoding using the specified colors. The
  694. arguments to this method are an array of colors; see <a href="../symbols/pv.html#.color">pv.color</a>. For
  695. example, to create a categorical color encoding using the <tt>species</tt>
  696. attribute:
  697. <pre>pv.colors("red", "green", "blue").by(function(d) d.species)</pre>
  698. The result of this expression can be used as a fill- or stroke-style
  699. property. This assumes that the data's <tt>species</tt> attribute is a
  700. string.
  701. <br />
  702. <i>Defined in: </i> <a href="../symbols/src/color_Colors.js.html">Colors.js</a>.
  703. </div>
  704. <dl class="detailList">
  705. <dt class="heading">Parameters:</dt>
  706. <dt>
  707. <span class="light fixedFont">{string}</span> <b>colors...</b>
  708. </dt>
  709. <dd>categorical colors.</dd>
  710. </dl>
  711. <dl class="detailList">
  712. <dt class="heading">Returns:</dt>
  713. <dd><span class="light fixedFont">{<a href="../symbols/pv.Scale.ordinal.html">pv.Scale.ordinal</a>}</span> an ordinal color scale.</dd>
  714. </dl>
  715. <dl class="detailList">
  716. <dt class="heading">See:</dt>
  717. <dd><a href="../symbols/pv.Scale.ordinal.html">pv.Scale.ordinal</a></dd>
  718. </dl>
  719. <hr />
  720. <a name=".cross"> </a>
  721. <div class="fixedFont">&lt;static&gt;
  722. <span class="light">{array}</span>
  723. <span class="light">pv.</span><b>cross</b>(a, b)
  724. </div>
  725. <div class="description">
  726. Given two arrays <tt>a</tt> and <tt>b</tt>, <style
  727. type="text/css">sub{line-height:0}</style> returns an array of all possible
  728. pairs of elements [a<sub>i</sub>, b<sub>j</sub>]. The outer loop is on array
  729. <i>a</i>, while the inner loop is on <i>b</i>, such that the order of
  730. returned elements is [a<sub>0</sub>, b<sub>0</sub>], [a<sub>0</sub>,
  731. b<sub>1</sub>], ... [a<sub>0</sub>, b<sub>m</sub>], [a<sub>1</sub>,
  732. b<sub>0</sub>], [a<sub>1</sub>, b<sub>1</sub>], ... [a<sub>1</sub>,
  733. b<sub>m</sub>], ... [a<sub>n</sub>, b<sub>m</sub>]. If either array is empty,
  734. an empty array is returned.
  735. </div>
  736. <dl class="detailList">
  737. <dt class="heading">Parameters:</dt>
  738. <dt>
  739. <span class="light fixedFont">{array}</span> <b>a</b>
  740. </dt>
  741. <dd>an array.</dd>
  742. <dt>
  743. <span class="light fixedFont">{array}</span> <b>b</b>
  744. </dt>
  745. <dd>an array.</dd>
  746. </dl>
  747. <dl class="detailList">
  748. <dt class="heading">Returns:</dt>
  749. <dd><span class="light fixedFont">{array}</span> an array of pairs of elements in <tt>a</tt> and <tt>b</tt>.</dd>
  750. </dl>
  751. <hr />
  752. <a name=".dict"> </a>
  753. <div class="fixedFont">&lt;static&gt;
  754. <span class="light">pv.</span><b>dict</b>(keys, f)
  755. </div>
  756. <div class="description">
  757. Returns a map constructed from the specified <tt>keys</tt>, using the
  758. function <tt>f</tt> to compute the value for each key. The single argument to
  759. the value function is the key. The callback is invoked only for indexes of
  760. the array which have assigned values; it is not invoked for indexes which
  761. have been deleted or which have never been assigned values.
  762. <p>For example, this expression creates a map from strings to string length:
  763. <pre>pv.dict(["one", "three", "seventeen"], function(s) s.length)</pre>
  764. The returned value is <tt>{one: 3, three: 5, seventeen: 9}</tt>. Accessor
  765. functions can refer to <tt>this.index</tt>.
  766. </div>
  767. <dl class="detailList">
  768. <dt class="heading">Parameters:</dt>
  769. <dt>
  770. <span class="light fixedFont">{array}</span> <b>keys</b>
  771. </dt>
  772. <dd>an array.</dd>
  773. <dt>
  774. <span class="light fixedFont">{function}</span> <b>f</b>
  775. </dt>
  776. <dd>a value function.</dd>
  777. </dl>
  778. <dl class="detailList">
  779. <dt class="heading">Returns:</dt>
  780. <dd>a map from keys to values.</dd>
  781. </dl>
  782. <hr />
  783. <a name=".entries"> </a>
  784. <div class="fixedFont">&lt;static&gt;
  785. <span class="light">{array}</span>
  786. <span class="light">pv.</span><b>entries</b>(map)
  787. </div>
  788. <div class="description">
  789. Returns all of the entries (key-value pairs) of the specified object (a
  790. map). The order of the returned array is not defined. Each key-value pair is
  791. represented as an object with <tt>key</tt> and <tt>value</tt> attributes,
  792. e.g., <tt>{key: "foo", value: 42}</tt>.
  793. </div>
  794. <dl class="detailList">
  795. <dt class="heading">Parameters:</dt>
  796. <dt>
  797. <b>map</b>
  798. </dt>
  799. <dd>an object.</dd>
  800. </dl>
  801. <dl class="detailList">
  802. <dt class="heading">Returns:</dt>
  803. <dd><span class="light fixedFont">{array}</span> an array of key-value pairs corresponding to the keys.</dd>
  804. </dl>
  805. <hr />
  806. <a name=".flatten"> </a>
  807. <div class="fixedFont">&lt;static&gt;
  808. <span class="light">{<a href="../symbols/pv.Flatten.html">pv.Flatten</a>}</span>
  809. <span class="light">pv.</span><b>flatten</b>(map)
  810. </div>
  811. <div class="description">
  812. Returns a <a href="../symbols/pv.Flatten.html">pv.Flatten</a> operator for the specified map. This is a
  813. convenience factory method, equivalent to <tt>new pv.Flatten(map)</tt>.
  814. <br />
  815. <i>Defined in: </i> <a href="../symbols/src/data_Flatten.js.html">Flatten.js</a>.
  816. </div>
  817. <dl class="detailList">
  818. <dt class="heading">Parameters:</dt>
  819. <dt>
  820. <b>map</b>
  821. </dt>
  822. <dd>a map to flatten.</dd>
  823. </dl>
  824. <dl class="detailList">
  825. <dt class="heading">Returns:</dt>
  826. <dd><span class="light fixedFont">{<a href="../symbols/pv.Flatten.html">pv.Flatten</a>}</span> a flatten operator for the specified map.</dd>
  827. </dl>
  828. <dl class="detailList">
  829. <dt class="heading">See:</dt>
  830. <dd><a href="../symbols/pv.Flatten.html">pv.Flatten</a></dd>
  831. </dl>
  832. <hr />
  833. <a name=".hsl"> </a>
  834. <div class="fixedFont">&lt;static&gt;
  835. <span class="light">pv.</span><b>hsl</b>(h, s, l, a)
  836. </div>
  837. <div class="description">
  838. Constructs a new HSL color with the specified values.
  839. <br />
  840. <i>Defined in: </i> <a href="../symbols/src/color_Color.js.html">Color.js</a>.
  841. </div>
  842. <dl class="detailList">
  843. <dt class="heading">Parameters:</dt>
  844. <dt>
  845. <span class="light fixedFont">{number}</span> <b>h</b>
  846. </dt>
  847. <dd>the hue, an integer in [0, 360].</dd>
  848. <dt>
  849. <span class="light fixedFont">{number}</span> <b>s</b>
  850. </dt>
  851. <dd>the saturation, a float in [0, 1].</dd>
  852. <dt>
  853. <span class="light fixedFont">{number}</span> <b>l</b>
  854. </dt>
  855. <dd>the lightness, a float in [0, 1].</dd>
  856. <dt>
  857. <span class="light fixedFont">{number}</span> <b>a</b>
  858. <i>Optional</i>
  859. </dt>
  860. <dd>the opacity, a float in [0, 1].</dd>
  861. </dl>
  862. <dl class="detailList">
  863. <dt class="heading">Returns:</dt>
  864. <dd>pv.Color.Hsl</dd>
  865. </dl>
  866. <hr />
  867. <a name=".identity"> </a>
  868. <div class="fixedFont">&lt;static&gt;
  869. <span class="light">pv.</span><b>identity</b>(x)
  870. </div>
  871. <div class="description">
  872. Returns the passed-in argument, <tt>x</tt>; the identity function. This method
  873. is provided for convenience since it is used as the default behavior for a
  874. number of property functions.
  875. </div>
  876. <dl class="detailList">
  877. <dt class="heading">Parameters:</dt>
  878. <dt>
  879. <b>x</b>
  880. </dt>
  881. <dd>a value.</dd>
  882. </dl>
  883. <dl class="detailList">
  884. <dt class="heading">Returns:</dt>
  885. <dd>the value <tt>x</tt>.</dd>
  886. </dl>
  887. <hr />
  888. <a name=".index"> </a>
  889. <div class="fixedFont">&lt;static&gt;
  890. <span class="light">pv.</span><b>index</b>()
  891. </div>
  892. <div class="description">
  893. Returns <tt>this.index</tt>. This method is provided for convenience for use
  894. with scales. For example, to color bars by their index, say:
  895. <pre>.fillStyle(pv.Colors.category10().by(pv.index))</pre>
  896. This method is equivalent to <tt>function() this.index</tt>, but more
  897. succinct. Note that the <tt>index</tt> property is also supported for
  898. accessor functions with <a href="../symbols/pv.html#.max">pv.max</a>, <a href="../symbols/pv.html#.min">pv.min</a> and other array
  899. utility methods.
  900. </div>
  901. <dl class="detailList">
  902. <dt class="heading">See:</dt>
  903. <dd>pv.Scale</dd>
  904. <dd><a href="../symbols/pv.Mark.html#index">pv.Mark#index</a></dd>
  905. </dl>
  906. <hr />
  907. <a name=".keys"> </a>
  908. <div class="fixedFont">&lt;static&gt;
  909. <span class="light">{string[]}</span>
  910. <span class="light">pv.</span><b>keys</b>(map)
  911. </div>
  912. <div class="description">
  913. Returns all of the property names (keys) of the specified object (a map). The
  914. order of the returned array is not defined.
  915. </div>
  916. <dl class="detailList">
  917. <dt class="heading">Parameters:</dt>
  918. <dt>
  919. <b>map</b>
  920. </dt>
  921. <dd>an object.</dd>
  922. </dl>
  923. <dl class="detailList">
  924. <dt class="heading">Returns:</dt>
  925. <dd><span class="light fixedFont">{string[]}</span> an array of strings corresponding to the keys.</dd>
  926. </dl>
  927. <dl class="detailList">
  928. <dt class="heading">See:</dt>
  929. <dd><a href="#entries">#entries</a></dd>
  930. </dl>
  931. <hr />
  932. <a name=".log"> </a>
  933. <div class="fixedFont">&lt;static&gt;
  934. <span class="light">{number}</span>
  935. <span class="light">pv.</span><b>log</b>(x, b)
  936. </div>
  937. <div class="description">
  938. Returns the logarithm with a given base value.
  939. </div>
  940. <dl class="detailList">
  941. <dt class="heading">Parameters:</dt>
  942. <dt>
  943. <span class="light fixedFont">{number}</span> <b>x</b>
  944. </dt>
  945. <dd>the number for which to compute the logarithm.</dd>
  946. <dt>
  947. <span class="light fixedFont">{number}</span> <b>b</b>
  948. </dt>
  949. <dd>the base of the logarithm.</dd>
  950. </dl>
  951. <dl class="detailList">
  952. <dt class="heading">Returns:</dt>
  953. <dd><span class="light fixedFont">{number}</span> the logarithm value.</dd>
  954. </dl>
  955. <hr />
  956. <a name=".logAdjusted"> </a>
  957. <div class="fixedFont">&lt;static&gt;
  958. <span class="light">{number}</span>
  959. <span class="light">pv.</span><b>logAdjusted</b>(x, b)
  960. </div>
  961. <div class="description">
  962. Computes a zero-symmetric logarithm, with adjustment to values between zero
  963. and the logarithm base. This adjustment introduces distortion for values less
  964. than the base number, but enables simultaneous plotting of log-transformed
  965. data involving both positive and negative numbers.
  966. </div>
  967. <dl class="detailList">
  968. <dt class="heading">Parameters:</dt>
  969. <dt>
  970. <span class="light fixedFont">{number}</span> <b>x</b>
  971. </dt>
  972. <dd>the number for which to compute the logarithm.</dd>
  973. <dt>
  974. <span class="light fixedFont">{number}</span> <b>b</b>
  975. </dt>
  976. <dd>the base of the logarithm.</dd>
  977. </dl>
  978. <dl class="detailList">
  979. <dt class="heading">Returns:</dt>
  980. <dd><span class="light fixedFont">{number}</span> the adjusted, symmetric log value.</dd>
  981. </dl>
  982. <hr />
  983. <a name=".logCeil"> </a>
  984. <div class="fixedFont">&lt;static&gt;
  985. <span class="light">{number}</span>
  986. <span class="light">pv.</span><b>logCeil</b>(x, b)
  987. </div>
  988. <div class="description">
  989. Rounds an input value up according to its logarithm. The method takes the
  990. ceiling of the logarithm of the value and then uses the resulting value as an
  991. exponent for the base value.
  992. </div>
  993. <dl class="detailList">
  994. <dt class="heading">Parameters:</dt>
  995. <dt>
  996. <span class="light fixedFont">{number}</span> <b>x</b>
  997. </dt>
  998. <dd>the number for which to compute the logarithm ceiling.</dd>
  999. <dt>
  1000. <span class="light fixedFont">{number}</span> <b>b</b>
  1001. </dt>
  1002. <dd>the base of the logarithm.</dd>
  1003. </dl>
  1004. <dl class="detailList">
  1005. <dt class="heading">Returns:</dt>
  1006. <dd><span class="light fixedFont">{number}</span> the rounded-by-logarithm value.</dd>
  1007. </dl>
  1008. <hr />
  1009. <a name=".logFloor"> </a>
  1010. <div class="fixedFont">&lt;static&gt;
  1011. <span class="light">{number}</span>
  1012. <span class="light">pv.</span><b>logFloor</b>(x, b)
  1013. </div>
  1014. <div class="description">
  1015. Rounds an input value down according to its logarithm. The method takes the
  1016. floor of the logarithm of the value and then uses the resulting value as an
  1017. exponent for the base value.
  1018. </div>
  1019. <dl class="detailList">
  1020. <dt class="heading">Parameters:</dt>
  1021. <dt>
  1022. <span class="light fixedFont">{number}</span> <b>x</b>
  1023. </dt>
  1024. <dd>the number for which to compute the logarithm floor.</dd>
  1025. <dt>
  1026. <span class="light fixedFont">{number}</span> <b>b</b>
  1027. </dt>
  1028. <dd>the base of the logarithm.</dd>
  1029. </dl>
  1030. <dl class="detailList">
  1031. <dt class="heading">Returns:</dt>
  1032. <dd><span class="light fixedFont">{number}</span> the rounded-by-logarithm value.</dd>
  1033. </dl>
  1034. <hr />
  1035. <a name=".logSymmetric"> </a>
  1036. <div class="fixedFont">&lt;static&gt;
  1037. <span class="light">{number}</span>
  1038. <span class="light">pv.</span><b>logSymmetric</b>(x, b)
  1039. </div>
  1040. <div class="description">
  1041. Computes a zero-symmetric logarithm. Computes the logarithm of the absolute
  1042. value of the input, and determines the sign of the output according to the
  1043. sign of the input value.
  1044. </div>
  1045. <dl class="detailList">
  1046. <dt class="heading">Parameters:</dt>
  1047. <dt>
  1048. <span class="light fixedFont">{number}</span> <b>x</b>
  1049. </dt>
  1050. <dd>the number for which to compute the logarithm.</dd>
  1051. <dt>
  1052. <span class="light fixedFont">{number}</span> <b>b</b>
  1053. </dt>
  1054. <dd>the base of the logarithm.</dd>
  1055. </dl>
  1056. <dl class="detailList">
  1057. <dt class="heading">Returns:</dt>
  1058. <dd><span class="light fixedFont">{number}</span> the symmetric log value.</dd>
  1059. </dl>
  1060. <hr />
  1061. <a name=".max"> </a>
  1062. <div class="fixedFont">&lt;static&gt;
  1063. <span class="light">{number}</span>
  1064. <span class="light">pv.</span><b>max</b>(array, f)
  1065. </div>
  1066. <div class="description">
  1067. Returns the maximum value of the specified array. If the specified array is
  1068. not an array of numbers, an optional accessor function <tt>f</tt> can be
  1069. specified to map the elements to numbers. See <a href="#normalize">#normalize</a> for an
  1070. example. Accessor functions can refer to <tt>this.index</tt>.
  1071. </div>
  1072. <dl class="detailList">
  1073. <dt class="heading">Parameters:</dt>
  1074. <dt>
  1075. <span class="light fixedFont">{array}</span> <b>array</b>
  1076. </dt>
  1077. <dd>an array of objects, or numbers.</dd>
  1078. <dt>
  1079. <span class="light fixedFont">{function}</span> <b>f</b>
  1080. <i>Optional</i>
  1081. </dt>
  1082. <dd>an optional accessor function.</dd>
  1083. </dl>
  1084. <dl class="detailList">
  1085. <dt class="heading">Returns:</dt>
  1086. <dd><span class="light fixedFont">{number}</span> the maximum value of the specified array.</dd>
  1087. </dl>
  1088. <hr />
  1089. <a name=".mean"> </a>
  1090. <div class="fixedFont">&lt;static&gt;
  1091. <span class="light">{number}</span>
  1092. <span class="light">pv.</span><b>mean</b>(array, f)
  1093. </div>
  1094. <div class="description">
  1095. Returns the arithmetic mean, or average, of the specified array. If the
  1096. specified array is not an array of numbers, an optional accessor function
  1097. <tt>f</tt> can be specified to map the elements to numbers. See
  1098. <a href="#normalize">#normalize</a> for an example. Accessor functions can refer to
  1099. <tt>this.index</tt>.
  1100. </div>
  1101. <dl class="detailList">
  1102. <dt class="heading">Parameters:</dt>
  1103. <dt>
  1104. <span class="light fixedFont">{array}</span> <b>array</b>
  1105. </dt>
  1106. <dd>an array of objects, or numbers.</dd>
  1107. <dt>
  1108. <span class="light fixedFont">{function}</span> <b>f</b>
  1109. <i>Optional</i>
  1110. </dt>
  1111. <dd>an optional accessor function.</dd>
  1112. </dl>
  1113. <dl class="detailList">
  1114. <dt class="heading">Returns:</dt>
  1115. <dd><span class="light fixedFont">{number}</span> the mean of the specified array.</dd>
  1116. </dl>
  1117. <hr />
  1118. <a name=".median"> </a>
  1119. <div class="fixedFont">&lt;static&gt;
  1120. <span class="light">{number}</span>
  1121. <span class="light">pv.</span><b>median</b>(array, f)
  1122. </div>
  1123. <div class="description">
  1124. Returns the median of the specified array. If the specified array is not an
  1125. array of numbers, an optional accessor function <tt>f</tt> can be specified
  1126. to map the elements to numbers. See <a href="#normalize">#normalize</a> for an example.
  1127. Accessor functions can refer to <tt>this.index</tt>.
  1128. </div>
  1129. <dl class="detailList">
  1130. <dt class="heading">Parameters:</dt>
  1131. <dt>
  1132. <span class="light fixedFont">{array}</span> <b>array</b>
  1133. </dt>
  1134. <dd>an array of objects, or numbers.</dd>
  1135. <dt>
  1136. <span class="light fixedFont">{function}</span> <b>f</b>
  1137. <i>Optional</i>
  1138. </dt>
  1139. <dd>an optional accessor function.</dd>
  1140. </dl>
  1141. <dl class="detailList">
  1142. <dt class="heading">Returns:</dt>
  1143. <dd><span class="light fixedFont">{number}</span> the median of the specified array.</dd>
  1144. </dl>
  1145. <hr />
  1146. <a name=".min"> </a>
  1147. <div class="fixedFont">&lt;static&gt;
  1148. <span class="light">{number}</span>
  1149. <span class="light">pv.</span><b>min</b>(array, f)
  1150. </div>
  1151. <div class="description">
  1152. Returns the minimum value of the specified array of numbers. If the specified
  1153. array is not an array of numbers, an optional accessor function <tt>f</tt>
  1154. can be specified to map the elements to numbers. See <a href="#normalize">#normalize</a> for
  1155. an example. Accessor functions can refer to <tt>this.index</tt>.
  1156. </div>
  1157. <dl class="detailList">
  1158. <dt class="heading">Parameters:</dt>
  1159. <dt>
  1160. <span class="light fixedFont">{array}</span> <b>array</b>
  1161. </dt>
  1162. <dd>an array of objects, or numbers.</dd>
  1163. <dt>
  1164. <span class="light fixedFont">{function}</span> <b>f</b>
  1165. <i>Optional</i>
  1166. </dt>
  1167. <dd>an optional accessor function.</dd>
  1168. </dl>
  1169. <dl class="detailList">
  1170. <dt class="heading">Returns:</dt>
  1171. <dd><span class="light fixedFont">{number}</span> the minimum value of the specified array.</dd>
  1172. </dl>
  1173. <hr />
  1174. <a name=".naturalOrder"> </a>
  1175. <div class="fixedFont">&lt;static&gt;
  1176. <span class="light">{number}</span>
  1177. <span class="light">pv.</span><b>naturalOrder</b>(a, b)
  1178. </div>
  1179. <div class="description">
  1180. The comparator function for natural order. This can be used in conjunction with
  1181. the built-in array <tt>sort</tt> method to sort elements by their natural
  1182. order, ascending. Note that if no comparator function is specified to the
  1183. built-in <tt>sort</tt> method, the default order is lexicographic, <i>not</i>
  1184. natural!
  1185. </div>
  1186. <dl class="detailList">
  1187. <dt class="heading">Parameters:</dt>
  1188. <dt>
  1189. <b>a</b>
  1190. </dt>
  1191. <dd>an element to compare.</dd>
  1192. <dt>
  1193. <b>b</b>
  1194. </dt>
  1195. <dd>an element to compare.</dd>
  1196. </dl>
  1197. <dl class="detailList">
  1198. <dt class="heading">Returns:</dt>
  1199. <dd><span class="light fixedFont">{number}</span> negative if a &lt; b; positive if a &gt; b; otherwise 0.</dd>
  1200. </dl>
  1201. <dl class="detailList">
  1202. <dt class="heading">See:</dt>
  1203. <dd><a
  1204. href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/sort">Array.sort</a>.</dd>
  1205. </dl>
  1206. <hr />
  1207. <a name=".nest"> </a>
  1208. <div class="fixedFont">&lt;static&gt;
  1209. <span class="light">{<a href="../symbols/pv.Nest.html">pv.Nest</a>}</span>
  1210. <span class="light">pv.</span><b>nest</b>(array)
  1211. </div>
  1212. <div class="description">
  1213. Returns a <a href="../symbols/pv.Nest.html">pv.Nest</a> operator for the specified array. This is a
  1214. convenience factory method, equivalent to <tt>new pv.Nest(array)</tt>.
  1215. <br />
  1216. <i>Defined in: </i> <a href="../symbols/src/data_Nest.js.html">Nest.js</a>.
  1217. </div>
  1218. <dl class="detailList">
  1219. <dt class="heading">Parameters:</dt>
  1220. <dt>
  1221. <span class="light fixedFont">{array}</span> <b>array</b>
  1222. </dt>
  1223. <dd>an array of elements to nest.</dd>
  1224. </dl>
  1225. <dl class="detailList">
  1226. <dt class="heading">Returns:</dt>
  1227. <dd><span class="light fixedFont">{<a href="../symbols/pv.Nest.html">pv.Nest</a>}</span> a nest operator for the specified array.</dd>
  1228. </dl>
  1229. <dl class="detailList">
  1230. <dt class="heading">See:</dt>
  1231. <dd><a href="../symbols/pv.Nest.html">pv.Nest</a></dd>
  1232. </dl>
  1233. <hr />
  1234. <a name=".normalize"> </a>
  1235. <div class="fixedFont">&lt;static&gt;
  1236. <span class="light">{number[]}</span>
  1237. <span class="light">pv.</span><b>normalize</b>(array, f)
  1238. </div>
  1239. <div class="description">
  1240. Returns a normalized copy of the specified array, such that the sum of the
  1241. returned elements sum to one. If the specified array is not an array of
  1242. numbers, an optional accessor function <tt>f</tt> can be specified to map the
  1243. elements to numbers. For example, if <tt>array</tt> is an array of objects,
  1244. and each object has a numeric property "foo", the expression
  1245. <pre>pv.normalize(array, function(d) d.foo)</pre>
  1246. returns a normalized array on the "foo" property. If an accessor function is
  1247. not specified, the identity function is used. Accessor functions can refer to
  1248. <tt>this.index</tt>.
  1249. </div>
  1250. <dl class="detailList">
  1251. <dt class="heading">Parameters:</dt>
  1252. <dt>
  1253. <span class="light fixedFont">{array}</span> <b>array</b>
  1254. </dt>
  1255. <dd>an array of objects, or numbers.</dd>
  1256. <dt>
  1257. <span class="light fixedFont">{function}</span> <b>f</b>
  1258. <i>Optional</i>
  1259. </dt>
  1260. <dd>an optional accessor function.</dd>
  1261. </dl>
  1262. <dl class="detailList">
  1263. <dt class="heading">Returns:</dt>
  1264. <dd><span class="light fixedFont">{number[]}</span> an array of numbers that sums to one.</dd>
  1265. </dl>
  1266. <hr />
  1267. <a name=".numerate"> </a>
  1268. <div class="fixedFont">&lt;static&gt;
  1269. <span class="light">pv.</span><b>numerate</b>(keys, f)
  1270. </div>
  1271. <div class="description">
  1272. Returns a map from key to index for the specified <tt>keys</tt> array. For
  1273. example,
  1274. <pre>pv.numerate(["a", "b", "c"])</pre>
  1275. returns <tt>{a: 0, b: 1, c: 2}</tt>. Note that since JavaScript maps only
  1276. support string keys, <tt>keys</tt> must contain strings, or other values that
  1277. naturally map to distinct string values. Alternatively, an optional accessor
  1278. function <tt>f</tt> can be specified to compute the string key for the given
  1279. element. Accessor functions can refer to <tt>this.index</tt>.
  1280. </div>
  1281. <dl class="detailList">
  1282. <dt class="heading">Parameters:</dt>
  1283. <dt>
  1284. <span class="light fixedFont">{array}</span> <b>keys</b>
  1285. </dt>
  1286. <dd>an array, usually of string keys.</dd>
  1287. <dt>
  1288. <span class="light fixedFont">{function}</span> <b>f</b>
  1289. <i>Optional</i>
  1290. </dt>
  1291. <dd>an optional key function.</dd>
  1292. </dl>
  1293. <dl class="detailList">
  1294. <dt class="heading">Returns:</dt>
  1295. <dd>a map from key to index.</dd>
  1296. </dl>
  1297. <hr />
  1298. <a name=".parent"> </a>
  1299. <div class="fixedFont">&lt;static&gt;
  1300. <span class="light">pv.</span><b>parent</b>()
  1301. </div>
  1302. <div class="description">
  1303. Returns <tt>this.parent.index</tt>. This method is provided for convenience
  1304. for use with scales. This method is provided for convenience for use with
  1305. scales. For example, to color bars by their parent index, say:
  1306. <pre>.fillStyle(pv.Colors.category10().by(pv.parent))</pre>
  1307. Tthis method is equivalent to <tt>function() this.parent.index</tt>, but more
  1308. succinct.
  1309. </div>
  1310. <dl class="detailList">
  1311. <dt class="heading">See:</dt>
  1312. <dd>pv.Scale</dd>
  1313. <dd><a href="../symbols/pv.Mark.html#index">pv.Mark#index</a></dd>
  1314. </dl>
  1315. <hr />
  1316. <a name=".permute"> </a>
  1317. <div class="fixedFont">&lt;static&gt;
  1318. <span class="light">{array}</span>
  1319. <span class="light">pv.</span><b>permute</b>(array, indexes, f)
  1320. </div>
  1321. <div class="description">
  1322. Returns a permutation of the specified array, using the specified array of
  1323. indexes. The returned array contains the corresponding element in
  1324. <tt>array</tt> for each index in <tt>indexes</tt>, in order. For example,
  1325. <pre>pv.permute(["a", "b", "c"], [1, 2, 0])</pre>
  1326. returns <tt>["b", "c", "a"]</tt>. It is acceptable for the array of indexes
  1327. to be a different length from the array of elements, and for indexes to be
  1328. duplicated or omitted. The optional accessor function <tt>f</tt> can be used
  1329. to perform a simultaneous mapping of the array elements. Accessor functions
  1330. can refer to <tt>this.index</tt>.
  1331. </div>
  1332. <dl class="detailList">
  1333. <dt class="heading">Parameters:</dt>
  1334. <dt>
  1335. <span class="light fixedFont">{array}</span> <b>array</b>
  1336. </dt>
  1337. <dd>an array.</dd>
  1338. <dt>
  1339. <span class="light fixedFont">{number[]}</span> <b>indexes</b>
  1340. </dt>
  1341. <dd>an array of indexes into <tt>array</tt>.</dd>
  1342. <dt>
  1343. <span class="light fixedFont">{function}</span> <b>f</b>
  1344. <i>Optional</i>
  1345. </dt>
  1346. <dd>an optional accessor function.</dd>
  1347. </dl>
  1348. <dl class="detailList">
  1349. <dt class="heading">Returns:</dt>
  1350. <dd><span class="light fixedFont">{array}</span> an array of elements from <tt>array</tt>; a permutation.</dd>
  1351. </dl>
  1352. <hr />
  1353. <a name=".ramp"> </a>
  1354. <div class="fixedFont">&lt;static&gt;
  1355. <span class="light">{Function}</span>
  1356. <span class="light">pv.</span><b>ramp</b>(start, end)
  1357. </div>
  1358. <div class="description">
  1359. Returns a linear color ramp from the specified <tt>start</tt> color to the
  1360. specified <tt>end</tt> color. The color arguments may be specified either as
  1361. <tt>string</tt>s or as <a href="../symbols/pv.Color.html">pv.Color</a>s.
  1362. <br />
  1363. <i>Defined in: </i> <a href="../symbols/src/color_Ramp.js.html">Ramp.js</a>.
  1364. </div>
  1365. <dl class="detailList">
  1366. <dt class="heading">Parameters:</dt>
  1367. <dt>
  1368. <span class="light fixedFont">{string}</span> <b>start</b>
  1369. </dt>
  1370. <dd>the start color; may be a <tt>pv.Color</tt>.</dd>
  1371. <dt>
  1372. <span class="light fixedFont">{string}</span> <b>end</b>
  1373. </dt>
  1374. <dd>the end color; may be a <tt>pv.Color</tt>.</dd>
  1375. </dl>
  1376. <dl class="detailList">
  1377. <dt class="heading">Returns:</dt>
  1378. <dd><span class="light fixedFont">{Function}</span> a color ramp from <tt>start</tt> to <tt>end</tt>.</dd>
  1379. </dl>
  1380. <dl class="detailList">
  1381. <dt class="heading">See:</dt>
  1382. <dd><a href="../symbols/pv.Scale.linear.html">pv.Scale.linear</a></dd>
  1383. </dl>
  1384. <hr />
  1385. <a name=".random"> </a>
  1386. <div class="fixedFont">&lt;static&gt;
  1387. <span class="light">pv.</span><b>random</b>(min, max, step)
  1388. </div>
  1389. <div class="description">
  1390. Returns a random number in the range [<tt>min</tt>, <tt>max</tt>) that is a
  1391. multiple of <tt>step</tt>. More specifically, the returned number is of the
  1392. form <tt>min</tt> + <i>n</i> * <tt>step</tt>, where <i>n</i> is a nonnegative
  1393. integer. If <tt>step</tt> is not specified, it defaults to 1, returning a
  1394. random integer if <tt>min</tt> is also an integer.
  1395. </div>
  1396. <dl class="detailList">
  1397. <dt class="heading">Parameters:</dt>
  1398. <dt>
  1399. <b>min</b>
  1400. </dt>
  1401. <dd>{number} minimum value.</dd>
  1402. <dt>
  1403. <b>max</b>
  1404. <i>Optional</i>
  1405. </dt>
  1406. <dd>{number} maximum value.</dd>
  1407. <dt>
  1408. <b>step</b>
  1409. <i>Optional</i>
  1410. </dt>
  1411. <dd>{numbeR} step value.</dd>
  1412. </dl>
  1413. <hr />
  1414. <a name=".range"> </a>
  1415. <div class="fixedFont">&lt;static&gt;
  1416. <span class="light">{number[]}</span>
  1417. <span class="light">pv.</span><b>range</b>(start, stop, step)
  1418. </div>
  1419. <div class="description">
  1420. Returns an array of numbers, starting at <tt>start</tt>, incrementing by
  1421. <tt>step</tt>, until <tt>stop</tt> is reached. The stop value is exclusive. If
  1422. only a single argument is specified, this value is interpeted as the
  1423. <i>stop</i> value, with the <i>start</i> value as zero. If only two arguments
  1424. are specified, the step value is implied to be one.
  1425. <p>The method is modeled after the built-in <tt>range</tt> method from
  1426. Python. See the Python documentation for more details.
  1427. </div>
  1428. <dl class="detailList">
  1429. <dt class="heading">Parameters:</dt>
  1430. <dt>
  1431. <span class="light fixedFont">{number}</span> <b>start</b>
  1432. <i>Optional</i>
  1433. </dt>
  1434. <dd>the start value.</dd>
  1435. <dt>
  1436. <span class="light fixedFont">{number}</span> <b>stop</b>
  1437. </dt>
  1438. <dd>the stop value.</dd>
  1439. <dt>
  1440. <span class="light fixedFont">{number}</span> <b>step</b>
  1441. <i>Optional</i>
  1442. </dt>
  1443. <dd>the step value.</dd>
  1444. </dl>
  1445. <dl class="detailList">
  1446. <dt class="heading">Returns:</dt>
  1447. <dd><span class="light fixedFont">{number[]}</span> an array of numbers.</dd>
  1448. </dl>
  1449. <dl class="detailList">
  1450. <dt class="heading">See:</dt>
  1451. <dd><a href="http://docs.python.org/library/functions.html#range">Python range</a></dd>
  1452. </dl>
  1453. <hr />
  1454. <a name=".repeat"> </a>
  1455. <div class="fixedFont">&lt;static&gt;
  1456. <span class="light">{array}</span>
  1457. <span class="light">pv.</span><b>repeat</b>(a, n)
  1458. </div>
  1459. <div class="description">
  1460. Concatenates the specified array with itself <i>n</i> times. For example,
  1461. <tt>pv.repeat([1, 2])</tt> returns [1, 2, 1, 2].
  1462. </div>
  1463. <dl class="detailList">
  1464. <dt class="heading">Parameters:</dt>
  1465. <dt>
  1466. <span class="light fixedFont">{array}</span> <b>a</b>
  1467. </dt>
  1468. <dd>an array.</dd>
  1469. <dt>
  1470. <span class="light fixedFont">{number}</span> <b>n</b>
  1471. <i>Optional</i>
  1472. </dt>
  1473. <dd>the number of times to repeat; defaults to two.</dd>
  1474. </dl>
  1475. <dl class="detailList">
  1476. <dt class="heading">Returns:</dt>
  1477. <dd><span class="light fixedFont">{array}</span> an array that repeats the specified array.</dd>
  1478. </dl>
  1479. <hr />
  1480. <a name=".reverseOrder"> </a>
  1481. <div class="fixedFont">&lt;static&gt;
  1482. <span class="light">{number}</span>
  1483. <span class="light">pv.</span><b>reverseOrder</b>(a, b)
  1484. </div>
  1485. <div class="description">
  1486. The comparator function for reverse natural order. This can be used in
  1487. conjunction with the built-in array <tt>sort</tt> method to sort elements by
  1488. their natural order, descending. Note that if no comparator function is
  1489. specified to the built-in <tt>sort</tt> method, the default order is
  1490. lexicographic, <i>not</i> natural!
  1491. </div>
  1492. <dl class="detailList">
  1493. <dt class="heading">Parameters:</dt>
  1494. <dt>
  1495. <b>a</b>
  1496. </dt>
  1497. <dd>an element to compare.</dd>
  1498. <dt>
  1499. <b>b</b>
  1500. </dt>
  1501. <dd>an element to compare.</dd>
  1502. </dl>
  1503. <dl class="detailList">
  1504. <dt class="heading">Returns:</dt>
  1505. <dd><span class="light fixedFont">{number}</span> negative if a &lt; b; positive if a &gt; b; otherwise 0.</dd>
  1506. </dl>
  1507. <dl class="detailList">
  1508. <dt class="heading">See:</dt>
  1509. <dd><a href="#naturalOrder">#naturalOrder</a></dd>
  1510. </dl>
  1511. <hr />
  1512. <a name=".rgb"> </a>
  1513. <div class="fixedFont">&lt;static&gt;
  1514. <span class="light">pv.</span><b>rgb</b>(r, g, b, a)
  1515. </div>
  1516. <div class="description">
  1517. Constructs a new RGB color with the specified channel values.
  1518. <br />
  1519. <i>Defined in: </i> <a href="../symbols/src/color_Color.js.html">Color.js</a>.
  1520. </div>
  1521. <dl class="detailList">
  1522. <dt class="heading">Parameters:</dt>
  1523. <dt>
  1524. <span class="light fixedFont">{number}</span> <b>r</b>
  1525. </dt>
  1526. <dd>the red channel, an integer in [0,255].</dd>
  1527. <dt>
  1528. <span class="light fixedFont">{number}</span> <b>g</b>
  1529. </dt>
  1530. <dd>the green channel, an integer in [0,255].</dd>
  1531. <dt>
  1532. <span class="light fixedFont">{number}</span> <b>b</b>
  1533. </dt>
  1534. <dd>the blue channel, an integer in [0,255].</dd>
  1535. <dt>
  1536. <span class="light fixedFont">{number}</span> <b>a</b>
  1537. <i>Optional</i>
  1538. </dt>
  1539. <dd>the alpha channel, a float in [0,1].</dd>
  1540. </dl>
  1541. <dl class="detailList">
  1542. <dt class="heading">Returns:</dt>
  1543. <dd>pv.Color.Rgb</dd>
  1544. </dl>
  1545. <hr />
  1546. <a name=".search"> </a>
  1547. <div class="fixedFont">&lt;static&gt;
  1548. <span class="light">pv.</span><b>search</b>(array, value, f)
  1549. </div>
  1550. <div class="description">
  1551. Searches the specified array of numbers for the specified value using the
  1552. binary search algorithm. The array must be sorted (as by the <tt>sort</tt>
  1553. method) prior to making this call. If it is not sorted, the results are
  1554. undefined. If the array contains multiple elements with the specified value,
  1555. there is no guarantee which one will be found.
  1556. <p>The <i>insertion point</i> is defined as the point at which the value
  1557. would be inserted into the array: the index of the first element greater than
  1558. the value, or <tt>array.length</tt>, if all elements in the array are less
  1559. than the specified value. Note that this guarantees that the return value
  1560. will be nonnegative if and only if the value is found.
  1561. </div>
  1562. <dl class="detailList">
  1563. <dt class="heading">Parameters:</dt>
  1564. <dt>
  1565. <span class="light fixedFont">{number[]}</span> <b>array</b>
  1566. </dt>
  1567. <dd>the array to be searched.</dd>
  1568. <dt>
  1569. <span class="light fixedFont">{number}</span> <b>value</b>
  1570. </dt>
  1571. <dd>the value to be searched for.</dd>
  1572. <dt>
  1573. <span class="light fixedFont">{function}</span> <b>f</b>
  1574. <i>Optional</i>
  1575. </dt>
  1576. <dd>an optional key function.</dd>
  1577. </dl>
  1578. <dl class="detailList">
  1579. <dt class="heading">Returns:</dt>
  1580. <dd>the index of the search value, if it is contained in the array;
  1581. otherwise, (-(<i>insertion point</i>) - 1).</dd>
  1582. </dl>
  1583. <hr />
  1584. <a name=".sum"> </a>
  1585. <div class="fixedFont">&lt;static&gt;
  1586. <span class="light">{number}</span>
  1587. <span class="light">pv.</span><b>sum</b>(array, f)
  1588. </div>
  1589. <div class="description">
  1590. Returns the sum of the specified array. If the specified array is not an
  1591. array of numbers, an optional accessor function <tt>f</tt> can be specified
  1592. to map the elements to numbers. See <a href="#normalize">#normalize</a> for an example.
  1593. Accessor functions can refer to <tt>this.index</tt>.
  1594. </div>
  1595. <dl class="detailList">
  1596. <dt class="heading">Parameters:</dt>
  1597. <dt>
  1598. <span class="light fixedFont">{array}</span> <b>array</b>
  1599. </dt>
  1600. <dd>an array of objects, or numbers.</dd>
  1601. <dt>
  1602. <span class="light fixedFont">{function}</span> <b>f</b>
  1603. <i>Optional</i>
  1604. </dt>
  1605. <dd>an optional accessor function.</dd>
  1606. </dl>
  1607. <dl class="detailList">
  1608. <dt class="heading">Returns:</dt>
  1609. <dd><span class="light fixedFont">{number}</span> the sum of the specified array.</dd>
  1610. </dl>
  1611. <hr />
  1612. <a name=".transpose"> </a>
  1613. <div class="fixedFont">&lt;static&gt;
  1614. <span class="light">{array[]}</span>
  1615. <span class="light">pv.</span><b>transpose</b>(arrays)
  1616. </div>
  1617. <div class="description">
  1618. Given the specified array of arrays, <style
  1619. type="text/css">sub{line-height:0}</style> transposes each element
  1620. array<sub>ij</sub> with array<sub>ji</sub>. If the array has dimensions
  1621. <i>n</i>&times;<i>m</i>, it will have dimensions <i>m</i>&times;<i>n</i>
  1622. after this method returns. This method transposes the elements of the array
  1623. in place, mutating the array, and returning a reference to the array.
  1624. </div>
  1625. <dl class="detailList">
  1626. <dt class="heading">Parameters:</dt>
  1627. <dt>
  1628. <span class="light fixedFont">{array[]}</span> <b>arrays</b>
  1629. </dt>
  1630. <dd>an array of arrays.</dd>
  1631. </dl>
  1632. <dl class="detailList">
  1633. <dt class="heading">Returns:</dt>
  1634. <dd><span class="light fixedFont">{array[]}</span> the passed-in array, after transposing the elements.</dd>
  1635. </dl>
  1636. <hr />
  1637. <a name=".tree"> </a>
  1638. <div class="fixedFont">&lt;static&gt;
  1639. <span class="light">{<a href="../symbols/pv.Tree.html">pv.Tree</a>}</span>
  1640. <span class="light">pv.</span><b>tree</b>(array)
  1641. </div>
  1642. <div class="description">
  1643. Returns a <a href="../symbols/pv.Tree.html">pv.Tree</a> operator for the specified array. This is a
  1644. convenience factory method, equivalent to <tt>new pv.Tree(array)</tt>.
  1645. <br />
  1646. <i>Defined in: </i> <a href="../symbols/src/data_Tree.js.html">Tree.js</a>.
  1647. </div>
  1648. <dl class="detailList">
  1649. <dt class="heading">Parameters:</dt>
  1650. <dt>
  1651. <span class="light fixedFont">{array}</span> <b>array</b>
  1652. </dt>
  1653. <dd>an array from which to construct a tree.</dd>
  1654. </dl>
  1655. <dl class="detailList">
  1656. <dt class="heading">Returns:</dt>
  1657. <dd><span class="light fixedFont">{<a href="../symbols/pv.Tree.html">pv.Tree</a>}</span> a tree operator for the specified array.</dd>
  1658. </dl>
  1659. <dl class="detailList">
  1660. <dt class="heading">See:</dt>
  1661. <dd><a href="../symbols/pv.Tree.html">pv.Tree</a></dd>
  1662. </dl>
  1663. <hr />
  1664. <a name=".values"> </a>
  1665. <div class="fixedFont">&lt;static&gt;
  1666. <span class="light">{array}</span>
  1667. <span class="light">pv.</span><b>values</b>(map)
  1668. </div>
  1669. <div class="description">
  1670. Returns all of the values (attribute values) of the specified object (a
  1671. map). The order of the returned array is not defined.
  1672. </div>
  1673. <dl class="detailList">
  1674. <dt class="heading">Parameters:</dt>
  1675. <dt>
  1676. <b>map</b>
  1677. </dt>
  1678. <dd>an object.</dd>
  1679. </dl>
  1680. <dl class="detailList">
  1681. <dt class="heading">Returns:</dt>
  1682. <dd><span class="light fixedFont">{array}</span> an array of objects corresponding to the values.</dd>
  1683. </dl>
  1684. <dl class="detailList">
  1685. <dt class="heading">See:</dt>
  1686. <dd><a href="#entries">#entries</a></dd>
  1687. </dl>
  1688. <hr />
  1689. <a name=".vector"> </a>
  1690. <div class="fixedFont">&lt;static&gt;
  1691. <span class="light">{<a href="../symbols/pv.Vector.html">pv.Vector</a>}</span>
  1692. <span class="light">pv.</span><b>vector</b>(x, y)
  1693. </div>
  1694. <div class="description">
  1695. Returns a <a href="../symbols/pv.Vector.html">pv.Vector</a> for the specified <i>x</i> and <i>y</i>
  1696. coordinate. This is a convenience factory method, equivalent to <tt>new
  1697. pv.Vector(x, y)</tt>.
  1698. <br />
  1699. <i>Defined in: </i> <a href="../symbols/src/data_Vector.js.html">Vector.js</a>.
  1700. </div>
  1701. <dl class="detailList">
  1702. <dt class="heading">Parameters:</dt>
  1703. <dt>
  1704. <span class="light fixedFont">{number}</span> <b>x</b>
  1705. </dt>
  1706. <dd>the <i>x</i> coordinate.</dd>
  1707. <dt>
  1708. <span class="light fixedFont">{number}</span> <b>y</b>
  1709. </dt>
  1710. <dd>the <i>y</i> coordinate.</dd>
  1711. </dl>
  1712. <dl class="detailList">
  1713. <dt class="heading">Returns:</dt>
  1714. <dd><span class="light fixedFont">{<a href="../symbols/pv.Vector.html">pv.Vector</a>}</span> a vector for the specified coordinates.</dd>
  1715. </dl>
  1716. <dl class="detailList">
  1717. <dt class="heading">See:</dt>
  1718. <dd><a href="../symbols/pv.Vector.html">pv.Vector</a></dd>
  1719. </dl>
  1720. <!-- ============================== event details ========================= -->
  1721. <hr />
  1722. </div>
  1723. <!-- ============================== footer ================================= -->
  1724. <div class="fineprint" style="clear:both">
  1725. Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Tue Oct 06 2009 09:59:02 GMT-0700 (PDT)
  1726. </div>
  1727. </body>
  1728. </html>