diff options
Diffstat (limited to 'priv/static')
103 files changed, 32 insertions, 61869 deletions
diff --git a/priv/static/assets/alcoolog.js b/priv/static/assets/alcoolog.js new file mode 100644 index 0000000..8a04fd2 --- /dev/null +++ b/priv/static/assets/alcoolog.js @@ -0,0 +1 @@ +(()=>{})(); diff --git a/priv/static/assets/alcoolog.js.br b/priv/static/assets/alcoolog.js.br Binary files differnew file mode 100644 index 0000000..95f8136 --- /dev/null +++ b/priv/static/assets/alcoolog.js.br diff --git a/priv/static/assets/alcoolog.js.gz b/priv/static/assets/alcoolog.js.gz Binary files differnew file mode 100644 index 0000000..0cd1b70 --- /dev/null +++ b/priv/static/assets/alcoolog.js.gz diff --git a/priv/static/assets/site.css b/priv/static/assets/site.css new file mode 100644 index 0000000..6d25d3f --- /dev/null +++ b/priv/static/assets/site.css @@ -0,0 +1 @@ +/*! tailwindcss v2.2.9 | MIT License | https://tailwindcss.com*//*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */html{-webkit-text-size-adjust:100%;line-height:1.15;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji;margin:0}hr{color:inherit;height:0}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}[type=button],button{-webkit-appearance:button}legend{padding:0}progress{vertical-align:baseline}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}button{background-color:transparent;background-image:none}fieldset,ol,ul{margin:0;padding:0}ol,ul{list-style:none}html{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{font-family:inherit;line-height:inherit}*,:after,:before{border:0 solid;box-sizing:border-box}hr{border-top-width:1px}img{border-style:solid}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#a8a29e;opacity:1}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#a8a29e;opacity:1}input::placeholder,textarea::placeholder{color:#a8a29e;opacity:1}[role=button],button{cursor:pointer}table{border-collapse:collapse}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}button,input,optgroup,select,textarea{color:inherit;line-height:inherit;padding:0}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-border-opacity:1;border-color:rgba(231,229,228,var(--tw-border-opacity))}.prose{color:#44403c;max-width:65ch}.prose [class~=lead]{color:#57534e;font-size:1.25em;line-height:1.6;margin-bottom:1.2em;margin-top:1.2em}.prose a{color:#1c1917;font-weight:500;text-decoration:underline}.prose strong{color:#1c1917;font-weight:600}.prose ol[type=A]{--list-counter-style:upper-alpha}.prose ol[type=a]{--list-counter-style:lower-alpha}.prose ol[type=A s]{--list-counter-style:upper-alpha}.prose ol[type=a s]{--list-counter-style:lower-alpha}.prose ol[type=i],.prose ol[type=i s]{--list-counter-style:lower-roman}.prose ol[type="1"]{--list-counter-style:decimal}.prose ol>li{padding-left:1.75em;position:relative}.prose ol>li:before{color:#78716c;content:counter(list-item,var(--list-counter-style,decimal)) ".";font-weight:400;left:0;position:absolute}.prose ul>li{padding-left:1.75em;position:relative}.prose ul>li:before{background-color:#d6d3d1;border-radius:50%;content:"";height:.375em;left:.25em;position:absolute;top:.6875em;width:.375em}.prose hr{border-color:#e7e5e4;border-top-width:1px;margin-bottom:3em;margin-top:3em}.prose blockquote{border-left-color:#e7e5e4;border-left-width:.25rem;color:#1c1917;font-style:italic;font-weight:500;margin-bottom:1.6em;margin-top:1.6em;padding-left:1em;quotes:"\201C""\201D""\2018""\2019"}.prose blockquote p:first-of-type:before{content:open-quote}.prose blockquote p:last-of-type:after{content:close-quote}.prose h1{color:#1c1917;font-size:2.25em;font-weight:800;line-height:1.1111111;margin-bottom:.8888889em;margin-top:0}.prose h2{color:#1c1917;font-size:1.5em;font-weight:700;line-height:1.3333333;margin-bottom:1em;margin-top:2em}.prose h3{color:#1c1917;font-size:1.25em;font-weight:600;line-height:1.6;margin-bottom:.6em;margin-top:1.6em}.prose h4{color:#1c1917;font-weight:600;line-height:1.5;margin-bottom:.5em;margin-top:1.5em}.prose figure figcaption{color:#78716c;font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose code{color:#1c1917;font-size:.875em;font-weight:600}.prose code:after,.prose code:before{content:"`"}.prose a code{color:#1c1917}.prose pre{background-color:#292524;border-radius:.375rem;color:#e7e5e4;font-size:.875em;line-height:1.7142857;margin-bottom:1.7142857em;margin-top:1.7142857em;overflow-x:auto;padding:.8571429em 1.1428571em}.prose pre code{background-color:transparent;border-radius:0;border-width:0;color:inherit;font-family:inherit;font-size:inherit;font-weight:400;line-height:inherit;padding:0}.prose pre code:after,.prose pre code:before{content:none}.prose table{font-size:.875em;line-height:1.7142857;margin-bottom:2em;margin-top:2em;table-layout:auto;text-align:left;width:100%}.prose thead{border-bottom-color:#d6d3d1;border-bottom-width:1px;color:#1c1917;font-weight:600}.prose thead th{padding-bottom:.5714286em;padding-left:.5714286em;padding-right:.5714286em;vertical-align:bottom}.prose tbody tr{border-bottom-color:#e7e5e4;border-bottom-width:1px}.prose tbody tr:last-child{border-bottom-width:0}.prose tbody td{padding:.5714286em;vertical-align:top}.prose{font-size:1rem;line-height:1.75}.prose p{margin-bottom:1.25em;margin-top:1.25em}.prose figure,.prose img,.prose video{margin-bottom:2em;margin-top:2em}.prose figure>*{margin-bottom:0;margin-top:0}.prose h2 code{font-size:.875em}.prose h3 code{font-size:.9em}.prose ol,.prose ul{margin-bottom:1.25em;margin-top:1.25em}.prose li{margin-bottom:.5em;margin-top:.5em}.prose>ul>li p{margin-bottom:.75em;margin-top:.75em}.prose>ul>li>:first-child{margin-top:1.25em}.prose>ul>li>:last-child{margin-bottom:1.25em}.prose>ol>li>:first-child{margin-top:1.25em}.prose>ol>li>:last-child{margin-bottom:1.25em}.prose ol ol,.prose ol ul,.prose ul ol,.prose ul ul{margin-bottom:.75em;margin-top:.75em}.prose h2+*,.prose h3+*,.prose h4+*,.prose hr+*{margin-top:0}.prose thead th:first-child{padding-left:0}.prose thead th:last-child{padding-right:0}.prose tbody td:first-child{padding-left:0}.prose tbody td:last-child{padding-right:0}.prose>:first-child{margin-top:0}.prose>:last-child{margin-bottom:0}.prose-lg{font-size:1.125rem;line-height:1.7777778}.prose-lg p{margin-bottom:1.3333333em;margin-top:1.3333333em}.prose-lg [class~=lead]{font-size:1.2222222em;line-height:1.4545455;margin-bottom:1.0909091em;margin-top:1.0909091em}.prose-lg blockquote{margin-bottom:1.6666667em;margin-top:1.6666667em;padding-left:1em}.prose-lg h1{font-size:2.6666667em;line-height:1;margin-bottom:.8333333em;margin-top:0}.prose-lg h2{font-size:1.6666667em;line-height:1.3333333;margin-bottom:1.0666667em;margin-top:1.8666667em}.prose-lg h3{font-size:1.3333333em;line-height:1.5;margin-bottom:.6666667em;margin-top:1.6666667em}.prose-lg h4{line-height:1.5555556;margin-bottom:.4444444em;margin-top:1.7777778em}.prose-lg figure,.prose-lg img,.prose-lg video{margin-bottom:1.7777778em;margin-top:1.7777778em}.prose-lg figure>*{margin-bottom:0;margin-top:0}.prose-lg figure figcaption{font-size:.8888889em;line-height:1.5;margin-top:1em}.prose-lg code{font-size:.8888889em}.prose-lg h2 code{font-size:.8666667em}.prose-lg h3 code{font-size:.875em}.prose-lg pre{border-radius:.375rem;font-size:.8888889em;line-height:1.75;margin-bottom:2em;margin-top:2em;padding:1em 1.5em}.prose-lg ol,.prose-lg ul{margin-bottom:1.3333333em;margin-top:1.3333333em}.prose-lg li{margin-bottom:.6666667em;margin-top:.6666667em}.prose-lg ol>li{padding-left:1.6666667em}.prose-lg ol>li:before{left:0}.prose-lg ul>li{padding-left:1.6666667em}.prose-lg ul>li:before{height:.3333333em;left:.2222222em;top:.72222em;width:.3333333em}.prose-lg>ul>li p{margin-bottom:.8888889em;margin-top:.8888889em}.prose-lg>ul>li>:first-child{margin-top:1.3333333em}.prose-lg>ul>li>:last-child{margin-bottom:1.3333333em}.prose-lg>ol>li>:first-child{margin-top:1.3333333em}.prose-lg>ol>li>:last-child{margin-bottom:1.3333333em}.prose-lg ol ol,.prose-lg ol ul,.prose-lg ul ol,.prose-lg ul ul{margin-bottom:.8888889em;margin-top:.8888889em}.prose-lg hr{margin-bottom:3.1111111em;margin-top:3.1111111em}.prose-lg h2+*,.prose-lg h3+*,.prose-lg h4+*,.prose-lg hr+*{margin-top:0}.prose-lg table{font-size:.8888889em;line-height:1.5}.prose-lg thead th{padding-bottom:.75em;padding-left:.75em;padding-right:.75em}.prose-lg thead th:first-child{padding-left:0}.prose-lg thead th:last-child{padding-right:0}.prose-lg tbody td{padding:.75em}.prose-lg tbody td:first-child{padding-left:0}.prose-lg tbody td:last-child{padding-right:0}.prose-lg>:first-child{margin-top:0}.prose-lg>:last-child{margin-bottom:0}.static{position:static}.absolute{position:absolute}.relative{position:relative}.right-0{right:0}.col-span-1{grid-column:span 1/span 1}.m-4{margin:1rem}.mx-auto{margin-left:auto;margin-right:auto}.-my-2{margin-bottom:-.5rem;margin-top:-.5rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-12{margin-top:3rem}.mt-24{margin-top:6rem}.-mt-32{margin-top:-8rem}.-mr-2{margin-right:-.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-10{margin-left:2.5rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-10{height:2.5rem}.h-16{height:4rem}.w-1{width:.25rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-10{width:2.5rem}.w-48{width:12rem}.w-auto{width:auto}.w-full{width:100%}.min-w-full{min-width:100%}.max-w-xs{max-width:20rem}.max-w-7xl{max-width:80rem}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.origin-top-right{transform-origin:top right}.transform{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;transform:translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-95{--tw-scale-x:.95;--tw-scale-y:.95}.scale-100{--tw-scale-x:1;--tw-scale-y:1}@-webkit-keyframes spin{to{transform:rotate(1turn)}}@keyframes spin{to{transform:rotate(1turn)}}@-webkit-keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}@keyframes bounce{0%,to{-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}.list-outside{list-style-position:outside}.list-decimal{list-style-type:decimal}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.content-center{align-content:center}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.75rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.75rem*var(--tw-space-x-reverse))}.space-x-6>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1.5rem*var(--tw-space-x-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgba(231,229,228,var(--tw-divide-opacity))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded-md{border-radius:.375rem}.rounded-lg{border-radius:.5rem}.rounded-full{border-radius:9999px}.border-2{border-width:2px}.border-t{border-top-width:1px}.border-r{border-right-width:1px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-transparent{border-color:transparent}.border-gray-200{--tw-border-opacity:1;border-color:rgba(231,229,228,var(--tw-border-opacity))}.border-gray-700{--tw-border-opacity:1;border-color:rgba(68,64,60,var(--tw-border-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgba(250,250,249,var(--tw-bg-opacity))}.bg-gray-800{--tw-bg-opacity:1;background-color:rgba(41,37,36,var(--tw-bg-opacity))}.bg-gray-900{--tw-bg-opacity:1;background-color:rgba(28,25,23,var(--tw-bg-opacity))}.bg-red-50{--tw-bg-opacity:1;background-color:rgba(255,241,242,var(--tw-bg-opacity))}.hover\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgba(245,245,244,var(--tw-bg-opacity))}.focus\:bg-gray-700:focus,.hover\:bg-gray-700:hover{--tw-bg-opacity:1;background-color:rgba(68,64,60,var(--tw-bg-opacity))}.focus\:bg-indigo-50:focus{--tw-bg-opacity:1;background-color:rgba(238,242,255,var(--tw-bg-opacity))}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0{padding-bottom:0;padding-top:0}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-4{padding-bottom:1rem;padding-top:1rem}.py-6{padding-bottom:1.5rem;padding-top:1.5rem}.py-10{padding-bottom:2.5rem;padding-top:2.5rem}.py-0\.5{padding-bottom:.125rem;padding-top:.125rem}.pt-4{padding-top:1rem}.pb-3{padding-bottom:.75rem}.pb-12{padding-bottom:3rem}.pb-32{padding-bottom:8rem}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.text-xs{font-size:.75rem;line-height:1rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.font-thin{font-weight:100}.font-medium{font-weight:500}.font-semibold{font-weight:600}.font-bold{font-weight:700}.uppercase{text-transform:uppercase}.leading-4{line-height:1rem}.leading-5{line-height:1.25rem}.leading-8{line-height:2rem}.leading-9{line-height:2.25rem}.leading-none{line-height:1}.leading-loose{line-height:2}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.text-white{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity:1;color:rgba(214,211,209,var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity:1;color:rgba(168,162,158,var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgba(120,113,108,var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgba(87,83,78,var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgba(68,64,60,var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgba(28,25,23,var(--tw-text-opacity))}.text-red-400{--tw-text-opacity:1;color:rgba(251,113,133,var(--tw-text-opacity))}.text-red-800{--tw-text-opacity:1;color:rgba(159,18,57,var(--tw-text-opacity))}.hover\:text-white:hover{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.hover\:text-gray-600:hover{--tw-text-opacity:1;color:rgba(87,83,78,var(--tw-text-opacity))}.hover\:text-gray-700:hover{--tw-text-opacity:1;color:rgba(68,64,60,var(--tw-text-opacity))}.focus\:text-white:focus{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.focus\:text-indigo-600:focus{--tw-text-opacity:1;color:rgba(79,70,229,var(--tw-text-opacity))}.opacity-0{opacity:0}.opacity-100{opacity:1}*,:after,:before{--tw-shadow:0 0 #0000}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,0.05)}.shadow,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,0.1),0 1px 2px 0 rgba(0,0,0,0.06)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,0.1),0 4px 6px -2px rgba(0,0,0,0.05);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}*,:after,:before{--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000}.filter{--tw-blur:var(--tw-empty,/*!*/ /*!*/);--tw-brightness:var(--tw-empty,/*!*/ /*!*/);--tw-contrast:var(--tw-empty,/*!*/ /*!*/);--tw-grayscale:var(--tw-empty,/*!*/ /*!*/);--tw-hue-rotate:var(--tw-empty,/*!*/ /*!*/);--tw-invert:var(--tw-empty,/*!*/ /*!*/);--tw-saturate:var(--tw-empty,/*!*/ /*!*/);--tw-sepia:var(--tw-empty,/*!*/ /*!*/);--tw-drop-shadow:var(--tw-empty,/*!*/ /*!*/);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-duration:.15s;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-75{transition-duration:75ms}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@media (min-width:640px){.sm\:-mx-6{margin-left:-1.5rem;margin-right:-1.5rem}.sm\:block{display:block}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.sm\:gap-6{gap:1.5rem}.sm\:rounded-lg{border-radius:.5rem}.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-3{padding-left:.75rem;padding-right:.75rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}}@media (min-width:768px){.md\:ml-6{margin-left:1.5rem}.md\:block{display:block}.md\:hidden{display:none}}@media (min-width:1024px){.lg\:-mx-8{margin-left:-2rem;margin-right:-2rem}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.lg\:px-8{padding-left:2rem;padding-right:2rem}}
\ No newline at end of file diff --git a/priv/static/assets/site.css.br b/priv/static/assets/site.css.br Binary files differnew file mode 100644 index 0000000..fee2dc3 --- /dev/null +++ b/priv/static/assets/site.css.br diff --git a/priv/static/assets/site.css.gz b/priv/static/assets/site.css.gz Binary files differnew file mode 100644 index 0000000..9ae5119 --- /dev/null +++ b/priv/static/assets/site.css.gz diff --git a/priv/static/assets/site.js b/priv/static/assets/site.js new file mode 100644 index 0000000..971f9fa --- /dev/null +++ b/priv/static/assets/site.js @@ -0,0 +1,30 @@ +(()=>{(function(){if(window.Reflect===void 0||window.customElements===void 0||window.customElements.polyfillWrapFlushCallback)return;let r=HTMLElement,e={HTMLElement:function(){return Reflect.construct(r,[],this.constructor)}};window.HTMLElement=e.HTMLElement,HTMLElement.prototype=r.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,r)})();var Z=new WeakMap;function dt(r){let e=r instanceof Element?r:r instanceof Node?r.parentElement:null,t=e?e.closest("input, button"):null;return(t==null?void 0:t.type)=="submit"?t:null}function ft(r){let e=dt(r.target);e&&e.form&&Z.set(e.form,e)}(function(){"SubmitEvent"in window||(addEventListener("click",ft,!0),Object.defineProperty(Event.prototype,"submitter",{get(){if(this.type=="submit"&&this.target instanceof HTMLFormElement)return Z.get(this.target)}}))})();var w;(function(r){r.eager="eager",r.lazy="lazy"})(w||(w={}));var v=class extends HTMLElement{constructor(){super();this.loaded=Promise.resolve(),this.delegate=new v.delegateConstructor(this)}static get observedAttributes(){return["disabled","loading","src"]}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){let{src:e}=this;this.src=null,this.src=e}attributeChangedCallback(e){e=="loading"?this.delegate.loadingStyleChanged():e=="src"?this.delegate.sourceURLChanged():this.delegate.disabledChanged()}get src(){return this.getAttribute("src")}set src(e){e?this.setAttribute("src",e):this.removeAttribute("src")}get loading(){return pt(this.getAttribute("loading")||"")}set loading(e){e?this.setAttribute("loading",e):this.removeAttribute("loading")}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get autoscroll(){return this.hasAttribute("autoscroll")}set autoscroll(e){e?this.setAttribute("autoscroll",""):this.removeAttribute("autoscroll")}get complete(){return!this.delegate.isLoading}get isActive(){return this.ownerDocument===document&&!this.isPreview}get isPreview(){var e,t;return(t=(e=this.ownerDocument)===null||e===void 0?void 0:e.documentElement)===null||t===void 0?void 0:t.hasAttribute("data-turbo-preview")}};function pt(r){switch(r.toLowerCase()){case"lazy":return w.lazy;default:return w.eager}}function m(r){return new URL(r.toString(),document.baseURI)}function P(r){let e;if(r.hash)return r.hash.slice(1);if(e=r.href.match(/#(.*)$/))return e[1]}function mt(r){return(wt(r).match(/\.[^.]*$/)||[])[0]||""}function gt(r){return!!mt(r).match(/^(?:|\.(?:htm|html|xhtml))$/)}function vt(r,e){let t=Et(e);return r.href===m(t).href||r.href.startsWith(t)}function _(r){let e=P(r);return e!=null?r.href.slice(0,-(e.length+1)):r.href}function F(r){return _(r)}function bt(r,e){return m(r).href==m(e).href}function yt(r){return r.pathname.split("/").slice(1)}function wt(r){return yt(r).slice(-1)[0]}function Et(r){return St(r.origin+r.pathname)}function St(r){return r.endsWith("/")?r:r+"/"}var W=class{constructor(e){this.response=e}get succeeded(){return this.response.ok}get failed(){return!this.succeeded}get clientError(){return this.statusCode>=400&&this.statusCode<=499}get serverError(){return this.statusCode>=500&&this.statusCode<=599}get redirected(){return this.response.redirected}get location(){return m(this.response.url)}get isHTML(){return this.contentType&&this.contentType.match(/^(?:text\/([^\s;,]+\b)?html|application\/xhtml\+xml)\b/)}get statusCode(){return this.response.status}get contentType(){return this.header("Content-Type")}get responseText(){return this.response.text()}get responseHTML(){return this.isHTML?this.response.text():Promise.resolve(void 0)}header(e){return this.response.headers.get(e)}};function u(r,{target:e,cancelable:t,detail:n}={}){let i=new CustomEvent(r,{cancelable:t,bubbles:!0,detail:n});return(e||document.documentElement).dispatchEvent(i),i}function B(){return new Promise(r=>requestAnimationFrame(()=>r()))}function At(){return new Promise(r=>setTimeout(()=>r(),0))}function Pt(){return Promise.resolve()}function ee(r=""){return new DOMParser().parseFromString(r,"text/html")}function te(r,...e){let t=Lt(r,e).replace(/^\n/,"").split(` +`),n=t[0].match(/^\s+/),i=n?n[0].length:0;return t.map(s=>s.slice(i)).join(` +`)}function Lt(r,e){return r.reduce((t,n,i)=>{let s=e[i]==null?"":e[i];return t+n+s},"")}function k(){return Array.apply(null,{length:36}).map((r,e)=>e==8||e==13||e==18||e==23?"-":e==14?"4":e==19?(Math.floor(Math.random()*4)+8).toString(16):Math.floor(Math.random()*15).toString(16)).join("")}var h;(function(r){r[r.get=0]="get",r[r.post=1]="post",r[r.put=2]="put",r[r.patch=3]="patch",r[r.delete=4]="delete"})(h||(h={}));function Tt(r){switch(r.toLowerCase()){case"get":return h.get;case"post":return h.post;case"put":return h.put;case"patch":return h.patch;case"delete":return h.delete}}var I=class{constructor(e,t,n,i=new URLSearchParams){this.abortController=new AbortController,this.resolveRequestPromise=s=>{},this.delegate=e,this.method=t,this.headers=this.defaultHeaders,this.isIdempotent?this.url=Ct(n,[...i.entries()]):(this.body=i,this.url=n)}get location(){return this.url}get params(){return this.url.searchParams}get entries(){return this.body?Array.from(this.body.entries()):[]}cancel(){this.abortController.abort()}async perform(){var e,t;let{fetchOptions:n}=this;(t=(e=this.delegate).prepareHeadersForRequest)===null||t===void 0||t.call(e,this.headers,this),await this.allowRequestToBeIntercepted(n);try{this.delegate.requestStarted(this);let i=await fetch(this.url.href,n);return await this.receive(i)}catch(i){if(i.name!=="AbortError")throw this.delegate.requestErrored(this,i),i}finally{this.delegate.requestFinished(this)}}async receive(e){let t=new W(e);return u("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:t}}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,t):t.succeeded?this.delegate.requestSucceededWithResponse(this,t):this.delegate.requestFailedWithResponse(this,t),t}get fetchOptions(){var e;return{method:h[this.method].toUpperCase(),credentials:"same-origin",headers:this.headers,redirect:"follow",body:this.body,signal:this.abortSignal,referrer:(e=this.delegate.referrer)===null||e===void 0?void 0:e.href}}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isIdempotent(){return this.method==h.get}get abortSignal(){return this.abortController.signal}async allowRequestToBeIntercepted(e){let t=new Promise(i=>this.resolveRequestPromise=i);u("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:e,url:this.url.href,resume:this.resolveRequestPromise}}).defaultPrevented&&await t}};function Ct(r,e){let t=new URLSearchParams(r.search);for(let[n,i]of e)i instanceof File||(t.has(n)?(t.delete(n),r.searchParams.set(n,i)):r.searchParams.append(n,i));return r}var re=class{constructor(e,t){this.started=!1,this.intersect=n=>{let i=n.slice(-1)[0];(i==null?void 0:i.isIntersecting)&&this.delegate.elementAppearedInViewport(this.element)},this.delegate=e,this.element=t,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&&(this.started=!1,this.intersectionObserver.unobserve(this.element))}},L=class{constructor(e){this.templateElement=document.createElement("template"),this.templateElement.innerHTML=e}static wrap(e){return typeof e=="string"?new this(e):e}get fragment(){let e=document.createDocumentFragment();for(let t of this.foreignElements)e.appendChild(document.importNode(t,!0));return e}get foreignElements(){return this.templateChildren.reduce((e,t)=>t.tagName.toLowerCase()=="turbo-stream"?[...e,t]:e,[])}get templateChildren(){return Array.from(this.templateElement.content.children)}};L.contentType="text/vnd.turbo-stream.html";var E;(function(r){r[r.initialized=0]="initialized",r[r.requesting=1]="requesting",r[r.waiting=2]="waiting",r[r.receiving=3]="receiving",r[r.stopping=4]="stopping",r[r.stopped=5]="stopped"})(E||(E={}));var S;(function(r){r.urlEncoded="application/x-www-form-urlencoded",r.multipart="multipart/form-data",r.plain="text/plain"})(S||(S={}));function Ot(r){switch(r.toLowerCase()){case S.multipart:return S.multipart;case S.plain:return S.plain;default:return S.urlEncoded}}var U=class{constructor(e,t,n,i=!1){this.state=E.initialized,this.delegate=e,this.formElement=t,this.submitter=n,this.formData=Rt(t,n),this.fetchRequest=new I(this,this.method,this.location,this.body),this.mustRedirect=i}get method(){var e;let t=((e=this.submitter)===null||e===void 0?void 0:e.getAttribute("formmethod"))||this.formElement.getAttribute("method")||"";return Tt(t.toLowerCase())||h.get}get action(){var e;let t=typeof this.formElement.action=="string"?this.formElement.action:null;return((e=this.submitter)===null||e===void 0?void 0:e.getAttribute("formaction"))||this.formElement.getAttribute("action")||t||""}get location(){return m(this.action)}get body(){return this.enctype==S.urlEncoded||this.method==h.get?new URLSearchParams(this.stringFormData):this.formData}get enctype(){var e;return Ot(((e=this.submitter)===null||e===void 0?void 0:e.getAttribute("formenctype"))||this.formElement.enctype)}get isIdempotent(){return this.fetchRequest.isIdempotent}get stringFormData(){return[...this.formData].reduce((e,[t,n])=>e.concat(typeof n=="string"?[[t,n]]:[]),[])}async start(){let{initialized:e,requesting:t}=E;if(this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){let{stopping:e,stopped:t}=E;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareHeadersForRequest(e,t){if(!t.isIdempotent){let n=kt(ne("csrf-param"))||ne("csrf-token");n&&(e["X-CSRF-Token"]=n),e.Accept=[L.contentType,e.Accept].join(", ")}}requestStarted(e){this.state=E.waiting,u("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError)this.delegate.formSubmissionFailedWithResponse(this,t);else if(this.requestMustRedirect(e)&&Mt(t)){let n=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,n)}else this.state=E.receiving,this.result={success:!0,fetchResponse:t},this.delegate.formSubmissionSucceededWithResponse(this,t)}requestFailedWithResponse(e,t){this.result={success:!1,fetchResponse:t},this.delegate.formSubmissionFailedWithResponse(this,t)}requestErrored(e,t){this.result={success:!1,error:t},this.delegate.formSubmissionErrored(this,t)}requestFinished(e){this.state=E.stopped,u("turbo:submit-end",{target:this.formElement,detail:Object.assign({formSubmission:this},this.result)}),this.delegate.formSubmissionFinished(this)}requestMustRedirect(e){return!e.isIdempotent&&this.mustRedirect}};function Rt(r,e){let t=new FormData(r),n=e==null?void 0:e.getAttribute("name"),i=e==null?void 0:e.getAttribute("value");return n&&i!=null&&t.get(n)!=i&&t.append(n,i),t}function kt(r){if(r!=null){let t=(document.cookie?document.cookie.split("; "):[]).find(n=>n.startsWith(r));if(t){let n=t.split("=").slice(1).join("=");return n?decodeURIComponent(n):void 0}}}function ne(r){let e=document.querySelector(`meta[name="${r}"]`);return e&&e.content}function Mt(r){return r.statusCode==200&&!r.redirected}var M=class{constructor(e){this.element=e}get children(){return[...this.element.children]}hasAnchor(e){return this.getElementForAnchor(e)!=null}getElementForAnchor(e){return e?this.element.querySelector(`[id='${e}'], a[name='${e}']`):null}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){return this.element.querySelector("[autofocus]")}get permanentElements(){return[...this.element.querySelectorAll("[id][data-turbo-permanent]")]}getPermanentElementById(e){return this.element.querySelector(`#${e}[data-turbo-permanent]`)}getPermanentElementMapForSnapshot(e){let t={};for(let n of this.permanentElements){let{id:i}=n,s=e.getPermanentElementById(i);s&&(t[i]=[n,s])}return t}},K=class{constructor(e,t){this.submitBubbled=n=>{if(n.target instanceof HTMLFormElement){let i=n.target,s=n.submitter||void 0;this.delegate.shouldInterceptFormSubmission(i,s)&&(n.preventDefault(),n.stopImmediatePropagation(),this.delegate.formSubmissionIntercepted(i,s))}},this.delegate=e,this.element=t}start(){this.element.addEventListener("submit",this.submitBubbled)}stop(){this.element.removeEventListener("submit",this.submitBubbled)}},z=class{constructor(e,t){this.resolveRenderPromise=n=>{},this.resolveInterceptionPromise=n=>{},this.delegate=e,this.element=t}scrollToAnchor(e){let t=this.snapshot.getElementForAnchor(e);t?(this.scrollToElement(t),this.focusElement(t)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(e){this.scrollToAnchor(P(e))}scrollToElement(e){e.scrollIntoView()}focusElement(e){e instanceof HTMLElement&&(e.hasAttribute("tabindex")?e.focus():(e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")))}scrollToPosition({x:e,y:t}){this.scrollRoot.scrollTo(e,t)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}async render(e){let{isPreview:t,shouldRender:n,newSnapshot:i}=e;if(n)try{this.renderPromise=new Promise(c=>this.resolveRenderPromise=c),this.renderer=e,this.prepareToRenderSnapshot(e);let s=new Promise(c=>this.resolveInterceptionPromise=c);this.delegate.allowsImmediateRender(i,this.resolveInterceptionPromise)||await s,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(i,t),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.resolveRenderPromise(void 0),delete this.renderPromise}else this.invalidate()}invalidate(){this.delegate.viewInvalidated()}prepareToRenderSnapshot(e){this.markAsPreview(e.isPreview),e.prepareToRender()}markAsPreview(e){e?this.element.setAttribute("data-turbo-preview",""):this.element.removeAttribute("data-turbo-preview")}async renderSnapshot(e){await e.render()}finishRenderingSnapshot(e){e.finishRendering()}},ie=class extends z{invalidate(){this.element.innerHTML=""}get snapshot(){return new M(this.element)}},$=class{constructor(e,t){this.clickBubbled=n=>{this.respondsToEventTarget(n.target)?this.clickEvent=n:delete this.clickEvent},this.linkClicked=n=>{this.clickEvent&&this.respondsToEventTarget(n.target)&&n.target instanceof Element&&this.delegate.shouldInterceptLinkClick(n.target,n.detail.url)&&(this.clickEvent.preventDefault(),n.preventDefault(),this.delegate.linkClickIntercepted(n.target,n.detail.url)),delete this.clickEvent},this.willVisit=()=>{delete this.clickEvent},this.delegate=e,this.element=t}start(){this.element.addEventListener("click",this.clickBubbled),document.addEventListener("turbo:click",this.linkClicked),document.addEventListener("turbo:before-visit",this.willVisit)}stop(){this.element.removeEventListener("click",this.clickBubbled),document.removeEventListener("turbo:click",this.linkClicked),document.removeEventListener("turbo:before-visit",this.willVisit)}respondsToEventTarget(e){let t=e instanceof Element?e:e instanceof Node?e.parentElement:null;return t&&t.closest("turbo-frame, html")==this.element}},se=class{constructor(e){this.permanentElementMap=e}static preservingPermanentElements(e,t){let n=new this(e);n.enter(),t(),n.leave()}enter(){for(let e in this.permanentElementMap){let[,t]=this.permanentElementMap[e];this.replaceNewPermanentElementWithPlaceholder(t)}}leave(){for(let e in this.permanentElementMap){let[t]=this.permanentElementMap[e];this.replaceCurrentPermanentElementWithClone(t),this.replacePlaceholderWithPermanentElement(t)}}replaceNewPermanentElementWithPlaceholder(e){let t=xt(e);e.replaceWith(t)}replaceCurrentPermanentElementWithClone(e){let t=e.cloneNode(!0);e.replaceWith(t)}replacePlaceholderWithPermanentElement(e){let t=this.getPlaceholderById(e.id);t==null||t.replaceWith(e)}getPlaceholderById(e){return this.placeholders.find(t=>t.content==e)}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}};function xt(r){let e=document.createElement("meta");return e.setAttribute("name","turbo-permanent-placeholder"),e.setAttribute("content",r.id),e}var N=class{constructor(e,t,n){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=n,this.promise=new Promise((i,s)=>this.resolvingFunctions={resolve:i,reject:s})}get shouldRender(){return!0}prepareToRender(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}createScriptElement(e){if(e.getAttribute("data-turbo-eval")=="false")return e;{let t=document.createElement("script");return this.cspNonce&&(t.nonce=this.cspNonce),t.textContent=e.textContent,t.async=!1,Ft(t,e),t}}preservingPermanentElements(e){se.preservingPermanentElements(this.permanentElementMap,e)}focusFirstAutofocusableElement(){let e=this.connectedSnapshot.firstAutofocusableElement;Bt(e)&&e.focus()}get connectedSnapshot(){return this.newSnapshot.isConnected?this.newSnapshot:this.currentSnapshot}get currentElement(){return this.currentSnapshot.element}get newElement(){return this.newSnapshot.element}get permanentElementMap(){return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot)}get cspNonce(){var e;return(e=document.head.querySelector('meta[name="csp-nonce"]'))===null||e===void 0?void 0:e.getAttribute("content")}};function Ft(r,e){for(let{name:t,value:n}of[...e.attributes])r.setAttribute(t,n)}function Bt(r){return r&&typeof r.focus=="function"}var oe=class extends N{get shouldRender(){return!0}async render(){await B(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await B(),this.focusFirstAutofocusableElement(),await B(),this.activateScriptElements()}loadFrameElement(){var e;let t=document.createRange();t.selectNodeContents(this.currentElement),t.deleteContents();let n=this.newElement,i=(e=n.ownerDocument)===null||e===void 0?void 0:e.createRange();i&&(i.selectNodeContents(n),this.currentElement.appendChild(i.extractContents()))}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){let e=this.currentElement.firstElementChild,t=It(this.currentElement.getAttribute("data-autoscroll-block"),"end");if(e)return e.scrollIntoView({block:t}),!0}return!1}activateScriptElements(){for(let e of this.newScriptElements){let t=this.createScriptElement(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}};function It(r,e){return r=="end"||r=="start"||r=="center"||r=="nearest"?r:e}var g=class{constructor(){this.hiding=!1,this.value=0,this.visible=!1,this.trickle=()=>{this.setValue(this.value+Math.random()/100)},this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}static get defaultCSS(){return te` + .turbo-progress-bar { + position: fixed; + display: block; + top: 0; + left: 0; + height: 3px; + background: #0076ff; + z-index: 9999; + transition: + width ${g.animationDuration}ms ease-out, + opacity ${g.animationDuration/2}ms ${g.animationDuration/2}ms ease-in; + transform: translate3d(0, 0, 0); + } + `}show(){this.visible||(this.visible=!0,this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement(()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1}))}setValue(e){this.value=e,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(e){this.progressElement.style.opacity="0",setTimeout(e,g.animationDuration*1.5)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,g.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}refresh(){requestAnimationFrame(()=>{this.progressElement.style.width=`${10+this.value*90}%`})}createStylesheetElement(){let e=document.createElement("style");return e.type="text/css",e.textContent=g.defaultCSS,e}createProgressElement(){let e=document.createElement("div");return e.className="turbo-progress-bar",e}};g.animationDuration=300;var ae=class extends M{constructor(){super(...arguments);this.detailsByOuterHTML=this.children.filter(e=>!jt(e)).reduce((e,t)=>{let{outerHTML:n}=t,i=n in e?e[n]:{type:Nt(t),tracked:qt(t),elements:[]};return Object.assign(Object.assign({},e),{[n]:Object.assign(Object.assign({},i),{elements:[...i.elements,t]})})},{})}get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter(e=>this.detailsByOuterHTML[e].tracked).join("")}getScriptElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("script",e)}getStylesheetElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("stylesheet",e)}getElementsMatchingTypeNotInSnapshot(e,t){return Object.keys(this.detailsByOuterHTML).filter(n=>!(n in t.detailsByOuterHTML)).map(n=>this.detailsByOuterHTML[n]).filter(({type:n})=>n==e).map(({elements:[n]})=>n)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((e,t)=>{let{type:n,tracked:i,elements:s}=this.detailsByOuterHTML[t];return n==null&&!i?[...e,...s]:s.length>1?[...e,...s.slice(1)]:e},[])}getMetaValue(e){let t=this.findMetaElementByName(e);return t?t.getAttribute("content"):null}findMetaElementByName(e){return Object.keys(this.detailsByOuterHTML).reduce((t,n)=>{let{elements:[i]}=this.detailsByOuterHTML[n];return Ht(i,e)?i:t},void 0)}};function Nt(r){if(Vt(r))return"script";if(Dt(r))return"stylesheet"}function qt(r){return r.getAttribute("data-turbo-track")=="reload"}function Vt(r){return r.tagName.toLowerCase()=="script"}function jt(r){return r.tagName.toLowerCase()=="noscript"}function Dt(r){let e=r.tagName.toLowerCase();return e=="style"||e=="link"&&r.getAttribute("rel")=="stylesheet"}function Ht(r,e){return r.tagName.toLowerCase()=="meta"&&r.getAttribute("name")==e}var b=class extends M{constructor(e,t){super(e);this.headSnapshot=t}static fromHTMLString(e=""){return this.fromDocument(ee(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({head:e,body:t}){return new this(t,new ae(e))}clone(){return new b(this.element.cloneNode(!0),this.headSnapshot)}get headElement(){return this.headSnapshot.element}get rootLocation(){var e;let t=(e=this.getSetting("root"))!==null&&e!==void 0?e:"/";return m(t)}get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return this.cacheControlValue!="no-preview"}get isCacheable(){return this.cacheControlValue!="no-cache"}get isVisitable(){return this.getSetting("visit-control")!="reload"}getSetting(e){return this.headSnapshot.getMetaValue(`turbo-${e}`)}},T;(function(r){r.visitStart="visitStart",r.requestStart="requestStart",r.requestEnd="requestEnd",r.visitEnd="visitEnd"})(T||(T={}));var p;(function(r){r.initialized="initialized",r.started="started",r.canceled="canceled",r.failed="failed",r.completed="completed"})(p||(p={}));var _t={action:"advance",historyChanged:!1},A;(function(r){r[r.networkFailure=0]="networkFailure",r[r.timeoutFailure=-1]="timeoutFailure",r[r.contentTypeMismatch=-2]="contentTypeMismatch"})(A||(A={}));var ce=class{constructor(e,t,n,i={}){this.identifier=k(),this.timingMetrics={},this.followedRedirect=!1,this.historyChanged=!1,this.scrolled=!1,this.snapshotCached=!1,this.state=p.initialized,this.delegate=e,this.location=t,this.restorationIdentifier=n||k();let{action:s,historyChanged:o,referrer:c,snapshotHTML:l,response:a}=Object.assign(Object.assign({},_t),i);this.action=s,this.historyChanged=o,this.referrer=c,this.snapshotHTML=l,this.response=a,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action)}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}get silent(){return this.isSamePage}start(){this.state==p.initialized&&(this.recordTimingMetric(T.visitStart),this.state=p.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==p.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=p.canceled)}complete(){this.state==p.started&&(this.recordTimingMetric(T.visitEnd),this.state=p.completed,this.adapter.visitCompleted(this),this.delegate.visitCompleted(this),this.followRedirect())}fail(){this.state==p.started&&(this.state=p.failed,this.adapter.visitFailed(this))}changeHistory(){var e;if(!this.historyChanged){let t=this.location.href===((e=this.referrer)===null||e===void 0?void 0:e.href)?"replace":this.action,n=this.getHistoryMethodForAction(t);this.history.update(n,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new I(this,h.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(T.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){let{statusCode:t}=e;le(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(T.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){let{statusCode:e,responseHTML:t}=this.response;this.render(async()=>{this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,le(e)&&t!=null?(await this.view.renderPage(b.fromHTMLString(t)),this.adapter.visitRendered(this),this.complete()):(await this.view.renderError(b.fromHTMLString(t)),this.adapter.visitRendered(this),this.fail())})}}getCachedSnapshot(){let e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!P(this.location)||e.hasAnchor(P(this.location)))&&(this.action=="restore"||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return b.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return this.getCachedSnapshot()!=null}loadCachedSnapshot(){let e=this.getCachedSnapshot();if(e){let t=this.shouldIssueRequest();this.render(async()=>{this.cacheSnapshot(),this.isSamePage?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.view.renderPage(e,t),this.adapter.visitRendered(this),t||this.complete())})}}followRedirect(){this.redirectedToLocation&&!this.followedRedirect&&(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response}),this.followedRedirect=!0)}goToSamePageAnchor(){this.isSamePage&&this.render(async()=>{this.cacheSnapshot(),this.adapter.visitRendered(this)})}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){let n=await t.responseHTML;n==null?this.recordResponse({statusCode:A.contentTypeMismatch}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:t.statusCode,responseHTML:n}))}async requestFailedWithResponse(e,t){let n=await t.responseHTML;n==null?this.recordResponse({statusCode:A.contentTypeMismatch}):this.recordResponse({statusCode:t.statusCode,responseHTML:n})}requestErrored(e,t){this.recordResponse({statusCode:A.networkFailure})}requestFinished(){this.finishRequest()}performScroll(){this.scrolled||(this.action=="restore"?this.scrollToRestoredPosition()||this.scrollToAnchor()||this.view.scrollToTop():this.scrollToAnchor()||this.view.scrollToTop(),this.isSamePage&&this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation,this.location),this.scrolled=!0)}scrollToRestoredPosition(){let{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){let e=P(this.location);if(e!=null)return this.view.scrollToAnchor(e),!0}recordTimingMetric(e){this.timingMetrics[e]=new Date().getTime()}getTimingMetrics(){return Object.assign({},this.timingMetrics)}getHistoryMethodForAction(e){switch(e){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}hasPreloadedResponse(){return typeof this.response=="object"}shouldIssueRequest(){return this.isSamePage?!1:this.action=="restore"?!this.hasCachedSnapshot():!0}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot(),this.snapshotCached=!0)}async render(e){this.cancelRender(),await new Promise(t=>{this.frame=requestAnimationFrame(()=>t())}),await e(),delete this.frame,this.performScroll()}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}};function le(r){return r>=200&&r<300}var ue=class{constructor(e){this.progressBar=new g,this.showProgressBar=()=>{this.progressBar.show()},this.session=e}visitProposedToLocation(e,t){this.navigator.startVisit(e,k(),t)}visitStarted(e){e.issueRequest(),e.changeHistory(),e.goToSamePageAnchor(),e.loadCachedSnapshot()}visitRequestStarted(e){this.progressBar.setValue(0),e.hasCachedSnapshot()||e.action!="restore"?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(e){e.loadResponse()}visitRequestFailedWithStatusCode(e,t){switch(t){case A.networkFailure:case A.timeoutFailure:case A.contentTypeMismatch:return this.reload();default:return e.loadResponse()}}visitRequestFinished(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitCompleted(e){}pageInvalidated(){this.reload()}visitFailed(e){}visitRendered(e){}formSubmissionStarted(e){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(e){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),this.visitProgressBarTimeout!=null&&(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){this.formProgressBarTimeout==null&&(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),this.formProgressBarTimeout!=null&&(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}reload(){window.location.reload()}get navigator(){return this.session.navigator}},he=class{constructor(){this.started=!1}start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeStaleElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeStaleElements,!1))}removeStaleElements(){let e=[...document.querySelectorAll('[data-turbo-cache="false"]')];for(let t of e)t.remove()}},de=class{constructor(e){this.started=!1,this.submitCaptured=()=>{removeEventListener("submit",this.submitBubbled,!1),addEventListener("submit",this.submitBubbled,!1)},this.submitBubbled=t=>{if(!t.defaultPrevented){let n=t.target instanceof HTMLFormElement?t.target:void 0,i=t.submitter||void 0;n&&((i==null?void 0:i.getAttribute("formmethod"))||n.method)!="dialog"&&this.delegate.willSubmitForm(n,i)&&(t.preventDefault(),this.delegate.formSubmitted(n,i))}},this.delegate=e}start(){this.started||(addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&&(removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}},fe=class{constructor(e){this.element=e,this.linkInterceptor=new $(this,e),this.formInterceptor=new K(this,e)}start(){this.linkInterceptor.start(),this.formInterceptor.start()}stop(){this.linkInterceptor.stop(),this.formInterceptor.stop()}shouldInterceptLinkClick(e,t){return this.shouldRedirect(e)}linkClickIntercepted(e,t){let n=this.findFrameElement(e);n&&(n.setAttribute("reloadable",""),n.src=t)}shouldInterceptFormSubmission(e,t){return this.shouldRedirect(e,t)}formSubmissionIntercepted(e,t){let n=this.findFrameElement(e);n&&(n.removeAttribute("reloadable"),n.delegate.formSubmissionIntercepted(e,t))}shouldRedirect(e,t){let n=this.findFrameElement(e);return n?n!=e.closest("turbo-frame"):!1}findFrameElement(e){let t=e.getAttribute("data-turbo-frame");if(t&&t!="_top"){let n=this.element.querySelector(`#${t}:not([disabled])`);if(n instanceof v)return n}}},pe=class{constructor(e){this.restorationIdentifier=k(),this.restorationData={},this.started=!1,this.pageLoaded=!1,this.onPopState=t=>{if(this.shouldHandlePopState()){let{turbo:n}=t.state||{};if(n){this.location=new URL(window.location.href);let{restorationIdentifier:i}=n;this.restorationIdentifier=i,this.delegate.historyPoppedToLocationWithRestorationIdentifier(this.location,i)}}},this.onPageLoad=async t=>{await Pt(),this.pageLoaded=!0},this.delegate=e}start(){this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1)}push(e,t){this.update(history.pushState,e,t)}replace(e,t){this.update(history.replaceState,e,t)}update(e,t,n=k()){let i={turbo:{restorationIdentifier:n}};e.call(history,i,"",t.href),this.location=t,this.restorationIdentifier=n}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){let{restorationIdentifier:t}=this,n=this.restorationData[t];this.restorationData[t]=Object.assign(Object.assign({},n),e)}assumeControlOfScrollRestoration(){var e;this.previousScrollRestoration||(this.previousScrollRestoration=(e=history.scrollRestoration)!==null&&e!==void 0?e:"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||document.readyState=="complete"}},me=class{constructor(e){this.started=!1,this.clickCaptured=()=>{removeEventListener("click",this.clickBubbled,!1),addEventListener("click",this.clickBubbled,!1)},this.clickBubbled=t=>{if(this.clickEventIsSignificant(t)){let n=t.composedPath&&t.composedPath()[0]||t.target,i=this.findLinkFromClickTarget(n);if(i){let s=this.getLocationForLink(i);this.delegate.willFollowLinkToLocation(i,s)&&(t.preventDefault(),this.delegate.followedLinkToLocation(i,s))}}},this.delegate=e}start(){this.started||(addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&&(removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}findLinkFromClickTarget(e){if(e instanceof Element)return e.closest("a[href]:not([target^=_]):not([download])")}getLocationForLink(e){return m(e.getAttribute("href")||"")}};function ge(r){return r=="advance"||r=="replace"||r=="restore"}var ve=class{constructor(e){this.delegate=e}proposeVisit(e,t={}){this.delegate.allowsVisitingLocationWithAction(e,t.action)&&this.delegate.visitProposedToLocation(e,t)}startVisit(e,t,n={}){this.stop(),this.currentVisit=new ce(this,m(e),t,Object.assign({referrer:this.location},n)),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new U(this,e,t,!0),this.formSubmission.isIdempotent?this.proposeVisit(this.formSubmission.fetchRequest.url,{action:this.getActionForFormSubmission(this.formSubmission)}):this.formSubmission.start()}stop(){this.formSubmission&&(this.formSubmission.stop(),delete this.formSubmission),this.currentVisit&&(this.currentVisit.cancel(),delete this.currentVisit)}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}formSubmissionStarted(e){typeof this.adapter.formSubmissionStarted=="function"&&this.adapter.formSubmissionStarted(e)}async formSubmissionSucceededWithResponse(e,t){if(e==this.formSubmission){let n=await t.responseHTML;if(n){e.method!=h.get&&this.view.clearSnapshotCache();let{statusCode:i}=t,s={response:{statusCode:i,responseHTML:n}};this.proposeVisit(t.location,s)}}}async formSubmissionFailedWithResponse(e,t){let n=await t.responseHTML;if(n){let i=b.fromHTMLString(n);t.serverError?await this.view.renderError(i):await this.view.renderPage(i),this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished(e){typeof this.adapter.formSubmissionFinished=="function"&&this.adapter.formSubmissionFinished(e)}visitStarted(e){this.delegate.visitStarted(e)}visitCompleted(e){this.delegate.visitCompleted(e)}locationWithActionIsSamePage(e,t){let n=P(e),i=P(this.view.lastRenderedLocation),s=t==="restore"&&typeof n=="undefined";return t!=="replace"&&_(e)===_(this.view.lastRenderedLocation)&&(s||n!=null&&n!==i)}visitScrolledToSamePageLocation(e,t){this.delegate.visitScrolledToSamePageLocation(e,t)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}getActionForFormSubmission(e){let{formElement:t,submitter:n}=e,i=(n==null?void 0:n.getAttribute("data-turbo-action"))||t.getAttribute("data-turbo-action");return ge(i)?i:"advance"}},y;(function(r){r[r.initial=0]="initial",r[r.loading=1]="loading",r[r.interactive=2]="interactive",r[r.complete=3]="complete"})(y||(y={}));var be=class{constructor(e){this.stage=y.initial,this.started=!1,this.interpretReadyState=()=>{let{readyState:t}=this;t=="interactive"?this.pageIsInteractive():t=="complete"&&this.pageIsComplete()},this.pageWillUnload=()=>{this.delegate.pageWillUnload()},this.delegate=e}start(){this.started||(this.stage==y.initial&&(this.stage=y.loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}pageIsInteractive(){this.stage==y.loading&&(this.stage=y.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==y.interactive&&(this.stage=y.complete,this.delegate.pageLoaded())}get readyState(){return document.readyState}},ye=class{constructor(e){this.started=!1,this.onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})},this.delegate=e}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}updatePosition(e){this.delegate.scrollPositionChanged(e)}},we=class{constructor(e){this.sources=new Set,this.started=!1,this.inspectFetchResponse=t=>{let n=Wt(t);n&&Ut(n)&&(t.preventDefault(),this.receiveMessageResponse(n))},this.receiveMessageEvent=t=>{this.started&&typeof t.data=="string"&&this.receiveMessageHTML(t.data)},this.delegate=e}start(){this.started||(this.started=!0,addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(e){this.streamSourceIsConnected(e)||(this.sources.add(e),e.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(e){this.streamSourceIsConnected(e)&&(this.sources.delete(e),e.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(e){return this.sources.has(e)}async receiveMessageResponse(e){let t=await e.responseHTML;t&&this.receiveMessageHTML(t)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream(new L(e))}};function Wt(r){var e;let t=(e=r.detail)===null||e===void 0?void 0:e.fetchResponse;if(t instanceof W)return t}function Ut(r){var e;return((e=r.contentType)!==null&&e!==void 0?e:"").startsWith(L.contentType)}var Ee=class extends N{async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){let{documentElement:e,head:t,body:n}=document;e.replaceChild(this.newHead,t),e.replaceChild(this.newElement,n)}activateScriptElements(){for(let e of this.scriptElements){let t=e.parentNode;if(t){let n=this.createScriptElement(e);t.replaceChild(n,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return[...document.documentElement.querySelectorAll("script")]}},J=class extends N{get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}prepareToRender(){this.mergeHead()}async render(){this.replaceBody()}finishRendering(){super.finishRendering(),this.isPreview||this.focusFirstAutofocusableElement()}get currentHeadSnapshot(){return this.currentSnapshot.headSnapshot}get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}mergeHead(){this.copyNewHeadStylesheetElements(),this.copyNewHeadScriptElements(),this.removeCurrentHeadProvisionalElements(),this.copyNewHeadProvisionalElements()}replaceBody(){this.preservingPermanentElements(()=>{this.activateNewBody(),this.assignNewBody()})}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}copyNewHeadStylesheetElements(){for(let e of this.newHeadStylesheetElements)document.head.appendChild(e)}copyNewHeadScriptElements(){for(let e of this.newHeadScriptElements)document.head.appendChild(this.createScriptElement(e))}removeCurrentHeadProvisionalElements(){for(let e of this.currentHeadProvisionalElements)document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(let e of this.newHeadProvisionalElements)document.head.appendChild(e)}activateNewBody(){document.adoptNode(this.newElement),this.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(let e of this.newBodyScriptElements){let t=this.createScriptElement(e);e.replaceWith(t)}}assignNewBody(){document.body&&this.newElement instanceof HTMLBodyElement?document.body.replaceWith(this.newElement):document.documentElement.appendChild(this.newElement)}get newHeadStylesheetElements(){return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)}get newHeadScriptElements(){return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)}get currentHeadProvisionalElements(){return this.currentHeadSnapshot.provisionalElements}get newHeadProvisionalElements(){return this.newHeadSnapshot.provisionalElements}get newBodyScriptElements(){return this.newElement.querySelectorAll("script")}},Se=class{constructor(e){this.keys=[],this.snapshots={},this.size=e}has(e){return F(e)in this.snapshots}get(e){if(this.has(e)){let t=this.read(e);return this.touch(e),t}}put(e,t){return this.write(e,t),this.touch(e),t}clear(){this.snapshots={}}read(e){return this.snapshots[F(e)]}write(e,t){this.snapshots[F(e)]=t}touch(e){let t=F(e),n=this.keys.indexOf(t);n>-1&&this.keys.splice(n,1),this.keys.unshift(t),this.trim()}trim(){for(let e of this.keys.splice(this.size))delete this.snapshots[e]}},Ae=class extends z{constructor(){super(...arguments);this.snapshotCache=new Se(10),this.lastRenderedLocation=new URL(location.href)}renderPage(e,t=!1){let n=new J(this.snapshot,e,t);return this.render(n)}renderError(e){let t=new Ee(this.snapshot,e,!1);return this.render(t)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(){if(this.shouldCacheSnapshot){this.delegate.viewWillCacheSnapshot();let{snapshot:e,lastRenderedLocation:t}=this;await At(),this.snapshotCache.put(t,e.clone())}}getCachedSnapshotForLocation(e){return this.snapshotCache.get(e)}get snapshot(){return b.fromElement(this.element)}get shouldCacheSnapshot(){return this.snapshot.isCacheable}},Pe=class{constructor(){this.navigator=new ve(this),this.history=new pe(this),this.view=new Ae(this,document.documentElement),this.adapter=new ue(this),this.pageObserver=new be(this),this.cacheObserver=new he,this.linkClickObserver=new me(this),this.formSubmitObserver=new de(this),this.scrollObserver=new ye(this),this.streamObserver=new we(this),this.frameRedirector=new fe(document.documentElement),this.drive=!0,this.enabled=!0,this.progressBarDelay=500,this.started=!1}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.started=!1)}registerAdapter(e){this.adapter=e}visit(e,t={}){this.navigator.proposeVisit(m(e),t)}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){document.documentElement.appendChild(L.wrap(e).fragment)}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(e){this.progressBarDelay=e}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}historyPoppedToLocationWithRestorationIdentifier(e,t){this.enabled?this.navigator.startVisit(e,t,{action:"restore",historyChanged:!0}):this.adapter.pageInvalidated()}scrollPositionChanged(e){this.history.updateRestorationData({scrollPosition:e})}willFollowLinkToLocation(e,t){return this.elementDriveEnabled(e)&&this.locationIsVisitable(t)&&this.applicationAllowsFollowingLinkToLocation(e,t)}followedLinkToLocation(e,t){let n=this.getActionForLink(e);this.convertLinkWithMethodClickToFormSubmission(e)||this.visit(t.href,{action:n})}convertLinkWithMethodClickToFormSubmission(e){let t=e.getAttribute("data-turbo-method");if(t){let n=document.createElement("form");return n.method=t,n.action=e.getAttribute("href")||"undefined",document.body.appendChild(n),u("submit",{cancelable:!0,target:n})}else return!1}allowsVisitingLocationWithAction(e,t){return this.locationWithActionIsSamePage(e,t)||this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){Le(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){Le(e.location),e.silent||this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.notifyApplicationAfterPageLoad(e.getTimingMetrics())}locationWithActionIsSamePage(e,t){return this.navigator.locationWithActionIsSamePage(e,t)}visitScrolledToSamePageLocation(e,t){this.notifyApplicationAfterVisitingSamePageLocation(e,t)}willSubmitForm(e,t){return this.elementDriveEnabled(e)&&this.elementDriveEnabled(t)}formSubmitted(e,t){this.navigator.submitForm(e,t)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(e){this.renderStreamMessage(e)}viewWillCacheSnapshot(){var e;((e=this.navigator.currentVisit)===null||e===void 0?void 0:e.silent)||this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:e},t){return!this.notifyApplicationBeforeRender(e,t).defaultPrevented}viewRenderedSnapshot(e,t){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender()}viewInvalidated(){this.adapter.pageInvalidated()}frameLoaded(e){this.notifyApplicationAfterFrameLoad(e)}frameRendered(e,t){this.notifyApplicationAfterFrameRender(e,t)}applicationAllowsFollowingLinkToLocation(e,t){return!this.notifyApplicationAfterClickingLinkToLocation(e,t).defaultPrevented}applicationAllowsVisitingLocation(e){return!this.notifyApplicationBeforeVisitingLocation(e).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,t){return u("turbo:click",{target:e,detail:{url:t.href},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return u("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return u("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return u("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return u("turbo:before-render",{detail:{newBody:e,resume:t},cancelable:!0})}notifyApplicationAfterRender(){return u("turbo:render")}notifyApplicationAfterPageLoad(e={}){return u("turbo:load",{detail:{url:this.location.href,timing:e}})}notifyApplicationAfterVisitingSamePageLocation(e,t){dispatchEvent(new HashChangeEvent("hashchange",{oldURL:e.toString(),newURL:t.toString()}))}notifyApplicationAfterFrameLoad(e){return u("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return u("turbo:frame-render",{detail:{fetchResponse:e},target:t,cancelable:!0})}elementDriveEnabled(e){let t=e==null?void 0:e.closest("[data-turbo]");return this.drive?t?t.getAttribute("data-turbo")!="false":!0:t?t.getAttribute("data-turbo")=="true":!1}getActionForLink(e){let t=e.getAttribute("data-turbo-action");return ge(t)?t:"advance"}locationIsVisitable(e){return vt(e,this.snapshot.rootLocation)&>(e)}get snapshot(){return this.view.snapshot}};function Le(r){Object.defineProperties(r,Kt)}var Kt={absoluteURL:{get(){return this.toString()}}},d=new Pe,{navigator:zt}=d;function Te(){d.start()}function $t(r){d.registerAdapter(r)}function Jt(r,e){d.visit(r,e)}function Gt(r){d.connectStreamSource(r)}function Qt(r){d.disconnectStreamSource(r)}function Xt(r){d.renderStreamMessage(r)}function Yt(){d.clearCache()}function Zt(r){d.setProgressBarDelay(r)}var er=Object.freeze({__proto__:null,navigator:zt,session:d,PageRenderer:J,PageSnapshot:b,start:Te,registerAdapter:$t,visit:Jt,connectStreamSource:Gt,disconnectStreamSource:Qt,renderStreamMessage:Xt,clearCache:Yt,setProgressBarDelay:Zt}),Ce=class{constructor(e){this.resolveVisitPromise=()=>{},this.connected=!1,this.hasBeenLoaded=!1,this.settingSourceURL=!1,this.element=e,this.view=new ie(this,this.element),this.appearanceObserver=new re(this,this.element),this.linkInterceptor=new $(this,this.element),this.formInterceptor=new K(this,this.element)}connect(){this.connected||(this.connected=!0,this.reloadable=!1,this.loadingStyle==w.lazy&&this.appearanceObserver.start(),this.linkInterceptor.start(),this.formInterceptor.start(),this.sourceURLChanged())}disconnect(){this.connected&&(this.connected=!1,this.appearanceObserver.stop(),this.linkInterceptor.stop(),this.formInterceptor.stop())}disabledChanged(){this.loadingStyle==w.eager&&this.loadSourceURL()}sourceURLChanged(){(this.loadingStyle==w.eager||this.hasBeenLoaded)&&this.loadSourceURL()}loadingStyleChanged(){this.loadingStyle==w.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.loadSourceURL())}async loadSourceURL(){if(!this.settingSourceURL&&this.enabled&&this.isActive&&(this.reloadable||this.sourceURL!=this.currentURL)){let e=this.currentURL;if(this.currentURL=this.sourceURL,this.sourceURL)try{this.element.loaded=this.visit(this.sourceURL),this.appearanceObserver.stop(),await this.element.loaded,this.hasBeenLoaded=!0,d.frameLoaded(this.element)}catch(t){throw this.currentURL=e,t}}}async loadResponse(e){e.redirected&&(this.sourceURL=e.response.url);try{let t=await e.responseHTML;if(t){let{body:n}=ee(t),i=new M(await this.extractForeignFrameElement(n)),s=new oe(this.view.snapshot,i,!1);this.view.renderPromise&&await this.view.renderPromise,await this.view.render(s),d.frameRendered(e,this.element)}}catch(t){console.error(t),this.view.invalidate()}}elementAppearedInViewport(e){this.loadSourceURL()}shouldInterceptLinkClick(e,t){return e.hasAttribute("data-turbo-method")?!1:this.shouldInterceptNavigation(e)}linkClickIntercepted(e,t){this.reloadable=!0,this.navigateFrame(e,t)}shouldInterceptFormSubmission(e,t){return this.shouldInterceptNavigation(e,t)}formSubmissionIntercepted(e,t){if(this.formSubmission&&this.formSubmission.stop(),this.reloadable=!1,this.formSubmission=new U(this,e,t),this.formSubmission.fetchRequest.isIdempotent)this.navigateFrame(e,this.formSubmission.fetchRequest.url.href);else{let{fetchRequest:n}=this.formSubmission;this.prepareHeadersForRequest(n.headers,n),this.formSubmission.start()}}prepareHeadersForRequest(e,t){e["Turbo-Frame"]=this.id}requestStarted(e){this.element.setAttribute("busy","")}requestPreventedHandlingResponse(e,t){this.resolveVisitPromise()}async requestSucceededWithResponse(e,t){await this.loadResponse(t),this.resolveVisitPromise()}requestFailedWithResponse(e,t){console.error(t),this.resolveVisitPromise()}requestErrored(e,t){console.error(t),this.resolveVisitPromise()}requestFinished(e){this.element.removeAttribute("busy")}formSubmissionStarted(e){this.findFrameElement(e.formElement).setAttribute("busy","")}formSubmissionSucceededWithResponse(e,t){this.findFrameElement(e.formElement).delegate.loadResponse(t)}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t)}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished(e){this.findFrameElement(e.formElement).removeAttribute("busy")}allowsImmediateRender(e,t){return!0}viewRenderedSnapshot(e,t){}viewInvalidated(){}async visit(e){let t=new I(this,h.get,m(e));return new Promise(n=>{this.resolveVisitPromise=()=>{this.resolveVisitPromise=()=>{},n()},t.perform()})}navigateFrame(e,t){let n=this.findFrameElement(e);n.src=t}findFrameElement(e){var t;let n=e.getAttribute("data-turbo-frame")||this.element.getAttribute("target");return(t=Oe(n))!==null&&t!==void 0?t:this.element}async extractForeignFrameElement(e){let t,n=CSS.escape(this.id);try{if(t=Re(e.querySelector(`turbo-frame#${n}`),this.currentURL))return t;if(t=Re(e.querySelector(`turbo-frame[src][recurse~=${n}]`),this.currentURL))return await t.loaded,await this.extractForeignFrameElement(t);console.error(`Response has no matching <turbo-frame id="${n}"> element`)}catch(i){console.error(i)}return new v}shouldInterceptNavigation(e,t){let n=e.getAttribute("data-turbo-frame")||this.element.getAttribute("target");if(!this.enabled||n=="_top")return!1;if(n){let i=Oe(n);if(i)return!i.disabled}return!(!d.elementDriveEnabled(e)||t&&!d.elementDriveEnabled(t))}get id(){return this.element.id}get enabled(){return!this.element.disabled}get sourceURL(){if(this.element.src)return this.element.src}get reloadable(){return this.findFrameElement(this.element).hasAttribute("reloadable")}set reloadable(e){let t=this.findFrameElement(this.element);e?t.setAttribute("reloadable",""):t.removeAttribute("reloadable")}set sourceURL(e){this.settingSourceURL=!0,this.element.src=e??null,this.currentURL=this.element.src,this.settingSourceURL=!1}get loadingStyle(){return this.element.loading}get isLoading(){return this.formSubmission!==void 0||this.resolveVisitPromise()!==void 0}get isActive(){return this.element.isActive&&this.connected}};function Oe(r){if(r!=null){let e=document.getElementById(r);if(e instanceof v)return e}}function Re(r,e){if(r){let t=r.getAttribute("src");if(t!=null&&e!=null&&bt(t,e))throw new Error(`Matching <turbo-frame id="${r.id}"> element has a source URL which references itself`);if(r.ownerDocument!==document&&(r=document.importNode(r,!0)),r instanceof v)return r.connectedCallback(),r}}var tr={after(){this.targetElements.forEach(r=>{var e;return(e=r.parentElement)===null||e===void 0?void 0:e.insertBefore(this.templateContent,r.nextSibling)})},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(r=>r.append(this.templateContent))},before(){this.targetElements.forEach(r=>{var e;return(e=r.parentElement)===null||e===void 0?void 0:e.insertBefore(this.templateContent,r)})},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(r=>r.prepend(this.templateContent))},remove(){this.targetElements.forEach(r=>r.remove())},replace(){this.targetElements.forEach(r=>r.replaceWith(this.templateContent))},update(){this.targetElements.forEach(r=>{r.innerHTML="",r.append(this.templateContent)})}},ke=class extends HTMLElement{async connectedCallback(){try{await this.render()}catch(e){console.error(e)}finally{this.disconnect()}}async render(){var e;return(e=this.renderPromise)!==null&&e!==void 0?e:this.renderPromise=(async()=>{this.dispatchEvent(this.beforeRenderEvent)&&(await B(),this.performAction())})()}disconnect(){try{this.remove()}catch(e){}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(e=>e.remove())}get duplicateChildren(){var e;let t=this.targetElements.flatMap(i=>[...i.children]).filter(i=>!!i.id),n=[...(e=this.templateContent)===null||e===void 0?void 0:e.children].filter(i=>!!i.id).map(i=>i.id);return t.filter(i=>n.includes(i.id))}get performAction(){if(this.action){let e=tr[this.action];if(e)return e;this.raise("unknown action")}this.raise("action attribute is missing")}get targetElements(){if(this.target)return this.targetElementsById;if(this.targets)return this.targetElementsByQuery;this.raise("target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.raise("first child element must be a <template> element")}get action(){return this.getAttribute("action")}get target(){return this.getAttribute("target")}get targets(){return this.getAttribute("targets")}raise(e){throw new Error(`${this.description}: ${e}`)}get description(){var e,t;return(t=((e=this.outerHTML.match(/<[^>]+>/))!==null&&e!==void 0?e:[])[0])!==null&&t!==void 0?t:"<turbo-stream>"}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0})}get targetElementsById(){var e;let t=(e=this.ownerDocument)===null||e===void 0?void 0:e.getElementById(this.target);return t!==null?[t]:[]}get targetElementsByQuery(){var e;let t=(e=this.ownerDocument)===null||e===void 0?void 0:e.querySelectorAll(this.targets);return t.length!==0?Array.prototype.slice.call(t):[]}};v.delegateConstructor=Ce;customElements.define("turbo-frame",v);customElements.define("turbo-stream",ke);(()=>{let r=document.currentScript;if(!!r&&!r.hasAttribute("data-turbo-suppress-warning")){for(;r=r.parentElement;)if(r==document.body)return console.warn(te` + You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do! + + Load your application’s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change. + + For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements + + —— + Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s + `,r.outerHTML)}})();window.Turbo=er;Te();var Me=function(){function r(e,t,n){this.eventTarget=e,this.eventName=t,this.eventOptions=n,this.unorderedBindings=new Set}return r.prototype.connect=function(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)},r.prototype.disconnect=function(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)},r.prototype.bindingConnected=function(e){this.unorderedBindings.add(e)},r.prototype.bindingDisconnected=function(e){this.unorderedBindings.delete(e)},r.prototype.handleEvent=function(e){for(var t=rr(e),n=0,i=this.bindings;n<i.length;n++){var s=i[n];if(t.immediatePropagationStopped)break;s.handleEvent(t)}},Object.defineProperty(r.prototype,"bindings",{get:function(){return Array.from(this.unorderedBindings).sort(function(e,t){var n=e.index,i=t.index;return n<i?-1:n>i?1:0})},enumerable:!1,configurable:!0}),r}();function rr(r){if("immediatePropagationStopped"in r)return r;var e=r.stopImmediatePropagation;return Object.assign(r,{immediatePropagationStopped:!1,stopImmediatePropagation:function(){this.immediatePropagationStopped=!0,e.call(this)}})}var xe=function(){function r(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}return r.prototype.start=function(){this.started||(this.started=!0,this.eventListeners.forEach(function(e){return e.connect()}))},r.prototype.stop=function(){this.started&&(this.started=!1,this.eventListeners.forEach(function(e){return e.disconnect()}))},Object.defineProperty(r.prototype,"eventListeners",{get:function(){return Array.from(this.eventListenerMaps.values()).reduce(function(e,t){return e.concat(Array.from(t.values()))},[])},enumerable:!1,configurable:!0}),r.prototype.bindingConnected=function(e){this.fetchEventListenerForBinding(e).bindingConnected(e)},r.prototype.bindingDisconnected=function(e){this.fetchEventListenerForBinding(e).bindingDisconnected(e)},r.prototype.handleError=function(e,t,n){n===void 0&&(n={}),this.application.handleError(e,"Error "+t,n)},r.prototype.fetchEventListenerForBinding=function(e){var t=e.eventTarget,n=e.eventName,i=e.eventOptions;return this.fetchEventListener(t,n,i)},r.prototype.fetchEventListener=function(e,t,n){var i=this.fetchEventListenerMapForEventTarget(e),s=this.cacheKey(t,n),o=i.get(s);return o||(o=this.createEventListener(e,t,n),i.set(s,o)),o},r.prototype.createEventListener=function(e,t,n){var i=new Me(e,t,n);return this.started&&i.connect(),i},r.prototype.fetchEventListenerMapForEventTarget=function(e){var t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t},r.prototype.cacheKey=function(e,t){var n=[e];return Object.keys(t).sort().forEach(function(i){n.push(""+(t[i]?"":"!")+i)}),n.join(":")},r}();var nr=/^((.+?)(@(window|document))?->)?(.+?)(#([^:]+?))(:(.+))?$/;function Fe(r){var e=r.trim(),t=e.match(nr)||[];return{eventTarget:ir(t[4]),eventName:t[2],eventOptions:t[9]?sr(t[9]):{},identifier:t[5],methodName:t[7]}}function ir(r){if(r=="window")return window;if(r=="document")return document}function sr(r){return r.split(":").reduce(function(e,t){var n;return Object.assign(e,(n={},n[t.replace(/^!/,"")]=!/^!/.test(t),n))},{})}function Be(r){if(r==window)return"window";if(r==document)return"document"}var Ie=function(){function r(e,t,n){this.element=e,this.index=t,this.eventTarget=n.eventTarget||e,this.eventName=n.eventName||or(e)||G("missing event name"),this.eventOptions=n.eventOptions||{},this.identifier=n.identifier||G("missing identifier"),this.methodName=n.methodName||G("missing method name")}return r.forToken=function(e){return new this(e.element,e.index,Fe(e.content))},r.prototype.toString=function(){var e=this.eventTargetName?"@"+this.eventTargetName:"";return""+this.eventName+e+"->"+this.identifier+"#"+this.methodName},Object.defineProperty(r.prototype,"eventTargetName",{get:function(){return Be(this.eventTarget)},enumerable:!1,configurable:!0}),r}();var Ne={a:function(r){return"click"},button:function(r){return"click"},form:function(r){return"submit"},input:function(r){return r.getAttribute("type")=="submit"?"click":"input"},select:function(r){return"change"},textarea:function(r){return"input"}};function or(r){var e=r.tagName.toLowerCase();if(e in Ne)return Ne[e](r)}function G(r){throw new Error(r)}var qe=function(){function r(e,t){this.context=e,this.action=t}return Object.defineProperty(r.prototype,"index",{get:function(){return this.action.index},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"eventTarget",{get:function(){return this.action.eventTarget},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"eventOptions",{get:function(){return this.action.eventOptions},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"identifier",{get:function(){return this.context.identifier},enumerable:!1,configurable:!0}),r.prototype.handleEvent=function(e){this.willBeInvokedByEvent(e)&&this.invokeWithEvent(e)},Object.defineProperty(r.prototype,"eventName",{get:function(){return this.action.eventName},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"method",{get:function(){var e=this.controller[this.methodName];if(typeof e=="function")return e;throw new Error('Action "'+this.action+'" references undefined method "'+this.methodName+'"')},enumerable:!1,configurable:!0}),r.prototype.invokeWithEvent=function(e){try{this.method.call(this.controller,e)}catch(l){var t=this,n=t.identifier,i=t.controller,s=t.element,o=t.index,c={identifier:n,controller:i,element:s,index:o,event:e};this.context.handleError(l,'invoking action "'+this.action+'"',c)}},r.prototype.willBeInvokedByEvent=function(e){var t=e.target;return this.element===t?!0:t instanceof Element&&this.element.contains(t)?this.scope.containsElement(t):this.scope.containsElement(this.action.element)},Object.defineProperty(r.prototype,"controller",{get:function(){return this.context.controller},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"methodName",{get:function(){return this.action.methodName},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"element",{get:function(){return this.scope.element},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"scope",{get:function(){return this.context.scope},enumerable:!1,configurable:!0}),r}();var Ve=function(){function r(e,t){var n=this;this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver(function(i){return n.processMutations(i)})}return r.prototype.start=function(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,childList:!0,subtree:!0}),this.refresh())},r.prototype.stop=function(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)},r.prototype.refresh=function(){if(this.started){for(var e=new Set(this.matchElementsInTree()),t=0,n=Array.from(this.elements);t<n.length;t++){var i=n[t];e.has(i)||this.removeElement(i)}for(var s=0,o=Array.from(e);s<o.length;s++){var i=o[s];this.addElement(i)}}},r.prototype.processMutations=function(e){if(this.started)for(var t=0,n=e;t<n.length;t++){var i=n[t];this.processMutation(i)}},r.prototype.processMutation=function(e){e.type=="attributes"?this.processAttributeChange(e.target,e.attributeName):e.type=="childList"&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))},r.prototype.processAttributeChange=function(e,t){var n=e;this.elements.has(n)?this.delegate.elementAttributeChanged&&this.matchElement(n)?this.delegate.elementAttributeChanged(n,t):this.removeElement(n):this.matchElement(n)&&this.addElement(n)},r.prototype.processRemovedNodes=function(e){for(var t=0,n=Array.from(e);t<n.length;t++){var i=n[t],s=this.elementFromNode(i);s&&this.processTree(s,this.removeElement)}},r.prototype.processAddedNodes=function(e){for(var t=0,n=Array.from(e);t<n.length;t++){var i=n[t],s=this.elementFromNode(i);s&&this.elementIsActive(s)&&this.processTree(s,this.addElement)}},r.prototype.matchElement=function(e){return this.delegate.matchElement(e)},r.prototype.matchElementsInTree=function(e){return e===void 0&&(e=this.element),this.delegate.matchElementsInTree(e)},r.prototype.processTree=function(e,t){for(var n=0,i=this.matchElementsInTree(e);n<i.length;n++){var s=i[n];t.call(this,s)}},r.prototype.elementFromNode=function(e){if(e.nodeType==Node.ELEMENT_NODE)return e},r.prototype.elementIsActive=function(e){return e.isConnected!=this.element.isConnected?!1:this.element.contains(e)},r.prototype.addElement=function(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))},r.prototype.removeElement=function(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))},r}();var je=function(){function r(e,t,n){this.attributeName=t,this.delegate=n,this.elementObserver=new Ve(e,this)}return Object.defineProperty(r.prototype,"element",{get:function(){return this.elementObserver.element},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"selector",{get:function(){return"["+this.attributeName+"]"},enumerable:!1,configurable:!0}),r.prototype.start=function(){this.elementObserver.start()},r.prototype.stop=function(){this.elementObserver.stop()},r.prototype.refresh=function(){this.elementObserver.refresh()},Object.defineProperty(r.prototype,"started",{get:function(){return this.elementObserver.started},enumerable:!1,configurable:!0}),r.prototype.matchElement=function(e){return e.hasAttribute(this.attributeName)},r.prototype.matchElementsInTree=function(e){var t=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(this.selector));return t.concat(n)},r.prototype.elementMatched=function(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)},r.prototype.elementUnmatched=function(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)},r.prototype.elementAttributeChanged=function(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)},r}();var De=function(){function r(e,t){var n=this;this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(function(i){return n.processMutations(i)})}return r.prototype.start=function(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0}),this.refresh())},r.prototype.stop=function(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)},r.prototype.refresh=function(){if(this.started)for(var e=0,t=this.knownAttributeNames;e<t.length;e++){var n=t[e];this.refreshAttribute(n)}},r.prototype.processMutations=function(e){if(this.started)for(var t=0,n=e;t<n.length;t++){var i=n[t];this.processMutation(i)}},r.prototype.processMutation=function(e){var t=e.attributeName;t&&this.refreshAttribute(t)},r.prototype.refreshAttribute=function(e){var t=this.delegate.getStringMapKeyForAttribute(e);if(t!=null){this.stringMap.has(e)||this.stringMapKeyAdded(t,e);var n=this.element.getAttribute(e);this.stringMap.get(e)!=n&&this.stringMapValueChanged(n,t),n==null?(this.stringMap.delete(e),this.stringMapKeyRemoved(t,e)):this.stringMap.set(e,n)}},r.prototype.stringMapKeyAdded=function(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)},r.prototype.stringMapValueChanged=function(e,t){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t)},r.prototype.stringMapKeyRemoved=function(e,t){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t)},Object.defineProperty(r.prototype,"knownAttributeNames",{get:function(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"currentAttributeNames",{get:function(){return Array.from(this.element.attributes).map(function(e){return e.name})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"recordedAttributeNames",{get:function(){return Array.from(this.stringMap.keys())},enumerable:!1,configurable:!0}),r}();function q(r,e,t){He(r,e).add(t)}function V(r,e,t){He(r,e).delete(t),ar(r,e)}function He(r,e){var t=r.get(e);return t||(t=new Set,r.set(e,t)),t}function ar(r,e){var t=r.get(e);t!=null&&t.size==0&&r.delete(e)}var C=function(){function r(){this.valuesByKey=new Map}return Object.defineProperty(r.prototype,"values",{get:function(){var e=Array.from(this.valuesByKey.values());return e.reduce(function(t,n){return t.concat(Array.from(n))},[])},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"size",{get:function(){var e=Array.from(this.valuesByKey.values());return e.reduce(function(t,n){return t+n.size},0)},enumerable:!1,configurable:!0}),r.prototype.add=function(e,t){q(this.valuesByKey,e,t)},r.prototype.delete=function(e,t){V(this.valuesByKey,e,t)},r.prototype.has=function(e,t){var n=this.valuesByKey.get(e);return n!=null&&n.has(t)},r.prototype.hasKey=function(e){return this.valuesByKey.has(e)},r.prototype.hasValue=function(e){var t=Array.from(this.valuesByKey.values());return t.some(function(n){return n.has(e)})},r.prototype.getValuesForKey=function(e){var t=this.valuesByKey.get(e);return t?Array.from(t):[]},r.prototype.getKeysForValue=function(e){return Array.from(this.valuesByKey).filter(function(t){var n=t[0],i=t[1];return i.has(e)}).map(function(t){var n=t[0],i=t[1];return n})},r}();var cr=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)i.hasOwnProperty(s)&&(n[s]=i[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),en=function(r){cr(e,r);function e(){var t=r.call(this)||this;return t.keysByValue=new Map,t}return Object.defineProperty(e.prototype,"values",{get:function(){return Array.from(this.keysByValue.keys())},enumerable:!1,configurable:!0}),e.prototype.add=function(t,n){r.prototype.add.call(this,t,n),q(this.keysByValue,n,t)},e.prototype.delete=function(t,n){r.prototype.delete.call(this,t,n),V(this.keysByValue,n,t)},e.prototype.hasValue=function(t){return this.keysByValue.has(t)},e.prototype.getKeysForValue=function(t){var n=this.keysByValue.get(t);return n?Array.from(n):[]},e}(C);var _e=function(){function r(e,t,n){this.attributeObserver=new je(e,t,this),this.delegate=n,this.tokensByElement=new C}return Object.defineProperty(r.prototype,"started",{get:function(){return this.attributeObserver.started},enumerable:!1,configurable:!0}),r.prototype.start=function(){this.attributeObserver.start()},r.prototype.stop=function(){this.attributeObserver.stop()},r.prototype.refresh=function(){this.attributeObserver.refresh()},Object.defineProperty(r.prototype,"element",{get:function(){return this.attributeObserver.element},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"attributeName",{get:function(){return this.attributeObserver.attributeName},enumerable:!1,configurable:!0}),r.prototype.elementMatchedAttribute=function(e){this.tokensMatched(this.readTokensForElement(e))},r.prototype.elementAttributeValueChanged=function(e){var t=this.refreshTokensForElement(e),n=t[0],i=t[1];this.tokensUnmatched(n),this.tokensMatched(i)},r.prototype.elementUnmatchedAttribute=function(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))},r.prototype.tokensMatched=function(e){var t=this;e.forEach(function(n){return t.tokenMatched(n)})},r.prototype.tokensUnmatched=function(e){var t=this;e.forEach(function(n){return t.tokenUnmatched(n)})},r.prototype.tokenMatched=function(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)},r.prototype.tokenUnmatched=function(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)},r.prototype.refreshTokensForElement=function(e){var t=this.tokensByElement.getValuesForKey(e),n=this.readTokensForElement(e),i=ur(t,n).findIndex(function(s){var o=s[0],c=s[1];return!hr(o,c)});return i==-1?[[],[]]:[t.slice(i),n.slice(i)]},r.prototype.readTokensForElement=function(e){var t=this.attributeName,n=e.getAttribute(t)||"";return lr(n,e,t)},r}();function lr(r,e,t){return r.trim().split(/\s+/).filter(function(n){return n.length}).map(function(n,i){return{element:e,attributeName:t,content:n,index:i}})}function ur(r,e){var t=Math.max(r.length,e.length);return Array.from({length:t},function(n,i){return[r[i],e[i]]})}function hr(r,e){return r&&e&&r.index==e.index&&r.content==e.content}var j=function(){function r(e,t,n){this.tokenListObserver=new _e(e,t,this),this.delegate=n,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}return Object.defineProperty(r.prototype,"started",{get:function(){return this.tokenListObserver.started},enumerable:!1,configurable:!0}),r.prototype.start=function(){this.tokenListObserver.start()},r.prototype.stop=function(){this.tokenListObserver.stop()},r.prototype.refresh=function(){this.tokenListObserver.refresh()},Object.defineProperty(r.prototype,"element",{get:function(){return this.tokenListObserver.element},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"attributeName",{get:function(){return this.tokenListObserver.attributeName},enumerable:!1,configurable:!0}),r.prototype.tokenMatched=function(e){var t=e.element,n=this.fetchParseResultForToken(e).value;n&&(this.fetchValuesByTokenForElement(t).set(e,n),this.delegate.elementMatchedValue(t,n))},r.prototype.tokenUnmatched=function(e){var t=e.element,n=this.fetchParseResultForToken(e).value;n&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,n))},r.prototype.fetchParseResultForToken=function(e){var t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t},r.prototype.fetchValuesByTokenForElement=function(e){var t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t},r.prototype.parseToken=function(e){try{var t=this.delegate.parseValueForToken(e);return{value:t}}catch(n){return{error:n}}},r}();var We=function(){function r(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}return r.prototype.start=function(){this.valueListObserver||(this.valueListObserver=new j(this.element,this.actionAttribute,this),this.valueListObserver.start())},r.prototype.stop=function(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())},Object.defineProperty(r.prototype,"element",{get:function(){return this.context.element},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"identifier",{get:function(){return this.context.identifier},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"actionAttribute",{get:function(){return this.schema.actionAttribute},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){return this.context.schema},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bindings",{get:function(){return Array.from(this.bindingsByAction.values())},enumerable:!1,configurable:!0}),r.prototype.connectAction=function(e){var t=new qe(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)},r.prototype.disconnectAction=function(e){var t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))},r.prototype.disconnectAllActions=function(){var e=this;this.bindings.forEach(function(t){return e.delegate.bindingDisconnected(t)}),this.bindingsByAction.clear()},r.prototype.parseValueForToken=function(e){var t=Ie.forToken(e);if(t.identifier==this.identifier)return t},r.prototype.elementMatchedValue=function(e,t){this.connectAction(t)},r.prototype.elementUnmatchedValue=function(e,t){this.disconnectAction(t)},r}();var Ue=function(){function r(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new De(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap,this.invokeChangedCallbacksForDefaultValues()}return r.prototype.start=function(){this.stringMapObserver.start()},r.prototype.stop=function(){this.stringMapObserver.stop()},Object.defineProperty(r.prototype,"element",{get:function(){return this.context.element},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"controller",{get:function(){return this.context.controller},enumerable:!1,configurable:!0}),r.prototype.getStringMapKeyForAttribute=function(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name},r.prototype.stringMapValueChanged=function(e,t){this.invokeChangedCallbackForValue(t)},r.prototype.invokeChangedCallbacksForDefaultValues=function(){for(var e=0,t=this.valueDescriptors;e<t.length;e++){var n=t[e],i=n.key,s=n.name,o=n.defaultValue;o!=null&&!this.controller.data.has(i)&&this.invokeChangedCallbackForValue(s)}},r.prototype.invokeChangedCallbackForValue=function(e){var t=e+"Changed",n=this.receiver[t];if(typeof n=="function"){var i=this.receiver[e];n.call(this.receiver,i)}},Object.defineProperty(r.prototype,"valueDescriptors",{get:function(){var e=this.valueDescriptorMap;return Object.keys(e).map(function(t){return e[t]})},enumerable:!1,configurable:!0}),r}();var Q=function(){function r(e,t){this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new We(this,this.dispatcher),this.valueObserver=new Ue(this,this.controller);try{this.controller.initialize()}catch(n){this.handleError(n,"initializing controller")}}return r.prototype.connect=function(){this.bindingObserver.start(),this.valueObserver.start();try{this.controller.connect()}catch(e){this.handleError(e,"connecting controller")}},r.prototype.disconnect=function(){try{this.controller.disconnect()}catch(e){this.handleError(e,"disconnecting controller")}this.valueObserver.stop(),this.bindingObserver.stop()},Object.defineProperty(r.prototype,"application",{get:function(){return this.module.application},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"identifier",{get:function(){return this.module.identifier},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){return this.application.schema},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dispatcher",{get:function(){return this.application.dispatcher},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"element",{get:function(){return this.scope.element},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parentElement",{get:function(){return this.element.parentElement},enumerable:!1,configurable:!0}),r.prototype.handleError=function(e,t,n){n===void 0&&(n={});var i=this,s=i.identifier,o=i.controller,c=i.element;n=Object.assign({identifier:s,controller:o,element:c},n),this.application.handleError(e,"Error "+t,n)},r}();function O(r,e){var t=ze(r);return Array.from(t.reduce(function(n,i){return dr(i,e).forEach(function(s){return n.add(s)}),n},new Set))}function Ke(r,e){var t=ze(r);return t.reduce(function(n,i){return n.push.apply(n,fr(i,e)),n},[])}function ze(r){for(var e=[];r;)e.push(r),r=Object.getPrototypeOf(r);return e.reverse()}function dr(r,e){var t=r[e];return Array.isArray(t)?t:[]}function fr(r,e){var t=r[e];return t?Object.keys(t).map(function(n){return[n,t[n]]}):[]}var pr=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)i.hasOwnProperty(s)&&(n[s]=i[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),mr=function(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var s=arguments[e],o=0,c=s.length;o<c;o++,i++)n[i]=s[o];return n};function $e(r){return gr(r,vr(r))}function gr(r,e){var t=Er(r),n=br(r.prototype,e);return Object.defineProperties(t.prototype,n),t}function vr(r){var e=O(r,"blessings");return e.reduce(function(t,n){var i=n(r);for(var s in i){var o=t[s]||{};t[s]=Object.assign(o,i[s])}return t},{})}function br(r,e){return wr(e).reduce(function(t,n){var i,s=yr(r,e,n);return s&&Object.assign(t,(i={},i[n]=s,i)),t},{})}function yr(r,e,t){var n=Object.getOwnPropertyDescriptor(r,t),i=n&&"value"in n;if(!i){var s=Object.getOwnPropertyDescriptor(e,t).value;return n&&(s.get=n.get||s.get,s.set=n.set||s.set),s}}var wr=function(){return typeof Object.getOwnPropertySymbols=="function"?function(r){return mr(Object.getOwnPropertyNames(r),Object.getOwnPropertySymbols(r))}:Object.getOwnPropertyNames}(),Er=function(){function r(t){function n(){var i=this&&this instanceof n?this.constructor:void 0;return Reflect.construct(t,arguments,i)}return n.prototype=Object.create(t.prototype,{constructor:{value:n}}),Reflect.setPrototypeOf(n,t),n}function e(){var t=function(){this.a.call(this)},n=r(t);return n.prototype.a=function(){},new n}try{return e(),r}catch(t){return function(n){return function(i){pr(s,i);function s(){return i!==null&&i.apply(this,arguments)||this}return s}(n)}}}();function Je(r){return{identifier:r.identifier,controllerConstructor:$e(r.controllerConstructor)}}var Ge=function(){function r(e,t){this.application=e,this.definition=Je(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}return Object.defineProperty(r.prototype,"identifier",{get:function(){return this.definition.identifier},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"controllerConstructor",{get:function(){return this.definition.controllerConstructor},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"contexts",{get:function(){return Array.from(this.connectedContexts)},enumerable:!1,configurable:!0}),r.prototype.connectContextForScope=function(e){var t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()},r.prototype.disconnectContextForScope=function(e){var t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())},r.prototype.fetchContextForScope=function(e){var t=this.contextsByScope.get(e);return t||(t=new Q(this,e),this.contextsByScope.set(e,t)),t},r}();var Qe=function(){function r(e){this.scope=e}return r.prototype.has=function(e){return this.data.has(this.getDataKey(e))},r.prototype.get=function(e){return this.data.get(this.getDataKey(e))},r.prototype.getAttributeName=function(e){return this.data.getAttributeNameForKey(this.getDataKey(e))},r.prototype.getDataKey=function(e){return e+"-class"},Object.defineProperty(r.prototype,"data",{get:function(){return this.scope.data},enumerable:!1,configurable:!0}),r}();function Xe(r){return r.replace(/(?:[_-])([a-z0-9])/g,function(e,t){return t.toUpperCase()})}function R(r){return r.charAt(0).toUpperCase()+r.slice(1)}function D(r){return r.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()})}var Ye=function(){function r(e){this.scope=e}return Object.defineProperty(r.prototype,"element",{get:function(){return this.scope.element},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"identifier",{get:function(){return this.scope.identifier},enumerable:!1,configurable:!0}),r.prototype.get=function(e){var t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)},r.prototype.set=function(e,t){var n=this.getAttributeNameForKey(e);return this.element.setAttribute(n,t),this.get(e)},r.prototype.has=function(e){var t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)},r.prototype.delete=function(e){if(this.has(e)){var t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}else return!1},r.prototype.getAttributeNameForKey=function(e){return"data-"+this.identifier+"-"+D(e)},r}();var Ze=function(){function r(e){this.warnedKeysByObject=new WeakMap,this.logger=e}return r.prototype.warn=function(e,t,n){var i=this.warnedKeysByObject.get(e);i||(i=new Set,this.warnedKeysByObject.set(e,i)),i.has(t)||(i.add(t),this.logger.warn(n,e))},r}();function x(r,e){return"["+r+'~="'+e+'"]'}var Sr=function(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var s=arguments[e],o=0,c=s.length;o<c;o++,i++)n[i]=s[o];return n},et=function(){function r(e){this.scope=e}return Object.defineProperty(r.prototype,"element",{get:function(){return this.scope.element},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"identifier",{get:function(){return this.scope.identifier},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){return this.scope.schema},enumerable:!1,configurable:!0}),r.prototype.has=function(e){return this.find(e)!=null},r.prototype.find=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.reduce(function(i,s){return i||e.findTarget(s)||e.findLegacyTarget(s)},void 0)},r.prototype.findAll=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.reduce(function(i,s){return Sr(i,e.findAllTargets(s),e.findAllLegacyTargets(s))},[])},r.prototype.findTarget=function(e){var t=this.getSelectorForTargetName(e);return this.scope.findElement(t)},r.prototype.findAllTargets=function(e){var t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)},r.prototype.getSelectorForTargetName=function(e){var t="data-"+this.identifier+"-target";return x(t,e)},r.prototype.findLegacyTarget=function(e){var t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)},r.prototype.findAllLegacyTargets=function(e){var t=this,n=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(n).map(function(i){return t.deprecate(i,e)})},r.prototype.getLegacySelectorForTargetName=function(e){var t=this.identifier+"."+e;return x(this.schema.targetAttribute,t)},r.prototype.deprecate=function(e,t){if(e){var n=this.identifier,i=this.schema.targetAttribute;this.guide.warn(e,"target:"+t,"Please replace "+i+'="'+n+"."+t+'" with data-'+n+'-target="'+t+'". '+("The "+i+" attribute is deprecated and will be removed in a future version of Stimulus."))}return e},Object.defineProperty(r.prototype,"guide",{get:function(){return this.scope.guide},enumerable:!1,configurable:!0}),r}();var Ar=function(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var s=arguments[e],o=0,c=s.length;o<c;o++,i++)n[i]=s[o];return n},tt=function(){function r(e,t,n,i){var s=this;this.targets=new et(this),this.classes=new Qe(this),this.data=new Ye(this),this.containsElement=function(o){return o.closest(s.controllerSelector)===s.element},this.schema=e,this.element=t,this.identifier=n,this.guide=new Ze(i)}return r.prototype.findElement=function(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)},r.prototype.findAllElements=function(e){return Ar(this.element.matches(e)?[this.element]:[],this.queryElements(e).filter(this.containsElement))},r.prototype.queryElements=function(e){return Array.from(this.element.querySelectorAll(e))},Object.defineProperty(r.prototype,"controllerSelector",{get:function(){return x(this.schema.controllerAttribute,this.identifier)},enumerable:!1,configurable:!0}),r}();var rt=function(){function r(e,t,n){this.element=e,this.schema=t,this.delegate=n,this.valueListObserver=new j(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}return r.prototype.start=function(){this.valueListObserver.start()},r.prototype.stop=function(){this.valueListObserver.stop()},Object.defineProperty(r.prototype,"controllerAttribute",{get:function(){return this.schema.controllerAttribute},enumerable:!1,configurable:!0}),r.prototype.parseValueForToken=function(e){var t=e.element,n=e.content,i=this.fetchScopesByIdentifierForElement(t),s=i.get(n);return s||(s=this.delegate.createScopeForElementAndIdentifier(t,n),i.set(n,s)),s},r.prototype.elementMatchedValue=function(e,t){var n=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,n),n==1&&this.delegate.scopeConnected(t)},r.prototype.elementUnmatchedValue=function(e,t){var n=this.scopeReferenceCounts.get(t);n&&(this.scopeReferenceCounts.set(t,n-1),n==1&&this.delegate.scopeDisconnected(t))},r.prototype.fetchScopesByIdentifierForElement=function(e){var t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t},r}();var nt=function(){function r(e){this.application=e,this.scopeObserver=new rt(this.element,this.schema,this),this.scopesByIdentifier=new C,this.modulesByIdentifier=new Map}return Object.defineProperty(r.prototype,"element",{get:function(){return this.application.element},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){return this.application.schema},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"logger",{get:function(){return this.application.logger},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"controllerAttribute",{get:function(){return this.schema.controllerAttribute},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"modules",{get:function(){return Array.from(this.modulesByIdentifier.values())},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"contexts",{get:function(){return this.modules.reduce(function(e,t){return e.concat(t.contexts)},[])},enumerable:!1,configurable:!0}),r.prototype.start=function(){this.scopeObserver.start()},r.prototype.stop=function(){this.scopeObserver.stop()},r.prototype.loadDefinition=function(e){this.unloadIdentifier(e.identifier);var t=new Ge(this.application,e);this.connectModule(t)},r.prototype.unloadIdentifier=function(e){var t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)},r.prototype.getContextForElementAndIdentifier=function(e,t){var n=this.modulesByIdentifier.get(t);if(n)return n.contexts.find(function(i){return i.element==e})},r.prototype.handleError=function(e,t,n){this.application.handleError(e,t,n)},r.prototype.createScopeForElementAndIdentifier=function(e,t){return new tt(this.schema,e,t,this.logger)},r.prototype.scopeConnected=function(e){this.scopesByIdentifier.add(e.identifier,e);var t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)},r.prototype.scopeDisconnected=function(e){this.scopesByIdentifier.delete(e.identifier,e);var t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)},r.prototype.connectModule=function(e){this.modulesByIdentifier.set(e.identifier,e);var t=this.scopesByIdentifier.getValuesForKey(e.identifier);t.forEach(function(n){return e.connectContextForScope(n)})},r.prototype.disconnectModule=function(e){this.modulesByIdentifier.delete(e.identifier);var t=this.scopesByIdentifier.getValuesForKey(e.identifier);t.forEach(function(n){return e.disconnectContextForScope(n)})},r}();var X={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target"};var Pr=function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function c(f){try{a(n.next(f))}catch(H){o(H)}}function l(f){try{a(n.throw(f))}catch(H){o(H)}}function a(f){f.done?s(f.value):i(f.value).then(c,l)}a((n=n.apply(r,e||[])).next())})},Lr=function(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(a){return function(f){return l([a,f])}}function l(a){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(s=a[0]&2?i.return:a[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;switch(i=0,s&&(a=[a[0]&2,s.value]),a[0]){case 0:case 1:s=a;break;case 4:return t.label++,{value:a[1],done:!1};case 5:t.label++,i=a[1],a=[0];continue;case 7:a=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){t.label=a[1];break}if(a[0]===6&&t.label<s[1]){t.label=s[1],s=a;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(a);break}s[2]&&t.ops.pop(),t.trys.pop();continue}a=e.call(r,t)}catch(f){a=[6,f],i=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},it=function(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var s=arguments[e],o=0,c=s.length;o<c;o++,i++)n[i]=s[o];return n},Y=function(){function r(e,t){e===void 0&&(e=document.documentElement),t===void 0&&(t=X),this.logger=console,this.element=e,this.schema=t,this.dispatcher=new xe(this),this.router=new nt(this)}return r.start=function(e,t){var n=new r(e,t);return n.start(),n},r.prototype.start=function(){return Pr(this,void 0,void 0,function(){return Lr(this,function(e){switch(e.label){case 0:return[4,Tr()];case 1:return e.sent(),this.dispatcher.start(),this.router.start(),[2]}})})},r.prototype.stop=function(){this.dispatcher.stop(),this.router.stop()},r.prototype.register=function(e,t){this.load({identifier:e,controllerConstructor:t})},r.prototype.load=function(e){for(var t=this,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var s=Array.isArray(e)?e:it([e],n);s.forEach(function(o){return t.router.loadDefinition(o)})},r.prototype.unload=function(e){for(var t=this,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var s=Array.isArray(e)?e:it([e],n);s.forEach(function(o){return t.router.unloadIdentifier(o)})},Object.defineProperty(r.prototype,"controllers",{get:function(){return this.router.contexts.map(function(e){return e.controller})},enumerable:!1,configurable:!0}),r.prototype.getControllerForElementAndIdentifier=function(e,t){var n=this.router.getContextForElementAndIdentifier(e,t);return n?n.controller:null},r.prototype.handleError=function(e,t,n){this.logger.error(`%s + +%o + +%o`,t,e,n)},r}();function Tr(){return new Promise(function(r){document.readyState=="loading"?document.addEventListener("DOMContentLoaded",r):r()})}function st(r){var e=O(r,"classes");return e.reduce(function(t,n){return Object.assign(t,Cr(n))},{})}function Cr(r){var e,t=r+"Class";return e={},e[t]={get:function(){var n=this.classes;if(n.has(r))return n.get(r);var i=n.getAttributeName(r);throw new Error('Missing attribute "'+i+'"')}},e["has"+R(t)]={get:function(){return this.classes.has(r)}},e}function ot(r){var e=O(r,"targets");return e.reduce(function(t,n){return Object.assign(t,Or(n))},{})}function Or(r){var e;return e={},e[r+"Target"]={get:function(){var t=this.targets.find(r);if(t)return t;throw new Error('Missing target element "'+this.identifier+"."+r+'"')}},e[r+"Targets"]={get:function(){return this.targets.findAll(r)}},e["has"+R(r)+"Target"]={get:function(){return this.targets.has(r)}},e}function at(r){var e=Ke(r,"values"),t={valueDescriptorMap:{get:function(){var n=this;return e.reduce(function(i,s){var o,c=ct(s),l=n.data.getAttributeNameForKey(c.key);return Object.assign(i,(o={},o[l]=c,o))},{})}}};return e.reduce(function(n,i){return Object.assign(n,Rr(i))},t)}function Rr(r){var e,t=ct(r),n=t.type,i=t.key,s=t.name,o=Fr[n],c=lt[n]||lt.default;return e={},e[s]={get:function(){var l=this.data.get(i);return l!==null?o(l):t.defaultValue},set:function(l){l===void 0?this.data.delete(i):this.data.set(i,c(l))}},e["has"+R(s)]={get:function(){return this.data.has(i)}},e}function ct(r){var e=r[0],t=r[1],n=kr(t);return Mr(e,n)}function kr(r){switch(r){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}throw new Error('Unknown value type constant "'+r+'"')}function Mr(r,e){var t=D(r)+"-value";return{type:e,key:t,name:Xe(t),get defaultValue(){return xr[e]}}}var xr={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},Fr={array:function(r){var e=JSON.parse(r);if(!Array.isArray(e))throw new TypeError("Expected array");return e},boolean:function(r){return!(r=="0"||r=="false")},number:function(r){return parseFloat(r)},object:function(r){var e=JSON.parse(r);if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError("Expected object");return e},string:function(r){return r}},lt={default:Br,array:ut,object:ut};function ut(r){return JSON.stringify(r)}function Br(r){return""+r}var Ir=function(){function r(e){this.context=e}return Object.defineProperty(r.prototype,"application",{get:function(){return this.context.application},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"scope",{get:function(){return this.context.scope},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"element",{get:function(){return this.scope.element},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"identifier",{get:function(){return this.scope.identifier},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"targets",{get:function(){return this.scope.targets},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"classes",{get:function(){return this.scope.classes},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"data",{get:function(){return this.scope.data},enumerable:!1,configurable:!0}),r.prototype.initialize=function(){},r.prototype.connect=function(){},r.prototype.disconnect=function(){},r.blessings=[st,ot,at],r.targets=[],r.values={},r}();var ht=[];var Nr=Y.start();Nr.load(ht);})(); diff --git a/priv/static/assets/site.js.br b/priv/static/assets/site.js.br Binary files differnew file mode 100644 index 0000000..c4fc486 --- /dev/null +++ b/priv/static/assets/site.js.br diff --git a/priv/static/assets/site.js.gz b/priv/static/assets/site.js.gz Binary files differnew file mode 100644 index 0000000..ef81dcf --- /dev/null +++ b/priv/static/assets/site.js.gz diff --git a/priv/static/js/soundmanager2-jsmin.js b/priv/static/js/soundmanager2-jsmin.js deleted file mode 100755 index 31858fd..0000000 --- a/priv/static/js/soundmanager2-jsmin.js +++ /dev/null @@ -1,114 +0,0 @@ -/** @license - - - SoundManager 2: JavaScript Sound for the Web - ---------------------------------------------- - http://schillmania.com/projects/soundmanager2/ - - Copyright (c) 2007, Scott Schiller. All rights reserved. - Code provided under the BSD License: - http://schillmania.com/projects/soundmanager2/license.txt - - V2.97a.20170601 -*/ -(function(h,g){function J(sb,J){function ha(b){return c.preferFlash&&G&&!c.ignoreFlash&&c.flash[b]!==g&&c.flash[b]}function r(b){return function(d){var e=this._s;e&&e._a?d=b.call(this,d):(e&&e.id?c._wD(e.id+": Ignoring "+d.type):c._wD("HTML5::Ignoring "+d.type),d=null);return d}}this.setupOptions={url:sb||null,flashVersion:8,debugMode:!0,debugFlash:!1,useConsole:!0,consoleOnly:!0,waitForWindowLoad:!1,bgColor:"#ffffff",useHighPerformance:!1,flashPollingInterval:null,html5PollingInterval:null,flashLoadTimeout:1E3, -wmode:null,allowScriptAccess:"always",useFlashBlock:!1,useHTML5Audio:!0,forceUseGlobalHTML5Audio:!1,ignoreMobileRestrictions:!1,html5Test:/^(probably|maybe)$/i,preferFlash:!1,noSWFCache:!1,idPrefix:"sound"};this.defaultOptions={autoLoad:!1,autoPlay:!1,from:null,loops:1,onid3:null,onerror:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onposition:null,onstop:null,onfinish:null,multiShot:!0,multiShotEvents:!1,position:null,pan:0,playbackRate:1,stream:!0,to:null, -type:null,usePolicyFile:!1,volume:100};this.flash9Options={onfailure:null,isMovieStar:null,usePeakData:!1,useWaveformData:!1,useEQData:!1,onbufferchange:null,ondataerror:null};this.movieStarOptions={bufferTime:3,serverURL:null,onconnect:null,duration:null};this.audioFormats={mp3:{type:['audio/mpeg; codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],required:!0},mp4:{related:["aac","m4a","m4b"],type:['audio/mp4; codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"], -required:!1},ogg:{type:["audio/ogg; codecs=vorbis"],required:!1},opus:{type:["audio/ogg; codecs=opus","audio/opus"],required:!1},wav:{type:['audio/wav; codecs="1"',"audio/wav","audio/wave","audio/x-wav"],required:!1},flac:{type:["audio/flac"],required:!1}};this.movieID="sm2-container";this.id=J||"sm2movie";this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.versionNumber="V2.97a.20170601";this.altURL=this.movieURL=this.version=null;this.enabled=this.swfLoaded=!1;this.oMC=null; -this.sounds={};this.soundIDs=[];this.didFlashBlock=this.muted=!1;this.filePattern=null;this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.features={buffering:!1,peakData:!1,waveformData:!1,eqData:!1,movieStar:!1};this.sandbox={type:null,types:{remote:"remote (domain-based) rules",localWithFile:"local with file access (no internet access)",localWithNetwork:"local with network (internet access only, no local access)",localTrusted:"local, trusted (local+internet access)"},description:null, -noRemote:null,noLocal:null};this.html5={usingFlash:null};this.flash={};this.ignoreFlash=this.html5Only=!1;var V,c=this,Ya=null,l=null,E,v=navigator.userAgent,ia=h.location.href.toString(),m=document,xa,Za,ya,n,H=[],za=!0,C,W=!1,X=!1,q=!1,y=!1,ja=!1,p,tb=0,Y,A,Aa,Q,Ba,O,R,S,$a,Ca,Da,ka,z,la,P,Ea,Z,ma,na,T,ab,Fa,bb=["log","info","warn","error"],Ga,Ha,cb,aa=null,Ia=null,t,Ja,U,db,oa,pa,K,w,ba=!1,Ka=!1,eb,fb,gb,qa=0,ca=null,ra,L=[],da,u=null,hb,sa,ea,ib,M,ta,La,jb,x,kb=Array.prototype.slice,B=!1,Ma,G, -Na,lb,I,mb,Oa,fa,nb=0,Pa,Qa=v.match(/(ipad|iphone|ipod)/i),Ra=v.match(/android/i),N=v.match(/msie|trident/i),ub=v.match(/webkit/i),ua=v.match(/safari/i)&&!v.match(/chrome/i),Sa=v.match(/opera/i),va=v.match(/(mobile|pre\/|xoom)/i)||Qa||Ra,Ta=!ia.match(/usehtml5audio/i)&&!ia.match(/sm2-ignorebadua/i)&&ua&&!v.match(/silk/i)&&v.match(/OS\sX\s10_6_([3-7])/i),Ua=h.console!==g&&console.log!==g,Va=m.hasFocus!==g?m.hasFocus():null,wa=ua&&(m.hasFocus===g||!m.hasFocus()),ob=!wa,pb=/(mp3|mp4|mpa|m4a|m4b)/i,ga= -m.location?m.location.protocol.match(/http/i):null,vb=ga?"":"//",qb=/^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4|m4v|m4a|m4b|mp4v|3gp|3g2)\s*(?:$|;)/i,rb="mpeg4 aac flv mov mp4 m4v f4v m4a m4b mp4v 3gp 3g2".split(" "),wb=new RegExp("\\.("+rb.join("|")+")(\\?.*)?$","i");this.mimePattern=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.useAltURL=!ga;ib=[null,"MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"];var Wa;try{Wa=Audio!==g&&(Sa&&opera!==g&&10>opera.version()? -new Audio(null):new Audio).canPlayType!==g}catch(xb){Wa=!1}this.hasHTML5=Wa;this.setup=function(b){var d=!c.url;b!==g&&q&&u&&c.ok()&&(b.flashVersion!==g||b.url!==g||b.html5Test!==g)&&K(t("setupLate"));Aa(b);if(!B)if(va){if(!c.setupOptions.ignoreMobileRestrictions||c.setupOptions.forceUseGlobalHTML5Audio)L.push(z.globalHTML5),B=!0}else c.setupOptions.forceUseGlobalHTML5Audio&&(L.push(z.globalHTML5),B=!0);if(!Pa&&va)if(c.setupOptions.ignoreMobileRestrictions)L.push(z.ignoreMobile);else if(c.setupOptions.useHTML5Audio&& -!c.setupOptions.preferFlash||c._wD(z.mobileUA),c.setupOptions.useHTML5Audio=!0,c.setupOptions.preferFlash=!1,Qa)c.ignoreFlash=!0;else if(Ra&&!v.match(/android\s2\.3/i)||!Ra)c._wD(z.globalHTML5),B=!0;b&&(d&&Z&&b.url!==g&&c.beginDelayedInit(),Z||b.url===g||"complete"!==m.readyState||setTimeout(P,1));Pa=!0;return c};this.supported=this.ok=function(){return u?q&&!y:c.useHTML5Audio&&c.hasHTML5};this.getMovie=function(c){return E(c)||m[c]||h[c]};this.createSound=function(b,d){function e(){f=oa(f);c.sounds[f.id]= -new V(f);c.soundIDs.push(f.id);return c.sounds[f.id]}var a,f;a=null;a="soundManager.createSound(): "+t(q?"notOK":"notReady");if(!q||!c.ok())return K(a),!1;d!==g&&(b={id:b,url:d});f=A(b);f.url=ra(f.url);f.id===g&&(f.id=c.setupOptions.idPrefix+nb++);f.id.toString().charAt(0).match(/^[0-9]$/)&&c._wD("soundManager.createSound(): "+t("badID",f.id),2);c._wD("soundManager.createSound(): "+f.id+(f.url?" ("+f.url+")":""),1);if(w(f.id,!0))return c._wD("soundManager.createSound(): "+f.id+" exists",1),c.sounds[f.id]; -if(sa(f))a=e(),c.html5Only||c._wD(f.id+": Using HTML5"),a._setup_html5(f);else{if(c.html5Only)return c._wD(f.id+": No HTML5 support for this sound, and no Flash. Exiting."),e();if(c.html5.usingFlash&&f.url&&f.url.match(/data:/i))return c._wD(f.id+": data: URIs not supported via Flash. Exiting."),e();8<n&&(null===f.isMovieStar&&(f.isMovieStar=!!(f.serverURL||f.type&&f.type.match(qb)||f.url&&f.url.match(wb))),f.isMovieStar&&(c._wD("soundManager.createSound(): using MovieStar handling"),1<f.loops&&p("noNSLoop"))); -f=pa(f,"soundManager.createSound(): ");a=e();8===n?l._createSound(f.id,f.loops||1,f.usePolicyFile):(l._createSound(f.id,f.url,f.usePeakData,f.useWaveformData,f.useEQData,f.isMovieStar,f.isMovieStar?f.bufferTime:!1,f.loops||1,f.serverURL,f.duration||null,f.autoPlay,!0,f.autoLoad,f.usePolicyFile),f.serverURL||(a.connected=!0,f.onconnect&&f.onconnect.apply(a)));f.serverURL||!f.autoLoad&&!f.autoPlay||a.load(f)}!f.serverURL&&f.autoPlay&&a.play();return a};this.destroySound=function(b,d){if(!w(b))return!1; -var e=c.sounds[b],a;e.stop();e._iO={};e.unload();for(a=0;a<c.soundIDs.length;a++)if(c.soundIDs[a]===b){c.soundIDs.splice(a,1);break}d||e.destruct(!0);delete c.sounds[b];return!0};this.load=function(b,d){return w(b)?c.sounds[b].load(d):!1};this.unload=function(b){return w(b)?c.sounds[b].unload():!1};this.onposition=this.onPosition=function(b,d,e,a){return w(b)?c.sounds[b].onposition(d,e,a):!1};this.clearOnPosition=function(b,d,e){return w(b)?c.sounds[b].clearOnPosition(d,e):!1};this.start=this.play= -function(b,d){var e=null,a=d&&!(d instanceof Object);if(!q||!c.ok())return K("soundManager.play(): "+t(q?"notOK":"notReady")),!1;if(w(b,a))a&&(d={url:d});else{if(!a)return!1;a&&(d={url:d});d&&d.url&&(c._wD('soundManager.play(): Attempting to create "'+b+'"',1),d.id=b,e=c.createSound(d).play())}null===e&&(e=c.sounds[b].play(d));return e};this.setPlaybackRate=function(b,d,e){return w(b)?c.sounds[b].setPlaybackRate(d,e):!1};this.setPosition=function(b,d){return w(b)?c.sounds[b].setPosition(d):!1};this.stop= -function(b){if(!w(b))return!1;c._wD("soundManager.stop("+b+")",1);return c.sounds[b].stop()};this.stopAll=function(){var b;c._wD("soundManager.stopAll()",1);for(b in c.sounds)c.sounds.hasOwnProperty(b)&&c.sounds[b].stop()};this.pause=function(b){return w(b)?c.sounds[b].pause():!1};this.pauseAll=function(){var b;for(b=c.soundIDs.length-1;0<=b;b--)c.sounds[c.soundIDs[b]].pause()};this.resume=function(b){return w(b)?c.sounds[b].resume():!1};this.resumeAll=function(){var b;for(b=c.soundIDs.length-1;0<= -b;b--)c.sounds[c.soundIDs[b]].resume()};this.togglePause=function(b){return w(b)?c.sounds[b].togglePause():!1};this.setPan=function(b,d){return w(b)?c.sounds[b].setPan(d):!1};this.setVolume=function(b,d){var e,a;if(b!==g&&!isNaN(b)&&d===g){e=0;for(a=c.soundIDs.length;e<a;e++)c.sounds[c.soundIDs[e]].setVolume(b);return!1}return w(b)?c.sounds[b].setVolume(d):!1};this.mute=function(b){var d=0;b instanceof String&&(b=null);if(b){if(!w(b))return!1;c._wD('soundManager.mute(): Muting "'+b+'"');return c.sounds[b].mute()}c._wD("soundManager.mute(): Muting all sounds"); -for(d=c.soundIDs.length-1;0<=d;d--)c.sounds[c.soundIDs[d]].mute();return c.muted=!0};this.muteAll=function(){c.mute()};this.unmute=function(b){b instanceof String&&(b=null);if(b){if(!w(b))return!1;c._wD('soundManager.unmute(): Unmuting "'+b+'"');return c.sounds[b].unmute()}c._wD("soundManager.unmute(): Unmuting all sounds");for(b=c.soundIDs.length-1;0<=b;b--)c.sounds[c.soundIDs[b]].unmute();c.muted=!1;return!0};this.unmuteAll=function(){c.unmute()};this.toggleMute=function(b){return w(b)?c.sounds[b].toggleMute(): -!1};this.getMemoryUse=function(){var c=0;l&&8!==n&&(c=parseInt(l._getMemoryUse(),10));return c};this.disable=function(b){var d;b===g&&(b=!1);if(y)return!1;y=!0;p("shutdown",1);for(d=c.soundIDs.length-1;0<=d;d--)Ga(c.sounds[c.soundIDs[d]]);Ga(c);Y(b);x.remove(h,"load",R);return!0};this.canPlayMIME=function(b){var d;c.hasHTML5&&(d=ea({type:b}));!d&&u&&(d=b&&c.ok()?!!(8<n&&b.match(qb)||b.match(c.mimePattern)):null);return d};this.canPlayURL=function(b){var d;c.hasHTML5&&(d=ea({url:b}));!d&&u&&(d=b&& -c.ok()?!!b.match(c.filePattern):null);return d};this.canPlayLink=function(b){return b.type!==g&&b.type&&c.canPlayMIME(b.type)?!0:c.canPlayURL(b.href)};this.getSoundById=function(b,d){if(!b)return null;var e=c.sounds[b];e||d||c._wD('soundManager.getSoundById(): Sound "'+b+'" not found.',2);return e};this.onready=function(b,d){if("function"===typeof b)q&&c._wD(t("queue","onready")),d||(d=h),Ba("onready",b,d),O();else throw t("needFunction","onready");return!0};this.ontimeout=function(b,d){if("function"=== -typeof b)q&&c._wD(t("queue","ontimeout")),d||(d=h),Ba("ontimeout",b,d),O({type:"ontimeout"});else throw t("needFunction","ontimeout");return!0};this._writeDebug=function(b,d){var e,a;if(!c.setupOptions.debugMode)return!1;if(Ua&&c.useConsole){if(d&&"object"===typeof d)console.log(b,d);else if(bb[d]!==g)console[bb[d]](b);else console.log(b);if(c.consoleOnly)return!0}e=E("soundmanager-debug");if(!e)return!1;a=m.createElement("div");0===++tb%2&&(a.className="sm2-alt");d=d===g?0:parseInt(d,10);a.appendChild(m.createTextNode(b)); -d&&(2<=d&&(a.style.fontWeight="bold"),3===d&&(a.style.color="#ff3333"));e.insertBefore(a,e.firstChild);return!0};-1!==ia.indexOf("sm2-debug=alert")&&(this._writeDebug=function(c){h.alert(c)});this._wD=this._writeDebug;this._debug=function(){var b,d;p("currentObj",1);b=0;for(d=c.soundIDs.length;b<d;b++)c.sounds[c.soundIDs[b]]._debug()};this.reboot=function(b,d){c.soundIDs.length&&c._wD("Destroying "+c.soundIDs.length+" SMSound object"+(1!==c.soundIDs.length?"s":"")+"...");var e,a,f;for(e=c.soundIDs.length- -1;0<=e;e--)c.sounds[c.soundIDs[e]].destruct();if(l)try{N&&(Ia=l.innerHTML),aa=l.parentNode.removeChild(l)}catch(g){p("badRemove",2)}Ia=aa=u=l=null;c.enabled=Z=q=ba=Ka=W=X=y=B=c.swfLoaded=!1;c.soundIDs=[];c.sounds={};nb=0;Pa=!1;if(b)H=[];else for(e in H)if(H.hasOwnProperty(e))for(a=0,f=H[e].length;a<f;a++)H[e][a].fired=!1;d||c._wD("soundManager: Rebooting...");c.html5={usingFlash:null};c.flash={};c.html5Only=!1;c.ignoreFlash=!1;h.setTimeout(function(){d||c.beginDelayedInit()},20);return c};this.reset= -function(){p("reset");return c.reboot(!0,!0)};this.getMoviePercent=function(){return l&&"PercentLoaded"in l?l.PercentLoaded():null};this.beginDelayedInit=function(){ja=!0;P();setTimeout(function(){if(Ka)return!1;na();la();return Ka=!0},20);S()};this.destruct=function(){c._wD("soundManager.destruct()");c.disable(!0)};V=function(b){var d,e,a=this,f,h,k,F,m,q,r=!1,D=[],v=0,Xa,y,u=null,z;e=d=null;this.sID=this.id=b.id;this.url=b.url;this._iO=this.instanceOptions=this.options=A(b);this.pan=this.options.pan; -this.volume=this.options.volume;this.isHTML5=!1;this._a=null;z=!this.url;this.id3={};this._debug=function(){c._wD(a.id+": Merged options:",a.options)};this.load=function(b){var d=null,e;b!==g?a._iO=A(b,a.options):(b=a.options,a._iO=b,u&&u!==a.url&&(p("manURL"),a._iO.url=a.url,a.url=null));a._iO.url||(a._iO.url=a.url);a._iO.url=ra(a._iO.url);e=a.instanceOptions=a._iO;c._wD(a.id+": load ("+e.url+")");if(!e.url&&!a.url)return c._wD(a.id+": load(): url is unassigned. Exiting.",2),a;a.isHTML5||8!==n|| -a.url||e.autoPlay||c._wD(a.id+": Flash 8 load() limitation: Wait for onload() before calling play().",1);if(e.url===a.url&&0!==a.readyState&&2!==a.readyState)return p("onURL",1),3===a.readyState&&e.onload&&fa(a,function(){e.onload.apply(a,[!!a.duration])}),a;a.loaded=!1;a.readyState=1;a.playState=0;a.id3={};if(sa(e))d=a._setup_html5(e),d._called_load?c._wD(a.id+": Ignoring request to load again"):(a._html5_canplay=!1,a.url!==e.url&&(c._wD(p("manURL")+": "+e.url),a._a.src=e.url,a.setPosition(0)),a._a.autobuffer= -"auto",a._a.preload="auto",a._a._called_load=!0);else{if(c.html5Only)return c._wD(a.id+": No flash support. Exiting."),a;if(a._iO.url&&a._iO.url.match(/data:/i))return c._wD(a.id+": data: URIs not supported via Flash. Exiting."),a;try{a.isHTML5=!1,a._iO=pa(oa(e)),a._iO.autoPlay&&(a._iO.position||a._iO.from)&&(c._wD(a.id+": Disabling autoPlay because of non-zero offset case"),a._iO.autoPlay=!1),e=a._iO,8===n?l._load(a.id,e.url,e.stream,e.autoPlay,e.usePolicyFile):l._load(a.id,e.url,!!e.stream,!!e.autoPlay, -e.loops||1,!!e.autoLoad,e.usePolicyFile)}catch(f){p("smError",2),C("onload",!1),T({type:"SMSOUND_LOAD_JS_EXCEPTION",fatal:!0})}}a.url=e.url;return a};this.unload=function(){0!==a.readyState&&(c._wD(a.id+": unload()"),a.isHTML5?(F(),a._a&&(a._a.pause(),u=ta(a._a))):8===n?l._unload(a.id,"about:blank"):l._unload(a.id),f());return a};this.destruct=function(b){c._wD(a.id+": Destruct");a.isHTML5?(F(),a._a&&(a._a.pause(),ta(a._a),B||k(),a._a._s=null,a._a=null)):(a._iO.onfailure=null,l._destroySound(a.id)); -b||c.destroySound(a.id,!0)};this.start=this.play=function(b,d){var e,f,k,F,h;f=!0;e=a.id+": play(): ";d=d===g?!0:d;b||(b={});a.url&&(a._iO.url=a.url);a._iO=A(a._iO,a.options);a._iO=A(b,a._iO);a._iO.url=ra(a._iO.url);a.instanceOptions=a._iO;if(!a.isHTML5&&a._iO.serverURL&&!a.connected)return a.getAutoPlay()||(c._wD(e+" Netstream not connected yet - setting autoPlay"),a.setAutoPlay(!0)),a;sa(a._iO)&&(a._setup_html5(a._iO),m());if(1===a.playState&&!a.paused){f=a._iO.multiShot;if(!f)return c._wD(e+"Already playing (one-shot)", -1),a.isHTML5&&a.setPosition(a._iO.position),a;c._wD(e+"Already playing (multi-shot)",1)}b.url&&b.url!==a.url&&(a.readyState||a.isHTML5||8!==n||!z?a.load(a._iO):z=!1);if(a.loaded)c._wD(e.substr(0,e.lastIndexOf(":")));else if(0===a.readyState){c._wD(e+"Attempting to load");if(a.isHTML5||c.html5Only)if(a.isHTML5)a.load(a._iO);else return c._wD(e+"Unsupported type. Exiting."),a;else a._iO.autoPlay=!0,a.load(a._iO);a.instanceOptions=a._iO}else{if(2===a.readyState)return c._wD(e+"Could not load - exiting", -2),a;c._wD(e+"Loading - attempting to play...")}!a.isHTML5&&9===n&&0<a.position&&a.position===a.duration&&(c._wD(e+"Sound at end, resetting to position: 0"),b.position=0);a.paused&&0<=a.position&&(!a._iO.serverURL||0<a.position)?(c._wD(e+"Resuming from paused state",1),a.resume()):(a._iO=A(b,a._iO),(!a.isHTML5&&null!==a._iO.position&&0<a._iO.position||null!==a._iO.from&&0<a._iO.from||null!==a._iO.to)&&0===a.instanceCount&&0===a.playState&&!a._iO.serverURL&&(f=function(){a._iO=A(b,a._iO);a.play(a._iO)}, -a.isHTML5&&!a._html5_canplay?(c._wD(e+"Beginning load for non-zero offset case"),a.load({_oncanplay:f})):a.isHTML5||a.loaded||a.readyState&&2===a.readyState||(c._wD(e+"Preloading for non-zero offset case"),a.load({onload:f})),a._iO=y()),(!a.instanceCount||a._iO.multiShotEvents||a.isHTML5&&a._iO.multiShot&&!B||!a.isHTML5&&8<n&&!a.getAutoPlay())&&a.instanceCount++,a._iO.onposition&&0===a.playState&&q(a),a.playState=1,a.paused=!1,a.position=a._iO.position===g||isNaN(a._iO.position)?0:a._iO.position, -a.isHTML5||(a._iO=pa(oa(a._iO))),a._iO.onplay&&d&&(a._iO.onplay.apply(a),r=!0),a.setVolume(a._iO.volume,!0),a.setPan(a._iO.pan,!0),1!==a._iO.playbackRate&&a.setPlaybackRate(a._iO.playbackRate),a.isHTML5?2>a.instanceCount?(m(),e=a._setup_html5(),a.setPosition(a._iO.position),e.play()):(c._wD(a.id+": Cloning Audio() for instance #"+a.instanceCount+"..."),k=new Audio(a._iO.url),F=function(){x.remove(k,"ended",F);a._onfinish(a);ta(k);k=null},h=function(){x.remove(k,"canplay",h);try{k.currentTime=a._iO.position/ -1E3}catch(c){K(a.id+": multiShot play() failed to apply position of "+a._iO.position/1E3)}k.play()},x.add(k,"ended",F),a._iO.volume!==g&&(k.volume=Math.max(0,Math.min(1,a._iO.volume/100))),a.muted&&(k.muted=!0),a._iO.position?x.add(k,"canplay",h):k.play()):(f=l._start(a.id,a._iO.loops||1,9===n?a.position:a.position/1E3,a._iO.multiShot||!1),9!==n||f||(c._wD(e+"No sound hardware, or 32-sound ceiling hit",2),a._iO.onplayerror&&a._iO.onplayerror.apply(a))));return a};this.stop=function(b){var d=a._iO; -1===a.playState&&(c._wD(a.id+": stop()"),a._onbufferchange(0),a._resetOnPosition(0),a.paused=!1,a.isHTML5||(a.playState=0),Xa(),d.to&&a.clearOnPosition(d.to),a.isHTML5?a._a&&(b=a.position,a.setPosition(0),a.position=b,a._a.pause(),a.playState=0,a._onTimer(),F()):(l._stop(a.id,b),d.serverURL&&a.unload()),a.instanceCount=0,a._iO={},d.onstop&&d.onstop.apply(a));return a};this.setAutoPlay=function(b){c._wD(a.id+": Autoplay turned "+(b?"on":"off"));a._iO.autoPlay=b;a.isHTML5||(l._setAutoPlay(a.id,b),b&& -!a.instanceCount&&1===a.readyState&&(a.instanceCount++,c._wD(a.id+": Incremented instance count to "+a.instanceCount)))};this.getAutoPlay=function(){return a._iO.autoPlay};this.setPlaybackRate=function(b){var d=Math.max(.5,Math.min(4,b));d!==b&&c._wD(a.id+": setPlaybackRate("+b+"): limiting rate to "+d,2);if(a.isHTML5)try{a._iO.playbackRate=d,a._a.playbackRate=d}catch(e){c._wD(a.id+": setPlaybackRate("+d+") failed: "+e.message,2)}return a};this.setPosition=function(b){b===g&&(b=0);var d=a.isHTML5? -Math.max(b,0):Math.min(a.duration||a._iO.duration,Math.max(b,0));a.position=d;b=a.position/1E3;a._resetOnPosition(a.position);a._iO.position=d;if(!a.isHTML5)b=9===n?a.position:b,a.readyState&&2!==a.readyState&&l._setPosition(a.id,b,a.paused||!a.playState,a._iO.multiShot);else if(a._a){if(a._html5_canplay){if(a._a.currentTime.toFixed(3)!==b.toFixed(3)){c._wD(a.id+": setPosition("+b+")");try{a._a.currentTime=b,(0===a.playState||a.paused)&&a._a.pause()}catch(e){c._wD(a.id+": setPosition("+b+") failed: "+ -e.message,2)}}}else if(b)return c._wD(a.id+": setPosition("+b+"): Cannot seek yet, sound not ready",2),a;a.paused&&a._onTimer(!0)}return a};this.pause=function(b){if(a.paused||0===a.playState&&1!==a.readyState)return a;c._wD(a.id+": pause()");a.paused=!0;a.isHTML5?(a._setup_html5().pause(),F()):(b||b===g)&&l._pause(a.id,a._iO.multiShot);a._iO.onpause&&a._iO.onpause.apply(a);return a};this.resume=function(){var b=a._iO;if(!a.paused)return a;c._wD(a.id+": resume()");a.paused=!1;a.playState=1;a.isHTML5? -(a._setup_html5().play(),m()):(b.isMovieStar&&!b.serverURL&&a.setPosition(a.position),l._pause(a.id,b.multiShot));!r&&b.onplay?(b.onplay.apply(a),r=!0):b.onresume&&b.onresume.apply(a);return a};this.togglePause=function(){c._wD(a.id+": togglePause()");if(0===a.playState)return a.play({position:9!==n||a.isHTML5?a.position/1E3:a.position}),a;a.paused?a.resume():a.pause();return a};this.setPan=function(b,c){b===g&&(b=0);c===g&&(c=!1);a.isHTML5||l._setPan(a.id,b);a._iO.pan=b;c||(a.pan=b,a.options.pan= -b);return a};this.setVolume=function(b,d){b===g&&(b=100);d===g&&(d=!1);a.isHTML5?a._a&&(c.muted&&!a.muted&&(a.muted=!0,a._a.muted=!0),a._a.volume=Math.max(0,Math.min(1,b/100))):l._setVolume(a.id,c.muted&&!a.muted||a.muted?0:b);a._iO.volume=b;d||(a.volume=b,a.options.volume=b);return a};this.mute=function(){a.muted=!0;a.isHTML5?a._a&&(a._a.muted=!0):l._setVolume(a.id,0);return a};this.unmute=function(){a.muted=!1;var b=a._iO.volume!==g;a.isHTML5?a._a&&(a._a.muted=!1):l._setVolume(a.id,b?a._iO.volume: -a.options.volume);return a};this.toggleMute=function(){return a.muted?a.unmute():a.mute()};this.onposition=this.onPosition=function(b,c,d){D.push({position:parseInt(b,10),method:c,scope:d!==g?d:a,fired:!1});return a};this.clearOnPosition=function(a,b){var c;a=parseInt(a,10);if(!isNaN(a))for(c=0;c<D.length;c++)a!==D[c].position||b&&b!==D[c].method||(D[c].fired&&v--,D.splice(c,1))};this._processOnPosition=function(){var b,c;b=D.length;if(!b||!a.playState||v>=b)return!1;for(--b;0<=b;b--)c=D[b],!c.fired&& -a.position>=c.position&&(c.fired=!0,v++,c.method.apply(c.scope,[c.position]));return!0};this._resetOnPosition=function(a){var b,c;b=D.length;if(!b)return!1;for(--b;0<=b;b--)c=D[b],c.fired&&a<=c.position&&(c.fired=!1,v--);return!0};y=function(){var b=a._iO,d=b.from,e=b.to,f,g;g=function(){c._wD(a.id+': "To" time of '+e+" reached.");a.clearOnPosition(e,g);a.stop()};f=function(){c._wD(a.id+': Playing "from" '+d);if(null!==e&&!isNaN(e))a.onPosition(e,g)};null===d||isNaN(d)||(b.position=d,b.multiShot= -!1,f());return b};q=function(){var b,c=a._iO.onposition;if(c)for(b in c)if(c.hasOwnProperty(b))a.onPosition(parseInt(b,10),c[b])};Xa=function(){var b,c=a._iO.onposition;if(c)for(b in c)c.hasOwnProperty(b)&&a.clearOnPosition(parseInt(b,10))};m=function(){a.isHTML5&&eb(a)};F=function(){a.isHTML5&&fb(a)};f=function(b){b||(D=[],v=0);r=!1;a._hasTimer=null;a._a=null;a._html5_canplay=!1;a.bytesLoaded=null;a.bytesTotal=null;a.duration=a._iO&&a._iO.duration?a._iO.duration:null;a.durationEstimate=null;a.buffered= -[];a.eqData=[];a.eqData.left=[];a.eqData.right=[];a.failures=0;a.isBuffering=!1;a.instanceOptions={};a.instanceCount=0;a.loaded=!1;a.metadata={};a.readyState=0;a.muted=!1;a.paused=!1;a.peakData={left:0,right:0};a.waveformData={left:[],right:[]};a.playState=0;a.position=null;a.id3={}};f();this._onTimer=function(b){var c,f=!1,g={};(a._hasTimer||b)&&a._a&&(b||(0<a.playState||1===a.readyState)&&!a.paused)&&(c=a._get_html5_duration(),c!==d&&(d=c,a.duration=c,f=!0),a.durationEstimate=a.duration,c=1E3*a._a.currentTime|| -0,c!==e&&(e=c,f=!0),(f||b)&&a._whileplaying(c,g,g,g,g));return f};this._get_html5_duration=function(){var b=a._iO;return(b=a._a&&a._a.duration?1E3*a._a.duration:b&&b.duration?b.duration:null)&&!isNaN(b)&&Infinity!==b?b:null};this._apply_loop=function(a,b){!a.loop&&1<b&&c._wD("Note: Native HTML5 looping is infinite.",1);a.loop=1<b?"loop":""};this._setup_html5=function(b){b=A(a._iO,b);var c=B?Ya:a._a,d=decodeURI(b.url),e;B?d===decodeURI(Ma)&&(e=!0):d===decodeURI(u)&&(e=!0);if(c){if(c._s)if(B)c._s&& -c._s.playState&&!e&&c._s.stop();else if(!B&&d===decodeURI(u))return a._apply_loop(c,b.loops),c;e||(u&&f(!1),c.src=b.url,Ma=u=a.url=b.url,c._called_load=!1)}else b.autoLoad||b.autoPlay?(a._a=new Audio(b.url),a._a.load()):a._a=Sa&&10>opera.version()?new Audio(null):new Audio,c=a._a,c._called_load=!1,B&&(Ya=c);a.isHTML5=!0;a._a=c;c._s=a;h();a._apply_loop(c,b.loops);b.autoLoad||b.autoPlay?a.load():(c.autobuffer=!1,c.preload="auto");return c};h=function(){if(a._a._added_events)return!1;var b;a._a._added_events= -!0;for(b in I)I.hasOwnProperty(b)&&a._a&&a._a.addEventListener(b,I[b],!1);return!0};k=function(){var b;c._wD(a.id+": Removing event listeners");a._a._added_events=!1;for(b in I)I.hasOwnProperty(b)&&a._a&&a._a.removeEventListener(b,I[b],!1)};this._onload=function(b){var d=!!b||!a.isHTML5&&8===n&&a.duration;b=a.id+": ";c._wD(b+(d?"onload()":"Failed to load / invalid sound?"+(a.duration?" -":" Zero-length duration reported.")+" ("+a.url+")"),d?1:2);d||a.isHTML5||(!0===c.sandbox.noRemote&&c._wD(b+t("noNet"), -1),!0===c.sandbox.noLocal&&c._wD(b+t("noLocal"),1));a.loaded=d;a.readyState=d?3:2;a._onbufferchange(0);d||a.isHTML5||a._onerror();a._iO.onload&&fa(a,function(){a._iO.onload.apply(a,[d])});return!0};this._onerror=function(b,c){a._iO.onerror&&fa(a,function(){a._iO.onerror.apply(a,[b,c])})};this._onbufferchange=function(b){if(0===a.playState||b&&a.isBuffering||!b&&!a.isBuffering)return!1;a.isBuffering=1===b;a._iO.onbufferchange&&(c._wD(a.id+": Buffer state change: "+b),a._iO.onbufferchange.apply(a,[b])); -return!0};this._onsuspend=function(){a._iO.onsuspend&&(c._wD(a.id+": Playback suspended"),a._iO.onsuspend.apply(a));return!0};this._onfailure=function(b,d,e){a.failures++;c._wD(a.id+": Failure ("+a.failures+"): "+b);if(a._iO.onfailure&&1===a.failures)a._iO.onfailure(b,d,e);else c._wD(a.id+": Ignoring failure")};this._onwarning=function(b,c,d){if(a._iO.onwarning)a._iO.onwarning(b,c,d)};this._onfinish=function(){var b=a._iO.onfinish;a._onbufferchange(0);a._resetOnPosition(0);a.instanceCount&&(a.instanceCount--, -a.instanceCount||(Xa(),a.playState=0,a.paused=!1,a.instanceCount=0,a.instanceOptions={},a._iO={},F(),a.isHTML5&&(a.position=0)),a.instanceCount&&!a._iO.multiShotEvents||!b||(c._wD(a.id+": onfinish()"),fa(a,function(){b.apply(a)})))};this._whileloading=function(b,c,d,e){var f=a._iO;a.bytesLoaded=b;a.bytesTotal=c;a.duration=Math.floor(d);a.bufferLength=e;a.durationEstimate=a.isHTML5||f.isMovieStar?a.duration:f.duration?a.duration>f.duration?a.duration:f.duration:parseInt(a.bytesTotal/a.bytesLoaded* -a.duration,10);a.isHTML5||(a.buffered=[{start:0,end:a.duration}]);(3!==a.readyState||a.isHTML5)&&f.whileloading&&f.whileloading.apply(a)};this._whileplaying=function(b,c,d,e,f){var k=a._iO;if(isNaN(b)||null===b)return!1;a.position=Math.max(0,b);a._processOnPosition();!a.isHTML5&&8<n&&(k.usePeakData&&c!==g&&c&&(a.peakData={left:c.leftPeak,right:c.rightPeak}),k.useWaveformData&&d!==g&&d&&(a.waveformData={left:d.split(","),right:e.split(",")}),k.useEQData&&f!==g&&f&&f.leftEQ&&(b=f.leftEQ.split(","), -a.eqData=b,a.eqData.left=b,f.rightEQ!==g&&f.rightEQ&&(a.eqData.right=f.rightEQ.split(","))));1===a.playState&&(a.isHTML5||8!==n||a.position||!a.isBuffering||a._onbufferchange(0),k.whileplaying&&k.whileplaying.apply(a));return!0};this._oncaptiondata=function(b){c._wD(a.id+": Caption data received.");a.captiondata=b;a._iO.oncaptiondata&&a._iO.oncaptiondata.apply(a,[b])};this._onmetadata=function(b,d){c._wD(a.id+": Metadata received.");var e={},f,g;f=0;for(g=b.length;f<g;f++)e[b[f]]=d[f];a.metadata= -e;a._iO.onmetadata&&a._iO.onmetadata.call(a,a.metadata)};this._onid3=function(b,d){c._wD(a.id+": ID3 data received.");var e=[],f,g;f=0;for(g=b.length;f<g;f++)e[b[f]]=d[f];a.id3=A(a.id3,e);a._iO.onid3&&a._iO.onid3.apply(a)};this._onconnect=function(b){b=1===b;c._wD(a.id+": "+(b?"Connected.":"Failed to connect? - "+a.url),b?1:2);if(a.connected=b)a.failures=0,w(a.id)&&(a.getAutoPlay()?a.play(g,a.getAutoPlay()):a._iO.autoLoad&&a.load()),a._iO.onconnect&&a._iO.onconnect.apply(a,[b])};this._ondataerror= -function(b){0<a.playState&&(c._wD(a.id+": Data error: "+b),a._iO.ondataerror&&a._iO.ondataerror.apply(a))};this._debug()};ma=function(){return m.body||m.getElementsByTagName("div")[0]};E=function(b){return m.getElementById(b)};A=function(b,d){var e=b||{},a,f;a=d===g?c.defaultOptions:d;for(f in a)a.hasOwnProperty(f)&&e[f]===g&&(e[f]="object"!==typeof a[f]||null===a[f]?a[f]:A(e[f],a[f]));return e};fa=function(b,c){b.isHTML5||8!==n?c():h.setTimeout(c,0)};Q={onready:1,ontimeout:1,defaultOptions:1,flash9Options:1, -movieStarOptions:1};Aa=function(b,d){var e,a=!0,f=d!==g,h=c.setupOptions;if(b===g){a=[];for(e in h)h.hasOwnProperty(e)&&a.push(e);for(e in Q)Q.hasOwnProperty(e)&&("object"===typeof c[e]?a.push(e+": {...}"):c[e]instanceof Function?a.push(e+": function() {...}"):a.push(e));c._wD(t("setup",a.join(", ")));return!1}for(e in b)if(b.hasOwnProperty(e))if("object"!==typeof b[e]||null===b[e]||b[e]instanceof Array||b[e]instanceof RegExp)f&&Q[d]!==g?c[d][e]=b[e]:h[e]!==g?(c.setupOptions[e]=b[e],c[e]=b[e]):Q[e]=== -g?(K(t(c[e]===g?"setupUndef":"setupError",e),2),a=!1):c[e]instanceof Function?c[e].apply(c,b[e]instanceof Array?b[e]:[b[e]]):c[e]=b[e];else if(Q[e]===g)K(t(c[e]===g?"setupUndef":"setupError",e),2),a=!1;else return Aa(b[e],e);return a};x=function(){function b(a){a=kb.call(a);var b=a.length;e?(a[1]="on"+a[1],3<b&&a.pop()):3===b&&a.push(!1);return a}function c(b,d){var g=b.shift(),h=[a[d]];if(e)g[h](b[0],b[1]);else g[h].apply(g,b)}var e=h.attachEvent,a={add:e?"attachEvent":"addEventListener",remove:e? -"detachEvent":"removeEventListener"};return{add:function(){c(b(arguments),"add")},remove:function(){c(b(arguments),"remove")}}}();I={abort:r(function(){c._wD(this._s.id+": abort")}),canplay:r(function(){var b=this._s,d;if(!b._html5_canplay){b._html5_canplay=!0;c._wD(b.id+": canplay");b._onbufferchange(0);d=b._iO.position===g||isNaN(b._iO.position)?null:b._iO.position/1E3;if(this.currentTime!==d){c._wD(b.id+": canplay: Setting position to "+d);try{this.currentTime=d}catch(e){c._wD(b.id+": canplay: Setting position of "+ -d+" failed: "+e.message,2)}}b._iO._oncanplay&&b._iO._oncanplay()}}),canplaythrough:r(function(){var b=this._s;b.loaded||(b._onbufferchange(0),b._whileloading(b.bytesLoaded,b.bytesTotal,b._get_html5_duration()),b._onload(!0))}),durationchange:r(function(){var b=this._s,d;d=b._get_html5_duration();isNaN(d)||d===b.duration||(c._wD(this._s.id+": durationchange ("+d+")"+(b.duration?", previously "+b.duration:"")),b.durationEstimate=b.duration=d)}),ended:r(function(){var b=this._s;c._wD(b.id+": ended"); -b._onfinish()}),error:r(function(){var b=ib[this.error.code]||null;c._wD(this._s.id+": HTML5 error, code "+this.error.code+(b?" ("+b+")":""));this._s._onload(!1);this._s._onerror(this.error.code,b)}),loadeddata:r(function(){var b=this._s;c._wD(b.id+": loadeddata");b._loaded||ua||(b.duration=b._get_html5_duration())}),loadedmetadata:r(function(){c._wD(this._s.id+": loadedmetadata")}),loadstart:r(function(){c._wD(this._s.id+": loadstart");this._s._onbufferchange(1)}),play:r(function(){this._s._onbufferchange(0)}), -playing:r(function(){c._wD(this._s.id+": playing "+String.fromCharCode(9835));this._s._onbufferchange(0)}),progress:r(function(b){var d=this._s,e,a,f;e=0;var g="progress"===b.type,k=b.target.buffered,h=b.loaded||0,m=b.total||1;d.buffered=[];if(k&&k.length){e=0;for(a=k.length;e<a;e++)d.buffered.push({start:1E3*k.start(e),end:1E3*k.end(e)});e=1E3*(k.end(0)-k.start(0));h=Math.min(1,e/(1E3*b.target.duration));if(g&&1<k.length){f=[];a=k.length;for(e=0;e<a;e++)f.push(1E3*b.target.buffered.start(e)+"-"+ -1E3*b.target.buffered.end(e));c._wD(this._s.id+": progress, timeRanges: "+f.join(", "))}g&&!isNaN(h)&&c._wD(this._s.id+": progress, "+Math.floor(100*h)+"% loaded")}isNaN(h)||(d._whileloading(h,m,d._get_html5_duration()),h&&m&&h===m&&I.canplaythrough.call(this,b))}),ratechange:r(function(){c._wD(this._s.id+": ratechange")}),suspend:r(function(b){var d=this._s;c._wD(this._s.id+": suspend");I.progress.call(this,b);d._onsuspend()}),stalled:r(function(){c._wD(this._s.id+": stalled")}),timeupdate:r(function(){this._s._onTimer()}), -waiting:r(function(){var b=this._s;c._wD(this._s.id+": waiting");b._onbufferchange(1)})};sa=function(b){return b&&(b.type||b.url||b.serverURL)?b.serverURL||b.type&&ha(b.type)?!1:b.type?ea({type:b.type}):ea({url:b.url})||c.html5Only||b.url.match(/data:/i):!1};ta=function(b){var d;b&&(d=ua?"about:blank":c.html5.canPlayType("audio/wav")?"data:audio/wave;base64,/UklGRiYAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQIAAAD//w==":"about:blank",b.src=d,b._called_unload!==g&&(b._called_load=!1));B&&(Ma=null); -return d};ea=function(b){if(!c.useHTML5Audio||!c.hasHTML5)return!1;var d=b.url||null;b=b.type||null;var e=c.audioFormats,a;if(b&&c.html5[b]!==g)return c.html5[b]&&!ha(b);if(!M){M=[];for(a in e)e.hasOwnProperty(a)&&(M.push(a),e[a].related&&(M=M.concat(e[a].related)));M=new RegExp("\\.("+M.join("|")+")(\\?.*)?$","i")}(a=d?d.toLowerCase().match(M):null)&&a.length?a=a[1]:b&&(d=b.indexOf(";"),a=(-1!==d?b.substr(0,d):b).substr(6));a&&c.html5[a]!==g?d=c.html5[a]&&!ha(a):(b="audio/"+a,d=c.html5.canPlayType({type:b}), -d=(c.html5[a]=d)&&c.html5[b]&&!ha(b));return d};jb=function(){function b(a){var b,e=b=!1;if(!d||"function"!==typeof d.canPlayType)return b;if(a instanceof Array){k=0;for(b=a.length;k<b;k++)if(c.html5[a[k]]||d.canPlayType(a[k]).match(c.html5Test))e=!0,c.html5[a[k]]=!0,c.flash[a[k]]=!!a[k].match(pb);b=e}else a=d&&"function"===typeof d.canPlayType?d.canPlayType(a):!1,b=!(!a||!a.match(c.html5Test));return b}if(!c.useHTML5Audio||!c.hasHTML5)return u=c.html5.usingFlash=!0,!1;var d=Audio!==g?Sa&&10>opera.version()? -new Audio(null):new Audio:null,e,a,f={},h,k;h=c.audioFormats;for(e in h)if(h.hasOwnProperty(e)&&(a="audio/"+e,f[e]=b(h[e].type),f[a]=f[e],e.match(pb)?(c.flash[e]=!0,c.flash[a]=!0):(c.flash[e]=!1,c.flash[a]=!1),h[e]&&h[e].related))for(k=h[e].related.length-1;0<=k;k--)f["audio/"+h[e].related[k]]=f[e],c.html5[h[e].related[k]]=f[e],c.flash[h[e].related[k]]=f[e];f.canPlayType=d?b:null;c.html5=A(c.html5,f);c.html5.usingFlash=hb();u=c.html5.usingFlash;return!0};z={notReady:"Unavailable - wait until onready() has fired.", -notOK:"Audio support is not available.",domError:"soundManagerexception caught while appending SWF to DOM.",spcWmode:"Removing wmode, preventing known SWF loading issue(s)",swf404:"soundManager: Verify that %s is a valid path.",tryDebug:"Try soundManager.debugFlash = true for more security details (output goes to SWF.)",checkSWF:"See SWF output for more debug info.",localFail:"soundManager: Non-HTTP page ("+m.location.protocol+" URL?) Review Flash player security settings for this special case:\nhttp://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html\nMay need to add/allow path, eg. c:/sm2/ or /users/me/sm2/", -waitFocus:"soundManager: Special case: Waiting for SWF to load with window focus...",waitForever:"soundManager: Waiting indefinitely for Flash (will recover if unblocked)...",waitSWF:"soundManager: Waiting for 100% SWF load...",needFunction:"soundManager: Function object expected for %s",badID:'Sound ID "%s" should be a string, starting with a non-numeric character',currentObj:"soundManager: _debug(): Current sound objects",waitOnload:"soundManager: Waiting for window.onload()",docLoaded:"soundManager: Document already loaded", -onload:"soundManager: initComplete(): calling soundManager.onload()",onloadOK:"soundManager.onload() complete",didInit:"soundManager: init(): Already called?",secNote:"Flash security note: Network/internet URLs will not load due to security restrictions. Access can be configured via Flash Player Global Security Settings Page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html",badRemove:"soundManager: Failed to remove Flash node.",shutdown:"soundManager.disable(): Shutting down", -queue:"soundManager: Queueing %s handler",smError:"SMSound.load(): Exception: JS-Flash communication failed, or JS error.",fbTimeout:"No flash response, applying .swf_timedout CSS...",fbLoaded:"Flash loaded",fbHandler:"soundManager: flashBlockHandler()",manURL:"SMSound.load(): Using manually-assigned URL",onURL:"soundManager.load(): current URL already assigned.",badFV:'soundManager.flashVersion must be 8 or 9. "%s" is invalid. Reverting to %s.',as2loop:"Note: Setting stream:false so looping can work (flash 8 limitation)", -noNSLoop:"Note: Looping not implemented for MovieStar formats",needfl9:"Note: Switching to flash 9, required for MP4 formats.",mfTimeout:"Setting flashLoadTimeout = 0 (infinite) for off-screen, mobile flash case",needFlash:"soundManager: Fatal error: Flash is needed to play some required formats, but is not available.",gotFocus:"soundManager: Got window focus.",policy:"Enabling usePolicyFile for data access",setup:"soundManager.setup(): allowed parameters: %s",setupError:'soundManager.setup(): "%s" cannot be assigned with this method.', -setupUndef:'soundManager.setup(): Could not find option "%s"',setupLate:"soundManager.setup(): url, flashVersion and html5Test property changes will not take effect until reboot().",noURL:"soundManager: Flash URL required. Call soundManager.setup({url:...}) to get started.",sm2Loaded:"SoundManager 2: Ready. "+String.fromCharCode(10003),reset:"soundManager.reset(): Removing event callbacks",mobileUA:"Mobile UA detected, preferring HTML5 by default.",globalHTML5:"Using singleton HTML5 Audio() pattern for this device.", -ignoreMobile:"Ignoring mobile restrictions for this device."};t=function(){var b,c,e,a;b=kb.call(arguments);c=b.shift();if((a=z&&z[c]?z[c]:"")&&b&&b.length)for(c=0,e=b.length;c<e;c++)a=a.replace("%s",b[c]);return a};oa=function(b){8===n&&1<b.loops&&b.stream&&(p("as2loop"),b.stream=!1);return b};pa=function(b,d){b&&!b.usePolicyFile&&(b.onid3||b.usePeakData||b.useWaveformData||b.useEQData)&&(c._wD((d||"")+t("policy")),b.usePolicyFile=!0);return b};K=function(b){Ua&&console.warn!==g?console.warn(b): -c._wD(b)};xa=function(){return!1};Ga=function(b){for(var c in b)b.hasOwnProperty(c)&&"function"===typeof b[c]&&(b[c]=xa)};Ha=function(b){b===g&&(b=!1);(y||b)&&c.disable(b)};cb=function(b){var d=null;if(b)if(b.match(/\.swf(\?.*)?$/i)){if(d=b.substr(b.toLowerCase().lastIndexOf(".swf?")+4))return b}else b.lastIndexOf("/")!==b.length-1&&(b+="/");b=(b&&-1!==b.lastIndexOf("/")?b.substr(0,b.lastIndexOf("/")+1):"./")+c.movieURL;c.noSWFCache&&(b+="?ts="+(new Date).getTime());return b};Da=function(){n=parseInt(c.flashVersion, -10);8!==n&&9!==n&&(c._wD(t("badFV",n,8)),c.flashVersion=n=8);var b=c.debugMode||c.debugFlash?"_debug.swf":".swf";c.useHTML5Audio&&!c.html5Only&&c.audioFormats.mp4.required&&9>n&&(c._wD(t("needfl9")),c.flashVersion=n=9);c.version=c.versionNumber+(c.html5Only?" (HTML5-only mode)":9===n?" (AS3/Flash 9)":" (AS2/Flash 8)");8<n?(c.defaultOptions=A(c.defaultOptions,c.flash9Options),c.features.buffering=!0,c.defaultOptions=A(c.defaultOptions,c.movieStarOptions),c.filePatterns.flash9=new RegExp("\\.(mp3|"+ -rb.join("|")+")(\\?.*)?$","i"),c.features.movieStar=!0):c.features.movieStar=!1;c.filePattern=c.filePatterns[8!==n?"flash9":"flash8"];c.movieURL=(8===n?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",b);c.features.peakData=c.features.waveformData=c.features.eqData=8<n};ab=function(b,c){l&&l._setPolling(b,c)};Fa=function(){c.debugURLParam.test(ia)&&(c.setupOptions.debugMode=c.debugMode=!0);if(!E(c.debugID)){var b,d,e,a;if(!(!c.debugMode||E(c.debugID)||Ua&&c.useConsole&&c.consoleOnly)){b= -m.createElement("div");b.id=c.debugID+"-toggle";d={position:"fixed",bottom:"0px",right:"0px",width:"1.2em",height:"1.2em",lineHeight:"1.2em",margin:"2px",textAlign:"center",border:"1px solid #999",cursor:"pointer",background:"#fff",color:"#333",zIndex:10001};b.appendChild(m.createTextNode("-"));b.onclick=db;b.title="Toggle SM2 debug console";v.match(/msie 6/i)&&(b.style.position="absolute",b.style.cursor="hand");for(a in d)d.hasOwnProperty(a)&&(b.style[a]=d[a]);d=m.createElement("div");d.id=c.debugID; -d.style.display=c.debugMode?"block":"none";if(c.debugMode&&!E(b.id)){try{e=ma(),e.appendChild(b)}catch(f){throw Error(t("domError")+" \n"+f.toString());}e.appendChild(d)}}}};w=this.getSoundById;p=function(b,d){return b?c._wD(t(b),d):""};db=function(){var b=E(c.debugID),d=E(c.debugID+"-toggle");b&&(za?(d.innerHTML="+",b.style.display="none"):(d.innerHTML="-",b.style.display="block"),za=!za)};C=function(b,c,e){if(h.sm2Debugger!==g)try{sm2Debugger.handleEvent(b,c,e)}catch(a){return!1}return!0};U=function(){var b= -[];c.debugMode&&b.push("sm2_debug");c.debugFlash&&b.push("flash_debug");c.useHighPerformance&&b.push("high_performance");return b.join(" ")};Ja=function(){var b=t("fbHandler"),d=c.getMoviePercent(),e={type:"FLASHBLOCK"};c.html5Only||(c.ok()?(c.didFlashBlock&&c._wD(b+": Unblocked"),c.oMC&&(c.oMC.className=[U(),"movieContainer","swf_loaded"+(c.didFlashBlock?" swf_unblocked":"")].join(" "))):(u&&(c.oMC.className=U()+" movieContainer "+(null===d?"swf_timedout":"swf_error"),c._wD(b+": "+t("fbTimeout")+ -(d?" ("+t("fbLoaded")+")":""))),c.didFlashBlock=!0,O({type:"ontimeout",ignoreInit:!0,error:e}),T(e)))};Ba=function(b,c,e){H[b]===g&&(H[b]=[]);H[b].push({method:c,scope:e||null,fired:!1})};O=function(b){b||(b={type:c.ok()?"onready":"ontimeout"});if(!q&&b&&!b.ignoreInit||"ontimeout"===b.type&&(c.ok()||y&&!b.ignoreInit))return!1;var d={success:b&&b.ignoreInit?c.ok():!y},e=b&&b.type?H[b.type]||[]:[],a=[],f,d=[d],g=u&&!c.ok();b.error&&(d[0].error=b.error);b=0;for(f=e.length;b<f;b++)!0!==e[b].fired&&a.push(e[b]); -if(a.length)for(b=0,f=a.length;b<f;b++)a[b].scope?a[b].method.apply(a[b].scope,d):a[b].method.apply(this,d),g||(a[b].fired=!0);return!0};R=function(){h.setTimeout(function(){c.useFlashBlock&&Ja();O();"function"===typeof c.onload&&(p("onload",1),c.onload.apply(h),p("onloadOK",1));c.waitForWindowLoad&&x.add(h,"load",R)},1)};Na=function(){if(G!==g)return G;var b=!1,c=navigator,e,a=h.ActiveXObject,f;try{f=c.plugins}catch(m){f=void 0}if(f&&f.length)(c=c.mimeTypes)&&c["application/x-shockwave-flash"]&& -c["application/x-shockwave-flash"].enabledPlugin&&c["application/x-shockwave-flash"].enabledPlugin.description&&(b=!0);else if(a!==g&&!v.match(/MSAppHost/i)){try{e=new a("ShockwaveFlash.ShockwaveFlash")}catch(k){e=null}b=!!e}return G=b};hb=function(){var b,d,e=c.audioFormats;Qa&&v.match(/os (1|2|3_0|3_1)\s/i)?(c.hasHTML5=!1,c.html5Only=!0,c.oMC&&(c.oMC.style.display="none")):c.useHTML5Audio&&(c.html5&&c.html5.canPlayType||(c._wD("SoundManager: No HTML5 Audio() support detected."),c.hasHTML5=!1),Ta&& -c._wD("soundManager: Note: Buggy HTML5 Audio in Safari on this OS X release, see https://bugs.webkit.org/show_bug.cgi?id=32159 - "+(G?"will use flash fallback for MP3/MP4, if available":" would use flash fallback for MP3/MP4, but none detected."),1));if(c.useHTML5Audio&&c.hasHTML5)for(d in da=!0,e)e.hasOwnProperty(d)&&e[d].required&&(c.html5.canPlayType(e[d].type)?c.preferFlash&&(c.flash[d]||c.flash[e[d].type])&&(b=!0):(da=!1,b=!0));c.ignoreFlash&&(b=!1,da=!0);c.html5Only=c.hasHTML5&&c.useHTML5Audio&& -!b;return!c.html5Only};ra=function(b){var d,e,a=0;if(b instanceof Array){d=0;for(e=b.length;d<e;d++)if(b[d]instanceof Object){if(c.canPlayMIME(b[d].type)){a=d;break}}else if(c.canPlayURL(b[d])){a=d;break}b[a].url&&(b[a]=b[a].url);b=b[a]}return b};eb=function(b){b._hasTimer||(b._hasTimer=!0,!va&&c.html5PollingInterval&&(null===ca&&0===qa&&(ca=setInterval(gb,c.html5PollingInterval)),qa++))};fb=function(b){b._hasTimer&&(b._hasTimer=!1,!va&&c.html5PollingInterval&&qa--)};gb=function(){var b;if(null=== -ca||qa)for(b=c.soundIDs.length-1;0<=b;b--)c.sounds[c.soundIDs[b]].isHTML5&&c.sounds[c.soundIDs[b]]._hasTimer&&c.sounds[c.soundIDs[b]]._onTimer();else clearInterval(ca),ca=null};T=function(b){b=b!==g?b:{};"function"===typeof c.onerror&&c.onerror.apply(h,[{type:b.type!==g?b.type:null}]);b.fatal!==g&&b.fatal&&c.disable()};lb=function(){if(Ta&&Na()){var b=c.audioFormats,d,e;for(e in b)if(b.hasOwnProperty(e)&&("mp3"===e||"mp4"===e)&&(c._wD("soundManager: Using flash fallback for "+e+" format"),c.html5[e]= -!1,b[e]&&b[e].related))for(d=b[e].related.length-1;0<=d;d--)c.html5[b[e].related[d]]=!1}};this._setSandboxType=function(b){var d=c.sandbox;d.type=b;d.description=d.types[d.types[b]!==g?b:"unknown"];"localWithFile"===d.type?(d.noRemote=!0,d.noLocal=!1,p("secNote",2)):"localWithNetwork"===d.type?(d.noRemote=!1,d.noLocal=!0):"localTrusted"===d.type&&(d.noRemote=!1,d.noLocal=!1)};this._externalInterfaceOK=function(b){if(!c.swfLoaded){var d;C("swf",!0);C("flashtojs",!0);c.swfLoaded=!0;wa=!1;Ta&&lb();b&& -b.replace(/\+dev/i,"")===c.versionNumber.replace(/\+dev/i,"")?setTimeout(ya,N?100:1):(d='soundManager: Fatal: JavaScript file build "'+c.versionNumber+'" does not match Flash SWF build "'+b+'" at '+c.url+". Ensure both are up-to-date.",setTimeout(function(){throw Error(d);},0))}};na=function(b,d){function e(){var a=[],b,d=[];b="SoundManager "+c.version+(!c.html5Only&&c.useHTML5Audio?c.hasHTML5?" + HTML5 audio":", no HTML5 audio support":"");c.html5Only?c.html5PollingInterval&&a.push("html5PollingInterval ("+ -c.html5PollingInterval+"ms)"):(c.preferFlash&&a.push("preferFlash"),c.useHighPerformance&&a.push("useHighPerformance"),c.flashPollingInterval&&a.push("flashPollingInterval ("+c.flashPollingInterval+"ms)"),c.html5PollingInterval&&a.push("html5PollingInterval ("+c.html5PollingInterval+"ms)"),c.wmode&&a.push("wmode ("+c.wmode+")"),c.debugFlash&&a.push("debugFlash"),c.useFlashBlock&&a.push("flashBlock"));a.length&&(d=d.concat([a.join(" + ")]));c._wD(b+(d.length?" + "+d.join(", "):""),1);mb()}function a(a, -b){return'<param name="'+a+'" value="'+b+'" />'}if(W&&X)return!1;if(c.html5Only)return Da(),e(),c.oMC=E(c.movieID),ya(),X=W=!0,!1;var f=d||c.url,h=c.altURL||f,k=ma(),l=U(),n=null,n=m.getElementsByTagName("html")[0],p,r,q,n=n&&n.dir&&n.dir.match(/rtl/i);b=b===g?c.id:b;Da();c.url=cb(ga?f:h);d=c.url;c.wmode=!c.wmode&&c.useHighPerformance?"transparent":c.wmode;null!==c.wmode&&(v.match(/msie 8/i)||!N&&!c.useHighPerformance)&&navigator.platform.match(/win32|win64/i)&&(L.push(z.spcWmode),c.wmode=null);k= -{name:b,id:b,src:d,quality:"high",allowScriptAccess:c.allowScriptAccess,bgcolor:c.bgColor,pluginspage:vb+"www.macromedia.com/go/getflashplayer",title:"JS/Flash audio component (SoundManager 2)",type:"application/x-shockwave-flash",wmode:c.wmode,hasPriority:"true"};c.debugFlash&&(k.FlashVars="debug=1");c.wmode||delete k.wmode;if(N)f=m.createElement("div"),r=['<object id="'+b+'" data="'+d+'" type="'+k.type+'" title="'+k.title+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">', -a("movie",d),a("AllowScriptAccess",c.allowScriptAccess),a("quality",k.quality),c.wmode?a("wmode",c.wmode):"",a("bgcolor",c.bgColor),a("hasPriority","true"),c.debugFlash?a("FlashVars",k.FlashVars):"","</object>"].join("");else for(p in f=m.createElement("embed"),k)k.hasOwnProperty(p)&&f.setAttribute(p,k[p]);Fa();l=U();if(k=ma())if(c.oMC=E(c.movieID)||m.createElement("div"),c.oMC.id)q=c.oMC.className,c.oMC.className=(q?q+" ":"movieContainer")+(l?" "+l:""),c.oMC.appendChild(f),N&&(p=c.oMC.appendChild(m.createElement("div")), -p.className="sm2-object-box",p.innerHTML=r),X=!0;else{c.oMC.id=c.movieID;c.oMC.className="movieContainer "+l;p=l=null;c.useFlashBlock||(c.useHighPerformance?l={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"}:(l={position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"},n&&(l.left=Math.abs(parseInt(l.left,10))+"px")));ub&&(c.oMC.style.zIndex=1E4);if(!c.debugFlash)for(q in l)l.hasOwnProperty(q)&&(c.oMC.style[q]=l[q]);try{N||c.oMC.appendChild(f), -k.appendChild(c.oMC),N&&(p=c.oMC.appendChild(m.createElement("div")),p.className="sm2-object-box",p.innerHTML=r),X=!0}catch(u){throw Error(t("domError")+" \n"+u.toString());}}W=!0;e();return!0};la=function(){if(c.html5Only)return na(),!1;if(l)return!1;if(!c.url)return p("noURL"),!1;l=c.getMovie(c.id);l||(aa?(N?c.oMC.innerHTML=Ia:c.oMC.appendChild(aa),aa=null,W=!0):na(c.id,c.url),l=c.getMovie(c.id));"function"===typeof c.oninitmovie&&setTimeout(c.oninitmovie,1);Oa();return!0};S=function(){setTimeout($a, -1E3)};Ca=function(){h.setTimeout(function(){K("soundManager: useFlashBlock is false, 100% HTML5 mode is possible. Rebooting with preferFlash: false...");c.setup({preferFlash:!1}).reboot();c.didFlashBlock=!0;c.beginDelayedInit()},1)};$a=function(){var b,d=!1;c.url&&!ba&&(ba=!0,x.remove(h,"load",S),G&&wa&&!Va?p("waitFocus"):(q||(b=c.getMoviePercent(),0<b&&100>b&&(d=!0)),setTimeout(function(){b=c.getMoviePercent();d?(ba=!1,c._wD(t("waitSWF")),h.setTimeout(S,1)):(q||(c._wD("soundManager: No Flash response within expected time. Likely causes: "+ -(0===b?"SWF load failed, ":"")+"Flash blocked or JS-Flash security error."+(c.debugFlash?" "+t("checkSWF"):""),2),!ga&&b&&(p("localFail",2),c.debugFlash||p("tryDebug",2)),0===b&&c._wD(t("swf404",c.url),1),C("flashtojs",!1,": Timed out"+(ga?" (Check flash security or flash blockers)":" (No plugin/missing SWF?)"))),!q&&ob&&(null===b?c.useFlashBlock||0===c.flashLoadTimeout?(c.useFlashBlock&&Ja(),p("waitForever")):!c.useFlashBlock&&da?Ca():(p("waitForever"),O({type:"ontimeout",ignoreInit:!0,error:{type:"INIT_FLASHBLOCK"}})): -0===c.flashLoadTimeout?p("waitForever"):!c.useFlashBlock&&da?Ca():Ha(!0)))},c.flashLoadTimeout)))};ka=function(){if(Va||!wa)return x.remove(h,"focus",ka),!0;Va=ob=!0;p("gotFocus");ba=!1;S();x.remove(h,"focus",ka);return!0};Oa=function(){L.length&&(c._wD("SoundManager 2: "+L.join(" "),1),L=[])};mb=function(){Oa();var b,d=[];if(c.useHTML5Audio&&c.hasHTML5){for(b in c.audioFormats)c.audioFormats.hasOwnProperty(b)&&d.push(b+" = "+c.html5[b]+(!c.html5[b]&&u&&c.flash[b]?" (using flash)":c.preferFlash&& -c.flash[b]&&u?" (preferring flash)":c.html5[b]?"":" ("+(c.audioFormats[b].required?"required, ":"")+"and no flash support)"));c._wD("SoundManager 2 HTML5 support: "+d.join(", "),1)}};Y=function(b){if(q)return!1;if(c.html5Only)return p("sm2Loaded",1),q=!0,R(),C("onload",!0),!0;var d=!0,e;c.useFlashBlock&&c.flashLoadTimeout&&!c.getMoviePercent()||(q=!0);e={type:!G&&u?"NO_FLASH":"INIT_TIMEOUT"};c._wD("SoundManager 2 "+(y?"failed to load":"loaded")+" ("+(y?"Flash security/load error":"OK")+") "+String.fromCharCode(y? -10006:10003),y?2:1);y||b?(c.useFlashBlock&&c.oMC&&(c.oMC.className=U()+" "+(null===c.getMoviePercent()?"swf_timedout":"swf_error")),O({type:"ontimeout",error:e,ignoreInit:!0}),C("onload",!1),T(e),d=!1):C("onload",!0);y||(c.waitForWindowLoad&&!ja?(p("waitOnload"),x.add(h,"load",R)):(c.waitForWindowLoad&&ja&&p("docLoaded"),R()));return d};Za=function(){var b,d=c.setupOptions;for(b in d)d.hasOwnProperty(b)&&(c[b]===g?c[b]=d[b]:c[b]!==d[b]&&(c.setupOptions[b]=c[b]))};ya=function(){if(q)return p("didInit"), -!1;if(c.html5Only)return q||(x.remove(h,"load",c.beginDelayedInit),c.enabled=!0,Y()),!0;la();try{l._externalInterfaceTest(!1),ab(!0,c.flashPollingInterval||(c.useHighPerformance?10:50)),c.debugMode||l._disableDebug(),c.enabled=!0,C("jstoflash",!0),c.html5Only||x.add(h,"unload",xa)}catch(b){return c._wD("js/flash exception: "+b.toString()),C("jstoflash",!1),T({type:"JS_TO_FLASH_EXCEPTION",fatal:!0}),Ha(!0),Y(),!1}Y();x.remove(h,"load",c.beginDelayedInit);return!0};P=function(){if(Z)return!1;Z=!0;Za(); -Fa();!G&&c.hasHTML5&&(c._wD("SoundManager 2: No Flash detected"+(c.useHTML5Audio?". Trying HTML5-only mode.":", enabling HTML5."),1),c.setup({useHTML5Audio:!0,preferFlash:!1}));jb();!G&&u&&(L.push(z.needFlash),c.setup({flashLoadTimeout:1}));m.removeEventListener&&m.removeEventListener("DOMContentLoaded",P,!1);la();return!0};La=function(){"complete"===m.readyState&&(P(),m.detachEvent("onreadystatechange",La));return!0};Ea=function(){ja=!0;P();x.remove(h,"load",Ea)};Na();x.add(h,"focus",ka);x.add(h, -"load",S);x.add(h,"load",Ea);m.addEventListener?m.addEventListener("DOMContentLoaded",P,!1):m.attachEvent?m.attachEvent("onreadystatechange",La):(C("onload",!1),T({type:"NO_DOM2_EVENTS",fatal:!0}))}if(!h||!h.document)throw Error("SoundManager requires a browser with window and document objects.");var V=null;h.SM2_DEFER!==g&&SM2_DEFER||(V=new J);"object"===typeof module&&module&&"object"===typeof module.exports?(module.exports.SoundManager=J,module.exports.soundManager=V):"function"===typeof define&& -define.amd&&define(function(){return{constructor:J,getInstance:function(g){!h.soundManager&&g instanceof Function&&(g=g(J),g instanceof J&&(h.soundManager=g));return h.soundManager}}});h.SoundManager=J;h.soundManager=V})(window);
\ No newline at end of file diff --git a/priv/static/js/soundmanager2-nodebug-jsmin.js b/priv/static/js/soundmanager2-nodebug-jsmin.js deleted file mode 100755 index 3f2d704..0000000 --- a/priv/static/js/soundmanager2-nodebug-jsmin.js +++ /dev/null @@ -1,84 +0,0 @@ -/** @license
- *
- * SoundManager 2: JavaScript Sound for the Web
- * ----------------------------------------------
- * http://schillmania.com/projects/soundmanager2/
- *
- * Copyright (c) 2007, Scott Schiller. All rights reserved.
- * Code provided under the BSD License:
- * http://schillmania.com/projects/soundmanager2/license.txt
- *
- * V2.97a.20170601
- */
-(function(g,h){function v(gb,v){function Z(b){return c.preferFlash&&z&&!c.ignoreFlash&&c.flash[b]!==h&&c.flash[b]}function q(b){return function(c){var d=this._s;return d&&d._a?b.call(this,c):null}}this.setupOptions={url:gb||null,flashVersion:8,debugMode:!0,debugFlash:!1,useConsole:!0,consoleOnly:!0,waitForWindowLoad:!1,bgColor:"#ffffff",useHighPerformance:!1,flashPollingInterval:null,html5PollingInterval:null,flashLoadTimeout:1E3,wmode:null,allowScriptAccess:"always",useFlashBlock:!1,useHTML5Audio:!0, -forceUseGlobalHTML5Audio:!1,ignoreMobileRestrictions:!1,html5Test:/^(probably|maybe)$/i,preferFlash:!1,noSWFCache:!1,idPrefix:"sound"};this.defaultOptions={autoLoad:!1,autoPlay:!1,from:null,loops:1,onid3:null,onerror:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onposition:null,onstop:null,onfinish:null,multiShot:!0,multiShotEvents:!1,position:null,pan:0,playbackRate:1,stream:!0,to:null,type:null,usePolicyFile:!1,volume:100};this.flash9Options={onfailure:null, -isMovieStar:null,usePeakData:!1,useWaveformData:!1,useEQData:!1,onbufferchange:null,ondataerror:null};this.movieStarOptions={bufferTime:3,serverURL:null,onconnect:null,duration:null};this.audioFormats={mp3:{type:['audio/mpeg; codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],required:!0},mp4:{related:["aac","m4a","m4b"],type:['audio/mp4; codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"],required:!1},ogg:{type:["audio/ogg; codecs=vorbis"],required:!1}, -opus:{type:["audio/ogg; codecs=opus","audio/opus"],required:!1},wav:{type:['audio/wav; codecs="1"',"audio/wav","audio/wave","audio/x-wav"],required:!1},flac:{type:["audio/flac"],required:!1}};this.movieID="sm2-container";this.id=v||"sm2movie";this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.versionNumber="V2.97a.20170601";this.altURL=this.movieURL=this.version=null;this.enabled=this.swfLoaded=!1;this.oMC=null;this.sounds={};this.soundIDs=[];this.didFlashBlock=this.muted= -!1;this.filePattern=null;this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.features={buffering:!1,peakData:!1,waveformData:!1,eqData:!1,movieStar:!1};this.sandbox={};this.html5={usingFlash:null};this.flash={};this.ignoreFlash=this.html5Only=!1;var M,c=this,Na=null,k=null,aa,t=navigator.userAgent,Oa=g.location.href.toString(),n=document,oa,Pa,pa,m,x=[],N=!1,O=!1,l=!1,A=!1,qa=!1,P,w,ra,ba,sa,E,G,H,Qa,ta,ua,ca,I,da,F,va,Q,wa,ea,J,Ra,xa,ya,za,Sa,R=null,Aa=null,S,Ba,K,fa,ga,p,T= -!1,Ca=!1,Ta,Ua,Va,ha=0,U=null,ia,V=[],W,u=null,Wa,ja,X,Xa,C,ka,Da,Ya,r,hb=Array.prototype.slice,y=!1,Ea,z,Fa,Za,B,Y,$a=0,Ga,Ha=t.match(/(ipad|iphone|ipod)/i),Ia=t.match(/android/i),D=t.match(/msie|trident/i),ib=t.match(/webkit/i),la=t.match(/safari/i)&&!t.match(/chrome/i),Ja=t.match(/opera/i),ma=t.match(/(mobile|pre\/|xoom)/i)||Ha||Ia,ab=!Oa.match(/usehtml5audio/i)&&!Oa.match(/sm2-ignorebadua/i)&&la&&!t.match(/silk/i)&&t.match(/OS\sX\s10_6_([3-7])/i),Ka=n.hasFocus!==h?n.hasFocus():null,na=la&&(n.hasFocus=== -h||!n.hasFocus()),bb=!na,cb=/(mp3|mp4|mpa|m4a|m4b)/i,La=n.location?n.location.protocol.match(/http/i):null,jb=La?"":"//",db=/^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4|m4v|m4a|m4b|mp4v|3gp|3g2)\s*(?:$|;)/i,eb="mpeg4 aac flv mov mp4 m4v f4v m4a m4b mp4v 3gp 3g2".split(" "),kb=new RegExp("\\.("+eb.join("|")+")(\\?.*)?$","i");this.mimePattern=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.useAltURL=!La;Xa=[null,"MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"]; -var Ma;try{Ma=Audio!==h&&(Ja&&opera!==h&&10>opera.version()?new Audio(null):new Audio).canPlayType!==h}catch(lb){Ma=!1}this.hasHTML5=Ma;this.setup=function(b){var e=!c.url;b!==h&&l&&u&&c.ok();ra(b);if(!y)if(ma){if(!c.setupOptions.ignoreMobileRestrictions||c.setupOptions.forceUseGlobalHTML5Audio)V.push(I.globalHTML5),y=!0}else c.setupOptions.forceUseGlobalHTML5Audio&&(V.push(I.globalHTML5),y=!0);if(!Ga&&ma)if(c.setupOptions.ignoreMobileRestrictions)V.push(I.ignoreMobile);else if(c.setupOptions.useHTML5Audio= -!0,c.setupOptions.preferFlash=!1,Ha)c.ignoreFlash=!0;else if(Ia&&!t.match(/android\s2\.3/i)||!Ia)y=!0;b&&(e&&Q&&b.url!==h&&c.beginDelayedInit(),Q||b.url===h||"complete"!==n.readyState||setTimeout(F,1));Ga=!0;return c};this.supported=this.ok=function(){return u?l&&!A:c.useHTML5Audio&&c.hasHTML5};this.getMovie=function(b){return aa(b)||n[b]||g[b]};this.createSound=function(b,e){function d(){a=fa(a);c.sounds[a.id]=new M(a);c.soundIDs.push(a.id);return c.sounds[a.id]}var a,f=null;if(!l||!c.ok())return!1; -e!==h&&(b={id:b,url:e});a=w(b);a.url=ia(a.url);a.id===h&&(a.id=c.setupOptions.idPrefix+$a++);if(p(a.id,!0))return c.sounds[a.id];if(ja(a))f=d(),f._setup_html5(a);else{if(c.html5Only||c.html5.usingFlash&&a.url&&a.url.match(/data:/i))return d();8<m&&null===a.isMovieStar&&(a.isMovieStar=!!(a.serverURL||a.type&&a.type.match(db)||a.url&&a.url.match(kb)));a=ga(a,void 0);f=d();8===m?k._createSound(a.id,a.loops||1,a.usePolicyFile):(k._createSound(a.id,a.url,a.usePeakData,a.useWaveformData,a.useEQData,a.isMovieStar, -a.isMovieStar?a.bufferTime:!1,a.loops||1,a.serverURL,a.duration||null,a.autoPlay,!0,a.autoLoad,a.usePolicyFile),a.serverURL||(f.connected=!0,a.onconnect&&a.onconnect.apply(f)));a.serverURL||!a.autoLoad&&!a.autoPlay||f.load(a)}!a.serverURL&&a.autoPlay&&f.play();return f};this.destroySound=function(b,e){if(!p(b))return!1;var d=c.sounds[b],a;d.stop();d._iO={};d.unload();for(a=0;a<c.soundIDs.length;a++)if(c.soundIDs[a]===b){c.soundIDs.splice(a,1);break}e||d.destruct(!0);delete c.sounds[b];return!0};this.load= -function(b,e){return p(b)?c.sounds[b].load(e):!1};this.unload=function(b){return p(b)?c.sounds[b].unload():!1};this.onposition=this.onPosition=function(b,e,d,a){return p(b)?c.sounds[b].onposition(e,d,a):!1};this.clearOnPosition=function(b,e,d){return p(b)?c.sounds[b].clearOnPosition(e,d):!1};this.start=this.play=function(b,e){var d=null,a=e&&!(e instanceof Object);if(!l||!c.ok())return!1;if(p(b,a))a&&(e={url:e});else{if(!a)return!1;a&&(e={url:e});e&&e.url&&(e.id=b,d=c.createSound(e).play())}null=== -d&&(d=c.sounds[b].play(e));return d};this.setPlaybackRate=function(b,e,d){return p(b)?c.sounds[b].setPlaybackRate(e,d):!1};this.setPosition=function(b,e){return p(b)?c.sounds[b].setPosition(e):!1};this.stop=function(b){return p(b)?c.sounds[b].stop():!1};this.stopAll=function(){for(var b in c.sounds)c.sounds.hasOwnProperty(b)&&c.sounds[b].stop()};this.pause=function(b){return p(b)?c.sounds[b].pause():!1};this.pauseAll=function(){var b;for(b=c.soundIDs.length-1;0<=b;b--)c.sounds[c.soundIDs[b]].pause()}; -this.resume=function(b){return p(b)?c.sounds[b].resume():!1};this.resumeAll=function(){var b;for(b=c.soundIDs.length-1;0<=b;b--)c.sounds[c.soundIDs[b]].resume()};this.togglePause=function(b){return p(b)?c.sounds[b].togglePause():!1};this.setPan=function(b,e){return p(b)?c.sounds[b].setPan(e):!1};this.setVolume=function(b,e){var d,a;if(b!==h&&!isNaN(b)&&e===h){d=0;for(a=c.soundIDs.length;d<a;d++)c.sounds[c.soundIDs[d]].setVolume(b);return!1}return p(b)?c.sounds[b].setVolume(e):!1};this.mute=function(b){var e= -0;b instanceof String&&(b=null);if(b)return p(b)?c.sounds[b].mute():!1;for(e=c.soundIDs.length-1;0<=e;e--)c.sounds[c.soundIDs[e]].mute();return c.muted=!0};this.muteAll=function(){c.mute()};this.unmute=function(b){b instanceof String&&(b=null);if(b)return p(b)?c.sounds[b].unmute():!1;for(b=c.soundIDs.length-1;0<=b;b--)c.sounds[c.soundIDs[b]].unmute();c.muted=!1;return!0};this.unmuteAll=function(){c.unmute()};this.toggleMute=function(b){return p(b)?c.sounds[b].toggleMute():!1};this.getMemoryUse=function(){var b= -0;k&&8!==m&&(b=parseInt(k._getMemoryUse(),10));return b};this.disable=function(b){var e;b===h&&(b=!1);if(A)return!1;A=!0;for(e=c.soundIDs.length-1;0<=e;e--)ya(c.sounds[c.soundIDs[e]]);ya(c);P(b);r.remove(g,"load",G);return!0};this.canPlayMIME=function(b){var e;c.hasHTML5&&(e=X({type:b}));!e&&u&&(e=b&&c.ok()?!!(8<m&&b.match(db)||b.match(c.mimePattern)):null);return e};this.canPlayURL=function(b){var e;c.hasHTML5&&(e=X({url:b}));!e&&u&&(e=b&&c.ok()?!!b.match(c.filePattern):null);return e};this.canPlayLink= -function(b){return b.type!==h&&b.type&&c.canPlayMIME(b.type)?!0:c.canPlayURL(b.href)};this.getSoundById=function(b,e){return b?c.sounds[b]:null};this.onready=function(b,c){if("function"===typeof b)c||(c=g),sa("onready",b,c),E();else throw S("needFunction","onready");return!0};this.ontimeout=function(b,c){if("function"===typeof b)c||(c=g),sa("ontimeout",b,c),E({type:"ontimeout"});else throw S("needFunction","ontimeout");return!0};this._wD=this._writeDebug=function(b,c){return!0};this._debug=function(){}; -this.reboot=function(b,e){var d,a,f;for(d=c.soundIDs.length-1;0<=d;d--)c.sounds[c.soundIDs[d]].destruct();if(k)try{D&&(Aa=k.innerHTML),R=k.parentNode.removeChild(k)}catch(h){}Aa=R=u=k=null;c.enabled=Q=l=T=Ca=N=O=A=y=c.swfLoaded=!1;c.soundIDs=[];c.sounds={};$a=0;Ga=!1;if(b)x=[];else for(d in x)if(x.hasOwnProperty(d))for(a=0,f=x[d].length;a<f;a++)x[d][a].fired=!1;c.html5={usingFlash:null};c.flash={};c.html5Only=!1;c.ignoreFlash=!1;g.setTimeout(function(){e||c.beginDelayedInit()},20);return c};this.reset= -function(){return c.reboot(!0,!0)};this.getMoviePercent=function(){return k&&"PercentLoaded"in k?k.PercentLoaded():null};this.beginDelayedInit=function(){qa=!0;F();setTimeout(function(){if(Ca)return!1;ea();da();return Ca=!0},20);H()};this.destruct=function(){c.disable(!0)};M=function(b){var e,d,a=this,f,L,fb,g,n,q,t=!1,l=[],u=0,x,A,v=null,z;d=e=null;this.sID=this.id=b.id;this.url=b.url;this._iO=this.instanceOptions=this.options=w(b);this.pan=this.options.pan;this.volume=this.options.volume;this.isHTML5= -!1;this._a=null;z=!this.url;this.id3={};this._debug=function(){};this.load=function(b){var e=null,d;b!==h?a._iO=w(b,a.options):(b=a.options,a._iO=b,v&&v!==a.url&&(a._iO.url=a.url,a.url=null));a._iO.url||(a._iO.url=a.url);a._iO.url=ia(a._iO.url);d=a.instanceOptions=a._iO;if(!d.url&&!a.url)return a;if(d.url===a.url&&0!==a.readyState&&2!==a.readyState)return 3===a.readyState&&d.onload&&Y(a,function(){d.onload.apply(a,[!!a.duration])}),a;a.loaded=!1;a.readyState=1;a.playState=0;a.id3={};if(ja(d))e=a._setup_html5(d), -e._called_load||(a._html5_canplay=!1,a.url!==d.url&&(a._a.src=d.url,a.setPosition(0)),a._a.autobuffer="auto",a._a.preload="auto",a._a._called_load=!0);else{if(c.html5Only||a._iO.url&&a._iO.url.match(/data:/i))return a;try{a.isHTML5=!1,a._iO=ga(fa(d)),a._iO.autoPlay&&(a._iO.position||a._iO.from)&&(a._iO.autoPlay=!1),d=a._iO,8===m?k._load(a.id,d.url,d.stream,d.autoPlay,d.usePolicyFile):k._load(a.id,d.url,!!d.stream,!!d.autoPlay,d.loops||1,!!d.autoLoad,d.usePolicyFile)}catch(f){J({type:"SMSOUND_LOAD_JS_EXCEPTION", -fatal:!0})}}a.url=d.url;return a};this.unload=function(){0!==a.readyState&&(a.isHTML5?(g(),a._a&&(a._a.pause(),v=ka(a._a))):8===m?k._unload(a.id,"about:blank"):k._unload(a.id),f());return a};this.destruct=function(b){a.isHTML5?(g(),a._a&&(a._a.pause(),ka(a._a),y||fb(),a._a._s=null,a._a=null)):(a._iO.onfailure=null,k._destroySound(a.id));b||c.destroySound(a.id,!0)};this.start=this.play=function(b,e){var d,f,g,L;d=!0;e=e===h?!0:e;b||(b={});a.url&&(a._iO.url=a.url);a._iO=w(a._iO,a.options);a._iO=w(b, -a._iO);a._iO.url=ia(a._iO.url);a.instanceOptions=a._iO;if(!a.isHTML5&&a._iO.serverURL&&!a.connected)return a.getAutoPlay()||a.setAutoPlay(!0),a;ja(a._iO)&&(a._setup_html5(a._iO),n());if(1===a.playState&&!a.paused&&(d=a._iO.multiShot,!d))return a.isHTML5&&a.setPosition(a._iO.position),a;b.url&&b.url!==a.url&&(a.readyState||a.isHTML5||8!==m||!z?a.load(a._iO):z=!1);if(!a.loaded)if(0===a.readyState){if(a.isHTML5||c.html5Only)if(a.isHTML5)a.load(a._iO);else return a;else a._iO.autoPlay=!0,a.load(a._iO); -a.instanceOptions=a._iO}else if(2===a.readyState)return a;!a.isHTML5&&9===m&&0<a.position&&a.position===a.duration&&(b.position=0);a.paused&&0<=a.position&&(!a._iO.serverURL||0<a.position)?a.resume():(a._iO=w(b,a._iO),(!a.isHTML5&&null!==a._iO.position&&0<a._iO.position||null!==a._iO.from&&0<a._iO.from||null!==a._iO.to)&&0===a.instanceCount&&0===a.playState&&!a._iO.serverURL&&(d=function(){a._iO=w(b,a._iO);a.play(a._iO)},a.isHTML5&&!a._html5_canplay?a.load({_oncanplay:d}):a.isHTML5||a.loaded||a.readyState&& -2===a.readyState||a.load({onload:d}),a._iO=A()),(!a.instanceCount||a._iO.multiShotEvents||a.isHTML5&&a._iO.multiShot&&!y||!a.isHTML5&&8<m&&!a.getAutoPlay())&&a.instanceCount++,a._iO.onposition&&0===a.playState&&q(a),a.playState=1,a.paused=!1,a.position=a._iO.position===h||isNaN(a._iO.position)?0:a._iO.position,a.isHTML5||(a._iO=ga(fa(a._iO))),a._iO.onplay&&e&&(a._iO.onplay.apply(a),t=!0),a.setVolume(a._iO.volume,!0),a.setPan(a._iO.pan,!0),1!==a._iO.playbackRate&&a.setPlaybackRate(a._iO.playbackRate), -a.isHTML5?2>a.instanceCount?(n(),d=a._setup_html5(),a.setPosition(a._iO.position),d.play()):(f=new Audio(a._iO.url),g=function(){r.remove(f,"ended",g);a._onfinish(a);ka(f);f=null},L=function(){r.remove(f,"canplay",L);try{f.currentTime=a._iO.position/1E3}catch(b){}f.play()},r.add(f,"ended",g),a._iO.volume!==h&&(f.volume=Math.max(0,Math.min(1,a._iO.volume/100))),a.muted&&(f.muted=!0),a._iO.position?r.add(f,"canplay",L):f.play()):(d=k._start(a.id,a._iO.loops||1,9===m?a.position:a.position/1E3,a._iO.multiShot|| -!1),9!==m||d||a._iO.onplayerror&&a._iO.onplayerror.apply(a)));return a};this.stop=function(b){var c=a._iO;1===a.playState&&(a._onbufferchange(0),a._resetOnPosition(0),a.paused=!1,a.isHTML5||(a.playState=0),x(),c.to&&a.clearOnPosition(c.to),a.isHTML5?a._a&&(b=a.position,a.setPosition(0),a.position=b,a._a.pause(),a.playState=0,a._onTimer(),g()):(k._stop(a.id,b),c.serverURL&&a.unload()),a.instanceCount=0,a._iO={},c.onstop&&c.onstop.apply(a));return a};this.setAutoPlay=function(b){a._iO.autoPlay=b;a.isHTML5|| -(k._setAutoPlay(a.id,b),b&&(a.instanceCount||1!==a.readyState||a.instanceCount++))};this.getAutoPlay=function(){return a._iO.autoPlay};this.setPlaybackRate=function(b){b=Math.max(.5,Math.min(4,b));if(a.isHTML5)try{a._iO.playbackRate=b,a._a.playbackRate=b}catch(c){}return a};this.setPosition=function(b){b===h&&(b=0);var c=a.isHTML5?Math.max(b,0):Math.min(a.duration||a._iO.duration,Math.max(b,0));a.position=c;b=a.position/1E3;a._resetOnPosition(a.position);a._iO.position=c;if(!a.isHTML5)b=9===m?a.position: -b,a.readyState&&2!==a.readyState&&k._setPosition(a.id,b,a.paused||!a.playState,a._iO.multiShot);else if(a._a){if(a._html5_canplay){if(a._a.currentTime.toFixed(3)!==b.toFixed(3))try{a._a.currentTime=b,(0===a.playState||a.paused)&&a._a.pause()}catch(d){}}else if(b)return a;a.paused&&a._onTimer(!0)}return a};this.pause=function(b){if(a.paused||0===a.playState&&1!==a.readyState)return a;a.paused=!0;a.isHTML5?(a._setup_html5().pause(),g()):(b||b===h)&&k._pause(a.id,a._iO.multiShot);a._iO.onpause&&a._iO.onpause.apply(a); -return a};this.resume=function(){var b=a._iO;if(!a.paused)return a;a.paused=!1;a.playState=1;a.isHTML5?(a._setup_html5().play(),n()):(b.isMovieStar&&!b.serverURL&&a.setPosition(a.position),k._pause(a.id,b.multiShot));!t&&b.onplay?(b.onplay.apply(a),t=!0):b.onresume&&b.onresume.apply(a);return a};this.togglePause=function(){if(0===a.playState)return a.play({position:9!==m||a.isHTML5?a.position/1E3:a.position}),a;a.paused?a.resume():a.pause();return a};this.setPan=function(b,c){b===h&&(b=0);c===h&& -(c=!1);a.isHTML5||k._setPan(a.id,b);a._iO.pan=b;c||(a.pan=b,a.options.pan=b);return a};this.setVolume=function(b,d){b===h&&(b=100);d===h&&(d=!1);a.isHTML5?a._a&&(c.muted&&!a.muted&&(a.muted=!0,a._a.muted=!0),a._a.volume=Math.max(0,Math.min(1,b/100))):k._setVolume(a.id,c.muted&&!a.muted||a.muted?0:b);a._iO.volume=b;d||(a.volume=b,a.options.volume=b);return a};this.mute=function(){a.muted=!0;a.isHTML5?a._a&&(a._a.muted=!0):k._setVolume(a.id,0);return a};this.unmute=function(){a.muted=!1;var b=a._iO.volume!== -h;a.isHTML5?a._a&&(a._a.muted=!1):k._setVolume(a.id,b?a._iO.volume:a.options.volume);return a};this.toggleMute=function(){return a.muted?a.unmute():a.mute()};this.onposition=this.onPosition=function(b,c,d){l.push({position:parseInt(b,10),method:c,scope:d!==h?d:a,fired:!1});return a};this.clearOnPosition=function(a,b){var c;a=parseInt(a,10);if(!isNaN(a))for(c=0;c<l.length;c++)a!==l[c].position||b&&b!==l[c].method||(l[c].fired&&u--,l.splice(c,1))};this._processOnPosition=function(){var b,c;b=l.length; -if(!b||!a.playState||u>=b)return!1;for(--b;0<=b;b--)c=l[b],!c.fired&&a.position>=c.position&&(c.fired=!0,u++,c.method.apply(c.scope,[c.position]));return!0};this._resetOnPosition=function(a){var b,c;b=l.length;if(!b)return!1;for(--b;0<=b;b--)c=l[b],c.fired&&a<=c.position&&(c.fired=!1,u--);return!0};A=function(){var b=a._iO,c=b.from,d=b.to,e,f;f=function(){a.clearOnPosition(d,f);a.stop()};e=function(){if(null!==d&&!isNaN(d))a.onPosition(d,f)};null===c||isNaN(c)||(b.position=c,b.multiShot=!1,e());return b}; -q=function(){var b,c=a._iO.onposition;if(c)for(b in c)if(c.hasOwnProperty(b))a.onPosition(parseInt(b,10),c[b])};x=function(){var b,c=a._iO.onposition;if(c)for(b in c)c.hasOwnProperty(b)&&a.clearOnPosition(parseInt(b,10))};n=function(){a.isHTML5&&Ta(a)};g=function(){a.isHTML5&&Ua(a)};f=function(b){b||(l=[],u=0);t=!1;a._hasTimer=null;a._a=null;a._html5_canplay=!1;a.bytesLoaded=null;a.bytesTotal=null;a.duration=a._iO&&a._iO.duration?a._iO.duration:null;a.durationEstimate=null;a.buffered=[];a.eqData= -[];a.eqData.left=[];a.eqData.right=[];a.failures=0;a.isBuffering=!1;a.instanceOptions={};a.instanceCount=0;a.loaded=!1;a.metadata={};a.readyState=0;a.muted=!1;a.paused=!1;a.peakData={left:0,right:0};a.waveformData={left:[],right:[]};a.playState=0;a.position=null;a.id3={}};f();this._onTimer=function(b){var c,f=!1,h={};(a._hasTimer||b)&&a._a&&(b||(0<a.playState||1===a.readyState)&&!a.paused)&&(c=a._get_html5_duration(),c!==e&&(e=c,a.duration=c,f=!0),a.durationEstimate=a.duration,c=1E3*a._a.currentTime|| -0,c!==d&&(d=c,f=!0),(f||b)&&a._whileplaying(c,h,h,h,h));return f};this._get_html5_duration=function(){var b=a._iO;return(b=a._a&&a._a.duration?1E3*a._a.duration:b&&b.duration?b.duration:null)&&!isNaN(b)&&Infinity!==b?b:null};this._apply_loop=function(a,b){a.loop=1<b?"loop":""};this._setup_html5=function(b){b=w(a._iO,b);var c=y?Na:a._a,d=decodeURI(b.url),e;y?d===decodeURI(Ea)&&(e=!0):d===decodeURI(v)&&(e=!0);if(c){if(c._s)if(y)c._s&&c._s.playState&&!e&&c._s.stop();else if(!y&&d===decodeURI(v))return a._apply_loop(c, -b.loops),c;e||(v&&f(!1),c.src=b.url,Ea=v=a.url=b.url,c._called_load=!1)}else b.autoLoad||b.autoPlay?(a._a=new Audio(b.url),a._a.load()):a._a=Ja&&10>opera.version()?new Audio(null):new Audio,c=a._a,c._called_load=!1,y&&(Na=c);a.isHTML5=!0;a._a=c;c._s=a;L();a._apply_loop(c,b.loops);b.autoLoad||b.autoPlay?a.load():(c.autobuffer=!1,c.preload="auto");return c};L=function(){if(a._a._added_events)return!1;var b;a._a._added_events=!0;for(b in B)B.hasOwnProperty(b)&&a._a&&a._a.addEventListener(b,B[b],!1); -return!0};fb=function(){var b;a._a._added_events=!1;for(b in B)B.hasOwnProperty(b)&&a._a&&a._a.removeEventListener(b,B[b],!1)};this._onload=function(b){var c=!!b||!a.isHTML5&&8===m&&a.duration;a.loaded=c;a.readyState=c?3:2;a._onbufferchange(0);c||a.isHTML5||a._onerror();a._iO.onload&&Y(a,function(){a._iO.onload.apply(a,[c])});return!0};this._onerror=function(b,c){a._iO.onerror&&Y(a,function(){a._iO.onerror.apply(a,[b,c])})};this._onbufferchange=function(b){if(0===a.playState||b&&a.isBuffering||!b&& -!a.isBuffering)return!1;a.isBuffering=1===b;a._iO.onbufferchange&&a._iO.onbufferchange.apply(a,[b]);return!0};this._onsuspend=function(){a._iO.onsuspend&&a._iO.onsuspend.apply(a);return!0};this._onfailure=function(b,c,d){a.failures++;if(a._iO.onfailure&&1===a.failures)a._iO.onfailure(b,c,d)};this._onwarning=function(b,c,d){if(a._iO.onwarning)a._iO.onwarning(b,c,d)};this._onfinish=function(){var b=a._iO.onfinish;a._onbufferchange(0);a._resetOnPosition(0);a.instanceCount&&(a.instanceCount--,a.instanceCount|| -(x(),a.playState=0,a.paused=!1,a.instanceCount=0,a.instanceOptions={},a._iO={},g(),a.isHTML5&&(a.position=0)),(!a.instanceCount||a._iO.multiShotEvents)&&b&&Y(a,function(){b.apply(a)}))};this._whileloading=function(b,c,d,e){var f=a._iO;a.bytesLoaded=b;a.bytesTotal=c;a.duration=Math.floor(d);a.bufferLength=e;a.durationEstimate=a.isHTML5||f.isMovieStar?a.duration:f.duration?a.duration>f.duration?a.duration:f.duration:parseInt(a.bytesTotal/a.bytesLoaded*a.duration,10);a.isHTML5||(a.buffered=[{start:0, -end:a.duration}]);(3!==a.readyState||a.isHTML5)&&f.whileloading&&f.whileloading.apply(a)};this._whileplaying=function(b,c,d,e,f){var g=a._iO;if(isNaN(b)||null===b)return!1;a.position=Math.max(0,b);a._processOnPosition();!a.isHTML5&&8<m&&(g.usePeakData&&c!==h&&c&&(a.peakData={left:c.leftPeak,right:c.rightPeak}),g.useWaveformData&&d!==h&&d&&(a.waveformData={left:d.split(","),right:e.split(",")}),g.useEQData&&f!==h&&f&&f.leftEQ&&(b=f.leftEQ.split(","),a.eqData=b,a.eqData.left=b,f.rightEQ!==h&&f.rightEQ&& -(a.eqData.right=f.rightEQ.split(","))));1===a.playState&&(a.isHTML5||8!==m||a.position||!a.isBuffering||a._onbufferchange(0),g.whileplaying&&g.whileplaying.apply(a));return!0};this._oncaptiondata=function(b){a.captiondata=b;a._iO.oncaptiondata&&a._iO.oncaptiondata.apply(a,[b])};this._onmetadata=function(b,c){var d={},e,f;e=0;for(f=b.length;e<f;e++)d[b[e]]=c[e];a.metadata=d;a._iO.onmetadata&&a._iO.onmetadata.call(a,a.metadata)};this._onid3=function(b,c){var d=[],e,f;e=0;for(f=b.length;e<f;e++)d[b[e]]= -c[e];a.id3=w(a.id3,d);a._iO.onid3&&a._iO.onid3.apply(a)};this._onconnect=function(b){b=1===b;if(a.connected=b)a.failures=0,p(a.id)&&(a.getAutoPlay()?a.play(h,a.getAutoPlay()):a._iO.autoLoad&&a.load()),a._iO.onconnect&&a._iO.onconnect.apply(a,[b])};this._ondataerror=function(b){0<a.playState&&a._iO.ondataerror&&a._iO.ondataerror.apply(a)}};wa=function(){return n.body||n.getElementsByTagName("div")[0]};aa=function(b){return n.getElementById(b)};w=function(b,e){var d=b||{},a,f;a=e===h?c.defaultOptions: -e;for(f in a)a.hasOwnProperty(f)&&d[f]===h&&(d[f]="object"!==typeof a[f]||null===a[f]?a[f]:w(d[f],a[f]));return d};Y=function(b,c){b.isHTML5||8!==m?c():g.setTimeout(c,0)};ba={onready:1,ontimeout:1,defaultOptions:1,flash9Options:1,movieStarOptions:1};ra=function(b,e){var d,a=!0,f=e!==h,g=c.setupOptions;for(d in b)if(b.hasOwnProperty(d))if("object"!==typeof b[d]||null===b[d]||b[d]instanceof Array||b[d]instanceof RegExp)f&&ba[e]!==h?c[e][d]=b[d]:g[d]!==h?(c.setupOptions[d]=b[d],c[d]=b[d]):ba[d]===h? -a=!1:c[d]instanceof Function?c[d].apply(c,b[d]instanceof Array?b[d]:[b[d]]):c[d]=b[d];else if(ba[d]===h)a=!1;else return ra(b[d],d);return a};r=function(){function b(a){a=hb.call(a);var b=a.length;d?(a[1]="on"+a[1],3<b&&a.pop()):3===b&&a.push(!1);return a}function c(b,e){var h=b.shift(),g=[a[e]];if(d)h[g](b[0],b[1]);else h[g].apply(h,b)}var d=g.attachEvent,a={add:d?"attachEvent":"addEventListener",remove:d?"detachEvent":"removeEventListener"};return{add:function(){c(b(arguments),"add")},remove:function(){c(b(arguments), -"remove")}}}();B={abort:q(function(){}),canplay:q(function(){var b=this._s,c;if(!b._html5_canplay){b._html5_canplay=!0;b._onbufferchange(0);c=b._iO.position===h||isNaN(b._iO.position)?null:b._iO.position/1E3;if(this.currentTime!==c)try{this.currentTime=c}catch(d){}b._iO._oncanplay&&b._iO._oncanplay()}}),canplaythrough:q(function(){var b=this._s;b.loaded||(b._onbufferchange(0),b._whileloading(b.bytesLoaded,b.bytesTotal,b._get_html5_duration()),b._onload(!0))}),durationchange:q(function(){var b=this._s, -c;c=b._get_html5_duration();isNaN(c)||c===b.duration||(b.durationEstimate=b.duration=c)}),ended:q(function(){this._s._onfinish()}),error:q(function(){var b=Xa[this.error.code]||null;this._s._onload(!1);this._s._onerror(this.error.code,b)}),loadeddata:q(function(){var b=this._s;b._loaded||la||(b.duration=b._get_html5_duration())}),loadedmetadata:q(function(){}),loadstart:q(function(){this._s._onbufferchange(1)}),play:q(function(){this._s._onbufferchange(0)}),playing:q(function(){this._s._onbufferchange(0)}), -progress:q(function(b){var c=this._s,d,a,f=0,f=b.target.buffered;d=b.loaded||0;var h=b.total||1;c.buffered=[];if(f&&f.length){d=0;for(a=f.length;d<a;d++)c.buffered.push({start:1E3*f.start(d),end:1E3*f.end(d)});f=1E3*(f.end(0)-f.start(0));d=Math.min(1,f/(1E3*b.target.duration))}isNaN(d)||(c._whileloading(d,h,c._get_html5_duration()),d&&h&&d===h&&B.canplaythrough.call(this,b))}),ratechange:q(function(){}),suspend:q(function(b){var c=this._s;B.progress.call(this,b);c._onsuspend()}),stalled:q(function(){}), -timeupdate:q(function(){this._s._onTimer()}),waiting:q(function(){this._s._onbufferchange(1)})};ja=function(b){return b&&(b.type||b.url||b.serverURL)?b.serverURL||b.type&&Z(b.type)?!1:b.type?X({type:b.type}):X({url:b.url})||c.html5Only||b.url.match(/data:/i):!1};ka=function(b){var e;b&&(e=la?"about:blank":c.html5.canPlayType("audio/wav")?"data:audio/wave;base64,/UklGRiYAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQIAAAD//w==":"about:blank",b.src=e,b._called_unload!==h&&(b._called_load=!1));y&&(Ea= -null);return e};X=function(b){if(!c.useHTML5Audio||!c.hasHTML5)return!1;var e=b.url||null;b=b.type||null;var d=c.audioFormats,a;if(b&&c.html5[b]!==h)return c.html5[b]&&!Z(b);if(!C){C=[];for(a in d)d.hasOwnProperty(a)&&(C.push(a),d[a].related&&(C=C.concat(d[a].related)));C=new RegExp("\\.("+C.join("|")+")(\\?.*)?$","i")}(a=e?e.toLowerCase().match(C):null)&&a.length?a=a[1]:b&&(e=b.indexOf(";"),a=(-1!==e?b.substr(0,e):b).substr(6));a&&c.html5[a]!==h?e=c.html5[a]&&!Z(a):(b="audio/"+a,e=c.html5.canPlayType({type:b}), -e=(c.html5[a]=e)&&c.html5[b]&&!Z(b));return e};Ya=function(){function b(a){var b,d=b=!1;if(!e||"function"!==typeof e.canPlayType)return b;if(a instanceof Array){k=0;for(b=a.length;k<b;k++)if(c.html5[a[k]]||e.canPlayType(a[k]).match(c.html5Test))d=!0,c.html5[a[k]]=!0,c.flash[a[k]]=!!a[k].match(cb);b=d}else a=e&&"function"===typeof e.canPlayType?e.canPlayType(a):!1,b=!(!a||!a.match(c.html5Test));return b}if(!c.useHTML5Audio||!c.hasHTML5)return u=c.html5.usingFlash=!0,!1;var e=Audio!==h?Ja&&10>opera.version()? -new Audio(null):new Audio:null,d,a,f={},g,k;g=c.audioFormats;for(d in g)if(g.hasOwnProperty(d)&&(a="audio/"+d,f[d]=b(g[d].type),f[a]=f[d],d.match(cb)?(c.flash[d]=!0,c.flash[a]=!0):(c.flash[d]=!1,c.flash[a]=!1),g[d]&&g[d].related))for(k=g[d].related.length-1;0<=k;k--)f["audio/"+g[d].related[k]]=f[d],c.html5[g[d].related[k]]=f[d],c.flash[g[d].related[k]]=f[d];f.canPlayType=e?b:null;c.html5=w(c.html5,f);c.html5.usingFlash=Wa();u=c.html5.usingFlash;return!0};I={};S=function(){};fa=function(b){8===m&& -1<b.loops&&b.stream&&(b.stream=!1);return b};ga=function(b,c){b&&!b.usePolicyFile&&(b.onid3||b.usePeakData||b.useWaveformData||b.useEQData)&&(b.usePolicyFile=!0);return b};oa=function(){return!1};ya=function(b){for(var c in b)b.hasOwnProperty(c)&&"function"===typeof b[c]&&(b[c]=oa)};za=function(b){b===h&&(b=!1);(A||b)&&c.disable(b)};Sa=function(b){var e=null;if(b)if(b.match(/\.swf(\?.*)?$/i)){if(e=b.substr(b.toLowerCase().lastIndexOf(".swf?")+4))return b}else b.lastIndexOf("/")!==b.length-1&&(b+= -"/");b=(b&&-1!==b.lastIndexOf("/")?b.substr(0,b.lastIndexOf("/")+1):"./")+c.movieURL;c.noSWFCache&&(b+="?ts="+(new Date).getTime());return b};ua=function(){m=parseInt(c.flashVersion,10);8!==m&&9!==m&&(c.flashVersion=m=8);var b=c.debugMode||c.debugFlash?"_debug.swf":".swf";c.useHTML5Audio&&!c.html5Only&&c.audioFormats.mp4.required&&9>m&&(c.flashVersion=m=9);c.version=c.versionNumber+(c.html5Only?" (HTML5-only mode)":9===m?" (AS3/Flash 9)":" (AS2/Flash 8)");8<m?(c.defaultOptions=w(c.defaultOptions, -c.flash9Options),c.features.buffering=!0,c.defaultOptions=w(c.defaultOptions,c.movieStarOptions),c.filePatterns.flash9=new RegExp("\\.(mp3|"+eb.join("|")+")(\\?.*)?$","i"),c.features.movieStar=!0):c.features.movieStar=!1;c.filePattern=c.filePatterns[8!==m?"flash9":"flash8"];c.movieURL=(8===m?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",b);c.features.peakData=c.features.waveformData=c.features.eqData=8<m};Ra=function(b,c){k&&k._setPolling(b,c)};xa=function(){};p=this.getSoundById; -K=function(){var b=[];c.debugMode&&b.push("sm2_debug");c.debugFlash&&b.push("flash_debug");c.useHighPerformance&&b.push("high_performance");return b.join(" ")};Ba=function(){S("fbHandler");var b=c.getMoviePercent(),e={type:"FLASHBLOCK"};c.html5Only||(c.ok()?c.oMC&&(c.oMC.className=[K(),"movieContainer","swf_loaded"+(c.didFlashBlock?" swf_unblocked":"")].join(" ")):(u&&(c.oMC.className=K()+" movieContainer "+(null===b?"swf_timedout":"swf_error")),c.didFlashBlock=!0,E({type:"ontimeout",ignoreInit:!0, -error:e}),J(e)))};sa=function(b,c,d){x[b]===h&&(x[b]=[]);x[b].push({method:c,scope:d||null,fired:!1})};E=function(b){b||(b={type:c.ok()?"onready":"ontimeout"});if(!l&&b&&!b.ignoreInit||"ontimeout"===b.type&&(c.ok()||A&&!b.ignoreInit))return!1;var e={success:b&&b.ignoreInit?c.ok():!A},d=b&&b.type?x[b.type]||[]:[],a=[],f,e=[e],h=u&&!c.ok();b.error&&(e[0].error=b.error);b=0;for(f=d.length;b<f;b++)!0!==d[b].fired&&a.push(d[b]);if(a.length)for(b=0,f=a.length;b<f;b++)a[b].scope?a[b].method.apply(a[b].scope, -e):a[b].method.apply(this,e),h||(a[b].fired=!0);return!0};G=function(){g.setTimeout(function(){c.useFlashBlock&&Ba();E();"function"===typeof c.onload&&c.onload.apply(g);c.waitForWindowLoad&&r.add(g,"load",G)},1)};Fa=function(){if(z!==h)return z;var b=!1,c=navigator,d,a=g.ActiveXObject,f;try{f=c.plugins}catch(k){f=void 0}if(f&&f.length)(c=c.mimeTypes)&&c["application/x-shockwave-flash"]&&c["application/x-shockwave-flash"].enabledPlugin&&c["application/x-shockwave-flash"].enabledPlugin.description&& -(b=!0);else if(a!==h&&!t.match(/MSAppHost/i)){try{d=new a("ShockwaveFlash.ShockwaveFlash")}catch(n){d=null}b=!!d}return z=b};Wa=function(){var b,e,d=c.audioFormats;Ha&&t.match(/os (1|2|3_0|3_1)\s/i)?(c.hasHTML5=!1,c.html5Only=!0,c.oMC&&(c.oMC.style.display="none")):!c.useHTML5Audio||c.html5&&c.html5.canPlayType||(c.hasHTML5=!1);if(c.useHTML5Audio&&c.hasHTML5)for(e in W=!0,d)d.hasOwnProperty(e)&&d[e].required&&(c.html5.canPlayType(d[e].type)?c.preferFlash&&(c.flash[e]||c.flash[d[e].type])&&(b=!0): -(W=!1,b=!0));c.ignoreFlash&&(b=!1,W=!0);c.html5Only=c.hasHTML5&&c.useHTML5Audio&&!b;return!c.html5Only};ia=function(b){var e,d,a=0;if(b instanceof Array){e=0;for(d=b.length;e<d;e++)if(b[e]instanceof Object){if(c.canPlayMIME(b[e].type)){a=e;break}}else if(c.canPlayURL(b[e])){a=e;break}b[a].url&&(b[a]=b[a].url);b=b[a]}return b};Ta=function(b){b._hasTimer||(b._hasTimer=!0,!ma&&c.html5PollingInterval&&(null===U&&0===ha&&(U=setInterval(Va,c.html5PollingInterval)),ha++))};Ua=function(b){b._hasTimer&&(b._hasTimer= -!1,!ma&&c.html5PollingInterval&&ha--)};Va=function(){var b;if(null===U||ha)for(b=c.soundIDs.length-1;0<=b;b--)c.sounds[c.soundIDs[b]].isHTML5&&c.sounds[c.soundIDs[b]]._hasTimer&&c.sounds[c.soundIDs[b]]._onTimer();else clearInterval(U),U=null};J=function(b){b=b!==h?b:{};"function"===typeof c.onerror&&c.onerror.apply(g,[{type:b.type!==h?b.type:null}]);b.fatal!==h&&b.fatal&&c.disable()};Za=function(){if(ab&&Fa()){var b=c.audioFormats,e,d;for(d in b)if(b.hasOwnProperty(d)&&("mp3"===d||"mp4"===d)&&(c.html5[d]= -!1,b[d]&&b[d].related))for(e=b[d].related.length-1;0<=e;e--)c.html5[b[d].related[e]]=!1}};this._setSandboxType=function(b){};this._externalInterfaceOK=function(b){c.swfLoaded||(c.swfLoaded=!0,na=!1,ab&&Za(),setTimeout(pa,D?100:1))};ea=function(b,e){function d(a,b){return'<param name="'+a+'" value="'+b+'" />'}if(N&&O)return!1;if(c.html5Only)return ua(),c.oMC=aa(c.movieID),pa(),O=N=!0,!1;var a=e||c.url,f=c.altURL||a,g=wa(),k=K(),m=null,m=n.getElementsByTagName("html")[0],l,q,p,m=m&&m.dir&&m.dir.match(/rtl/i); -b=b===h?c.id:b;ua();c.url=Sa(La?a:f);e=c.url;c.wmode=!c.wmode&&c.useHighPerformance?"transparent":c.wmode;null!==c.wmode&&(t.match(/msie 8/i)||!D&&!c.useHighPerformance)&&navigator.platform.match(/win32|win64/i)&&(V.push(I.spcWmode),c.wmode=null);g={name:b,id:b,src:e,quality:"high",allowScriptAccess:c.allowScriptAccess,bgcolor:c.bgColor,pluginspage:jb+"www.macromedia.com/go/getflashplayer",title:"JS/Flash audio component (SoundManager 2)",type:"application/x-shockwave-flash",wmode:c.wmode,hasPriority:"true"}; -c.debugFlash&&(g.FlashVars="debug=1");c.wmode||delete g.wmode;if(D)a=n.createElement("div"),q=['<object id="'+b+'" data="'+e+'" type="'+g.type+'" title="'+g.title+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">',d("movie",e),d("AllowScriptAccess",c.allowScriptAccess),d("quality",g.quality),c.wmode?d("wmode",c.wmode):"",d("bgcolor",c.bgColor),d("hasPriority","true"),c.debugFlash?d("FlashVars",g.FlashVars): -"","</object>"].join("");else for(l in a=n.createElement("embed"),g)g.hasOwnProperty(l)&&a.setAttribute(l,g[l]);xa();k=K();if(g=wa())if(c.oMC=aa(c.movieID)||n.createElement("div"),c.oMC.id)p=c.oMC.className,c.oMC.className=(p?p+" ":"movieContainer")+(k?" "+k:""),c.oMC.appendChild(a),D&&(l=c.oMC.appendChild(n.createElement("div")),l.className="sm2-object-box",l.innerHTML=q),O=!0;else{c.oMC.id=c.movieID;c.oMC.className="movieContainer "+k;l=k=null;c.useFlashBlock||(c.useHighPerformance?k={position:"fixed", -width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"}:(k={position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"},m&&(k.left=Math.abs(parseInt(k.left,10))+"px")));ib&&(c.oMC.style.zIndex=1E4);if(!c.debugFlash)for(p in k)k.hasOwnProperty(p)&&(c.oMC.style[p]=k[p]);try{D||c.oMC.appendChild(a),g.appendChild(c.oMC),D&&(l=c.oMC.appendChild(n.createElement("div")),l.className="sm2-object-box",l.innerHTML=q),O=!0}catch(r){throw Error(S("domError")+" \n"+r.toString());}}return N= -!0};da=function(){if(c.html5Only)return ea(),!1;if(k||!c.url)return!1;k=c.getMovie(c.id);k||(R?(D?c.oMC.innerHTML=Aa:c.oMC.appendChild(R),R=null,N=!0):ea(c.id,c.url),k=c.getMovie(c.id));"function"===typeof c.oninitmovie&&setTimeout(c.oninitmovie,1);return!0};H=function(){setTimeout(Qa,1E3)};ta=function(){g.setTimeout(function(){c.setup({preferFlash:!1}).reboot();c.didFlashBlock=!0;c.beginDelayedInit()},1)};Qa=function(){var b,e=!1;c.url&&!T&&(T=!0,r.remove(g,"load",H),z&&na&&!Ka||(l||(b=c.getMoviePercent(), -0<b&&100>b&&(e=!0)),setTimeout(function(){b=c.getMoviePercent();e?(T=!1,g.setTimeout(H,1)):!l&&bb&&(null===b?c.useFlashBlock||0===c.flashLoadTimeout?c.useFlashBlock&&Ba():!c.useFlashBlock&&W?ta():E({type:"ontimeout",ignoreInit:!0,error:{type:"INIT_FLASHBLOCK"}}):0!==c.flashLoadTimeout&&(!c.useFlashBlock&&W?ta():za(!0)))},c.flashLoadTimeout)))};ca=function(){if(Ka||!na)return r.remove(g,"focus",ca),!0;Ka=bb=!0;T=!1;H();r.remove(g,"focus",ca);return!0};P=function(b){if(l)return!1;if(c.html5Only)return l= -!0,G(),!0;var e=!0,d;c.useFlashBlock&&c.flashLoadTimeout&&!c.getMoviePercent()||(l=!0);d={type:!z&&u?"NO_FLASH":"INIT_TIMEOUT"};if(A||b)c.useFlashBlock&&c.oMC&&(c.oMC.className=K()+" "+(null===c.getMoviePercent()?"swf_timedout":"swf_error")),E({type:"ontimeout",error:d,ignoreInit:!0}),J(d),e=!1;A||(c.waitForWindowLoad&&!qa?r.add(g,"load",G):G());return e};Pa=function(){var b,e=c.setupOptions;for(b in e)e.hasOwnProperty(b)&&(c[b]===h?c[b]=e[b]:c[b]!==e[b]&&(c.setupOptions[b]=c[b]))};pa=function(){if(l)return!1; -if(c.html5Only)return l||(r.remove(g,"load",c.beginDelayedInit),c.enabled=!0,P()),!0;da();try{k._externalInterfaceTest(!1),Ra(!0,c.flashPollingInterval||(c.useHighPerformance?10:50)),c.debugMode||k._disableDebug(),c.enabled=!0,c.html5Only||r.add(g,"unload",oa)}catch(b){return J({type:"JS_TO_FLASH_EXCEPTION",fatal:!0}),za(!0),P(),!1}P();r.remove(g,"load",c.beginDelayedInit);return!0};F=function(){if(Q)return!1;Q=!0;Pa();xa();!z&&c.hasHTML5&&c.setup({useHTML5Audio:!0,preferFlash:!1});Ya();!z&&u&&(V.push(I.needFlash), -c.setup({flashLoadTimeout:1}));n.removeEventListener&&n.removeEventListener("DOMContentLoaded",F,!1);da();return!0};Da=function(){"complete"===n.readyState&&(F(),n.detachEvent("onreadystatechange",Da));return!0};va=function(){qa=!0;F();r.remove(g,"load",va)};Fa();r.add(g,"focus",ca);r.add(g,"load",H);r.add(g,"load",va);n.addEventListener?n.addEventListener("DOMContentLoaded",F,!1):n.attachEvent?n.attachEvent("onreadystatechange",Da):J({type:"NO_DOM2_EVENTS",fatal:!0})}if(!g||!g.document)throw Error("SoundManager requires a browser with window and document objects."); -var M=null;g.SM2_DEFER!==h&&SM2_DEFER||(M=new v);"object"===typeof module&&module&&"object"===typeof module.exports?(module.exports.SoundManager=v,module.exports.soundManager=M):"function"===typeof define&&define.amd&&define(function(){return{constructor:v,getInstance:function(h){!g.soundManager&&h instanceof Function&&(h=h(v),h instanceof v&&(g.soundManager=h));return g.soundManager}}});g.SoundManager=v;g.soundManager=M})(window);
\ No newline at end of file diff --git a/priv/static/js/soundmanager2-nodebug.js b/priv/static/js/soundmanager2-nodebug.js deleted file mode 100755 index 3cfa8c8..0000000 --- a/priv/static/js/soundmanager2-nodebug.js +++ /dev/null @@ -1,2704 +0,0 @@ -/** @license
- *
- * SoundManager 2: JavaScript Sound for the Web
- * ----------------------------------------------
- * http://schillmania.com/projects/soundmanager2/
- *
- * Copyright (c) 2007, Scott Schiller. All rights reserved.
- * Code provided under the BSD License:
- * http://schillmania.com/projects/soundmanager2/license.txt
- *
- * V2.97a.20170601
- */
-
-/**
- * About this file
-
-(function SM2(window, _undefined) {
-'use strict';
-if (!window || !window.document) {
- throw new Error('SoundManager requires a browser with window and document objects.');
-}
-var soundManager = null;
-function SoundManager(smURL, smID) {
- this.setupOptions = {
- url: (smURL || null),
- flashVersion: 8,
- debugMode: true,
- debugFlash: false,
- useConsole: true,
- consoleOnly: true,
- waitForWindowLoad: false,
- bgColor: '#ffffff',
- useHighPerformance: false,
- flashPollingInterval: null,
- html5PollingInterval: null,
- flashLoadTimeout: 1000,
- wmode: null,
- allowScriptAccess: 'always',
- useFlashBlock: false,
- useHTML5Audio: true,
- forceUseGlobalHTML5Audio: false,
- ignoreMobileRestrictions: false,
- html5Test: /^(probably|maybe)$/i,
- preferFlash: false,
- noSWFCache: false,
- idPrefix: 'sound'
- };
- this.defaultOptions = {
- autoLoad: false,
- autoPlay: false,
- from: null,
- loops: 1,
- onid3: null,
- onerror: null,
- onload: null,
- whileloading: null,
- onplay: null,
- onpause: null,
- onresume: null,
- whileplaying: null,
- onposition: null,
- onstop: null,
- onfinish: null,
- multiShot: true,
- multiShotEvents: false,
- position: null,
- pan: 0,
- playbackRate: 1,
- stream: true,
- to: null,
- type: null,
- usePolicyFile: false,
- volume: 100
- };
- this.flash9Options = {
- onfailure: null,
- isMovieStar: null,
- usePeakData: false,
- useWaveformData: false,
- useEQData: false,
- onbufferchange: null,
- ondataerror: null
- };
- this.movieStarOptions = {
- bufferTime: 3,
- serverURL: null,
- onconnect: null,
- duration: null
- };
- this.audioFormats = {
- mp3: {
- type: ['audio/mpeg; codecs="mp3"', 'audio/mpeg', 'audio/mp3', 'audio/MPA', 'audio/mpa-robust'],
- required: true
- },
- mp4: {
- related: ['aac', 'm4a', 'm4b'],
- type: ['audio/mp4; codecs="mp4a.40.2"', 'audio/aac', 'audio/x-m4a', 'audio/MP4A-LATM', 'audio/mpeg4-generic'],
- required: false
- },
- ogg: {
- type: ['audio/ogg; codecs=vorbis'],
- required: false
- },
- opus: {
- type: ['audio/ogg; codecs=opus', 'audio/opus'],
- required: false
- },
- wav: {
- type: ['audio/wav; codecs="1"', 'audio/wav', 'audio/wave', 'audio/x-wav'],
- required: false
- },
- flac: {
- type: ['audio/flac'],
- required: false
- }
- };
- this.movieID = 'sm2-container';
- this.id = (smID || 'sm2movie');
- this.debugID = 'soundmanager-debug';
- this.debugURLParam = /([#?&])debug=1/i;
- this.versionNumber = 'V2.97a.20170601';
- this.version = null;
- this.movieURL = null;
- this.altURL = null;
- this.swfLoaded = false;
- this.enabled = false;
- this.oMC = null;
- this.sounds = {};
- this.soundIDs = [];
- this.muted = false;
- this.didFlashBlock = false;
- this.filePattern = null;
- this.filePatterns = {
- flash8: /\.mp3(\?.*)?$/i,
- flash9: /\.mp3(\?.*)?$/i
- };
- this.features = {
- buffering: false,
- peakData: false,
- waveformData: false,
- eqData: false,
- movieStar: false
- };
- this.sandbox = {
- };
- this.html5 = {
- usingFlash: null
- };
- this.flash = {};
- this.html5Only = false;
- this.ignoreFlash = false;
- var SMSound,
- sm2 = this, globalHTML5Audio = null, flash = null, sm = 'soundManager', smc = sm + ': ', h5 = 'HTML5::', id, ua = navigator.userAgent, wl = window.location.href.toString(), doc = document, doNothing, setProperties, init, fV, on_queue = [], debugOpen = true, debugTS, didAppend = false, appendSuccess = false, didInit = false, disabled = false, windowLoaded = false, _wDS, wdCount = 0, initComplete, mixin, assign, extraOptions, addOnEvent, processOnEvents, initUserOnload, delayWaitForEI, waitForEI, rebootIntoHTML5, setVersionInfo, handleFocus, strings, initMovie, domContentLoaded, winOnLoad, didDCLoaded, getDocument, createMovie, catchError, setPolling, initDebug, debugLevels = ['log', 'info', 'warn', 'error'], defaultFlashVersion = 8, disableObject, failSafely, normalizeMovieURL, oRemoved = null, oRemovedHTML = null, str, flashBlockHandler, getSWFCSS, swfCSS, toggleDebug, loopFix, policyFix, complain, idCheck, waitingForEI = false, initPending = false, startTimer, stopTimer, timerExecute, h5TimerCount = 0, h5IntervalTimer = null, parseURL, messages = [],
- canIgnoreFlash, needsFlash = null, featureCheck, html5OK, html5CanPlay, html5ErrorCodes, html5Ext, html5Unload, domContentLoadedIE, testHTML5, event, slice = Array.prototype.slice, useGlobalHTML5Audio = false, lastGlobalHTML5URL, hasFlash, detectFlash, badSafariFix, html5_events, showSupport, flushMessages, wrapCallback, idCounter = 0, didSetup, msecScale = 1000,
- is_iDevice = ua.match(/(ipad|iphone|ipod)/i), isAndroid = ua.match(/android/i), isIE = ua.match(/msie|trident/i),
- isWebkit = ua.match(/webkit/i),
- isSafari = (ua.match(/safari/i) && !ua.match(/chrome/i)),
- isOpera = (ua.match(/opera/i)),
- mobileHTML5 = (ua.match(/(mobile|pre\/|xoom)/i) || is_iDevice || isAndroid),
- isBadSafari = (!wl.match(/usehtml5audio/i) && !wl.match(/sm2-ignorebadua/i) && isSafari && !ua.match(/silk/i) && ua.match(/OS\sX\s10_6_([3-7])/i)),
- hasConsole = (window.console !== _undefined && console.log !== _undefined),
- isFocused = (doc.hasFocus !== _undefined ? doc.hasFocus() : null),
- tryInitOnFocus = (isSafari && (doc.hasFocus === _undefined || !doc.hasFocus())),
- okToDisable = !tryInitOnFocus,
- flashMIME = /(mp3|mp4|mpa|m4a|m4b)/i,
- emptyURL = 'about:blank',
- emptyWAV = 'data:audio/wave;base64,/UklGRiYAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQIAAAD//w==',
- overHTTP = (doc.location ? doc.location.protocol.match(/http/i) : null),
- http = (!overHTTP ? '//' : ''),
- netStreamMimeTypes = /^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4|m4v|m4a|m4b|mp4v|3gp|3g2)\s*(?:$|;)/i,
- netStreamTypes = ['mpeg4', 'aac', 'flv', 'mov', 'mp4', 'm4v', 'f4v', 'm4a', 'm4b', 'mp4v', '3gp', '3g2'],
- netStreamPattern = new RegExp('\\.(' + netStreamTypes.join('|') + ')(\\?.*)?$', 'i');
- this.mimePattern = /^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;
- this.useAltURL = !overHTTP;
- swfCSS = {
- swfBox: 'sm2-object-box',
- swfDefault: 'movieContainer',
- swfError: 'swf_error',
- swfTimedout: 'swf_timedout',
- swfLoaded: 'swf_loaded',
- swfUnblocked: 'swf_unblocked',
- sm2Debug: 'sm2_debug',
- highPerf: 'high_performance',
- flashDebug: 'flash_debug'
- };
- html5ErrorCodes = [
- null,
- 'MEDIA_ERR_ABORTED',
- 'MEDIA_ERR_NETWORK',
- 'MEDIA_ERR_DECODE',
- 'MEDIA_ERR_SRC_NOT_SUPPORTED'
- ];
- this.hasHTML5 = (function() {
- try {
- return (Audio !== _undefined && (isOpera && opera !== _undefined && opera.version() < 10 ? new Audio(null) : new Audio()).canPlayType !== _undefined);
- } catch(e) {
- return false;
- }
- }());
- this.setup = function(options) {
- var noURL = (!sm2.url);
- if (options !== _undefined && didInit && needsFlash && sm2.ok() && (options.flashVersion !== _undefined || options.url !== _undefined || options.html5Test !== _undefined)) {
- }
- assign(options);
- if (!useGlobalHTML5Audio) {
- if (mobileHTML5) {
- if (!sm2.setupOptions.ignoreMobileRestrictions || sm2.setupOptions.forceUseGlobalHTML5Audio) {
- messages.push(strings.globalHTML5);
- useGlobalHTML5Audio = true;
- }
- } else if (sm2.setupOptions.forceUseGlobalHTML5Audio) {
- messages.push(strings.globalHTML5);
- useGlobalHTML5Audio = true;
- }
- }
- if (!didSetup && mobileHTML5) {
- if (sm2.setupOptions.ignoreMobileRestrictions) {
- messages.push(strings.ignoreMobile);
- } else {
- sm2.setupOptions.useHTML5Audio = true;
- sm2.setupOptions.preferFlash = false;
- if (is_iDevice) {
- sm2.ignoreFlash = true;
- } else if ((isAndroid && !ua.match(/android\s2\.3/i)) || !isAndroid) {
- useGlobalHTML5Audio = true;
- }
- }
- }
- if (options) {
- if (noURL && didDCLoaded && options.url !== _undefined) {
- sm2.beginDelayedInit();
- }
- if (!didDCLoaded && options.url !== _undefined && doc.readyState === 'complete') {
- setTimeout(domContentLoaded, 1);
- }
- }
- didSetup = true;
- return sm2;
- };
- this.ok = function() {
- return (needsFlash ? (didInit && !disabled) : (sm2.useHTML5Audio && sm2.hasHTML5));
- };
- this.supported = this.ok;
- this.getMovie = function(movie_id) {
- return id(movie_id) || doc[movie_id] || window[movie_id];
- };
- this.createSound = function(oOptions, _url) {
- var cs, cs_string, options, oSound = null;
- if (!didInit || !sm2.ok()) {
- return false;
- }
- if (_url !== _undefined) {
- oOptions = {
- id: oOptions,
- url: _url
- };
- }
- options = mixin(oOptions);
- options.url = parseURL(options.url);
- if (options.id === _undefined) {
- options.id = sm2.setupOptions.idPrefix + (idCounter++);
- }
- if (idCheck(options.id, true)) {
- return sm2.sounds[options.id];
- }
- function make() {
- options = loopFix(options);
- sm2.sounds[options.id] = new SMSound(options);
- sm2.soundIDs.push(options.id);
- return sm2.sounds[options.id];
- }
- if (html5OK(options)) {
- oSound = make();
- oSound._setup_html5(options);
- } else {
- if (sm2.html5Only) {
- return make();
- }
- if (sm2.html5.usingFlash && options.url && options.url.match(/data:/i)) {
- return make();
- }
- if (fV > 8) {
- if (options.isMovieStar === null) {
- options.isMovieStar = !!(options.serverURL || (options.type ? options.type.match(netStreamMimeTypes) : false) || (options.url && options.url.match(netStreamPattern)));
- }
- }
- options = policyFix(options, cs);
- oSound = make();
- if (fV === 8) {
- flash._createSound(options.id, options.loops || 1, options.usePolicyFile);
- } else {
- flash._createSound(options.id, options.url, options.usePeakData, options.useWaveformData, options.useEQData, options.isMovieStar, (options.isMovieStar ? options.bufferTime : false), options.loops || 1, options.serverURL, options.duration || null, options.autoPlay, true, options.autoLoad, options.usePolicyFile);
- if (!options.serverURL) {
- oSound.connected = true;
- if (options.onconnect) {
- options.onconnect.apply(oSound);
- }
- }
- }
- if (!options.serverURL && (options.autoLoad || options.autoPlay)) {
- oSound.load(options);
- }
- }
- if (!options.serverURL && options.autoPlay) {
- oSound.play();
- }
- return oSound;
- };
- this.destroySound = function(sID, _bFromSound) {
- if (!idCheck(sID)) return false;
- var oS = sm2.sounds[sID], i;
- oS.stop();
- oS._iO = {};
- oS.unload();
- for (i = 0; i < sm2.soundIDs.length; i++) {
- if (sm2.soundIDs[i] === sID) {
- sm2.soundIDs.splice(i, 1);
- break;
- }
- }
- if (!_bFromSound) {
- oS.destruct(true);
- }
- oS = null;
- delete sm2.sounds[sID];
- return true;
- };
- this.load = function(sID, oOptions) {
- if (!idCheck(sID)) return false;
- return sm2.sounds[sID].load(oOptions);
- };
- this.unload = function(sID) {
- if (!idCheck(sID)) return false;
- return sm2.sounds[sID].unload();
- };
- this.onPosition = function(sID, nPosition, oMethod, oScope) {
- if (!idCheck(sID)) return false;
- return sm2.sounds[sID].onposition(nPosition, oMethod, oScope);
- };
- this.onposition = this.onPosition;
- this.clearOnPosition = function(sID, nPosition, oMethod) {
- if (!idCheck(sID)) return false;
- return sm2.sounds[sID].clearOnPosition(nPosition, oMethod);
- };
- this.play = function(sID, oOptions) {
- var result = null,
- overloaded = (oOptions && !(oOptions instanceof Object));
- if (!didInit || !sm2.ok()) {
- return false;
- }
- if (!idCheck(sID, overloaded)) {
- if (!overloaded) return false;
- if (overloaded) {
- oOptions = {
- url: oOptions
- };
- }
- if (oOptions && oOptions.url) {
- oOptions.id = sID;
- result = sm2.createSound(oOptions).play();
- }
- } else if (overloaded) {
- oOptions = {
- url: oOptions
- };
- }
- if (result === null) {
- result = sm2.sounds[sID].play(oOptions);
- }
- return result;
- };
- this.start = this.play;
- this.setPlaybackRate = function(sID, rate, allowOverride) {
- if (!idCheck(sID)) return false;
- return sm2.sounds[sID].setPlaybackRate(rate, allowOverride);
- };
- this.setPosition = function(sID, nMsecOffset) {
- if (!idCheck(sID)) return false;
- return sm2.sounds[sID].setPosition(nMsecOffset);
- };
- this.stop = function(sID) {
- if (!idCheck(sID)) return false;
- return sm2.sounds[sID].stop();
- };
- this.stopAll = function() {
- var oSound;
- for (oSound in sm2.sounds) {
- if (sm2.sounds.hasOwnProperty(oSound)) {
- sm2.sounds[oSound].stop();
- }
- }
- };
- this.pause = function(sID) {
- if (!idCheck(sID)) return false;
- return sm2.sounds[sID].pause();
- };
- this.pauseAll = function() {
- var i;
- for (i = sm2.soundIDs.length - 1; i >= 0; i--) {
- sm2.sounds[sm2.soundIDs[i]].pause();
- }
- };
- this.resume = function(sID) {
- if (!idCheck(sID)) return false;
- return sm2.sounds[sID].resume();
- };
- this.resumeAll = function() {
- var i;
- for (i = sm2.soundIDs.length - 1; i >= 0; i--) {
- sm2.sounds[sm2.soundIDs[i]].resume();
- }
- };
- this.togglePause = function(sID) {
- if (!idCheck(sID)) return false;
- return sm2.sounds[sID].togglePause();
- };
- this.setPan = function(sID, nPan) {
- if (!idCheck(sID)) return false;
- return sm2.sounds[sID].setPan(nPan);
- };
- this.setVolume = function(sID, nVol) {
- var i, j;
- if (sID !== _undefined && !isNaN(sID) && nVol === _undefined) {
- for (i = 0, j = sm2.soundIDs.length; i < j; i++) {
- sm2.sounds[sm2.soundIDs[i]].setVolume(sID);
- }
- return false;
- }
- if (!idCheck(sID)) return false;
- return sm2.sounds[sID].setVolume(nVol);
- };
- this.mute = function(sID) {
- var i = 0;
- if (sID instanceof String) {
- sID = null;
- }
- if (!sID) {
- for (i = sm2.soundIDs.length - 1; i >= 0; i--) {
- sm2.sounds[sm2.soundIDs[i]].mute();
- }
- sm2.muted = true;
- } else {
- if (!idCheck(sID)) return false;
- return sm2.sounds[sID].mute();
- }
- return true;
- };
- this.muteAll = function() {
- sm2.mute();
- };
- this.unmute = function(sID) {
- var i;
- if (sID instanceof String) {
- sID = null;
- }
- if (!sID) {
- for (i = sm2.soundIDs.length - 1; i >= 0; i--) {
- sm2.sounds[sm2.soundIDs[i]].unmute();
- }
- sm2.muted = false;
- } else {
- if (!idCheck(sID)) return false;
- return sm2.sounds[sID].unmute();
- }
- return true;
- };
- this.unmuteAll = function() {
- sm2.unmute();
- };
- this.toggleMute = function(sID) {
- if (!idCheck(sID)) return false;
- return sm2.sounds[sID].toggleMute();
- };
- this.getMemoryUse = function() {
- var ram = 0;
- if (flash && fV !== 8) {
- ram = parseInt(flash._getMemoryUse(), 10);
- }
- return ram;
- };
- this.disable = function(bNoDisable) {
- var i;
- if (bNoDisable === _undefined) {
- bNoDisable = false;
- }
- if (disabled) return false;
- disabled = true;
- for (i = sm2.soundIDs.length - 1; i >= 0; i--) {
- disableObject(sm2.sounds[sm2.soundIDs[i]]);
- }
- disableObject(sm2);
- initComplete(bNoDisable);
- event.remove(window, 'load', initUserOnload);
- return true;
- };
- this.canPlayMIME = function(sMIME) {
- var result;
- if (sm2.hasHTML5) {
- result = html5CanPlay({
- type: sMIME
- });
- }
- if (!result && needsFlash) {
- result = (sMIME && sm2.ok() ? !!((fV > 8 ? sMIME.match(netStreamMimeTypes) : null) || sMIME.match(sm2.mimePattern)) : null);
- }
- return result;
- };
- this.canPlayURL = function(sURL) {
- var result;
- if (sm2.hasHTML5) {
- result = html5CanPlay({
- url: sURL
- });
- }
- if (!result && needsFlash) {
- result = (sURL && sm2.ok() ? !!(sURL.match(sm2.filePattern)) : null);
- }
- return result;
- };
- this.canPlayLink = function(oLink) {
- if (oLink.type !== _undefined && oLink.type && sm2.canPlayMIME(oLink.type)) return true;
- return sm2.canPlayURL(oLink.href);
- };
- this.getSoundById = function(sID, _suppressDebug) {
- if (!sID) return null;
- var result = sm2.sounds[sID];
- return result;
- };
- this.onready = function(oMethod, oScope) {
- var sType = 'onready',
- result = false;
- if (typeof oMethod === 'function') {
- if (!oScope) {
- oScope = window;
- }
- addOnEvent(sType, oMethod, oScope);
- processOnEvents();
- result = true;
- } else {
- throw str('needFunction', sType);
- }
- return result;
- };
- this.ontimeout = function(oMethod, oScope) {
- var sType = 'ontimeout',
- result = false;
- if (typeof oMethod === 'function') {
- if (!oScope) {
- oScope = window;
- }
- addOnEvent(sType, oMethod, oScope);
- processOnEvents({ type: sType });
- result = true;
- } else {
- throw str('needFunction', sType);
- }
- return result;
- };
- this._writeDebug = function(sText, sTypeOrObject) {
- return true;
- };
- this._wD = this._writeDebug;
- this._debug = function() {
- };
- this.reboot = function(resetEvents, excludeInit) {
- var i, j, k;
- for (i = sm2.soundIDs.length - 1; i >= 0; i--) {
- sm2.sounds[sm2.soundIDs[i]].destruct();
- }
- if (flash) {
- try {
- if (isIE) {
- oRemovedHTML = flash.innerHTML;
- }
- oRemoved = flash.parentNode.removeChild(flash);
- } catch(e) {
- }
- }
- oRemovedHTML = oRemoved = needsFlash = flash = null;
- sm2.enabled = didDCLoaded = didInit = waitingForEI = initPending = didAppend = appendSuccess = disabled = useGlobalHTML5Audio = sm2.swfLoaded = false;
- sm2.soundIDs = [];
- sm2.sounds = {};
- idCounter = 0;
- didSetup = false;
- if (!resetEvents) {
- for (i in on_queue) {
- if (on_queue.hasOwnProperty(i)) {
- for (j = 0, k = on_queue[i].length; j < k; j++) {
- on_queue[i][j].fired = false;
- }
- }
- }
- } else {
- on_queue = [];
- }
- sm2.html5 = {
- usingFlash: null
- };
- sm2.flash = {};
- sm2.html5Only = false;
- sm2.ignoreFlash = false;
- window.setTimeout(function() {
- if (!excludeInit) {
- sm2.beginDelayedInit();
- }
- }, 20);
- return sm2;
- };
- this.reset = function() {
- return sm2.reboot(true, true);
- };
- this.getMoviePercent = function() {
- return (flash && 'PercentLoaded' in flash ? flash.PercentLoaded() : null);
- };
- this.beginDelayedInit = function() {
- windowLoaded = true;
- domContentLoaded();
- setTimeout(function() {
- if (initPending) return false;
- createMovie();
- initMovie();
- initPending = true;
- return true;
- }, 20);
- delayWaitForEI();
- };
- this.destruct = function() {
- sm2.disable(true);
- };
- SMSound = function(oOptions) {
- var s = this, resetProperties, add_html5_events, remove_html5_events, stop_html5_timer, start_html5_timer, attachOnPosition, onplay_called = false, onPositionItems = [], onPositionFired = 0, detachOnPosition, applyFromTo, lastURL = null, lastHTML5State, urlOmitted;
- lastHTML5State = {
- duration: null,
- time: null
- };
- this.id = oOptions.id;
- this.sID = this.id;
- this.url = oOptions.url;
- this.options = mixin(oOptions);
- this.instanceOptions = this.options;
- this._iO = this.instanceOptions;
- this.pan = this.options.pan;
- this.volume = this.options.volume;
- this.isHTML5 = false;
- this._a = null;
- urlOmitted = (!this.url);
- this.id3 = {};
- this._debug = function() {
- };
- this.load = function(options) {
- var oSound = null, instanceOptions;
- if (options !== _undefined) {
- s._iO = mixin(options, s.options);
- } else {
- options = s.options;
- s._iO = options;
- if (lastURL && lastURL !== s.url) {
- s._iO.url = s.url;
- s.url = null;
- }
- }
- if (!s._iO.url) {
- s._iO.url = s.url;
- }
- s._iO.url = parseURL(s._iO.url);
- s.instanceOptions = s._iO;
- instanceOptions = s._iO;
- if (!instanceOptions.url && !s.url) {
- return s;
- }
- if (instanceOptions.url === s.url && s.readyState !== 0 && s.readyState !== 2) {
- if (s.readyState === 3 && instanceOptions.onload) {
- wrapCallback(s, function() {
- instanceOptions.onload.apply(s, [(!!s.duration)]);
- });
- }
- return s;
- }
- s.loaded = false;
- s.readyState = 1;
- s.playState = 0;
- s.id3 = {};
- if (html5OK(instanceOptions)) {
- oSound = s._setup_html5(instanceOptions);
- if (!oSound._called_load) {
- s._html5_canplay = false;
- if (s.url !== instanceOptions.url) {
- s._a.src = instanceOptions.url;
- s.setPosition(0);
- }
- s._a.autobuffer = 'auto';
- s._a.preload = 'auto';
- s._a._called_load = true;
- } else {
- }
- } else {
- if (sm2.html5Only) {
- return s;
- }
- if (s._iO.url && s._iO.url.match(/data:/i)) {
- return s;
- }
- try {
- s.isHTML5 = false;
- s._iO = policyFix(loopFix(instanceOptions));
- if (s._iO.autoPlay && (s._iO.position || s._iO.from)) {
- s._iO.autoPlay = false;
- }
- instanceOptions = s._iO;
- if (fV === 8) {
- flash._load(s.id, instanceOptions.url, instanceOptions.stream, instanceOptions.autoPlay, instanceOptions.usePolicyFile);
- } else {
- flash._load(s.id, instanceOptions.url, !!(instanceOptions.stream), !!(instanceOptions.autoPlay), instanceOptions.loops || 1, !!(instanceOptions.autoLoad), instanceOptions.usePolicyFile);
- }
- } catch(e) {
- catchError({
- type: 'SMSOUND_LOAD_JS_EXCEPTION',
- fatal: true
- });
- }
- }
- s.url = instanceOptions.url;
- return s;
- };
- this.unload = function() {
- if (s.readyState !== 0) {
- if (!s.isHTML5) {
- if (fV === 8) {
- flash._unload(s.id, emptyURL);
- } else {
- flash._unload(s.id);
- }
- } else {
- stop_html5_timer();
- if (s._a) {
- s._a.pause();
- lastURL = html5Unload(s._a);
- }
- }
- resetProperties();
- }
- return s;
- };
- this.destruct = function(_bFromSM) {
- if (!s.isHTML5) {
- s._iO.onfailure = null;
- flash._destroySound(s.id);
- } else {
- stop_html5_timer();
- if (s._a) {
- s._a.pause();
- html5Unload(s._a);
- if (!useGlobalHTML5Audio) {
- remove_html5_events();
- }
- s._a._s = null;
- s._a = null;
- }
- }
- if (!_bFromSM) {
- sm2.destroySound(s.id, true);
- }
- };
- this.play = function(options, _updatePlayState) {
- var fN, allowMulti, a, onready,
- audioClone, onended, oncanplay,
- startOK = true;
- _updatePlayState = (_updatePlayState === _undefined ? true : _updatePlayState);
- if (!options) {
- options = {};
- }
- if (s.url) {
- s._iO.url = s.url;
- }
- s._iO = mixin(s._iO, s.options);
- s._iO = mixin(options, s._iO);
- s._iO.url = parseURL(s._iO.url);
- s.instanceOptions = s._iO;
- if (!s.isHTML5 && s._iO.serverURL && !s.connected) {
- if (!s.getAutoPlay()) {
- s.setAutoPlay(true);
- }
- return s;
- }
- if (html5OK(s._iO)) {
- s._setup_html5(s._iO);
- start_html5_timer();
- }
- if (s.playState === 1 && !s.paused) {
- allowMulti = s._iO.multiShot;
- if (!allowMulti) {
- if (s.isHTML5) {
- s.setPosition(s._iO.position);
- }
- return s;
- }
- }
- if (options.url && options.url !== s.url) {
- if (!s.readyState && !s.isHTML5 && fV === 8 && urlOmitted) {
- urlOmitted = false;
- } else {
- s.load(s._iO);
- }
- }
- if (!s.loaded) {
- if (s.readyState === 0) {
- if (!s.isHTML5 && !sm2.html5Only) {
- s._iO.autoPlay = true;
- s.load(s._iO);
- } else if (s.isHTML5) {
- s.load(s._iO);
- } else {
- return s;
- }
- s.instanceOptions = s._iO;
- } else if (s.readyState === 2) {
- return s;
- } else {
- }
- } else {
- }
- if (!s.isHTML5 && fV === 9 && s.position > 0 && s.position === s.duration) {
- options.position = 0;
- }
- if (s.paused && s.position >= 0 && (!s._iO.serverURL || s.position > 0)) {
- s.resume();
- } else {
- s._iO = mixin(options, s._iO);
- if (((!s.isHTML5 && s._iO.position !== null && s._iO.position > 0) || (s._iO.from !== null && s._iO.from > 0) || s._iO.to !== null) && s.instanceCount === 0 && s.playState === 0 && !s._iO.serverURL) {
- onready = function() {
- s._iO = mixin(options, s._iO);
- s.play(s._iO);
- };
- if (s.isHTML5 && !s._html5_canplay) {
- s.load({
- _oncanplay: onready
- });
- } else if (!s.isHTML5 && !s.loaded && (!s.readyState || s.readyState !== 2)) {
- s.load({
- onload: onready
- });
- }
- s._iO = applyFromTo();
- }
- if (!s.instanceCount || s._iO.multiShotEvents || (s.isHTML5 && s._iO.multiShot && !useGlobalHTML5Audio) || (!s.isHTML5 && fV > 8 && !s.getAutoPlay())) {
- s.instanceCount++;
- }
- if (s._iO.onposition && s.playState === 0) {
- attachOnPosition(s);
- }
- s.playState = 1;
- s.paused = false;
- s.position = (s._iO.position !== _undefined && !isNaN(s._iO.position) ? s._iO.position : 0);
- if (!s.isHTML5) {
- s._iO = policyFix(loopFix(s._iO));
- }
- if (s._iO.onplay && _updatePlayState) {
- s._iO.onplay.apply(s);
- onplay_called = true;
- }
- s.setVolume(s._iO.volume, true);
- s.setPan(s._iO.pan, true);
- if (s._iO.playbackRate !== 1) {
- s.setPlaybackRate(s._iO.playbackRate);
- }
- if (!s.isHTML5) {
- startOK = flash._start(s.id, s._iO.loops || 1, (fV === 9 ? s.position : s.position / msecScale), s._iO.multiShot || false);
- if (fV === 9 && !startOK) {
- if (s._iO.onplayerror) {
- s._iO.onplayerror.apply(s);
- }
- }
- } else if (s.instanceCount < 2) {
- start_html5_timer();
- a = s._setup_html5();
- s.setPosition(s._iO.position);
- a.play();
- } else {
- audioClone = new Audio(s._iO.url);
- onended = function() {
- event.remove(audioClone, 'ended', onended);
- s._onfinish(s);
- html5Unload(audioClone);
- audioClone = null;
- };
- oncanplay = function() {
- event.remove(audioClone, 'canplay', oncanplay);
- try {
- audioClone.currentTime = s._iO.position / msecScale;
- } catch(err) {
- }
- audioClone.play();
- };
- event.add(audioClone, 'ended', onended);
- if (s._iO.volume !== _undefined) {
- audioClone.volume = Math.max(0, Math.min(1, s._iO.volume / 100));
- }
- if (s.muted) {
- audioClone.muted = true;
- }
- if (s._iO.position) {
- event.add(audioClone, 'canplay', oncanplay);
- } else {
- audioClone.play();
- }
- }
- }
- return s;
- };
- this.start = this.play;
- this.stop = function(bAll) {
- var instanceOptions = s._iO,
- originalPosition;
- if (s.playState === 1) {
- s._onbufferchange(0);
- s._resetOnPosition(0);
- s.paused = false;
- if (!s.isHTML5) {
- s.playState = 0;
- }
- detachOnPosition();
- if (instanceOptions.to) {
- s.clearOnPosition(instanceOptions.to);
- }
- if (!s.isHTML5) {
- flash._stop(s.id, bAll);
- if (instanceOptions.serverURL) {
- s.unload();
- }
- } else if (s._a) {
- originalPosition = s.position;
- s.setPosition(0);
- s.position = originalPosition;
- s._a.pause();
- s.playState = 0;
- s._onTimer();
- stop_html5_timer();
- }
- s.instanceCount = 0;
- s._iO = {};
- if (instanceOptions.onstop) {
- instanceOptions.onstop.apply(s);
- }
- }
- return s;
- };
- this.setAutoPlay = function(autoPlay) {
- s._iO.autoPlay = autoPlay;
- if (!s.isHTML5) {
- flash._setAutoPlay(s.id, autoPlay);
- if (autoPlay) {
- if (!s.instanceCount && s.readyState === 1) {
- s.instanceCount++;
- }
- }
- }
- };
- this.getAutoPlay = function() {
- return s._iO.autoPlay;
- };
- this.setPlaybackRate = function(playbackRate) {
- var normalizedRate = Math.max(0.5, Math.min(4, playbackRate));
- if (s.isHTML5) {
- try {
- s._iO.playbackRate = normalizedRate;
- s._a.playbackRate = normalizedRate;
- } catch(e) {
- }
- }
- return s;
- };
- this.setPosition = function(nMsecOffset) {
- if (nMsecOffset === _undefined) {
- nMsecOffset = 0;
- }
- var position, position1K,
- offset = (s.isHTML5 ? Math.max(nMsecOffset, 0) : Math.min(s.duration || s._iO.duration, Math.max(nMsecOffset, 0)));
- s.position = offset;
- position1K = s.position / msecScale;
- s._resetOnPosition(s.position);
- s._iO.position = offset;
- if (!s.isHTML5) {
- position = (fV === 9 ? s.position : position1K);
- if (s.readyState && s.readyState !== 2) {
- flash._setPosition(s.id, position, (s.paused || !s.playState), s._iO.multiShot);
- }
- } else if (s._a) {
- if (s._html5_canplay) {
- if (s._a.currentTime.toFixed(3) !== position1K.toFixed(3)) {
- try {
- s._a.currentTime = position1K;
- if (s.playState === 0 || s.paused) {
- s._a.pause();
- }
- } catch(e) {
- }
- }
- } else if (position1K) {
- return s;
- }
- if (s.paused) {
- s._onTimer(true);
- }
- }
- return s;
- };
- this.pause = function(_bCallFlash) {
- if (s.paused || (s.playState === 0 && s.readyState !== 1)) return s;
- s.paused = true;
- if (!s.isHTML5) {
- if (_bCallFlash || _bCallFlash === _undefined) {
- flash._pause(s.id, s._iO.multiShot);
- }
- } else {
- s._setup_html5().pause();
- stop_html5_timer();
- }
- if (s._iO.onpause) {
- s._iO.onpause.apply(s);
- }
- return s;
- };
- this.resume = function() {
- var instanceOptions = s._iO;
- if (!s.paused) return s;
- s.paused = false;
- s.playState = 1;
- if (!s.isHTML5) {
- if (instanceOptions.isMovieStar && !instanceOptions.serverURL) {
- s.setPosition(s.position);
- }
- flash._pause(s.id, instanceOptions.multiShot);
- } else {
- s._setup_html5().play();
- start_html5_timer();
- }
- if (!onplay_called && instanceOptions.onplay) {
- instanceOptions.onplay.apply(s);
- onplay_called = true;
- } else if (instanceOptions.onresume) {
- instanceOptions.onresume.apply(s);
- }
- return s;
- };
- this.togglePause = function() {
- if (s.playState === 0) {
- s.play({
- position: (fV === 9 && !s.isHTML5 ? s.position : s.position / msecScale)
- });
- return s;
- }
- if (s.paused) {
- s.resume();
- } else {
- s.pause();
- }
- return s;
- };
- this.setPan = function(nPan, bInstanceOnly) {
- if (nPan === _undefined) {
- nPan = 0;
- }
- if (bInstanceOnly === _undefined) {
- bInstanceOnly = false;
- }
- if (!s.isHTML5) {
- flash._setPan(s.id, nPan);
- }
- s._iO.pan = nPan;
- if (!bInstanceOnly) {
- s.pan = nPan;
- s.options.pan = nPan;
- }
- return s;
- };
- this.setVolume = function(nVol, _bInstanceOnly) {
- if (nVol === _undefined) {
- nVol = 100;
- }
- if (_bInstanceOnly === _undefined) {
- _bInstanceOnly = false;
- }
- if (!s.isHTML5) {
- flash._setVolume(s.id, (sm2.muted && !s.muted) || s.muted ? 0 : nVol);
- } else if (s._a) {
- if (sm2.muted && !s.muted) {
- s.muted = true;
- s._a.muted = true;
- }
- s._a.volume = Math.max(0, Math.min(1, nVol / 100));
- }
- s._iO.volume = nVol;
- if (!_bInstanceOnly) {
- s.volume = nVol;
- s.options.volume = nVol;
- }
- return s;
- };
- this.mute = function() {
- s.muted = true;
- if (!s.isHTML5) {
- flash._setVolume(s.id, 0);
- } else if (s._a) {
- s._a.muted = true;
- }
- return s;
- };
- this.unmute = function() {
- s.muted = false;
- var hasIO = (s._iO.volume !== _undefined);
- if (!s.isHTML5) {
- flash._setVolume(s.id, hasIO ? s._iO.volume : s.options.volume);
- } else if (s._a) {
- s._a.muted = false;
- }
- return s;
- };
- this.toggleMute = function() {
- return (s.muted ? s.unmute() : s.mute());
- };
- this.onPosition = function(nPosition, oMethod, oScope) {
- onPositionItems.push({
- position: parseInt(nPosition, 10),
- method: oMethod,
- scope: (oScope !== _undefined ? oScope : s),
- fired: false
- });
- return s;
- };
- this.onposition = this.onPosition;
- this.clearOnPosition = function(nPosition, oMethod) {
- var i;
- nPosition = parseInt(nPosition, 10);
- if (isNaN(nPosition)) {
- return;
- }
- for (i = 0; i < onPositionItems.length; i++) {
- if (nPosition === onPositionItems[i].position) {
- if (!oMethod || (oMethod === onPositionItems[i].method)) {
- if (onPositionItems[i].fired) {
- onPositionFired--;
- }
- onPositionItems.splice(i, 1);
- }
- }
- }
- };
- this._processOnPosition = function() {
- var i, item, j = onPositionItems.length;
- if (!j || !s.playState || onPositionFired >= j) return false;
- for (i = j - 1; i >= 0; i--) {
- item = onPositionItems[i];
- if (!item.fired && s.position >= item.position) {
- item.fired = true;
- onPositionFired++;
- item.method.apply(item.scope, [item.position]);
- j = onPositionItems.length;
- }
- }
- return true;
- };
- this._resetOnPosition = function(nPosition) {
- var i, item, j = onPositionItems.length;
- if (!j) return false;
- for (i = j - 1; i >= 0; i--) {
- item = onPositionItems[i];
- if (item.fired && nPosition <= item.position) {
- item.fired = false;
- onPositionFired--;
- }
- }
- return true;
- };
- applyFromTo = function() {
- var instanceOptions = s._iO,
- f = instanceOptions.from,
- t = instanceOptions.to,
- start, end;
- end = function() {
- s.clearOnPosition(t, end);
- s.stop();
- };
- start = function() {
- if (t !== null && !isNaN(t)) {
- s.onPosition(t, end);
- }
- };
- if (f !== null && !isNaN(f)) {
- instanceOptions.position = f;
- instanceOptions.multiShot = false;
- start();
- }
- return instanceOptions;
- };
- attachOnPosition = function() {
- var item,
- op = s._iO.onposition;
- if (op) {
- for (item in op) {
- if (op.hasOwnProperty(item)) {
- s.onPosition(parseInt(item, 10), op[item]);
- }
- }
- }
- };
- detachOnPosition = function() {
- var item,
- op = s._iO.onposition;
- if (op) {
- for (item in op) {
- if (op.hasOwnProperty(item)) {
- s.clearOnPosition(parseInt(item, 10));
- }
- }
- }
- };
- start_html5_timer = function() {
- if (s.isHTML5) {
- startTimer(s);
- }
- };
- stop_html5_timer = function() {
- if (s.isHTML5) {
- stopTimer(s);
- }
- };
- resetProperties = function(retainPosition) {
- if (!retainPosition) {
- onPositionItems = [];
- onPositionFired = 0;
- }
- onplay_called = false;
- s._hasTimer = null;
- s._a = null;
- s._html5_canplay = false;
- s.bytesLoaded = null;
- s.bytesTotal = null;
- s.duration = (s._iO && s._iO.duration ? s._iO.duration : null);
- s.durationEstimate = null;
- s.buffered = [];
- s.eqData = [];
- s.eqData.left = [];
- s.eqData.right = [];
- s.failures = 0;
- s.isBuffering = false;
- s.instanceOptions = {};
- s.instanceCount = 0;
- s.loaded = false;
- s.metadata = {};
- s.readyState = 0;
- s.muted = false;
- s.paused = false;
- s.peakData = {
- left: 0,
- right: 0
- };
- s.waveformData = {
- left: [],
- right: []
- };
- s.playState = 0;
- s.position = null;
- s.id3 = {};
- };
- resetProperties();
- this._onTimer = function(bForce) {
- var duration, isNew = false, time, x = {};
- if (s._hasTimer || bForce) {
- if (s._a && (bForce || ((s.playState > 0 || s.readyState === 1) && !s.paused))) {
- duration = s._get_html5_duration();
- if (duration !== lastHTML5State.duration) {
- lastHTML5State.duration = duration;
- s.duration = duration;
- isNew = true;
- }
- s.durationEstimate = s.duration;
- time = (s._a.currentTime * msecScale || 0);
- if (time !== lastHTML5State.time) {
- lastHTML5State.time = time;
- isNew = true;
- }
- if (isNew || bForce) {
- s._whileplaying(time, x, x, x, x);
- }
- }
- }
- return isNew;
- };
- this._get_html5_duration = function() {
- var instanceOptions = s._iO,
- d = (s._a && s._a.duration ? s._a.duration * msecScale : (instanceOptions && instanceOptions.duration ? instanceOptions.duration : null)),
- result = (d && !isNaN(d) && d !== Infinity ? d : null);
- return result;
- };
- this._apply_loop = function(a, nLoops) {
- a.loop = (nLoops > 1 ? 'loop' : '');
- };
- this._setup_html5 = function(options) {
- var instanceOptions = mixin(s._iO, options),
- a = useGlobalHTML5Audio ? globalHTML5Audio : s._a,
- dURL = decodeURI(instanceOptions.url),
- sameURL;
- if (useGlobalHTML5Audio) {
- if (dURL === decodeURI(lastGlobalHTML5URL)) {
- sameURL = true;
- }
- } else if (dURL === decodeURI(lastURL)) {
- sameURL = true;
- }
- if (a) {
- if (a._s) {
- if (useGlobalHTML5Audio) {
- if (a._s && a._s.playState && !sameURL) {
- a._s.stop();
- }
- } else if (!useGlobalHTML5Audio && dURL === decodeURI(lastURL)) {
- s._apply_loop(a, instanceOptions.loops);
- return a;
- }
- }
- if (!sameURL) {
- if (lastURL) {
- resetProperties(false);
- }
- a.src = instanceOptions.url;
- s.url = instanceOptions.url;
- lastURL = instanceOptions.url;
- lastGlobalHTML5URL = instanceOptions.url;
- a._called_load = false;
- }
- } else {
- if (instanceOptions.autoLoad || instanceOptions.autoPlay) {
- s._a = new Audio(instanceOptions.url);
- s._a.load();
- } else {
- s._a = (isOpera && opera.version() < 10 ? new Audio(null) : new Audio());
- }
- a = s._a;
- a._called_load = false;
- if (useGlobalHTML5Audio) {
- globalHTML5Audio = a;
- }
- }
- s.isHTML5 = true;
- s._a = a;
- a._s = s;
- add_html5_events();
- s._apply_loop(a, instanceOptions.loops);
- if (instanceOptions.autoLoad || instanceOptions.autoPlay) {
- s.load();
- } else {
- a.autobuffer = false;
- a.preload = 'auto';
- }
- return a;
- };
- add_html5_events = function() {
- if (s._a._added_events) return false;
- var f;
- function add(oEvt, oFn, bCapture) {
- return s._a ? s._a.addEventListener(oEvt, oFn, bCapture || false) : null;
- }
- s._a._added_events = true;
- for (f in html5_events) {
- if (html5_events.hasOwnProperty(f)) {
- add(f, html5_events[f]);
- }
- }
- return true;
- };
- remove_html5_events = function() {
- var f;
- function remove(oEvt, oFn, bCapture) {
- return (s._a ? s._a.removeEventListener(oEvt, oFn, bCapture || false) : null);
- }
- s._a._added_events = false;
- for (f in html5_events) {
- if (html5_events.hasOwnProperty(f)) {
- remove(f, html5_events[f]);
- }
- }
- };
- this._onload = function(nSuccess) {
- var fN,
- loadOK = !!nSuccess || (!s.isHTML5 && fV === 8 && s.duration);
- s.loaded = loadOK;
- s.readyState = (loadOK ? 3 : 2);
- s._onbufferchange(0);
- if (!loadOK && !s.isHTML5) {
- s._onerror();
- }
- if (s._iO.onload) {
- wrapCallback(s, function() {
- s._iO.onload.apply(s, [loadOK]);
- });
- }
- return true;
- };
- this._onerror = function(errorCode, description) {
- if (s._iO.onerror) {
- wrapCallback(s, function() {
- s._iO.onerror.apply(s, [errorCode, description]);
- });
- }
- };
- this._onbufferchange = function(nIsBuffering) {
- if (s.playState === 0) return false;
- if ((nIsBuffering && s.isBuffering) || (!nIsBuffering && !s.isBuffering)) return false;
- s.isBuffering = (nIsBuffering === 1);
- if (s._iO.onbufferchange) {
- s._iO.onbufferchange.apply(s, [nIsBuffering]);
- }
- return true;
- };
- this._onsuspend = function() {
- if (s._iO.onsuspend) {
- s._iO.onsuspend.apply(s);
- }
- return true;
- };
- this._onfailure = function(msg, level, code) {
- s.failures++;
- if (s._iO.onfailure && s.failures === 1) {
- s._iO.onfailure(msg, level, code);
- } else {
- }
- };
- this._onwarning = function(msg, level, code) {
- if (s._iO.onwarning) {
- s._iO.onwarning(msg, level, code);
- }
- };
- this._onfinish = function() {
- var io_onfinish = s._iO.onfinish;
- s._onbufferchange(0);
- s._resetOnPosition(0);
- if (s.instanceCount) {
- s.instanceCount--;
- if (!s.instanceCount) {
- detachOnPosition();
- s.playState = 0;
- s.paused = false;
- s.instanceCount = 0;
- s.instanceOptions = {};
- s._iO = {};
- stop_html5_timer();
- if (s.isHTML5) {
- s.position = 0;
- }
- }
- if (!s.instanceCount || s._iO.multiShotEvents) {
- if (io_onfinish) {
- wrapCallback(s, function() {
- io_onfinish.apply(s);
- });
- }
- }
- }
- };
- this._whileloading = function(nBytesLoaded, nBytesTotal, nDuration, nBufferLength) {
- var instanceOptions = s._iO;
- s.bytesLoaded = nBytesLoaded;
- s.bytesTotal = nBytesTotal;
- s.duration = Math.floor(nDuration);
- s.bufferLength = nBufferLength;
- if (!s.isHTML5 && !instanceOptions.isMovieStar) {
- if (instanceOptions.duration) {
- s.durationEstimate = (s.duration > instanceOptions.duration) ? s.duration : instanceOptions.duration;
- } else {
- s.durationEstimate = parseInt((s.bytesTotal / s.bytesLoaded) * s.duration, 10);
- }
- } else {
- s.durationEstimate = s.duration;
- }
- if (!s.isHTML5) {
- s.buffered = [{
- start: 0,
- end: s.duration
- }];
- }
- if ((s.readyState !== 3 || s.isHTML5) && instanceOptions.whileloading) {
- instanceOptions.whileloading.apply(s);
- }
- };
- this._whileplaying = function(nPosition, oPeakData, oWaveformDataLeft, oWaveformDataRight, oEQData) {
- var instanceOptions = s._iO,
- eqLeft;
- if (isNaN(nPosition) || nPosition === null) return false;
- s.position = Math.max(0, nPosition);
- s._processOnPosition();
- if (!s.isHTML5 && fV > 8) {
- if (instanceOptions.usePeakData && oPeakData !== _undefined && oPeakData) {
- s.peakData = {
- left: oPeakData.leftPeak,
- right: oPeakData.rightPeak
- };
- }
- if (instanceOptions.useWaveformData && oWaveformDataLeft !== _undefined && oWaveformDataLeft) {
- s.waveformData = {
- left: oWaveformDataLeft.split(','),
- right: oWaveformDataRight.split(',')
- };
- }
- if (instanceOptions.useEQData) {
- if (oEQData !== _undefined && oEQData && oEQData.leftEQ) {
- eqLeft = oEQData.leftEQ.split(',');
- s.eqData = eqLeft;
- s.eqData.left = eqLeft;
- if (oEQData.rightEQ !== _undefined && oEQData.rightEQ) {
- s.eqData.right = oEQData.rightEQ.split(',');
- }
- }
- }
- }
- if (s.playState === 1) {
- if (!s.isHTML5 && fV === 8 && !s.position && s.isBuffering) {
- s._onbufferchange(0);
- }
- if (instanceOptions.whileplaying) {
- instanceOptions.whileplaying.apply(s);
- }
- }
- return true;
- };
- this._oncaptiondata = function(oData) {
- s.captiondata = oData;
- if (s._iO.oncaptiondata) {
- s._iO.oncaptiondata.apply(s, [oData]);
- }
- };
- this._onmetadata = function(oMDProps, oMDData) {
- var oData = {}, i, j;
- for (i = 0, j = oMDProps.length; i < j; i++) {
- oData[oMDProps[i]] = oMDData[i];
- }
- s.metadata = oData;
- if (s._iO.onmetadata) {
- s._iO.onmetadata.call(s, s.metadata);
- }
- };
- this._onid3 = function(oID3Props, oID3Data) {
- var oData = [], i, j;
- for (i = 0, j = oID3Props.length; i < j; i++) {
- oData[oID3Props[i]] = oID3Data[i];
- }
- s.id3 = mixin(s.id3, oData);
- if (s._iO.onid3) {
- s._iO.onid3.apply(s);
- }
- };
- this._onconnect = function(bSuccess) {
- bSuccess = (bSuccess === 1);
- s.connected = bSuccess;
- if (bSuccess) {
- s.failures = 0;
- if (idCheck(s.id)) {
- if (s.getAutoPlay()) {
- s.play(_undefined, s.getAutoPlay());
- } else if (s._iO.autoLoad) {
- s.load();
- }
- }
- if (s._iO.onconnect) {
- s._iO.onconnect.apply(s, [bSuccess]);
- }
- }
- };
- this._ondataerror = function(sError) {
- if (s.playState > 0) {
- if (s._iO.ondataerror) {
- s._iO.ondataerror.apply(s);
- }
- }
- };
- };
- getDocument = function() {
- return (doc.body || doc.getElementsByTagName('div')[0]);
- };
- id = function(sID) {
- return doc.getElementById(sID);
- };
- mixin = function(oMain, oAdd) {
- var o1 = (oMain || {}), o2, o;
- o2 = (oAdd === _undefined ? sm2.defaultOptions : oAdd);
- for (o in o2) {
- if (o2.hasOwnProperty(o) && o1[o] === _undefined) {
- if (typeof o2[o] !== 'object' || o2[o] === null) {
- o1[o] = o2[o];
- } else {
- o1[o] = mixin(o1[o], o2[o]);
- }
- }
- }
- return o1;
- };
- wrapCallback = function(oSound, callback) {
- if (!oSound.isHTML5 && fV === 8) {
- window.setTimeout(callback, 0);
- } else {
- callback();
- }
- };
- extraOptions = {
- onready: 1,
- ontimeout: 1,
- defaultOptions: 1,
- flash9Options: 1,
- movieStarOptions: 1
- };
- assign = function(o, oParent) {
- var i,
- result = true,
- hasParent = (oParent !== _undefined),
- setupOptions = sm2.setupOptions,
- bonusOptions = extraOptions;
- for (i in o) {
- if (o.hasOwnProperty(i)) {
- if (typeof o[i] !== 'object' || o[i] === null || o[i] instanceof Array || o[i] instanceof RegExp) {
- if (hasParent && bonusOptions[oParent] !== _undefined) {
- sm2[oParent][i] = o[i];
- } else if (setupOptions[i] !== _undefined) {
- sm2.setupOptions[i] = o[i];
- sm2[i] = o[i];
- } else if (bonusOptions[i] === _undefined) {
- result = false;
- } else if (sm2[i] instanceof Function) {
- sm2[i].apply(sm2, (o[i] instanceof Array ? o[i] : [o[i]]));
- } else {
- sm2[i] = o[i];
- }
- } else if (bonusOptions[i] === _undefined) {
- result = false;
- } else {
- return assign(o[i], i);
- }
- }
- }
- return result;
- };
- function preferFlashCheck(kind) {
- return (sm2.preferFlash && hasFlash && !sm2.ignoreFlash && (sm2.flash[kind] !== _undefined && sm2.flash[kind]));
- }
- event = (function() {
- var old = (window.attachEvent),
- evt = {
- add: (old ? 'attachEvent' : 'addEventListener'),
- remove: (old ? 'detachEvent' : 'removeEventListener')
- };
- function getArgs(oArgs) {
- var args = slice.call(oArgs),
- len = args.length;
- if (old) {
- args[1] = 'on' + args[1];
- if (len > 3) {
- args.pop();
- }
- } else if (len === 3) {
- args.push(false);
- }
- return args;
- }
- function apply(args, sType) {
- var element = args.shift(),
- method = [evt[sType]];
- if (old) {
- element[method](args[0], args[1]);
- } else {
- element[method].apply(element, args);
- }
- }
- function add() {
- apply(getArgs(arguments), 'add');
- }
- function remove() {
- apply(getArgs(arguments), 'remove');
- }
- return {
- add: add,
- remove: remove
- };
- }());
- function html5_event(oFn) {
- return function(e) {
- var s = this._s,
- result;
- if (!s || !s._a) {
- result = null;
- } else {
- result = oFn.call(this, e);
- }
- return result;
- };
- }
- html5_events = {
- abort: html5_event(function() {
- }),
- canplay: html5_event(function() {
- var s = this._s,
- position1K;
- if (s._html5_canplay) {
- return;
- }
- s._html5_canplay = true;
- s._onbufferchange(0);
- position1K = (s._iO.position !== _undefined && !isNaN(s._iO.position) ? s._iO.position / msecScale : null);
- if (this.currentTime !== position1K) {
- try {
- this.currentTime = position1K;
- } catch(ee) {
- }
- }
- if (s._iO._oncanplay) {
- s._iO._oncanplay();
- }
- }),
- canplaythrough: html5_event(function() {
- var s = this._s;
- if (!s.loaded) {
- s._onbufferchange(0);
- s._whileloading(s.bytesLoaded, s.bytesTotal, s._get_html5_duration());
- s._onload(true);
- }
- }),
- durationchange: html5_event(function() {
- var s = this._s,
- duration;
- duration = s._get_html5_duration();
- if (!isNaN(duration) && duration !== s.duration) {
- s.durationEstimate = s.duration = duration;
- }
- }),
- ended: html5_event(function() {
- var s = this._s;
- s._onfinish();
- }),
- error: html5_event(function() {
- var description = (html5ErrorCodes[this.error.code] || null);
- this._s._onload(false);
- this._s._onerror(this.error.code, description);
- }),
- loadeddata: html5_event(function() {
- var s = this._s;
- if (!s._loaded && !isSafari) {
- s.duration = s._get_html5_duration();
- }
- }),
- loadedmetadata: html5_event(function() {
- }),
- loadstart: html5_event(function() {
- this._s._onbufferchange(1);
- }),
- play: html5_event(function() {
- this._s._onbufferchange(0);
- }),
- playing: html5_event(function() {
- this._s._onbufferchange(0);
- }),
- progress: html5_event(function(e) {
- var s = this._s,
- i, j, progStr, buffered = 0,
- isProgress = (e.type === 'progress'),
- ranges = e.target.buffered,
- loaded = (e.loaded || 0),
- total = (e.total || 1);
- s.buffered = [];
- if (ranges && ranges.length) {
- for (i = 0, j = ranges.length; i < j; i++) {
- s.buffered.push({
- start: ranges.start(i) * msecScale,
- end: ranges.end(i) * msecScale
- });
- }
- buffered = (ranges.end(0) - ranges.start(0)) * msecScale;
- loaded = Math.min(1, buffered / (e.target.duration * msecScale));
- }
- if (!isNaN(loaded)) {
- s._whileloading(loaded, total, s._get_html5_duration());
- if (loaded && total && loaded === total) {
- html5_events.canplaythrough.call(this, e);
- }
- }
- }),
- ratechange: html5_event(function() {
- }),
- suspend: html5_event(function(e) {
- var s = this._s;
- html5_events.progress.call(this, e);
- s._onsuspend();
- }),
- stalled: html5_event(function() {
- }),
- timeupdate: html5_event(function() {
- this._s._onTimer();
- }),
- waiting: html5_event(function() {
- var s = this._s;
- s._onbufferchange(1);
- })
- };
- html5OK = function(iO) {
- var result;
- if (!iO || (!iO.type && !iO.url && !iO.serverURL)) {
- result = false;
- } else if (iO.serverURL || (iO.type && preferFlashCheck(iO.type))) {
- result = false;
- } else {
- result = ((iO.type ? html5CanPlay({ type: iO.type }) : html5CanPlay({ url: iO.url }) || sm2.html5Only || iO.url.match(/data:/i)));
- }
- return result;
- };
- html5Unload = function(oAudio) {
- var url;
- if (oAudio) {
- url = (isSafari ? emptyURL : (sm2.html5.canPlayType('audio/wav') ? emptyWAV : emptyURL));
- oAudio.src = url;
- if (oAudio._called_unload !== _undefined) {
- oAudio._called_load = false;
- }
- }
- if (useGlobalHTML5Audio) {
- lastGlobalHTML5URL = null;
- }
- return url;
- };
- html5CanPlay = function(o) {
- if (!sm2.useHTML5Audio || !sm2.hasHTML5) return false;
- var url = (o.url || null),
- mime = (o.type || null),
- aF = sm2.audioFormats,
- result,
- offset,
- fileExt,
- item;
- if (mime && sm2.html5[mime] !== _undefined) return (sm2.html5[mime] && !preferFlashCheck(mime));
- if (!html5Ext) {
- html5Ext = [];
- for (item in aF) {
- if (aF.hasOwnProperty(item)) {
- html5Ext.push(item);
- if (aF[item].related) {
- html5Ext = html5Ext.concat(aF[item].related);
- }
- }
- }
- html5Ext = new RegExp('\\.(' + html5Ext.join('|') + ')(\\?.*)?$', 'i');
- }
- fileExt = (url ? url.toLowerCase().match(html5Ext) : null);
- if (!fileExt || !fileExt.length) {
- if (!mime) {
- result = false;
- } else {
- offset = mime.indexOf(';');
- fileExt = (offset !== -1 ? mime.substr(0, offset) : mime).substr(6);
- }
- } else {
- fileExt = fileExt[1];
- }
- if (fileExt && sm2.html5[fileExt] !== _undefined) {
- result = (sm2.html5[fileExt] && !preferFlashCheck(fileExt));
- } else {
- mime = 'audio/' + fileExt;
- result = sm2.html5.canPlayType({ type: mime });
- sm2.html5[fileExt] = result;
- result = (result && sm2.html5[mime] && !preferFlashCheck(mime));
- }
- return result;
- };
- testHTML5 = function() {
- if (!sm2.useHTML5Audio || !sm2.hasHTML5) {
- sm2.html5.usingFlash = true;
- needsFlash = true;
- return false;
- }
- var a = (Audio !== _undefined ? (isOpera && opera.version() < 10 ? new Audio(null) : new Audio()) : null),
- item, lookup, support = {}, aF, i;
- function cp(m) {
- var canPlay, j,
- result = false,
- isOK = false;
- if (!a || typeof a.canPlayType !== 'function') return result;
- if (m instanceof Array) {
- for (i = 0, j = m.length; i < j; i++) {
- if (sm2.html5[m[i]] || a.canPlayType(m[i]).match(sm2.html5Test)) {
- isOK = true;
- sm2.html5[m[i]] = true;
- sm2.flash[m[i]] = !!(m[i].match(flashMIME));
- }
- }
- result = isOK;
- } else {
- canPlay = (a && typeof a.canPlayType === 'function' ? a.canPlayType(m) : false);
- result = !!(canPlay && (canPlay.match(sm2.html5Test)));
- }
- return result;
- }
- aF = sm2.audioFormats;
- for (item in aF) {
- if (aF.hasOwnProperty(item)) {
- lookup = 'audio/' + item;
- support[item] = cp(aF[item].type);
- support[lookup] = support[item];
- if (item.match(flashMIME)) {
- sm2.flash[item] = true;
- sm2.flash[lookup] = true;
- } else {
- sm2.flash[item] = false;
- sm2.flash[lookup] = false;
- }
- if (aF[item] && aF[item].related) {
- for (i = aF[item].related.length - 1; i >= 0; i--) {
- support['audio/' + aF[item].related[i]] = support[item];
- sm2.html5[aF[item].related[i]] = support[item];
- sm2.flash[aF[item].related[i]] = support[item];
- }
- }
- }
- }
- support.canPlayType = (a ? cp : null);
- sm2.html5 = mixin(sm2.html5, support);
- sm2.html5.usingFlash = featureCheck();
- needsFlash = sm2.html5.usingFlash;
- return true;
- };
- strings = {
- };
- str = function() {
- };
- loopFix = function(sOpt) {
- if (fV === 8 && sOpt.loops > 1 && sOpt.stream) {
- sOpt.stream = false;
- }
- return sOpt;
- };
- policyFix = function(sOpt, sPre) {
- if (sOpt && !sOpt.usePolicyFile && (sOpt.onid3 || sOpt.usePeakData || sOpt.useWaveformData || sOpt.useEQData)) {
- sOpt.usePolicyFile = true;
- }
- return sOpt;
- };
- complain = function(sMsg) {
- };
- doNothing = function() {
- return false;
- };
- disableObject = function(o) {
- var oProp;
- for (oProp in o) {
- if (o.hasOwnProperty(oProp) && typeof o[oProp] === 'function') {
- o[oProp] = doNothing;
- }
- }
- oProp = null;
- };
- failSafely = function(bNoDisable) {
- if (bNoDisable === _undefined) {
- bNoDisable = false;
- }
- if (disabled || bNoDisable) {
- sm2.disable(bNoDisable);
- }
- };
- normalizeMovieURL = function(movieURL) {
- var urlParams = null, url;
- if (movieURL) {
- if (movieURL.match(/\.swf(\?.*)?$/i)) {
- urlParams = movieURL.substr(movieURL.toLowerCase().lastIndexOf('.swf?') + 4);
- if (urlParams) return movieURL;
- } else if (movieURL.lastIndexOf('/') !== movieURL.length - 1) {
- movieURL += '/';
- }
- }
- url = (movieURL && movieURL.lastIndexOf('/') !== -1 ? movieURL.substr(0, movieURL.lastIndexOf('/') + 1) : './') + sm2.movieURL;
- if (sm2.noSWFCache) {
- url += ('?ts=' + new Date().getTime());
- }
- return url;
- };
- setVersionInfo = function() {
- fV = parseInt(sm2.flashVersion, 10);
- if (fV !== 8 && fV !== 9) {
- sm2.flashVersion = fV = defaultFlashVersion;
- }
- var isDebug = (sm2.debugMode || sm2.debugFlash ? '_debug.swf' : '.swf');
- if (sm2.useHTML5Audio && !sm2.html5Only && sm2.audioFormats.mp4.required && fV < 9) {
- sm2.flashVersion = fV = 9;
- }
- sm2.version = sm2.versionNumber + (sm2.html5Only ? ' (HTML5-only mode)' : (fV === 9 ? ' (AS3/Flash 9)' : ' (AS2/Flash 8)'));
- if (fV > 8) {
- sm2.defaultOptions = mixin(sm2.defaultOptions, sm2.flash9Options);
- sm2.features.buffering = true;
- sm2.defaultOptions = mixin(sm2.defaultOptions, sm2.movieStarOptions);
- sm2.filePatterns.flash9 = new RegExp('\\.(mp3|' + netStreamTypes.join('|') + ')(\\?.*)?$', 'i');
- sm2.features.movieStar = true;
- } else {
- sm2.features.movieStar = false;
- }
- sm2.filePattern = sm2.filePatterns[(fV !== 8 ? 'flash9' : 'flash8')];
- sm2.movieURL = (fV === 8 ? 'soundmanager2.swf' : 'soundmanager2_flash9.swf').replace('.swf', isDebug);
- sm2.features.peakData = sm2.features.waveformData = sm2.features.eqData = (fV > 8);
- };
- setPolling = function(bPolling, bHighPerformance) {
- if (!flash) {
- return;
- }
- flash._setPolling(bPolling, bHighPerformance);
- };
- initDebug = function() {
- };
- idCheck = this.getSoundById;
- getSWFCSS = function() {
- var css = [];
- if (sm2.debugMode) {
- css.push(swfCSS.sm2Debug);
- }
- if (sm2.debugFlash) {
- css.push(swfCSS.flashDebug);
- }
- if (sm2.useHighPerformance) {
- css.push(swfCSS.highPerf);
- }
- return css.join(' ');
- };
- flashBlockHandler = function() {
- var name = str('fbHandler'),
- p = sm2.getMoviePercent(),
- css = swfCSS,
- error = {
- type: 'FLASHBLOCK'
- };
- if (sm2.html5Only) {
- return;
- }
- if (!sm2.ok()) {
- if (needsFlash) {
- sm2.oMC.className = getSWFCSS() + ' ' + css.swfDefault + ' ' + (p === null ? css.swfTimedout : css.swfError);
- }
- sm2.didFlashBlock = true;
- processOnEvents({
- type: 'ontimeout',
- ignoreInit: true,
- error: error
- });
- catchError(error);
- } else {
- if (sm2.oMC) {
- sm2.oMC.className = [getSWFCSS(), css.swfDefault, css.swfLoaded + (sm2.didFlashBlock ? ' ' + css.swfUnblocked : '')].join(' ');
- }
- }
- };
- addOnEvent = function(sType, oMethod, oScope) {
- if (on_queue[sType] === _undefined) {
- on_queue[sType] = [];
- }
- on_queue[sType].push({
- method: oMethod,
- scope: (oScope || null),
- fired: false
- });
- };
- processOnEvents = function(oOptions) {
- if (!oOptions) {
- oOptions = {
- type: (sm2.ok() ? 'onready' : 'ontimeout')
- };
- }
- if (!didInit && oOptions && !oOptions.ignoreInit) return false;
- if (oOptions.type === 'ontimeout' && (sm2.ok() || (disabled && !oOptions.ignoreInit))) return false;
- var status = {
- success: (oOptions && oOptions.ignoreInit ? sm2.ok() : !disabled)
- },
- srcQueue = (oOptions && oOptions.type ? on_queue[oOptions.type] || [] : []),
- queue = [], i, j,
- args = [status],
- canRetry = (needsFlash && !sm2.ok());
- if (oOptions.error) {
- args[0].error = oOptions.error;
- }
- for (i = 0, j = srcQueue.length; i < j; i++) {
- if (srcQueue[i].fired !== true) {
- queue.push(srcQueue[i]);
- }
- }
- if (queue.length) {
- for (i = 0, j = queue.length; i < j; i++) {
- if (queue[i].scope) {
- queue[i].method.apply(queue[i].scope, args);
- } else {
- queue[i].method.apply(this, args);
- }
- if (!canRetry) {
- queue[i].fired = true;
- }
- }
- }
- return true;
- };
- initUserOnload = function() {
- window.setTimeout(function() {
- if (sm2.useFlashBlock) {
- flashBlockHandler();
- }
- processOnEvents();
- if (typeof sm2.onload === 'function') {
- sm2.onload.apply(window);
- }
- if (sm2.waitForWindowLoad) {
- event.add(window, 'load', initUserOnload);
- }
- }, 1);
- };
- detectFlash = function() {
- if (hasFlash !== _undefined) return hasFlash;
- var hasPlugin = false, n = navigator, obj, type, types, AX = window.ActiveXObject;
- var nP;
- try {
- nP = n.plugins;
- } catch(e) {
- nP = undefined;
- }
- if (nP && nP.length) {
- type = 'application/x-shockwave-flash';
- types = n.mimeTypes;
- if (types && types[type] && types[type].enabledPlugin && types[type].enabledPlugin.description) {
- hasPlugin = true;
- }
- } else if (AX !== _undefined && !ua.match(/MSAppHost/i)) {
- try {
- obj = new AX('ShockwaveFlash.ShockwaveFlash');
- } catch(e) {
- obj = null;
- }
- hasPlugin = (!!obj);
- obj = null;
- }
- hasFlash = hasPlugin;
- return hasPlugin;
- };
- featureCheck = function() {
- var flashNeeded,
- item,
- formats = sm2.audioFormats,
- isSpecial = (is_iDevice && !!(ua.match(/os (1|2|3_0|3_1)\s/i)));
- if (isSpecial) {
- sm2.hasHTML5 = false;
- sm2.html5Only = true;
- if (sm2.oMC) {
- sm2.oMC.style.display = 'none';
- }
- } else if (sm2.useHTML5Audio) {
- if (!sm2.html5 || !sm2.html5.canPlayType) {
- sm2.hasHTML5 = false;
- }
- }
- if (sm2.useHTML5Audio && sm2.hasHTML5) {
- canIgnoreFlash = true;
- for (item in formats) {
- if (formats.hasOwnProperty(item)) {
- if (formats[item].required) {
- if (!sm2.html5.canPlayType(formats[item].type)) {
- canIgnoreFlash = false;
- flashNeeded = true;
- } else if (sm2.preferFlash && (sm2.flash[item] || sm2.flash[formats[item].type])) {
- flashNeeded = true;
- }
- }
- }
- }
- }
- if (sm2.ignoreFlash) {
- flashNeeded = false;
- canIgnoreFlash = true;
- }
- sm2.html5Only = (sm2.hasHTML5 && sm2.useHTML5Audio && !flashNeeded);
- return (!sm2.html5Only);
- };
- parseURL = function(url) {
- var i, j, urlResult = 0, result;
- if (url instanceof Array) {
- for (i = 0, j = url.length; i < j; i++) {
- if (url[i] instanceof Object) {
- if (sm2.canPlayMIME(url[i].type)) {
- urlResult = i;
- break;
- }
- } else if (sm2.canPlayURL(url[i])) {
- urlResult = i;
- break;
- }
- }
- if (url[urlResult].url) {
- url[urlResult] = url[urlResult].url;
- }
- result = url[urlResult];
- } else {
- result = url;
- }
- return result;
- };
- startTimer = function(oSound) {
- if (!oSound._hasTimer) {
- oSound._hasTimer = true;
- if (!mobileHTML5 && sm2.html5PollingInterval) {
- if (h5IntervalTimer === null && h5TimerCount === 0) {
- h5IntervalTimer = setInterval(timerExecute, sm2.html5PollingInterval);
- }
- h5TimerCount++;
- }
- }
- };
- stopTimer = function(oSound) {
- if (oSound._hasTimer) {
- oSound._hasTimer = false;
- if (!mobileHTML5 && sm2.html5PollingInterval) {
- h5TimerCount--;
- }
- }
- };
- timerExecute = function() {
- var i;
- if (h5IntervalTimer !== null && !h5TimerCount) {
- clearInterval(h5IntervalTimer);
- h5IntervalTimer = null;
- return;
- }
- for (i = sm2.soundIDs.length - 1; i >= 0; i--) {
- if (sm2.sounds[sm2.soundIDs[i]].isHTML5 && sm2.sounds[sm2.soundIDs[i]]._hasTimer) {
- sm2.sounds[sm2.soundIDs[i]]._onTimer();
- }
- }
- };
- catchError = function(options) {
- options = (options !== _undefined ? options : {});
- if (typeof sm2.onerror === 'function') {
- sm2.onerror.apply(window, [{
- type: (options.type !== _undefined ? options.type : null)
- }]);
- }
- if (options.fatal !== _undefined && options.fatal) {
- sm2.disable();
- }
- };
- badSafariFix = function() {
- if (!isBadSafari || !detectFlash()) {
- return;
- }
- var aF = sm2.audioFormats, i, item;
- for (item in aF) {
- if (aF.hasOwnProperty(item)) {
- if (item === 'mp3' || item === 'mp4') {
- sm2.html5[item] = false;
- if (aF[item] && aF[item].related) {
- for (i = aF[item].related.length - 1; i >= 0; i--) {
- sm2.html5[aF[item].related[i]] = false;
- }
- }
- }
- }
- }
- };
- this._setSandboxType = function(sandboxType) {
- };
- this._externalInterfaceOK = function(swfVersion) {
- if (sm2.swfLoaded) {
- return;
- }
- var e;
- sm2.swfLoaded = true;
- tryInitOnFocus = false;
- if (isBadSafari) {
- badSafariFix();
- }
- setTimeout(init, isIE ? 100 : 1);
- };
- createMovie = function(movieID, movieURL) {
- if (didAppend && appendSuccess) return false;
- function initMsg() {
- }
- if (sm2.html5Only) {
- setVersionInfo();
- initMsg();
- sm2.oMC = id(sm2.movieID);
- init();
- didAppend = true;
- appendSuccess = true;
- return false;
- }
- var remoteURL = (movieURL || sm2.url),
- localURL = (sm2.altURL || remoteURL),
- swfTitle = 'JS/Flash audio component (SoundManager 2)',
- oTarget = getDocument(),
- extraClass = getSWFCSS(),
- isRTL = null,
- html = doc.getElementsByTagName('html')[0],
- oEmbed, oMovie, tmp, movieHTML, oEl, s, x, sClass;
- isRTL = (html && html.dir && html.dir.match(/rtl/i));
- movieID = (movieID === _undefined ? sm2.id : movieID);
- function param(name, value) {
- return '<param name="' + name + '" value="' + value + '" />';
- }
- setVersionInfo();
- sm2.url = normalizeMovieURL(overHTTP ? remoteURL : localURL);
- movieURL = sm2.url;
- sm2.wmode = (!sm2.wmode && sm2.useHighPerformance ? 'transparent' : sm2.wmode);
- if (sm2.wmode !== null && (ua.match(/msie 8/i) || (!isIE && !sm2.useHighPerformance)) && navigator.platform.match(/win32|win64/i)) {
- messages.push(strings.spcWmode);
- sm2.wmode = null;
- }
- oEmbed = {
- name: movieID,
- id: movieID,
- src: movieURL,
- quality: 'high',
- allowScriptAccess: sm2.allowScriptAccess,
- bgcolor: sm2.bgColor,
- pluginspage: http + 'www.macromedia.com/go/getflashplayer',
- title: swfTitle,
- type: 'application/x-shockwave-flash',
- wmode: sm2.wmode,
- hasPriority: 'true'
- };
- if (sm2.debugFlash) {
- oEmbed.FlashVars = 'debug=1';
- }
- if (!sm2.wmode) {
- delete oEmbed.wmode;
- }
- if (isIE) {
- oMovie = doc.createElement('div');
- movieHTML = [
- '<object id="' + movieID + '" data="' + movieURL + '" type="' + oEmbed.type + '" title="' + oEmbed.title + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">',
- param('movie', movieURL),
- param('AllowScriptAccess', sm2.allowScriptAccess),
- param('quality', oEmbed.quality),
- (sm2.wmode ? param('wmode', sm2.wmode) : ''),
- param('bgcolor', sm2.bgColor),
- param('hasPriority', 'true'),
- (sm2.debugFlash ? param('FlashVars', oEmbed.FlashVars) : ''),
- '</object>'
- ].join('');
- } else {
- oMovie = doc.createElement('embed');
- for (tmp in oEmbed) {
- if (oEmbed.hasOwnProperty(tmp)) {
- oMovie.setAttribute(tmp, oEmbed[tmp]);
- }
- }
- }
- initDebug();
- extraClass = getSWFCSS();
- oTarget = getDocument();
- if (oTarget) {
- sm2.oMC = (id(sm2.movieID) || doc.createElement('div'));
- if (!sm2.oMC.id) {
- sm2.oMC.id = sm2.movieID;
- sm2.oMC.className = swfCSS.swfDefault + ' ' + extraClass;
- s = null;
- oEl = null;
- if (!sm2.useFlashBlock) {
- if (sm2.useHighPerformance) {
- s = {
- position: 'fixed',
- width: '8px',
- height: '8px',
- bottom: '0px',
- left: '0px',
- overflow: 'hidden'
- };
- } else {
- s = {
- position: 'absolute',
- width: '6px',
- height: '6px',
- top: '-9999px',
- left: '-9999px'
- };
- if (isRTL) {
- s.left = Math.abs(parseInt(s.left, 10)) + 'px';
- }
- }
- }
- if (isWebkit) {
- sm2.oMC.style.zIndex = 10000;
- }
- if (!sm2.debugFlash) {
- for (x in s) {
- if (s.hasOwnProperty(x)) {
- sm2.oMC.style[x] = s[x];
- }
- }
- }
- try {
- if (!isIE) {
- sm2.oMC.appendChild(oMovie);
- }
- oTarget.appendChild(sm2.oMC);
- if (isIE) {
- oEl = sm2.oMC.appendChild(doc.createElement('div'));
- oEl.className = swfCSS.swfBox;
- oEl.innerHTML = movieHTML;
- }
- appendSuccess = true;
- } catch(e) {
- throw new Error(str('domError') + ' \n' + e.toString());
- }
- } else {
- sClass = sm2.oMC.className;
- sm2.oMC.className = (sClass ? sClass + ' ' : swfCSS.swfDefault) + (extraClass ? ' ' + extraClass : '');
- sm2.oMC.appendChild(oMovie);
- if (isIE) {
- oEl = sm2.oMC.appendChild(doc.createElement('div'));
- oEl.className = swfCSS.swfBox;
- oEl.innerHTML = movieHTML;
- }
- appendSuccess = true;
- }
- }
- didAppend = true;
- initMsg();
- return true;
- };
- initMovie = function() {
- if (sm2.html5Only) {
- createMovie();
- return false;
- }
- if (flash) return false;
- if (!sm2.url) {
- return false;
- }
- flash = sm2.getMovie(sm2.id);
- if (!flash) {
- if (!oRemoved) {
- createMovie(sm2.id, sm2.url);
- } else {
- if (!isIE) {
- sm2.oMC.appendChild(oRemoved);
- } else {
- sm2.oMC.innerHTML = oRemovedHTML;
- }
- oRemoved = null;
- didAppend = true;
- }
- flash = sm2.getMovie(sm2.id);
- }
- if (typeof sm2.oninitmovie === 'function') {
- setTimeout(sm2.oninitmovie, 1);
- }
- return true;
- };
- delayWaitForEI = function() {
- setTimeout(waitForEI, 1000);
- };
- rebootIntoHTML5 = function() {
- window.setTimeout(function() {
- sm2.setup({
- preferFlash: false
- }).reboot();
- sm2.didFlashBlock = true;
- sm2.beginDelayedInit();
- }, 1);
- };
- waitForEI = function() {
- var p,
- loadIncomplete = false;
- if (!sm2.url) {
- return;
- }
- if (waitingForEI) {
- return;
- }
- waitingForEI = true;
- event.remove(window, 'load', delayWaitForEI);
- if (hasFlash && tryInitOnFocus && !isFocused) {
- return;
- }
- if (!didInit) {
- p = sm2.getMoviePercent();
- if (p > 0 && p < 100) {
- loadIncomplete = true;
- }
- }
- setTimeout(function() {
- p = sm2.getMoviePercent();
- if (loadIncomplete) {
- waitingForEI = false;
- window.setTimeout(delayWaitForEI, 1);
- return;
- }
- if (!didInit && okToDisable) {
- if (p === null) {
- if (sm2.useFlashBlock || sm2.flashLoadTimeout === 0) {
- if (sm2.useFlashBlock) {
- flashBlockHandler();
- }
- } else if (!sm2.useFlashBlock && canIgnoreFlash) {
- rebootIntoHTML5();
- } else {
- processOnEvents({
- type: 'ontimeout',
- ignoreInit: true,
- error: {
- type: 'INIT_FLASHBLOCK'
- }
- });
- }
- } else if (sm2.flashLoadTimeout === 0) {
- } else if (!sm2.useFlashBlock && canIgnoreFlash) {
- rebootIntoHTML5();
- } else {
- failSafely(true);
- }
- }
- }, sm2.flashLoadTimeout);
- };
- handleFocus = function() {
- function cleanup() {
- event.remove(window, 'focus', handleFocus);
- }
- if (isFocused || !tryInitOnFocus) {
- cleanup();
- return true;
- }
- okToDisable = true;
- isFocused = true;
- waitingForEI = false;
- delayWaitForEI();
- cleanup();
- return true;
- };
- flushMessages = function() {
- };
- showSupport = function() {
- };
- initComplete = function(bNoDisable) {
- if (didInit) return false;
- if (sm2.html5Only) {
- didInit = true;
- initUserOnload();
- return true;
- }
- var wasTimeout = (sm2.useFlashBlock && sm2.flashLoadTimeout && !sm2.getMoviePercent()),
- result = true,
- error;
- if (!wasTimeout) {
- didInit = true;
- }
- error = {
- type: (!hasFlash && needsFlash ? 'NO_FLASH' : 'INIT_TIMEOUT')
- };
- if (disabled || bNoDisable) {
- if (sm2.useFlashBlock && sm2.oMC) {
- sm2.oMC.className = getSWFCSS() + ' ' + (sm2.getMoviePercent() === null ? swfCSS.swfTimedout : swfCSS.swfError);
- }
- processOnEvents({
- type: 'ontimeout',
- error: error,
- ignoreInit: true
- });
- catchError(error);
- result = false;
- } else {
- }
- if (!disabled) {
- if (sm2.waitForWindowLoad && !windowLoaded) {
- event.add(window, 'load', initUserOnload);
- } else {
- initUserOnload();
- }
- }
- return result;
- };
- setProperties = function() {
- var i,
- o = sm2.setupOptions;
- for (i in o) {
- if (o.hasOwnProperty(i)) {
- if (sm2[i] === _undefined) {
- sm2[i] = o[i];
- } else if (sm2[i] !== o[i]) {
- sm2.setupOptions[i] = sm2[i];
- }
- }
- }
- };
- init = function() {
- if (didInit) {
- return false;
- }
- function cleanup() {
- event.remove(window, 'load', sm2.beginDelayedInit);
- }
- if (sm2.html5Only) {
- if (!didInit) {
- cleanup();
- sm2.enabled = true;
- initComplete();
- }
- return true;
- }
- initMovie();
- try {
- flash._externalInterfaceTest(false);
- setPolling(true, (sm2.flashPollingInterval || (sm2.useHighPerformance ? 10 : 50)));
- if (!sm2.debugMode) {
- flash._disableDebug();
- }
- sm2.enabled = true;
- if (!sm2.html5Only) {
- event.add(window, 'unload', doNothing);
- }
- } catch(e) {
- catchError({
- type: 'JS_TO_FLASH_EXCEPTION',
- fatal: true
- });
- failSafely(true);
- initComplete();
- return false;
- }
- initComplete();
- cleanup();
- return true;
- };
- domContentLoaded = function() {
- if (didDCLoaded) return false;
- didDCLoaded = true;
- setProperties();
- initDebug();
- if (!hasFlash && sm2.hasHTML5) {
- sm2.setup({
- useHTML5Audio: true,
- preferFlash: false
- });
- }
- testHTML5();
- if (!hasFlash && needsFlash) {
- messages.push(strings.needFlash);
- sm2.setup({
- flashLoadTimeout: 1
- });
- }
- if (doc.removeEventListener) {
- doc.removeEventListener('DOMContentLoaded', domContentLoaded, false);
- }
- initMovie();
- return true;
- };
- domContentLoadedIE = function() {
- if (doc.readyState === 'complete') {
- domContentLoaded();
- doc.detachEvent('onreadystatechange', domContentLoadedIE);
- }
- return true;
- };
- winOnLoad = function() {
- windowLoaded = true;
- domContentLoaded();
- event.remove(window, 'load', winOnLoad);
- };
- detectFlash();
- event.add(window, 'focus', handleFocus);
- event.add(window, 'load', delayWaitForEI);
- event.add(window, 'load', winOnLoad);
- if (doc.addEventListener) {
- doc.addEventListener('DOMContentLoaded', domContentLoaded, false);
- } else if (doc.attachEvent) {
- doc.attachEvent('onreadystatechange', domContentLoadedIE);
- } else {
- catchError({
- type: 'NO_DOM2_EVENTS',
- fatal: true
- });
- }
-}
-// SM2_DEFER details: http://www.schillmania.com/projects/soundmanager2/doc/getstarted/#lazy-loading
-if (window.SM2_DEFER === _undefined || !SM2_DEFER) {
- soundManager = new SoundManager();
-}
-if (typeof module === 'object' && module && typeof module.exports === 'object') {
- module.exports.SoundManager = SoundManager;
- module.exports.soundManager = soundManager;
-} else if (typeof define === 'function' && define.amd) {
- define(function() {
- function getInstance(smBuilder) {
- if (!window.soundManager && smBuilder instanceof Function) {
- var instance = smBuilder(SoundManager);
- if (instance instanceof SoundManager) {
- window.soundManager = instance;
- }
- }
- return window.soundManager;
- }
- return {
- constructor: SoundManager,
- getInstance: getInstance
- };
- });
-}
-// standard browser case
-// constructor
-window.SoundManager = SoundManager;
-// public API, flash callbacks etc.
-window.soundManager = soundManager;
-}(window));
diff --git a/priv/static/js/soundmanager2.js b/priv/static/js/soundmanager2.js deleted file mode 100755 index d38b38d..0000000 --- a/priv/static/js/soundmanager2.js +++ /dev/null @@ -1,6294 +0,0 @@ -/** @license
- *
- * SoundManager 2: JavaScript Sound for the Web
- * ----------------------------------------------
- * http://schillmania.com/projects/soundmanager2/
- *
- * Copyright (c) 2007, Scott Schiller. All rights reserved.
- * Code provided under the BSD License:
- * http://schillmania.com/projects/soundmanager2/license.txt
- *
- * V2.97a.20170601
- */
-
-/**
- * About this file
- * -------------------------------------------------------------------------------------
- * This is the fully-commented source version of the SoundManager 2 API,
- * recommended for use during development and testing.
- *
- * See soundmanager2-nodebug-jsmin.js for an optimized build (~11KB with gzip.)
- * http://schillmania.com/projects/soundmanager2/doc/getstarted/#basic-inclusion
- * Alternately, serve this file with gzip for 75% compression savings (~30KB over HTTP.)
- *
- * You may notice <d> and </d> comments in this source; these are delimiters for
- * debug blocks which are removed in the -nodebug builds, further optimizing code size.
- *
- * Also, as you may note: Whoa, reliable cross-platform/device audio support is hard! ;)
- */
-
-(function SM2(window, _undefined) {
-
-/* global Audio, document, window, navigator, define, module, SM2_DEFER, opera, setTimeout, setInterval, clearTimeout, sm2Debugger */
-
-'use strict';
-
-if (!window || !window.document) {
-
- // Don't cross the [environment] streams. SM2 expects to be running in a browser, not under node.js etc.
- // Additionally, if a browser somehow manages to fail this test, as Egon said: "It would be bad."
-
- throw new Error('SoundManager requires a browser with window and document objects.');
-
-}
-
-var soundManager = null;
-
-/**
- * The SoundManager constructor.
- *
- * @constructor
- * @param {string} smURL Optional: Path to SWF files
- * @param {string} smID Optional: The ID to use for the SWF container element
- * @this {SoundManager}
- * @return {SoundManager} The new SoundManager instance
- */
-
-function SoundManager(smURL, smID) {
-
- /**
- * soundManager configuration options list
- * defines top-level configuration properties to be applied to the soundManager instance (eg. soundManager.flashVersion)
- * to set these properties, use the setup() method - eg., soundManager.setup({url: '/swf/', flashVersion: 9})
- */
-
- this.setupOptions = {
-
- url: (smURL || null), // path (directory) where SoundManager 2 SWFs exist, eg., /path/to/swfs/
- flashVersion: 8, // flash build to use (8 or 9.) Some API features require 9.
- debugMode: true, // enable debugging output (console.log() with HTML fallback)
- debugFlash: false, // enable debugging output inside SWF, troubleshoot Flash/browser issues
- useConsole: true, // use console.log() if available (otherwise, writes to #soundmanager-debug element)
- consoleOnly: true, // if console is being used, do not create/write to #soundmanager-debug
- waitForWindowLoad: false, // force SM2 to wait for window.onload() before trying to call soundManager.onload()
- bgColor: '#ffffff', // SWF background color. N/A when wmode = 'transparent'
- useHighPerformance: false, // position:fixed flash movie can help increase js/flash speed, minimize lag
- flashPollingInterval: null, // msec affecting whileplaying/loading callback frequency. If null, default of 50 msec is used.
- html5PollingInterval: null, // msec affecting whileplaying() for HTML5 audio, excluding mobile devices. If null, native HTML5 update events are used.
- flashLoadTimeout: 1000, // msec to wait for flash movie to load before failing (0 = infinity)
- wmode: null, // flash rendering mode - null, 'transparent', or 'opaque' (last two allow z-index to work)
- allowScriptAccess: 'always', // for scripting the SWF (object/embed property), 'always' or 'sameDomain'
- useFlashBlock: false, // *requires flashblock.css, see demos* - allow recovery from flash blockers. Wait indefinitely and apply timeout CSS to SWF, if applicable.
- useHTML5Audio: true, // use HTML5 Audio() where API is supported (most Safari, Chrome versions), Firefox (MP3/MP4 support varies.) Ideally, transparent vs. Flash API where possible.
- forceUseGlobalHTML5Audio: false, // if true, a single Audio() object is used for all sounds - and only one can play at a time.
- ignoreMobileRestrictions: false, // if true, SM2 will not apply global HTML5 audio rules to mobile UAs. iOS > 7 and WebViews may allow multiple Audio() instances.
- html5Test: /^(probably|maybe)$/i, // HTML5 Audio() format support test. Use /^probably$/i; if you want to be more conservative.
- preferFlash: false, // overrides useHTML5audio, will use Flash for MP3/MP4/AAC if present. Potential option if HTML5 playback with these formats is quirky.
- noSWFCache: false, // if true, appends ?ts={date} to break aggressive SWF caching.
- idPrefix: 'sound' // if an id is not provided to createSound(), this prefix is used for generated IDs - 'sound0', 'sound1' etc.
-
- };
-
- this.defaultOptions = {
-
- /**
- * the default configuration for sound objects made with createSound() and related methods
- * eg., volume, auto-load behaviour and so forth
- */
-
- autoLoad: false, // enable automatic loading (otherwise .load() will be called on demand with .play(), the latter being nicer on bandwidth - if you want to .load yourself, you also can)
- autoPlay: false, // enable playing of file as soon as possible (much faster if "stream" is true)
- from: null, // position to start playback within a sound (msec), default = beginning
- loops: 1, // how many times to repeat the sound (position will wrap around to 0, setPosition() will break out of loop when >0)
- onid3: null, // callback function for "ID3 data is added/available"
- onerror: null, // callback function for "load failed" (or, playback/network/decode error under HTML5.)
- onload: null, // callback function for "load finished"
- whileloading: null, // callback function for "download progress update" (X of Y bytes received)
- onplay: null, // callback for "play" start
- onpause: null, // callback for "pause"
- onresume: null, // callback for "resume" (pause toggle)
- whileplaying: null, // callback during play (position update)
- onposition: null, // object containing times and function callbacks for positions of interest
- onstop: null, // callback for "user stop"
- onfinish: null, // callback function for "sound finished playing"
- multiShot: true, // let sounds "restart" or layer on top of each other when played multiple times, rather than one-shot/one at a time
- multiShotEvents: false, // fire multiple sound events (currently onfinish() only) when multiShot is enabled
- position: null, // offset (milliseconds) to seek to within loaded sound data.
- pan: 0, // "pan" settings, left-to-right, -100 to 100
- playbackRate: 1, // rate at which to play the sound (HTML5-only)
- stream: true, // allows playing before entire file has loaded (recommended)
- to: null, // position to end playback within a sound (msec), default = end
- type: null, // MIME-like hint for file pattern / canPlay() tests, eg. audio/mp3
- usePolicyFile: false, // enable crossdomain.xml request for audio on remote domains (for ID3/waveform access)
- volume: 100 // self-explanatory. 0-100, the latter being the max.
-
- };
-
- this.flash9Options = {
-
- /**
- * flash 9-only options,
- * merged into defaultOptions if flash 9 is being used
- */
-
- onfailure: null, // callback function for when playing fails (Flash 9, MovieStar + RTMP-only)
- isMovieStar: null, // "MovieStar" MPEG4 audio mode. Null (default) = auto detect MP4, AAC etc. based on URL. true = force on, ignore URL
- usePeakData: false, // enable left/right channel peak (level) data
- useWaveformData: false, // enable sound spectrum (raw waveform data) - NOTE: May increase CPU load.
- useEQData: false, // enable sound EQ (frequency spectrum data) - NOTE: May increase CPU load.
- onbufferchange: null, // callback for "isBuffering" property change
- ondataerror: null // callback for waveform/eq data access error (flash playing audio in other tabs/domains)
-
- };
-
- this.movieStarOptions = {
-
- /**
- * flash 9.0r115+ MPEG4 audio options,
- * merged into defaultOptions if flash 9+movieStar mode is enabled
- */
-
- bufferTime: 3, // seconds of data to buffer before playback begins (null = flash default of 0.1 seconds - if AAC playback is gappy, try increasing.)
- serverURL: null, // rtmp: FMS or FMIS server to connect to, required when requesting media via RTMP or one of its variants
- onconnect: null, // rtmp: callback for connection to flash media server
- duration: null // rtmp: song duration (msec)
-
- };
-
- this.audioFormats = {
-
- /**
- * determines HTML5 support + flash requirements.
- * if no support (via flash and/or HTML5) for a "required" format, SM2 will fail to start.
- * flash fallback is used for MP3 or MP4 if HTML5 can't play it (or if preferFlash = true)
- */
-
- mp3: {
- type: ['audio/mpeg; codecs="mp3"', 'audio/mpeg', 'audio/mp3', 'audio/MPA', 'audio/mpa-robust'],
- required: true
- },
-
- mp4: {
- related: ['aac', 'm4a', 'm4b'], // additional formats under the MP4 container
- type: ['audio/mp4; codecs="mp4a.40.2"', 'audio/aac', 'audio/x-m4a', 'audio/MP4A-LATM', 'audio/mpeg4-generic'],
- required: false
- },
-
- ogg: {
- type: ['audio/ogg; codecs=vorbis'],
- required: false
- },
-
- opus: {
- type: ['audio/ogg; codecs=opus', 'audio/opus'],
- required: false
- },
-
- wav: {
- type: ['audio/wav; codecs="1"', 'audio/wav', 'audio/wave', 'audio/x-wav'],
- required: false
- },
-
- flac: {
- type: ['audio/flac'],
- required: false
- }
-
- };
-
- // HTML attributes (id + class names) for the SWF container
-
- this.movieID = 'sm2-container';
- this.id = (smID || 'sm2movie');
-
- this.debugID = 'soundmanager-debug';
- this.debugURLParam = /([#?&])debug=1/i;
-
- // dynamic attributes
-
- this.versionNumber = 'V2.97a.20170601';
- this.version = null;
- this.movieURL = null;
- this.altURL = null;
- this.swfLoaded = false;
- this.enabled = false;
- this.oMC = null;
- this.sounds = {};
- this.soundIDs = [];
- this.muted = false;
- this.didFlashBlock = false;
- this.filePattern = null;
-
- this.filePatterns = {
- flash8: /\.mp3(\?.*)?$/i,
- flash9: /\.mp3(\?.*)?$/i
- };
-
- // support indicators, set at init
-
- this.features = {
- buffering: false,
- peakData: false,
- waveformData: false,
- eqData: false,
- movieStar: false
- };
-
- // flash sandbox info, used primarily in troubleshooting
-
- this.sandbox = {
- // <d>
- type: null,
- types: {
- remote: 'remote (domain-based) rules',
- localWithFile: 'local with file access (no internet access)',
- localWithNetwork: 'local with network (internet access only, no local access)',
- localTrusted: 'local, trusted (local+internet access)'
- },
- description: null,
- noRemote: null,
- noLocal: null
- // </d>
- };
-
- /**
- * format support (html5/flash)
- * stores canPlayType() results based on audioFormats.
- * eg. { mp3: boolean, mp4: boolean }
- * treat as read-only.
- */
-
- this.html5 = {
- usingFlash: null // set if/when flash fallback is needed
- };
-
- // file type support hash
- this.flash = {};
-
- // determined at init time
- this.html5Only = false;
-
- // used for special cases (eg. iPad/iPhone/palm OS?)
- this.ignoreFlash = false;
-
- /**
- * a few private internals (OK, a lot. :D)
- */
-
- var SMSound,
- sm2 = this, globalHTML5Audio = null, flash = null, sm = 'soundManager', smc = sm + ': ', h5 = 'HTML5::', id, ua = navigator.userAgent, wl = window.location.href.toString(), doc = document, doNothing, setProperties, init, fV, on_queue = [], debugOpen = true, debugTS, didAppend = false, appendSuccess = false, didInit = false, disabled = false, windowLoaded = false, _wDS, wdCount = 0, initComplete, mixin, assign, extraOptions, addOnEvent, processOnEvents, initUserOnload, delayWaitForEI, waitForEI, rebootIntoHTML5, setVersionInfo, handleFocus, strings, initMovie, domContentLoaded, winOnLoad, didDCLoaded, getDocument, createMovie, catchError, setPolling, initDebug, debugLevels = ['log', 'info', 'warn', 'error'], defaultFlashVersion = 8, disableObject, failSafely, normalizeMovieURL, oRemoved = null, oRemovedHTML = null, str, flashBlockHandler, getSWFCSS, swfCSS, toggleDebug, loopFix, policyFix, complain, idCheck, waitingForEI = false, initPending = false, startTimer, stopTimer, timerExecute, h5TimerCount = 0, h5IntervalTimer = null, parseURL, messages = [],
- canIgnoreFlash, needsFlash = null, featureCheck, html5OK, html5CanPlay, html5ErrorCodes, html5Ext, html5Unload, domContentLoadedIE, testHTML5, event, slice = Array.prototype.slice, useGlobalHTML5Audio = false, lastGlobalHTML5URL, hasFlash, detectFlash, badSafariFix, html5_events, showSupport, flushMessages, wrapCallback, idCounter = 0, didSetup, msecScale = 1000,
- is_iDevice = ua.match(/(ipad|iphone|ipod)/i), isAndroid = ua.match(/android/i), isIE = ua.match(/msie|trident/i),
- isWebkit = ua.match(/webkit/i),
- isSafari = (ua.match(/safari/i) && !ua.match(/chrome/i)),
- isOpera = (ua.match(/opera/i)),
- mobileHTML5 = (ua.match(/(mobile|pre\/|xoom)/i) || is_iDevice || isAndroid),
- isBadSafari = (!wl.match(/usehtml5audio/i) && !wl.match(/sm2-ignorebadua/i) && isSafari && !ua.match(/silk/i) && ua.match(/OS\sX\s10_6_([3-7])/i)), // Safari 4 and 5 (excluding Kindle Fire, "Silk") occasionally fail to load/play HTML5 audio on Snow Leopard 10.6.3 through 10.6.7 due to bug(s) in QuickTime X and/or other underlying frameworks. :/ Confirmed bug. https://bugs.webkit.org/show_bug.cgi?id=32159
- hasConsole = (window.console !== _undefined && console.log !== _undefined),
- isFocused = (doc.hasFocus !== _undefined ? doc.hasFocus() : null),
- tryInitOnFocus = (isSafari && (doc.hasFocus === _undefined || !doc.hasFocus())),
- okToDisable = !tryInitOnFocus,
- flashMIME = /(mp3|mp4|mpa|m4a|m4b)/i,
- emptyURL = 'about:blank', // safe URL to unload, or load nothing from (flash 8 + most HTML5 UAs)
- emptyWAV = 'data:audio/wave;base64,/UklGRiYAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQIAAAD//w==', // tiny WAV for HTML5 unloading
- overHTTP = (doc.location ? doc.location.protocol.match(/http/i) : null),
- http = (!overHTTP ? '//' : ''),
- // mp3, mp4, aac etc.
- netStreamMimeTypes = /^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4|m4v|m4a|m4b|mp4v|3gp|3g2)\s*(?:$|;)/i,
- // Flash v9.0r115+ "moviestar" formats
- netStreamTypes = ['mpeg4', 'aac', 'flv', 'mov', 'mp4', 'm4v', 'f4v', 'm4a', 'm4b', 'mp4v', '3gp', '3g2'],
- netStreamPattern = new RegExp('\\.(' + netStreamTypes.join('|') + ')(\\?.*)?$', 'i');
-
- this.mimePattern = /^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i; // default mp3 set
-
- // use altURL if not "online"
- this.useAltURL = !overHTTP;
-
- swfCSS = {
- swfBox: 'sm2-object-box',
- swfDefault: 'movieContainer',
- swfError: 'swf_error', // SWF loaded, but SM2 couldn't start (other error)
- swfTimedout: 'swf_timedout',
- swfLoaded: 'swf_loaded',
- swfUnblocked: 'swf_unblocked', // or loaded OK
- sm2Debug: 'sm2_debug',
- highPerf: 'high_performance',
- flashDebug: 'flash_debug'
- };
-
- /**
- * HTML5 error codes, per W3C
- * Error code 1, MEDIA_ERR_ABORTED: Client aborted download at user's request.
- * Error code 2, MEDIA_ERR_NETWORK: A network error of some description caused the user agent to stop fetching the media resource, after the resource was established to be usable.
- * Error code 3, MEDIA_ERR_DECODE: An error of some description occurred while decoding the media resource, after the resource was established to be usable.
- * Error code 4, MEDIA_ERR_SRC_NOT_SUPPORTED: Media (audio file) not supported ("not usable.")
- * Reference: https://html.spec.whatwg.org/multipage/embedded-content.html#error-codes
- */
- html5ErrorCodes = [
- null,
- 'MEDIA_ERR_ABORTED',
- 'MEDIA_ERR_NETWORK',
- 'MEDIA_ERR_DECODE',
- 'MEDIA_ERR_SRC_NOT_SUPPORTED'
- ];
-
- /**
- * basic HTML5 Audio() support test
- * try...catch because of IE 9 "not implemented" nonsense
- * https://github.com/Modernizr/Modernizr/issues/224
- */
-
- this.hasHTML5 = (function() {
- try {
- // new Audio(null) for stupid Opera 9.64 case, which throws not_enough_arguments exception otherwise.
- return (Audio !== _undefined && (isOpera && opera !== _undefined && opera.version() < 10 ? new Audio(null) : new Audio()).canPlayType !== _undefined);
- } catch(e) {
- return false;
- }
- }());
-
- /**
- * Public SoundManager API
- * -----------------------
- */
-
- /**
- * Configures top-level soundManager properties.
- *
- * @param {object} options Option parameters, eg. { flashVersion: 9, url: '/path/to/swfs/' }
- * onready and ontimeout are also accepted parameters. call soundManager.setup() to see the full list.
- */
-
- this.setup = function(options) {
-
- var noURL = (!sm2.url);
-
- // warn if flash options have already been applied
-
- if (options !== _undefined && didInit && needsFlash && sm2.ok() && (options.flashVersion !== _undefined || options.url !== _undefined || options.html5Test !== _undefined)) {
- complain(str('setupLate'));
- }
-
- // TODO: defer: true?
-
- assign(options);
-
- if (!useGlobalHTML5Audio) {
-
- if (mobileHTML5) {
-
- // force the singleton HTML5 pattern on mobile, by default.
- if (!sm2.setupOptions.ignoreMobileRestrictions || sm2.setupOptions.forceUseGlobalHTML5Audio) {
- messages.push(strings.globalHTML5);
- useGlobalHTML5Audio = true;
- }
-
- } else if (sm2.setupOptions.forceUseGlobalHTML5Audio) {
-
- // only apply singleton HTML5 on desktop if forced.
- messages.push(strings.globalHTML5);
- useGlobalHTML5Audio = true;
-
- }
-
- }
-
- if (!didSetup && mobileHTML5) {
-
- if (sm2.setupOptions.ignoreMobileRestrictions) {
-
- messages.push(strings.ignoreMobile);
-
- } else {
-
- // prefer HTML5 for mobile + tablet-like devices, probably more reliable vs. flash at this point.
-
- // <d>
- if (!sm2.setupOptions.useHTML5Audio || sm2.setupOptions.preferFlash) {
- // notify that defaults are being changed.
- sm2._wD(strings.mobileUA);
- }
- // </d>
-
- sm2.setupOptions.useHTML5Audio = true;
- sm2.setupOptions.preferFlash = false;
-
- if (is_iDevice) {
-
- // no flash here.
- sm2.ignoreFlash = true;
-
- } else if ((isAndroid && !ua.match(/android\s2\.3/i)) || !isAndroid) {
-
- /**
- * Android devices tend to work better with a single audio instance, specifically for chained playback of sounds in sequence.
- * Common use case: exiting sound onfinish() -> createSound() -> play()
- * Presuming similar restrictions for other mobile, non-Android, non-iOS devices.
- */
-
- // <d>
- sm2._wD(strings.globalHTML5);
- // </d>
-
- useGlobalHTML5Audio = true;
-
- }
-
- }
-
- }
-
- // special case 1: "Late setup". SM2 loaded normally, but user didn't assign flash URL eg., setup({url:...}) before SM2 init. Treat as delayed init.
-
- if (options) {
-
- if (noURL && didDCLoaded && options.url !== _undefined) {
- sm2.beginDelayedInit();
- }
-
- // special case 2: If lazy-loading SM2 (DOMContentLoaded has already happened) and user calls setup() with url: parameter, try to init ASAP.
-
- if (!didDCLoaded && options.url !== _undefined && doc.readyState === 'complete') {
- setTimeout(domContentLoaded, 1);
- }
-
- }
-
- didSetup = true;
-
- return sm2;
-
- };
-
- this.ok = function() {
-
- return (needsFlash ? (didInit && !disabled) : (sm2.useHTML5Audio && sm2.hasHTML5));
-
- };
-
- this.supported = this.ok; // legacy
-
- this.getMovie = function(movie_id) {
-
- // safety net: some old browsers differ on SWF references, possibly related to ExternalInterface / flash version
- return id(movie_id) || doc[movie_id] || window[movie_id];
-
- };
-
- /**
- * Creates a SMSound sound object instance. Can also be overloaded, e.g., createSound('mySound', '/some.mp3');
- *
- * @param {object} oOptions Sound options (at minimum, url parameter is required.)
- * @return {object} SMSound The new SMSound object.
- */
-
- this.createSound = function(oOptions, _url) {
-
- var cs, cs_string, options, oSound = null;
-
- // <d>
- cs = sm + '.createSound(): ';
- cs_string = cs + str(!didInit ? 'notReady' : 'notOK');
- // </d>
-
- if (!didInit || !sm2.ok()) {
- complain(cs_string);
- return false;
- }
-
- if (_url !== _undefined) {
- // function overloading in JS! :) ... assume simple createSound(id, url) use case.
- oOptions = {
- id: oOptions,
- url: _url
- };
- }
-
- // inherit from defaultOptions
- options = mixin(oOptions);
-
- options.url = parseURL(options.url);
-
- // generate an id, if needed.
- if (options.id === _undefined) {
- options.id = sm2.setupOptions.idPrefix + (idCounter++);
- }
-
- // <d>
- if (options.id.toString().charAt(0).match(/^[0-9]$/)) {
- sm2._wD(cs + str('badID', options.id), 2);
- }
-
- sm2._wD(cs + options.id + (options.url ? ' (' + options.url + ')' : ''), 1);
- // </d>
-
- if (idCheck(options.id, true)) {
- sm2._wD(cs + options.id + ' exists', 1);
- return sm2.sounds[options.id];
- }
-
- function make() {
-
- options = loopFix(options);
- sm2.sounds[options.id] = new SMSound(options);
- sm2.soundIDs.push(options.id);
- return sm2.sounds[options.id];
-
- }
-
- if (html5OK(options)) {
-
- oSound = make();
- // <d>
- if (!sm2.html5Only) {
- sm2._wD(options.id + ': Using HTML5');
- }
- // </d>
- oSound._setup_html5(options);
-
- } else {
-
- if (sm2.html5Only) {
- sm2._wD(options.id + ': No HTML5 support for this sound, and no Flash. Exiting.');
- return make();
- }
-
- // TODO: Move HTML5/flash checks into generic URL parsing/handling function.
-
- if (sm2.html5.usingFlash && options.url && options.url.match(/data:/i)) {
- // data: URIs not supported by Flash, either.
- sm2._wD(options.id + ': data: URIs not supported via Flash. Exiting.');
- return make();
- }
-
- if (fV > 8) {
- if (options.isMovieStar === null) {
- // attempt to detect MPEG-4 formats
- options.isMovieStar = !!(options.serverURL || (options.type ? options.type.match(netStreamMimeTypes) : false) || (options.url && options.url.match(netStreamPattern)));
- }
- // <d>
- if (options.isMovieStar) {
- sm2._wD(cs + 'using MovieStar handling');
- if (options.loops > 1) {
- _wDS('noNSLoop');
- }
- }
- // </d>
- }
-
- options = policyFix(options, cs);
- oSound = make();
-
- if (fV === 8) {
- flash._createSound(options.id, options.loops || 1, options.usePolicyFile);
- } else {
- flash._createSound(options.id, options.url, options.usePeakData, options.useWaveformData, options.useEQData, options.isMovieStar, (options.isMovieStar ? options.bufferTime : false), options.loops || 1, options.serverURL, options.duration || null, options.autoPlay, true, options.autoLoad, options.usePolicyFile);
- if (!options.serverURL) {
- // We are connected immediately
- oSound.connected = true;
- if (options.onconnect) {
- options.onconnect.apply(oSound);
- }
- }
- }
-
- if (!options.serverURL && (options.autoLoad || options.autoPlay)) {
- // call load for non-rtmp streams
- oSound.load(options);
- }
-
- }
-
- // rtmp will play in onconnect
- if (!options.serverURL && options.autoPlay) {
- oSound.play();
- }
-
- return oSound;
-
- };
-
- /**
- * Destroys a SMSound sound object instance.
- *
- * @param {string} sID The ID of the sound to destroy
- */
-
- this.destroySound = function(sID, _bFromSound) {
-
- // explicitly destroy a sound before normal page unload, etc.
-
- if (!idCheck(sID)) return false;
-
- var oS = sm2.sounds[sID], i;
-
- oS.stop();
-
- // Disable all callbacks after stop(), when the sound is being destroyed
- oS._iO = {};
-
- oS.unload();
-
- for (i = 0; i < sm2.soundIDs.length; i++) {
- if (sm2.soundIDs[i] === sID) {
- sm2.soundIDs.splice(i, 1);
- break;
- }
- }
-
- if (!_bFromSound) {
- // ignore if being called from SMSound instance
- oS.destruct(true);
- }
-
- oS = null;
- delete sm2.sounds[sID];
-
- return true;
-
- };
-
- /**
- * Calls the load() method of a SMSound object by ID.
- *
- * @param {string} sID The ID of the sound
- * @param {object} oOptions Optional: Sound options
- */
-
- this.load = function(sID, oOptions) {
-
- if (!idCheck(sID)) return false;
-
- return sm2.sounds[sID].load(oOptions);
-
- };
-
- /**
- * Calls the unload() method of a SMSound object by ID.
- *
- * @param {string} sID The ID of the sound
- */
-
- this.unload = function(sID) {
-
- if (!idCheck(sID)) return false;
-
- return sm2.sounds[sID].unload();
-
- };
-
- /**
- * Calls the onPosition() method of a SMSound object by ID.
- *
- * @param {string} sID The ID of the sound
- * @param {number} nPosition The position to watch for
- * @param {function} oMethod The relevant callback to fire
- * @param {object} oScope Optional: The scope to apply the callback to
- * @return {SMSound} The SMSound object
- */
-
- this.onPosition = function(sID, nPosition, oMethod, oScope) {
-
- if (!idCheck(sID)) return false;
-
- return sm2.sounds[sID].onposition(nPosition, oMethod, oScope);
-
- };
-
- // legacy/backwards-compability: lower-case method name
- this.onposition = this.onPosition;
-
- /**
- * Calls the clearOnPosition() method of a SMSound object by ID.
- *
- * @param {string} sID The ID of the sound
- * @param {number} nPosition The position to watch for
- * @param {function} oMethod Optional: The relevant callback to fire
- * @return {SMSound} The SMSound object
- */
-
- this.clearOnPosition = function(sID, nPosition, oMethod) {
-
- if (!idCheck(sID)) return false;
-
- return sm2.sounds[sID].clearOnPosition(nPosition, oMethod);
-
- };
-
- /**
- * Calls the play() method of a SMSound object by ID.
- *
- * @param {string} sID The ID of the sound
- * @param {object} oOptions Optional: Sound options
- * @return {SMSound} The SMSound object
- */
-
- this.play = function(sID, oOptions) {
-
- var result = null,
- // legacy function-overloading use case: play('mySound', '/path/to/some.mp3');
- overloaded = (oOptions && !(oOptions instanceof Object));
-
- if (!didInit || !sm2.ok()) {
- complain(sm + '.play(): ' + str(!didInit ? 'notReady' : 'notOK'));
- return false;
- }
-
- if (!idCheck(sID, overloaded)) {
-
- // no sound found for the given ID. Bail.
- if (!overloaded) return false;
-
- if (overloaded) {
- oOptions = {
- url: oOptions
- };
- }
-
- if (oOptions && oOptions.url) {
- // overloading use case, create+play: .play('someID', {url:'/path/to.mp3'});
- sm2._wD(sm + '.play(): Attempting to create "' + sID + '"', 1);
- oOptions.id = sID;
- result = sm2.createSound(oOptions).play();
- }
-
- } else if (overloaded) {
-
- // existing sound object case
- oOptions = {
- url: oOptions
- };
-
- }
-
- if (result === null) {
- // default case
- result = sm2.sounds[sID].play(oOptions);
- }
-
- return result;
-
- };
-
- // just for convenience
- this.start = this.play;
-
- /**
- * Calls the setPlaybackRate() method of a SMSound object by ID.
- *
- * @param {string} sID The ID of the sound
- * @return {SMSound} The SMSound object
- */
-
- this.setPlaybackRate = function(sID, rate, allowOverride) {
-
- if (!idCheck(sID)) return false;
-
- return sm2.sounds[sID].setPlaybackRate(rate, allowOverride);
-
- };
-
- /**
- * Calls the setPosition() method of a SMSound object by ID.
- *
- * @param {string} sID The ID of the sound
- * @param {number} nMsecOffset Position (milliseconds)
- * @return {SMSound} The SMSound object
- */
-
- this.setPosition = function(sID, nMsecOffset) {
-
- if (!idCheck(sID)) return false;
-
- return sm2.sounds[sID].setPosition(nMsecOffset);
-
- };
-
- /**
- * Calls the stop() method of a SMSound object by ID.
- *
- * @param {string} sID The ID of the sound
- * @return {SMSound} The SMSound object
- */
-
- this.stop = function(sID) {
-
- if (!idCheck(sID)) return false;
-
- sm2._wD(sm + '.stop(' + sID + ')', 1);
-
- return sm2.sounds[sID].stop();
-
- };
-
- /**
- * Stops all currently-playing sounds.
- */
-
- this.stopAll = function() {
-
- var oSound;
- sm2._wD(sm + '.stopAll()', 1);
-
- for (oSound in sm2.sounds) {
- if (sm2.sounds.hasOwnProperty(oSound)) {
- // apply only to sound objects
- sm2.sounds[oSound].stop();
- }
- }
-
- };
-
- /**
- * Calls the pause() method of a SMSound object by ID.
- *
- * @param {string} sID The ID of the sound
- * @return {SMSound} The SMSound object
- */
-
- this.pause = function(sID) {
-
- if (!idCheck(sID)) return false;
-
- return sm2.sounds[sID].pause();
-
- };
-
- /**
- * Pauses all currently-playing sounds.
- */
-
- this.pauseAll = function() {
-
- var i;
- for (i = sm2.soundIDs.length - 1; i >= 0; i--) {
- sm2.sounds[sm2.soundIDs[i]].pause();
- }
-
- };
-
- /**
- * Calls the resume() method of a SMSound object by ID.
- *
- * @param {string} sID The ID of the sound
- * @return {SMSound} The SMSound object
- */
-
- this.resume = function(sID) {
-
- if (!idCheck(sID)) return false;
-
- return sm2.sounds[sID].resume();
-
- };
-
- /**
- * Resumes all currently-paused sounds.
- */
-
- this.resumeAll = function() {
-
- var i;
- for (i = sm2.soundIDs.length - 1; i >= 0; i--) {
- sm2.sounds[sm2.soundIDs[i]].resume();
- }
-
- };
-
- /**
- * Calls the togglePause() method of a SMSound object by ID.
- *
- * @param {string} sID The ID of the sound
- * @return {SMSound} The SMSound object
- */
-
- this.togglePause = function(sID) {
-
- if (!idCheck(sID)) return false;
-
- return sm2.sounds[sID].togglePause();
-
- };
-
- /**
- * Calls the setPan() method of a SMSound object by ID.
- *
- * @param {string} sID The ID of the sound
- * @param {number} nPan The pan value (-100 to 100)
- * @return {SMSound} The SMSound object
- */
-
- this.setPan = function(sID, nPan) {
-
- if (!idCheck(sID)) return false;
-
- return sm2.sounds[sID].setPan(nPan);
-
- };
-
- /**
- * Calls the setVolume() method of a SMSound object by ID
- * Overloaded case: pass only volume argument eg., setVolume(50) to apply to all sounds.
- *
- * @param {string} sID The ID of the sound
- * @param {number} nVol The volume value (0 to 100)
- * @return {SMSound} The SMSound object
- */
-
- this.setVolume = function(sID, nVol) {
-
- // setVolume(50) function overloading case - apply to all sounds
-
- var i, j;
-
- if (sID !== _undefined && !isNaN(sID) && nVol === _undefined) {
- for (i = 0, j = sm2.soundIDs.length; i < j; i++) {
- sm2.sounds[sm2.soundIDs[i]].setVolume(sID);
- }
- return false;
- }
-
- // setVolume('mySound', 50) case
-
- if (!idCheck(sID)) return false;
-
- return sm2.sounds[sID].setVolume(nVol);
-
- };
-
- /**
- * Calls the mute() method of either a single SMSound object by ID, or all sound objects.
- *
- * @param {string} sID Optional: The ID of the sound (if omitted, all sounds will be used.)
- */
-
- this.mute = function(sID) {
-
- var i = 0;
-
- if (sID instanceof String) {
- sID = null;
- }
-
- if (!sID) {
-
- sm2._wD(sm + '.mute(): Muting all sounds');
- for (i = sm2.soundIDs.length - 1; i >= 0; i--) {
- sm2.sounds[sm2.soundIDs[i]].mute();
- }
- sm2.muted = true;
-
- } else {
-
- if (!idCheck(sID)) return false;
-
- sm2._wD(sm + '.mute(): Muting "' + sID + '"');
- return sm2.sounds[sID].mute();
-
- }
-
- return true;
-
- };
-
- /**
- * Mutes all sounds.
- */
-
- this.muteAll = function() {
-
- sm2.mute();
-
- };
-
- /**
- * Calls the unmute() method of either a single SMSound object by ID, or all sound objects.
- *
- * @param {string} sID Optional: The ID of the sound (if omitted, all sounds will be used.)
- */
-
- this.unmute = function(sID) {
-
- var i;
-
- if (sID instanceof String) {
- sID = null;
- }
-
- if (!sID) {
-
- sm2._wD(sm + '.unmute(): Unmuting all sounds');
- for (i = sm2.soundIDs.length - 1; i >= 0; i--) {
- sm2.sounds[sm2.soundIDs[i]].unmute();
- }
- sm2.muted = false;
-
- } else {
-
- if (!idCheck(sID)) return false;
-
- sm2._wD(sm + '.unmute(): Unmuting "' + sID + '"');
-
- return sm2.sounds[sID].unmute();
-
- }
-
- return true;
-
- };
-
- /**
- * Unmutes all sounds.
- */
-
- this.unmuteAll = function() {
-
- sm2.unmute();
-
- };
-
- /**
- * Calls the toggleMute() method of a SMSound object by ID.
- *
- * @param {string} sID The ID of the sound
- * @return {SMSound} The SMSound object
- */
-
- this.toggleMute = function(sID) {
-
- if (!idCheck(sID)) return false;
-
- return sm2.sounds[sID].toggleMute();
-
- };
-
- /**
- * Retrieves the memory used by the flash plugin.
- *
- * @return {number} The amount of memory in use
- */
-
- this.getMemoryUse = function() {
-
- // flash-only
- var ram = 0;
-
- if (flash && fV !== 8) {
- ram = parseInt(flash._getMemoryUse(), 10);
- }
-
- return ram;
-
- };
-
- /**
- * Undocumented: NOPs soundManager and all SMSound objects.
- */
-
- this.disable = function(bNoDisable) {
-
- // destroy all functions
- var i;
-
- if (bNoDisable === _undefined) {
- bNoDisable = false;
- }
-
- // already disabled?
- if (disabled) return false;
-
- disabled = true;
-
- _wDS('shutdown', 1);
-
- for (i = sm2.soundIDs.length - 1; i >= 0; i--) {
- disableObject(sm2.sounds[sm2.soundIDs[i]]);
- }
-
- disableObject(sm2);
-
- // fire "complete", despite fail
- initComplete(bNoDisable);
-
- event.remove(window, 'load', initUserOnload);
-
- return true;
-
- };
-
- /**
- * Determines playability of a MIME type, eg. 'audio/mp3'.
- */
-
- this.canPlayMIME = function(sMIME) {
-
- var result;
-
- if (sm2.hasHTML5) {
- result = html5CanPlay({
- type: sMIME
- });
- }
-
- if (!result && needsFlash) {
- // if flash 9, test netStream (movieStar) types as well.
- result = (sMIME && sm2.ok() ? !!((fV > 8 ? sMIME.match(netStreamMimeTypes) : null) || sMIME.match(sm2.mimePattern)) : null); // TODO: make less "weird" (per JSLint)
- }
-
- return result;
-
- };
-
- /**
- * Determines playability of a URL based on audio support.
- *
- * @param {string} sURL The URL to test
- * @return {boolean} URL playability
- */
-
- this.canPlayURL = function(sURL) {
-
- var result;
-
- if (sm2.hasHTML5) {
- result = html5CanPlay({
- url: sURL
- });
- }
-
- if (!result && needsFlash) {
- result = (sURL && sm2.ok() ? !!(sURL.match(sm2.filePattern)) : null);
- }
-
- return result;
-
- };
-
- /**
- * Determines playability of an HTML DOM <a> object (or similar object literal) based on audio support.
- *
- * @param {object} oLink an HTML DOM <a> object or object literal including href and/or type attributes
- * @return {boolean} URL playability
- */
-
- this.canPlayLink = function(oLink) {
-
- if (oLink.type !== _undefined && oLink.type && sm2.canPlayMIME(oLink.type)) return true;
-
- return sm2.canPlayURL(oLink.href);
-
- };
-
- /**
- * Retrieves a SMSound object by ID.
- *
- * @param {string} sID The ID of the sound
- * @return {SMSound} The SMSound object
- */
-
- this.getSoundById = function(sID, _suppressDebug) {
-
- if (!sID) return null;
-
- var result = sm2.sounds[sID];
-
- // <d>
- if (!result && !_suppressDebug) {
- sm2._wD(sm + '.getSoundById(): Sound "' + sID + '" not found.', 2);
- }
- // </d>
-
- return result;
-
- };
-
- /**
- * Queues a callback for execution when SoundManager has successfully initialized.
- *
- * @param {function} oMethod The callback method to fire
- * @param {object} oScope Optional: The scope to apply to the callback
- */
-
- this.onready = function(oMethod, oScope) {
-
- var sType = 'onready',
- result = false;
-
- if (typeof oMethod === 'function') {
-
- // <d>
- if (didInit) {
- sm2._wD(str('queue', sType));
- }
- // </d>
-
- if (!oScope) {
- oScope = window;
- }
-
- addOnEvent(sType, oMethod, oScope);
- processOnEvents();
-
- result = true;
-
- } else {
-
- throw str('needFunction', sType);
-
- }
-
- return result;
-
- };
-
- /**
- * Queues a callback for execution when SoundManager has failed to initialize.
- *
- * @param {function} oMethod The callback method to fire
- * @param {object} oScope Optional: The scope to apply to the callback
- */
-
- this.ontimeout = function(oMethod, oScope) {
-
- var sType = 'ontimeout',
- result = false;
-
- if (typeof oMethod === 'function') {
-
- // <d>
- if (didInit) {
- sm2._wD(str('queue', sType));
- }
- // </d>
-
- if (!oScope) {
- oScope = window;
- }
-
- addOnEvent(sType, oMethod, oScope);
- processOnEvents({ type: sType });
-
- result = true;
-
- } else {
-
- throw str('needFunction', sType);
-
- }
-
- return result;
-
- };
-
- /**
- * Writes console.log()-style debug output to a console or in-browser element.
- * Applies when debugMode = true
- *
- * @param {string} sText The console message
- * @param {object} nType Optional log level (number), or object. Number case: Log type/style where 0 = 'info', 1 = 'warn', 2 = 'error'. Object case: Object to be dumped.
- */
-
- this._writeDebug = function(sText, sTypeOrObject) {
-
- // pseudo-private console.log()-style output
- // <d>
-
- var sDID = 'soundmanager-debug', o, oItem;
-
- if (!sm2.setupOptions.debugMode) return false;
-
- if (hasConsole && sm2.useConsole) {
- if (sTypeOrObject && typeof sTypeOrObject === 'object') {
- // object passed; dump to console.
- console.log(sText, sTypeOrObject);
- } else if (debugLevels[sTypeOrObject] !== _undefined) {
- console[debugLevels[sTypeOrObject]](sText);
- } else {
- console.log(sText);
- }
- if (sm2.consoleOnly) return true;
- }
-
- o = id(sDID);
-
- if (!o) return false;
-
- oItem = doc.createElement('div');
-
- if (++wdCount % 2 === 0) {
- oItem.className = 'sm2-alt';
- }
-
- if (sTypeOrObject === _undefined) {
- sTypeOrObject = 0;
- } else {
- sTypeOrObject = parseInt(sTypeOrObject, 10);
- }
-
- oItem.appendChild(doc.createTextNode(sText));
-
- if (sTypeOrObject) {
- if (sTypeOrObject >= 2) {
- oItem.style.fontWeight = 'bold';
- }
- if (sTypeOrObject === 3) {
- oItem.style.color = '#ff3333';
- }
- }
-
- // top-to-bottom
- // o.appendChild(oItem);
-
- // bottom-to-top
- o.insertBefore(oItem, o.firstChild);
-
- o = null;
- // </d>
-
- return true;
-
- };
-
- // <d>
- // last-resort debugging option
- if (wl.indexOf('sm2-debug=alert') !== -1) {
- this._writeDebug = function(sText) {
- window.alert(sText);
- };
- }
- // </d>
-
- // alias
- this._wD = this._writeDebug;
-
- /**
- * Provides debug / state information on all SMSound objects.
- */
-
- this._debug = function() {
-
- // <d>
- var i, j;
- _wDS('currentObj', 1);
-
- for (i = 0, j = sm2.soundIDs.length; i < j; i++) {
- sm2.sounds[sm2.soundIDs[i]]._debug();
- }
- // </d>
-
- };
-
- /**
- * Restarts and re-initializes the SoundManager instance.
- *
- * @param {boolean} resetEvents Optional: When true, removes all registered onready and ontimeout event callbacks.
- * @param {boolean} excludeInit Options: When true, does not call beginDelayedInit() (which would restart SM2).
- * @return {object} soundManager The soundManager instance.
- */
-
- this.reboot = function(resetEvents, excludeInit) {
-
- // reset some (or all) state, and re-init unless otherwise specified.
-
- // <d>
- if (sm2.soundIDs.length) {
- sm2._wD('Destroying ' + sm2.soundIDs.length + ' SMSound object' + (sm2.soundIDs.length !== 1 ? 's' : '') + '...');
- }
- // </d>
-
- var i, j, k;
-
- for (i = sm2.soundIDs.length - 1; i >= 0; i--) {
- sm2.sounds[sm2.soundIDs[i]].destruct();
- }
-
- // trash ze flash (remove from the DOM)
-
- if (flash) {
-
- try {
-
- if (isIE) {
- oRemovedHTML = flash.innerHTML;
- }
-
- oRemoved = flash.parentNode.removeChild(flash);
-
- } catch(e) {
-
- // Remove failed? May be due to flash blockers silently removing the SWF object/embed node from the DOM. Warn and continue.
-
- _wDS('badRemove', 2);
-
- }
-
- }
-
- // actually, force recreate of movie.
-
- oRemovedHTML = oRemoved = needsFlash = flash = null;
-
- sm2.enabled = didDCLoaded = didInit = waitingForEI = initPending = didAppend = appendSuccess = disabled = useGlobalHTML5Audio = sm2.swfLoaded = false;
-
- sm2.soundIDs = [];
- sm2.sounds = {};
-
- idCounter = 0;
- didSetup = false;
-
- if (!resetEvents) {
- // reset callbacks for onready, ontimeout etc. so that they will fire again on re-init
- for (i in on_queue) {
- if (on_queue.hasOwnProperty(i)) {
- for (j = 0, k = on_queue[i].length; j < k; j++) {
- on_queue[i][j].fired = false;
- }
- }
- }
- } else {
- // remove all callbacks entirely
- on_queue = [];
- }
-
- // <d>
- if (!excludeInit) {
- sm2._wD(sm + ': Rebooting...');
- }
- // </d>
-
- // reset HTML5 and flash canPlay test results
-
- sm2.html5 = {
- usingFlash: null
- };
-
- sm2.flash = {};
-
- // reset device-specific HTML/flash mode switches
-
- sm2.html5Only = false;
- sm2.ignoreFlash = false;
-
- window.setTimeout(function() {
-
- // by default, re-init
-
- if (!excludeInit) {
- sm2.beginDelayedInit();
- }
-
- }, 20);
-
- return sm2;
-
- };
-
- this.reset = function() {
-
- /**
- * Shuts down and restores the SoundManager instance to its original loaded state, without an explicit reboot. All onready/ontimeout handlers are removed.
- * After this call, SM2 may be re-initialized via soundManager.beginDelayedInit().
- * @return {object} soundManager The soundManager instance.
- */
-
- _wDS('reset');
-
- return sm2.reboot(true, true);
-
- };
-
- /**
- * Undocumented: Determines the SM2 flash movie's load progress.
- *
- * @return {number or null} Percent loaded, or if invalid/unsupported, null.
- */
-
- this.getMoviePercent = function() {
-
- /**
- * Interesting syntax notes...
- * Flash/ExternalInterface (ActiveX/NPAPI) bridge methods are not typeof "function" nor instanceof Function, but are still valid.
- * Furthermore, using (flash && flash.PercentLoaded) causes IE to throw "object doesn't support this property or method".
- * Thus, 'in' syntax must be used.
- */
-
- return (flash && 'PercentLoaded' in flash ? flash.PercentLoaded() : null);
-
- };
-
- /**
- * Additional helper for manually invoking SM2's init process after DOM Ready / window.onload().
- */
-
- this.beginDelayedInit = function() {
-
- windowLoaded = true;
- domContentLoaded();
-
- setTimeout(function() {
-
- if (initPending) return false;
-
- createMovie();
- initMovie();
- initPending = true;
-
- return true;
-
- }, 20);
-
- delayWaitForEI();
-
- };
-
- /**
- * Destroys the SoundManager instance and all SMSound instances.
- */
-
- this.destruct = function() {
-
- sm2._wD(sm + '.destruct()');
- sm2.disable(true);
-
- };
-
- /**
- * SMSound() (sound object) constructor
- * ------------------------------------
- *
- * @param {object} oOptions Sound options (id and url are required attributes)
- * @return {SMSound} The new SMSound object
- */
-
- SMSound = function(oOptions) {
-
- var s = this, resetProperties, add_html5_events, remove_html5_events, stop_html5_timer, start_html5_timer, attachOnPosition, onplay_called = false, onPositionItems = [], onPositionFired = 0, detachOnPosition, applyFromTo, lastURL = null, lastHTML5State, urlOmitted;
-
- lastHTML5State = {
- // tracks duration + position (time)
- duration: null,
- time: null
- };
-
- this.id = oOptions.id;
-
- // legacy
- this.sID = this.id;
-
- this.url = oOptions.url;
- this.options = mixin(oOptions);
-
- // per-play-instance-specific options
- this.instanceOptions = this.options;
-
- // short alias
- this._iO = this.instanceOptions;
-
- // assign property defaults
- this.pan = this.options.pan;
- this.volume = this.options.volume;
-
- // whether or not this object is using HTML5
- this.isHTML5 = false;
-
- // internal HTML5 Audio() object reference
- this._a = null;
-
- // for flash 8 special-case createSound() without url, followed by load/play with url case
- urlOmitted = (!this.url);
-
- /**
- * SMSound() public methods
- * ------------------------
- */
-
- this.id3 = {};
-
- /**
- * Writes SMSound object parameters to debug console
- */
-
- this._debug = function() {
-
- // <d>
- sm2._wD(s.id + ': Merged options:', s.options);
- // </d>
-
- };
-
- /**
- * Begins loading a sound per its *url*.
- *
- * @param {object} options Optional: Sound options
- * @return {SMSound} The SMSound object
- */
-
- this.load = function(options) {
-
- var oSound = null, instanceOptions;
-
- if (options !== _undefined) {
- s._iO = mixin(options, s.options);
- } else {
- options = s.options;
- s._iO = options;
- if (lastURL && lastURL !== s.url) {
- _wDS('manURL');
- s._iO.url = s.url;
- s.url = null;
- }
- }
-
- if (!s._iO.url) {
- s._iO.url = s.url;
- }
-
- s._iO.url = parseURL(s._iO.url);
-
- // ensure we're in sync
- s.instanceOptions = s._iO;
-
- // local shortcut
- instanceOptions = s._iO;
-
- sm2._wD(s.id + ': load (' + instanceOptions.url + ')');
-
- if (!instanceOptions.url && !s.url) {
- sm2._wD(s.id + ': load(): url is unassigned. Exiting.', 2);
- return s;
- }
-
- // <d>
- if (!s.isHTML5 && fV === 8 && !s.url && !instanceOptions.autoPlay) {
- // flash 8 load() -> play() won't work before onload has fired.
- sm2._wD(s.id + ': Flash 8 load() limitation: Wait for onload() before calling play().', 1);
- }
- // </d>
-
- if (instanceOptions.url === s.url && s.readyState !== 0 && s.readyState !== 2) {
- _wDS('onURL', 1);
- // if loaded and an onload() exists, fire immediately.
- if (s.readyState === 3 && instanceOptions.onload) {
- // assume success based on truthy duration.
- wrapCallback(s, function() {
- instanceOptions.onload.apply(s, [(!!s.duration)]);
- });
- }
- return s;
- }
-
- // reset a few state properties
-
- s.loaded = false;
- s.readyState = 1;
- s.playState = 0;
- s.id3 = {};
-
- // TODO: If switching from HTML5 -> flash (or vice versa), stop currently-playing audio.
-
- if (html5OK(instanceOptions)) {
-
- oSound = s._setup_html5(instanceOptions);
-
- if (!oSound._called_load) {
-
- s._html5_canplay = false;
-
- // TODO: review called_load / html5_canplay logic
-
- // if url provided directly to load(), assign it here.
-
- if (s.url !== instanceOptions.url) {
-
- sm2._wD(_wDS('manURL') + ': ' + instanceOptions.url);
-
- s._a.src = instanceOptions.url;
-
- // TODO: review / re-apply all relevant options (volume, loop, onposition etc.)
-
- // reset position for new URL
- s.setPosition(0);
-
- }
-
- // given explicit load call, try to preload.
-
- // early HTML5 implementation (non-standard)
- s._a.autobuffer = 'auto';
-
- // standard property, values: none / metadata / auto
- // reference: http://msdn.microsoft.com/en-us/library/ie/ff974759%28v=vs.85%29.aspx
- s._a.preload = 'auto';
-
- s._a._called_load = true;
-
- } else {
-
- sm2._wD(s.id + ': Ignoring request to load again');
-
- }
-
- } else {
-
- if (sm2.html5Only) {
- sm2._wD(s.id + ': No flash support. Exiting.');
- return s;
- }
-
- if (s._iO.url && s._iO.url.match(/data:/i)) {
- // data: URIs not supported by Flash, either.
- sm2._wD(s.id + ': data: URIs not supported via Flash. Exiting.');
- return s;
- }
-
- try {
- s.isHTML5 = false;
- s._iO = policyFix(loopFix(instanceOptions));
- // if we have "position", disable auto-play as we'll be seeking to that position at onload().
- if (s._iO.autoPlay && (s._iO.position || s._iO.from)) {
- sm2._wD(s.id + ': Disabling autoPlay because of non-zero offset case');
- s._iO.autoPlay = false;
- }
- // re-assign local shortcut
- instanceOptions = s._iO;
- if (fV === 8) {
- flash._load(s.id, instanceOptions.url, instanceOptions.stream, instanceOptions.autoPlay, instanceOptions.usePolicyFile);
- } else {
- flash._load(s.id, instanceOptions.url, !!(instanceOptions.stream), !!(instanceOptions.autoPlay), instanceOptions.loops || 1, !!(instanceOptions.autoLoad), instanceOptions.usePolicyFile);
- }
- } catch(e) {
- _wDS('smError', 2);
- debugTS('onload', false);
- catchError({
- type: 'SMSOUND_LOAD_JS_EXCEPTION',
- fatal: true
- });
- }
-
- }
-
- // after all of this, ensure sound url is up to date.
- s.url = instanceOptions.url;
-
- return s;
-
- };
-
- /**
- * Unloads a sound, canceling any open HTTP requests.
- *
- * @return {SMSound} The SMSound object
- */
-
- this.unload = function() {
-
- // Flash 8/AS2 can't "close" a stream - fake it by loading an empty URL
- // Flash 9/AS3: Close stream, preventing further load
- // HTML5: Most UAs will use empty URL
-
- if (s.readyState !== 0) {
-
- sm2._wD(s.id + ': unload()');
-
- if (!s.isHTML5) {
-
- if (fV === 8) {
- flash._unload(s.id, emptyURL);
- } else {
- flash._unload(s.id);
- }
-
- } else {
-
- stop_html5_timer();
-
- if (s._a) {
-
- s._a.pause();
-
- // update empty URL, too
- lastURL = html5Unload(s._a);
-
- }
-
- }
-
- // reset load/status flags
- resetProperties();
-
- }
-
- return s;
-
- };
-
- /**
- * Unloads and destroys a sound.
- */
-
- this.destruct = function(_bFromSM) {
-
- sm2._wD(s.id + ': Destruct');
-
- if (!s.isHTML5) {
-
- // kill sound within Flash
- // Disable the onfailure handler
- s._iO.onfailure = null;
- flash._destroySound(s.id);
-
- } else {
-
- stop_html5_timer();
-
- if (s._a) {
- s._a.pause();
- html5Unload(s._a);
- if (!useGlobalHTML5Audio) {
- remove_html5_events();
- }
- // break obvious circular reference
- s._a._s = null;
- s._a = null;
- }
-
- }
-
- if (!_bFromSM) {
- // ensure deletion from controller
- sm2.destroySound(s.id, true);
- }
-
- };
-
- /**
- * Begins playing a sound.
- *
- * @param {object} options Optional: Sound options
- * @return {SMSound} The SMSound object
- */
-
- this.play = function(options, _updatePlayState) {
-
- var fN, allowMulti, a, onready,
- audioClone, onended, oncanplay,
- startOK = true;
-
- // <d>
- fN = s.id + ': play(): ';
- // </d>
-
- // default to true
- _updatePlayState = (_updatePlayState === _undefined ? true : _updatePlayState);
-
- if (!options) {
- options = {};
- }
-
- // first, use local URL (if specified)
- if (s.url) {
- s._iO.url = s.url;
- }
-
- // mix in any options defined at createSound()
- s._iO = mixin(s._iO, s.options);
-
- // mix in any options specific to this method
- s._iO = mixin(options, s._iO);
-
- s._iO.url = parseURL(s._iO.url);
-
- s.instanceOptions = s._iO;
-
- // RTMP-only
- if (!s.isHTML5 && s._iO.serverURL && !s.connected) {
- if (!s.getAutoPlay()) {
- sm2._wD(fN + ' Netstream not connected yet - setting autoPlay');
- s.setAutoPlay(true);
- }
- // play will be called in onconnect()
- return s;
- }
-
- if (html5OK(s._iO)) {
- s._setup_html5(s._iO);
- start_html5_timer();
- }
-
- if (s.playState === 1 && !s.paused) {
-
- allowMulti = s._iO.multiShot;
-
- if (!allowMulti) {
-
- sm2._wD(fN + 'Already playing (one-shot)', 1);
-
- if (s.isHTML5) {
- // go back to original position.
- s.setPosition(s._iO.position);
- }
-
- return s;
-
- }
-
- sm2._wD(fN + 'Already playing (multi-shot)', 1);
-
- }
-
- // edge case: play() with explicit URL parameter
- if (options.url && options.url !== s.url) {
-
- // special case for createSound() followed by load() / play() with url; avoid double-load case.
- if (!s.readyState && !s.isHTML5 && fV === 8 && urlOmitted) {
-
- urlOmitted = false;
-
- } else {
-
- // load using merged options
- s.load(s._iO);
-
- }
-
- }
-
- if (!s.loaded) {
-
- if (s.readyState === 0) {
-
- sm2._wD(fN + 'Attempting to load');
-
- // try to get this sound playing ASAP
- if (!s.isHTML5 && !sm2.html5Only) {
-
- // flash: assign directly because setAutoPlay() increments the instanceCount
- s._iO.autoPlay = true;
- s.load(s._iO);
-
- } else if (s.isHTML5) {
-
- // iOS needs this when recycling sounds, loading a new URL on an existing object.
- s.load(s._iO);
-
- } else {
-
- sm2._wD(fN + 'Unsupported type. Exiting.');
-
- return s;
-
- }
-
- // HTML5 hack - re-set instanceOptions?
- s.instanceOptions = s._iO;
-
- } else if (s.readyState === 2) {
-
- sm2._wD(fN + 'Could not load - exiting', 2);
-
- return s;
-
- } else {
-
- sm2._wD(fN + 'Loading - attempting to play...');
-
- }
-
- } else {
-
- // "play()"
- sm2._wD(fN.substr(0, fN.lastIndexOf(':')));
-
- }
-
- if (!s.isHTML5 && fV === 9 && s.position > 0 && s.position === s.duration) {
- // flash 9 needs a position reset if play() is called while at the end of a sound.
- sm2._wD(fN + 'Sound at end, resetting to position: 0');
- options.position = 0;
- }
-
- /**
- * Streams will pause when their buffer is full if they are being loaded.
- * In this case paused is true, but the song hasn't started playing yet.
- * If we just call resume() the onplay() callback will never be called.
- * So only call resume() if the position is > 0.
- * Another reason is because options like volume won't have been applied yet.
- * For normal sounds, just resume.
- */
-
- if (s.paused && s.position >= 0 && (!s._iO.serverURL || s.position > 0)) {
-
- // https://gist.github.com/37b17df75cc4d7a90bf6
- sm2._wD(fN + 'Resuming from paused state', 1);
- s.resume();
-
- } else {
-
- s._iO = mixin(options, s._iO);
-
- /**
- * Preload in the event of play() with position under Flash,
- * or from/to parameters and non-RTMP case
- */
- if (((!s.isHTML5 && s._iO.position !== null && s._iO.position > 0) || (s._iO.from !== null && s._iO.from > 0) || s._iO.to !== null) && s.instanceCount === 0 && s.playState === 0 && !s._iO.serverURL) {
-
- onready = function() {
- // sound "canplay" or onload()
- // re-apply position/from/to to instance options, and start playback
- s._iO = mixin(options, s._iO);
- s.play(s._iO);
- };
-
- // HTML5 needs to at least have "canplay" fired before seeking.
- if (s.isHTML5 && !s._html5_canplay) {
-
- // this hasn't been loaded yet. load it first, and then do this again.
- sm2._wD(fN + 'Beginning load for non-zero offset case');
-
- s.load({
- // note: custom HTML5-only event added for from/to implementation.
- _oncanplay: onready
- });
-
- } else if (!s.isHTML5 && !s.loaded && (!s.readyState || s.readyState !== 2)) {
-
- // to be safe, preload the whole thing in Flash.
-
- sm2._wD(fN + 'Preloading for non-zero offset case');
-
- s.load({
- onload: onready
- });
-
- }
-
- // otherwise, we're ready to go. re-apply local options, and continue
-
- s._iO = applyFromTo();
-
- }
-
- // sm2._wD(fN + 'Starting to play');
-
- // increment instance counter, where enabled + supported
- if (!s.instanceCount || s._iO.multiShotEvents || (s.isHTML5 && s._iO.multiShot && !useGlobalHTML5Audio) || (!s.isHTML5 && fV > 8 && !s.getAutoPlay())) {
- s.instanceCount++;
- }
-
- // if first play and onposition parameters exist, apply them now
- if (s._iO.onposition && s.playState === 0) {
- attachOnPosition(s);
- }
-
- s.playState = 1;
- s.paused = false;
-
- s.position = (s._iO.position !== _undefined && !isNaN(s._iO.position) ? s._iO.position : 0);
-
- if (!s.isHTML5) {
- s._iO = policyFix(loopFix(s._iO));
- }
-
- if (s._iO.onplay && _updatePlayState) {
- s._iO.onplay.apply(s);
- onplay_called = true;
- }
-
- s.setVolume(s._iO.volume, true);
- s.setPan(s._iO.pan, true);
-
- if (s._iO.playbackRate !== 1) {
- s.setPlaybackRate(s._iO.playbackRate);
- }
-
- if (!s.isHTML5) {
-
- startOK = flash._start(s.id, s._iO.loops || 1, (fV === 9 ? s.position : s.position / msecScale), s._iO.multiShot || false);
-
- if (fV === 9 && !startOK) {
- // edge case: no sound hardware, or 32-channel flash ceiling hit.
- // applies only to Flash 9, non-NetStream/MovieStar sounds.
- // http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Sound.html#play%28%29
- sm2._wD(fN + 'No sound hardware, or 32-sound ceiling hit', 2);
- if (s._iO.onplayerror) {
- s._iO.onplayerror.apply(s);
- }
-
- }
-
- } else if (s.instanceCount < 2) {
-
- // HTML5 single-instance case
-
- start_html5_timer();
-
- a = s._setup_html5();
-
- s.setPosition(s._iO.position);
-
- a.play();
-
- } else {
-
- // HTML5 multi-shot case
-
- sm2._wD(s.id + ': Cloning Audio() for instance #' + s.instanceCount + '...');
-
- audioClone = new Audio(s._iO.url);
-
- onended = function() {
- event.remove(audioClone, 'ended', onended);
- s._onfinish(s);
- // cleanup
- html5Unload(audioClone);
- audioClone = null;
- };
-
- oncanplay = function() {
- event.remove(audioClone, 'canplay', oncanplay);
- try {
- audioClone.currentTime = s._iO.position / msecScale;
- } catch(err) {
- complain(s.id + ': multiShot play() failed to apply position of ' + (s._iO.position / msecScale));
- }
- audioClone.play();
- };
-
- event.add(audioClone, 'ended', onended);
-
- // apply volume to clones, too
- if (s._iO.volume !== _undefined) {
- audioClone.volume = Math.max(0, Math.min(1, s._iO.volume / 100));
- }
-
- // playing multiple muted sounds? if you do this, you're weird ;) - but let's cover it.
- if (s.muted) {
- audioClone.muted = true;
- }
-
- if (s._iO.position) {
- // HTML5 audio can't seek before onplay() event has fired.
- // wait for canplay, then seek to position and start playback.
- event.add(audioClone, 'canplay', oncanplay);
- } else {
- // begin playback at currentTime: 0
- audioClone.play();
- }
-
- }
-
- }
-
- return s;
-
- };
-
- // just for convenience
- this.start = this.play;
-
- /**
- * Stops playing a sound (and optionally, all sounds)
- *
- * @param {boolean} bAll Optional: Whether to stop all sounds
- * @return {SMSound} The SMSound object
- */
-
- this.stop = function(bAll) {
-
- var instanceOptions = s._iO,
- originalPosition;
-
- if (s.playState === 1) {
-
- sm2._wD(s.id + ': stop()');
-
- s._onbufferchange(0);
- s._resetOnPosition(0);
- s.paused = false;
-
- if (!s.isHTML5) {
- s.playState = 0;
- }
-
- // remove onPosition listeners, if any
- detachOnPosition();
-
- // and "to" position, if set
- if (instanceOptions.to) {
- s.clearOnPosition(instanceOptions.to);
- }
-
- if (!s.isHTML5) {
-
- flash._stop(s.id, bAll);
-
- // hack for netStream: just unload
- if (instanceOptions.serverURL) {
- s.unload();
- }
-
- } else if (s._a) {
-
- originalPosition = s.position;
-
- // act like Flash, though
- s.setPosition(0);
-
- // hack: reflect old position for onstop() (also like Flash)
- s.position = originalPosition;
-
- // html5 has no stop()
- // NOTE: pausing means iOS requires interaction to resume.
- s._a.pause();
-
- s.playState = 0;
-
- // and update UI
- s._onTimer();
-
- stop_html5_timer();
-
- }
-
- s.instanceCount = 0;
- s._iO = {};
-
- if (instanceOptions.onstop) {
- instanceOptions.onstop.apply(s);
- }
-
- }
-
- return s;
-
- };
-
- /**
- * Undocumented/internal: Sets autoPlay for RTMP.
- *
- * @param {boolean} autoPlay state
- */
-
- this.setAutoPlay = function(autoPlay) {
-
- sm2._wD(s.id + ': Autoplay turned ' + (autoPlay ? 'on' : 'off'));
- s._iO.autoPlay = autoPlay;
-
- if (!s.isHTML5) {
- flash._setAutoPlay(s.id, autoPlay);
- if (autoPlay) {
- // only increment the instanceCount if the sound isn't loaded (TODO: verify RTMP)
- if (!s.instanceCount && s.readyState === 1) {
- s.instanceCount++;
- sm2._wD(s.id + ': Incremented instance count to ' + s.instanceCount);
- }
- }
- }
-
- };
-
- /**
- * Undocumented/internal: Returns the autoPlay boolean.
- *
- * @return {boolean} The current autoPlay value
- */
-
- this.getAutoPlay = function() {
-
- return s._iO.autoPlay;
-
- };
-
- /**
- * Sets the playback rate of a sound (HTML5-only.)
- *
- * @param {number} playbackRate (+/-)
- * @return {SMSound} The SMSound object
- */
-
- this.setPlaybackRate = function(playbackRate) {
-
- // Per Mozilla, limit acceptable values to prevent playback from stopping (unless allowOverride is truthy.)
- // https://developer.mozilla.org/en-US/Apps/Build/Audio_and_video_delivery/WebAudio_playbackRate_explained
- var normalizedRate = Math.max(0.5, Math.min(4, playbackRate));
-
- // <d>
- if (normalizedRate !== playbackRate) {
- sm2._wD(s.id + ': setPlaybackRate(' + playbackRate + '): limiting rate to ' + normalizedRate, 2);
- }
- // </d>
-
- if (s.isHTML5) {
- try {
- s._iO.playbackRate = normalizedRate;
- s._a.playbackRate = normalizedRate;
- } catch(e) {
- sm2._wD(s.id + ': setPlaybackRate(' + normalizedRate + ') failed: ' + e.message, 2);
- }
- }
-
- return s;
-
- };
-
- /**
- * Sets the position of a sound.
- *
- * @param {number} nMsecOffset Position (milliseconds)
- * @return {SMSound} The SMSound object
- */
-
- this.setPosition = function(nMsecOffset) {
-
- if (nMsecOffset === _undefined) {
- nMsecOffset = 0;
- }
-
- var position, position1K,
- // Use the duration from the instance options, if we don't have a track duration yet.
- // position >= 0 and <= current available (loaded) duration
- offset = (s.isHTML5 ? Math.max(nMsecOffset, 0) : Math.min(s.duration || s._iO.duration, Math.max(nMsecOffset, 0)));
-
- s.position = offset;
- position1K = s.position / msecScale;
- s._resetOnPosition(s.position);
- s._iO.position = offset;
-
- if (!s.isHTML5) {
-
- position = (fV === 9 ? s.position : position1K);
-
- if (s.readyState && s.readyState !== 2) {
- // if paused or not playing, will not resume (by playing)
- flash._setPosition(s.id, position, (s.paused || !s.playState), s._iO.multiShot);
- }
-
- } else if (s._a) {
-
- // Set the position in the canplay handler if the sound is not ready yet
- if (s._html5_canplay) {
-
- if (s._a.currentTime.toFixed(3) !== position1K.toFixed(3)) {
-
- /**
- * DOM/JS errors/exceptions to watch out for:
- * if seek is beyond (loaded?) position, "DOM exception 11"
- * "INDEX_SIZE_ERR": DOM exception 1
- */
- sm2._wD(s.id + ': setPosition(' + position1K + ')');
-
- try {
- s._a.currentTime = position1K;
- if (s.playState === 0 || s.paused) {
- // allow seek without auto-play/resume
- s._a.pause();
- }
- } catch(e) {
- sm2._wD(s.id + ': setPosition(' + position1K + ') failed: ' + e.message, 2);
- }
-
- }
-
- } else if (position1K) {
-
- // warn on non-zero seek attempts
- sm2._wD(s.id + ': setPosition(' + position1K + '): Cannot seek yet, sound not ready', 2);
- return s;
-
- }
-
- if (s.paused) {
-
- // if paused, refresh UI right away by forcing update
- s._onTimer(true);
-
- }
-
- }
-
- return s;
-
- };
-
- /**
- * Pauses sound playback.
- *
- * @return {SMSound} The SMSound object
- */
-
- this.pause = function(_bCallFlash) {
-
- if (s.paused || (s.playState === 0 && s.readyState !== 1)) return s;
-
- sm2._wD(s.id + ': pause()');
- s.paused = true;
-
- if (!s.isHTML5) {
- if (_bCallFlash || _bCallFlash === _undefined) {
- flash._pause(s.id, s._iO.multiShot);
- }
- } else {
- s._setup_html5().pause();
- stop_html5_timer();
- }
-
- if (s._iO.onpause) {
- s._iO.onpause.apply(s);
- }
-
- return s;
-
- };
-
- /**
- * Resumes sound playback.
- *
- * @return {SMSound} The SMSound object
- */
-
- /**
- * When auto-loaded streams pause on buffer full they have a playState of 0.
- * We need to make sure that the playState is set to 1 when these streams "resume".
- * When a paused stream is resumed, we need to trigger the onplay() callback if it
- * hasn't been called already. In this case since the sound is being played for the
- * first time, I think it's more appropriate to call onplay() rather than onresume().
- */
-
- this.resume = function() {
-
- var instanceOptions = s._iO;
-
- if (!s.paused) return s;
-
- sm2._wD(s.id + ': resume()');
- s.paused = false;
- s.playState = 1;
-
- if (!s.isHTML5) {
-
- if (instanceOptions.isMovieStar && !instanceOptions.serverURL) {
- // Bizarre Webkit bug (Chrome reported via 8tracks.com dudes): AAC content paused for 30+ seconds(?) will not resume without a reposition.
- s.setPosition(s.position);
- }
-
- // flash method is toggle-based (pause/resume)
- flash._pause(s.id, instanceOptions.multiShot);
-
- } else {
-
- s._setup_html5().play();
- start_html5_timer();
-
- }
-
- if (!onplay_called && instanceOptions.onplay) {
-
- instanceOptions.onplay.apply(s);
- onplay_called = true;
-
- } else if (instanceOptions.onresume) {
-
- instanceOptions.onresume.apply(s);
-
- }
-
- return s;
-
- };
-
- /**
- * Toggles sound playback.
- *
- * @return {SMSound} The SMSound object
- */
-
- this.togglePause = function() {
-
- sm2._wD(s.id + ': togglePause()');
-
- if (s.playState === 0) {
- s.play({
- position: (fV === 9 && !s.isHTML5 ? s.position : s.position / msecScale)
- });
- return s;
- }
-
- if (s.paused) {
- s.resume();
- } else {
- s.pause();
- }
-
- return s;
-
- };
-
- /**
- * Sets the panning (L-R) effect.
- *
- * @param {number} nPan The pan value (-100 to 100)
- * @return {SMSound} The SMSound object
- */
-
- this.setPan = function(nPan, bInstanceOnly) {
-
- if (nPan === _undefined) {
- nPan = 0;
- }
-
- if (bInstanceOnly === _undefined) {
- bInstanceOnly = false;
- }
-
- if (!s.isHTML5) {
- flash._setPan(s.id, nPan);
- } // else { no HTML5 pan? }
-
- s._iO.pan = nPan;
-
- if (!bInstanceOnly) {
- s.pan = nPan;
- s.options.pan = nPan;
- }
-
- return s;
-
- };
-
- /**
- * Sets the volume.
- *
- * @param {number} nVol The volume value (0 to 100)
- * @return {SMSound} The SMSound object
- */
-
- this.setVolume = function(nVol, _bInstanceOnly) {
-
- /**
- * Note: Setting volume has no effect on iOS "special snowflake" devices.
- * Hardware volume control overrides software, and volume
- * will always return 1 per Apple docs. (iOS 4 + 5.)
- * http://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/HTML-canvas-guide/AddingSoundtoCanvasAnimations/AddingSoundtoCanvasAnimations.html
- */
-
- if (nVol === _undefined) {
- nVol = 100;
- }
-
- if (_bInstanceOnly === _undefined) {
- _bInstanceOnly = false;
- }
-
- if (!s.isHTML5) {
-
- flash._setVolume(s.id, (sm2.muted && !s.muted) || s.muted ? 0 : nVol);
-
- } else if (s._a) {
-
- if (sm2.muted && !s.muted) {
- s.muted = true;
- s._a.muted = true;
- }
-
- // valid range for native HTML5 Audio(): 0-1
- s._a.volume = Math.max(0, Math.min(1, nVol / 100));
-
- }
-
- s._iO.volume = nVol;
-
- if (!_bInstanceOnly) {
- s.volume = nVol;
- s.options.volume = nVol;
- }
-
- return s;
-
- };
-
- /**
- * Mutes the sound.
- *
- * @return {SMSound} The SMSound object
- */
-
- this.mute = function() {
-
- s.muted = true;
-
- if (!s.isHTML5) {
- flash._setVolume(s.id, 0);
- } else if (s._a) {
- s._a.muted = true;
- }
-
- return s;
-
- };
-
- /**
- * Unmutes the sound.
- *
- * @return {SMSound} The SMSound object
- */
-
- this.unmute = function() {
-
- s.muted = false;
- var hasIO = (s._iO.volume !== _undefined);
-
- if (!s.isHTML5) {
- flash._setVolume(s.id, hasIO ? s._iO.volume : s.options.volume);
- } else if (s._a) {
- s._a.muted = false;
- }
-
- return s;
-
- };
-
- /**
- * Toggles the muted state of a sound.
- *
- * @return {SMSound} The SMSound object
- */
-
- this.toggleMute = function() {
-
- return (s.muted ? s.unmute() : s.mute());
-
- };
-
- /**
- * Registers a callback to be fired when a sound reaches a given position during playback.
- *
- * @param {number} nPosition The position to watch for
- * @param {function} oMethod The relevant callback to fire
- * @param {object} oScope Optional: The scope to apply the callback to
- * @return {SMSound} The SMSound object
- */
-
- this.onPosition = function(nPosition, oMethod, oScope) {
-
- // TODO: basic dupe checking?
-
- onPositionItems.push({
- position: parseInt(nPosition, 10),
- method: oMethod,
- scope: (oScope !== _undefined ? oScope : s),
- fired: false
- });
-
- return s;
-
- };
-
- // legacy/backwards-compability: lower-case method name
- this.onposition = this.onPosition;
-
- /**
- * Removes registered callback(s) from a sound, by position and/or callback.
- *
- * @param {number} nPosition The position to clear callback(s) for
- * @param {function} oMethod Optional: Identify one callback to be removed when multiple listeners exist for one position
- * @return {SMSound} The SMSound object
- */
-
- this.clearOnPosition = function(nPosition, oMethod) {
-
- var i;
-
- nPosition = parseInt(nPosition, 10);
-
- if (isNaN(nPosition)) {
- // safety check
- return;
- }
-
- for (i = 0; i < onPositionItems.length; i++) {
-
- if (nPosition === onPositionItems[i].position) {
- // remove this item if no method was specified, or, if the method matches
-
- if (!oMethod || (oMethod === onPositionItems[i].method)) {
-
- if (onPositionItems[i].fired) {
- // decrement "fired" counter, too
- onPositionFired--;
- }
-
- onPositionItems.splice(i, 1);
-
- }
-
- }
-
- }
-
- };
-
- this._processOnPosition = function() {
-
- var i, item, j = onPositionItems.length;
-
- if (!j || !s.playState || onPositionFired >= j) return false;
-
- for (i = j - 1; i >= 0; i--) {
-
- item = onPositionItems[i];
-
- if (!item.fired && s.position >= item.position) {
-
- item.fired = true;
- onPositionFired++;
- item.method.apply(item.scope, [item.position]);
-
- // reset j -- onPositionItems.length can be changed in the item callback above... occasionally breaking the loop.
- j = onPositionItems.length;
-
- }
-
- }
-
- return true;
-
- };
-
- this._resetOnPosition = function(nPosition) {
-
- // reset "fired" for items interested in this position
- var i, item, j = onPositionItems.length;
-
- if (!j) return false;
-
- for (i = j - 1; i >= 0; i--) {
-
- item = onPositionItems[i];
-
- if (item.fired && nPosition <= item.position) {
- item.fired = false;
- onPositionFired--;
- }
-
- }
-
- return true;
-
- };
-
- /**
- * SMSound() private internals
- * --------------------------------
- */
-
- applyFromTo = function() {
-
- var instanceOptions = s._iO,
- f = instanceOptions.from,
- t = instanceOptions.to,
- start, end;
-
- end = function() {
-
- // end has been reached.
- sm2._wD(s.id + ': "To" time of ' + t + ' reached.');
-
- // detach listener
- s.clearOnPosition(t, end);
-
- // stop should clear this, too
- s.stop();
-
- };
-
- start = function() {
-
- sm2._wD(s.id + ': Playing "from" ' + f);
-
- // add listener for end
- if (t !== null && !isNaN(t)) {
- s.onPosition(t, end);
- }
-
- };
-
- if (f !== null && !isNaN(f)) {
-
- // apply to instance options, guaranteeing correct start position.
- instanceOptions.position = f;
-
- // multiShot timing can't be tracked, so prevent that.
- instanceOptions.multiShot = false;
-
- start();
-
- }
-
- // return updated instanceOptions including starting position
- return instanceOptions;
-
- };
-
- attachOnPosition = function() {
-
- var item,
- op = s._iO.onposition;
-
- // attach onposition things, if any, now.
-
- if (op) {
-
- for (item in op) {
- if (op.hasOwnProperty(item)) {
- s.onPosition(parseInt(item, 10), op[item]);
- }
- }
-
- }
-
- };
-
- detachOnPosition = function() {
-
- var item,
- op = s._iO.onposition;
-
- // detach any onposition()-style listeners.
-
- if (op) {
-
- for (item in op) {
- if (op.hasOwnProperty(item)) {
- s.clearOnPosition(parseInt(item, 10));
- }
- }
-
- }
-
- };
-
- start_html5_timer = function() {
-
- if (s.isHTML5) {
- startTimer(s);
- }
-
- };
-
- stop_html5_timer = function() {
-
- if (s.isHTML5) {
- stopTimer(s);
- }
-
- };
-
- resetProperties = function(retainPosition) {
-
- if (!retainPosition) {
- onPositionItems = [];
- onPositionFired = 0;
- }
-
- onplay_called = false;
-
- s._hasTimer = null;
- s._a = null;
- s._html5_canplay = false;
- s.bytesLoaded = null;
- s.bytesTotal = null;
- s.duration = (s._iO && s._iO.duration ? s._iO.duration : null);
- s.durationEstimate = null;
- s.buffered = [];
-
- // legacy: 1D array
- s.eqData = [];
-
- s.eqData.left = [];
- s.eqData.right = [];
-
- s.failures = 0;
- s.isBuffering = false;
- s.instanceOptions = {};
- s.instanceCount = 0;
- s.loaded = false;
- s.metadata = {};
-
- // 0 = uninitialised, 1 = loading, 2 = failed/error, 3 = loaded/success
- s.readyState = 0;
-
- s.muted = false;
- s.paused = false;
-
- s.peakData = {
- left: 0,
- right: 0
- };
-
- s.waveformData = {
- left: [],
- right: []
- };
-
- s.playState = 0;
- s.position = null;
-
- s.id3 = {};
-
- };
-
- resetProperties();
-
- /**
- * Pseudo-private SMSound internals
- * --------------------------------
- */
-
- this._onTimer = function(bForce) {
-
- /**
- * HTML5-only _whileplaying() etc.
- * called from both HTML5 native events, and polling/interval-based timers
- * mimics flash and fires only when time/duration change, so as to be polling-friendly
- */
-
- var duration, isNew = false, time, x = {};
-
- if (s._hasTimer || bForce) {
-
- // TODO: May not need to track readyState (1 = loading)
-
- if (s._a && (bForce || ((s.playState > 0 || s.readyState === 1) && !s.paused))) {
-
- duration = s._get_html5_duration();
-
- if (duration !== lastHTML5State.duration) {
-
- lastHTML5State.duration = duration;
- s.duration = duration;
- isNew = true;
-
- }
-
- // TODO: investigate why this goes wack if not set/re-set each time.
- s.durationEstimate = s.duration;
-
- time = (s._a.currentTime * msecScale || 0);
-
- if (time !== lastHTML5State.time) {
-
- lastHTML5State.time = time;
- isNew = true;
-
- }
-
- if (isNew || bForce) {
-
- s._whileplaying(time, x, x, x, x);
-
- }
-
- }/* else {
-
- // sm2._wD('_onTimer: Warn for "'+s.id+'": '+(!s._a?'Could not find element. ':'')+(s.playState === 0?'playState bad, 0?':'playState = '+s.playState+', OK'));
-
- return false;
-
- }*/
-
- }
-
- return isNew;
-
- };
-
- this._get_html5_duration = function() {
-
- var instanceOptions = s._iO,
- // if audio object exists, use its duration - else, instance option duration (if provided - it's a hack, really, and should be retired) OR null
- d = (s._a && s._a.duration ? s._a.duration * msecScale : (instanceOptions && instanceOptions.duration ? instanceOptions.duration : null)),
- result = (d && !isNaN(d) && d !== Infinity ? d : null);
-
- return result;
-
- };
-
- this._apply_loop = function(a, nLoops) {
-
- /**
- * boolean instead of "loop", for webkit? - spec says string. http://www.w3.org/TR/html-markup/audio.html#audio.attrs.loop
- * note that loop is either off or infinite under HTML5, unlike Flash which allows arbitrary loop counts to be specified.
- */
-
- // <d>
- if (!a.loop && nLoops > 1) {
- sm2._wD('Note: Native HTML5 looping is infinite.', 1);
- }
- // </d>
-
- a.loop = (nLoops > 1 ? 'loop' : '');
-
- };
-
- this._setup_html5 = function(options) {
-
- var instanceOptions = mixin(s._iO, options),
- a = useGlobalHTML5Audio ? globalHTML5Audio : s._a,
- dURL = decodeURI(instanceOptions.url),
- sameURL;
-
- /**
- * "First things first, I, Poppa..." (reset the previous state of the old sound, if playing)
- * Fixes case with devices that can only play one sound at a time
- * Otherwise, other sounds in mid-play will be terminated without warning and in a stuck state
- */
-
- if (useGlobalHTML5Audio) {
-
- if (dURL === decodeURI(lastGlobalHTML5URL)) {
- // global HTML5 audio: re-use of URL
- sameURL = true;
- }
-
- } else if (dURL === decodeURI(lastURL)) {
-
- // options URL is the same as the "last" URL, and we used (loaded) it
- sameURL = true;
-
- }
-
- if (a) {
-
- if (a._s) {
-
- if (useGlobalHTML5Audio) {
-
- if (a._s && a._s.playState && !sameURL) {
-
- // global HTML5 audio case, and loading a new URL. stop the currently-playing one.
- a._s.stop();
-
- }
-
- } else if (!useGlobalHTML5Audio && dURL === decodeURI(lastURL)) {
-
- // non-global HTML5 reuse case: same url, ignore request
- s._apply_loop(a, instanceOptions.loops);
-
- return a;
-
- }
-
- }
-
- if (!sameURL) {
-
- // don't retain onPosition() stuff with new URLs.
-
- if (lastURL) {
- resetProperties(false);
- }
-
- // assign new HTML5 URL
-
- a.src = instanceOptions.url;
-
- s.url = instanceOptions.url;
-
- lastURL = instanceOptions.url;
-
- lastGlobalHTML5URL = instanceOptions.url;
-
- a._called_load = false;
-
- }
-
- } else {
-
- if (instanceOptions.autoLoad || instanceOptions.autoPlay) {
-
- s._a = new Audio(instanceOptions.url);
- s._a.load();
-
- } else {
-
- // null for stupid Opera 9.64 case
- s._a = (isOpera && opera.version() < 10 ? new Audio(null) : new Audio());
-
- }
-
- // assign local reference
- a = s._a;
-
- a._called_load = false;
-
- if (useGlobalHTML5Audio) {
-
- globalHTML5Audio = a;
-
- }
-
- }
-
- s.isHTML5 = true;
-
- // store a ref on the track
- s._a = a;
-
- // store a ref on the audio
- a._s = s;
-
- add_html5_events();
-
- s._apply_loop(a, instanceOptions.loops);
-
- if (instanceOptions.autoLoad || instanceOptions.autoPlay) {
-
- s.load();
-
- } else {
-
- // early HTML5 implementation (non-standard)
- a.autobuffer = false;
-
- // standard ('none' is also an option.)
- a.preload = 'auto';
-
- }
-
- return a;
-
- };
-
- add_html5_events = function() {
-
- if (s._a._added_events) return false;
-
- var f;
-
- function add(oEvt, oFn, bCapture) {
- return s._a ? s._a.addEventListener(oEvt, oFn, bCapture || false) : null;
- }
-
- s._a._added_events = true;
-
- for (f in html5_events) {
- if (html5_events.hasOwnProperty(f)) {
- add(f, html5_events[f]);
- }
- }
-
- return true;
-
- };
-
- remove_html5_events = function() {
-
- // Remove event listeners
-
- var f;
-
- function remove(oEvt, oFn, bCapture) {
- return (s._a ? s._a.removeEventListener(oEvt, oFn, bCapture || false) : null);
- }
-
- sm2._wD(s.id + ': Removing event listeners');
- s._a._added_events = false;
-
- for (f in html5_events) {
- if (html5_events.hasOwnProperty(f)) {
- remove(f, html5_events[f]);
- }
- }
-
- };
-
- /**
- * Pseudo-private event internals
- * ------------------------------
- */
-
- this._onload = function(nSuccess) {
-
- var fN,
- // check for duration to prevent false positives from flash 8 when loading from cache.
- loadOK = !!nSuccess || (!s.isHTML5 && fV === 8 && s.duration);
-
- // <d>
- fN = s.id + ': ';
- sm2._wD(fN + (loadOK ? 'onload()' : 'Failed to load / invalid sound?' + (!s.duration ? ' Zero-length duration reported.' : ' -') + ' (' + s.url + ')'), (loadOK ? 1 : 2));
-
- if (!loadOK && !s.isHTML5) {
- if (sm2.sandbox.noRemote === true) {
- sm2._wD(fN + str('noNet'), 1);
- }
- if (sm2.sandbox.noLocal === true) {
- sm2._wD(fN + str('noLocal'), 1);
- }
- }
- // </d>
-
- s.loaded = loadOK;
- s.readyState = (loadOK ? 3 : 2);
- s._onbufferchange(0);
-
- if (!loadOK && !s.isHTML5) {
- // note: no error code from Flash.
- s._onerror();
- }
-
- if (s._iO.onload) {
- wrapCallback(s, function() {
- s._iO.onload.apply(s, [loadOK]);
- });
- }
-
- return true;
-
- };
-
- this._onerror = function(errorCode, description) {
-
- // https://html.spec.whatwg.org/multipage/embedded-content.html#error-codes
- if (s._iO.onerror) {
- wrapCallback(s, function() {
- s._iO.onerror.apply(s, [errorCode, description]);
- });
- }
-
- };
-
- this._onbufferchange = function(nIsBuffering) {
-
- // ignore if not playing
- if (s.playState === 0) return false;
-
- if ((nIsBuffering && s.isBuffering) || (!nIsBuffering && !s.isBuffering)) return false;
-
- s.isBuffering = (nIsBuffering === 1);
-
- if (s._iO.onbufferchange) {
- sm2._wD(s.id + ': Buffer state change: ' + nIsBuffering);
- s._iO.onbufferchange.apply(s, [nIsBuffering]);
- }
-
- return true;
-
- };
-
- /**
- * Playback may have stopped due to buffering, or related reason.
- * This state can be encountered on iOS < 6 when auto-play is blocked.
- */
-
- this._onsuspend = function() {
-
- if (s._iO.onsuspend) {
- sm2._wD(s.id + ': Playback suspended');
- s._iO.onsuspend.apply(s);
- }
-
- return true;
-
- };
-
- /**
- * flash 9/movieStar + RTMP-only method, should fire only once at most
- * at this point we just recreate failed sounds rather than trying to reconnect
- */
-
- this._onfailure = function(msg, level, code) {
-
- s.failures++;
- sm2._wD(s.id + ': Failure (' + s.failures + '): ' + msg);
-
- if (s._iO.onfailure && s.failures === 1) {
- s._iO.onfailure(msg, level, code);
- } else {
- sm2._wD(s.id + ': Ignoring failure');
- }
-
- };
-
- /**
- * flash 9/movieStar + RTMP-only method for unhandled warnings/exceptions from Flash
- * e.g., RTMP "method missing" warning (non-fatal) for getStreamLength on server
- */
-
- this._onwarning = function(msg, level, code) {
-
- if (s._iO.onwarning) {
- s._iO.onwarning(msg, level, code);
- }
-
- };
-
- this._onfinish = function() {
-
- // store local copy before it gets trashed...
- var io_onfinish = s._iO.onfinish;
-
- s._onbufferchange(0);
- s._resetOnPosition(0);
-
- // reset some state items
- if (s.instanceCount) {
-
- s.instanceCount--;
-
- if (!s.instanceCount) {
-
- // remove onPosition listeners, if any
- detachOnPosition();
-
- // reset instance options
- s.playState = 0;
- s.paused = false;
- s.instanceCount = 0;
- s.instanceOptions = {};
- s._iO = {};
- stop_html5_timer();
-
- // reset position, too
- if (s.isHTML5) {
- s.position = 0;
- }
-
- }
-
- if (!s.instanceCount || s._iO.multiShotEvents) {
- // fire onfinish for last, or every instance
- if (io_onfinish) {
- sm2._wD(s.id + ': onfinish()');
- wrapCallback(s, function() {
- io_onfinish.apply(s);
- });
- }
- }
-
- }
-
- };
-
- this._whileloading = function(nBytesLoaded, nBytesTotal, nDuration, nBufferLength) {
-
- var instanceOptions = s._iO;
-
- s.bytesLoaded = nBytesLoaded;
- s.bytesTotal = nBytesTotal;
- s.duration = Math.floor(nDuration);
- s.bufferLength = nBufferLength;
-
- if (!s.isHTML5 && !instanceOptions.isMovieStar) {
-
- if (instanceOptions.duration) {
- // use duration from options, if specified and larger. nobody should be specifying duration in options, actually, and it should be retired.
- s.durationEstimate = (s.duration > instanceOptions.duration) ? s.duration : instanceOptions.duration;
- } else {
- s.durationEstimate = parseInt((s.bytesTotal / s.bytesLoaded) * s.duration, 10);
- }
-
- } else {
-
- s.durationEstimate = s.duration;
-
- }
-
- // for flash, reflect sequential-load-style buffering
- if (!s.isHTML5) {
- s.buffered = [{
- start: 0,
- end: s.duration
- }];
- }
-
- // allow whileloading to fire even if "load" fired under HTML5, due to HTTP range/partials
- if ((s.readyState !== 3 || s.isHTML5) && instanceOptions.whileloading) {
- instanceOptions.whileloading.apply(s);
- }
-
- };
-
- this._whileplaying = function(nPosition, oPeakData, oWaveformDataLeft, oWaveformDataRight, oEQData) {
-
- var instanceOptions = s._iO,
- eqLeft;
-
- // flash safety net
- if (isNaN(nPosition) || nPosition === null) return false;
-
- // Safari HTML5 play() may return small -ve values when starting from position: 0, eg. -50.120396875. Unexpected/invalid per W3, I think. Normalize to 0.
- s.position = Math.max(0, nPosition);
-
- s._processOnPosition();
-
- if (!s.isHTML5 && fV > 8) {
-
- if (instanceOptions.usePeakData && oPeakData !== _undefined && oPeakData) {
- s.peakData = {
- left: oPeakData.leftPeak,
- right: oPeakData.rightPeak
- };
- }
-
- if (instanceOptions.useWaveformData && oWaveformDataLeft !== _undefined && oWaveformDataLeft) {
- s.waveformData = {
- left: oWaveformDataLeft.split(','),
- right: oWaveformDataRight.split(',')
- };
- }
-
- if (instanceOptions.useEQData) {
- if (oEQData !== _undefined && oEQData && oEQData.leftEQ) {
- eqLeft = oEQData.leftEQ.split(',');
- s.eqData = eqLeft;
- s.eqData.left = eqLeft;
- if (oEQData.rightEQ !== _undefined && oEQData.rightEQ) {
- s.eqData.right = oEQData.rightEQ.split(',');
- }
- }
- }
-
- }
-
- if (s.playState === 1) {
-
- // special case/hack: ensure buffering is false if loading from cache (and not yet started)
- if (!s.isHTML5 && fV === 8 && !s.position && s.isBuffering) {
- s._onbufferchange(0);
- }
-
- if (instanceOptions.whileplaying) {
- // flash may call after actual finish
- instanceOptions.whileplaying.apply(s);
- }
-
- }
-
- return true;
-
- };
-
- this._oncaptiondata = function(oData) {
-
- /**
- * internal: flash 9 + NetStream (MovieStar/RTMP-only) feature
- *
- * @param {object} oData
- */
-
- sm2._wD(s.id + ': Caption data received.');
-
- s.captiondata = oData;
-
- if (s._iO.oncaptiondata) {
- s._iO.oncaptiondata.apply(s, [oData]);
- }
-
- };
-
- this._onmetadata = function(oMDProps, oMDData) {
-
- /**
- * internal: flash 9 + NetStream (MovieStar/RTMP-only) feature
- * RTMP may include song title, MovieStar content may include encoding info
- *
- * @param {array} oMDProps (names)
- * @param {array} oMDData (values)
- */
-
- sm2._wD(s.id + ': Metadata received.');
-
- var oData = {}, i, j;
-
- for (i = 0, j = oMDProps.length; i < j; i++) {
- oData[oMDProps[i]] = oMDData[i];
- }
-
- s.metadata = oData;
-
- if (s._iO.onmetadata) {
- s._iO.onmetadata.call(s, s.metadata);
- }
-
- };
-
- this._onid3 = function(oID3Props, oID3Data) {
-
- /**
- * internal: flash 8 + flash 9 ID3 feature
- * may include artist, song title etc.
- *
- * @param {array} oID3Props (names)
- * @param {array} oID3Data (values)
- */
-
- sm2._wD(s.id + ': ID3 data received.');
-
- var oData = [], i, j;
-
- for (i = 0, j = oID3Props.length; i < j; i++) {
- oData[oID3Props[i]] = oID3Data[i];
- }
-
- s.id3 = mixin(s.id3, oData);
-
- if (s._iO.onid3) {
- s._iO.onid3.apply(s);
- }
-
- };
-
- // flash/RTMP-only
-
- this._onconnect = function(bSuccess) {
-
- bSuccess = (bSuccess === 1);
- sm2._wD(s.id + ': ' + (bSuccess ? 'Connected.' : 'Failed to connect? - ' + s.url), (bSuccess ? 1 : 2));
- s.connected = bSuccess;
-
- if (bSuccess) {
-
- s.failures = 0;
-
- if (idCheck(s.id)) {
- if (s.getAutoPlay()) {
- // only update the play state if auto playing
- s.play(_undefined, s.getAutoPlay());
- } else if (s._iO.autoLoad) {
- s.load();
- }
- }
-
- if (s._iO.onconnect) {
- s._iO.onconnect.apply(s, [bSuccess]);
- }
-
- }
-
- };
-
- this._ondataerror = function(sError) {
-
- // flash 9 wave/eq data handler
- // hack: called at start, and end from flash at/after onfinish()
- if (s.playState > 0) {
- sm2._wD(s.id + ': Data error: ' + sError);
- if (s._iO.ondataerror) {
- s._iO.ondataerror.apply(s);
- }
- }
-
- };
-
- // <d>
- this._debug();
- // </d>
-
- }; // SMSound()
-
- /**
- * Private SoundManager internals
- * ------------------------------
- */
-
- getDocument = function() {
-
- return (doc.body || doc.getElementsByTagName('div')[0]);
-
- };
-
- id = function(sID) {
-
- return doc.getElementById(sID);
-
- };
-
- mixin = function(oMain, oAdd) {
-
- // non-destructive merge
- var o1 = (oMain || {}), o2, o;
-
- // if unspecified, o2 is the default options object
- o2 = (oAdd === _undefined ? sm2.defaultOptions : oAdd);
-
- for (o in o2) {
-
- if (o2.hasOwnProperty(o) && o1[o] === _undefined) {
-
- if (typeof o2[o] !== 'object' || o2[o] === null) {
-
- // assign directly
- o1[o] = o2[o];
-
- } else {
-
- // recurse through o2
- o1[o] = mixin(o1[o], o2[o]);
-
- }
-
- }
-
- }
-
- return o1;
-
- };
-
- wrapCallback = function(oSound, callback) {
-
- /**
- * 03/03/2013: Fix for Flash Player 11.6.602.171 + Flash 8 (flashVersion = 8) SWF issue
- * setTimeout() fix for certain SMSound callbacks like onload() and onfinish(), where subsequent calls like play() and load() fail when Flash Player 11.6.602.171 is installed, and using soundManager with flashVersion = 8 (which is the default).
- * Not sure of exact cause. Suspect race condition and/or invalid (NaN-style) position argument trickling down to the next JS -> Flash _start() call, in the play() case.
- * Fix: setTimeout() to yield, plus safer null / NaN checking on position argument provided to Flash.
- * https://getsatisfaction.com/schillmania/topics/recent_chrome_update_seems_to_have_broken_my_sm2_audio_player
- */
- if (!oSound.isHTML5 && fV === 8) {
- window.setTimeout(callback, 0);
- } else {
- callback();
- }
-
- };
-
- // additional soundManager properties that soundManager.setup() will accept
-
- extraOptions = {
- onready: 1,
- ontimeout: 1,
- defaultOptions: 1,
- flash9Options: 1,
- movieStarOptions: 1
- };
-
- assign = function(o, oParent) {
-
- /**
- * recursive assignment of properties, soundManager.setup() helper
- * allows property assignment based on whitelist
- */
-
- var i,
- result = true,
- hasParent = (oParent !== _undefined),
- setupOptions = sm2.setupOptions,
- bonusOptions = extraOptions;
-
- // <d>
-
- // if soundManager.setup() called, show accepted parameters.
-
- if (o === _undefined) {
-
- result = [];
-
- for (i in setupOptions) {
-
- if (setupOptions.hasOwnProperty(i)) {
- result.push(i);
- }
-
- }
-
- for (i in bonusOptions) {
-
- if (bonusOptions.hasOwnProperty(i)) {
-
- if (typeof sm2[i] === 'object') {
- result.push(i + ': {...}');
- } else if (sm2[i] instanceof Function) {
- result.push(i + ': function() {...}');
- } else {
- result.push(i);
- }
-
- }
-
- }
-
- sm2._wD(str('setup', result.join(', ')));
-
- return false;
-
- }
-
- // </d>
-
- for (i in o) {
-
- if (o.hasOwnProperty(i)) {
-
- // if not an {object} we want to recurse through...
-
- if (typeof o[i] !== 'object' || o[i] === null || o[i] instanceof Array || o[i] instanceof RegExp) {
-
- // check "allowed" options
-
- if (hasParent && bonusOptions[oParent] !== _undefined) {
-
- // valid recursive / nested object option, eg., { defaultOptions: { volume: 50 } }
- sm2[oParent][i] = o[i];
-
- } else if (setupOptions[i] !== _undefined) {
-
- // special case: assign to setupOptions object, which soundManager property references
- sm2.setupOptions[i] = o[i];
-
- // assign directly to soundManager, too
- sm2[i] = o[i];
-
- } else if (bonusOptions[i] === _undefined) {
-
- // invalid or disallowed parameter. complain.
- complain(str((sm2[i] === _undefined ? 'setupUndef' : 'setupError'), i), 2);
-
- result = false;
-
- } else if (sm2[i] instanceof Function) {
-
- /**
- * valid extraOptions (bonusOptions) parameter.
- * is it a method, like onready/ontimeout? call it.
- * multiple parameters should be in an array, eg. soundManager.setup({onready: [myHandler, myScope]});
- */
- sm2[i].apply(sm2, (o[i] instanceof Array ? o[i] : [o[i]]));
-
- } else {
-
- // good old-fashioned direct assignment
- sm2[i] = o[i];
-
- }
-
- } else if (bonusOptions[i] === _undefined) {
-
- // recursion case, eg., { defaultOptions: { ... } }
-
- // invalid or disallowed parameter. complain.
- complain(str((sm2[i] === _undefined ? 'setupUndef' : 'setupError'), i), 2);
-
- result = false;
-
- } else {
-
- // recurse through object
- return assign(o[i], i);
-
- }
-
- }
-
- }
-
- return result;
-
- };
-
- function preferFlashCheck(kind) {
-
- // whether flash should play a given type
- return (sm2.preferFlash && hasFlash && !sm2.ignoreFlash && (sm2.flash[kind] !== _undefined && sm2.flash[kind]));
-
- }
-
- /**
- * Internal DOM2-level event helpers
- * ---------------------------------
- */
-
- event = (function() {
-
- // normalize event methods
- var old = (window.attachEvent),
- evt = {
- add: (old ? 'attachEvent' : 'addEventListener'),
- remove: (old ? 'detachEvent' : 'removeEventListener')
- };
-
- // normalize "on" event prefix, optional capture argument
- function getArgs(oArgs) {
-
- var args = slice.call(oArgs),
- len = args.length;
-
- if (old) {
- // prefix
- args[1] = 'on' + args[1];
- if (len > 3) {
- // no capture
- args.pop();
- }
- } else if (len === 3) {
- args.push(false);
- }
-
- return args;
-
- }
-
- function apply(args, sType) {
-
- // normalize and call the event method, with the proper arguments
- var element = args.shift(),
- method = [evt[sType]];
-
- if (old) {
- // old IE can't do apply().
- element[method](args[0], args[1]);
- } else {
- element[method].apply(element, args);
- }
-
- }
-
- function add() {
- apply(getArgs(arguments), 'add');
- }
-
- function remove() {
- apply(getArgs(arguments), 'remove');
- }
-
- return {
- add: add,
- remove: remove
- };
-
- }());
-
- /**
- * Internal HTML5 event handling
- * -----------------------------
- */
-
- function html5_event(oFn) {
-
- // wrap html5 event handlers so we don't call them on destroyed and/or unloaded sounds
-
- return function(e) {
-
- var s = this._s,
- result;
-
- if (!s || !s._a) {
- // <d>
- if (s && s.id) {
- sm2._wD(s.id + ': Ignoring ' + e.type);
- } else {
- sm2._wD(h5 + 'Ignoring ' + e.type);
- }
- // </d>
- result = null;
- } else {
- result = oFn.call(this, e);
- }
-
- return result;
-
- };
-
- }
-
- html5_events = {
-
- // HTML5 event-name-to-handler map
-
- abort: html5_event(function() {
-
- sm2._wD(this._s.id + ': abort');
-
- }),
-
- // enough has loaded to play
-
- canplay: html5_event(function() {
-
- var s = this._s,
- position1K;
-
- if (s._html5_canplay) {
- // this event has already fired. ignore.
- return;
- }
-
- s._html5_canplay = true;
- sm2._wD(s.id + ': canplay');
- s._onbufferchange(0);
-
- // position according to instance options
- position1K = (s._iO.position !== _undefined && !isNaN(s._iO.position) ? s._iO.position / msecScale : null);
-
- // set the position if position was provided before the sound loaded
- if (this.currentTime !== position1K) {
- sm2._wD(s.id + ': canplay: Setting position to ' + position1K);
- try {
- this.currentTime = position1K;
- } catch(ee) {
- sm2._wD(s.id + ': canplay: Setting position of ' + position1K + ' failed: ' + ee.message, 2);
- }
- }
-
- // hack for HTML5 from/to case
- if (s._iO._oncanplay) {
- s._iO._oncanplay();
- }
-
- }),
-
- canplaythrough: html5_event(function() {
-
- var s = this._s;
-
- if (!s.loaded) {
- s._onbufferchange(0);
- s._whileloading(s.bytesLoaded, s.bytesTotal, s._get_html5_duration());
- s._onload(true);
- }
-
- }),
-
- durationchange: html5_event(function() {
-
- // durationchange may fire at various times, probably the safest way to capture accurate/final duration.
-
- var s = this._s,
- duration;
-
- duration = s._get_html5_duration();
-
- if (!isNaN(duration) && duration !== s.duration) {
-
- sm2._wD(this._s.id + ': durationchange (' + duration + ')' + (s.duration ? ', previously ' + s.duration : ''));
-
- s.durationEstimate = s.duration = duration;
-
- }
-
- }),
-
- // TODO: Reserved for potential use
- /*
- emptied: html5_event(function() {
-
- sm2._wD(this._s.id + ': emptied');
-
- }),
- */
-
- ended: html5_event(function() {
-
- var s = this._s;
-
- sm2._wD(s.id + ': ended');
-
- s._onfinish();
-
- }),
-
- error: html5_event(function() {
-
- var description = (html5ErrorCodes[this.error.code] || null);
- sm2._wD(this._s.id + ': HTML5 error, code ' + this.error.code + (description ? ' (' + description + ')' : ''));
- this._s._onload(false);
- this._s._onerror(this.error.code, description);
-
- }),
-
- loadeddata: html5_event(function() {
-
- var s = this._s;
-
- sm2._wD(s.id + ': loadeddata');
-
- // safari seems to nicely report progress events, eventually totalling 100%
- if (!s._loaded && !isSafari) {
- s.duration = s._get_html5_duration();
- }
-
- }),
-
- loadedmetadata: html5_event(function() {
-
- sm2._wD(this._s.id + ': loadedmetadata');
-
- }),
-
- loadstart: html5_event(function() {
-
- sm2._wD(this._s.id + ': loadstart');
- // assume buffering at first
- this._s._onbufferchange(1);
-
- }),
-
- play: html5_event(function() {
-
- // sm2._wD(this._s.id + ': play()');
- // once play starts, no buffering
- this._s._onbufferchange(0);
-
- }),
-
- playing: html5_event(function() {
-
- sm2._wD(this._s.id + ': playing ' + String.fromCharCode(9835));
- // once play starts, no buffering
- this._s._onbufferchange(0);
-
- }),
-
- progress: html5_event(function(e) {
-
- // note: can fire repeatedly after "loaded" event, due to use of HTTP range/partials
-
- var s = this._s,
- i, j, progStr, buffered = 0,
- isProgress = (e.type === 'progress'),
- ranges = e.target.buffered,
- // firefox 3.6 implements e.loaded/total (bytes)
- loaded = (e.loaded || 0),
- total = (e.total || 1);
-
- // reset the "buffered" (loaded byte ranges) array
- s.buffered = [];
-
- if (ranges && ranges.length) {
-
- // if loaded is 0, try TimeRanges implementation as % of load
- // https://developer.mozilla.org/en/DOM/TimeRanges
-
- // re-build "buffered" array
- // HTML5 returns seconds. SM2 API uses msec for setPosition() etc., whether Flash or HTML5.
- for (i = 0, j = ranges.length; i < j; i++) {
- s.buffered.push({
- start: ranges.start(i) * msecScale,
- end: ranges.end(i) * msecScale
- });
- }
-
- // use the last value locally
- buffered = (ranges.end(0) - ranges.start(0)) * msecScale;
-
- // linear case, buffer sum; does not account for seeking and HTTP partials / byte ranges
- loaded = Math.min(1, buffered / (e.target.duration * msecScale));
-
- // <d>
- if (isProgress && ranges.length > 1) {
- progStr = [];
- j = ranges.length;
- for (i = 0; i < j; i++) {
- progStr.push((e.target.buffered.start(i) * msecScale) + '-' + (e.target.buffered.end(i) * msecScale));
- }
- sm2._wD(this._s.id + ': progress, timeRanges: ' + progStr.join(', '));
- }
-
- if (isProgress && !isNaN(loaded)) {
- sm2._wD(this._s.id + ': progress, ' + Math.floor(loaded * 100) + '% loaded');
- }
- // </d>
-
- }
-
- if (!isNaN(loaded)) {
-
- // TODO: prevent calls with duplicate values.
- s._whileloading(loaded, total, s._get_html5_duration());
- if (loaded && total && loaded === total) {
- // in case "onload" doesn't fire (eg. gecko 1.9.2)
- html5_events.canplaythrough.call(this, e);
- }
-
- }
-
- }),
-
- ratechange: html5_event(function() {
-
- sm2._wD(this._s.id + ': ratechange');
-
- }),
-
- suspend: html5_event(function(e) {
-
- // download paused/stopped, may have finished (eg. onload)
- var s = this._s;
-
- sm2._wD(this._s.id + ': suspend');
- html5_events.progress.call(this, e);
- s._onsuspend();
-
- }),
-
- stalled: html5_event(function() {
-
- sm2._wD(this._s.id + ': stalled');
-
- }),
-
- timeupdate: html5_event(function() {
-
- this._s._onTimer();
-
- }),
-
- waiting: html5_event(function() {
-
- var s = this._s;
-
- // see also: seeking
- sm2._wD(this._s.id + ': waiting');
-
- // playback faster than download rate, etc.
- s._onbufferchange(1);
-
- })
-
- };
-
- html5OK = function(iO) {
-
- // playability test based on URL or MIME type
-
- var result;
-
- if (!iO || (!iO.type && !iO.url && !iO.serverURL)) {
-
- // nothing to check
- result = false;
-
- } else if (iO.serverURL || (iO.type && preferFlashCheck(iO.type))) {
-
- // RTMP, or preferring flash
- result = false;
-
- } else {
-
- // Use type, if specified. Pass data: URIs to HTML5. If HTML5-only mode, no other options, so just give 'er
- result = ((iO.type ? html5CanPlay({ type: iO.type }) : html5CanPlay({ url: iO.url }) || sm2.html5Only || iO.url.match(/data:/i)));
-
- }
-
- return result;
-
- };
-
- html5Unload = function(oAudio) {
-
- /**
- * Internal method: Unload media, and cancel any current/pending network requests.
- * Firefox can load an empty URL, which allegedly destroys the decoder and stops the download.
- * https://developer.mozilla.org/En/Using_audio_and_video_in_Firefox#Stopping_the_download_of_media
- * However, Firefox has been seen loading a relative URL from '' and thus requesting the hosting page on unload.
- * Other UA behaviour is unclear, so everyone else gets an about:blank-style URL.
- */
-
- var url;
-
- if (oAudio) {
-
- // Firefox and Chrome accept short WAVe data: URIs. Chome dislikes audio/wav, but accepts audio/wav for data: MIME.
- // Desktop Safari complains / fails on data: URI, so it gets about:blank.
- url = (isSafari ? emptyURL : (sm2.html5.canPlayType('audio/wav') ? emptyWAV : emptyURL));
-
- oAudio.src = url;
-
- // reset some state, too
- if (oAudio._called_unload !== _undefined) {
- oAudio._called_load = false;
- }
-
- }
-
- if (useGlobalHTML5Audio) {
-
- // ensure URL state is trashed, also
- lastGlobalHTML5URL = null;
-
- }
-
- return url;
-
- };
-
- html5CanPlay = function(o) {
-
- /**
- * Try to find MIME, test and return truthiness
- * o = {
- * url: '/path/to/an.mp3',
- * type: 'audio/mp3'
- * }
- */
-
- if (!sm2.useHTML5Audio || !sm2.hasHTML5) return false;
-
- var url = (o.url || null),
- mime = (o.type || null),
- aF = sm2.audioFormats,
- result,
- offset,
- fileExt,
- item;
-
- // account for known cases like audio/mp3
-
- if (mime && sm2.html5[mime] !== _undefined) return (sm2.html5[mime] && !preferFlashCheck(mime));
-
- if (!html5Ext) {
-
- html5Ext = [];
-
- for (item in aF) {
-
- if (aF.hasOwnProperty(item)) {
-
- html5Ext.push(item);
-
- if (aF[item].related) {
- html5Ext = html5Ext.concat(aF[item].related);
- }
-
- }
-
- }
-
- html5Ext = new RegExp('\\.(' + html5Ext.join('|') + ')(\\?.*)?$', 'i');
-
- }
-
- // TODO: Strip URL queries, etc.
- fileExt = (url ? url.toLowerCase().match(html5Ext) : null);
-
- if (!fileExt || !fileExt.length) {
-
- if (!mime) {
-
- result = false;
-
- } else {
-
- // audio/mp3 -> mp3, result should be known
- offset = mime.indexOf(';');
-
- // strip "audio/X; codecs..."
- fileExt = (offset !== -1 ? mime.substr(0, offset) : mime).substr(6);
-
- }
-
- } else {
-
- // match the raw extension name - "mp3", for example
- fileExt = fileExt[1];
-
- }
-
- if (fileExt && sm2.html5[fileExt] !== _undefined) {
-
- // result known
- result = (sm2.html5[fileExt] && !preferFlashCheck(fileExt));
-
- } else {
-
- mime = 'audio/' + fileExt;
- result = sm2.html5.canPlayType({ type: mime });
-
- sm2.html5[fileExt] = result;
-
- // sm2._wD('canPlayType, found result: ' + result);
- result = (result && sm2.html5[mime] && !preferFlashCheck(mime));
- }
-
- return result;
-
- };
-
- testHTML5 = function() {
-
- /**
- * Internal: Iterates over audioFormats, determining support eg. audio/mp3, audio/mpeg and so on
- * assigns results to html5[] and flash[].
- */
-
- if (!sm2.useHTML5Audio || !sm2.hasHTML5) {
-
- // without HTML5, we need Flash.
- sm2.html5.usingFlash = true;
- needsFlash = true;
-
- return false;
-
- }
-
- // double-whammy: Opera 9.64 throws WRONG_ARGUMENTS_ERR if no parameter passed to Audio(), and Webkit + iOS happily tries to load "null" as a URL. :/
- var a = (Audio !== _undefined ? (isOpera && opera.version() < 10 ? new Audio(null) : new Audio()) : null),
- item, lookup, support = {}, aF, i;
-
- function cp(m) {
-
- var canPlay, j,
- result = false,
- isOK = false;
-
- if (!a || typeof a.canPlayType !== 'function') return result;
-
- if (m instanceof Array) {
-
- // iterate through all mime types, return any successes
-
- for (i = 0, j = m.length; i < j; i++) {
-
- if (sm2.html5[m[i]] || a.canPlayType(m[i]).match(sm2.html5Test)) {
-
- isOK = true;
- sm2.html5[m[i]] = true;
-
- // note flash support, too
- sm2.flash[m[i]] = !!(m[i].match(flashMIME));
-
- }
-
- }
-
- result = isOK;
-
- } else {
-
- canPlay = (a && typeof a.canPlayType === 'function' ? a.canPlayType(m) : false);
- result = !!(canPlay && (canPlay.match(sm2.html5Test)));
-
- }
-
- return result;
-
- }
-
- // test all registered formats + codecs
-
- aF = sm2.audioFormats;
-
- for (item in aF) {
-
- if (aF.hasOwnProperty(item)) {
-
- lookup = 'audio/' + item;
-
- support[item] = cp(aF[item].type);
-
- // write back generic type too, eg. audio/mp3
- support[lookup] = support[item];
-
- // assign flash
- if (item.match(flashMIME)) {
-
- sm2.flash[item] = true;
- sm2.flash[lookup] = true;
-
- } else {
-
- sm2.flash[item] = false;
- sm2.flash[lookup] = false;
-
- }
-
- // assign result to related formats, too
-
- if (aF[item] && aF[item].related) {
-
- for (i = aF[item].related.length - 1; i >= 0; i--) {
-
- // eg. audio/m4a
- support['audio/' + aF[item].related[i]] = support[item];
- sm2.html5[aF[item].related[i]] = support[item];
- sm2.flash[aF[item].related[i]] = support[item];
-
- }
-
- }
-
- }
-
- }
-
- support.canPlayType = (a ? cp : null);
- sm2.html5 = mixin(sm2.html5, support);
-
- sm2.html5.usingFlash = featureCheck();
- needsFlash = sm2.html5.usingFlash;
-
- return true;
-
- };
-
- strings = {
-
- // <d>
- notReady: 'Unavailable - wait until onready() has fired.',
- notOK: 'Audio support is not available.',
- domError: sm + 'exception caught while appending SWF to DOM.',
- spcWmode: 'Removing wmode, preventing known SWF loading issue(s)',
- swf404: smc + 'Verify that %s is a valid path.',
- tryDebug: 'Try ' + sm + '.debugFlash = true for more security details (output goes to SWF.)',
- checkSWF: 'See SWF output for more debug info.',
- localFail: smc + 'Non-HTTP page (' + doc.location.protocol + ' URL?) Review Flash player security settings for this special case:\nhttp://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html\nMay need to add/allow path, eg. c:/sm2/ or /users/me/sm2/',
- waitFocus: smc + 'Special case: Waiting for SWF to load with window focus...',
- waitForever: smc + 'Waiting indefinitely for Flash (will recover if unblocked)...',
- waitSWF: smc + 'Waiting for 100% SWF load...',
- needFunction: smc + 'Function object expected for %s',
- badID: 'Sound ID "%s" should be a string, starting with a non-numeric character',
- currentObj: smc + '_debug(): Current sound objects',
- waitOnload: smc + 'Waiting for window.onload()',
- docLoaded: smc + 'Document already loaded',
- onload: smc + 'initComplete(): calling soundManager.onload()',
- onloadOK: sm + '.onload() complete',
- didInit: smc + 'init(): Already called?',
- secNote: 'Flash security note: Network/internet URLs will not load due to security restrictions. Access can be configured via Flash Player Global Security Settings Page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html',
- badRemove: smc + 'Failed to remove Flash node.',
- shutdown: sm + '.disable(): Shutting down',
- queue: smc + 'Queueing %s handler',
- smError: 'SMSound.load(): Exception: JS-Flash communication failed, or JS error.',
- fbTimeout: 'No flash response, applying .' + swfCSS.swfTimedout + ' CSS...',
- fbLoaded: 'Flash loaded',
- fbHandler: smc + 'flashBlockHandler()',
- manURL: 'SMSound.load(): Using manually-assigned URL',
- onURL: sm + '.load(): current URL already assigned.',
- badFV: sm + '.flashVersion must be 8 or 9. "%s" is invalid. Reverting to %s.',
- as2loop: 'Note: Setting stream:false so looping can work (flash 8 limitation)',
- noNSLoop: 'Note: Looping not implemented for MovieStar formats',
- needfl9: 'Note: Switching to flash 9, required for MP4 formats.',
- mfTimeout: 'Setting flashLoadTimeout = 0 (infinite) for off-screen, mobile flash case',
- needFlash: smc + 'Fatal error: Flash is needed to play some required formats, but is not available.',
- gotFocus: smc + 'Got window focus.',
- policy: 'Enabling usePolicyFile for data access',
- setup: sm + '.setup(): allowed parameters: %s',
- setupError: sm + '.setup(): "%s" cannot be assigned with this method.',
- setupUndef: sm + '.setup(): Could not find option "%s"',
- setupLate: sm + '.setup(): url, flashVersion and html5Test property changes will not take effect until reboot().',
- noURL: smc + 'Flash URL required. Call soundManager.setup({url:...}) to get started.',
- sm2Loaded: 'SoundManager 2: Ready. ' + String.fromCharCode(10003),
- reset: sm + '.reset(): Removing event callbacks',
- mobileUA: 'Mobile UA detected, preferring HTML5 by default.',
- globalHTML5: 'Using singleton HTML5 Audio() pattern for this device.',
- ignoreMobile: 'Ignoring mobile restrictions for this device.'
- // </d>
-
- };
-
- str = function() {
-
- // internal string replace helper.
- // arguments: o [,items to replace]
- // <d>
-
- var args,
- i, j, o,
- sstr;
-
- // real array, please
- args = slice.call(arguments);
-
- // first argument
- o = args.shift();
-
- sstr = (strings && strings[o] ? strings[o] : '');
-
- if (sstr && args && args.length) {
- for (i = 0, j = args.length; i < j; i++) {
- sstr = sstr.replace('%s', args[i]);
- }
- }
-
- return sstr;
- // </d>
-
- };
-
- loopFix = function(sOpt) {
-
- // flash 8 requires stream = false for looping to work
- if (fV === 8 && sOpt.loops > 1 && sOpt.stream) {
- _wDS('as2loop');
- sOpt.stream = false;
- }
-
- return sOpt;
-
- };
-
- policyFix = function(sOpt, sPre) {
-
- if (sOpt && !sOpt.usePolicyFile && (sOpt.onid3 || sOpt.usePeakData || sOpt.useWaveformData || sOpt.useEQData)) {
- sm2._wD((sPre || '') + str('policy'));
- sOpt.usePolicyFile = true;
- }
-
- return sOpt;
-
- };
-
- complain = function(sMsg) {
-
- // <d>
- if (hasConsole && console.warn !== _undefined) {
- console.warn(sMsg);
- } else {
- sm2._wD(sMsg);
- }
- // </d>
-
- };
-
- doNothing = function() {
-
- return false;
-
- };
-
- disableObject = function(o) {
-
- var oProp;
-
- for (oProp in o) {
- if (o.hasOwnProperty(oProp) && typeof o[oProp] === 'function') {
- o[oProp] = doNothing;
- }
- }
-
- oProp = null;
-
- };
-
- failSafely = function(bNoDisable) {
-
- // general failure exception handler
-
- if (bNoDisable === _undefined) {
- bNoDisable = false;
- }
-
- if (disabled || bNoDisable) {
- sm2.disable(bNoDisable);
- }
-
- };
-
- normalizeMovieURL = function(movieURL) {
-
- var urlParams = null, url;
-
- if (movieURL) {
-
- if (movieURL.match(/\.swf(\?.*)?$/i)) {
-
- urlParams = movieURL.substr(movieURL.toLowerCase().lastIndexOf('.swf?') + 4);
-
- // assume user knows what they're doing
- if (urlParams) return movieURL;
-
- } else if (movieURL.lastIndexOf('/') !== movieURL.length - 1) {
-
- // append trailing slash, if needed
- movieURL += '/';
-
- }
-
- }
-
- url = (movieURL && movieURL.lastIndexOf('/') !== -1 ? movieURL.substr(0, movieURL.lastIndexOf('/') + 1) : './') + sm2.movieURL;
-
- if (sm2.noSWFCache) {
- url += ('?ts=' + new Date().getTime());
- }
-
- return url;
-
- };
-
- setVersionInfo = function() {
-
- // short-hand for internal use
-
- fV = parseInt(sm2.flashVersion, 10);
-
- if (fV !== 8 && fV !== 9) {
- sm2._wD(str('badFV', fV, defaultFlashVersion));
- sm2.flashVersion = fV = defaultFlashVersion;
- }
-
- // debug flash movie, if applicable
-
- var isDebug = (sm2.debugMode || sm2.debugFlash ? '_debug.swf' : '.swf');
-
- if (sm2.useHTML5Audio && !sm2.html5Only && sm2.audioFormats.mp4.required && fV < 9) {
- sm2._wD(str('needfl9'));
- sm2.flashVersion = fV = 9;
- }
-
- sm2.version = sm2.versionNumber + (sm2.html5Only ? ' (HTML5-only mode)' : (fV === 9 ? ' (AS3/Flash 9)' : ' (AS2/Flash 8)'));
-
- // set up default options
- if (fV > 8) {
-
- // +flash 9 base options
- sm2.defaultOptions = mixin(sm2.defaultOptions, sm2.flash9Options);
- sm2.features.buffering = true;
-
- // +moviestar support
- sm2.defaultOptions = mixin(sm2.defaultOptions, sm2.movieStarOptions);
- sm2.filePatterns.flash9 = new RegExp('\\.(mp3|' + netStreamTypes.join('|') + ')(\\?.*)?$', 'i');
- sm2.features.movieStar = true;
-
- } else {
-
- sm2.features.movieStar = false;
-
- }
-
- // regExp for flash canPlay(), etc.
- sm2.filePattern = sm2.filePatterns[(fV !== 8 ? 'flash9' : 'flash8')];
-
- // if applicable, use _debug versions of SWFs
- sm2.movieURL = (fV === 8 ? 'soundmanager2.swf' : 'soundmanager2_flash9.swf').replace('.swf', isDebug);
-
- sm2.features.peakData = sm2.features.waveformData = sm2.features.eqData = (fV > 8);
-
- };
-
- setPolling = function(bPolling, bHighPerformance) {
-
- if (!flash) {
- return;
- }
-
- flash._setPolling(bPolling, bHighPerformance);
-
- };
-
- initDebug = function() {
-
- // starts debug mode, creating output <div> for UAs without console object
-
- // allow force of debug mode via URL
- // <d>
- if (sm2.debugURLParam.test(wl)) {
- sm2.setupOptions.debugMode = sm2.debugMode = true;
- }
-
- if (id(sm2.debugID)) {
- return;
- }
-
- var oD, oDebug, oTarget, oToggle, tmp;
-
- if (sm2.debugMode && !id(sm2.debugID) && (!hasConsole || !sm2.useConsole || !sm2.consoleOnly)) {
-
- oD = doc.createElement('div');
- oD.id = sm2.debugID + '-toggle';
-
- oToggle = {
- position: 'fixed',
- bottom: '0px',
- right: '0px',
- width: '1.2em',
- height: '1.2em',
- lineHeight: '1.2em',
- margin: '2px',
- textAlign: 'center',
- border: '1px solid #999',
- cursor: 'pointer',
- background: '#fff',
- color: '#333',
- zIndex: 10001
- };
-
- oD.appendChild(doc.createTextNode('-'));
- oD.onclick = toggleDebug;
- oD.title = 'Toggle SM2 debug console';
-
- if (ua.match(/msie 6/i)) {
- oD.style.position = 'absolute';
- oD.style.cursor = 'hand';
- }
-
- for (tmp in oToggle) {
- if (oToggle.hasOwnProperty(tmp)) {
- oD.style[tmp] = oToggle[tmp];
- }
- }
-
- oDebug = doc.createElement('div');
- oDebug.id = sm2.debugID;
- oDebug.style.display = (sm2.debugMode ? 'block' : 'none');
-
- if (sm2.debugMode && !id(oD.id)) {
- try {
- oTarget = getDocument();
- oTarget.appendChild(oD);
- } catch(e2) {
- throw new Error(str('domError') + ' \n' + e2.toString());
- }
- oTarget.appendChild(oDebug);
- }
-
- }
-
- oTarget = null;
- // </d>
-
- };
-
- idCheck = this.getSoundById;
-
- // <d>
- _wDS = function(o, errorLevel) {
-
- return (!o ? '' : sm2._wD(str(o), errorLevel));
-
- };
-
- toggleDebug = function() {
-
- var o = id(sm2.debugID),
- oT = id(sm2.debugID + '-toggle');
-
- if (!o) {
- return;
- }
-
- if (debugOpen) {
- // minimize
- oT.innerHTML = '+';
- o.style.display = 'none';
- } else {
- oT.innerHTML = '-';
- o.style.display = 'block';
- }
-
- debugOpen = !debugOpen;
-
- };
-
- debugTS = function(sEventType, bSuccess, sMessage) {
-
- // troubleshooter debug hooks
-
- if (window.sm2Debugger !== _undefined) {
- try {
- sm2Debugger.handleEvent(sEventType, bSuccess, sMessage);
- } catch(e) {
- // oh well
- return false;
- }
- }
-
- return true;
-
- };
- // </d>
-
- getSWFCSS = function() {
-
- var css = [];
-
- if (sm2.debugMode) {
- css.push(swfCSS.sm2Debug);
- }
-
- if (sm2.debugFlash) {
- css.push(swfCSS.flashDebug);
- }
-
- if (sm2.useHighPerformance) {
- css.push(swfCSS.highPerf);
- }
-
- return css.join(' ');
-
- };
-
- flashBlockHandler = function() {
-
- // *possible* flash block situation.
-
- var name = str('fbHandler'),
- p = sm2.getMoviePercent(),
- css = swfCSS,
- error = {
- type: 'FLASHBLOCK'
- };
-
- if (sm2.html5Only) {
- // no flash, or unused
- return;
- }
-
- if (!sm2.ok()) {
-
- if (needsFlash) {
- // make the movie more visible, so user can fix
- sm2.oMC.className = getSWFCSS() + ' ' + css.swfDefault + ' ' + (p === null ? css.swfTimedout : css.swfError);
- sm2._wD(name + ': ' + str('fbTimeout') + (p ? ' (' + str('fbLoaded') + ')' : ''));
- }
-
- sm2.didFlashBlock = true;
-
- // fire onready(), complain lightly
- processOnEvents({
- type: 'ontimeout',
- ignoreInit: true,
- error: error
- });
-
- catchError(error);
-
- } else {
-
- // SM2 loaded OK (or recovered)
-
- // <d>
- if (sm2.didFlashBlock) {
- sm2._wD(name + ': Unblocked');
- }
- // </d>
-
- if (sm2.oMC) {
- sm2.oMC.className = [getSWFCSS(), css.swfDefault, css.swfLoaded + (sm2.didFlashBlock ? ' ' + css.swfUnblocked : '')].join(' ');
- }
-
- }
-
- };
-
- addOnEvent = function(sType, oMethod, oScope) {
-
- if (on_queue[sType] === _undefined) {
- on_queue[sType] = [];
- }
-
- on_queue[sType].push({
- method: oMethod,
- scope: (oScope || null),
- fired: false
- });
-
- };
-
- processOnEvents = function(oOptions) {
-
- // if unspecified, assume OK/error
-
- if (!oOptions) {
- oOptions = {
- type: (sm2.ok() ? 'onready' : 'ontimeout')
- };
- }
-
- // not ready yet.
- if (!didInit && oOptions && !oOptions.ignoreInit) return false;
-
- // invalid case
- if (oOptions.type === 'ontimeout' && (sm2.ok() || (disabled && !oOptions.ignoreInit))) return false;
-
- var status = {
- success: (oOptions && oOptions.ignoreInit ? sm2.ok() : !disabled)
- },
-
- // queue specified by type, or none
- srcQueue = (oOptions && oOptions.type ? on_queue[oOptions.type] || [] : []),
-
- queue = [], i, j,
- args = [status],
- canRetry = (needsFlash && !sm2.ok());
-
- if (oOptions.error) {
- args[0].error = oOptions.error;
- }
-
- for (i = 0, j = srcQueue.length; i < j; i++) {
- if (srcQueue[i].fired !== true) {
- queue.push(srcQueue[i]);
- }
- }
-
- if (queue.length) {
-
- // sm2._wD(sm + ': Firing ' + queue.length + ' ' + oOptions.type + '() item' + (queue.length === 1 ? '' : 's'));
- for (i = 0, j = queue.length; i < j; i++) {
-
- if (queue[i].scope) {
- queue[i].method.apply(queue[i].scope, args);
- } else {
- queue[i].method.apply(this, args);
- }
-
- if (!canRetry) {
- // useFlashBlock and SWF timeout case doesn't count here.
- queue[i].fired = true;
-
- }
-
- }
-
- }
-
- return true;
-
- };
-
- initUserOnload = function() {
-
- window.setTimeout(function() {
-
- if (sm2.useFlashBlock) {
- flashBlockHandler();
- }
-
- processOnEvents();
-
- // call user-defined "onload", scoped to window
-
- if (typeof sm2.onload === 'function') {
- _wDS('onload', 1);
- sm2.onload.apply(window);
- _wDS('onloadOK', 1);
- }
-
- if (sm2.waitForWindowLoad) {
- event.add(window, 'load', initUserOnload);
- }
-
- }, 1);
-
- };
-
- detectFlash = function() {
-
- /**
- * Hat tip: Flash Detect library (BSD, (C) 2007) by Carl "DocYes" S. Yestrau
- * http://featureblend.com/javascript-flash-detection-library.html / http://featureblend.com/license.txt
- */
-
- // this work has already been done.
- if (hasFlash !== _undefined) return hasFlash;
-
- var hasPlugin = false, n = navigator, obj, type, types, AX = window.ActiveXObject;
-
- // MS Edge 14 throws an "Unspecified Error" because n.plugins is inaccessible due to permissions
- var nP;
-
- try {
- nP = n.plugins;
- } catch(e) {
- nP = undefined;
- }
-
- if (nP && nP.length) {
-
- type = 'application/x-shockwave-flash';
- types = n.mimeTypes;
-
- if (types && types[type] && types[type].enabledPlugin && types[type].enabledPlugin.description) {
- hasPlugin = true;
- }
-
- } else if (AX !== _undefined && !ua.match(/MSAppHost/i)) {
-
- // Windows 8 Store Apps (MSAppHost) are weird (compatibility?) and won't complain here, but will barf if Flash/ActiveX object is appended to the DOM.
- try {
- obj = new AX('ShockwaveFlash.ShockwaveFlash');
- } catch(e) {
- // oh well
- obj = null;
- }
-
- hasPlugin = (!!obj);
-
- // cleanup, because it is ActiveX after all
- obj = null;
-
- }
-
- hasFlash = hasPlugin;
-
- return hasPlugin;
-
- };
-
- featureCheck = function() {
-
- var flashNeeded,
- item,
- formats = sm2.audioFormats,
- // iPhone <= 3.1 has broken HTML5 audio(), but firmware 3.2 (original iPad) + iOS4 works.
- isSpecial = (is_iDevice && !!(ua.match(/os (1|2|3_0|3_1)\s/i)));
-
- if (isSpecial) {
-
- // has Audio(), but is broken; let it load links directly.
- sm2.hasHTML5 = false;
-
- // ignore flash case, however
- sm2.html5Only = true;
-
- // hide the SWF, if present
- if (sm2.oMC) {
- sm2.oMC.style.display = 'none';
- }
-
- } else if (sm2.useHTML5Audio) {
-
- if (!sm2.html5 || !sm2.html5.canPlayType) {
- sm2._wD('SoundManager: No HTML5 Audio() support detected.');
- sm2.hasHTML5 = false;
- }
-
- // <d>
- if (isBadSafari) {
- sm2._wD(smc + 'Note: Buggy HTML5 Audio in Safari on this OS X release, see https://bugs.webkit.org/show_bug.cgi?id=32159 - ' + (!hasFlash ? ' would use flash fallback for MP3/MP4, but none detected.' : 'will use flash fallback for MP3/MP4, if available'), 1);
- }
- // </d>
-
- }
-
- if (sm2.useHTML5Audio && sm2.hasHTML5) {
-
- // sort out whether flash is optional, required or can be ignored.
-
- // innocent until proven guilty.
- canIgnoreFlash = true;
-
- for (item in formats) {
-
- if (formats.hasOwnProperty(item)) {
-
- if (formats[item].required) {
-
- if (!sm2.html5.canPlayType(formats[item].type)) {
-
- // 100% HTML5 mode is not possible.
- canIgnoreFlash = false;
- flashNeeded = true;
-
- } else if (sm2.preferFlash && (sm2.flash[item] || sm2.flash[formats[item].type])) {
-
- // flash may be required, or preferred for this format.
- flashNeeded = true;
-
- }
-
- }
-
- }
-
- }
-
- }
-
- // sanity check...
- if (sm2.ignoreFlash) {
- flashNeeded = false;
- canIgnoreFlash = true;
- }
-
- sm2.html5Only = (sm2.hasHTML5 && sm2.useHTML5Audio && !flashNeeded);
-
- return (!sm2.html5Only);
-
- };
-
- parseURL = function(url) {
-
- /**
- * Internal: Finds and returns the first playable URL (or failing that, the first URL.)
- * @param {string or array} url A single URL string, OR, an array of URL strings or {url:'/path/to/resource', type:'audio/mp3'} objects.
- */
-
- var i, j, urlResult = 0, result;
-
- if (url instanceof Array) {
-
- // find the first good one
- for (i = 0, j = url.length; i < j; i++) {
-
- if (url[i] instanceof Object) {
-
- // MIME check
- if (sm2.canPlayMIME(url[i].type)) {
- urlResult = i;
- break;
- }
-
- } else if (sm2.canPlayURL(url[i])) {
-
- // URL string check
- urlResult = i;
- break;
-
- }
-
- }
-
- // normalize to string
- if (url[urlResult].url) {
- url[urlResult] = url[urlResult].url;
- }
-
- result = url[urlResult];
-
- } else {
-
- // single URL case
- result = url;
-
- }
-
- return result;
-
- };
-
-
- startTimer = function(oSound) {
-
- /**
- * attach a timer to this sound, and start an interval if needed
- */
-
- if (!oSound._hasTimer) {
-
- oSound._hasTimer = true;
-
- if (!mobileHTML5 && sm2.html5PollingInterval) {
-
- if (h5IntervalTimer === null && h5TimerCount === 0) {
-
- h5IntervalTimer = setInterval(timerExecute, sm2.html5PollingInterval);
-
- }
-
- h5TimerCount++;
-
- }
-
- }
-
- };
-
- stopTimer = function(oSound) {
-
- /**
- * detach a timer
- */
-
- if (oSound._hasTimer) {
-
- oSound._hasTimer = false;
-
- if (!mobileHTML5 && sm2.html5PollingInterval) {
-
- // interval will stop itself at next execution.
-
- h5TimerCount--;
-
- }
-
- }
-
- };
-
- timerExecute = function() {
-
- /**
- * manual polling for HTML5 progress events, ie., whileplaying()
- * (can achieve greater precision than conservative default HTML5 interval)
- */
-
- var i;
-
- if (h5IntervalTimer !== null && !h5TimerCount) {
-
- // no active timers, stop polling interval.
-
- clearInterval(h5IntervalTimer);
-
- h5IntervalTimer = null;
-
- return;
-
- }
-
- // check all HTML5 sounds with timers
-
- for (i = sm2.soundIDs.length - 1; i >= 0; i--) {
-
- if (sm2.sounds[sm2.soundIDs[i]].isHTML5 && sm2.sounds[sm2.soundIDs[i]]._hasTimer) {
- sm2.sounds[sm2.soundIDs[i]]._onTimer();
- }
-
- }
-
- };
-
- catchError = function(options) {
-
- options = (options !== _undefined ? options : {});
-
- if (typeof sm2.onerror === 'function') {
- sm2.onerror.apply(window, [{
- type: (options.type !== _undefined ? options.type : null)
- }]);
- }
-
- if (options.fatal !== _undefined && options.fatal) {
- sm2.disable();
- }
-
- };
-
- badSafariFix = function() {
-
- // special case: "bad" Safari (OS X 10.3 - 10.7) must fall back to flash for MP3/MP4
- if (!isBadSafari || !detectFlash()) {
- // doesn't apply
- return;
- }
-
- var aF = sm2.audioFormats, i, item;
-
- for (item in aF) {
-
- if (aF.hasOwnProperty(item)) {
-
- if (item === 'mp3' || item === 'mp4') {
-
- sm2._wD(sm + ': Using flash fallback for ' + item + ' format');
- sm2.html5[item] = false;
-
- // assign result to related formats, too
- if (aF[item] && aF[item].related) {
- for (i = aF[item].related.length - 1; i >= 0; i--) {
- sm2.html5[aF[item].related[i]] = false;
- }
- }
-
- }
-
- }
-
- }
-
- };
-
- /**
- * Pseudo-private flash/ExternalInterface methods
- * ----------------------------------------------
- */
-
- this._setSandboxType = function(sandboxType) {
-
- // <d>
- // Security sandbox according to Flash plugin
- var sb = sm2.sandbox;
-
- sb.type = sandboxType;
- sb.description = sb.types[(sb.types[sandboxType] !== _undefined ? sandboxType : 'unknown')];
-
- if (sb.type === 'localWithFile') {
-
- sb.noRemote = true;
- sb.noLocal = false;
- _wDS('secNote', 2);
-
- } else if (sb.type === 'localWithNetwork') {
-
- sb.noRemote = false;
- sb.noLocal = true;
-
- } else if (sb.type === 'localTrusted') {
-
- sb.noRemote = false;
- sb.noLocal = false;
-
- }
- // </d>
-
- };
-
- this._externalInterfaceOK = function(swfVersion) {
-
- // flash callback confirming flash loaded, EI working etc.
- // swfVersion: SWF build string
-
- if (sm2.swfLoaded) {
- return;
- }
-
- var e;
-
- debugTS('swf', true);
- debugTS('flashtojs', true);
- sm2.swfLoaded = true;
- tryInitOnFocus = false;
-
- if (isBadSafari) {
- badSafariFix();
- }
-
- // complain if JS + SWF build/version strings don't match, excluding +DEV builds
- // <d>
- if (!swfVersion || swfVersion.replace(/\+dev/i, '') !== sm2.versionNumber.replace(/\+dev/i, '')) {
-
- e = sm + ': Fatal: JavaScript file build "' + sm2.versionNumber + '" does not match Flash SWF build "' + swfVersion + '" at ' + sm2.url + '. Ensure both are up-to-date.';
-
- // escape flash -> JS stack so this error fires in window.
- setTimeout(function() {
- throw new Error(e);
- }, 0);
-
- // exit, init will fail with timeout
- return;
-
- }
- // </d>
-
- // IE needs a larger timeout
- setTimeout(init, isIE ? 100 : 1);
-
- };
-
- /**
- * Private initialization helpers
- * ------------------------------
- */
-
- createMovie = function(movieID, movieURL) {
-
- // ignore if already connected
- if (didAppend && appendSuccess) return false;
-
- function initMsg() {
-
- // <d>
-
- var options = [],
- title,
- msg = [],
- delimiter = ' + ';
-
- title = 'SoundManager ' + sm2.version + (!sm2.html5Only && sm2.useHTML5Audio ? (sm2.hasHTML5 ? ' + HTML5 audio' : ', no HTML5 audio support') : '');
-
- if (!sm2.html5Only) {
-
- if (sm2.preferFlash) {
- options.push('preferFlash');
- }
-
- if (sm2.useHighPerformance) {
- options.push('useHighPerformance');
- }
-
- if (sm2.flashPollingInterval) {
- options.push('flashPollingInterval (' + sm2.flashPollingInterval + 'ms)');
- }
-
- if (sm2.html5PollingInterval) {
- options.push('html5PollingInterval (' + sm2.html5PollingInterval + 'ms)');
- }
-
- if (sm2.wmode) {
- options.push('wmode (' + sm2.wmode + ')');
- }
-
- if (sm2.debugFlash) {
- options.push('debugFlash');
- }
-
- if (sm2.useFlashBlock) {
- options.push('flashBlock');
- }
-
- } else if (sm2.html5PollingInterval) {
- options.push('html5PollingInterval (' + sm2.html5PollingInterval + 'ms)');
- }
-
- if (options.length) {
- msg = msg.concat([options.join(delimiter)]);
- }
-
- sm2._wD(title + (msg.length ? delimiter + msg.join(', ') : ''), 1);
-
- showSupport();
-
- // </d>
-
- }
-
- if (sm2.html5Only) {
-
- // 100% HTML5 mode
- setVersionInfo();
-
- initMsg();
- sm2.oMC = id(sm2.movieID);
- init();
-
- // prevent multiple init attempts
- didAppend = true;
-
- appendSuccess = true;
-
- return false;
-
- }
-
- // flash path
- var remoteURL = (movieURL || sm2.url),
- localURL = (sm2.altURL || remoteURL),
- swfTitle = 'JS/Flash audio component (SoundManager 2)',
- oTarget = getDocument(),
- extraClass = getSWFCSS(),
- isRTL = null,
- html = doc.getElementsByTagName('html')[0],
- oEmbed, oMovie, tmp, movieHTML, oEl, s, x, sClass;
-
- isRTL = (html && html.dir && html.dir.match(/rtl/i));
- movieID = (movieID === _undefined ? sm2.id : movieID);
-
- function param(name, value) {
- return '<param name="' + name + '" value="' + value + '" />';
- }
-
- // safety check for legacy (change to Flash 9 URL)
- setVersionInfo();
- sm2.url = normalizeMovieURL(overHTTP ? remoteURL : localURL);
- movieURL = sm2.url;
-
- sm2.wmode = (!sm2.wmode && sm2.useHighPerformance ? 'transparent' : sm2.wmode);
-
- if (sm2.wmode !== null && (ua.match(/msie 8/i) || (!isIE && !sm2.useHighPerformance)) && navigator.platform.match(/win32|win64/i)) {
- /**
- * extra-special case: movie doesn't load until scrolled into view when using wmode = anything but 'window' here
- * does not apply when using high performance (position:fixed means on-screen), OR infinite flash load timeout
- * wmode breaks IE 8 on Vista + Win7 too in some cases, as of January 2011 (?)
- */
- messages.push(strings.spcWmode);
- sm2.wmode = null;
- }
-
- oEmbed = {
- name: movieID,
- id: movieID,
- src: movieURL,
- quality: 'high',
- allowScriptAccess: sm2.allowScriptAccess,
- bgcolor: sm2.bgColor,
- pluginspage: http + 'www.macromedia.com/go/getflashplayer',
- title: swfTitle,
- type: 'application/x-shockwave-flash',
- wmode: sm2.wmode,
- // http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c36cfb8137124318eebc6-7ffd.html
- hasPriority: 'true'
- };
-
- if (sm2.debugFlash) {
- oEmbed.FlashVars = 'debug=1';
- }
-
- if (!sm2.wmode) {
- // don't write empty attribute
- delete oEmbed.wmode;
- }
-
- if (isIE) {
-
- // IE is "special".
- oMovie = doc.createElement('div');
- movieHTML = [
- '<object id="' + movieID + '" data="' + movieURL + '" type="' + oEmbed.type + '" title="' + oEmbed.title + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">',
- param('movie', movieURL),
- param('AllowScriptAccess', sm2.allowScriptAccess),
- param('quality', oEmbed.quality),
- (sm2.wmode ? param('wmode', sm2.wmode) : ''),
- param('bgcolor', sm2.bgColor),
- param('hasPriority', 'true'),
- (sm2.debugFlash ? param('FlashVars', oEmbed.FlashVars) : ''),
- '</object>'
- ].join('');
-
- } else {
-
- oMovie = doc.createElement('embed');
- for (tmp in oEmbed) {
- if (oEmbed.hasOwnProperty(tmp)) {
- oMovie.setAttribute(tmp, oEmbed[tmp]);
- }
- }
-
- }
-
- initDebug();
- extraClass = getSWFCSS();
- oTarget = getDocument();
-
- if (oTarget) {
-
- sm2.oMC = (id(sm2.movieID) || doc.createElement('div'));
-
- if (!sm2.oMC.id) {
-
- sm2.oMC.id = sm2.movieID;
- sm2.oMC.className = swfCSS.swfDefault + ' ' + extraClass;
- s = null;
- oEl = null;
-
- if (!sm2.useFlashBlock) {
- if (sm2.useHighPerformance) {
- // on-screen at all times
- s = {
- position: 'fixed',
- width: '8px',
- height: '8px',
- // >= 6px for flash to run fast, >= 8px to start up under Firefox/win32 in some cases. odd? yes.
- bottom: '0px',
- left: '0px',
- overflow: 'hidden'
- };
- } else {
- // hide off-screen, lower priority
- s = {
- position: 'absolute',
- width: '6px',
- height: '6px',
- top: '-9999px',
- left: '-9999px'
- };
- if (isRTL) {
- s.left = Math.abs(parseInt(s.left, 10)) + 'px';
- }
- }
- }
-
- if (isWebkit) {
- // soundcloud-reported render/crash fix, safari 5
- sm2.oMC.style.zIndex = 10000;
- }
-
- if (!sm2.debugFlash) {
- for (x in s) {
- if (s.hasOwnProperty(x)) {
- sm2.oMC.style[x] = s[x];
- }
- }
- }
-
- try {
-
- if (!isIE) {
- sm2.oMC.appendChild(oMovie);
- }
-
- oTarget.appendChild(sm2.oMC);
-
- if (isIE) {
- oEl = sm2.oMC.appendChild(doc.createElement('div'));
- oEl.className = swfCSS.swfBox;
- oEl.innerHTML = movieHTML;
- }
-
- appendSuccess = true;
-
- } catch(e) {
-
- throw new Error(str('domError') + ' \n' + e.toString());
-
- }
-
- } else {
-
- // SM2 container is already in the document (eg. flashblock use case)
- sClass = sm2.oMC.className;
- sm2.oMC.className = (sClass ? sClass + ' ' : swfCSS.swfDefault) + (extraClass ? ' ' + extraClass : '');
- sm2.oMC.appendChild(oMovie);
-
- if (isIE) {
- oEl = sm2.oMC.appendChild(doc.createElement('div'));
- oEl.className = swfCSS.swfBox;
- oEl.innerHTML = movieHTML;
- }
-
- appendSuccess = true;
-
- }
-
- }
-
- didAppend = true;
-
- initMsg();
-
- // sm2._wD(sm + ': Trying to load ' + movieURL + (!overHTTP && sm2.altURL ? ' (alternate URL)' : ''), 1);
-
- return true;
-
- };
-
- initMovie = function() {
-
- if (sm2.html5Only) {
- createMovie();
- return false;
- }
-
- // attempt to get, or create, movie (may already exist)
- if (flash) return false;
-
- if (!sm2.url) {
-
- /**
- * Something isn't right - we've reached init, but the soundManager url property has not been set.
- * User has not called setup({url: ...}), or has not set soundManager.url (legacy use case) directly before init time.
- * Notify and exit. If user calls setup() with a url: property, init will be restarted as in the deferred loading case.
- */
-
- _wDS('noURL');
- return false;
-
- }
-
- // inline markup case
- flash = sm2.getMovie(sm2.id);
-
- if (!flash) {
-
- if (!oRemoved) {
-
- // try to create
- createMovie(sm2.id, sm2.url);
-
- } else {
-
- // try to re-append removed movie after reboot()
- if (!isIE) {
- sm2.oMC.appendChild(oRemoved);
- } else {
- sm2.oMC.innerHTML = oRemovedHTML;
- }
-
- oRemoved = null;
- didAppend = true;
-
- }
-
- flash = sm2.getMovie(sm2.id);
-
- }
-
- if (typeof sm2.oninitmovie === 'function') {
- setTimeout(sm2.oninitmovie, 1);
- }
-
- // <d>
- flushMessages();
- // </d>
-
- return true;
-
- };
-
- delayWaitForEI = function() {
-
- setTimeout(waitForEI, 1000);
-
- };
-
- rebootIntoHTML5 = function() {
-
- // special case: try for a reboot with preferFlash: false, if 100% HTML5 mode is possible and useFlashBlock is not enabled.
-
- window.setTimeout(function() {
-
- complain(smc + 'useFlashBlock is false, 100% HTML5 mode is possible. Rebooting with preferFlash: false...');
-
- sm2.setup({
- preferFlash: false
- }).reboot();
-
- // if for some reason you want to detect this case, use an ontimeout() callback and look for html5Only and didFlashBlock == true.
- sm2.didFlashBlock = true;
-
- sm2.beginDelayedInit();
-
- }, 1);
-
- };
-
- waitForEI = function() {
-
- var p,
- loadIncomplete = false;
-
- if (!sm2.url) {
- // No SWF url to load (noURL case) - exit for now. Will be retried when url is set.
- return;
- }
-
- if (waitingForEI) {
- return;
- }
-
- waitingForEI = true;
- event.remove(window, 'load', delayWaitForEI);
-
- if (hasFlash && tryInitOnFocus && !isFocused) {
- // Safari won't load flash in background tabs, only when focused.
- _wDS('waitFocus');
- return;
- }
-
- if (!didInit) {
- p = sm2.getMoviePercent();
- if (p > 0 && p < 100) {
- loadIncomplete = true;
- }
- }
-
- setTimeout(function() {
-
- p = sm2.getMoviePercent();
-
- if (loadIncomplete) {
- // special case: if movie *partially* loaded, retry until it's 100% before assuming failure.
- waitingForEI = false;
- sm2._wD(str('waitSWF'));
- window.setTimeout(delayWaitForEI, 1);
- return;
- }
-
- // <d>
- if (!didInit) {
-
- sm2._wD(sm + ': No Flash response within expected time. Likely causes: ' + (p === 0 ? 'SWF load failed, ' : '') + 'Flash blocked or JS-Flash security error.' + (sm2.debugFlash ? ' ' + str('checkSWF') : ''), 2);
-
- if (!overHTTP && p) {
-
- _wDS('localFail', 2);
-
- if (!sm2.debugFlash) {
- _wDS('tryDebug', 2);
- }
-
- }
-
- if (p === 0) {
-
- // if 0 (not null), probably a 404.
- sm2._wD(str('swf404', sm2.url), 1);
-
- }
-
- debugTS('flashtojs', false, ': Timed out' + (overHTTP ? ' (Check flash security or flash blockers)' : ' (No plugin/missing SWF?)'));
-
- }
- // </d>
-
- // give up / time-out, depending
-
- if (!didInit && okToDisable) {
-
- if (p === null) {
-
- // SWF failed to report load progress. Possibly blocked.
-
- if (sm2.useFlashBlock || sm2.flashLoadTimeout === 0) {
-
- if (sm2.useFlashBlock) {
-
- flashBlockHandler();
-
- }
-
- _wDS('waitForever');
-
- } else if (!sm2.useFlashBlock && canIgnoreFlash) {
-
- // no custom flash block handling, but SWF has timed out. Will recover if user unblocks / allows SWF load.
- rebootIntoHTML5();
-
- } else {
-
- _wDS('waitForever');
-
- // fire any regular registered ontimeout() listeners.
- processOnEvents({
- type: 'ontimeout',
- ignoreInit: true,
- error: {
- type: 'INIT_FLASHBLOCK'
- }
- });
-
- }
-
- } else if (sm2.flashLoadTimeout === 0) {
-
- // SWF loaded? Shouldn't be a blocking issue, then.
-
- _wDS('waitForever');
-
- } else if (!sm2.useFlashBlock && canIgnoreFlash) {
-
- rebootIntoHTML5();
-
- } else {
-
- failSafely(true);
-
- }
-
- }
-
- }, sm2.flashLoadTimeout);
-
- };
-
- handleFocus = function() {
-
- function cleanup() {
- event.remove(window, 'focus', handleFocus);
- }
-
- if (isFocused || !tryInitOnFocus) {
- // already focused, or not special Safari background tab case
- cleanup();
- return true;
- }
-
- okToDisable = true;
- isFocused = true;
- _wDS('gotFocus');
-
- // allow init to restart
- waitingForEI = false;
-
- // kick off ExternalInterface timeout, now that the SWF has started
- delayWaitForEI();
-
- cleanup();
- return true;
-
- };
-
- flushMessages = function() {
-
- // <d>
-
- // SM2 pre-init debug messages
- if (messages.length) {
- sm2._wD('SoundManager 2: ' + messages.join(' '), 1);
- messages = [];
- }
-
- // </d>
-
- };
-
- showSupport = function() {
-
- // <d>
-
- flushMessages();
-
- var item, tests = [];
-
- if (sm2.useHTML5Audio && sm2.hasHTML5) {
- for (item in sm2.audioFormats) {
- if (sm2.audioFormats.hasOwnProperty(item)) {
- tests.push(item + ' = ' + sm2.html5[item] + (!sm2.html5[item] && needsFlash && sm2.flash[item] ? ' (using flash)' : (sm2.preferFlash && sm2.flash[item] && needsFlash ? ' (preferring flash)' : (!sm2.html5[item] ? ' (' + (sm2.audioFormats[item].required ? 'required, ' : '') + 'and no flash support)' : ''))));
- }
- }
- sm2._wD('SoundManager 2 HTML5 support: ' + tests.join(', '), 1);
- }
-
- // </d>
-
- };
-
- initComplete = function(bNoDisable) {
-
- if (didInit) return false;
-
- if (sm2.html5Only) {
- // all good.
- _wDS('sm2Loaded', 1);
- didInit = true;
- initUserOnload();
- debugTS('onload', true);
- return true;
- }
-
- var wasTimeout = (sm2.useFlashBlock && sm2.flashLoadTimeout && !sm2.getMoviePercent()),
- result = true,
- error;
-
- if (!wasTimeout) {
- didInit = true;
- }
-
- error = {
- type: (!hasFlash && needsFlash ? 'NO_FLASH' : 'INIT_TIMEOUT')
- };
-
- sm2._wD('SoundManager 2 ' + (disabled ? 'failed to load' : 'loaded') + ' (' + (disabled ? 'Flash security/load error' : 'OK') + ') ' + String.fromCharCode(disabled ? 10006 : 10003), disabled ? 2 : 1);
-
- if (disabled || bNoDisable) {
-
- if (sm2.useFlashBlock && sm2.oMC) {
- sm2.oMC.className = getSWFCSS() + ' ' + (sm2.getMoviePercent() === null ? swfCSS.swfTimedout : swfCSS.swfError);
- }
-
- processOnEvents({
- type: 'ontimeout',
- error: error,
- ignoreInit: true
- });
-
- debugTS('onload', false);
- catchError(error);
-
- result = false;
-
- } else {
-
- debugTS('onload', true);
-
- }
-
- if (!disabled) {
-
- if (sm2.waitForWindowLoad && !windowLoaded) {
-
- _wDS('waitOnload');
- event.add(window, 'load', initUserOnload);
-
- } else {
-
- // <d>
- if (sm2.waitForWindowLoad && windowLoaded) {
- _wDS('docLoaded');
- }
- // </d>
-
- initUserOnload();
-
- }
-
- }
-
- return result;
-
- };
-
- /**
- * apply top-level setupOptions object as local properties, eg., this.setupOptions.flashVersion -> this.flashVersion (soundManager.flashVersion)
- * this maintains backward compatibility, and allows properties to be defined separately for use by soundManager.setup().
- */
-
- setProperties = function() {
-
- var i,
- o = sm2.setupOptions;
-
- for (i in o) {
-
- if (o.hasOwnProperty(i)) {
-
- // assign local property if not already defined
-
- if (sm2[i] === _undefined) {
-
- sm2[i] = o[i];
-
- } else if (sm2[i] !== o[i]) {
-
- // legacy support: write manually-assigned property (eg., soundManager.url) back to setupOptions to keep things in sync
- sm2.setupOptions[i] = sm2[i];
-
- }
-
- }
-
- }
-
- };
-
-
- init = function() {
-
- // called after onload()
-
- if (didInit) {
- _wDS('didInit');
- return false;
- }
-
- function cleanup() {
- event.remove(window, 'load', sm2.beginDelayedInit);
- }
-
- if (sm2.html5Only) {
-
- if (!didInit) {
- // we don't need no steenking flash!
- cleanup();
- sm2.enabled = true;
- initComplete();
- }
-
- return true;
-
- }
-
- // flash path
- initMovie();
-
- try {
-
- // attempt to talk to Flash
- flash._externalInterfaceTest(false);
-
- /**
- * Apply user-specified polling interval, OR, if "high performance" set, faster vs. default polling
- * (determines frequency of whileloading/whileplaying callbacks, effectively driving UI framerates)
- */
- setPolling(true, (sm2.flashPollingInterval || (sm2.useHighPerformance ? 10 : 50)));
-
- if (!sm2.debugMode) {
- // stop the SWF from making debug output calls to JS
- flash._disableDebug();
- }
-
- sm2.enabled = true;
- debugTS('jstoflash', true);
-
- if (!sm2.html5Only) {
- // prevent browser from showing cached page state (or rather, restoring "suspended" page state) via back button, because flash may be dead
- // http://www.webkit.org/blog/516/webkit-page-cache-ii-the-unload-event/
- event.add(window, 'unload', doNothing);
- }
-
- } catch(e) {
-
- sm2._wD('js/flash exception: ' + e.toString());
-
- debugTS('jstoflash', false);
-
- catchError({
- type: 'JS_TO_FLASH_EXCEPTION',
- fatal: true
- });
-
- // don't disable, for reboot()
- failSafely(true);
-
- initComplete();
-
- return false;
-
- }
-
- initComplete();
-
- // disconnect events
- cleanup();
-
- return true;
-
- };
-
- domContentLoaded = function() {
-
- if (didDCLoaded) return false;
-
- didDCLoaded = true;
-
- // assign top-level soundManager properties eg. soundManager.url
- setProperties();
-
- initDebug();
-
- if (!hasFlash && sm2.hasHTML5) {
-
- sm2._wD('SoundManager 2: No Flash detected' + (!sm2.useHTML5Audio ? ', enabling HTML5.' : '. Trying HTML5-only mode.'), 1);
-
- sm2.setup({
- useHTML5Audio: true,
- // make sure we aren't preferring flash, either
- // TODO: preferFlash should not matter if flash is not installed. Currently, stuff breaks without the below tweak.
- preferFlash: false
- });
-
- }
-
- testHTML5();
-
- if (!hasFlash && needsFlash) {
-
- messages.push(strings.needFlash);
-
- // TODO: Fatal here vs. timeout approach, etc.
- // hack: fail sooner.
- sm2.setup({
- flashLoadTimeout: 1
- });
-
- }
-
- if (doc.removeEventListener) {
- doc.removeEventListener('DOMContentLoaded', domContentLoaded, false);
- }
-
- initMovie();
-
- return true;
-
- };
-
- domContentLoadedIE = function() {
-
- if (doc.readyState === 'complete') {
- domContentLoaded();
- doc.detachEvent('onreadystatechange', domContentLoadedIE);
- }
-
- return true;
-
- };
-
- winOnLoad = function() {
-
- // catch edge case of initComplete() firing after window.load()
- windowLoaded = true;
-
- // catch case where DOMContentLoaded has been sent, but we're still in doc.readyState = 'interactive'
- domContentLoaded();
-
- event.remove(window, 'load', winOnLoad);
-
- };
-
- // sniff up-front
- detectFlash();
-
- // focus and window load, init (primarily flash-driven)
- event.add(window, 'focus', handleFocus);
- event.add(window, 'load', delayWaitForEI);
- event.add(window, 'load', winOnLoad);
-
- if (doc.addEventListener) {
-
- doc.addEventListener('DOMContentLoaded', domContentLoaded, false);
-
- } else if (doc.attachEvent) {
-
- doc.attachEvent('onreadystatechange', domContentLoadedIE);
-
- } else {
-
- // no add/attachevent support - safe to assume no JS -> Flash either
- debugTS('onload', false);
- catchError({
- type: 'NO_DOM2_EVENTS',
- fatal: true
- });
-
- }
-
-} // SoundManager()
-
-// SM2_DEFER details: http://www.schillmania.com/projects/soundmanager2/doc/getstarted/#lazy-loading
-
-if (window.SM2_DEFER === _undefined || !SM2_DEFER) {
- soundManager = new SoundManager();
-}
-
-/**
- * SoundManager public interfaces
- * ------------------------------
- */
-
-if (typeof module === 'object' && module && typeof module.exports === 'object') {
-
- /**
- * commonJS module
- */
-
- module.exports.SoundManager = SoundManager;
- module.exports.soundManager = soundManager;
-
-} else if (typeof define === 'function' && define.amd) {
-
- /**
- * AMD - requireJS
- * basic usage:
- * require(["/path/to/soundmanager2.js"], function(SoundManager) {
- * SoundManager.getInstance().setup({
- * url: '/swf/',
- * onready: function() { ... }
- * })
- * });
- *
- * SM2_DEFER usage:
- * window.SM2_DEFER = true;
- * require(["/path/to/soundmanager2.js"], function(SoundManager) {
- * SoundManager.getInstance(function() {
- * var soundManager = new SoundManager.constructor();
- * soundManager.setup({
- * url: '/swf/',
- * ...
- * });
- * ...
- * soundManager.beginDelayedInit();
- * return soundManager;
- * })
- * });
- */
-
- define(function() {
- /**
- * Retrieve the global instance of SoundManager.
- * If a global instance does not exist it can be created using a callback.
- *
- * @param {Function} smBuilder Optional: Callback used to create a new SoundManager instance
- * @return {SoundManager} The global SoundManager instance
- */
- function getInstance(smBuilder) {
- if (!window.soundManager && smBuilder instanceof Function) {
- var instance = smBuilder(SoundManager);
- if (instance instanceof SoundManager) {
- window.soundManager = instance;
- }
- }
- return window.soundManager;
- }
- return {
- constructor: SoundManager,
- getInstance: getInstance
- };
- });
-
-}
-
-// standard browser case
-
-// constructor
-window.SoundManager = SoundManager;
-
-/**
- * note: SM2 requires a window global due to Flash, which makes calls to window.soundManager.
- * Flash may not always be needed, but this is not known until async init and SM2 may even "reboot" into Flash mode.
- */
-
-// public API, flash callbacks etc.
-window.soundManager = soundManager;
-
-}(window));
diff --git a/priv/static/js/widget.js b/priv/static/js/widget.js deleted file mode 100644 index e1a5603..0000000 --- a/priv/static/js/widget.js +++ /dev/null @@ -1,57 +0,0 @@ -window.onload=function() { - - soundManager.setup({ - url: "/swf/", - preferFlash: false, - onready: function() { - window.soundPlayer = soundManager.createSound({ - id: 'radio', - url: 'http://91.121.59.45:8089/stream', - stream: true, - autoPlay: false, - usePolicyFile: true, - preferFlash: false, - autoStart: false - }) - - var playButton = document.getElementById("state"); - playButton.onclick = function() { - if (window.playerPlaying) { - console.log("should stop") - window.soundPlayer.stop(); - window.playerPlaying = false; - playButton.innerHTML = "▶"; - } else { - console.log("should start"); - window.soundPlayer.start(); - window.playerPlaying = true; - playButton.innerHTML = "⏸"; - } - } - - }, - ontimeout: function() { - console.log("soundmanager timeout") - } -}); - -window.evtSource = new EventSource("/api/icecast.sse"); -window.icecastStats = {}; -window.evtSource.addEventListener('icecast', function(e) { - var data = JSON.parse(e.data).icecast; - document.getElementById("np").innerHTML = data.np; - document.getElementById("genre").innerHTML = data.genre + " <span>en direct</span>"; - - player = document.getElementById("player"); - if (data.live != window.icecastStats.live) { - if (data.live) { - player.classList = ["live"]; - console.log("is live"); - } else { - player.classList = ["autodj"]; - console.log("stopped live"); - } - } - window.icecastStats = data; -}, false); -} diff --git a/priv/static/metrics-graphics-3.0-alpha3/.editorconfig b/priv/static/metrics-graphics-3.0-alpha3/.editorconfig deleted file mode 100644 index b400ed3..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/.editorconfig +++ /dev/null @@ -1,32 +0,0 @@ -# EditorConfig helps developers define and maintain consistent -# coding styles between different editors and IDEs -# editorconfig.org - -root = true - -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -indent_style = space -indent_size = 4 - -[*.js] -indent_style = space -indent_size = 4 - -[*.hbs] -indent_style = space -indent_size = 4 - -[*.css] -indent_style = space -indent_size = 4 - -[*.html] -indent_style = space -indent_size = 4 - -[*.{diff,md}] -trim_trailing_whitespace = false diff --git a/priv/static/metrics-graphics-3.0-alpha3/.gitignore b/priv/static/metrics-graphics-3.0-alpha3/.gitignore deleted file mode 100644 index 4c95c7f..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -# Dependencies -bower_components -node_modules - -# Logs -npm-debug.log - -# IDE -.idea - -# FS -.DS_Store - -# Others -other/divider.psd -other/htaccess.txt -bare.html diff --git a/priv/static/metrics-graphics-3.0-alpha3/.jshintignore b/priv/static/metrics-graphics-3.0-alpha3/.jshintignore deleted file mode 100644 index 111b1df..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/.jshintignore +++ /dev/null @@ -1,2 +0,0 @@ -src/js/common/bootstrap_tooltip_popover.js -src/js/layout/bootstrap_dropdown.js diff --git a/priv/static/metrics-graphics-3.0-alpha3/.jshintrc b/priv/static/metrics-graphics-3.0-alpha3/.jshintrc deleted file mode 100644 index e0bf401..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/.jshintrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "globals": { - "$": false, - "jQuery": false, - "MG": false, - "d3": false - }, - "laxbreak": true, - "validthis": true, - "loopfunc": true, - "sub": true, - "esversion": 6, - "-W082": false -} diff --git a/priv/static/metrics-graphics-3.0-alpha3/.travis.yml b/priv/static/metrics-graphics-3.0-alpha3/.travis.yml deleted file mode 100644 index 403c480..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -sudo: required -language: node_js -node_js: - - "8" -addons: - chrome: stable -before_script: - - sudo chown root /opt/google/chrome/chrome-sandbox - - sudo chmod 4755 /opt/google/chrome/chrome-sandbox -script: - - npm run lint - - npm run test-ci -before_deploy: - - cp dist/metricsgraphics.css dist/metricsgraphics.min.js . - - cp -r examples/* . - - cp -r src/js/* js -deploy: - - provider: npm - email: wrlach@gmail.com - api_key: - secure: LtS+7V8yMNMRelHAFv+ms71pYJzocX+jTePtUvNNY4k2j2b4rUkBYU0vSAmBbzOnSaIf5X8dXVzxEtYaMIliUr0vVbFvooK4GF6p4X/043dq2MRnm1GUdtG4byDd3JlYNyNo4REgmnpcARNLf3bffl3kXkb4JCvxbAWk/yuj2V4= - on: - tags: true - repo: metricsgraphics/metrics-graphics - - provider: pages - skip-cleanup: true - github-token: $GITHUB_TOKEN - on: - tags: true - branch: master diff --git a/priv/static/metrics-graphics-3.0-alpha3/CHANGELOG.md b/priv/static/metrics-graphics-3.0-alpha3/CHANGELOG.md deleted file mode 100644 index 036870a..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/CHANGELOG.md +++ /dev/null @@ -1,343 +0,0 @@ -### Changelog -All notable changes to this project will be documented in this file. - -Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - -#### [v2.15.0](https://github.com/mozilla/metrics-graphics/compare/v2.14.0...v2.15.0) -> 25 May 2018 -- basic brushing and zooming feature for line and point charts [`#851`](https://github.com/mozilla/metrics-graphics/pull/851) -- Don't overwrite user-specified decimals parameter when formatting y axis (fixes #844) [`#847`](https://github.com/mozilla/metrics-graphics/pull/847) -- Git ignore rework in section + IDE section [`#846`](https://github.com/mozilla/metrics-graphics/pull/846) -- Add an option to select lines with areas of a multi-line chart [`#830`](https://github.com/mozilla/metrics-graphics/pull/830) -- Add option to show active points on line and multi-lines charts [`#827`](https://github.com/mozilla/metrics-graphics/pull/827) -- Handle case where min_x is specified as 0 (fixes #729) [`#840`](https://github.com/mozilla/metrics-graphics/pull/840) -- Handle years-long time differences better when drawing x axis (fixes #848) [`#848`](https://github.com/mozilla/metrics-graphics/issues/848) -- Version 2.15 [`8593311`](https://github.com/mozilla/metrics-graphics/commit/859331163c491b333145b374d2848f2ff161d9e0) -- Add time range example of a "few years" [`52033a5`](https://github.com/mozilla/metrics-graphics/commit/52033a543fd6ef1ce7d7a2e40c9fbb91b28664c3) -- Remove unused variable from mg_add_x_axis_rim function [`525aaf0`](https://github.com/mozilla/metrics-graphics/commit/525aaf0f10f091f067d806404faf9b434ef72127) - -#### [v2.14.0](https://github.com/mozilla/metrics-graphics/compare/v2.13.0...v2.14.0) -> 15 March 2018 -- Regenerate files in dist [`#837`](https://github.com/mozilla/metrics-graphics/pull/837) -- Add option for flipped area under zero baseline [`#829`](https://github.com/mozilla/metrics-graphics/pull/829) -- Change the algorithm for calculate decimals of format y-axis ticks (Fixes #821) [`#832`](https://github.com/mozilla/metrics-graphics/pull/832) -- Use closures instead of `this` inside hover text code (fixes #828) [`#834`](https://github.com/mozilla/metrics-graphics/pull/834) -- Use babel before umd step in gulp build pipeline (fixes #825) [`#826`](https://github.com/mozilla/metrics-graphics/pull/826) -- Updates to travis so that ES6 is supported [`#816`](https://github.com/mozilla/metrics-graphics/pull/816) -- Fix: examples.htm works properly with `gulp serve`. #812 [`#813`](https://github.com/mozilla/metrics-graphics/pull/813) -- added @wlach to package.json contributors [`#810`](https://github.com/mozilla/metrics-graphics/pull/810) -- Use babel when generating metricsgraphics(.min).js [`#809`](https://github.com/mozilla/metrics-graphics/pull/809) -- Fix overlapping of label and ticks in the y-axis [`#803`](https://github.com/mozilla/metrics-graphics/pull/803) -- fixed grammatical error in readme file [`#804`](https://github.com/mozilla/metrics-graphics/pull/804) -- Change 'follow' to 'following' in README.md [`#801`](https://github.com/mozilla/metrics-graphics/pull/801) -- Handling requested changes of pull request #829 [`d5accbc`](https://github.com/mozilla/metrics-graphics/commit/d5accbcf16e778e6be1f8d18cda82fd74af37d54) -- Version 2.14.0 [`a124dab`](https://github.com/mozilla/metrics-graphics/commit/a124dab7e291e08abbce935a300bd68f13f139b6) -- Fix broken legend [`4545b21`](https://github.com/mozilla/metrics-graphics/commit/4545b212996715d76ee66ab99b4e0ec6f777aacd) - -#### [v2.13.0](https://github.com/mozilla/metrics-graphics/compare/v2.12.0...v2.13.0) -> 5 February 2018 -- change color for eleventh line in README.md [`#797`](https://github.com/mozilla/metrics-graphics/pull/797) -- Fix aggregated rollover circle displayed on missing data [`#786`](https://github.com/mozilla/metrics-graphics/pull/786) -- Update d3.js link [`#785`](https://github.com/mozilla/metrics-graphics/pull/785) -- Add CDNJS version badge in README.md [`#784`](https://github.com/mozilla/metrics-graphics/pull/784) -- Change maximum number of supported lines in series [`fcbc2fd`](https://github.com/mozilla/metrics-graphics/commit/fcbc2fdcc81beb5633b547c7a8a81de2f0beb4b3) -- Version 2.13 [`f49de36`](https://github.com/mozilla/metrics-graphics/commit/f49de3634b5825fc03c3bbbe8aff7252acea0765) -- Update README for new line behaviour [`36c2f4c`](https://github.com/mozilla/metrics-graphics/commit/36c2f4c8a51aea660856261e4540e0eac6a21d7c) - -#### [v2.12.0](https://github.com/mozilla/metrics-graphics/compare/v2.11.0...v2.12.0) -> 6 December 2017 -- Add mouse out events on marker text [`#780`](https://github.com/mozilla/metrics-graphics/pull/780) -- Fix linked rollovers when x-axis is not a date [`#781`](https://github.com/mozilla/metrics-graphics/pull/781) -- Fix wrong datalink [`#740`](https://github.com/mozilla/metrics-graphics/pull/740) -- Add mouse over events on Marker text [`#777`](https://github.com/mozilla/metrics-graphics/pull/777) -- Add option to display or not the active line data point information [`#776`](https://github.com/mozilla/metrics-graphics/pull/776) -- Add rollover click handler on line chart [`#775`](https://github.com/mozilla/metrics-graphics/pull/775) -- parseInt width & height to avoid concatenation [`#743`](https://github.com/mozilla/metrics-graphics/pull/743) -- Fix linked rollover when there is only one series with a custom y_accessor [`#770`](https://github.com/mozilla/metrics-graphics/pull/770) -- Line legend: use index instead of line_id [`#752`](https://github.com/mozilla/metrics-graphics/pull/752) -- Bump version to 2.12.0, update distribution [`b363d82`](https://github.com/mozilla/metrics-graphics/commit/b363d82c229fba6a280c9782b8154aad0ac901e7) -- Mouse Over Markers documentation [`8e72b4d`](https://github.com/mozilla/metrics-graphics/commit/8e72b4dffa8b2509e3b4becd7b55ca4b15f2a11a) -- Update reference to react-metrics-graphics [`02ed890`](https://github.com/mozilla/metrics-graphics/commit/02ed890e6a8402fb8b1c3d500d33fcd01e686507) - -#### [v2.11.0](https://github.com/mozilla/metrics-graphics/compare/v2.10.1...v2.11.0) -> 10 December 2016 -- Fix #653 : removed unused es6-module-transpiler [`#726`](https://github.com/mozilla/metrics-graphics/pull/726) -- add label support for scatter plots [`#727`](https://github.com/mozilla/metrics-graphics/pull/727) -- Fix #724: declare variable `target_ref` before usage. [`#728`](https://github.com/mozilla/metrics-graphics/pull/728) -- Allow markers to be on the edge of the graph. [`#720`](https://github.com/mozilla/metrics-graphics/pull/720) -- Universal markup rendering [`#723`](https://github.com/mozilla/metrics-graphics/pull/723) -- Multiline example links to wrong data file [`#711`](https://github.com/mozilla/metrics-graphics/pull/711) -- Added react component to the gallery in README.md [`#701`](https://github.com/mozilla/metrics-graphics/pull/701) -- Fix #709 [`#709`](https://github.com/mozilla/metrics-graphics/issues/709) -- Fix #724: declare variable `target_ref` before usage. [`#724`](https://github.com/mozilla/metrics-graphics/issues/724) -- Fix #710 [`#710`](https://github.com/mozilla/metrics-graphics/issues/710) -- Fix #705 [`#705`](https://github.com/mozilla/metrics-graphics/issues/705) -- Merge remote-tracking branch 'origin/master' (fixes #695) [`#695`](https://github.com/mozilla/metrics-graphics/issues/695) -- Up version to 2.11 [`ece9a17`](https://github.com/mozilla/metrics-graphics/commit/ece9a17313788e87dcb6b438cddcbf4ab08759e0) -- Up version to 2.11 [`6412851`](https://github.com/mozilla/metrics-graphics/commit/6412851edd2a55f5d37dd73dc69bc0974fb8fe7a) -- fix build [`7e2c4c8`](https://github.com/mozilla/metrics-graphics/commit/7e2c4c82bc9459d3f6684e44e975c272409354d6) - -#### [v2.10.1](https://github.com/mozilla/metrics-graphics/compare/v2.10.0...v2.10.1) -> 16 August 2016 -- Fix #693 [`#693`](https://github.com/mozilla/metrics-graphics/issues/693) -- Fix issue #694 [`1b54bd2`](https://github.com/mozilla/metrics-graphics/commit/1b54bd28c1e49416b64c6d975b87cfbf121e2cdd) -- Cleanup [`8e62b64`](https://github.com/mozilla/metrics-graphics/commit/8e62b64a721498281f24543a0b1cf528cd63e9b4) -- Update version to 2.10.1 [`aca3532`](https://github.com/mozilla/metrics-graphics/commit/aca3532f9945b08c85ba5e72946863ff3f2b762a) - -#### [v2.10.0](https://github.com/mozilla/metrics-graphics/compare/v2.9.0...v2.10.0) -> 2 August 2016 -- added option to center title over entire chart [`#652`](https://github.com/mozilla/metrics-graphics/pull/652) -- Correctly handle zero as one of the confidence band bounds [`#627`](https://github.com/mozilla/metrics-graphics/pull/627) -- Fixing disappearing point for single data point series in aggregate graph. [`#643`](https://github.com/mozilla/metrics-graphics/pull/643) -- Fix #684 [`#684`](https://github.com/mozilla/metrics-graphics/issues/684) -- Fix #683 [`#683`](https://github.com/mozilla/metrics-graphics/issues/683) -- Fix #681 [`#681`](https://github.com/mozilla/metrics-graphics/issues/681) -- re-implemented rollovers to further fix #654. Rollovers for categorical plots needs finessing. [`#654`](https://github.com/mozilla/metrics-graphics/issues/654) -- Fix #678 [`#678`](https://github.com/mozilla/metrics-graphics/issues/678) -- Fix #675 [`#675`](https://github.com/mozilla/metrics-graphics/issues/675) -- Fix #674 [`#674`](https://github.com/mozilla/metrics-graphics/issues/674) -- fixed #670 [`#670`](https://github.com/mozilla/metrics-graphics/issues/670) -- Fix #621 [`#621`](https://github.com/mozilla/metrics-graphics/issues/621) -- fixes #669 [`#669`](https://github.com/mozilla/metrics-graphics/issues/669) -- Fix #619 [`#619`](https://github.com/mozilla/metrics-graphics/issues/619) -- Fix #586 [`#586`](https://github.com/mozilla/metrics-graphics/issues/586) -- Fix #660 [`#660`](https://github.com/mozilla/metrics-graphics/issues/660) -- Fix #659 [`#659`](https://github.com/mozilla/metrics-graphics/issues/659) -- Fix #657 [`#657`](https://github.com/mozilla/metrics-graphics/issues/657) -- Fix #585 - update MG to work with D3 v4 [`#585`](https://github.com/mozilla/metrics-graphics/issues/585) -- Fix #642 [`#642`](https://github.com/mozilla/metrics-graphics/issues/642) -- Rebuild [`367d035`](https://github.com/mozilla/metrics-graphics/commit/367d035d6c18439f95eca2ced4b549b300414905) -- Cleanup [`05b8522`](https://github.com/mozilla/metrics-graphics/commit/05b85220ad858d2aef3d7fe82395d91624c7db8b) -- Cleanup [`d0c2b5c`](https://github.com/mozilla/metrics-graphics/commit/d0c2b5cbcf82c666e89484c4a371e07d8378c00b) - -#### [v2.9.0](https://github.com/mozilla/metrics-graphics/compare/v2.8.0...v2.9.0) -> 31 March 2016 -- typo at link href for data/points1.json [`#617`](https://github.com/mozilla/metrics-graphics/pull/617) -- Single window resize listener for all targets with automatic cleanup (fixes #544) [`#611`](https://github.com/mozilla/metrics-graphics/pull/611) -- Fixes #578 [`#593`](https://github.com/mozilla/metrics-graphics/pull/593) -- fixes #610 - aggregate rollover rollover doesn't break on single line [`#610`](https://github.com/mozilla/metrics-graphics/issues/610) -- Fix #620 [`#620`](https://github.com/mozilla/metrics-graphics/issues/620) -- fixes #616 - args.bar_thickness is automatically determined if args.height is set for bar charts [`#616`](https://github.com/mozilla/metrics-graphics/issues/616) -- closes #614 [`#614`](https://github.com/mozilla/metrics-graphics/issues/614) -- fixes #597. args.min_y_from_data presented a number of implementation problems. The main issue was that the plot bounds were not contingent on the range between the max and min y, so the inflation of the max and min for the purposes of plot bounds were contingent on the magnitude of the data. That's obviously silly. So now, if args.min_y_from_data, the range is taken into consideration. [`#597`](https://github.com/mozilla/metrics-graphics/issues/597) -- fixes #601. Removing clip path entirely from points for the moment. The clip path tends to cut off parts of points that are within the bounds but whose radius extends beyond the plot area. [`#601`](https://github.com/mozilla/metrics-graphics/issues/601) -- Fix #605 [`#605`](https://github.com/mozilla/metrics-graphics/issues/605) -- Fix #603 [`#603`](https://github.com/mozilla/metrics-graphics/issues/603) -- Fixes #578 [`#578`](https://github.com/mozilla/metrics-graphics/issues/578) -- #626 [`565636b`](https://github.com/mozilla/metrics-graphics/commit/565636b742cf3df746a4041c6ea01dfaef24e929) -- Update other chart types (#626) [`bdcaf45`](https://github.com/mozilla/metrics-graphics/commit/bdcaf45774d4fe70fca3b08c29d9e106f8912af9) -- Cleanup [`58d26b9`](https://github.com/mozilla/metrics-graphics/commit/58d26b913e5df8e8f20d307b678a40a2379b3735) - -#### [v2.8.0](https://github.com/mozilla/metrics-graphics/compare/v2.7.0...v2.8.0) -> 9 January 2016 -- Fix nest_data_for_aggregate_rollover() bugs [`#569`](https://github.com/mozilla/metrics-graphics/pull/569) -- Correctly handle zero sized svg elements during automatic resizes [`#570`](https://github.com/mozilla/metrics-graphics/pull/570) -- Track existing lines with unique class [`#568`](https://github.com/mozilla/metrics-graphics/pull/568) -- Add contribute.json file [`#536`](https://github.com/mozilla/metrics-graphics/pull/536) -- fixes #579 [`#579`](https://github.com/mozilla/metrics-graphics/issues/579) -- Fix #558 [`#558`](https://github.com/mozilla/metrics-graphics/issues/558) -- Fix #556 [`#556`](https://github.com/mozilla/metrics-graphics/issues/556) -- Track existing lines with unique class [`#546`](https://github.com/mozilla/metrics-graphics/issues/546) -- fixes #562 - hook issues with new processed min and max x [`#562`](https://github.com/mozilla/metrics-graphics/issues/562) -- fixes #561 - still a dirty hack [`#561`](https://github.com/mozilla/metrics-graphics/issues/561) -- fixes #521 - MG now supports much longer time series. [`#521`](https://github.com/mozilla/metrics-graphics/issues/521) -- closes #559, contributes to #555. Whatever was causing phantomjs to break on build is resolved. [`#559`](https://github.com/mozilla/metrics-graphics/issues/559) -- fixes #543 - we now have args.internal_error for internal problems (such as not passing in data) and args.error for user-defined errors [`#543`](https://github.com/mozilla/metrics-graphics/issues/543) -- fixes #531 [`#531`](https://github.com/mozilla/metrics-graphics/issues/531) -- closes #511 [`#511`](https://github.com/mozilla/metrics-graphics/issues/511) -- Revert the change for #563 until I get the chance to look at it again [`93a2b6e`](https://github.com/mozilla/metrics-graphics/commit/93a2b6e6785cdb520c06eafa1e826e594acacbc5) -- Cleanup [`cbbd94f`](https://github.com/mozilla/metrics-graphics/commit/cbbd94f2faf8ed367a31278e19803cf47302d152) -- d3 on npm is v4, was causing tests to fail, filed issue #585 [`09c30f0`](https://github.com/mozilla/metrics-graphics/commit/09c30f01364a7cc3c63e9c5fe6d570b7e7828b6a) - -#### [v2.7.0](https://github.com/mozilla/metrics-graphics/compare/v2.6.0...v2.7.0) -> 27 October 2015 -- Fix for #505 (histograms and dates) [`#509`](https://github.com/mozilla/metrics-graphics/pull/509) -- missing-data chart with full_width: true doesn't react properly on window resize [`#508`](https://github.com/mozilla/metrics-graphics/pull/508) -- Fix documentation to add the 'mg-' class prefix [`#501`](https://github.com/mozilla/metrics-graphics/pull/501) -- fix exception on aggregate_rollover is true & multiline [`#494`](https://github.com/mozilla/metrics-graphics/pull/494) -- Fix for empty data series in multiline chart [`#483`](https://github.com/mozilla/metrics-graphics/pull/483) -- Fix issue #479 [`#480`](https://github.com/mozilla/metrics-graphics/pull/480) -- Aggregate numerical [`#476`](https://github.com/mozilla/metrics-graphics/pull/476) -- Fix issue #457 [`#462`](https://github.com/mozilla/metrics-graphics/pull/462) -- added x_sort method [`#461`](https://github.com/mozilla/metrics-graphics/pull/461) -- Fix #520 [`#520`](https://github.com/mozilla/metrics-graphics/issues/520) -- Fix #519 [`#519`](https://github.com/mozilla/metrics-graphics/issues/519) -- Fix #517 [`#517`](https://github.com/mozilla/metrics-graphics/issues/517) -- Fix #463 [`#463`](https://github.com/mozilla/metrics-graphics/issues/463) -- closes #490, after a bit of weirdness in phantomJS. [`#490`](https://github.com/mozilla/metrics-graphics/issues/490) -- Fixes #490. Added an example for functions. [`#490`](https://github.com/mozilla/metrics-graphics/issues/490) -- Maintain x-axis formatting when drawing histograms [`#505`](https://github.com/mozilla/metrics-graphics/issues/505) -- Fix #485 - make least squares line span range of data rather than ticks [`#485`](https://github.com/mozilla/metrics-graphics/issues/485) -- Cleanup [`2dfed5a`](https://github.com/mozilla/metrics-graphics/commit/2dfed5ad62dbf276b2d47a1aa297d33376ca1c1e) -- Make it look nicer with the accessible style (#519) [`241c027`](https://github.com/mozilla/metrics-graphics/commit/241c027a0d2513b1b23088179559ce42478f9533) -- Update README.md [`3203a48`](https://github.com/mozilla/metrics-graphics/commit/3203a48a1fd82f9d28853ed67c5a2eb43eb673e2) - -#### [v2.6.0](https://github.com/mozilla/metrics-graphics/compare/v2.5.0...v2.6.0) -> 8 July 2015 -- Only try to add ticks if there is variation in the y-axis [`#455`](https://github.com/mozilla/metrics-graphics/pull/455) -- Sort dates in ascending order to make aggregate rollover work properly for certain lines [`#454`](https://github.com/mozilla/metrics-graphics/pull/454) -- Adding mg-regions to readme [`#451`](https://github.com/mozilla/metrics-graphics/pull/451) -- Fix index for `aggregate_rollover` and linked charts. [`#450`](https://github.com/mozilla/metrics-graphics/pull/450) -- Fix mouseover when aggregate_rollover and linked are enabled. [`#448`](https://github.com/mozilla/metrics-graphics/pull/448) -- Remove moot `version` property from bower.json [`#446`](https://github.com/mozilla/metrics-graphics/pull/446) -- Add support for `linked` charts when `aggregate_rollover` is enabled. [`#444`](https://github.com/mozilla/metrics-graphics/pull/444) -- looks to fix #449 [`#449`](https://github.com/mozilla/metrics-graphics/issues/449) -- Add an example for missing_is_hidden_accessor [`70c9434`](https://github.com/mozilla/metrics-graphics/commit/70c94347e985f9eb4146932f59a649c736912000) -- Update 'broken lines' example [`45af302`](https://github.com/mozilla/metrics-graphics/commit/45af30227efcbf42b2954dfa3de51f50c1af4bf0) -- Update footer to v2.6 [`dffd40e`](https://github.com/mozilla/metrics-graphics/commit/dffd40ecc60a31a31787e91aa6bf66013a77d985) - -#### [v2.5.0](https://github.com/mozilla/metrics-graphics/compare/v2.4.0...v2.5.0) -> 22 May 2015 -- Adding bar label rotation [`#434`](https://github.com/mozilla/metrics-graphics/pull/434) -- temporary fix for path tween [`#433`](https://github.com/mozilla/metrics-graphics/pull/433) -- Improved target reference generation [`#422`](https://github.com/mozilla/metrics-graphics/pull/422) -- Reordering dev env code to allow for errors; buttons now work even if MG code is broken. [`#425`](https://github.com/mozilla/metrics-graphics/pull/425) -- Reworking punctiation and target ref with tests [`#1`](https://github.com/mozilla/metrics-graphics/pull/1) -- Groundwork for extensibility (WIP) [`#351`](https://github.com/mozilla/metrics-graphics/pull/351) -- clone our data before we modify [`#414`](https://github.com/mozilla/metrics-graphics/pull/414) -- Use small font for baselines when small_text is set or implied [`#409`](https://github.com/mozilla/metrics-graphics/pull/409) -- Prepare files for v2.5 release [`8eb6752`](https://github.com/mozilla/metrics-graphics/commit/8eb6752d0bea9c6f683794dc0aff159756ed76a4) -- Fix issue #435 [`54c8cf3`](https://github.com/mozilla/metrics-graphics/commit/54c8cf33dcd0344a93a270c83e5e1930f0845fb7) -- Update references on interactive demo page [`5b26ee1`](https://github.com/mozilla/metrics-graphics/commit/5b26ee1c29239f416bb94bfa0f5915c719376845) - -#### [v2.4.0](https://github.com/mozilla/metrics-graphics/compare/v2.3.0...v2.4.0) -> 13 April 2015 -- Fix #405 [`#405`](https://github.com/mozilla/metrics-graphics/issues/405) -- Fixes #347 fully, and fixes the histograms and bars, which was broken upon last commit [`#347`](https://github.com/mozilla/metrics-graphics/issues/347) -- Fix #401 [`#401`](https://github.com/mozilla/metrics-graphics/issues/401) -- Update version to 2.4.0 [`4382ccd`](https://github.com/mozilla/metrics-graphics/commit/4382ccd48f91e829d63ea3e6f74221de180ab304) -- Update version to 2.4.0 [`9ff4341`](https://github.com/mozilla/metrics-graphics/commit/9ff4341f4eb2e7c21a5715c2e8f3a97c9d416b89) -- Delete empty line [`e8348bd`](https://github.com/mozilla/metrics-graphics/commit/e8348bd3a5433767d847c05eef560a2b5db0aa97) - -#### [v2.3.0](https://github.com/mozilla/metrics-graphics/compare/v2.2.1...v2.3.0) -> 30 March 2015 -- Fix "Uncaught ReferenceError: globals is not defined" for linked point c... [`#397`](https://github.com/mozilla/metrics-graphics/pull/397) -- npm install gulp [`#377`](https://github.com/mozilla/metrics-graphics/pull/377) -- fixes #368 - dom elements can again be passed to target. [`#368`](https://github.com/mozilla/metrics-graphics/issues/368) -- Fix #387 [`#387`](https://github.com/mozilla/metrics-graphics/issues/387) -- Last bit of cleanup [`036351b`](https://github.com/mozilla/metrics-graphics/commit/036351b7a8e09d60cde5b93de1317c7391090769) -- Update version to v2.3.0 [`dc61404`](https://github.com/mozilla/metrics-graphics/commit/dc61404178d950a9551fcd65ba48a442daed6db7) -- Rebuilt for v2.3.0 [`d74a77f`](https://github.com/mozilla/metrics-graphics/commit/d74a77f245fcbd8b5b2c4ccb105e68e71e1bff6b) - -#### [v2.2.1](https://github.com/mozilla/metrics-graphics/compare/v2.2.0...v2.2.1) -> 26 February 2015 -- Corrected issue where test target was not in scope [`#373`](https://github.com/mozilla/metrics-graphics/pull/373) -- Fix: missed a check for presence of predictor & baselines [`#371`](https://github.com/mozilla/metrics-graphics/pull/371) -- Add missing .mg-hover-* colors to dark demo css [`#369`](https://github.com/mozilla/metrics-graphics/pull/369) -- Bar redrawing fix [`#367`](https://github.com/mozilla/metrics-graphics/pull/367) -- Fix #372 [`#372`](https://github.com/mozilla/metrics-graphics/issues/372) -- Unit test for issue #372 [`e899bc7`](https://github.com/mozilla/metrics-graphics/commit/e899bc70dd255db72461dfe6226ff9c40abdcf2d) -- Update version to 2.2.1 [`4608060`](https://github.com/mozilla/metrics-graphics/commit/4608060d089f06b5d42dee325a451bd241bf9351) -- Updated version to 2.2.1 on examples pages [`38aea5b`](https://github.com/mozilla/metrics-graphics/commit/38aea5bd77eb15a2f3e53acc1b0af1aac428fa81) - -#### [v2.2.0](https://github.com/mozilla/metrics-graphics/compare/v2.1.0...v2.2.0) -> 13 February 2015 -- Setting id on the clip-path [`#357`](https://github.com/mozilla/metrics-graphics/pull/357) -- Correcting plot-window clip path [`#356`](https://github.com/mozilla/metrics-graphics/pull/356) -- Fix JS comment syntax in code block [`#353`](https://github.com/mozilla/metrics-graphics/pull/353) -- Enable syntax highlighting [`#352`](https://github.com/mozilla/metrics-graphics/pull/352) -- Adds support for transition on confidence band [`#329`](https://github.com/mozilla/metrics-graphics/pull/329) -- Adds support for two markers in close proximity. [`#326`](https://github.com/mozilla/metrics-graphics/pull/326) -- Fix duplicate chart title on redraw [`#348`](https://github.com/mozilla/metrics-graphics/pull/348) -- Improved tween for line-chart path transitions [`#343`](https://github.com/mozilla/metrics-graphics/pull/343) -- Fixed resize on mobile device orientation change [`#338`](https://github.com/mozilla/metrics-graphics/pull/338) -- Cleanup [`#340`](https://github.com/mozilla/metrics-graphics/pull/340) -- Fix #276 [`#276`](https://github.com/mozilla/metrics-graphics/issues/276) -- Minor cleanup [`dd7517e`](https://github.com/mozilla/metrics-graphics/commit/dd7517ed6c47166246499179d5093de2d8fb4ddc) -- Update version number in footers [`a762638`](https://github.com/mozilla/metrics-graphics/commit/a7626382502dd8d8b8b8f5ad92a1bf58bf915302) -- Minor cleanup [`0b82511`](https://github.com/mozilla/metrics-graphics/commit/0b825114b1465fb4a8947dd572cbf92252811465) - -#### [v2.1.0](https://github.com/mozilla/metrics-graphics/compare/v2.0.0...v2.1.0) -> 22 January 2015 -- Working a little on that GPA [`#335`](https://github.com/mozilla/metrics-graphics/pull/335) -- dev environment improvements [`#334`](https://github.com/mozilla/metrics-graphics/pull/334) -- Linked minutes [`#325`](https://github.com/mozilla/metrics-graphics/pull/325) -- Changes order of drawing markers. Making the order same for each graph [`#330`](https://github.com/mozilla/metrics-graphics/pull/330) -- Development server [`#322`](https://github.com/mozilla/metrics-graphics/pull/322) -- Print a warning in the console when the target element cannot be found [`#327`](https://github.com/mozilla/metrics-graphics/pull/327) -- Added aggregate_rollover to defaults [`#241`](https://github.com/mozilla/metrics-graphics/pull/241) -- Aggregated rollover information [`#316`](https://github.com/mozilla/metrics-graphics/pull/316) -- Added .editorconfig for consistency across IDEs [`#321`](https://github.com/mozilla/metrics-graphics/pull/321) -- Fix possibly-undefined use of local `pp` variable. [`#312`](https://github.com/mozilla/metrics-graphics/pull/312) -- Adding code-climate badge [`#317`](https://github.com/mozilla/metrics-graphics/pull/317) -- travis-ci setup [`#315`](https://github.com/mozilla/metrics-graphics/pull/315) -- Fixing tests for PhantomJS [`#314`](https://github.com/mozilla/metrics-graphics/pull/314) -- Disable sourcemap reference generation [`#304`](https://github.com/mozilla/metrics-graphics/pull/304) -- modify gulp-umd config to add MG to root namespace [`#301`](https://github.com/mozilla/metrics-graphics/pull/301) -- Vertical bars [`#243`](https://github.com/mozilla/metrics-graphics/pull/243) -- add gulp-umd to build:js task [`#296`](https://github.com/mozilla/metrics-graphics/pull/296) -- closes #284 and makes some additional tweaks [`#284`](https://github.com/mozilla/metrics-graphics/issues/284) -- Fix #289, we'll need to file another bug for missing_is_zero [`#289`](https://github.com/mozilla/metrics-graphics/issues/289) -- Fix #289 - error when missing_is_zero is set and data length is 1 [`#289`](https://github.com/mozilla/metrics-graphics/issues/289) -- closes #102, at least for now. You can set full_width or full_height to be true to have the svg span the parent element and resize with it. [`#102`](https://github.com/mozilla/metrics-graphics/issues/102) -- Unit tests for histograms, points, utility.js (#306), fixes #318 [`#318`](https://github.com/mozilla/metrics-graphics/issues/318) -- Update stroke widths for markers and baselines [`5b47468`](https://github.com/mozilla/metrics-graphics/commit/5b47468e62a63ecb40ec926973a7e78c1ef2509f) -- Recent change made in PR #330 [`f069405`](https://github.com/mozilla/metrics-graphics/commit/f0694053fe764b2bc92afd828edc3ad4cc059cd5) -- merging missing chart changes [`a7f14aa`](https://github.com/mozilla/metrics-graphics/commit/a7f14aa567309960c0aded08ca3d01f6c4431127) - -### [v2.0.0](https://github.com/mozilla/metrics-graphics/compare/v1.1.0...v2.0.0) -> 24 December 2014 -- Added rollout_callback, inverse of rollover_callback [`#239`](https://github.com/mozilla/metrics-graphics/pull/239) -- Updated packages with dist [`#273`](https://github.com/mozilla/metrics-graphics/pull/273) -- Updated example references to use dist instead of lib [`#272`](https://github.com/mozilla/metrics-graphics/pull/272) -- Moved folder structure [`#268`](https://github.com/mozilla/metrics-graphics/pull/268) -- Test suite setup [`#259`](https://github.com/mozilla/metrics-graphics/pull/259) -- Fix DOM ordering for redrawn lines/areas [`#254`](https://github.com/mozilla/metrics-graphics/pull/254) -- Gulp tasks for checking and building js [`#233`](https://github.com/mozilla/metrics-graphics/pull/233) -- Fixes #255 - for lines, at least, specifying an array of arrays (as a single line) or an array of array-arrays (multiline) with list:true will work as you expect. [`#255`](https://github.com/mozilla/metrics-graphics/issues/255) -- v2.0 changes [`11c6477`](https://github.com/mozilla/metrics-graphics/commit/11c64776d8b3d2a2c149b1cb4447219059912f5e) -- Update README.md [`1fd9d61`](https://github.com/mozilla/metrics-graphics/commit/1fd9d618b5d9c5c78db99d976be85bffb6afd9a6) -- Update README.md [`e3df9f1`](https://github.com/mozilla/metrics-graphics/commit/e3df9f1861293a1fec8ae0c78d711566e655a6d7) - -#### v1.1.0 -> 1 December 2014 -- Update process.js [`#234`](https://github.com/mozilla/metrics-graphics/pull/234) -- Fixes #229: Removing area when switching between single- and multi-line chart data [`#230`](https://github.com/mozilla/metrics-graphics/pull/230) -- Add dependency directories to .gitignore [`#221`](https://github.com/mozilla/metrics-graphics/pull/221) -- Create initial package.json [`#220`](https://github.com/mozilla/metrics-graphics/pull/220) -- chore(readme): fix example code [`#218`](https://github.com/mozilla/metrics-graphics/pull/218) -- missing_text now an arg for the 'missing-data' chart [`#213`](https://github.com/mozilla/metrics-graphics/pull/213) -- feat(target): allow DOM&jQuery elements in target option [`#211`](https://github.com/mozilla/metrics-graphics/pull/211) -- Added a missing comma in the API example. [`#204`](https://github.com/mozilla/metrics-graphics/pull/204) -- Fix example code [`#194`](https://github.com/mozilla/metrics-graphics/pull/194) -- Typo [`#191`](https://github.com/mozilla/metrics-graphics/pull/191) -- Alternate Date/Timestamp Parsing Options [`#186`](https://github.com/mozilla/metrics-graphics/pull/186) -- Add LICENSE file to repository [`#187`](https://github.com/mozilla/metrics-graphics/pull/187) -- Log axis [`#127`](https://github.com/mozilla/metrics-graphics/pull/127) -- Fixes issue #98 [`#128`](https://github.com/mozilla/metrics-graphics/pull/128) -- Histogram TypeError [`#125`](https://github.com/mozilla/metrics-graphics/pull/125) -- fixes 121 [`#122`](https://github.com/mozilla/metrics-graphics/pull/122) -- Add code to fix y axis labels for small values. [`#96`](https://github.com/mozilla/metrics-graphics/pull/96) -- Allow specification of line interpolation method. [`#94`](https://github.com/mozilla/metrics-graphics/pull/94) -- Remove baselines before drawing. [`#95`](https://github.com/mozilla/metrics-graphics/pull/95) -- Fixes #229: Removing area when switching between single- and multi-line chart data [`#229`](https://github.com/mozilla/metrics-graphics/issues/229) -- fixes #219 - we now no longer need bootstrap.js, since I pulled out the dropdown code [`#219`](https://github.com/mozilla/metrics-graphics/issues/219) -- fixes #176 - we were doing some weird padding thing and I can't remember why, but I removed it and now the year label doesn't collide with the date above it for very long graphics [`#176`](https://github.com/mozilla/metrics-graphics/issues/176) -- closes #159 - @almossawi take a look at dev and let me know what you think. [`#159`](https://github.com/mozilla/metrics-graphics/issues/159) -- fixes #174 - multiline charts using a single array now only plots what data is available for each line [`#174`](https://github.com/mozilla/metrics-graphics/issues/174) -- fixes #153 - ls now works with dates on x and y variables as date. [`#153`](https://github.com/mozilla/metrics-graphics/issues/153) -- closes #112 @almossawi let me know what you think / if there are any stylistic changes to the css that need to be implemented. The axis lines look a little heavy ... [`#112`](https://github.com/mozilla/metrics-graphics/issues/112) -- fixes #113. We have some parsing out of the init functionality so we can separate precomputation steps in each chart type [`#113`](https://github.com/mozilla/metrics-graphics/issues/113) -- added log scale support for y axis - fixes #82 [`#82`](https://github.com/mozilla/metrics-graphics/issues/82) -- closes #84 - multiline accessor support [`#84`](https://github.com/mozilla/metrics-graphics/issues/84) -- fixes #77 - missing charts don't duplicate upon calling moz_chart again [`#77`](https://github.com/mozilla/metrics-graphics/issues/77) -- fixes #77 - forgot to check for zero values in the args.y_axis_negative check [`#77`](https://github.com/mozilla/metrics-graphics/issues/77) -- closes #68 - also rearranged the section on rollovers to include more examples [`#68`](https://github.com/mozilla/metrics-graphics/issues/68) -- closes #62 [`#62`](https://github.com/mozilla/metrics-graphics/issues/62) -- closes #56 - not entirely satisfactorily, but allows negative values for both axes if that is in the cards. [`#56`](https://github.com/mozilla/metrics-graphics/issues/56) -- closes #54 - provided args.decimals to control float issues, with default 2 [`#54`](https://github.com/mozilla/metrics-graphics/issues/54) -- closes #59 - year marker now dependent on xax_tick value [`#59`](https://github.com/mozilla/metrics-graphics/issues/59) -- closes #52 - if working with date range and beginning of any year does not appear, then the first tick will have the year underneath it, for reference. If there is a beginning of year, then this doesn't happen, since you can infer everything else from just one year marker. [`#52`](https://github.com/mozilla/metrics-graphics/issues/52) -- added small text functionality - closes #41 [`#41`](https://github.com/mozilla/metrics-graphics/issues/41) -- closes #45 - no more underscore. pow finito [`#45`](https://github.com/mozilla/metrics-graphics/issues/45) -- added the code and links to top corner - closes #28 [`#28`](https://github.com/mozilla/metrics-graphics/issues/28) -- closes #7 - chart titling and description are in the main moz_chart thing now. Everything handled in the init step. We may need to separate the init step since it is pretty generic. [`#7`](https://github.com/mozilla/metrics-graphics/issues/7) -- closes #20 [`#20`](https://github.com/mozilla/metrics-graphics/issues/20) -- closes #17 - years now optional [`#17`](https://github.com/mozilla/metrics-graphics/issues/17) -- closes #15 - changed arg from type to format [`#15`](https://github.com/mozilla/metrics-graphics/issues/15) -- closes #21 ... made goals arbitrary, and separated the markers function from the line chart, since we will be using this function generically for other things, like the axis ones [`#21`](https://github.com/mozilla/metrics-graphics/issues/21) -- Fixes #3 - args.markers is the way to add markers to a graph [`#3`](https://github.com/mozilla/metrics-graphics/issues/3) -- Update bower.json [`15a4703`](https://github.com/mozilla/metrics-graphics/commit/15a4703db568342043f156b5635d10b17ebe98cb) -- Fix issue #245 [`6402716`](https://github.com/mozilla/metrics-graphics/commit/6402716c3165eb90cdace5729a18706ea2921187) -- Minor cleanup [`22d9a35`](https://github.com/mozilla/metrics-graphics/commit/22d9a355155f297801ffacfd9986ddc6af588dee) - diff --git a/priv/static/metrics-graphics-3.0-alpha3/HOOKS.md b/priv/static/metrics-graphics-3.0-alpha3/HOOKS.md deleted file mode 100644 index 21522a4..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/HOOKS.md +++ /dev/null @@ -1,18 +0,0 @@ -# Hooks -### Global -| Name | args | Description | -|------|------|-------------| -| `global.defaults` | `defaults` | Passes the global defaults prior to merging with args and chart-specific defaults | -| `global.before_init` | `args` | Called before initializing a chart. Allows pre-processing of the arguments passed into `MG.data_graphic`. | -| `x_axis.process_min_max` | `args`, `min_x`, `max_x` | Called after calculating the min and max values for the X axis | -| `y_axis.process_min_max` | `args`, `min_y`, `max_y` | Called after calculating the min and max values for the Y axis | - -### Line -| Name | args | Description | Notes | -|------|------|-------------|-------| -| `line.after_init` | `lineChart` - chart descriptor | Called after intializing the chart | | -| `line.after_rollover` | `args` | Called after setting up the rollover | | -| `line.before_all_series` | `args` | Called before rendering the chart. | Returning `false` will prevent the default rendering process from being executed. | -| `line.before_each_series` | `data[i]` - The current data in the for loop <br /> `args` | Called within the render loop, before any other render takes place. | | -| `line.after_each_series` | `data[i]` - The current data in the for loop <br /> `args` | Called within the render loop, after the default render has taken place. | | -| `line.before_destroy` | `lineChart` - chart descriptor | Called before destroying the chart on a subsequent call to the same target element. | Available as of v2.10 | diff --git a/priv/static/metrics-graphics-3.0-alpha3/LICENSE b/priv/static/metrics-graphics-3.0-alpha3/LICENSE deleted file mode 100644 index be2cc4d..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/LICENSE +++ /dev/null @@ -1,362 +0,0 @@ -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. "Contributor" - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. "Contributor Version" - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the terms of - a Secondary License. - -1.6. "Executable Form" - - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - - means a work that combines Covered Software with other material, in a - separate file or files, that is not Covered Software. - -1.8. "License" - - means this document. - -1.9. "Licensable" - - means having the right to grant, to the maximum extent possible, whether - at the time of the initial grant or subsequently, any and all of the - rights conveyed by this License. - -1.10. "Modifications" - - means any of the following: - - a. any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. "Patent Claims" of a Contributor - - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the License, - by the making, using, selling, offering for sale, having made, import, - or transfer of either its Contributions or its Contributor Version. - -1.12. "Secondary License" - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. "Source Code Form" - - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, "control" means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution - become effective for each Contribution on the date the Contributor first - distributes such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under - this License. No additional rights or licenses will be implied from the - distribution or licensing of Covered Software under this License. - Notwithstanding Section 2.1(b) above, no patent license is granted by a - Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of - its Contributions. - - This License does not grant any rights in the trademarks, service marks, - or logos of any Contributor (except as may be necessary to comply with - the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this - License (see Section 10.2) or under the terms of a Secondary License (if - permitted under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its - Contributions are its original creation(s) or it has sufficient rights to - grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under - applicable copyright doctrines of fair use, fair dealing, or other - equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under - the terms of this License. You must inform recipients that the Source - Code Form of the Covered Software is governed by the terms of this - License, and how they can obtain a copy of this License. You may not - attempt to alter or restrict the recipients' rights in the Source Code - Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter the - recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for - the Covered Software. If the Larger Work is a combination of Covered - Software with a work governed by one or more Secondary Licenses, and the - Covered Software is not Incompatible With Secondary Licenses, this - License permits You to additionally distribute such Covered Software - under the terms of such Secondary License(s), so that the recipient of - the Larger Work may, at their option, further distribute the Covered - Software under the terms of either this License or such Secondary - License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices - (including copyright notices, patent notices, disclaimers of warranty, or - limitations of liability) contained within the Source Code Form of the - Covered Software, except that You may alter any license notices to the - extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on - behalf of any Contributor. You must make it absolutely clear that any - such warranty, support, indemnity, or liability obligation is offered by - You alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, - judicial order, or regulation then You must: (a) comply with the terms of - this License to the maximum extent possible; and (b) describe the - limitations and the code they affect. Such description must be placed in a - text file included with all distributions of the Covered Software under - this License. Except to the extent prohibited by statute or regulation, - such description must be sufficiently detailed for a recipient of ordinary - skill to be able to understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing - basis, if such Contributor fails to notify You of the non-compliance by - some reasonable means prior to 60 days after You have come back into - compliance. Moreover, Your grants from a particular Contributor are - reinstated on an ongoing basis if such Contributor notifies You of the - non-compliance by some reasonable means, this is the first time You have - received notice of non-compliance with this License from such - Contributor, and You become compliant prior to 30 days after Your receipt - of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, - counter-claims, and cross-claims) alleging that a Contributor Version - directly or indirectly infringes any patent, then the rights granted to - You by any and all Contributors for the Covered Software under Section - 2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an "as is" basis, - without warranty of any kind, either expressed, implied, or statutory, - including, without limitation, warranties that the Covered Software is free - of defects, merchantable, fit for a particular purpose or non-infringing. - The entire risk as to the quality and performance of the Covered Software - is with You. Should any Covered Software prove defective in any respect, - You (not any Contributor) assume the cost of any necessary servicing, - repair, or correction. This disclaimer of warranty constitutes an essential - part of this License. No use of any Covered Software is authorized under - this License except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from - such party's negligence to the extent applicable law prohibits such - limitation. Some jurisdictions do not allow the exclusion or limitation of - incidental or consequential damages, so this exclusion and limitation may - not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts - of a jurisdiction where the defendant maintains its principal place of - business and such litigation shall be governed by laws of that - jurisdiction, without reference to its conflict-of-law provisions. Nothing - in this Section shall prevent a party's ability to bring cross-claims or - counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. Any law or regulation which provides that - the language of a contract shall be construed against the drafter shall not - be used to construe this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version - of the License under which You originally received the Covered Software, - or under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a - modified version of this License if you rename the license and remove - any references to the name of the license steward (except to note that - such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary - Licenses If You choose to distribute Source Code Form that is - Incompatible With Secondary Licenses under the terms of this version of - the License, the notice described in Exhibit B of this License must be - attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, -then You may include the notice in a location (such as a LICENSE file in a -relevant directory) where a recipient would be likely to look for such a -notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice - - This Source Code Form is "Incompatible - With Secondary Licenses", as defined by - the Mozilla Public License, v. 2.0. diff --git a/priv/static/metrics-graphics-3.0-alpha3/README.md b/priv/static/metrics-graphics-3.0-alpha3/README.md deleted file mode 100644 index 951da94..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/README.md +++ /dev/null @@ -1,146 +0,0 @@ -[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0) [![Build Status][travis-badge]][travis-badge-url] [![CDNJS](https://img.shields.io/cdnjs/v/metrics-graphics.svg)](https://cdnjs.com/libraries/metrics-graphics) - -<a href="http://metricsgraphicsjs.org/"><img src="http://metricsgraphicsjs.org/images/logo.svg" hspace="0" vspace="0" width="400" height="63"></a> - -_MetricsGraphics.js_ is a library optimized for visualizing and laying out time-series data. At under 80KB (minified), it provides a simple way to produce common types of graphics in a principled and consistent way. The library currently supports line charts, scatterplots, histograms, bar charts and data tables, as well as features like rug plots and basic linear regression. - -A sample set of examples may be found on [the examples page](http://metricsgraphicsjs.org). The example below demonstrates how easy it is to produce a graphic. Our graphics function provides a robust layer of indirection, allowing one to more efficiently build, say, a dashboard of interactive graphics, each of which may be pulling data from a different data source. For the complete list of options, and for download instructions, [take a look at the sections below](https://github.com/metricsgraphics/metrics-graphics/wiki). - -```js -MG.data_graphic({ - title: 'Downloads', - description: 'This graphics shows Firefox GA downloads for the past six months.', - data: downloads_data, // an array of objects, such as [{value:100,date:...},...] - width: 600, - height: 250, - target: '#downloads', // the html element that the graphic is inserted in - x_accessor: 'date', // the key that accesses the x value - y_accessor: 'value' // the key that accesses the y value -}) -``` - -The API is simple. All that's needed to create a graphic is to specify a few default parameters and then, if desired, override one or more of the [optional parameters on offer](https://github.com/metricsgraphics/metrics-graphics/wiki/List-of-Options). We don't maintain state. In order to update a graphic, one would call _MG.data_graphic_ on the same target element. - -The library is data-source agnostic. While it provides a number of convenience functions and options that allow for graphics to better handle things like missing observations, it doesn't care where the data comes from. - -Though originally envisioned for Mozilla Metrics dashboard projects, we are making this repository public for others to use, knowing full well that we are far from having this project in good-enough shape. Take a look at the issues to see the milestones and other upcoming work on this repository. We are currently using semantic versioning. - -<a href="http://metricsgraphicsjs.org">http://metricsgraphicsjs.org</a> - -## Important changes in v2.10 -The library now depends on D3 4.x. The impact on MG users is minimal, though if you do use D3 for other work, here is the [list of changes](https://github.com/d3/d3/blob/master/CHANGES.md) from 3.x to 4.x. Please refer to the [release notes](https://github.com/metricsgraphics/metrics-graphics/releases/tag/v2.10.0) for further details. - -## Important changes in v2.0 -1. The library is now namespaced. ``data_graphic`` is now ``MG.data_graphic``, ``convert_dates`` is now ``MG.convert.date``, ``clone`` is now ``MG.clone``, ``button_layout`` is now ``MG.button_layout`` and ``data_table`` is now ``MG.data_table``. We added a new convenience function called ``MG.convert.number``. -2. The ``rollover_callback`` option has been renamed ``mouseover`` and expanded in order to make it more consistent with other libraries. We now have three callback functions available: [mouseover](https://github.com/metricsgraphics/metrics-graphics/wiki/Graphic#mouseover), [mouseout](https://github.com/metricsgraphics/metrics-graphics/wiki/Graphic#mouseout) and [mousemove](https://github.com/metricsgraphics/metrics-graphics/wiki/Graphic#mousemove). -3. CSS rules have been prefixed and in some cases updated for consistency. ``active_datapoint`` for instance is now ``mg-active-datapoint``. - -## Quick-start guide -1. Download the [latest release](https://github.com/metricsgraphics/metrics-graphics/releases). -2. Follow the examples [here](https://github.com/metricsgraphics/metrics-graphics/blob/master/examples/index.htm) and [here](https://github.com/metricsgraphics/metrics-graphics/blob/master/examples/js/main.js) to see how graphics are laid out and built. The examples use JSON data from [examples/data](https://github.com/metricsgraphics/metrics-graphics/blob/master/examples/data), though you may easily pull data from elsewhere. - -## Dependencies -The library depends on [D3](http://d3js.org). If you wish to enable tooltips or use [buttons](https://github.com/metricsgraphics/metrics-graphics/wiki/Button-Layout), please include [jQuery](http://jquery.com/) as well. Versions of MG older than v2.10 depend on D3 3, whereas MG v2.10 onwards depend on D3 4. - -## Contributing -If you would like to help extend MetricsGraphics.js or fix bugs, please [fork the library](https://github.com/metricsgraphics/metrics-graphics) and install [Node.js](http://nodejs.org). Then, from the project's root directory install [gulp](http://gulpjs.com): - - npm install gulp - -Then, install the library's dependencies: - - npm install - -To build the library from source, type: - - gulp build:js - -To run tests, type: - - gulp test - -We have a basic development environment which uses the project source to -serve up an interactive example. To run it, type: - - gulp serve - -A development server will be available at http://localhost:4300. Just reload -it as you make modifications to the files in `src/` -- any changes made to -the example source and data should be preserved. - -The website [metricsgraphicsjs.org](https://metricsgraphicsjs.org) is automatically -uploaded/updated by travis ci when a new tag is created (corresponding to a -new release). It is served from github pages using a [netlify](https://netlify.com) -configuration maintained and controlled by [William Lachance](https://github.com/wlach/). - -You might also be interested in writing addons for the library, in which case, [have a read through this page](https://github.com/metricsgraphics/metrics-graphics/wiki/Developing-Addons). - -## Getting in touch - -If you have any questions about metrics graphics (either as a user or contributor), the best place to ask is the [#metricsgraphics](https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23metricsgraphics) channel on irc.mozilla.org ([learn more about irc @ Mozilla](https://wiki.mozilla.org/IRC)). - -## Resources -* [Examples](http://metricsgraphicsjs.org/examples.htm) -* [Interactive demo](http://metricsgraphicsjs.org/interactive-demo.htm) -* [List of options](https://github.com/metricsgraphics/metrics-graphics/wiki/List-of-Options) -* [Convenience functions](https://github.com/metricsgraphics/metrics-graphics/wiki/Convenience-Functions) -* [Hooks](https://github.com/metricsgraphics/metrics-graphics/blob/master/HOOKS.md) -* [Chart types](https://github.com/metricsgraphics/metrics-graphics/wiki/Chart-Types) -* [Developing addons](https://github.com/metricsgraphics/metrics-graphics/wiki/Developing-Addons) -* [Building a button layout](https://github.com/metricsgraphics/metrics-graphics/wiki/Button-Layout) - -## Download package -The download package includes everything that you see on [metricsgraphicsjs.org](http://metricsgraphicsjs.org). In order to use the library in your own project, the only files that you'll need are the ones under ``dist``. Remember to load ``D3`` and ``jQuery``. If you don't care about tooltips or the button layout, you won't need the latter. If your project uses Bootstrap, make sure you load MetricsGraphics.js after it. - -## Frequently asked questions -__What does MetricsGraphics.js do that library x doesn't do?__ - -If library x works for you, you should keep using it. We're not aiming to be competitive with libraries that already exist. We're aiming to make a library that meets our needs. We also happen to think that the world _needs_ a principled data presentation library, and that many of our needs are the same as other folks'. - -__I only see colours for the first 10 lines in my chart, what gives?__ - -The colors for the first ten lines, areas and legends are defined in the stylesheet for the light and dark themes. For an eleventh line, you would add the following CSS rules: - - -```css -.mg-line11-color { - stroke: lightpink; -} - -.mg-area11-color { - fill: lightpink; -} - -.mg-hover-line11-color { - fill: lightpink; -} - -.mg-line11-legend-color { - color: lightpink; -} -``` - -If you're plotting more than five lines in the same chart and using _color_ to encode some dimension of the data, then you probably need to rethink the chart. - -__I get an error when I load MG alongside library x__ - -If your project uses Bootstrap, make sure you load MetricsGraphics.js after it. If your project uses jQuery UI, load it after MetricsGraphics.js. - -## Gallery -Feel free to add your addons and websites to this list. -* [mg-color-scale (addon)](https://github.com/dandehavilland/mg-color-scale) -* [mg-line-brushing (addon)](https://github.com/dandehavilland/mg-line-brushing) -* [mg-regions (addon)](https://github.com/senseyeio/mg-regions) -* [Rails wrapper gem](https://github.com/dgilperez/metrics-graphics-rails) -* [R package (htmlwidget)](https://github.com/hrbrmstr/metricsgraphics) -* [Python library - using Pyxley](http://multithreaded.stitchfix.com/blog/2015/07/16/pyxley) -* [Angular directive](https://github.com/elmarquez/angular-metrics-graphics) -* [React component](https://github.com/metricsgraphics/react-metrics-graphics) - -## License - -The __MetricsGraphics.js__ code is shared under the terms of the [Mozilla Public License v2.0](http://www.mozilla.org/MPL/2.0/). See the `LICENSE` file at the root of the repository. The current logo is courtesy of [Font Awesome](http://fortawesome.github.io/Font-Awesome/). - - -[travis-badge]: https://travis-ci.org/metricsgraphics/metrics-graphics.svg?branch=master -[travis-badge-url]: https://travis-ci.org/metricsgraphics/metrics-graphics diff --git a/priv/static/metrics-graphics-3.0-alpha3/bower.json b/priv/static/metrics-graphics-3.0-alpha3/bower.json deleted file mode 100644 index ef5844b..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/bower.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "metrics-graphics", - "main": [ - "dist/metricsgraphics.js", - "dist/metricsgraphics.css" - ], - "dependencies": { - "d3": ">=4" - }, - "ignore": [ - ".DS_Store", - ".git", - ".gitignore", - "examples", - "gulp", - "gulpfile.js", - "index.js", - "node_modules", - "package.json", - "src", - "testem.json", - "tests" - ], - "license": "MPL-2.0", - "authors": [ - "Ali Almossawi", "Ali Almossawi (http://twitter.com/alialmossawi)>", - "Hamilton Ulmer", "Hamilton Ulmer (http://twitter.com/hamiltonulmer)>" - ], - "homepage": "http://metricsgraphicsjs.org", - "repository": { - "type": "git", - "url": "git://github.com/metricsgraphics/metrics-graphics.git" - }, - "keywords": [ - "metrics-graphics", - "metricsgraphicsjs", - "metricsgraphics", - "metricsgraphics.js", - "d3 charts" - ] -} diff --git a/priv/static/metrics-graphics-3.0-alpha3/contribute.json b/priv/static/metrics-graphics-3.0-alpha3/contribute.json deleted file mode 100644 index 6213da5..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/contribute.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "MetricsGraphics.js", - "description": "A library optimized for concise, principled data graphics and layouts.", - "repository": { - "url": "https://github.com/metricsgraphics/metrics-graphics", - "license": "MPL2", - "tests": "https://travis-ci.org/metricsgraphics/metrics-graphics/" - }, - "participate": { - "home": "http://metricsgraphicsjs.org/", - "docs": "https://github.com/metricsgraphics/metrics-graphics/wiki#resources", - "irc": "irc://irc.mozilla.org/#metricsgraphics", - "irc-contacts": [ - "almossawi", - "hulmer", - "wlach" - ] - }, - "bugs": { - "list": "https://github.com/metricsgraphics/metrics-graphics/issues", - "report": "https://github.com/metricsgraphics/metrics-graphics/issues/new", - "mentored": "https://github.com/metricsgraphics/metrics-graphics/labels/help%20wanted" - }, - "keywords": [ - "nodejs", - "d3", - "data", - "graphics" - ] -} diff --git a/priv/static/metrics-graphics-3.0-alpha3/dist/metricsgraphics.js b/priv/static/metrics-graphics-3.0-alpha3/dist/metricsgraphics.js deleted file mode 100644 index a0f7f22..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/dist/metricsgraphics.js +++ /dev/null @@ -1,7697 +0,0 @@ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - define(['d3'], factory); - } else if (typeof exports === 'object') { - module.exports = factory(require('d3')); - } else { - root.MG = factory(root.d3); - } -}(this, function(d3) { -'use strict'; - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -(typeof window === 'undefined' ? global : window).MG = { version: '2.11' }; - -//a set of helper functions, some that we've written, others that we've borrowed - -MG.convert = {}; - -MG.convert.date = function (data, accessor, time_format) { - time_format = typeof time_format === "undefined" ? '%Y-%m-%d' : time_format; - var parse_time = d3.timeParse(time_format); - data = data.map(function (d) { - d[accessor] = parse_time(d[accessor].trim()); - return d; - }); - - return data; -}; - -MG.convert.number = function (data, accessor) { - data = data.map(function (d) { - d[accessor] = Number(d[accessor]); - return d; - }); - - return data; -}; - -MG.time_format = function (utc, specifier) { - return utc ? d3.utcFormat(specifier) : d3.timeFormat(specifier); -}; - -function mg_jquery_exists() { - if (typeof jQuery !== 'undefined' || typeof $ !== 'undefined') { - return true; - } else { - return false; - } -} - -function mg_get_rollover_time_format(args) { - // if a rollover time format is defined, use that - if (args.rollover_time_format) { - return MG.time_format(args.utc_time, args.rollover_time_format); - } - - switch (args.processed.x_time_frame) { - case 'millis': - return MG.time_format(args.utc_time, '%b %e, %Y %H:%M:%S.%L'); - case 'seconds': - return MG.time_format(args.utc_time, '%b %e, %Y %H:%M:%S'); - case 'less-than-a-day': - return MG.time_format(args.utc_time, '%b %e, %Y %I:%M%p'); - case 'four-days': - return MG.time_format(args.utc_time, '%b %e, %Y %I:%M%p'); - } - - // default - return MG.time_format(args.utc_time, '%b %e, %Y'); -} - -function mg_data_in_plot_bounds(datum, args) { - return datum[args.x_accessor] >= args.processed.min_x && datum[args.x_accessor] <= args.processed.max_x && datum[args.y_accessor] >= args.processed.min_y && datum[args.y_accessor] <= args.processed.max_y; -} - -function is_array(thing) { - return Object.prototype.toString.call(thing) === '[object Array]'; -} - -function is_function(thing) { - return Object.prototype.toString.call(thing) === '[object Function]'; -} - -function is_empty_array(thing) { - return is_array(thing) && thing.length === 0; -} - -function is_object(thing) { - return Object.prototype.toString.call(thing) === '[object Object]'; -} - -function is_array_of_arrays(data) { - var all_elements = data.map(function (d) { - return is_array(d) === true && d.length > 0; - }); - - return d3.sum(all_elements) === data.length; -} - -function is_array_of_objects(data) { - // is every element of data an object? - var all_elements = data.map(function (d) { - return is_object(d) === true; - }); - - return d3.sum(all_elements) === data.length; -} - -function is_array_of_objects_or_empty(data) { - return is_empty_array(data) || is_array_of_objects(data); -} - -function pluck(arr, accessor) { - return arr.map(function (d) { - return d[accessor]; - }); -} - -function count_array_elements(arr) { - return arr.reduce(function (a, b) { - a[b] = a[b] + 1 || 1; - return a; - }, {}); -} - -function mg_get_bottom(args) { - return args.height - args.bottom; -} - -function mg_get_plot_bottom(args) { - // returns the pixel location of the bottom side of the plot area. - return mg_get_bottom(args) - args.buffer; -} - -function mg_get_top(args) { - return args.top; -} - -function mg_get_plot_top(args) { - // returns the pixel location of the top side of the plot area. - return mg_get_top(args) + args.buffer; -} - -function mg_get_left(args) { - return args.left; -} - -function mg_get_plot_left(args) { - // returns the pixel location of the left side of the plot area. - return mg_get_left(args) + args.buffer; -} - -function mg_get_right(args) { - return args.width - args.right; -} - -function mg_get_plot_right(args) { - // returns the pixel location of the right side of the plot area. - return mg_get_right(args) - args.buffer; -} - -//////// adding elements, removing elements ///////////// - -function mg_exit_and_remove(elem) { - elem.exit().remove(); -} - -function mg_selectAll_and_remove(svg, cl) { - svg.selectAll(cl).remove(); -} - -function mg_add_g(svg, cl) { - return svg.append('g').classed(cl, true); -} - -function mg_remove_element(svg, elem) { - svg.select(elem).remove(); -} - -//////// axis helper functions //////////// - -function mg_make_rug(args, rug_class) { - var svg = mg_get_svg_child_of(args.target); - var all_data = mg_flatten_array(args.data); - var rug = svg.selectAll('line.' + rug_class).data(all_data); - - rug.enter().append('line').attr('class', rug_class).attr('opacity', 0.3); - - //remove rug elements that are no longer in use - mg_exit_and_remove(rug); - - //set coordinates of new rug elements - mg_exit_and_remove(rug); - return rug; -} - -function mg_add_color_accessor_to_rug(rug, args, rug_mono_class) { - if (args.color_accessor) { - rug.attr('stroke', args.scalefns.colorf); - rug.classed(rug_mono_class, false); - } else { - rug.attr('stroke', null); - rug.classed(rug_mono_class, true); - } -} - -function mg_rotate_labels(labels, rotation_degree) { - if (rotation_degree) { - labels.attr({ - dy: 0, - transform: function transform() { - var elem = d3.select(this); - return 'rotate(' + rotation_degree + ' ' + elem.attr('x') + ',' + elem.attr('y') + ')'; - } - }); - } -} - -////////////////////////////////////////////////// - -function mg_elements_are_overlapping(labels) { - labels = labels.node(); - if (!labels) { - return false; - } - - for (var i = 0; i < labels.length; i++) { - if (mg_is_horizontally_overlapping(labels[i], labels)) return true; - } - - return false; -} - -function mg_prevent_horizontal_overlap(labels, args) { - if (!labels || labels.length == 1) { - return; - } - - //see if each of our labels overlaps any of the other labels - for (var i = 0; i < labels.length; i++) { - //if so, nudge it up a bit, if the label it intersects hasn't already been nudged - if (mg_is_horizontally_overlapping(labels[i], labels)) { - var node = d3.select(labels[i]); - var newY = +node.attr('y'); - if (newY + 8 >= args.top) { - newY = args.top - 16; - } - node.attr('y', newY); - } - } -} - -function mg_prevent_vertical_overlap(labels, args) { - if (!labels || labels.length == 1) { - return; - } - - labels.sort(function (b, a) { - return d3.select(a).attr('y') - d3.select(b).attr('y'); - }); - - labels.reverse(); - - var overlap_amount, label_i, label_j; - - //see if each of our labels overlaps any of the other labels - for (var i = 0; i < labels.length; i++) { - //if so, nudge it up a bit, if the label it intersects hasn't already been nudged - label_i = d3.select(labels[i]).text(); - - for (var j = 0; j < labels.length; j++) { - label_j = d3.select(labels[j]).text(); - overlap_amount = mg_is_vertically_overlapping(labels[i], labels[j]); - - if (overlap_amount !== false && label_i !== label_j) { - var node = d3.select(labels[i]); - var newY = +node.attr('y'); - newY = newY + overlap_amount; - node.attr('y', newY); - } - } - } -} - -function mg_is_vertically_overlapping(element, sibling) { - var element_bbox = element.getBoundingClientRect(); - var sibling_bbox = sibling.getBoundingClientRect(); - - if (element_bbox.top <= sibling_bbox.bottom && element_bbox.top >= sibling_bbox.top) { - return sibling_bbox.bottom - element_bbox.top; - } - - return false; -} - -function mg_is_horiz_overlap(element, sibling) { - var element_bbox = element.getBoundingClientRect(); - var sibling_bbox = sibling.getBoundingClientRect(); - - if (element_bbox.right >= sibling_bbox.left || element_bbox.top >= sibling_bbox.top) { - return sibling_bbox.bottom - element_bbox.top; - } - return false; -} - -function mg_is_horizontally_overlapping(element, labels) { - var element_bbox = element.getBoundingClientRect(); - - for (var i = 0; i < labels.length; i++) { - if (labels[i] == element) { - continue; - } - - //check to see if this label overlaps with any of the other labels - var sibling_bbox = labels[i].getBoundingClientRect(); - if (element_bbox.top === sibling_bbox.top && !(sibling_bbox.left > element_bbox.right || sibling_bbox.right < element_bbox.left)) { - return true; - } - } - - return false; -} - -function mg_infer_type(args, ns) { - // must return categorical or numerical. - var testPoint = mg_flatten_array(args.data); - - testPoint = testPoint[0][args[ns + '_accessor']]; - return typeof testPoint === 'string' ? 'categorical' : 'numerical'; -} - -function mg_get_svg_child_of(selector_or_node) { - return d3.select(selector_or_node).select('svg'); -} - -function mg_flatten_array(arr) { - var flat_data = []; - return flat_data.concat.apply(flat_data, arr); -} - -function mg_next_id() { - if (typeof MG._next_elem_id === 'undefined') { - MG._next_elem_id = 0; - } - - return 'mg-' + MG._next_elem_id++; -} - -function mg_target_ref(target) { - if (typeof target === 'string') { - return mg_normalize(target); - } else if (target instanceof window.HTMLElement) { - var target_ref = target.getAttribute('data-mg-uid'); - if (!target_ref) { - target_ref = mg_next_id(); - target.setAttribute('data-mg-uid', target_ref); - } - - return target_ref; - } else { - console.warn('The specified target should be a string or an HTMLElement.', target); - return mg_normalize(target); - } -} - -function mg_normalize(string) { - return string.replace(/[^a-zA-Z0-9 _-]+/g, '').replace(/ +?/g, ''); -} - -function get_pixel_dimension(target, dimension) { - return Number(d3.select(target).style(dimension).replace(/px/g, '')); -} - -function get_width(target) { - return get_pixel_dimension(target, 'width'); -} - -function get_height(target) { - return get_pixel_dimension(target, 'height'); -} - -function isNumeric(n) { - return !isNaN(parseFloat(n)) && isFinite(n); -} - -var each = function each(obj, iterator, context) { - // yanked out of underscore - var breaker = {}; - if (obj === null) return obj; - if (Array.prototype.forEach && obj.forEach === Array.prototype.forEach) { - obj.forEach(iterator, context); - } else if (obj.length === +obj.length) { - for (var i = 0, length = obj.length; i < length; i++) { - if (iterator.call(context, obj[i], i, obj) === breaker) return; - } - } else { - for (var k in obj) { - if (iterator.call(context, obj[k], k, obj) === breaker) return; - } - } - - return obj; -}; - -function merge_with_defaults(obj) { - // taken from underscore - each(Array.prototype.slice.call(arguments, 1), function (source) { - if (source) { - for (var prop in source) { - if (obj[prop] === void 0) obj[prop] = source[prop]; - } - } - }); - - return obj; -} - -MG.merge_with_defaults = merge_with_defaults; - -function number_of_values(data, accessor, value) { - var values = data.filter(function (d) { - return d[accessor] === value; - }); - - return values.length; -} - -function has_values_below(data, accessor, value) { - var values = data.filter(function (d) { - return d[accessor] <= value; - }); - - return values.length > 0; -} - -function has_too_many_zeros(data, accessor, zero_count) { - return number_of_values(data, accessor, 0) >= zero_count; -} - -function mg_is_date(obj) { - return Object.prototype.toString.call(obj) === '[object Date]'; -} - -function mg_is_object(obj) { - return Object.prototype.toString.call(obj) === '[object Object]'; -} - -function mg_is_array(obj) { - if (Array.isArray) { - return Array.isArray(obj); - } - - return Object.prototype.toString.call(obj) === '[object Array]'; -} - -function mg_is_function(obj) { - return Object.prototype.toString.call(obj) === '[object Function]'; -} - -// deep copy -// http://stackoverflow.com/questions/728360/most-elegant-way-to-clone-a-javascript-object -MG.clone = function (obj) { - var copy; - - // Handle the 3 simple types, and null or undefined - if (null === obj || "object" !== (typeof obj === 'undefined' ? 'undefined' : _typeof(obj))) return obj; - - // Handle Date - if (mg_is_date(obj)) { - copy = new Date(); - copy.setTime(obj.getTime()); - return copy; - } - - // Handle Array - if (mg_is_array(obj)) { - copy = []; - for (var i = 0, len = obj.length; i < len; i++) { - copy[i] = MG.clone(obj[i]); - } - return copy; - } - - // Handle Object - if (mg_is_object(obj)) { - copy = {}; - for (var attr in obj) { - if (obj.hasOwnProperty(attr)) copy[attr] = MG.clone(obj[attr]); - } - return copy; - } - - throw new Error("Unable to copy obj! Its type isn't supported."); -}; - -// give us the difference of two int arrays -// http://radu.cotescu.com/javascript-diff-function/ -function arr_diff(a, b) { - var seen = [], - diff = [], - i; - for (i = 0; i < b.length; i++) { - seen[b[i]] = true; - }for (i = 0; i < a.length; i++) { - if (!seen[a[i]]) diff.push(a[i]); - }return diff; -} - -MG.arr_diff = arr_diff; - -/** - Print warning message to the console when a feature has been scheduled for removal - - @author Dan de Havilland (github.com/dandehavilland) - @date 2014-12 -*/ -function warn_deprecation(message, untilVersion) { - console.warn('Deprecation: ' + message + (untilVersion ? '. This feature will be removed in ' + untilVersion + '.' : ' the near future.')); - console.trace(); -} - -MG.warn_deprecation = warn_deprecation; - -/** - Truncate a string to fit within an SVG text node - CSS text-overlow doesn't apply to SVG <= 1.2 - - @author Dan de Havilland (github.com/dandehavilland) - @date 2014-12-02 -*/ -function truncate_text(textObj, textString, width) { - var bbox, - position = 0; - - textObj.textContent = textString; - bbox = textObj.getBBox(); - - while (bbox.width > width) { - textObj.textContent = textString.slice(0, --position) + '...'; - bbox = textObj.getBBox(); - - if (textObj.textContent === '...') { - break; - } - } -} - -MG.truncate_text = truncate_text; - -/** - Wrap the contents of a text node to a specific width - - Adapted from bl.ocks.org/mbostock/7555321 - - @author Mike Bostock - @author Dan de Havilland - @date 2015-01-14 -*/ -function wrap_text(text, width, token, tspanAttrs) { - text.each(function () { - var text = d3.select(this), - words = text.text().split(token || /\s+/).reverse(), - word, - line = [], - lineNumber = 0, - lineHeight = 1.1, - // ems - y = text.attr("y"), - dy = 0, - tspan = text.text(null).append("tspan").attr("x", 0).attr("y", dy + "em").attr(tspanAttrs || {}); - - while (!!(word = words.pop())) { - line.push(word); - tspan.text(line.join(" ")); - if (width === null || tspan.node().getComputedTextLength() > width) { - line.pop(); - tspan.text(line.join(" ")); - line = [word]; - tspan = text.append("tspan").attr("x", 0).attr("y", ++lineNumber * lineHeight + dy + "em").attr(tspanAttrs || {}).text(word); - } - } - }); -} - -MG.wrap_text = wrap_text; - -function register(chartType, descriptor, defaults) { - MG.charts[chartType] = { - descriptor: descriptor, - defaults: defaults || {} - }; -} - -MG.register = register; - -/** - Record of all registered hooks. - For internal use only. -*/ -MG._hooks = {}; - -/** - Add a hook callthrough to the stack. - - Hooks are executed in the order that they were registered. -*/ -MG.add_hook = function (name, func, context) { - var hooks; - - if (!MG._hooks[name]) { - MG._hooks[name] = []; - } - - hooks = MG._hooks[name]; - - var already_registered = hooks.filter(function (hook) { - return hook.func === func; - }).length > 0; - - if (already_registered) { - throw 'That function is already registered.'; - } - - hooks.push({ - func: func, - context: context - }); -}; - -/** - Execute registered hooks. - - Optional arguments -*/ -MG.call_hook = function (name) { - var hooks = MG._hooks[name], - result = [].slice.apply(arguments, [1]), - processed; - - if (hooks) { - hooks.forEach(function (hook) { - if (hook.func) { - var params = processed || result; - - if (params && params.constructor !== Array) { - params = [params]; - } - - params = [].concat.apply([], params); - processed = hook.func.apply(hook.context, params); - } - }); - } - - return processed || result; -}; - -MG.globals = {}; -MG.deprecations = { - rollover_callback: { replacement: 'mouseover', version: '2.0' }, - rollout_callback: { replacement: 'mouseout', version: '2.0' }, - x_rollover_format: { replacement: 'x_mouseover', version: '2.10' }, - y_rollover_format: { replacement: 'y_mouseover', version: '2.10' }, - show_years: { replacement: 'show_secondary_x_label', version: '2.1' }, - xax_start_at_min: { replacement: 'axes_not_compact', version: '2.7' }, - interpolate_tension: { replacement: 'interpolate', version: '2.10' } -}; -MG.globals.link = false; -MG.globals.version = "1.1"; - -MG.charts = {}; - -MG.data_graphic = function (args) { - 'use strict'; - - var defaults = { - missing_is_zero: false, // if true, missing values will be treated as zeros - missing_is_hidden: false, // if true, missing values will appear as broken segments - missing_is_hidden_accessor: null, // the accessor that determines the boolean value for missing data points - legend: '', // an array identifying the labels for a chart's lines - legend_target: '', // if set, the specified element is populated with a legend - error: '', // if set, a graph will show an error icon and log the error to the console - animate_on_load: false, // animate lines on load - top: 65, // the size of the top margin - title_y_position: 10, // how many pixels from the top edge (0) should we show the title at - center_title_full_width: false, // center the title over the full graph (i.e. ignore left and right margins) - bottom: 45, // the size of the bottom margin - right: 10, // size of the right margin - left: 50, // size of the left margin - buffer: 8, // the buffer between the actual chart area and the margins - width: 350, // the width of the entire graphic - height: 220, // the height of the entire graphic - full_width: false, // sets the graphic width to be the width of the parent element and resizes dynamically - full_height: false, // sets the graphic width to be the width of the parent element and resizes dynamically - small_height_threshold: 120, // the height threshold for when smaller text appears - small_width_threshold: 160, // the width threshold for when smaller text appears - xax_count: 6, // number of x axis ticks - xax_tick_length: 5, // x axis tick length - axes_not_compact: true, - yax_count: 3, // number of y axis ticks - yax_tick_length: 5, // y axis tick length - x_extended_ticks: false, // extends x axis ticks across chart - useful for tall charts - y_extended_ticks: false, // extends y axis ticks across chart - useful for long charts - y_scale_type: 'linear', - max_x: null, - max_y: null, - min_x: null, - min_y: null, // if set, y axis starts at an arbitrary value - min_y_from_data: false, // if set, y axis will start at minimum value rather than at 0 - point_size: 2.5, // the size of the dot that appears on a line on mouse-over - active_point_on_lines: false, // if set, active dot on lines will be displayed. - active_point_accessor: 'active', // data accessor value to determine if a point is active or not - active_point_size: 2, // the size of the dot that appears on a line when - points_always_visible: false, // whether to always display data points and not just on hover - x_accessor: 'date', - xax_units: '', - x_label: '', - x_sort: true, - x_axis: true, - y_axis: true, - x_axis_position: 'bottom', - y_axis_position: 'left', - x_axis_type: null, // TO BE INTRODUCED IN 2.10 - y_axis_type: null, // TO BE INTRODUCED IN 2.10 - ygroup_accessor: null, - xgroup_accessor: null, - y_padding_percentage: 0.05, // for categorical scales - y_outer_padding_percentage: 0.1, // for categorical scales - ygroup_padding_percentage: 0.25, // for categorical scales - ygroup_outer_padding_percentage: 0, // for categorical scales - x_padding_percentage: 0.05, // for categorical scales - x_outer_padding_percentage: 0.1, // for categorical scales - xgroup_padding_percentage: 0.25, // for categorical scales - xgroup_outer_padding_percentage: 0, // for categorical scales - y_categorical_show_guides: false, - x_categorical_show_guide: false, - rotate_x_labels: 0, - rotate_y_labels: 0, - y_accessor: 'value', - y_label: '', - yax_units: '', - yax_units_append: false, - x_rug: false, - y_rug: false, - mouseover_align: 'right', // implemented in point.js - x_mouseover: null, - y_mouseover: null, - transition_on_update: true, - mouseover: null, - click: null, - show_rollover_text: true, - show_confidence_band: null, // given [l, u] shows a confidence at each point from l to u - xax_format: null, // xax_format is a function that formats the labels for the x axis. - area: true, // Can be also an array to select lines having areas (e.g. [1, 3]) - flip_area_under_y_value: null, // Specify a Y baseline number value to flip area under it. - chart_type: 'line', - data: [], - decimals: 2, // the number of decimals in any rollover - format: 'count', // format = {count, percentage} - inflator: 10 / 9, // for setting y axis max - linked: false, // links together all other graphs with linked:true, so rollovers in one trigger rollovers in the others - linked_format: '%Y-%m-%d', // What granularity to link on for graphs. Default is at day - list: false, - baselines: null, // sets the baseline lines - markers: null, // sets the marker lines - scalefns: {}, - scales: {}, - utc_time: false, - european_clock: false, - show_year_markers: false, - show_secondary_x_label: true, - target: '#viz', - interpolate: d3.curveCatmullRom.alpha(0), // interpolation method to use when rendering lines; increase tension if your data is irregular and you notice artifacts - custom_line_color_map: [], // allows arbitrary mapping of lines to colors, e.g. [2,3] will map line 1 to color 2 and line 2 to color 3 - colors: null, // UNIMPLEMENTED - allows direct color mapping to line colors. Will eventually require - max_data_size: null, // explicitly specify the the max number of line series, for use with custom_line_color_map - aggregate_rollover: false, // links the lines in a multi-line chart - show_tooltips: true, // if enabled, a chart's description will appear in a tooltip (requires jquery) - showActivePoint: true, // If enabled show active data point information in chart - brush: null, // add brushing function for this chart. could be set as 'xy', 'x', 'y' to restrict axis - zoom_target: null, // zooming target of brushing function. if not set the default is to zoom the current chart - brushing_selection_changed: null // callback function on brushing. the first parameter are the arguments that correspond to this chart, the second parameter is the range of the selection - }; - - MG.call_hook('global.defaults', defaults); - - if (!args) { - args = {}; - } - - var selected_chart = MG.charts[args.chart_type || defaults.chart_type]; - merge_with_defaults(args, selected_chart.defaults, defaults); - - if (args.list) { - args.x_accessor = 0; - args.y_accessor = 1; - } - - // check for deprecated parameters - for (var key in MG.deprecations) { - if (args.hasOwnProperty(key)) { - var deprecation = MG.deprecations[key], - message = 'Use of `args.' + key + '` has been deprecated', - replacement = deprecation.replacement, - version; - - // transparently alias the deprecated - if (replacement) { - if (args[replacement]) { - message += '. The replacement - `args.' + replacement + '` - has already been defined. This definition will be discarded.'; - } else { - args[replacement] = args[key]; - } - } - - if (deprecation.warned) { - continue; - } - - deprecation.warned = true; - - if (replacement) { - message += ' in favor of `args.' + replacement + '`'; - } - - warn_deprecation(message, deprecation.version); - } - } - - MG.call_hook('global.before_init', args); - - new selected_chart.descriptor(args); - - return args.data; -}; - -if (mg_jquery_exists()) { - /* ======================================================================== - * Bootstrap: tooltip.js v3.3.5 - * http://getbootstrap.com/javascript/#tooltip - * Inspired by the original jQuery.tipsy by Jason Frame - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - +function ($) { - 'use strict'; - - // TOOLTIP PUBLIC CLASS DEFINITION - // =============================== - - var Tooltip = function Tooltip(element, options) { - this.type = null; - this.options = null; - this.enabled = null; - this.timeout = null; - this.hoverState = null; - this.$element = null; - this.inState = null; - - this.init('tooltip', element, options); - }; - - Tooltip.VERSION = '3.3.5'; - - Tooltip.TRANSITION_DURATION = 150; - - Tooltip.DEFAULTS = { - animation: true, - placement: 'top', - selector: false, - template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', - trigger: 'hover focus', - title: '', - delay: 0, - html: false, - container: false, - viewport: { - selector: 'body', - padding: 0 - } - }; - - Tooltip.prototype.init = function (type, element, options) { - this.enabled = true; - this.type = type; - this.$element = $(element); - this.options = this.getOptions(options); - this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : this.options.viewport.selector || this.options.viewport); - this.inState = { click: false, hover: false, focus: false }; - - if (this.$element[0] instanceof document.constructor && !this.options.selector) { - throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!'); - } - - var triggers = this.options.trigger.split(' '); - - for (var i = triggers.length; i--;) { - var trigger = triggers[i]; - - if (trigger == 'click') { - this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)); - } else if (trigger != 'manual') { - var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'; - var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'; - - this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)); - this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)); - } - } - - this.options.selector ? this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' }) : this.fixTitle(); - }; - - Tooltip.prototype.getDefaults = function () { - return Tooltip.DEFAULTS; - }; - - Tooltip.prototype.getOptions = function (options) { - options = $.extend({}, this.getDefaults(), this.$element.data(), options); - - if (options.delay && typeof options.delay == 'number') { - options.delay = { - show: options.delay, - hide: options.delay - }; - } - - return options; - }; - - Tooltip.prototype.getDelegateOptions = function () { - var options = {}; - var defaults = this.getDefaults(); - - this._options && $.each(this._options, function (key, value) { - if (defaults[key] != value) options[key] = value; - }); - - return options; - }; - - Tooltip.prototype.enter = function (obj) { - var self = obj instanceof this.constructor ? obj : $(obj.currentTarget).data('bs.' + this.type); - - if (!self) { - self = new this.constructor(obj.currentTarget, this.getDelegateOptions()); - $(obj.currentTarget).data('bs.' + this.type, self); - } - - if (obj instanceof $.Event) { - self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true; - } - - if (self.tip().hasClass('in') || self.hoverState == 'in') { - self.hoverState = 'in'; - return; - } - - clearTimeout(self.timeout); - - self.hoverState = 'in'; - - if (!self.options.delay || !self.options.delay.show) return self.show(); - - self.timeout = setTimeout(function () { - if (self.hoverState == 'in') self.show(); - }, self.options.delay.show); - }; - - Tooltip.prototype.isInStateTrue = function () { - for (var key in this.inState) { - if (this.inState[key]) return true; - } - - return false; - }; - - Tooltip.prototype.leave = function (obj) { - var self = obj instanceof this.constructor ? obj : $(obj.currentTarget).data('bs.' + this.type); - - if (!self) { - self = new this.constructor(obj.currentTarget, this.getDelegateOptions()); - $(obj.currentTarget).data('bs.' + this.type, self); - } - - if (obj instanceof $.Event) { - self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false; - } - - if (self.isInStateTrue()) return; - - clearTimeout(self.timeout); - - self.hoverState = 'out'; - - if (!self.options.delay || !self.options.delay.hide) return self.hide(); - - self.timeout = setTimeout(function () { - if (self.hoverState == 'out') self.hide(); - }, self.options.delay.hide); - }; - - Tooltip.prototype.show = function () { - var e = $.Event('show.bs.' + this.type); - - if (this.hasContent() && this.enabled) { - this.$element.trigger(e); - - var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]); - if (e.isDefaultPrevented() || !inDom) return; - var that = this; - - var $tip = this.tip(); - - var tipId = this.getUID(this.type); - - this.setContent(); - $tip.attr('id', tipId); - this.$element.attr('aria-describedby', tipId); - - if (this.options.animation) $tip.addClass('fade'); - - var placement = typeof this.options.placement == 'function' ? this.options.placement.call(this, $tip[0], this.$element[0]) : this.options.placement; - - var autoToken = /\s?auto?\s?/i; - var autoPlace = autoToken.test(placement); - if (autoPlace) placement = placement.replace(autoToken, '') || 'top'; - - $tip.detach().css({ top: 0, left: 0, display: 'block' }).addClass(placement).data('bs.' + this.type, this); - - this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element); - this.$element.trigger('inserted.bs.' + this.type); - - var pos = this.getPosition(); - var actualWidth = $tip[0].offsetWidth; - var actualHeight = $tip[0].offsetHeight; - - if (autoPlace) { - var orgPlacement = placement; - var viewportDim = this.getPosition(this.$viewport); - - placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' : placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' : placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' : placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' : placement; - - $tip.removeClass(orgPlacement).addClass(placement); - } - - var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight); - - this.applyPlacement(calculatedOffset, placement); - - var complete = function complete() { - var prevHoverState = that.hoverState; - that.$element.trigger('shown.bs.' + that.type); - that.hoverState = null; - - if (prevHoverState == 'out') that.leave(that); - }; - - $.support.transition && this.$tip.hasClass('fade') ? $tip.one('bsTransitionEnd', complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : complete(); - } - }; - - Tooltip.prototype.applyPlacement = function (offset, placement) { - var $tip = this.tip(); - var width = $tip[0].offsetWidth; - var height = $tip[0].offsetHeight; - - // manually read margins because getBoundingClientRect includes difference - var marginTop = parseInt($tip.css('margin-top'), 10); - var marginLeft = parseInt($tip.css('margin-left'), 10); - - // we must check for NaN for ie 8/9 - if (isNaN(marginTop)) marginTop = 0; - if (isNaN(marginLeft)) marginLeft = 0; - - offset.top += marginTop; - offset.left += marginLeft; - - // $.fn.offset doesn't round pixel values - // so we use setOffset directly with our own function B-0 - $.offset.setOffset($tip[0], $.extend({ - using: function using(props) { - $tip.css({ - top: Math.round(props.top), - left: Math.round(props.left) - }); - } - }, offset), 0); - - $tip.addClass('in'); - - // check to see if placing tip in new offset caused the tip to resize itself - var actualWidth = $tip[0].offsetWidth; - var actualHeight = $tip[0].offsetHeight; - - if (placement == 'top' && actualHeight != height) { - offset.top = offset.top + height - actualHeight; - } - - var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight); - - if (delta.left) offset.left += delta.left;else offset.top += delta.top; - - var isVertical = /top|bottom/.test(placement); - var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight; - var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'; - - $tip.offset(offset); - this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical); - }; - - Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) { - this.arrow().css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%').css(isVertical ? 'top' : 'left', ''); - }; - - Tooltip.prototype.setContent = function () { - var $tip = this.tip(); - var title = this.getTitle(); - - $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title); - $tip.removeClass('fade in top bottom left right'); - }; - - Tooltip.prototype.hide = function (callback) { - var that = this; - var $tip = $(this.$tip); - var e = $.Event('hide.bs.' + this.type); - - function complete() { - if (that.hoverState != 'in') $tip.detach(); - that.$element.removeAttr('aria-describedby').trigger('hidden.bs.' + that.type); - callback && callback(); - } - - this.$element.trigger(e); - - if (e.isDefaultPrevented()) return; - - $tip.removeClass('in'); - - $.support.transition && $tip.hasClass('fade') ? $tip.one('bsTransitionEnd', complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : complete(); - - this.hoverState = null; - - return this; - }; - - Tooltip.prototype.fixTitle = function () { - var $e = this.$element; - if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') { - $e.attr('data-original-title', $e.attr('title') || '').attr('title', ''); - } - }; - - Tooltip.prototype.hasContent = function () { - return this.getTitle(); - }; - - Tooltip.prototype.getPosition = function ($element) { - $element = $element || this.$element; - - var el = $element[0]; - var isBody = el.tagName == 'BODY'; - - var elRect = el.getBoundingClientRect(); - if (elRect.width == null) { - // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093 - elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top }); - } - var elOffset = isBody ? { top: 0, left: 0 } : $element.offset(); - var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }; - var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null; - - return $.extend({}, elRect, scroll, outerDims, elOffset); - }; - - Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { - return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : - /* placement == 'right' */{ top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }; - }; - - Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) { - var delta = { top: 0, left: 0 }; - if (!this.$viewport) return delta; - - var viewportPadding = this.options.viewport && this.options.viewport.padding || 0; - var viewportDimensions = this.getPosition(this.$viewport); - - if (/right|left/.test(placement)) { - var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll; - var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight; - if (topEdgeOffset < viewportDimensions.top) { - // top overflow - delta.top = viewportDimensions.top - topEdgeOffset; - } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { - // bottom overflow - delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset; - } - } else { - var leftEdgeOffset = pos.left - viewportPadding; - var rightEdgeOffset = pos.left + viewportPadding + actualWidth; - if (leftEdgeOffset < viewportDimensions.left) { - // left overflow - delta.left = viewportDimensions.left - leftEdgeOffset; - } else if (rightEdgeOffset > viewportDimensions.right) { - // right overflow - delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset; - } - } - - return delta; - }; - - Tooltip.prototype.getTitle = function () { - var title; - var $e = this.$element; - var o = this.options; - - title = $e.attr('data-original-title') || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title); - - return title; - }; - - Tooltip.prototype.getUID = function (prefix) { - do { - prefix += ~~(Math.random() * 1000000); - } while (document.getElementById(prefix)); - return prefix; - }; - - Tooltip.prototype.tip = function () { - if (!this.$tip) { - this.$tip = $(this.options.template); - if (this.$tip.length != 1) { - throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!'); - } - } - return this.$tip; - }; - - Tooltip.prototype.arrow = function () { - return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'); - }; - - Tooltip.prototype.enable = function () { - this.enabled = true; - }; - - Tooltip.prototype.disable = function () { - this.enabled = false; - }; - - Tooltip.prototype.toggleEnabled = function () { - this.enabled = !this.enabled; - }; - - Tooltip.prototype.toggle = function (e) { - var self = this; - if (e) { - self = $(e.currentTarget).data('bs.' + this.type); - if (!self) { - self = new this.constructor(e.currentTarget, this.getDelegateOptions()); - $(e.currentTarget).data('bs.' + this.type, self); - } - } - - if (e) { - self.inState.click = !self.inState.click; - if (self.isInStateTrue()) self.enter(self);else self.leave(self); - } else { - self.tip().hasClass('in') ? self.leave(self) : self.enter(self); - } - }; - - Tooltip.prototype.destroy = function () { - var that = this; - clearTimeout(this.timeout); - this.hide(function () { - that.$element.off('.' + that.type).removeData('bs.' + that.type); - if (that.$tip) { - that.$tip.detach(); - } - that.$tip = null; - that.$arrow = null; - that.$viewport = null; - }); - }; - - // TOOLTIP PLUGIN DEFINITION - // ========================= - - function Plugin(option) { - return this.each(function () { - var $this = $(this); - var data = $this.data('bs.tooltip'); - var options = (typeof option === 'undefined' ? 'undefined' : _typeof(option)) == 'object' && option; - - if (!data && /destroy|hide/.test(option)) return; - if (!data) $this.data('bs.tooltip', data = new Tooltip(this, options)); - if (typeof option == 'string') data[option](); - }); - } - - var old = $.fn.tooltip; - - $.fn.tooltip = Plugin; - $.fn.tooltip.Constructor = Tooltip; - - // TOOLTIP NO CONFLICT - // =================== - - $.fn.tooltip.noConflict = function () { - $.fn.tooltip = old; - return this; - }; - }(jQuery); - - /* ======================================================================== - * Bootstrap: popover.js v3.3.5 - * http://getbootstrap.com/javascript/#popovers - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - +function ($) { - 'use strict'; - - // POPOVER PUBLIC CLASS DEFINITION - // =============================== - - var Popover = function Popover(element, options) { - this.init('popover', element, options); - }; - - if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js'); - - Popover.VERSION = '3.3.5'; - - Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { - placement: 'right', - trigger: 'click', - content: '', - template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' - }); - - // NOTE: POPOVER EXTENDS tooltip.js - // ================================ - - Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype); - - Popover.prototype.constructor = Popover; - - Popover.prototype.getDefaults = function () { - return Popover.DEFAULTS; - }; - - Popover.prototype.setContent = function () { - var $tip = this.tip(); - var title = this.getTitle(); - var content = this.getContent(); - - $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title); - $tip.find('.popover-content').children().detach().end()[// we use append for html objects to maintain js events - this.options.html ? typeof content == 'string' ? 'html' : 'append' : 'text'](content); - - $tip.removeClass('fade top bottom left right in'); - - // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do - // this manually by checking the contents. - if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide(); - }; - - Popover.prototype.hasContent = function () { - return this.getTitle() || this.getContent(); - }; - - Popover.prototype.getContent = function () { - var $e = this.$element; - var o = this.options; - - return $e.attr('data-content') || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content); - }; - - Popover.prototype.arrow = function () { - return this.$arrow = this.$arrow || this.tip().find('.arrow'); - }; - - // POPOVER PLUGIN DEFINITION - // ========================= - - function Plugin(option) { - return this.each(function () { - var $this = $(this); - var data = $this.data('bs.popover'); - var options = (typeof option === 'undefined' ? 'undefined' : _typeof(option)) == 'object' && option; - - if (!data && /destroy|hide/.test(option)) return; - if (!data) $this.data('bs.popover', data = new Popover(this, options)); - if (typeof option == 'string') data[option](); - }); - } - - var old = $.fn.popover; - - $.fn.popover = Plugin; - $.fn.popover.Constructor = Popover; - - // POPOVER NO CONFLICT - // =================== - - $.fn.popover.noConflict = function () { - $.fn.popover = old; - return this; - }; - }(jQuery); -} - -function chart_title(args) { - 'use strict'; - - var svg = mg_get_svg_child_of(args.target); - - //remove the current title if it exists - svg.select('.mg-header').remove(); - - if (args.target && args.title) { - var chartTitle = svg.insert('text').attr('class', 'mg-header').attr('x', args.center_title_full_width ? args.width / 2 : (args.width + args.left - args.right) / 2).attr('y', args.title_y_position).attr('text-anchor', 'middle').attr('dy', '0.55em'); - - //show the title - chartTitle.append('tspan').attr('class', 'mg-chart-title').text(args.title); - - //show and activate the description icon if we have a description - if (args.show_tooltips && args.description && mg_jquery_exists()) { - chartTitle.append('tspan').attr('class', 'mg-chart-description').attr('dx', '0.3em').text('\uF059'); - - //now that the title is an svg text element, we'll have to trigger - //mouseenter, mouseleave events manually for the popover to work properly - var $chartTitle = $(chartTitle.node()); - $chartTitle.popover({ - html: true, - animation: false, - placement: 'top', - content: args.description, - container: args.target, - trigger: 'manual', - template: '<div class="popover mg-popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>' - }).on('mouseenter', function () { - d3.selectAll(args.target).selectAll('.mg-popover').remove(); - - $(this).popover('show'); - $(d3.select(args.target).select('.popover').node()).on('mouseleave', function () { - $chartTitle.popover('hide'); - }); - }).on('mouseleave', function () { - setTimeout(function () { - if (!$('.popover:hover').length) { - $chartTitle.popover('hide'); - } - }, 120); - }); - } else if (args.show_tooltips && args.description && typeof $ === 'undefined') { - args.error = 'In order to enable tooltips, please make sure you include jQuery.'; - } - } - - if (args.error) { - error(args); - } -} - -MG.chart_title = chart_title; - -function mg_add_scale_function(args, scalefcn_name, scale, accessor, inflation) { - args.scalefns[scalefcn_name] = function (di) { - if (inflation === undefined) return args.scales[scale](di[accessor]);else return args.scales[scale](di[accessor]) + inflation; - }; -} - -function mg_position(str, args) { - if (str === 'bottom' || str === 'top') { - return [mg_get_plot_left(args), mg_get_plot_right(args)]; - } - - if (str === 'left' || str === 'right') { - return [mg_get_plot_bottom(args), args.top]; - } -} - -function mg_cat_position(str, args) { - if (str === 'bottom' || str === 'top') { - return [mg_get_plot_left(args), mg_get_plot_right(args)]; - } - - if (str === 'left' || str === 'right') { - return [mg_get_plot_bottom(args), mg_get_plot_top(args)]; - } -} - -function MGScale(args) { - // big wrapper around d3 scale that automatically formats & calculates scale bounds - // according to the data, and handles other niceties. - var scaleArgs = {}; - scaleArgs.use_inflator = false; - scaleArgs.zero_bottom = false; - scaleArgs.scaleType = 'numerical'; - - this.namespace = function (_namespace) { - scaleArgs.namespace = _namespace; - scaleArgs.namespace_accessor_name = scaleArgs.namespace + '_accessor'; - scaleArgs.scale_name = scaleArgs.namespace.toUpperCase(); - scaleArgs.scalefn_name = scaleArgs.namespace + 'f'; - return this; - }; - - this.scaleName = function (scaleName) { - scaleArgs.scale_name = scaleName.toUpperCase(); - scaleArgs.scalefn_name = scaleName + 'f'; - return this; - }; - - this.inflateDomain = function (tf) { - scaleArgs.use_inflator = tf; - return this; - }; - - this.zeroBottom = function (tf) { - scaleArgs.zero_bottom = tf; - return this; - }; - - ///////////////////////////////////////////////////////////////////////////////////////////////////////// - /// all scale domains are either numerical (number, date, etc.) or categorical (factor, label, etc) ///// - ///////////////////////////////////////////////////////////////////////////////////////////////////////// - // these functions automatically create the d3 scale function and place the domain. - - this.numericalDomainFromData = function () { - var other_flat_data_arrays = []; - - if (arguments.length > 0) { - other_flat_data_arrays = arguments; - } - - // pull out a non-empty array in args.data. - var illustrative_data; - for (var i = 0; i < args.data.length; i++) { - if (args.data[i].length > 0) { - illustrative_data = args.data[i]; - } - } - scaleArgs.is_time_series = mg_is_date(illustrative_data[0][args[scaleArgs.namespace_accessor_name]]) ? true : false; - - mg_add_scale_function(args, scaleArgs.scalefn_name, scaleArgs.scale_name, args[scaleArgs.namespace_accessor_name]); - - mg_min_max_numerical(args, scaleArgs, other_flat_data_arrays, scaleArgs.use_inflator); - - var time_scale = args.utc_time ? d3.scaleUtc() : d3.scaleTime(); - - args.scales[scaleArgs.scale_name] = scaleArgs.is_time_series ? time_scale : mg_is_function(args[scaleArgs.namespace + '_scale_type']) ? args.y_scale_type() : args[scaleArgs.namespace + '_scale_type'] === 'log' ? d3.scaleLog() : d3.scaleLinear(); - - args.scales[scaleArgs.scale_name].domain([args.processed['min_' + scaleArgs.namespace], args.processed['max_' + scaleArgs.namespace]]); - scaleArgs.scaleType = 'numerical'; - - return this; - }; - - this.categoricalDomain = function (domain) { - args.scales[scaleArgs.scale_name] = d3.scaleOrdinal().domain(domain); - mg_add_scale_function(args, scaleArgs.scalefn_name, scaleArgs.scale_name, args[scaleArgs.namespace_accessor_name]); - return this; - }; - - this.categoricalDomainFromData = function () { - // make args.categorical_variables. - // lets make the categorical variables. - var all_data = mg_flatten_array(args.data); - //d3.set(data.map(function(d){return d[args.group_accessor]})).values() - scaleArgs.categoricalVariables = d3.set(all_data.map(function (d) { - return d[args[scaleArgs.namespace_accessor_name]]; - })).values(); - args.scales[scaleArgs.scale_name] = d3.scaleBand().domain(scaleArgs.categoricalVariables); - - scaleArgs.scaleType = 'categorical'; - return this; - }; - - ///////////////////////////////////////////////////////////////////////////////////////////////////////////// - ////////// all scale ranges are either positional (for axes, etc) or arbitrary (colors, size, etc) ////////// - ///////////////////////////////////////////////////////////////////////////////////////////////////////////// - - this.numericalRange = function (range) { - if (typeof range === 'string') { - args.scales[scaleArgs.scale_name].range(mg_position(range, args)); - } else { - args.scales[scaleArgs.scale_name].range(range); - } - - return this; - }; - - this.categoricalRangeBands = function (range, halfway) { - if (halfway === undefined) halfway = false; - - var namespace = scaleArgs.namespace; - var paddingPercentage = args[namespace + '_padding_percentage']; - var outerPaddingPercentage = args[namespace + '_outer_padding_percentage']; - if (typeof range === 'string') { - // if string, it's a location. Place it accordingly. - args.scales[scaleArgs.scale_name].range(mg_position(range, args)).paddingInner(paddingPercentage).paddingOuter(outerPaddingPercentage); - } else { - args.scales[scaleArgs.scale_name].range(range).paddingInner(paddingPercentage).paddingOuter(outerPaddingPercentage); - } - - mg_add_scale_function(args, scaleArgs.scalefn_name, scaleArgs.scale_name, args[scaleArgs.namespace_accessor_name], halfway ? args.scales[scaleArgs.scale_name].bandwidth() / 2 : 0); - - return this; - }; - - this.categoricalRange = function (range) { - args.scales[scaleArgs.scale_name].range(range); - mg_add_scale_function(args, scaleArgs.scalefn_name, scaleArgs.scale_name, args[scaleArgs.namespace_accessor_name]); - return this; - }; - - this.categoricalColorRange = function () { - args.scales[scaleArgs.scale_name] = args.scales[scaleArgs.scale_name].domain().length > 10 ? d3.scaleOrdinal(d3.schemeCategory20) : d3.scaleOrdinal(d3.schemeCategory10); - - args.scales[scaleArgs.scale_name].domain(scaleArgs.categoricalVariables); - - mg_add_scale_function(args, scaleArgs.scalefn_name, scaleArgs.scale_name, args[scaleArgs.namespace_accessor_name]); - return this; - }; - - this.clamp = function (yn) { - args.scales[scaleArgs.scale_name].clamp(yn); - return this; - }; - - return this; -} - -MG.scale_factory = MGScale; - -/////////////////////////////// x, x_accessor, markers, baselines, etc. -function mg_min_max_numerical(args, scaleArgs, additional_data_arrays) { - // A BIT OF EXPLANATION ABOUT THIS FUNCTION - // This function pulls out all the accessor values in all the arrays in args.data. - // We also have this additional argument, additional_data_arrays, which is an array of arrays of raw data values. - // These values also get concatenated to the data pulled from args.data, and the extents are calculate from that. - // They are optional. - // - // This may seem arbitrary, but it gives us a lot of flexibility. For instance, if we're calculating - // the min and max for the y axis of a line chart, we're going to want to also factor in baselines (horizontal lines - // that might potentially be outside of the y value bounds). The easiest way to do this is in the line.js code - // & scale creation to just flatten the args.baselines array, pull out hte values, and feed it in - // so it appears in additional_data_arrays. - var namespace = scaleArgs.namespace; - var namespace_accessor_name = scaleArgs.namespace_accessor_name; - var use_inflator = scaleArgs.use_inflator; - var zero_bottom = scaleArgs.zero_bottom; - - var accessor = args[namespace_accessor_name]; - - // add together all relevant data arrays. - var all_data = mg_flatten_array(args.data).map(function (dp) { - return dp[accessor]; - }).concat(mg_flatten_array(additional_data_arrays)); - - // do processing for log - if (args[namespace + '_scale_type'] === 'log') { - all_data = all_data.filter(function (d) { - return d > 0; - }); - } - - // use inflator? - var extents = d3.extent(all_data); - var min_val = extents[0]; - var max_val = extents[1]; - - // bolt scale domain to zero when the right conditions are met: - // not pulling the bottom of the range from data - // not zero-bottomed - // not a time series - if (zero_bottom && !args['min_' + namespace + '_from_data'] && min_val > 0 && !scaleArgs.is_time_series) { - min_val = args[namespace + '_scale_type'] === 'log' ? 1 : 0; - } - - if (args[namespace + '_scale_type'] !== 'log' && min_val < 0 && !scaleArgs.is_time_series) { - min_val = min_val - (min_val - min_val * args.inflator) * use_inflator; - } - - if (!scaleArgs.is_time_series) { - max_val = max_val < 0 ? max_val + (max_val - max_val * args.inflator) * use_inflator : max_val * (use_inflator ? args.inflator : 1); - } - - min_val = args['min_' + namespace] != null ? args['min_' + namespace] : min_val; - max_val = args['max_' + namespace] != null ? args['max_' + namespace] : max_val; - // if there's a single data point, we should custom-set the max values - // so we're displaying some kind of range - if (min_val === max_val && args['min_' + namespace] == null && args['max_' + namespace] == null) { - if (mg_is_date(min_val)) { - max_val = new Date(MG.clone(min_val).setDate(min_val.getDate() + 1)); - } else if (typeof min_val === 'number') { - max_val = min_val + 1; - mg_force_xax_count_to_be_two(args); - } - } - - args.processed['min_' + namespace] = min_val; - args.processed['max_' + namespace] = max_val; - if (args.processed['zoom_' + namespace]) { - args.processed['min_' + namespace] = args.processed['zoom_' + namespace][0]; - args.processed['max_' + namespace] = args.processed['zoom_' + namespace][1]; - } - MG.call_hook('x_axis.process_min_max', args, args.processed.min_x, args.processed.max_x); - MG.call_hook('y_axis.process_min_max', args, args.processed.min_y, args.processed.max_y); -} - -function mg_categorical_group_color_scale(args) { - if (args.color_accessor !== false) { - if (args.ygroup_accessor) { - // add a custom accessor element. - if (args.color_accessor === null) { - args.color_accessor = args.y_accessor; - } else {} - } - if (args.color_accessor !== null) { - new MG.scale_factory(args).namespace('color').categoricalDomainFromData().categoricalColorRange(); - } - } -} - -function mg_add_color_categorical_scale(args, domain, accessor) { - args.scales.color = d3.scaleOrdinal(d3.schemeCategory20).domain(domain); - args.scalefns.color = function (d) { - return args.scales.color(d[accessor]); - }; -} - -function mg_get_categorical_domain(data, accessor) { - return d3.set(data.map(function (d) { - return d[accessor]; - })).values(); -} - -function mg_get_color_domain(args) { - var color_domain; - if (args.color_domain === null) { - if (args.color_type === 'number') { - color_domain = d3.extent(args.data[0], function (d) { - return d[args.color_accessor]; - }); - } else if (args.color_type === 'category') { - color_domain = mg_get_categorical_domain(args.data[0], args.color_accessor); - } - } else { - color_domain = args.color_domain; - } - return color_domain; -} - -function mg_get_color_range(args) { - var color_range; - if (args.color_range === null) { - if (args.color_type === 'number') { - color_range = ['blue', 'red']; - } else { - color_range = null; - } - } else { - color_range = args.color_range; - } - return color_range; -} - -function processScaleTicks(args, axis) { - var accessor = args[axis + '_accessor']; - var scale_ticks = args.scales[axis.toUpperCase()].ticks(args[axis + 'ax_count']); - var max = args.processed['max_' + axis]; - - function log10(val) { - if (val === 1000) { - return 3; - } - if (val === 1000000) { - return 7; - } - return Math.log(val) / Math.LN10; - } - - if (args[axis + '_scale_type'] === 'log') { - // get out only whole logs - scale_ticks = scale_ticks.filter(function (d) { - return Math.abs(log10(d)) % 1 < 1e-6 || Math.abs(log10(d)) % 1 > 1 - 1e-6; - }); - } - - // filter out fraction ticks if our data is ints and if xmax > number of generated ticks - var number_of_ticks = scale_ticks.length; - - // is our data object all ints? - var data_is_int = true; - args.data.forEach(function (d, i) { - d.forEach(function (d, i) { - if (d[accessor] % 1 !== 0) { - data_is_int = false; - return false; - } - }); - }); - - if (data_is_int && number_of_ticks > max && args.format === 'count') { - // remove non-integer ticks - scale_ticks = scale_ticks.filter(function (d) { - return d % 1 === 0; - }); - } - - args.processed[axis + '_ticks'] = scale_ticks; -} - -function rugPlacement(args, axisArgs) { - var position = axisArgs.position; - var ns = axisArgs.namespace; - var coordinates = {}; - if (position === 'left') { - coordinates.x1 = mg_get_left(args) + 1; - coordinates.x2 = mg_get_left(args) + args.rug_buffer_size; - coordinates.y1 = args.scalefns[ns + 'f']; - coordinates.y2 = args.scalefns[ns + 'f']; - } - if (position === 'right') { - coordinates.x1 = mg_get_right(args) - 1, coordinates.x2 = mg_get_right(args) - args.rug_buffer_size, coordinates.y1 = args.scalefns[ns + 'f']; - coordinates.y2 = args.scalefns[ns + 'f']; - } - if (position === 'top') { - coordinates.x1 = args.scalefns[ns + 'f']; - coordinates.x2 = args.scalefns[ns + 'f']; - coordinates.y1 = mg_get_top(args) + 1; - coordinates.y2 = mg_get_top(args) + args.rug_buffer_size; - } - if (position === 'bottom') { - coordinates.x1 = args.scalefns[ns + 'f']; - coordinates.x2 = args.scalefns[ns + 'f']; - coordinates.y1 = mg_get_bottom(args) - 1; - coordinates.y2 = mg_get_bottom(args) - args.rug_buffer_size; - } - return coordinates; -} - -function rimPlacement(args, axisArgs) { - var ns = axisArgs.namespace; - var position = axisArgs.position; - var tick_length = args.processed[ns + '_ticks'].length; - var ticks = args.processed[ns + '_ticks']; - var scale = args.scales[ns.toUpperCase()]; - var coordinates = {}; - - if (position === 'left') { - coordinates.x1 = mg_get_left(args); - coordinates.x2 = mg_get_left(args); - coordinates.y1 = scale(ticks[0]).toFixed(2); - coordinates.y2 = scale(ticks[tick_length - 1]).toFixed(2); - } - if (position === 'right') { - coordinates.x1 = mg_get_right(args); - coordinates.x2 = mg_get_right(args); - coordinates.y1 = scale(ticks[0]).toFixed(2); - coordinates.y2 = scale(ticks[tick_length - 1]).toFixed(2); - } - if (position === 'top') { - coordinates.x1 = mg_get_left(args); - coordinates.x2 = mg_get_right(args); - coordinates.y1 = mg_get_top(args); - coordinates.y2 = mg_get_top(args); - } - if (position === 'bottom') { - coordinates.x1 = mg_get_left(args); - coordinates.x2 = mg_get_right(args); - coordinates.y1 = mg_get_bottom(args); - coordinates.y2 = mg_get_bottom(args); - } - - if (position === 'left' || position === 'right') { - if (args.axes_not_compact) { - coordinates.y1 = mg_get_bottom(args); - coordinates.y2 = mg_get_top(args); - } else if (tick_length) { - coordinates.y1 = scale(ticks[0]).toFixed(2); - coordinates.y2 = scale(ticks[tick_length - 1]).toFixed(2); - } - } - - return coordinates; -} - -function labelPlacement(args, axisArgs) { - var position = axisArgs.position; - var ns = axisArgs.namespace; - var tickLength = args[ns + 'ax_tick_length']; - var scale = args.scales[ns.toUpperCase()]; - var coordinates = {}; - - if (position === 'left') { - coordinates.x = mg_get_left(args) - tickLength * 3 / 2; - coordinates.y = function (d) { - return scale(d).toFixed(2); - }; - coordinates.dx = -3; - coordinates.dy = '.35em'; - coordinates.textAnchor = 'end'; - coordinates.text = function (d) { - return mg_compute_yax_format(args)(d); - }; - } - if (position === 'right') { - coordinates.x = mg_get_right(args) + tickLength * 3 / 2; - coordinates.y = function (d) { - return scale(d).toFixed(2); - }; - coordinates.dx = 3; - coordinates.dy = '.35em'; - coordinates.textAnchor = 'start'; - coordinates.text = function (d) { - return mg_compute_yax_format(args)(d); - }; - } - if (position === 'top') { - coordinates.x = function (d) { - return scale(d).toFixed(2); - }; - coordinates.y = (mg_get_top(args) - tickLength * 7 / 3).toFixed(2); - coordinates.dx = 0; - coordinates.dy = '0em'; - coordinates.textAnchor = 'middle'; - coordinates.text = function (d) { - return mg_default_xax_format(args)(d); - }; - } - if (position === 'bottom') { - coordinates.x = function (d) { - return scale(d).toFixed(2); - }; - coordinates.y = (mg_get_bottom(args) + tickLength * 7 / 3).toFixed(2); - coordinates.dx = 0; - coordinates.dy = '.50em'; - coordinates.textAnchor = 'middle'; - coordinates.text = function (d) { - return mg_default_xax_format(args)(d); - }; - } - - return coordinates; -} - -function addSecondaryLabelElements(args, axisArgs, g) { - var tf = mg_get_yformat_and_secondary_time_function(args); - var years = tf.secondary(args.processed.min_x, args.processed.max_x); - if (years.length === 0) { - var first_tick = args.scales.X.ticks(args.xax_count)[0]; - years = [first_tick]; - } - - var yg = mg_add_g(g, 'mg-year-marker'); - if (tf.timeframe === 'default' && args.show_year_markers) { - yearMarkerLine(args, axisArgs, yg, years, tf.yformat); - } - if (tf.tick_diff_timeframe != 'years') yearMarkerText(args, axisArgs, yg, years, tf.yformat); -} - -function yearMarkerLine(args, axisArgs, g, years, yformat) { - g.selectAll('.mg-year-marker').data(years).enter().append('line').attr('x1', function (d) { - return args.scales.X(d).toFixed(2); - }).attr('x2', function (d) { - return args.scales.X(d).toFixed(2); - }).attr('y1', mg_get_top(args)).attr('y2', mg_get_bottom(args)); -} - -function yearMarkerText(args, axisArgs, g, years, yformat) { - var position = axisArgs.position; - var ns = axisArgs.namespace; - var scale = args.scales[ns.toUpperCase()]; - var x, y, dy, textAnchor, textFcn; - var xAxisTextElement = d3.select(args.target).select('.mg-x-axis text').node().getBoundingClientRect(); - - if (position === 'top') { - x = function x(d, i) { - return scale(d).toFixed(2); - }; - y = mg_get_top(args) - args.xax_tick_length * 7 / 3 - xAxisTextElement.height; - dy = '.50em'; - textAnchor = 'middle'; - textFcn = function textFcn(d) { - return yformat(new Date(d)); - }; - } - if (position === 'bottom') { - x = function x(d, i) { - return scale(d).toFixed(2); - }; - y = mg_get_bottom(args) + args.xax_tick_length * 7 / 3 + xAxisTextElement.height * 0.8; - dy = '.50em'; - textAnchor = 'middle'; - textFcn = function textFcn(d) { - return yformat(new Date(d)); - }; - } - - g.selectAll('.mg-year-marker').data(years).enter().append('text').attr('x', x).attr('y', y).attr('dy', dy).attr('text-anchor', textAnchor).text(textFcn); -} - -function addNumericalLabels(g, args, axisArgs) { - var ns = axisArgs.namespace; - var coords = labelPlacement(args, axisArgs); - var ticks = args.processed[ns + '_ticks']; - - var labels = g.selectAll('.mg-yax-labels').data(ticks).enter().append('text').attr('x', coords.x).attr('dx', coords.dx).attr('y', coords.y).attr('dy', coords.dy).attr('text-anchor', coords.textAnchor).text(coords.text); - // move the labels if they overlap - if (ns == 'x') { - if (args.time_series && args.european_clock) { - labels.append('tspan').classed('mg-european-hours', true).text(function (_d, i) { - var d = new Date(_d); - if (i === 0) return d3.timeFormat('%H')(d);else return ''; - }); - labels.append('tspan').classed('mg-european-minutes-seconds', true).text(function (_d, i) { - var d = new Date(_d); - return ':' + args.processed.xax_format(d); - }); - } else { - labels.text(function (d) { - return args.xax_units + args.processed.xax_format(d); - }); - } - - if (args.time_series && (args.show_years || args.show_secondary_x_label)) { - addSecondaryLabelElements(args, axisArgs, g); - } - } - - if (mg_elements_are_overlapping(labels)) { - labels.filter(function (d, i) { - return (i + 1) % 2 === 0; - }).remove(); - - var svg = mg_get_svg_child_of(args.target); - svg.selectAll('.mg-' + ns + 'ax-ticks').filter(function (d, i) { - return (i + 1) % 2 === 0; - }).remove(); - } -} - -function addTickLines(g, args, axisArgs) { - // name - var ns = axisArgs.namespace; - var position = axisArgs.position; - var scale = args.scales[ns.toUpperCase()]; - - var ticks = args.processed[ns + '_ticks']; - var ticksClass = 'mg-' + ns + 'ax-ticks'; - var extendedTicksClass = 'mg-extended-' + ns + 'ax-ticks'; - var extendedTicks = args[ns + '_extended_ticks']; - var tickLength = args[ns + 'ax_tick_length']; - - var x1, x2, y1, y2; - - if (position === 'left') { - x1 = mg_get_left(args); - x2 = extendedTicks ? mg_get_right(args) : mg_get_left(args) - tickLength; - y1 = function y1(d) { - return scale(d).toFixed(2); - }; - y2 = function y2(d) { - return scale(d).toFixed(2); - }; - } - if (position === 'right') { - x1 = mg_get_right(args); - x2 = extendedTicks ? mg_get_left(args) : mg_get_right(args) + tickLength; - y1 = function y1(d) { - return scale(d).toFixed(2); - }; - y2 = function y2(d) { - return scale(d).toFixed(2); - }; - } - if (position === 'top') { - x1 = function x1(d) { - return scale(d).toFixed(2); - }; - x2 = function x2(d) { - return scale(d).toFixed(2); - }; - y1 = mg_get_top(args); - y2 = extendedTicks ? mg_get_bottom(args) : mg_get_top(args) - tickLength; - } - if (position === 'bottom') { - x1 = function x1(d) { - return scale(d).toFixed(2); - }; - x2 = function x2(d) { - return scale(d).toFixed(2); - }; - y1 = mg_get_bottom(args); - y2 = extendedTicks ? mg_get_top(args) : mg_get_bottom(args) + tickLength; - } - - g.selectAll('.' + ticksClass).data(ticks).enter().append('line').classed(extendedTicksClass, extendedTicks).attr('x1', x1).attr('x2', x2).attr('y1', y1).attr('y2', y2); -} - -function initializeAxisRim(g, args, axisArgs) { - var namespace = axisArgs.namespace; - var tick_length = args.processed[namespace + '_ticks'].length; - - var rim = rimPlacement(args, axisArgs); - - if (!args[namespace + '_extended_ticks'] && !args[namespace + '_extended_ticks'] && tick_length) { - g.append('line').attr('x1', rim.x1).attr('x2', rim.x2).attr('y1', rim.y1).attr('y2', rim.y2); - } -} - -function initializeRug(args, rug_class) { - var svg = mg_get_svg_child_of(args.target); - var all_data = mg_flatten_array(args.data); - var rug = svg.selectAll('line.' + rug_class).data(all_data); - - // set the attributes that do not change after initialization, per - rug.enter().append('svg:line').attr('class', rug_class).attr('opacity', 0.3); - - // remove rug elements that are no longer in use - mg_exit_and_remove(rug); - - // set coordinates of new rug elements - mg_exit_and_remove(rug); - return rug; -} - -function rug(args, axisArgs) { - 'use strict'; - - args.rug_buffer_size = args.chart_type === 'point' ? args.buffer / 2 : args.buffer * 2 / 3; - - var rug = initializeRug(args, 'mg-' + axisArgs.namespace + '-rug'); - var rug_positions = rugPlacement(args, axisArgs); - rug.attr('x1', rug_positions.x1).attr('x2', rug_positions.x2).attr('y1', rug_positions.y1).attr('y2', rug_positions.y2); - - mg_add_color_accessor_to_rug(rug, args, 'mg-' + axisArgs.namespace + '-rug-mono'); -} - -function categoricalLabelPlacement(args, axisArgs, group) { - var ns = axisArgs.namespace; - var position = axisArgs.position; - var scale = args.scales[ns.toUpperCase()]; - var groupScale = args.scales[(ns + 'group').toUpperCase()]; - var coords = {}; - coords.cat = {}; - coords.group = {}; - // x, y, dy, text-anchor - - if (position === 'left') { - coords.cat.x = mg_get_plot_left(args) - args.buffer; - coords.cat.y = function (d) { - return groupScale(group) + scale(d) + scale.bandwidth() / 2; - }; - coords.cat.dy = '.35em'; - coords.cat.textAnchor = 'end'; - coords.group.x = mg_get_plot_left(args) - args.buffer; - coords.group.y = groupScale(group) + (groupScale.bandwidth ? groupScale.bandwidth() / 2 : 0); - coords.group.dy = '.35em'; - coords.group.textAnchor = args['rotate_' + ns + '_labels'] ? 'end' : 'end'; - } - - if (position === 'right') { - coords.cat.x = mg_get_plot_right(args) - args.buffer; - coords.cat.y = function (d) { - return groupScale(group) + scale(d) + scale.bandwidth() / 2; - }; - coords.cat.dy = '.35em'; - coords.cat.textAnchor = 'start'; - coords.group.x = mg_get_plot_right(args) - args.buffer; - coords.group.y = groupScale(group) + (groupScale.bandwidth ? groupScale.bandwidth() / 2 : 0); - coords.group.dy = '.35em'; - coords.group.textAnchor = 'start'; - } - - if (position === 'top') { - coords.cat.x = function (d) { - return groupScale(group) + scale(d) + scale.bandwidth() / 2; - }; - coords.cat.y = mg_get_plot_top(args) + args.buffer; - coords.cat.dy = '.35em'; - coords.cat.textAnchor = args['rotate_' + ns + '_labels'] ? 'start' : 'middle'; - coords.group.x = groupScale(group) + (groupScale.bandwidth ? groupScale.bandwidth() / 2 : 0); - coords.group.y = mg_get_plot_top(args) + args.buffer; - coords.group.dy = '.35em'; - coords.group.textAnchor = args['rotate_' + ns + '_labels'] ? 'start' : 'middle'; - } - - if (position === 'bottom') { - coords.cat.x = function (d) { - return groupScale(group) + scale(d) + scale.bandwidth() / 2; - }; - coords.cat.y = mg_get_plot_bottom(args) + args.buffer; - coords.cat.dy = '.35em'; - coords.cat.textAnchor = args['rotate_' + ns + '_labels'] ? 'start' : 'middle'; - coords.group.x = groupScale(group) + (groupScale.bandwidth ? groupScale.bandwidth() / 2 - scale.bandwidth() / 2 : 0); - coords.group.y = mg_get_plot_bottom(args) + args.buffer; - coords.group.dy = '.35em'; - coords.group.textAnchor = args['rotate_' + ns + '_labels'] ? 'start' : 'middle'; - } - - return coords; -} - -function categoricalLabels(args, axisArgs) { - var ns = axisArgs.namespace; - var nsClass = 'mg-' + ns + '-axis'; - var scale = args.scales[ns.toUpperCase()]; - var groupScale = args.scales[(ns + 'group').toUpperCase()]; - var groupAccessor = ns + 'group_accessor'; - - var svg = mg_get_svg_child_of(args.target); - mg_selectAll_and_remove(svg, '.' + nsClass); - var g = mg_add_g(svg, nsClass); - var group_g; - var groups = groupScale.domain && groupScale.domain() ? groupScale.domain() : ['1']; - - groups.forEach(function (group) { - // grab group placement stuff. - var coords = categoricalLabelPlacement(args, axisArgs, group); - - group_g = mg_add_g(g, 'mg-group-' + mg_normalize(group)); - if (args[groupAccessor] !== null) { - var labels = group_g.append('text').classed('mg-barplot-group-label', true).attr('x', coords.group.x).attr('y', coords.group.y).attr('dy', coords.group.dy).attr('text-anchor', coords.group.textAnchor).text(group); - } else { - var labels = group_g.selectAll('text').data(scale.domain()).enter().append('text').attr('x', coords.cat.x).attr('y', coords.cat.y).attr('dy', coords.cat.dy).attr('text-anchor', coords.cat.textAnchor).text(String); - } - if (args['rotate_' + ns + '_labels']) { - rotateLabels(labels, args['rotate_' + ns + '_labels']); - } - }); -} - -function categoricalGuides(args, axisArgs) { - // for each group - // for each data point - - var ns = axisArgs.namespace; - var scalef = args.scalefns[ns + 'f']; - var groupf = args.scalefns[ns + 'groupf']; - var groupScale = args.scales[(ns + 'group').toUpperCase()]; - var scale = args.scales[ns.toUpperCase()]; - var position = axisArgs.position; - - var svg = mg_get_svg_child_of(args.target); - var alreadyPlotted = []; - - var x1, x2, y1, y2; - var grs = groupScale.domain && groupScale.domain() ? groupScale.domain() : [null]; - - mg_selectAll_and_remove(svg, '.mg-category-guides'); - var g = mg_add_g(svg, 'mg-category-guides'); - - grs.forEach(function (group) { - scale.domain().forEach(function (cat) { - if (position === 'left' || position === 'right') { - x1 = mg_get_plot_left(args); - x2 = mg_get_plot_right(args); - y1 = scale(cat) + groupScale(group) + scale.bandwidth() / 2; - y2 = scale(cat) + groupScale(group) + scale.bandwidth() / 2; - } - - if (position === 'top' || position === 'bottom') { - x1 = scale(cat) + groupScale(group) + scale.bandwidth() / 2 * (group === null); - x2 = scale(cat) + groupScale(group) + scale.bandwidth() / 2 * (group === null); - y1 = mg_get_plot_bottom(args); - y2 = mg_get_plot_top(args); - } - - g.append('line').attr('x1', x1).attr('x2', x2).attr('y1', y1).attr('y2', y2).attr('stroke-dasharray', '2,1'); - }); - - var first = groupScale(group) + scale(scale.domain()[0]) + scale.bandwidth() / 2 * (group === null || position !== 'top' && position != 'bottom'); - var last = groupScale(group) + scale(scale.domain()[scale.domain().length - 1]) + scale.bandwidth() / 2 * (group === null || position !== 'top' && position != 'bottom'); - - var x11, x21, y11, y21, x12, x22, y12, y22; - if (position === 'left' || position === 'right') { - x11 = mg_get_plot_left(args); - x21 = mg_get_plot_left(args); - y11 = first; - y21 = last; - - x12 = mg_get_plot_right(args); - x22 = mg_get_plot_right(args); - y12 = first; - y22 = last; - } - - if (position === 'bottom' || position === 'top') { - x11 = first; - x21 = last; - y11 = mg_get_plot_bottom(args); - y21 = mg_get_plot_bottom(args); - - x12 = first; - x22 = last; - y12 = mg_get_plot_top(args); - y22 = mg_get_plot_top(args); - } - - g.append('line').attr('x1', x11).attr('x2', x21).attr('y1', y11).attr('y2', y21).attr('stroke-dasharray', '2,1'); - - g.append('line').attr('x1', x12).attr('x2', x22).attr('y1', y12).attr('y2', y22).attr('stroke-dasharray', '2,1'); - }); -} - -function rotateLabels(labels, rotation_degree) { - if (rotation_degree) { - labels.attr('transform', function () { - var elem = d3.select(this); - return 'rotate(' + rotation_degree + ' ' + elem.attr('x') + ',' + elem.attr('y') + ')'; - }); - } -} - -function zeroLine(args, axisArgs) { - var svg = mg_get_svg_child_of(args.target); - var ns = axisArgs.namespace; - var position = axisArgs.position; - var scale = args.scales[ns.toUpperCase()]; - var x1, x2, y1, y2; - if (position === 'left' || position === 'right') { - x1 = mg_get_plot_left(args); - x2 = mg_get_plot_right(args); - y1 = scale(0) + 1; - y2 = scale(0) + 1; - } - if (position === 'bottom' || position === 'top') { - y1 = mg_get_plot_top(args); - y2 = mg_get_plot_bottom(args); - x1 = scale(0) - 1; - x2 = scale(0) - 1; - } - - svg.append('line').attr('x1', x1).attr('x2', x2).attr('y1', y1).attr('y2', y2).attr('stroke', 'black'); -} - -var mgDrawAxis = {}; - -mgDrawAxis.categorical = function (args, axisArgs) { - var ns = axisArgs.namespace; - - categoricalLabels(args, axisArgs); - categoricalGuides(args, axisArgs); -}; - -mgDrawAxis.numerical = function (args, axisArgs) { - var namespace = axisArgs.namespace; - var axisName = namespace + '_axis'; - var axisClass = 'mg-' + namespace + '-axis'; - var svg = mg_get_svg_child_of(args.target); - - mg_selectAll_and_remove(svg, '.' + axisClass); - - if (!args[axisName]) { - return this; - } - - var g = mg_add_g(svg, axisClass); - - processScaleTicks(args, namespace); - initializeAxisRim(g, args, axisArgs); - addTickLines(g, args, axisArgs); - addNumericalLabels(g, args, axisArgs); - - // add label - if (args[namespace + '_label']) { - axisArgs.label(svg.select('.mg-' + namespace + '-axis'), args); - } - - // add rugs - if (args[namespace + '_rug']) { - rug(args, axisArgs); - } - - if (args.show_bar_zero) { - mg_bar_add_zero_line(args); - } - - return this; -}; - -function axisFactory(args) { - var axisArgs = {}; - axisArgs.type = 'numerical'; - - this.namespace = function (ns) { - // take the ns in the scale, and use it to - axisArgs.namespace = ns; - return this; - }; - - this.rug = function (tf) { - axisArgs.rug = tf; - return this; - }; - - this.label = function (tf) { - axisArgs.label = tf; - return this; - }; - - this.type = function (t) { - axisArgs.type = t; - return this; - }; - - this.position = function (pos) { - axisArgs.position = pos; - return this; - }; - - this.zeroLine = function (tf) { - axisArgs.zeroLine = tf; - return this; - }; - - this.draw = function () { - mgDrawAxis[axisArgs.type](args, axisArgs); - return this; - }; - - return this; -} - -MG.axis_factory = axisFactory; - -/* ================================================================================ */ -/* ================================================================================ */ -/* ================================================================================ */ - -function y_rug(args) { - 'use strict'; - - if (!args.y_rug) { - return; - } - - args.rug_buffer_size = args.chart_type === 'point' ? args.buffer / 2 : args.buffer * 2 / 3; - - var rug = mg_make_rug(args, 'mg-y-rug'); - - rug.attr('x1', args.left + 1).attr('x2', args.left + args.rug_buffer_size).attr('y1', args.scalefns.yf).attr('y2', args.scalefns.yf); - - mg_add_color_accessor_to_rug(rug, args, 'mg-y-rug-mono'); -} - -MG.y_rug = y_rug; - -function mg_change_y_extents_for_bars(args, my) { - if (args.chart_type === 'bar') { - my.min = 0; - my.max = d3.max(args.data[0], function (d) { - var trio = []; - trio.push(d[args.y_accessor]); - - if (args.baseline_accessor !== null) { - trio.push(d[args.baseline_accessor]); - } - - if (args.predictor_accessor !== null) { - trio.push(d[args.predictor_accessor]); - } - - return Math.max.apply(null, trio); - }); - } - return my; -} - -function mg_compute_yax_format(args) { - var yax_format = args.yax_format; - if (!yax_format) { - var decimals = args.decimals; - if (args.format === 'count') { - // increase decimals if we have small values, useful for realtime data - if (args.processed.y_ticks.length > 1) { - // calculate the number of decimals between the difference of ticks - // based on approach in flot: https://github.com/flot/flot/blob/958e5fd43c6dff4bab3e1fd5cb6109df5c1e8003/jquery.flot.js#L1810 - decimals = Math.max(0, -Math.floor(Math.log(Math.abs(args.processed.y_ticks[1] - args.processed.y_ticks[0])) / Math.LN10)); - } - - yax_format = function yax_format(d) { - var pf; - - if (decimals !== 0) { - // don't scale tiny values - pf = d3.format(',.' + decimals + 'f'); - } else if (d < 1000) { - pf = d3.format(',.0f'); - } else { - pf = d3.format(',.2s'); - } - - // are we adding units after the value or before? - if (args.yax_units_append) { - return pf(d) + args.yax_units; - } else { - return args.yax_units + pf(d); - } - }; - } else { - // percentage - yax_format = function yax_format(d_) { - var n = d3.format('.0%'); - return n(d_); - }; - } - } - return yax_format; -} - -function mg_bar_add_zero_line(args) { - var svg = mg_get_svg_child_of(args.target); - var extents = args.scales.X.domain(); - if (0 >= extents[0] && extents[1] >= 0) { - var r = args.scales.Y.range(); - var g = args.categorical_groups.length ? args.scales.YGROUP(args.categorical_groups[args.categorical_groups.length - 1]) : args.scales.YGROUP(); - - svg.append('svg:line').attr('x1', args.scales.X(0)).attr('x2', args.scales.X(0)).attr('y1', r[0] + mg_get_plot_top(args)).attr('y2', r[r.length - 1] + g).attr('stroke', 'black').attr('opacity', 0.2); - } -} - -function mg_y_domain_range(args, scale) { - scale.domain([args.processed.min_y, args.processed.max_y]).range([mg_get_plot_bottom(args), args.top]); - return scale; -} - -function mg_define_y_scales(args) { - var scale = mg_is_function(args.y_scale_type) ? args.y_scale_type() : args.y_scale_type === 'log' ? d3.scaleLog() : d3.scaleLinear(); - - if (args.y_scale_type === 'log') { - if (args.chart_type === 'histogram') { - // log histogram plots should start just below 1 - // so that bins with single counts are visible - args.processed.min_y = 0.2; - } else { - if (args.processed.min_y <= 0) { - args.processed.min_y = 1; - } - } - } - args.scales.Y = mg_y_domain_range(args, scale); - args.scales.Y.clamp(args.y_scale_type === 'log'); - - // used for ticks and such, and designed to be paired with log or linear - args.scales.Y_axis = mg_y_domain_range(args, d3.scaleLinear()); -} - -function mg_add_y_label(g, args) { - if (args.y_label) { - g.append('text').attr('class', 'label').attr('x', function () { - return -1 * (mg_get_plot_top(args) + (mg_get_plot_bottom(args) - mg_get_plot_top(args)) / 2); - }).attr('y', function () { - return args.left / 2; - }).attr('dy', '-1.2em').attr('text-anchor', 'middle').text(function (d) { - return args.y_label; - }).attr('transform', function (d) { - return 'rotate(-90)'; - }); - } -} - -function mg_add_y_axis_rim(g, args) { - var tick_length = args.processed.y_ticks.length; - if (!args.x_extended_ticks && !args.y_extended_ticks && tick_length) { - var y1scale, y2scale; - - if (args.axes_not_compact && args.chart_type !== 'bar') { - y1scale = args.height - args.bottom; - y2scale = args.top; - } else if (tick_length) { - y1scale = args.scales.Y(args.processed.y_ticks[0]).toFixed(2); - y2scale = args.scales.Y(args.processed.y_ticks[tick_length - 1]).toFixed(2); - } else { - y1scale = 0; - y2scale = 0; - } - - g.append('line').attr('x1', args.left).attr('x2', args.left).attr('y1', y1scale).attr('y2', y2scale); - } -} - -function mg_add_y_axis_tick_lines(g, args) { - g.selectAll('.mg-yax-ticks').data(args.processed.y_ticks).enter().append('line').classed('mg-extended-yax-ticks', args.y_extended_ticks).attr('x1', args.left).attr('x2', function () { - return args.y_extended_ticks ? args.width - args.right : args.left - args.yax_tick_length; - }).attr('y1', function (d) { - return args.scales.Y(d).toFixed(2); - }).attr('y2', function (d) { - return args.scales.Y(d).toFixed(2); - }); -} - -function mg_add_y_axis_tick_labels(g, args) { - var yax_format = mg_compute_yax_format(args); - g.selectAll('.mg-yax-labels').data(args.processed.y_ticks).enter().append('text').attr('x', args.left - args.yax_tick_length * 3 / 2).attr('dx', -3).attr('y', function (d) { - return args.scales.Y(d).toFixed(2); - }).attr('dy', '.35em').attr('text-anchor', 'end').text(function (d) { - var o = yax_format(d); - return o; - }); -} - -// TODO ought to be deprecated, only used by histogram -function y_axis(args) { - if (!args.processed) { - args.processed = {}; - } - - var svg = mg_get_svg_child_of(args.target); - MG.call_hook('y_axis.process_min_max', args, args.processed.min_y, args.processed.max_y); - mg_selectAll_and_remove(svg, '.mg-y-axis'); - - if (!args.y_axis) { - return this; - } - - var g = mg_add_g(svg, 'mg-y-axis'); - mg_add_y_label(g, args); - mg_process_scale_ticks(args, 'y'); - mg_add_y_axis_rim(g, args); - mg_add_y_axis_tick_lines(g, args); - mg_add_y_axis_tick_labels(g, args); - - if (args.y_rug) { - y_rug(args); - } - - return this; -} - -MG.y_axis = y_axis; - -function mg_add_categorical_labels(args) { - var svg = mg_get_svg_child_of(args.target); - mg_selectAll_and_remove(svg, '.mg-y-axis'); - var g = mg_add_g(svg, 'mg-y-axis'); - var group_g;(args.categorical_groups.length ? args.categorical_groups : ['1']).forEach(function (group) { - group_g = mg_add_g(g, 'mg-group-' + mg_normalize(group)); - - if (args.ygroup_accessor !== null) { - mg_add_group_label(group_g, group, args); - } else { - var labels = mg_add_graphic_labels(group_g, group, args); - mg_rotate_labels(labels, args.rotate_y_labels); - } - }); -} - -function mg_add_graphic_labels(g, group, args) { - return g.selectAll('text').data(args.scales.Y.domain()).enter().append('svg:text').attr('x', args.left - args.buffer).attr('y', function (d) { - return args.scales.YGROUP(group) + args.scales.Y(d) + args.scales.Y.bandwidth() / 2; - }).attr('dy', '.35em').attr('text-anchor', 'end').text(String); -} - -function mg_add_group_label(g, group, args) { - g.append('svg:text').classed('mg-barplot-group-label', true).attr('x', args.left - args.buffer).attr('y', args.scales.YGROUP(group) + args.scales.YGROUP.bandwidth() / 2).attr('dy', '.35em').attr('text-anchor', 'end').text(group); -} - -function mg_draw_group_lines(args) { - var svg = mg_get_svg_child_of(args.target); - var groups = args.scales.YGROUP.domain(); - var first = groups[0]; - var last = groups[groups.length - 1]; - - svg.select('.mg-category-guides').selectAll('mg-group-lines').data(groups).enter().append('line').attr('x1', mg_get_plot_left(args)).attr('x2', mg_get_plot_left(args)).attr('y1', function (d) { - return args.scales.YGROUP(d); - }).attr('y2', function (d) { - return args.scales.YGROUP(d) + args.ygroup_height; - }).attr('stroke-width', 1); -} - -function mg_y_categorical_show_guides(args) { - // for each group - // for each data point - var svg = mg_get_svg_child_of(args.target); - var alreadyPlotted = []; - args.data[0].forEach(function (d) { - if (alreadyPlotted.indexOf(d[args.y_accessor]) === -1) { - svg.select('.mg-category-guides').append('line').attr('x1', mg_get_plot_left(args)).attr('x2', mg_get_plot_right(args)).attr('y1', args.scalefns.yf(d) + args.scalefns.ygroupf(d)).attr('y2', args.scalefns.yf(d) + args.scalefns.ygroupf(d)).attr('stroke-dasharray', '2,1'); - } - }); -} - -function y_axis_categorical(args) { - if (!args.y_axis) { - return this; - } - - mg_add_categorical_labels(args); - // mg_draw_group_scaffold(args); - if (args.show_bar_zero) mg_bar_add_zero_line(args); - if (args.ygroup_accessor) mg_draw_group_lines(args); - if (args.y_categorical_show_guides) mg_y_categorical_show_guides(args); - return this; -} - -MG.y_axis_categorical = y_axis_categorical; - -function x_rug(args) { - 'use strict'; - - if (!args.x_rug) { - return; - } - - args.rug_buffer_size = args.chart_type === 'point' ? args.buffer / 2 : args.buffer; - - var rug = mg_make_rug(args, 'mg-x-rug'); - - rug.attr('x1', args.scalefns.xf).attr('x2', args.scalefns.xf).attr('y1', args.height - args.bottom - args.rug_buffer_size).attr('y2', args.height - args.bottom); - - mg_add_color_accessor_to_rug(rug, args, 'mg-x-rug-mono'); -} - -MG.x_rug = x_rug; - -function mg_add_processed_object(args) { - if (!args.processed) { - args.processed = {}; - } -} - -// TODO ought to be deprecated, only used by histogram -function x_axis(args) { - 'use strict'; - - var svg = mg_get_svg_child_of(args.target); - mg_add_processed_object(args); - - mg_select_xax_format(args); - mg_selectAll_and_remove(svg, '.mg-x-axis'); - - if (!args.x_axis) { - return this; - } - - var g = mg_add_g(svg, 'mg-x-axis'); - - mg_add_x_ticks(g, args); - mg_add_x_tick_labels(g, args); - if (args.x_label) { - mg_add_x_label(g, args); - } - if (args.x_rug) { - x_rug(args); - } - - return this; -} - -MG.x_axis = x_axis; - -function x_axis_categorical(args) { - var svg = mg_get_svg_child_of(args.target); - var additional_buffer = 0; - if (args.chart_type === 'bar') { - additional_buffer = args.buffer + 5; - } - - mg_add_categorical_scale(args, 'X', args.categorical_variables.reverse(), args.left, mg_get_plot_right(args) - additional_buffer); - mg_add_scale_function(args, 'xf', 'X', 'value'); - mg_selectAll_and_remove(svg, '.mg-x-axis'); - - var g = mg_add_g(svg, 'mg-x-axis'); - - if (!args.x_axis) { - return this; - } - - mg_add_x_axis_categorical_labels(g, args, additional_buffer); - return this; -} - -function mg_add_x_axis_categorical_labels(g, args, additional_buffer) { - var labels = g.selectAll('text').data(args.categorical_variables).enter().append('text'); - - labels.attr('x', function (d) { - return args.scales.X(d) + args.scales.X.bandwidth() / 2 + args.buffer * args.bar_outer_padding_percentage + additional_buffer / 2; - }).attr('y', mg_get_plot_bottom(args)).attr('dy', '.35em').attr('text-anchor', 'middle').text(String); - - if (args.truncate_x_labels) { - labels.each(function (d, idx) { - var elem = this, - width = args.scales.X.bandwidth(); - truncate_text(elem, d, width); - }); - } - mg_rotate_labels(labels, args.rotate_x_labels); -} - -MG.x_axis_categorical = x_axis_categorical; - -function mg_point_add_color_scale(args) { - var color_domain, color_range; - - if (args.color_accessor !== null) { - color_domain = mg_get_color_domain(args); - color_range = mg_get_color_range(args); - - if (args.color_type === 'number') { - args.scales.color = d3.scaleLinear().domain(color_domain).range(color_range).clamp(true); - } else { - args.scales.color = args.color_range !== null ? d3.scaleOrdinal().range(color_range) : color_domain.length > 10 ? d3.scaleOrdinal(d3.schemeCategory20) : d3.scaleOrdinal(d3.schemeCategory10); - - args.scales.color.domain(color_domain); - } - mg_add_scale_function(args, 'color', 'color', args.color_accessor); - } -} - -function mg_get_color_domain(args) { - var color_domain; - if (args.color_domain === null) { - if (args.color_type === 'number') { - color_domain = d3.extent(args.data[0], function (d) { - return d[args.color_accessor]; - }); - } else if (args.color_type === 'category') { - color_domain = d3.set(args.data[0].map(function (d) { - return d[args.color_accessor]; - })).values(); - - color_domain.sort(); - } - } else { - color_domain = args.color_domain; - } - return color_domain; -} - -function mg_get_color_range(args) { - var color_range; - if (args.color_range === null) { - if (args.color_type === 'number') { - color_range = ['blue', 'red']; - } else { - color_range = null; - } - } else { - color_range = args.color_range; - } - return color_range; -} - -function mg_point_add_size_scale(args) { - var min_size, max_size, size_domain, size_range; - if (args.size_accessor !== null) { - size_domain = mg_get_size_domain(args); - size_range = mg_get_size_range(args); - - args.scales.size = d3.scaleLinear().domain(size_domain).range(size_range).clamp(true); - - mg_add_scale_function(args, 'size', 'size', args.size_accessor); - } -} - -function mg_get_size_domain(args) { - return args.size_domain === null ? d3.extent(args.data[0], function (d) { - return d[args.size_accessor]; - }) : args.size_domain; -} - -function mg_get_size_range(args) { - var size_range; - if (args.size_range === null) { - size_range = [1, 5]; - } else { - size_range = args.size_range; - } - return size_range; -} - -function mg_add_x_label(g, args) { - if (args.x_label) { - g.append('text').attr('class', 'label').attr('x', function () { - return mg_get_plot_left(args) + (mg_get_plot_right(args) - mg_get_plot_left(args)) / 2; - }).attr('dx', args.x_label_nudge_x != null ? args.x_label_nudge_x : 0).attr('y', function () { - var xAxisTextElement = d3.select(args.target).select('.mg-x-axis text').node().getBoundingClientRect(); - return mg_get_bottom(args) + args.xax_tick_length * (7 / 3) + xAxisTextElement.height * 0.8 + 10; - }).attr('dy', '.5em').attr('text-anchor', 'middle').text(function (d) { - return args.x_label; - }); - } -} - -function mg_default_bar_xax_format(args) { - return function (d) { - if (d < 1.0 && d > -1.0 && d !== 0) { - // don't scale tiny values - return args.xax_units + d.toFixed(args.decimals); - } else { - var pf = d3.format(',.0f'); - return args.xax_units + pf(d); - } - }; -} - -function mg_get_time_frame(diff) { - // diff should be (max_x - min_x) / 1000, in other words, the difference in seconds. - var time_frame; - if (mg_milisec_diff(diff)) { - time_frame = 'millis'; - } else if (mg_sec_diff(diff)) { - time_frame = 'seconds'; - } else if (mg_day_diff(diff)) { - time_frame = 'less-than-a-day'; - } else if (mg_four_days(diff)) { - time_frame = 'four-days'; - } else if (mg_many_days(diff)) { - // a handful of months? - time_frame = 'many-days'; - } else if (mg_many_months(diff)) { - time_frame = 'many-months'; - } else if (mg_years(diff)) { - time_frame = 'years'; - } else { - time_frame = 'default'; - } - return time_frame; -} - -function mg_milisec_diff(diff) { - return diff < 1; -} - -function mg_sec_diff(diff) { - return diff < 60; -} - -function mg_day_diff(diff) { - return diff / (60 * 60) < 24; -} - -function mg_four_days(diff) { - return diff / (60 * 60) < 24 * 4; -} - -function mg_many_days(diff) { - return diff / (60 * 60 * 24) < 60; -} - -function mg_many_months(diff) { - return diff / (60 * 60 * 24) < 365; -} - -function mg_years(diff) { - return diff / (60 * 60 * 24) >= 365; -} - -function mg_get_time_format(utc, diff) { - var main_time_format; - if (mg_milisec_diff(diff)) { - main_time_format = MG.time_format(utc, '%M:%S.%L'); - } else if (mg_sec_diff(diff)) { - main_time_format = MG.time_format(utc, '%M:%S'); - } else if (mg_day_diff(diff)) { - main_time_format = MG.time_format(utc, '%H:%M'); - } else if (mg_four_days(diff) || mg_many_days(diff)) { - main_time_format = MG.time_format(utc, '%b %d'); - } else if (mg_many_months(diff)) { - main_time_format = MG.time_format(utc, '%b'); - } else { - main_time_format = MG.time_format(utc, '%Y'); - } - return main_time_format; -} - -function mg_process_time_format(args) { - if (args.time_series) { - var diff = (args.processed.max_x - args.processed.min_x) / 1000; - var tickDiff = (args.processed.x_ticks[1] - args.processed.x_ticks[0]) / 1000; - args.processed.x_time_frame = mg_get_time_frame(diff); - args.processed.x_tick_diff_time_frame = mg_get_time_frame(tickDiff); - args.processed.main_x_time_format = mg_get_time_format(args.utc_time, tickDiff); - } -} - -function mg_default_xax_format(args) { - if (args.xax_format) { - return args.xax_format; - } - - var data = args.processed.original_data || args.data; - var flattened = mg_flatten_array(data)[0]; - var test_point_x = flattened[args.processed.original_x_accessor || args.x_accessor]; - if (test_point_x === undefined) { - test_point_x = flattened; - } - - return function (d) { - mg_process_time_format(args); - - if (mg_is_date(test_point_x)) { - return args.processed.main_x_time_format(new Date(d)); - } else if (typeof test_point_x === 'number') { - var is_float = d % 1 !== 0; - var pf; - - if (is_float) { - pf = d3.format(',.' + args.decimals + 'f'); - } else if (d < 1000) { - pf = d3.format(',.0f'); - } else { - pf = d3.format(',.2s'); - } - return args.xax_units + pf(d); - } else { - return args.xax_units + d; - } - }; -} - -function mg_add_x_ticks(g, args) { - mg_process_scale_ticks(args, 'x'); - mg_add_x_axis_rim(args, g); - mg_add_x_axis_tick_lines(args, g); -} - -function mg_add_x_axis_rim(args, g) { - var last_i = args.scales.X.ticks(args.xax_count).length - 1; - - if (!args.x_extended_ticks) { - g.append('line').attr('x1', function () { - if (args.xax_count === 0) { - return mg_get_plot_left(args); - } else if (args.axes_not_compact && args.chart_type !== 'bar') { - return args.left; - } else { - return args.scales.X(args.scales.X.ticks(args.xax_count)[0]).toFixed(2); - } - }).attr('x2', function () { - if (args.xax_count === 0 || args.axes_not_compact && args.chart_type !== 'bar') { - return mg_get_right(args); - } else { - return args.scales.X(args.scales.X.ticks(args.xax_count)[last_i]).toFixed(2); - } - }).attr('y1', args.height - args.bottom).attr('y2', args.height - args.bottom); - } -} - -function mg_add_x_axis_tick_lines(args, g) { - g.selectAll('.mg-xax-ticks').data(args.processed.x_ticks).enter().append('line').attr('x1', function (d) { - return args.scales.X(d).toFixed(2); - }).attr('x2', function (d) { - return args.scales.X(d).toFixed(2); - }).attr('y1', args.height - args.bottom).attr('y2', function () { - return args.x_extended_ticks ? args.top : args.height - args.bottom + args.xax_tick_length; - }).attr('class', function () { - if (args.x_extended_ticks) { - return 'mg-extended-xax-ticks'; - } - }).classed('mg-xax-ticks', true); -} - -function mg_add_x_tick_labels(g, args) { - mg_add_primary_x_axis_label(args, g); - mg_add_secondary_x_axis_label(args, g); -} - -function mg_add_primary_x_axis_label(args, g) { - var labels = g.selectAll('.mg-xax-labels').data(args.processed.x_ticks).enter().append('text').attr('x', function (d) { - return args.scales.X(d).toFixed(2); - }).attr('y', (args.height - args.bottom + args.xax_tick_length * 7 / 3).toFixed(2)).attr('dy', '.50em').attr('text-anchor', 'middle'); - - if (args.time_series && args.european_clock) { - labels.append('tspan').classed('mg-european-hours', true).text(function (_d, i) { - var d = new Date(_d); - if (i === 0) return d3.timeFormat('%H')(d);else return ''; - }); - labels.append('tspan').classed('mg-european-minutes-seconds', true).text(function (_d, i) { - var d = new Date(_d); - return ':' + args.processed.xax_format(d); - }); - } else { - labels.text(function (d) { - return args.xax_units + args.processed.xax_format(d); - }); - } - - // CHECK TO SEE IF OVERLAP for labels. If so, - // remove half of them. This is a dirty hack. - // We will need to figure out a more principled way of doing this. - if (mg_elements_are_overlapping(labels)) { - labels.filter(function (d, i) { - return (i + 1) % 2 === 0; - }).remove(); - - var svg = mg_get_svg_child_of(args.target); - svg.selectAll('.mg-xax-ticks').filter(function (d, i) { - return (i + 1) % 2 === 0; - }).remove(); - } -} - -function mg_add_secondary_x_axis_label(args, g) { - if (args.time_series && (args.show_years || args.show_secondary_x_label)) { - mg_add_secondary_x_axis_elements(args, g); - } -} - -function mg_get_yformat_and_secondary_time_function(args) { - var tf = { - timeframe: args.processed.x_time_frame, - tick_diff_timeframe: args.processed.x_tick_diff_time_frame - }; - switch (tf.timeframe) { - case 'millis': - case 'seconds': - tf.secondary = d3.timeDays; - if (args.european_clock) tf.yformat = MG.time_format(args.utc_time, '%b %d');else tf.yformat = MG.time_format(args.utc_time, '%I %p'); - break; - case 'less-than-a-day': - tf.secondary = d3.timeDays; - tf.yformat = MG.time_format(args.utc_time, '%b %d'); - break; - case 'four-days': - tf.secondary = d3.timeDays; - tf.yformat = MG.time_format(args.utc_time, '%b %d'); - break; - case 'many-days': - tf.secondary = d3.timeYears; - tf.yformat = MG.time_format(args.utc_time, '%Y'); - break; - case 'many-months': - tf.secondary = d3.timeYears; - tf.yformat = MG.time_format(args.utc_time, '%Y'); - break; - default: - tf.secondary = d3.timeYears; - tf.yformat = MG.time_format(args.utc_time, '%Y'); - } - return tf; -} - -function mg_add_secondary_x_axis_elements(args, g) { - var tf = mg_get_yformat_and_secondary_time_function(args); - - var years = tf.secondary(args.processed.min_x, args.processed.max_x); - if (years.length === 0) { - var first_tick = args.scales.X.ticks(args.xax_count)[0]; - years = [first_tick]; - } - - var yg = mg_add_g(g, 'mg-year-marker'); - if (tf.timeframe === 'default' && args.show_year_markers) { - mg_add_year_marker_line(args, yg, years, tf.yformat); - } - if (tf.tick_diff_time_frame != 'years') mg_add_year_marker_text(args, yg, years, tf.yformat); -} - -function mg_add_year_marker_line(args, g, years, yformat) { - g.selectAll('.mg-year-marker').data(years).enter().append('line').attr('x1', function (d) { - return args.scales.X(d).toFixed(2); - }).attr('x2', function (d) { - return args.scales.X(d).toFixed(2); - }).attr('y1', mg_get_top(args)).attr('y2', mg_get_bottom(args)); -} - -function mg_add_year_marker_text(args, g, years, yformat) { - g.selectAll('.mg-year-marker').data(years).enter().append('text').attr('x', function (d, i) { - return args.scales.X(d).toFixed(2); - }).attr('y', function () { - var xAxisTextElement = d3.select(args.target).select('.mg-x-axis text').node().getBoundingClientRect(); - return mg_get_bottom(args) + args.xax_tick_length * 7 / 3 + xAxisTextElement.height * 0.8; - }).attr('dy', '.50em').attr('text-anchor', 'middle').text(function (d) { - return yformat(new Date(d)); - }); -} - -function mg_min_max_x_for_nonbars(mx, args, data) { - var extent_x = d3.extent(data, function (d) { - return d[args.x_accessor]; - }); - mx.min = extent_x[0]; - mx.max = extent_x[1]; -} - -function mg_min_max_x_for_bars(mx, args, data) { - mx.min = d3.min(data, function (d) { - var trio = [d[args.x_accessor], d[args.baseline_accessor] ? d[args.baseline_accessor] : 0, d[args.predictor_accessor] ? d[args.predictor_accessor] : 0]; - return Math.min.apply(null, trio); - }); - - if (mx.min > 0) mx.min = 0; - - mx.max = d3.max(data, function (d) { - var trio = [d[args.x_accessor], d[args.baseline_accessor] ? d[args.baseline_accessor] : 0, d[args.predictor_accessor] ? d[args.predictor_accessor] : 0]; - return Math.max.apply(null, trio); - }); - return mx; -} - -function mg_min_max_x_for_dates(mx) { - var yesterday = MG.clone(mx.min).setDate(mx.min.getDate() - 1); - var tomorrow = MG.clone(mx.min).setDate(mx.min.getDate() + 1); - mx.min = yesterday; - mx.max = tomorrow; -} - -function mg_min_max_x_for_numbers(mx) { - // TODO do we want to rewrite this? - mx.min = mx.min - 1; - mx.max = mx.max + 1; -} - -function mg_min_max_x_for_strings(mx) { - // TODO shouldn't be allowing strings here to be coerced into numbers - mx.min = Number(mx.min) - 1; - mx.max = Number(mx.max) + 1; -} - -function mg_force_xax_count_to_be_two(args) { - args.xax_count = 2; -} - -function mg_select_xax_format(args) { - var c = args.chart_type; - if (!args.processed.xax_format) { - if (args.xax_format) { - args.processed.xax_format = args.xax_format; - } else { - if (c === 'line' || c === 'point' || c === 'histogram') { - args.processed.xax_format = mg_default_xax_format(args); - } else if (c === 'bar') { - args.processed.xax_format = mg_default_bar_xax_format(args); - } - } - } -} - -function mg_merge_args_with_defaults(args) { - var defaults = { - target: null, - title: null, - description: null - }; - - if (!args) { - args = {}; - } - - if (!args.processed) { - args.processed = {}; - } - - args = merge_with_defaults(args, defaults); - return args; -} - -function mg_is_time_series(args) { - var first_elem = mg_flatten_array(args.processed.original_data || args.data)[0]; - args.time_series = mg_is_date(first_elem[args.processed.original_x_accessor || args.x_accessor]); -} - -function mg_init_compute_width(args) { - var svg_width = parseInt(args.width); - if (args.full_width) { - svg_width = get_width(args.target); - } - if (args.x_axis_type === 'categorical' && svg_width === null) { - svg_width = mg_categorical_calculate_height(args, 'x'); - } - - args.width = svg_width; -} - -function mg_init_compute_height(args) { - var svg_height = parseInt(args.height); - if (args.full_height) { - svg_height = get_height(args.target); - } - if (args.y_axis_type === 'categorical' && svg_height === null) { - svg_height = mg_categorical_calculate_height(args, 'y'); - } - - args.height = svg_height; -} - -function mg_remove_svg_if_chart_type_has_changed(svg, args) { - if (!svg.selectAll('.mg-main-line').empty() && args.chart_type !== 'line' || !svg.selectAll('.mg-points').empty() && args.chart_type !== 'point' || !svg.selectAll('.mg-histogram').empty() && args.chart_type !== 'histogram' || !svg.selectAll('.mg-barplot').empty() && args.chart_type !== 'bar') { - svg.remove(); - } -} - -function mg_add_svg_if_it_doesnt_exist(svg, args) { - if (mg_get_svg_child_of(args.target).empty()) { - svg = d3.select(args.target).append('svg').classed('linked', args.linked).attr('width', args.width).attr('height', args.height); - } - return svg; -} - -function mg_add_clip_path_for_plot_area(svg, args) { - svg.selectAll('.mg-clip-path').remove(); - svg.append('defs').attr('class', 'mg-clip-path').append('clipPath').attr('id', 'mg-plot-window-' + mg_target_ref(args.target)).append('svg:rect').attr('x', mg_get_left(args)).attr('y', mg_get_top(args)).attr('width', args.width - args.left - args.right - args.buffer).attr('height', args.height - args.top - args.bottom - args.buffer + 1); -} - -function mg_adjust_width_and_height_if_changed(svg, args) { - if (args.width !== Number(svg.attr('width'))) { - svg.attr('width', args.width); - } - if (args.height !== Number(svg.attr('height'))) { - svg.attr('height', args.height); - } -} - -function mg_set_viewbox_for_scaling(svg, args) { - // we need to reconsider how we handle automatic scaling - svg.attr('viewBox', '0 0 ' + args.width + ' ' + args.height); - if (args.full_width || args.full_height) { - svg.attr('preserveAspectRatio', 'xMinYMin meet'); - } -} - -function mg_remove_missing_classes_and_text(svg) { - // remove missing class - svg.classed('mg-missing', false); - - // remove missing text - svg.selectAll('.mg-missing-text').remove(); - svg.selectAll('.mg-missing-pane').remove(); -} - -function mg_remove_outdated_lines(svg, args) { - // if we're updating an existing chart and we have fewer lines than - // before, remove the outdated lines, e.g. if we had 3 lines, and we're calling - // data_graphic() on the same target with 2 lines, remove the 3rd line - - var i = 0; - - if (svg.selectAll('.mg-main-line').nodes().length >= args.data.length) { - // now, the thing is we can't just remove, say, line3 if we have a custom - // line-color map, instead, see which are the lines to be removed, and delete those - if (args.custom_line_color_map.length > 0) { - var array_full_series = function array_full_series(len) { - var arr = new Array(len); - for (var i = 0; i < arr.length; i++) { - arr[i] = i + 1; - } - return arr; - }; - - // get an array of lines ids to remove - var lines_to_remove = arr_diff(array_full_series(args.max_data_size), args.custom_line_color_map); - - for (i = 0; i < lines_to_remove.length; i++) { - svg.selectAll('.mg-main-line.mg-line' + lines_to_remove[i] + '-color').remove(); - } - } else { - // if we don't have a custom line-color map, just remove the lines from the end - var num_of_new = args.data.length; - var num_of_existing = svg.selectAll('.mg-main-line').nodes() ? svg.selectAll('.mg-main-line').nodes().length : 0; - - for (i = num_of_existing; i > num_of_new; i--) { - svg.selectAll('.mg-main-line.mg-line' + i + '-color').remove(); - } - } - } -} - -function mg_raise_container_error(container, args) { - if (container.empty()) { - console.warn('The specified target element "' + args.target + '" could not be found in the page. The chart will not be rendered.'); - return; - } -} - -function categoricalInitialization(args, ns) { - var which = ns === 'x' ? args.width : args.height; - mg_categorical_count_number_of_groups(args, ns); - mg_categorical_count_number_of_lanes(args, ns); - mg_categorical_calculate_group_length(args, ns, which); - if (which) mg_categorical_calculate_bar_thickness(args, ns); -} - -function selectXaxFormat(args) { - var c = args.chart_type; - if (!args.processed.xax_format) { - if (args.xax_format) { - args.processed.xax_format = args.xax_format; - } else { - if (c === 'line' || c === 'point' || c === 'histogram') { - args.processed.xax_format = mg_default_xax_format(args); - } else if (c === 'bar') { - args.processed.xax_format = mg_default_bar_xax_format(args); - } - } - } -} - -function mg_categorical_count_number_of_groups(args, ns) { - var accessor_string = ns + 'group_accessor'; - var accessor = args[accessor_string]; - args.categorical_groups = []; - if (accessor) { - var data = args.data[0]; - args.categorical_groups = d3.set(data.map(function (d) { - return d[accessor]; - })).values(); - } -} - -function mg_categorical_count_number_of_lanes(args, ns) { - var accessor_string = ns + 'group_accessor'; - var groupAccessor = args[accessor_string]; - - args.total_bars = args.data[0].length; - if (groupAccessor) { - var group_bars = count_array_elements(pluck(args.data[0], groupAccessor)); - group_bars = d3.max(Object.keys(group_bars).map(function (d) { - return group_bars[d]; - })); - args.bars_per_group = group_bars; - } else { - args.bars_per_group = args.data[0].length; - } -} - -function mg_categorical_calculate_group_length(args, ns, which) { - var groupHeight = ns + 'group_height'; - if (which) { - var gh = ns === 'y' ? (args.height - args.top - args.bottom - args.buffer * 2) / (args.categorical_groups.length || 1) : (args.width - args.left - args.right - args.buffer * 2) / (args.categorical_groups.length || 1); - - args[groupHeight] = gh; - } else { - var step = (1 + args[ns + '_padding_percentage']) * args.bar_thickness; - args[groupHeight] = args.bars_per_group * step + args[ns + '_outer_padding_percentage'] * 2 * step; //args.bar_thickness + (((args.bars_per_group-1) * args.bar_thickness) * (args.bar_padding_percentage + args.bar_outer_padding_percentage*2)); - } -} - -function mg_categorical_calculate_bar_thickness(args, ns) { - // take one group height. - var step = args[ns + 'group_height'] / (args.bars_per_group + args[ns + '_outer_padding_percentage']); - args.bar_thickness = step - step * args[ns + '_padding_percentage']; -} - -function mg_categorical_calculate_height(args, ns) { - var groupContribution = args[ns + 'group_height'] * (args.categorical_groups.length || 1); - - var marginContribution = ns === 'y' ? args.top + args.bottom + args.buffer * 2 : args.left + args.right + args.buffer * 2; - - return groupContribution + marginContribution + args.categorical_groups.length * args[ns + 'group_height'] * (args[ns + 'group_padding_percentage'] + args[ns + 'group_outer_padding_percentage']); -} - -function mg_barchart_extrapolate_group_and_thickness_from_height(args) { - // we need to set args.bar_thickness, group_height -} - -function init(args) { - 'use strict'; - - args = arguments[0]; - args = mg_merge_args_with_defaults(args); - // If you pass in a dom element for args.target, the expectation - // of a string elsewhere will break. - var container = d3.select(args.target); - mg_raise_container_error(container, args); - - var svg = container.selectAll('svg'); - - // some things that will need to be calculated if we have a categorical axis. - if (args.y_axis_type === 'categorical') { - categoricalInitialization(args, 'y'); - } - if (args.x_axis_type === 'categorical') { - categoricalInitialization(args, 'x'); - } - - selectXaxFormat(args); - - mg_is_time_series(args); - mg_init_compute_width(args); - mg_init_compute_height(args); - - mg_remove_svg_if_chart_type_has_changed(svg, args); - svg = mg_add_svg_if_it_doesnt_exist(svg, args); - - mg_add_clip_path_for_plot_area(svg, args); - mg_adjust_width_and_height_if_changed(svg, args); - mg_set_viewbox_for_scaling(svg, args); - mg_remove_missing_classes_and_text(svg); - chart_title(args); - mg_remove_outdated_lines(svg, args); - - return this; -} - -MG.init = init; - -function mg_return_label(d) { - return d.label; -} - -function mg_remove_existing_markers(svg) { - svg.selectAll('.mg-markers').remove(); - svg.selectAll('.mg-baselines').remove(); -} - -function mg_in_range(args) { - return function (d) { - return args.scales.X(d[args.x_accessor]) >= mg_get_plot_left(args) && args.scales.X(d[args.x_accessor]) <= mg_get_plot_right(args); - }; -} - -function mg_x_position(args) { - return function (d) { - return args.scales.X(d[args.x_accessor]); - }; -} - -function mg_x_position_fixed(args) { - var _mg_x_pos = mg_x_position(args); - return function (d) { - return _mg_x_pos(d).toFixed(2); - }; -} - -function mg_y_position_fixed(args) { - var _mg_y_pos = args.scales.Y; - return function (d) { - return _mg_y_pos(d.value).toFixed(2); - }; -} - -function mg_place_annotations(checker, class_name, args, svg, line_fcn, text_fcn) { - var g; - if (checker) { - g = svg.append('g').attr('class', class_name); - line_fcn(g, args); - text_fcn(g, args); - } -} - -function mg_place_markers(args, svg) { - mg_place_annotations(args.markers, 'mg-markers', args, svg, mg_place_marker_lines, mg_place_marker_text); -} - -function mg_place_baselines(args, svg) { - mg_place_annotations(args.baselines, 'mg-baselines', args, svg, mg_place_baseline_lines, mg_place_baseline_text); -} - -function mg_place_marker_lines(gm, args) { - var x_pos_fixed = mg_x_position_fixed(args); - gm.selectAll('.mg-markers').data(args.markers.filter(mg_in_range(args))).enter().append('line').attr('x1', x_pos_fixed).attr('x2', x_pos_fixed).attr('y1', args.top).attr('y2', mg_get_plot_bottom(args)).attr('class', function (d) { - return d.lineclass; - }).attr('stroke-dasharray', '3,1'); -} - -function mg_place_marker_text(gm, args) { - gm.selectAll('.mg-markers').data(args.markers.filter(mg_in_range(args))).enter().append('text').attr('class', function (d) { - return d.textclass || ''; - }).classed('mg-marker-text', true).attr('x', mg_x_position(args)).attr('y', args.x_axis_position === 'bottom' ? mg_get_top(args) * 0.95 : mg_get_bottom(args) + args.buffer).attr('text-anchor', 'middle').text(mg_return_label).each(function (d) { - if (d.click) { - d3.select(this).style('cursor', 'pointer').on('click', d.click); - } - if (d.mouseover) { - d3.select(this).style('cursor', 'pointer').on('mouseover', d.mouseover); - } - if (d.mouseout) { - d3.select(this).style('cursor', 'pointer').on('mouseout', d.mouseout); - } - }); - - mg_prevent_horizontal_overlap(gm.selectAll('.mg-marker-text').nodes(), args); -} - -function mg_place_baseline_lines(gb, args) { - var y_pos = mg_y_position_fixed(args); - gb.selectAll('.mg-baselines').data(args.baselines).enter().append('line').attr('x1', mg_get_plot_left(args)).attr('x2', mg_get_plot_right(args)).attr('y1', y_pos).attr('y2', y_pos); -} - -function mg_place_baseline_text(gb, args) { - var y_pos = mg_y_position_fixed(args); - gb.selectAll('.mg-baselines').data(args.baselines).enter().append('text').attr('x', mg_get_plot_right(args)).attr('y', y_pos).attr('dy', -3).attr('text-anchor', 'end').text(mg_return_label); -} - -function markers(args) { - 'use strict'; - - var svg = mg_get_svg_child_of(args.target); - mg_remove_existing_markers(svg); - mg_place_markers(args, svg); - mg_place_baselines(args, svg); - return this; -} - -MG.markers = markers; - -function mg_clear_mouseover_container(svg) { - svg.selectAll('.mg-active-datapoint-container').selectAll('*').remove(); -} - -function mg_setup_mouseover_container(svg, args) { - svg.select('.mg-active-datapoint').remove(); - var text_anchor = args.mouseover_align === 'right' ? 'end' : args.mouseover_align === 'left' ? 'start' : 'middle'; - - var mouseover_x = args.mouseover_align === 'right' ? mg_get_plot_right(args) : args.mouseover_align === 'left' ? mg_get_plot_left(args) : (args.width - args.left - args.right) / 2 + args.left; - - var active_datapoint = svg.select('.mg-active-datapoint-container').append('text').attr('class', 'mg-active-datapoint').attr('xml:space', 'preserve').attr('text-anchor', text_anchor); - - // set the rollover text's position; if we have markers on two lines, - // nudge up the rollover text a bit - var active_datapoint_y_nudge = 0.75; - - var y_position = args.x_axis_position === 'bottom' ? mg_get_top(args) * active_datapoint_y_nudge : mg_get_bottom(args) + args.buffer * 3; - - if (args.markers) { - var yPos; - svg.selectAll('.mg-marker-text').each(function () { - if (!yPos) { - yPos = d3.select(this).attr('y'); - } else if (yPos !== d3.select(this).attr('y')) { - active_datapoint_y_nudge = 0.56; - } - }); - } - - active_datapoint.attr('transform', 'translate(' + mouseover_x + ',' + y_position + ')'); -} - -function mg_mouseover_tspan(svg, text) { - var tspan = svg.append('tspan').text(text); - - return { - bold: function bold() { - return tspan.attr('font-weight', 'bold'); - }, - font_size: function font_size(pts) { - return tspan.attr('font-size', pts); - }, - x: function x(_x2) { - return tspan.attr('x', _x2); - }, - y: function y(_y2) { - return tspan.attr('y', _y2); - }, - elem: tspan - }; -} - -function mg_reset_text_container(svg) { - var textContainer = svg.select('.mg-active-datapoint'); - textContainer.selectAll('*').remove(); - return textContainer; -} - -function mg_mouseover_row(row_number, container, rargs) { - var lineHeight = 1.1; - var rrr = container.append('tspan').attr('x', 0).attr('y', row_number * lineHeight + 'em'); - - return { - rargs: rargs, - text: function text(_text) { - return mg_mouseover_tspan(rrr, _text); - } - }; -} - -function mg_mouseover_text(args, rargs) { - mg_setup_mouseover_container(rargs.svg, args); - - var mouseOver = { - row_number: 0, - rargs: rargs, - mouseover_row: function mouseover_row(rargs) { - mouseOver.row_number += 1; - return mg_mouseover_row(mouseOver.row_number, mouseOver.text_container, rargs); - }, - text_container: mg_reset_text_container(rargs.svg) - }; - - return mouseOver; -} - -{ - - var filter_in_range_data = function filter_in_range_data(args, range) { - var is_data_in_range = function is_data_in_range(data, range) { - return data > Math.min(range[0], range[1]) && data < Math.max(range[0], range[1]); - }; - // if range without this axis return true, else judge is data in range or not. - return function (d) { - return ['x', 'y'].every(function (dim) { - return !(dim in range) || is_data_in_range(d[args[dim + '_accessor']], range[dim]); - }); - }; - }; - - // the range here is the range of data - // range is an object with two optional attributes of x,y, respectively represent ranges on two axes - var zoom_to_data_domain = function zoom_to_data_domain(args, range) { - var raw_data = args.processed.raw_data || args.data; - // store raw data and raw domain to in order to zoom back to the initial state - if (!('raw_data' in args.processed)) { - args.processed.raw_domain = { - x: args.scales.X.domain(), - y: args.scales.Y.domain() - }; - args.processed.raw_data = raw_data; - } - // to avoid drawing outside the chart in the point chart, unnecessary in line chart. - if (args.chart_type === 'point') { - if (is_array_of_arrays(raw_data)) { - args.data = raw_data.map(function (d) { - return d.filter(filter_in_range_data(args, range)); - }); - } else { - args.data = raw_data.filter(filter_in_range_data(args, range)); - } - } - ['x', 'y'].forEach(function (dim) { - if (dim in range) args.processed['zoom_' + dim] = range[dim];else delete args.processed['zoom_' + dim]; - }); - if (args.processed.subplot) { - if (range !== args.processed.raw_domain) { - MG.create_brushing_pattern(args.processed.subplot, convert_domain_to_range(args.processed.subplot, range)); - } else { - MG.remove_brushing_pattern(args.processed.subplot); - } - } - new MG.charts[args.chart_type || defaults.chart_type].descriptor(args); - }; - - var zoom_to_raw_range = function zoom_to_raw_range(args) { - if (!('raw_domain' in args.processed)) return; - zoom_to_data_domain(args, args.processed.raw_domain); - delete args.processed.raw_domain; - delete args.processed.raw_data; - }; - - // converts the range of selection into the range of data that we can use to - // zoom the chart to a particular region - var convert_range_to_domain = function convert_range_to_domain(args, range) { - return ['x', 'y'].reduce(function (domain, dim) { - if (!(dim in range)) return domain; - domain[dim] = range[dim].map(function (v) { - return +args.scales[dim.toUpperCase()].invert(v); - }); - if (dim === 'y') domain[dim].reverse(); - return domain; - }, {}); - }; - - var convert_domain_to_range = function convert_domain_to_range(args, domain) { - return ['x', 'y'].reduce(function (range, dim) { - if (!(dim in domain)) return range; - range[dim] = domain[dim].map(function (v) { - return +args.scales[dim.toUpperCase()](v); - }); - if (dim === 'y') range[dim].reverse(); - return range; - }, {}); - }; - - // the range here is the range of selection - var zoom_to_data_range = function zoom_to_data_range(args, range) { - var domain = convert_range_to_domain(args, range); - zoom_to_data_domain(args, domain); - }; - - MG.convert_range_to_domain = convert_range_to_domain; - MG.zoom_to_data_domain = zoom_to_data_domain; - MG.zoom_to_data_range = zoom_to_data_range; - MG.zoom_to_raw_range = zoom_to_raw_range; -} - -{ - - var get_extent_rect = function get_extent_rect(args) { - return d3.select(args.target).select('.mg-extent').size() ? d3.select(args.target).select('.mg-extent') : d3.select(args.target).select('.mg-rollover-rect, .mg-voronoi').insert('g', '*').classed('mg-brush', true).append('rect').classed('mg-extent', true); - }; - - var create_brushing_pattern = function create_brushing_pattern(args, range) { - var x = range.x[0]; - var width = range.x[1] - range.x[0]; - var y = range.y[0]; - var height = range.y[1] - range.y[0]; - get_extent_rect(args).attr('x', x).attr('width', width).attr('y', y).attr('height', height).attr('opacity', 1); - }; - - var remove_brushing_pattern = function remove_brushing_pattern(args) { - get_extent_rect(args).attr('width', 0).attr('height', 0).attr('opacity', 0); - }; - - var add_event_handler_for_brush = function add_event_handler_for_brush(args, target, axis) { - var svg = d3.select(args.target).select('svg'); - var rollover = svg.select('.mg-rollover-rect, .mg-voronoi'); - var container = rollover.node(); - var isDragging = false; - var mouseDown = false; - var origin = []; - - var calculateSelectionRange = function calculateSelectionRange() { - var min_x = args.left; - var max_x = args.width - args.right - args.buffer; - var min_y = args.top; - var max_y = args.height - args.bottom - args.buffer; - var mouse = d3.mouse(container); - var range = {}; - range.x = axis.x ? [Math.max(min_x, Math.min(origin[0], mouse[0])), Math.min(max_x, Math.max(origin[0], mouse[0]))] : [min_x, max_x]; - range.y = axis.y ? [Math.max(min_y, Math.min(origin[1], mouse[1])), Math.min(max_y, Math.max(origin[1], mouse[1]))] : [min_y, max_y]; - return range; - }; - - rollover.classed('mg-brush-container', true); - rollover.on('mousedown.' + args.target, function () { - mouseDown = true; - isDragging = false; - origin = d3.mouse(container); - svg.classed('mg-brushed', false); - svg.classed('mg-brushing-in-progress', true); - remove_brushing_pattern(args); - }); - d3.select(document).on('mousemove.' + args.target, function () { - if (mouseDown) { - isDragging = true; - rollover.classed('mg-brushing', true); - create_brushing_pattern(args, calculateSelectionRange()); - } - }); - d3.select(document).on('mouseup.' + args.target, function () { - if (!mouseDown) return; - mouseDown = false; - svg.classed('mg-brushing-in-progress', false); - var range = calculateSelectionRange(); - if (isDragging) { - isDragging = false; - if (target === args) { - MG.zoom_to_data_range(target, range); - svg.select('.mg-rollover-rect, .mg-voronoi').classed('mg-brushed', true); - } else { - var domain = MG.convert_range_to_domain(args, range); - MG.zoom_to_data_domain(target, domain); - } - } else { - MG.zoom_to_raw_range(target); - } - if (mg_is_function(args.brushing_selection_changed)) args.brushing_selection_changed(args, range); - }); - }; - - var add_brush_function = function add_brush_function(args) { - if (args.x_axis_type === 'categorical' || args.y_axis_type === 'categorical') return console.warn('The option "brush" does not support axis type "categorical" currently.'); - if (!args.zoom_target) args.zoom_target = args; - if (args.zoom_target !== args) args.zoom_target.processed.subplot = args; - var brush_axis = void 0; - switch (args.brush) { - case 'x': - brush_axis = { x: true, y: false }; - break; - case 'y': - brush_axis = { x: false, y: true }; - break; - case 'xy': - brush_axis = { x: true, y: true }; - break; - default: - brush_axis = { x: true, y: true }; - } - add_event_handler_for_brush(args, args.zoom_target, brush_axis); - }; - - MG.add_brush_function = add_brush_function; - MG.create_brushing_pattern = create_brushing_pattern; - MG.remove_brushing_pattern = remove_brushing_pattern; -} - -function MG_WindowResizeTracker() { - var targets = []; - - var Observer; - if (typeof MutationObserver !== "undefined") { - Observer = MutationObserver; - } else if (typeof WebKitMutationObserver !== "undefined") { - Observer = WebKitMutationObserver; - } - - function window_listener() { - targets.forEach(function (target) { - var svg = d3.select(target).select('svg'); - - // skip if svg is not visible - if (!svg.empty() && (svg.node().parentNode.offsetWidth > 0 || svg.node().parentNode.offsetHeight > 0)) { - var aspect = svg.attr('width') !== 0 ? svg.attr('height') / svg.attr('width') : 0; - - var newWidth = get_width(target); - - svg.attr('width', newWidth); - svg.attr('height', aspect * newWidth); - } - }); - } - - function remove_target(target) { - var index = targets.indexOf(target); - if (index !== -1) { - targets.splice(index, 1); - } - - if (targets.length === 0) { - window.removeEventListener('resize', window_listener, true); - } - } - - return { - add_target: function add_target(target) { - if (targets.length === 0) { - window.addEventListener('resize', window_listener, true); - } - - if (targets.indexOf(target) === -1) { - targets.push(target); - - if (Observer) { - var observer = new Observer(function (mutations) { - var targetNode = d3.select(target).node(); - - if (!targetNode || mutations.some(function (mutation) { - for (var i = 0; i < mutation.removedNodes.length; i++) { - if (mutation.removedNodes[i] === targetNode) { - return true; - } - } - })) { - observer.disconnect(); - remove_target(target); - } - }); - - observer.observe(d3.select(target).node().parentNode, { childList: true }); - } - } - } - }; -} - -var mg_window_resize_tracker = new MG_WindowResizeTracker(); - -function mg_window_listeners(args) { - mg_if_aspect_ratio_resize_svg(args); -} - -function mg_if_aspect_ratio_resize_svg(args) { - // have we asked the svg to fill a div, if so resize with div - if (args.full_width || args.full_height) { - mg_window_resize_tracker.add_target(args.target); - } -} - -if (mg_jquery_exists()) { - /*! - * Bootstrap v3.3.1 (http://getbootstrap.com) - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ - - /*! - * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=c3834cc5b59ef727da53) - * Config saved to config.json and https://gist.github.com/c3834cc5b59ef727da53 - */ - - /* ======================================================================== - * Bootstrap: dropdown.js v3.3.1 - * http://getbootstrap.com/javascript/#dropdowns - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - +function ($) { - 'use strict'; - - if (typeof $().dropdown == 'function') return true; - - // DROPDOWN CLASS DEFINITION - // ========================= - - var backdrop = '.dropdown-backdrop'; - var toggle = '[data-toggle="dropdown"]'; - var Dropdown = function Dropdown(element) { - $(element).on('click.bs.dropdown', this.toggle); - }; - - Dropdown.VERSION = '3.3.1'; - - Dropdown.prototype.toggle = function (e) { - var $this = $(this); - - if ($this.is('.disabled, :disabled')) return; - - var $parent = getParent($this); - var isActive = $parent.hasClass('open'); - - clearMenus(); - - if (!isActive) { - if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { - // if mobile we use a backdrop because click events don't delegate - $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus); - } - - var relatedTarget = { relatedTarget: this }; - $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget)); - - if (e.isDefaultPrevented()) return; - - $this.trigger('focus').attr('aria-expanded', 'true'); - - $parent.toggleClass('open').trigger('shown.bs.dropdown', relatedTarget); - } - - return false; - }; - - Dropdown.prototype.keydown = function (e) { - if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return; - - var $this = $(this); - - e.preventDefault(); - e.stopPropagation(); - - if ($this.is('.disabled, :disabled')) return; - - var $parent = getParent($this); - var isActive = $parent.hasClass('open'); - - if (!isActive && e.which != 27 || isActive && e.which == 27) { - if (e.which == 27) $parent.find(toggle).trigger('focus'); - return $this.trigger('click'); - } - - var desc = ' li:not(.divider):visible a'; - var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc); - - if (!$items.length) return; - - var index = $items.index(e.target); - - if (e.which == 38 && index > 0) index--; // up - if (e.which == 40 && index < $items.length - 1) index++; // down - if (!~index) index = 0; - - $items.eq(index).trigger('focus'); - }; - - function clearMenus(e) { - if (e && e.which === 3) return; - $(backdrop).remove(); - $(toggle).each(function () { - var $this = $(this); - var $parent = getParent($this); - var relatedTarget = { relatedTarget: this }; - - if (!$parent.hasClass('open')) return; - - $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)); - - if (e.isDefaultPrevented()) return; - - $this.attr('aria-expanded', 'false'); - $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget); - }); - } - - function getParent($this) { - var selector = $this.attr('data-target'); - - if (!selector) { - selector = $this.attr('href'); - selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, ''); // strip for ie7 - } - - var $parent = selector && $(selector); - - return $parent && $parent.length ? $parent : $this.parent(); - } - - // DROPDOWN PLUGIN DEFINITION - // ========================== - - function Plugin(option) { - return this.each(function () { - var $this = $(this); - var data = $this.data('bs.dropdown'); - - if (!data) $this.data('bs.dropdown', data = new Dropdown(this)); - if (typeof option == 'string') data[option].call($this); - }); - } - - var old = $.fn.dropdown; - - $.fn.dropdown = Plugin; - $.fn.dropdown.Constructor = Dropdown; - - // DROPDOWN NO CONFLICT - // ==================== - - $.fn.dropdown.noConflict = function () { - $.fn.dropdown = old; - return this; - }; - - // APPLY TO STANDARD DROPDOWN ELEMENTS - // =================================== - - $(document).on('click.bs.dropdown.data-api', clearMenus).on('click.bs.dropdown.data-api', '.dropdown form', function (e) { - e.stopPropagation(); - }).on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle).on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown).on('keydown.bs.dropdown.data-api', '[role="menu"]', Dropdown.prototype.keydown).on('keydown.bs.dropdown.data-api', '[role="listbox"]', Dropdown.prototype.keydown); - }(jQuery); -} - -MG.button_layout = function (target) { - 'use strict'; - - this.target = target; - this.feature_set = {}; - this.public_name = {}; - this.sorters = {}; - this.manual = []; - this.manual_map = {}; - this.manual_callback = {}; - - this._strip_punctuation = function (s) { - var punctuationless = s.replace(/[^a-zA-Z0-9 _]+/g, ''); - var finalString = punctuationless.replace(/ +?/g, ''); - return finalString; - }; - - this.data = function (data) { - this._data = data; - return this; - }; - - this.manual_button = function (feature, feature_set, callback) { - this.feature_set[feature] = feature_set; - this.manual_map[this._strip_punctuation(feature)] = feature; - this.manual_callback[feature] = callback; // the default is going to be the first feature. - return this; - }; - - this.button = function (feature) { - if (arguments.length > 1) { - this.public_name[feature] = arguments[1]; - } - - if (arguments.length > 2) { - this.sorters[feature] = arguments[2]; - } - - this.feature_set[feature] = []; - return this; - }; - - this.callback = function (callback) { - this._callback = callback; - return this; - }; - - this.display = function () { - var callback = this._callback; - var manual_callback = this.manual_callback; - var manual_map = this.manual_map; - - var d, f, features, feat; - features = Object.keys(this.feature_set); - - var mapDtoF = function mapDtoF(f) { - return d[f]; - }; - - var i; - - // build out this.feature_set with this.data - for (i = 0; i < this._data.length; i++) { - d = this._data[i]; - f = features.map(mapDtoF); - for (var j = 0; j < features.length; j++) { - feat = features[j]; - if (this.feature_set[feat].indexOf(f[j]) === -1) { - this.feature_set[feat].push(f[j]); - } - } - } - - for (feat in this.feature_set) { - if (this.sorters.hasOwnProperty(feat)) { - this.feature_set[feat].sort(this.sorters[feat]); - } - } - - $(this.target).empty(); - - $(this.target).append("<div class='col-lg-12 segments text-center'></div>"); - - var dropdownLiAClick = function dropdownLiAClick() { - var k = $(this).data('key'); - var feature = $(this).data('feature'); - var manual_feature; - $('.' + feature + '-btns button.btn span.title').html(k); - if (!manual_map.hasOwnProperty(feature)) { - callback(feature, k); - } else { - manual_feature = manual_map[feature]; - manual_callback[manual_feature](k); - } - - return false; - }; - - for (var feature in this.feature_set) { - features = this.feature_set[feature]; - $(this.target + ' div.segments').append('<div class="btn-group ' + this._strip_punctuation(feature) + '-btns text-left">' + // This never changes. - '<button type="button" class="btn btn-default btn-lg dropdown-toggle" data-toggle="dropdown">' + "<span class='which-button'>" + (this.public_name.hasOwnProperty(feature) ? this.public_name[feature] : feature) + "</span>" + "<span class='title'>" + (this.manual_callback.hasOwnProperty(feature) ? this.feature_set[feature][0] : 'all') + "</span>" + // if a manual button, don't default to all in label. - '<span class="caret"></span>' + '</button>' + '<ul class="dropdown-menu" role="menu">' + (!this.manual_callback.hasOwnProperty(feature) ? '<li><a href="#" data-feature="' + feature + '" data-key="all">All</a></li>' : "") + (!this.manual_callback.hasOwnProperty(feature) ? '<li class="divider"></li>' : "") + '</ul>' + '</div>'); - - for (i = 0; i < features.length; i++) { - if (features[i] !== 'all' && features[i] !== undefined) { - // strange bug with undefined being added to manual buttons. - $(this.target + ' div.' + this._strip_punctuation(feature) + '-btns ul.dropdown-menu').append('<li><a href="#" data-feature="' + this._strip_punctuation(feature) + '" data-key="' + features[i] + '">' + features[i] + '</a></li>'); - } - } - - $('.' + this._strip_punctuation(feature) + '-btns .dropdown-menu li a').on('click', dropdownLiAClick); - } - - return this; - }; - - return this; -}; - -{ - var mg_line_color_text = function mg_line_color_text(elem, _ref, _ref2) { - var line_id = _ref.line_id; - var color = _ref2.color, - colors = _ref2.colors; - - elem.classed('mg-hover-line-color', color === null).classed('mg-hover-line' + line_id + '-color', colors === null).attr('fill', colors === null ? '' : colors[line_id - 1]); - }; - - var mg_line_graph_generators = function mg_line_graph_generators(args, plot, svg) { - mg_add_line_generator(args, plot); - mg_add_area_generator(args, plot); - mg_add_flat_line_generator(args, plot); - mg_add_confidence_band_generator(args, plot, svg); - }; - - var mg_add_confidence_band_generator = function mg_add_confidence_band_generator(args, plot, svg) { - plot.existing_band = svg.selectAll('.mg-confidence-band').nodes(); - if (args.show_confidence_band) { - plot.confidence_area = d3.area().defined(plot.line.defined()).x(args.scalefns.xf).y0(function (d) { - var l = args.show_confidence_band[0]; - if (d[l] != undefined) { - return args.scales.Y(d[l]); - } else { - return args.scales.Y(d[args.y_accessor]); - } - }).y1(function (d) { - var u = args.show_confidence_band[1]; - if (d[u] != undefined) { - return args.scales.Y(d[u]); - } else { - return args.scales.Y(d[args.y_accessor]); - } - }).curve(args.interpolate); - } - }; - - var mg_add_area_generator = function mg_add_area_generator(_ref3, plot) { - var scalefns = _ref3.scalefns, - scales = _ref3.scales, - interpolate = _ref3.interpolate, - flip_area_under_y_value = _ref3.flip_area_under_y_value; - - - var areaBaselineValue = Number.isFinite(flip_area_under_y_value) ? scales.Y(flip_area_under_y_value) : scales.Y.range()[0]; - - plot.area = d3.area().defined(plot.line.defined()).x(scalefns.xf).y0(function () { - return areaBaselineValue; - }).y1(scalefns.yf).curve(interpolate); - }; - - var mg_add_flat_line_generator = function mg_add_flat_line_generator(_ref4, plot) { - var y_accessor = _ref4.y_accessor, - scalefns = _ref4.scalefns, - scales = _ref4.scales, - interpolate = _ref4.interpolate; - - plot.flat_line = d3.line().defined(function (d) { - return (d['_missing'] === undefined || d['_missing'] !== true) && d[y_accessor] !== null; - }).x(scalefns.xf).y(function () { - return scales.Y(plot.data_median); - }).curve(interpolate); - }; - - var mg_add_line_generator = function mg_add_line_generator(_ref5, plot) { - var scalefns = _ref5.scalefns, - interpolate = _ref5.interpolate, - missing_is_zero = _ref5.missing_is_zero, - y_accessor = _ref5.y_accessor; - - plot.line = d3.line().x(scalefns.xf).y(scalefns.yf).curve(interpolate); - - // if missing_is_zero is not set, then hide data points that fall in missing - // data ranges or that have been explicitly identified as missing in the - // data source. - if (!missing_is_zero) { - // a line is defined if the _missing attrib is not set to true - // and the y-accessor is not null - plot.line = plot.line.defined(function (d) { - return (d['_missing'] === undefined || d['_missing'] !== true) && d[y_accessor] !== null; - }); - } - }; - - var mg_add_confidence_band = function mg_add_confidence_band(_ref6, plot, svg, which_line) { - var show_confidence_band = _ref6.show_confidence_band, - transition_on_update = _ref6.transition_on_update, - data = _ref6.data, - target = _ref6.target; - - if (show_confidence_band) { - var confidenceBand = void 0; - if (svg.select('.mg-confidence-band-' + which_line).empty()) { - svg.append('path').attr('class', 'mg-confidence-band mg-confidence-band-' + which_line); - } - - // transition this line's confidence band - confidenceBand = svg.select('.mg-confidence-band-' + which_line); - - confidenceBand.transition().duration(function () { - return transition_on_update ? 1000 : 0; - }).attr('d', plot.confidence_area(data[which_line - 1])).attr('clip-path', 'url(#mg-plot-window-' + mg_target_ref(target) + ')'); - } - }; - - var mg_add_area = function mg_add_area(_ref7, plot, svg, which_line, line_id) { - var data = _ref7.data, - target = _ref7.target, - colors = _ref7.colors; - - var areas = svg.selectAll('.mg-main-area.mg-area' + line_id); - if (plot.display_area) { - // if area already exists, transition it - if (!areas.empty()) { - svg.node().appendChild(areas.node()); - - areas.transition().duration(plot.update_transition_duration).attr('d', plot.area(data[which_line])).attr('clip-path', 'url(#mg-plot-window-' + mg_target_ref(target) + ')'); - } else { - // otherwise, add the area - svg.append('path').classed('mg-main-area', true).classed('mg-area' + line_id, true).classed('mg-area-color', colors === null).classed('mg-area' + line_id + '-color', colors === null).attr('d', plot.area(data[which_line])).attr('fill', colors === null ? '' : colors[line_id - 1]).attr('clip-path', 'url(#mg-plot-window-' + mg_target_ref(target) + ')'); - } - } else if (!areas.empty()) { - areas.remove(); - } - }; - - var mg_default_color_for_path = function mg_default_color_for_path(this_path, line_id) { - this_path.classed('mg-line-color', true).classed('mg-line' + line_id + '-color', true); - }; - - var mg_color_line = function mg_color_line(_ref8, this_path, which_line, line_id) { - var colors = _ref8.colors; - - if (colors) { - // for now, if args.colors is not an array, then keep moving as if nothing happened. - // if args.colors is not long enough, default to the usual line_id color. - if (colors.constructor === Array) { - this_path.attr('stroke', colors[which_line]); - if (colors.length < which_line + 1) { - // Go with default coloring. - // this_path.classed('mg-line' + (line_id) + '-color', true); - mg_default_color_for_path(this_path, line_id); - } - } else { - // this_path.classed('mg-line' + (line_id) + '-color', true); - mg_default_color_for_path(this_path, line_id); - } - } else { - // this is the typical workflow - // this_path.classed('mg-line' + (line_id) + '-color', true); - mg_default_color_for_path(this_path, line_id); - } - }; - - var mg_add_line_element = function mg_add_line_element(_ref9, plot, this_path, which_line) { - var animate_on_load = _ref9.animate_on_load, - data = _ref9.data, - y_accessor = _ref9.y_accessor, - target = _ref9.target; - - if (animate_on_load) { - plot.data_median = d3.median(data[which_line], function (d) { - return d[y_accessor]; - }); - this_path.attr('d', plot.flat_line(data[which_line])).transition().duration(1000).attr('d', plot.line(data[which_line])).attr('clip-path', 'url(#mg-plot-window-' + mg_target_ref(target) + ')'); - } else { - // or just add the line - this_path.attr('d', plot.line(data[which_line])).attr('clip-path', 'url(#mg-plot-window-' + mg_target_ref(target) + ')'); - } - }; - - var mg_add_line = function mg_add_line(args, plot, svg, existing_line, which_line, line_id) { - if (!existing_line.empty()) { - svg.node().appendChild(existing_line.node()); - - var lineTransition = existing_line.transition().duration(plot.update_transition_duration); - - if (!plot.display_area && args.transition_on_update && !args.missing_is_hidden) { - lineTransition.attrTween('d', path_tween(plot.line(args.data[which_line]), 4)); - } else { - lineTransition.attr('d', plot.line(args.data[which_line])); - } - } else { - // otherwise... - // if we're animating on load, animate the line from its median value - var this_path = svg.append('path').attr('class', 'mg-main-line mg-line' + line_id); - - mg_color_line(args, this_path, which_line, line_id); - mg_add_line_element(args, plot, this_path, which_line); - } - }; - - var mg_add_legend_element = function mg_add_legend_element(args, plot, which_line, line_id) { - var this_legend = void 0; - if (args.legend) { - if (is_array(args.legend)) { - this_legend = args.legend[which_line]; - } else if (is_function(args.legend)) { - this_legend = args.legend(args.data[which_line]); - } - - if (args.legend_target) { - if (args.colors && args.colors.constructor === Array) { - plot.legend_text = '<span style=\'color:' + args.colors[which_line] + '\'>— ' + this_legend + ' </span>' + plot.legend_text; - } else { - plot.legend_text = '<span class=\'mg-line' + line_id + '-legend-color\'>— ' + this_legend + ' </span>' + plot.legend_text; - } - } else { - var anchor_point = void 0, - anchor_orientation = void 0, - dx = void 0; - - if (args.y_axis_position === 'left') { - anchor_point = args.data[which_line][args.data[which_line].length - 1]; - anchor_orientation = 'start'; - dx = args.buffer; - } else { - anchor_point = args.data[which_line][0]; - anchor_orientation = 'end'; - dx = -args.buffer; - } - var legend_text = plot.legend_group.append('svg:text').attr('x', args.scalefns.xf(anchor_point)).attr('dx', dx).attr('y', args.scalefns.yf(anchor_point)).attr('dy', '.35em').attr('font-size', 10).attr('text-anchor', anchor_orientation).attr('font-weight', '300').text(this_legend); - - if (args.colors && args.colors.constructor === Array) { - if (args.colors.length < which_line + 1) { - legend_text.classed('mg-line' + line_id + '-legend-color', true); - } else { - legend_text.attr('fill', args.colors[which_line]); - } - } else { - legend_text.classed('mg-line-legend-color', true).classed('mg-line' + line_id + '-legend-color', true); - } - - mg_prevent_vertical_overlap(plot.legend_group.selectAll('.mg-line-legend text').nodes(), args); - } - } - }; - - var mg_plot_legend_if_legend_target = function mg_plot_legend_if_legend_target(target, legend) { - if (target) d3.select(target).html(legend); - }; - - var mg_add_legend_group = function mg_add_legend_group(_ref10, plot, svg) { - var legend = _ref10.legend; - - if (legend) plot.legend_group = mg_add_g(svg, 'mg-line-legend'); - }; - - var mg_remove_existing_line_rollover_elements = function mg_remove_existing_line_rollover_elements(svg) { - // remove the old rollovers if they already exist - mg_selectAll_and_remove(svg, '.mg-rollover-rect'); - mg_selectAll_and_remove(svg, '.mg-voronoi'); - - // remove the old rollover text and circle if they already exist - mg_selectAll_and_remove(svg, '.mg-active-datapoint'); - mg_selectAll_and_remove(svg, '.mg-line-rollover-circle'); - //mg_selectAll_and_remove(svg, '.mg-active-datapoint-container'); - }; - - var mg_add_rollover_circle = function mg_add_rollover_circle(_ref11, svg) { - var data = _ref11.data, - colors = _ref11.colors; - - // append circle - var circle = svg.selectAll('.mg-line-rollover-circle').data(data).enter().append('circle').attr('cx', 0).attr('cy', 0).attr('r', 0); - - if (colors && colors.constructor === Array) { - circle.attr('class', function (_ref12) { - var line_id = _ref12.line_id; - return 'mg-line' + line_id; - }).attr('fill', function (d, i) { - return colors[i]; - }).attr('stroke', function (d, i) { - return colors[i]; - }); - } else { - circle.attr('class', function (_ref13, i) { - var line_id = _ref13.line_id; - return ['mg-line' + line_id, 'mg-line' + line_id + '-color', 'mg-area' + line_id + '-color'].join(' '); - }); - } - circle.classed('mg-line-rollover-circle', true); - }; - - var mg_set_unique_line_id_for_each_series = function mg_set_unique_line_id_for_each_series(_ref14) { - var data = _ref14.data, - custom_line_color_map = _ref14.custom_line_color_map; - - // update our data by setting a unique line id for each series - // increment from 1... unless we have a custom increment series - - for (var i = 0; i < data.length; i++) { - for (var j = 0; j < data[i].length; j++) { - // Index is saved as original line id for the legend values - data[i][j].index = i + 1; - // if custom line-color map is set, use that instead of line_id (For colors) - if (custom_line_color_map.length > 0) { - data[i][j].line_id = custom_line_color_map[i]; - } else { - data[i][j].line_id = i + 1; - } - } - } - }; - - var mg_nest_data_for_voronoi = function mg_nest_data_for_voronoi(_ref15) { - var data = _ref15.data; - - return d3.merge(data); - }; - - var mg_line_class_string = function mg_line_class_string(args) { - return function (d) { - var class_string = void 0; - - if (args.linked) { - var v = d[args.x_accessor]; - var formatter = MG.time_format(args.utc_time, args.linked_format); - - // only format when x-axis is date - var id = typeof v === 'number' ? d.line_id - 1 : formatter(v); - class_string = 'roll_' + id + ' mg-line' + d.line_id; - - if (args.color === null) { - class_string += ' mg-line' + d.line_id + '-color'; - } - return class_string; - } else { - class_string = 'mg-line' + d.line_id; - if (args.color === null) class_string += ' mg-line' + d.line_id + '-color'; - return class_string; - } - }; - }; - - var mg_add_voronoi_rollover = function mg_add_voronoi_rollover(args, svg, rollover_on, rollover_off, rollover_move, rollover_click) { - var voronoi = d3.voronoi().x(function (d) { - return args.scales.X(d[args.x_accessor]).toFixed(2); - }).y(function (d) { - return args.scales.Y(d[args.y_accessor]).toFixed(2); - }).extent([[args.buffer, args.buffer + (args.title ? args.title_y_position : 0)], [args.width - args.buffer, args.height - args.buffer]]); - - var g = mg_add_g(svg, 'mg-voronoi'); - g.selectAll('path').data(voronoi.polygons(mg_nest_data_for_voronoi(args))).enter().append('path').filter(function (d) { - return d !== undefined && d.length > 0; - }).attr('d', function (d) { - return d == null ? null : 'M' + d.join('L') + 'Z'; - }).datum(function (d) { - return d == null ? null : d.data; - }) // because of d3.voronoi, reassign d - .attr('class', mg_line_class_string(args)).on('click', rollover_click).on('mouseover', rollover_on).on('mouseout', rollover_off).on('mousemove', rollover_move); - - mg_configure_voronoi_rollover(args, svg); - }; - - var nest_data_for_aggregate_rollover = function nest_data_for_aggregate_rollover(_ref16) { - var x_accessor = _ref16.x_accessor, - data = _ref16.data, - x_sort = _ref16.x_sort; - - var data_nested = d3.nest().key(function (d) { - return d[x_accessor]; - }).entries(d3.merge(data)); - data_nested.forEach(function (entry) { - var datum = entry.values[0]; - entry.key = datum[x_accessor]; - }); - - if (x_sort) { - return data_nested.sort(function (a, b) { - return new Date(a.key) - new Date(b.key); - }); - } else { - return data_nested; - } - }; - - var mg_add_aggregate_rollover = function mg_add_aggregate_rollover(args, svg, rollover_on, rollover_off, rollover_move, rollover_click) { - // Undo the keys getting coerced to strings, by setting the keys from the values - // This is necessary for when we have X axis keys that are things like - var data_nested = nest_data_for_aggregate_rollover(args); - - var xf = data_nested.map(function (_ref17) { - var key = _ref17.key; - return args.scales.X(key); - }); - - var g = svg.append('g').attr('class', 'mg-rollover-rect'); - - g.selectAll('.mg-rollover-rects').data(data_nested).enter().append('rect').attr('x', function (d, i) { - if (xf.length === 1) return mg_get_plot_left(args);else if (i === 0) return xf[i].toFixed(2);else return ((xf[i - 1] + xf[i]) / 2).toFixed(2); - }).attr('y', args.top).attr('width', function (d, i) { - if (xf.length === 1) return mg_get_plot_right(args);else if (i === 0) return ((xf[i + 1] - xf[i]) / 2).toFixed(2);else if (i === xf.length - 1) return ((xf[i] - xf[i - 1]) / 2).toFixed(2);else return ((xf[i + 1] - xf[i - 1]) / 2).toFixed(2); - }).attr('class', function (_ref18) { - var values = _ref18.values; - - var line_classes = values.map(function (_ref19) { - var line_id = _ref19.line_id; - - var lc = mg_line_class(line_id); - if (args.colors === null) lc += ' ' + mg_line_color_class(line_id); - return lc; - }).join(' '); - if (args.linked && values.length > 0) { - line_classes += ' ' + mg_rollover_id_class(mg_rollover_format_id(values[0], args)); - } - - return line_classes; - }).attr('height', args.height - args.bottom - args.top - args.buffer).attr('opacity', 0).on('click', rollover_click).on('mouseover', rollover_on).on('mouseout', rollover_off).on('mousemove', rollover_move); - - mg_configure_aggregate_rollover(args, svg); - }; - - var mg_configure_singleton_rollover = function mg_configure_singleton_rollover(_ref20, svg) { - var data = _ref20.data; - - svg.select('.mg-rollover-rect rect').on('mouseover')(data[0][0], 0); - }; - - var mg_configure_voronoi_rollover = function mg_configure_voronoi_rollover(_ref21, svg) { - var data = _ref21.data, - custom_line_color_map = _ref21.custom_line_color_map; - - for (var i = 0; i < data.length; i++) { - var j = i + 1; - - if (custom_line_color_map.length > 0 && custom_line_color_map[i] !== undefined) { - j = custom_line_color_map[i]; - } - - if (data[i].length === 1 && !svg.selectAll('.mg-voronoi .mg-line' + j).empty()) { - svg.selectAll('.mg-voronoi .mg-line' + j).on('mouseover')(data[i][0], 0); - - svg.selectAll('.mg-voronoi .mg-line' + j).on('mouseout')(data[i][0], 0); - } - } - }; - - var mg_line_class = function mg_line_class(line_id) { - return 'mg-line' + line_id; - }; - - var mg_line_color_class = function mg_line_color_class(line_id) { - return 'mg-line' + line_id + '-color'; - }; - - var mg_rollover_id_class = function mg_rollover_id_class(id) { - return 'roll_' + id; - }; - - var mg_rollover_format_id = function mg_rollover_format_id(d, _ref22) { - var x_accessor = _ref22.x_accessor, - utc_time = _ref22.utc_time, - linked_format = _ref22.linked_format; - - var v = d[x_accessor]; - var formatter = MG.time_format(utc_time, linked_format); - // only format when x-axis is date - return typeof v === 'number' ? v.toString().replace('.', '_') : formatter(v); - }; - - var mg_add_single_line_rollover = function mg_add_single_line_rollover(args, svg, rollover_on, rollover_off, rollover_move, rollover_click) { - // set to 1 unless we have a custom increment series - var line_id = 1; - if (args.custom_line_color_map.length > 0) { - line_id = args.custom_line_color_map[0]; - } - - var g = svg.append('g').attr('class', 'mg-rollover-rect'); - - var xf = args.data[0].map(args.scalefns.xf); - - g.selectAll('.mg-rollover-rects').data(args.data[0]).enter().append('rect').attr('class', function (d, i) { - var cl = mg_line_color_class(line_id) + ' ' + mg_line_class(d.line_id); - if (args.linked) cl += cl + ' ' + mg_rollover_id_class(mg_rollover_format_id(d, args)); - return cl; - }).attr('x', function (d, i) { - // if data set is of length 1 - if (xf.length === 1) return mg_get_plot_left(args);else if (i === 0) return xf[i].toFixed(2);else return ((xf[i - 1] + xf[i]) / 2).toFixed(2); - }).attr('y', function (d, i) { - return args.data.length > 1 ? args.scalefns.yf(d) - 6 // multi-line chart sensitivity - : args.top; - }).attr('width', function (d, i) { - // if data set is of length 1 - if (xf.length === 1) return mg_get_plot_right(args);else if (i === 0) return ((xf[i + 1] - xf[i]) / 2).toFixed(2);else if (i === xf.length - 1) return ((xf[i] - xf[i - 1]) / 2).toFixed(2);else return ((xf[i + 1] - xf[i - 1]) / 2).toFixed(2); - }).attr('height', function (d, i) { - return args.data.length > 1 ? 12 // multi-line chart sensitivity - : args.height - args.bottom - args.top - args.buffer; - }).attr('opacity', 0).on('click', rollover_click).on('mouseover', rollover_on).on('mouseout', rollover_off).on('mousemove', rollover_move); - - if (mg_is_singleton(args)) { - mg_configure_singleton_rollover(args, svg); - } - }; - - var mg_configure_aggregate_rollover = function mg_configure_aggregate_rollover(_ref23, svg) { - var data = _ref23.data; - - var rect = svg.selectAll('.mg-rollover-rect rect'); - var rect_first = rect.nodes()[0][0] || rect.nodes()[0]; - if (data.filter(function (_ref24) { - var length = _ref24.length; - return length === 1; - }).length > 0) { - rect.on('mouseover')(rect_first.__data__, 0); - } - }; - - var mg_is_standard_multiline = function mg_is_standard_multiline(_ref25) { - var data = _ref25.data, - aggregate_rollover = _ref25.aggregate_rollover; - - return data.length > 1 && !aggregate_rollover; - }; - - var mg_is_aggregated_rollover = function mg_is_aggregated_rollover(_ref26) { - var data = _ref26.data, - aggregate_rollover = _ref26.aggregate_rollover; - - return data.length > 1 && aggregate_rollover; - }; - - var mg_is_singleton = function mg_is_singleton(_ref27) { - var data = _ref27.data; - - return data.length === 1 && data[0].length === 1; - }; - - var mg_draw_all_line_elements = function mg_draw_all_line_elements(args, plot, svg) { - mg_remove_dangling_bands(plot, svg); - - // If option activated, remove existing active points if exists - if (args.active_point_on_lines) { - svg.selectAll('circle.mg-shown-active-point').remove(); - } - - for (var i = args.data.length - 1; i >= 0; i--) { - var this_data = args.data[i]; - - // passing the data for the current line - MG.call_hook('line.before_each_series', [this_data, args]); - - // override increment if we have a custom increment series - var line_id = i + 1; - if (args.custom_line_color_map.length > 0) { - line_id = args.custom_line_color_map[i]; - } - - args.data[i].line_id = line_id; - - // If option activated, add active points for each lines - if (args.active_point_on_lines) { - svg.selectAll('circle-' + line_id).data(args.data[i]).enter().filter(function (d) { - return d[args.active_point_accessor]; - }).append('circle').attr('class', 'mg-area' + line_id + '-color mg-shown-active-point').attr('cx', args.scalefns.xf).attr('cy', args.scalefns.yf).attr('r', function () { - return args.active_point_size; - }); - } - - if (this_data.length === 0) { - continue; - } - var existing_line = svg.select('path.mg-main-line.mg-line' + line_id); - - mg_add_confidence_band(args, plot, svg, line_id); - - if (Array.isArray(args.area)) { - if (args.area[line_id - 1]) { - mg_add_area(args, plot, svg, i, line_id); - } - } else { - mg_add_area(args, plot, svg, i, line_id); - } - - mg_add_line(args, plot, svg, existing_line, i, line_id); - mg_add_legend_element(args, plot, i, line_id); - - // passing the data for the current line - MG.call_hook('line.after_each_series', [this_data, existing_line, args]); - } - }; - - var mg_remove_dangling_bands = function mg_remove_dangling_bands(_ref28, svg) { - var existing_band = _ref28.existing_band; - - if (existing_band[0] && existing_band[0].length > svg.selectAll('.mg-main-line').node().length) { - svg.selectAll('.mg-confidence-band').remove(); - } - }; - - var mg_line_main_plot = function mg_line_main_plot(args) { - var plot = {}; - var svg = mg_get_svg_child_of(args.target); - - // remove any old legends if they exist - mg_selectAll_and_remove(svg, '.mg-line-legend'); - mg_add_legend_group(args, plot, svg); - - plot.data_median = 0; - plot.update_transition_duration = args.transition_on_update ? 1000 : 0; - plot.display_area = args.area && !args.use_data_y_min && args.data.length <= 1 && args.aggregate_rollover === false || Array.isArray(args.area) && args.area.length > 0; - plot.legend_text = ''; - mg_line_graph_generators(args, plot, svg); - plot.existing_band = svg.selectAll('.mg-confidence-band').nodes(); - - // should we continue with the default line render? A `line.all_series` hook should return false to prevent the default. - var continueWithDefault = MG.call_hook('line.before_all_series', [args]); - if (continueWithDefault !== false) { - mg_draw_all_line_elements(args, plot, svg); - } - - mg_plot_legend_if_legend_target(args.legend_target, plot.legend_text); - }; - - var mg_line_rollover_setup = function mg_line_rollover_setup(args, graph) { - var svg = mg_get_svg_child_of(args.target); - - if (args.showActivePoint && svg.selectAll('.mg-active-datapoint-container').nodes().length === 0) { - mg_add_g(svg, 'mg-active-datapoint-container'); - } - - mg_remove_existing_line_rollover_elements(svg); - mg_add_rollover_circle(args, svg); - mg_set_unique_line_id_for_each_series(args); - - if (mg_is_standard_multiline(args)) { - mg_add_voronoi_rollover(args, svg, graph.rolloverOn(args), graph.rolloverOff(args), graph.rolloverMove(args), graph.rolloverClick(args)); - } else if (mg_is_aggregated_rollover(args)) { - mg_add_aggregate_rollover(args, svg, graph.rolloverOn(args), graph.rolloverOff(args), graph.rolloverMove(args), graph.rolloverClick(args)); - } else { - mg_add_single_line_rollover(args, svg, graph.rolloverOn(args), graph.rolloverOff(args), graph.rolloverMove(args), graph.rolloverClick(args)); - } - }; - - var mg_update_rollover_circle = function mg_update_rollover_circle(args, svg, d) { - if (args.aggregate_rollover && args.data.length > 1) { - // hide the circles in case a non-contiguous series is present - svg.selectAll('circle.mg-line-rollover-circle').style('opacity', 0); - - d.values.forEach(function (datum, index, list) { - if (args.missing_is_hidden && list[index]['_missing']) { - return; - } - - if (mg_data_in_plot_bounds(datum, args)) mg_update_aggregate_rollover_circle(args, svg, datum); - }); - } else if (args.missing_is_hidden && d['_missing'] || d[args.y_accessor] === null) { - // disable rollovers for hidden parts of the line - // recall that hidden parts are missing data ranges and possibly also - // data points that have been explicitly identified as missing - return; - } else { - // show circle on mouse-overed rect - if (mg_data_in_plot_bounds(d, args)) { - mg_update_generic_rollover_circle(args, svg, d); - } - } - }; - - var mg_update_aggregate_rollover_circle = function mg_update_aggregate_rollover_circle(_ref29, svg, datum) { - var scales = _ref29.scales, - x_accessor = _ref29.x_accessor, - y_accessor = _ref29.y_accessor, - point_size = _ref29.point_size; - - svg.select('circle.mg-line-rollover-circle.mg-line' + datum.line_id).attr('cx', scales.X(datum[x_accessor]).toFixed(2)).attr('cy', scales.Y(datum[y_accessor]).toFixed(2)).attr('r', point_size).style('opacity', 1); - }; - - var mg_update_generic_rollover_circle = function mg_update_generic_rollover_circle(_ref30, svg, d) { - var scales = _ref30.scales, - x_accessor = _ref30.x_accessor, - y_accessor = _ref30.y_accessor, - point_size = _ref30.point_size; - - svg.selectAll('circle.mg-line-rollover-circle.mg-line' + d.line_id).classed('mg-line-rollover-circle', true).attr('cx', function () { - return scales.X(d[x_accessor]).toFixed(2); - }).attr('cy', function () { - return scales.Y(d[y_accessor]).toFixed(2); - }).attr('r', point_size).style('opacity', 1); - }; - - var mg_trigger_linked_mouseovers = function mg_trigger_linked_mouseovers(args, d, i) { - if (args.linked && !MG.globals.link) { - MG.globals.link = true; - if (!args.aggregate_rollover || d[args.y_accessor] !== undefined || d.values && d.values.length > 0) { - var datum = d.values ? d.values[0] : d; - var id = mg_rollover_format_id(datum, args); - // trigger mouseover on matching line in .linked charts - d3.selectAll('.' + mg_line_class(datum.line_id) + '.' + mg_rollover_id_class(id)).each(function (d) { - d3.select(this).on('mouseover')(d, i); - }); - } - } - }; - - var mg_trigger_linked_mouseouts = function mg_trigger_linked_mouseouts(_ref31, d, i) { - var linked = _ref31.linked, - utc_time = _ref31.utc_time, - linked_format = _ref31.linked_format, - x_accessor = _ref31.x_accessor; - - if (linked && MG.globals.link) { - MG.globals.link = false; - - var formatter = MG.time_format(utc_time, linked_format); - var datums = d.values ? d.values : [d]; - datums.forEach(function (datum) { - var v = datum[x_accessor]; - var id = typeof v === 'number' ? i : formatter(v); - - // trigger mouseout on matching line in .linked charts - d3.selectAll('.roll_' + id).each(function (d) { - d3.select(this).on('mouseout')(d); - }); - }); - } - }; - - var mg_remove_active_data_points_for_aggregate_rollover = function mg_remove_active_data_points_for_aggregate_rollover(args, svg) { - svg.selectAll('circle.mg-line-rollover-circle').filter(function (_ref32) { - var length = _ref32.length; - return length > 1; - }).style('opacity', 0); - }; - - var mg_remove_active_data_points_for_generic_rollover = function mg_remove_active_data_points_for_generic_rollover(_ref33, svg, _ref34) { - var custom_line_color_map = _ref33.custom_line_color_map, - data = _ref33.data; - var line_id = _ref34.line_id; - - svg.selectAll('circle.mg-line-rollover-circle.mg-line' + line_id).style('opacity', function () { - var id = line_id - 1; - - if (custom_line_color_map.length > 0 && custom_line_color_map.indexOf(line_id) !== undefined) { - id = custom_line_color_map.indexOf(line_id); - } - - if (data[id].length === 1) { - return 1; - } else { - return 0; - } - }); - }; - - var mg_remove_active_text = function mg_remove_active_text(svg) { - svg.select('.mg-active-datapoint').text(''); - }; - - var lineChart = function lineChart(args) { - this.init = function (args) { - this.args = args; - - if (!args.data || args.data.length === 0) { - args.internal_error = 'No data was supplied'; - internal_error(args); - return this; - } else { - args.internal_error = undefined; - } - - raw_data_transformation(args); - process_line(args); - - MG.call_hook('line.before_destroy', this); - - init(args); - - // TODO incorporate markers into calculation of x scales - new MG.scale_factory(args).namespace('x').numericalDomainFromData().numericalRange('bottom'); - - var baselines = (args.baselines || []).map(function (d) { - return d[args.y_accessor]; - }); - - new MG.scale_factory(args).namespace('y').zeroBottom(true).inflateDomain(true).numericalDomainFromData(baselines).numericalRange('left'); - - if (args.x_axis) { - new MG.axis_factory(args).namespace('x').type('numerical').position(args.x_axis_position).rug(x_rug(args)).label(mg_add_x_label).draw(); - } - - if (args.y_axis) { - new MG.axis_factory(args).namespace('y').type('numerical').position(args.y_axis_position).rug(y_rug(args)).label(mg_add_y_label).draw(); - } - - this.markers(); - this.mainPlot(); - this.rollover(); - this.windowListeners(); - if (args.brush) MG.add_brush_function(args); - MG.call_hook('line.after_init', this); - - return this; - }; - - this.mainPlot = function () { - mg_line_main_plot(args); - return this; - }; - - this.markers = function () { - markers(args); - return this; - }; - - this.rollover = function () { - mg_line_rollover_setup(args, this); - MG.call_hook('line.after_rollover', args); - - return this; - }; - - this.rolloverClick = function (args) { - return function (d, i) { - if (args.click) { - args.click(d, i); - } - }; - }; - - this.rolloverOn = function (args) { - var svg = mg_get_svg_child_of(args.target); - - return function (d, i) { - mg_update_rollover_circle(args, svg, d); - mg_trigger_linked_mouseovers(args, d, i); - - svg.selectAll('text').filter(function (g, j) { - return d === g; - }).attr('opacity', 0.3); - - // update rollover text except for missing data points - if (args.show_rollover_text && !(args.missing_is_hidden && d['_missing'] || d[args.y_accessor] === null)) { - var mouseover = mg_mouseover_text(args, { svg: svg }); - var row = mouseover.mouseover_row(); - if (args.aggregate_rollover) { - row.text((args.aggregate_rollover && args.data.length > 1 ? mg_format_x_aggregate_mouseover : mg_format_x_mouseover)(args, d)); - } - - var pts = args.aggregate_rollover && args.data.length > 1 ? d.values : [d]; - - pts.forEach(function (di) { - if (args.aggregate_rollover) { - row = mouseover.mouseover_row(); - } - - if (args.legend) { - mg_line_color_text(row.text(args.legend[di.index - 1] + ' ').bold(), di, args); - } - - mg_line_color_text(row.text('\u2014 ').elem, di, args); - if (!args.aggregate_rollover) { - row.text(mg_format_x_mouseover(args, di)); - } - - row.text(mg_format_y_mouseover(args, di, args.time_series === false)); - }); - } - - if (args.mouseover) { - args.mouseover(d, i); - } - }; - }; - - this.rolloverOff = function (args) { - var svg = mg_get_svg_child_of(args.target); - - return function (d, i) { - mg_trigger_linked_mouseouts(args, d, i); - if (args.aggregate_rollover) { - mg_remove_active_data_points_for_aggregate_rollover(args, svg); - } else { - mg_remove_active_data_points_for_generic_rollover(args, svg, d); - } - - if (args.data[0].length > 1) { - mg_clear_mouseover_container(svg); - } - - if (args.mouseout) { - args.mouseout(d, i); - } - }; - }; - - this.rolloverMove = function (args) { - return function (d, i) { - if (args.mousemove) { - args.mousemove(d, i); - } - }; - }; - - this.windowListeners = function () { - mg_window_listeners(this.args); - return this; - }; - - this.init(args); - }; - - MG.register('line', lineChart); -} - -{ - var histogram = function histogram(args) { - var _this = this; - - this.init = function (args) { - _this.args = args; - - raw_data_transformation(args); - process_histogram(args); - init(args); - - new MG.scale_factory(args).namespace('x').numericalDomainFromData().numericalRange('bottom'); - - var baselines = (args.baselines || []).map(function (d) { - return d[args.y_accessor]; - }); - - new MG.scale_factory(args).namespace('y').zeroBottom(true).inflateDomain(true).numericalDomainFromData(baselines).numericalRange('left'); - - x_axis(args); - y_axis(args); - - _this.mainPlot(); - _this.markers(); - _this.rollover(); - _this.windowListeners(); - - return _this; - }; - - this.mainPlot = function () { - var svg = mg_get_svg_child_of(args.target); - - //remove the old histogram, add new one - svg.selectAll('.mg-histogram').remove(); - - var g = svg.append('g').attr('class', 'mg-histogram'); - - var bar = g.selectAll('.mg-bar').data(args.data[0]).enter().append('g').attr('class', 'mg-bar').attr('transform', function (d) { - return 'translate(' + args.scales.X(d[args.x_accessor]).toFixed(2) + ',' + args.scales.Y(d[args.y_accessor]).toFixed(2) + ')'; - }); - - //draw bars - bar.append('rect').attr('x', 1).attr('width', function (d, i) { - if (args.data[0].length === 1) { - return (args.scalefns.xf(args.data[0][0]) - args.bar_margin).toFixed(0); - } else if (i !== args.data[0].length - 1) { - return (args.scalefns.xf(args.data[0][i + 1]) - args.scalefns.xf(d)).toFixed(0); - } else { - return (args.scalefns.xf(args.data[0][1]) - args.scalefns.xf(args.data[0][0])).toFixed(0); - } - }).attr('height', function (d) { - if (d[args.y_accessor] === 0) { - return 0; - } - - return (args.height - args.bottom - args.buffer - args.scales.Y(d[args.y_accessor])).toFixed(2); - }); - - return _this; - }; - - this.markers = function () { - markers(args); - return _this; - }; - - this.rollover = function () { - var svg = mg_get_svg_child_of(args.target); - - if (svg.selectAll('.mg-active-datapoint-container').nodes().length === 0) { - mg_add_g(svg, 'mg-active-datapoint-container'); - } - - //remove the old rollovers if they already exist - svg.selectAll('.mg-rollover-rect').remove(); - svg.selectAll('.mg-active-datapoint').remove(); - - var g = svg.append('g').attr('class', 'mg-rollover-rect'); - - //draw rollover bars - var bar = g.selectAll('.mg-bar').data(args.data[0]).enter().append('g').attr('class', function (d, i) { - if (args.linked) { - return 'mg-rollover-rects roll_' + i; - } else { - return 'mg-rollover-rects'; - } - }).attr('transform', function (d) { - return 'translate(' + args.scales.X(d[args.x_accessor]) + ',' + 0 + ')'; - }); - - bar.append('rect').attr('x', 1).attr('y', args.buffer + (args.title ? args.title_y_position : 0)).attr('width', function (d, i) { - //if data set is of length 1 - if (args.data[0].length === 1) { - return (args.scalefns.xf(args.data[0][0]) - args.bar_margin).toFixed(0); - } else if (i !== args.data[0].length - 1) { - return (args.scalefns.xf(args.data[0][i + 1]) - args.scalefns.xf(d)).toFixed(0); - } else { - return (args.scalefns.xf(args.data[0][1]) - args.scalefns.xf(args.data[0][0])).toFixed(0); - } - }).attr('height', function (d) { - return args.height; - }).attr('opacity', 0).on('mouseover', _this.rolloverOn(args)).on('mouseout', _this.rolloverOff(args)).on('mousemove', _this.rolloverMove(args)); - - return _this; - }; - - this.rolloverOn = function (args) { - var svg = mg_get_svg_child_of(args.target); - - return function (d, i) { - svg.selectAll('text').filter(function (g, j) { - return d === g; - }).attr('opacity', 0.3); - - var fmt = args.processed.xax_format || MG.time_format(args.utc_time, '%b %e, %Y'); - var num = format_rollover_number(args); - - svg.selectAll('.mg-bar rect').filter(function (d, j) { - return j === i; - }).classed('active', true); - - //trigger mouseover on all matching bars - if (args.linked && !MG.globals.link) { - MG.globals.link = true; - - //trigger mouseover on matching bars in .linked charts - d3.selectAll('.mg-rollover-rects.roll_' + i + ' rect').each(function (d) { - //use existing i - d3.select(this).on('mouseover')(d, i); - }); - } - - //update rollover text - if (args.show_rollover_text) { - var mo = mg_mouseover_text(args, { svg: svg }); - var row = mo.mouseover_row(); - row.text('\u259F ').elem.classed('hist-symbol', true); - - row.text(mg_format_x_mouseover(args, d)); // x - row.text(mg_format_y_mouseover(args, d, args.time_series === false)); - } - - if (args.mouseover) { - mg_setup_mouseover_container(svg, args); - args.mouseover(d, i); - } - }; - }; - - this.rolloverOff = function (args) { - var svg = mg_get_svg_child_of(args.target); - - return function (d, i) { - if (args.linked && MG.globals.link) { - MG.globals.link = false; - - //trigger mouseout on matching bars in .linked charts - d3.selectAll('.mg-rollover-rects.roll_' + i + ' rect').each(function (d) { - //use existing i - d3.select(this).on('mouseout')(d, i); - }); - } - - //reset active bar - svg.selectAll('.mg-bar rect').classed('active', false); - - //reset active data point text - mg_clear_mouseover_container(svg); - - if (args.mouseout) { - args.mouseout(d, i); - } - }; - }; - - this.rolloverMove = function (args) { - return function (d, i) { - if (args.mousemove) { - args.mousemove(d, i); - } - }; - }; - - this.windowListeners = function () { - mg_window_listeners(_this.args); - return _this; - }; - - this.init(args); - }; - - var _defaults = { - binned: false, - bins: null, - processed_x_accessor: 'x', - processed_y_accessor: 'y', - processed_dx_accessor: 'dx', - bar_margin: 1 - }; - - MG.register('histogram', histogram, _defaults); -} - -function point_mouseover(args, svg, d) { - var mouseover = mg_mouseover_text(args, { svg: svg }); - var row = mouseover.mouseover_row(); - - if (args.color_accessor !== null && args.color_type === 'category') { - var label = d[args.color_accessor]; - row.text(label + ' ').bold().attr('fill', args.scalefns.colorf(d)); - } - - mg_color_point_mouseover(args, row.text('\u25CF ').elem, d); // point shape - - row.text(mg_format_x_mouseover(args, d)); // x - row.text(mg_format_y_mouseover(args, d, args.time_series === false)); -} - -function mg_color_point_mouseover(_ref35, elem, d) { - var color_accessor = _ref35.color_accessor, - scalefns = _ref35.scalefns; - - if (color_accessor !== null) { - elem.attr('fill', scalefns.colorf(d)); - elem.attr('stroke', scalefns.colorf(d)); - } else { - elem.classed('mg-points-mono', true); - } -} - -{ - var mg_filter_out_plot_bounds = function mg_filter_out_plot_bounds(data, args) { - // max_x, min_x, max_y, min_y; - var x = args.x_accessor; - var y = args.y_accessor; - var new_data = data.filter(function (d) { - return (args.min_x === null || d[x] >= args.min_x) && (args.max_x === null || d[x] <= args.max_x) && (args.min_y === null || d[y] >= args.min_y) && (args.max_y === null || d[y] <= args.max_y); - }); - return new_data; - }; - - var pointChart = function pointChart(args) { - var _this2 = this; - - this.init = function (args) { - this.args = args; - - // infer y_axis and x_axis type; - args.x_axis_type = mg_infer_type(args, 'x'); - args.y_axis_type = mg_infer_type(args, 'y'); - - raw_data_transformation(args); - - process_point(args); - init(args); - - var xMaker = void 0, - yMaker = void 0; - - if (args.x_axis_type === 'categorical') { - xMaker = MG.scale_factory(args).namespace('x').categoricalDomainFromData().categoricalRangeBands([0, args.xgroup_height], args.xgroup_accessor === null); - - if (args.xgroup_accessor) { - new MG.scale_factory(args).namespace('xgroup').categoricalDomainFromData().categoricalRangeBands('bottom'); - } else { - args.scales.XGROUP = function () { - return mg_get_plot_left(args); - }; - args.scalefns.xgroupf = function () { - return mg_get_plot_left(args); - }; - } - - args.scalefns.xoutf = function (d) { - return args.scalefns.xf(d) + args.scalefns.xgroupf(d); - }; - } else { - xMaker = MG.scale_factory(args).namespace('x').inflateDomain(true).zeroBottom(args.y_axis_type === 'categorical').numericalDomainFromData((args.baselines || []).map(function (d) { - return d[args.x_accessor]; - })).numericalRange('bottom'); - - args.scalefns.xoutf = args.scalefns.xf; - } - - // y-scale generation. This needs to get simplified. - if (args.y_axis_type === 'categorical') { - yMaker = MG.scale_factory(args).namespace('y').zeroBottom(true).categoricalDomainFromData().categoricalRangeBands([0, args.ygroup_height], true); - - if (args.ygroup_accessor) { - - new MG.scale_factory(args).namespace('ygroup').categoricalDomainFromData().categoricalRangeBands('left'); - } else { - args.scales.YGROUP = function () { - return mg_get_plot_top(args); - }; - args.scalefns.ygroupf = function () { - return mg_get_plot_top(args); - }; - } - args.scalefns.youtf = function (d) { - return args.scalefns.yf(d) + args.scalefns.ygroupf(d); - }; - } else { - var baselines = (args.baselines || []).map(function (d) { - return d[args.y_accessor]; - }); - yMaker = MG.scale_factory(args).namespace('y').inflateDomain(true).zeroBottom(args.x_axis_type === 'categorical').numericalDomainFromData(baselines).numericalRange('left'); - - args.scalefns.youtf = function (d) { - return args.scalefns.yf(d); - }; - } - - /////// COLOR accessor - if (args.color_accessor !== null) { - var colorScale = MG.scale_factory(args).namespace('color'); - if (args.color_type === 'number') { - // do the color scale. - // etiher get color range, or what. - colorScale.numericalDomainFromData(mg_get_color_domain(args)).numericalRange(mg_get_color_range(args)).clamp(true); - } else { - if (args.color_domain) { - colorScale.categoricalDomain(args.color_domain).categoricalRange(args.color_range); - } else { - colorScale.categoricalDomainFromData().categoricalColorRange(); - } - } - } - - if (args.size_accessor) { - new MG.scale_factory(args).namespace('size').numericalDomainFromData().numericalRange(mg_get_size_range(args)).clamp(true); - } - - new MG.axis_factory(args).namespace('x').type(args.x_axis_type).zeroLine(args.y_axis_type === 'categorical').position(args.x_axis_position).rug(x_rug(args)).label(mg_add_x_label).draw(); - - new MG.axis_factory(args).namespace('y').type(args.y_axis_type).zeroLine(args.x_axis_type === 'categorical').position(args.y_axis_position).rug(y_rug(args)).label(mg_add_y_label).draw(); - - this.mainPlot(); - this.markers(); - this.rollover(); - this.windowListeners(); - if (args.brush) MG.add_brush_function(args); - return this; - }; - - this.markers = function () { - markers(args); - if (args.least_squares) { - add_ls(args); - } - - return this; - }; - - this.mainPlot = function () { - var svg = mg_get_svg_child_of(args.target); - - var data = mg_filter_out_plot_bounds(args.data[0], args); - //remove the old points, add new one - svg.selectAll('.mg-points').remove(); - - var g = svg.append('g').classed('mg-points', true); - - var pts = g.selectAll('circle').data(data).enter().append('circle').attr('class', function (d, i) { - return 'path-' + i; - }).attr('cx', args.scalefns.xoutf).attr('cy', function (d) { - return args.scalefns.youtf(d); - }); - - //are we coloring our points, or just using the default color? - if (args.color_accessor !== null) { - pts.attr('fill', args.scalefns.colorf); - pts.attr('stroke', args.scalefns.colorf); - } else { - pts.classed('mg-points-mono', true); - } - - if (args.size_accessor !== null) { - pts.attr('r', args.scalefns.sizef); - } else { - pts.attr('r', args.point_size); - } - - return this; - }; - - this.rollover = function () { - var svg = mg_get_svg_child_of(args.target); - - if (svg.selectAll('.mg-active-datapoint-container').nodes().length === 0) { - mg_add_g(svg, 'mg-active-datapoint-container'); - } - - //remove the old rollovers if they already exist - svg.selectAll('.mg-voronoi').remove(); - - //add rollover paths - var voronoi = d3.voronoi().x(args.scalefns.xoutf).y(args.scalefns.youtf).extent([[args.buffer, args.buffer + (args.title ? args.title_y_position : 0)], [args.width - args.buffer, args.height - args.buffer]]); - - var paths = svg.append('g').attr('class', 'mg-voronoi'); - - paths.selectAll('path').data(voronoi.polygons(mg_filter_out_plot_bounds(args.data[0], args))).enter().append('path').attr('d', function (d) { - return d == null ? null : 'M' + d.join(',') + 'Z'; - }).attr('class', function (d, i) { - return 'path-' + i; - }).style('fill-opacity', 0).on('mouseover', this.rolloverOn(args)).on('mouseout', this.rolloverOff(args)).on('mousemove', this.rolloverMove(args)); - - if (args.data[0].length === 1) { - point_mouseover(args, svg, args.data[0][0]); - } - - return this; - }; - - this.rolloverOn = function (args) { - var svg = mg_get_svg_child_of(args.target); - - return function (d, i) { - svg.selectAll('.mg-points circle').classed('selected', false); - - //highlight active point - var pts = svg.selectAll('.mg-points circle.path-' + i).classed('selected', true); - - if (args.size_accessor) { - pts.attr('r', function (di) { - return args.scalefns.sizef(di) + args.active_point_size_increase; - }); - } else { - pts.attr('r', args.point_size + args.active_point_size_increase); - } - - //trigger mouseover on all points for this class name in .linked charts - if (args.linked && !MG.globals.link) { - MG.globals.link = true; - - //trigger mouseover on matching point in .linked charts - d3.selectAll('.mg-voronoi .path-' + i).each(function () { - d3.select(_this2).on('mouseover')(d, i); - }); - } - - if (args.show_rollover_text) { - point_mouseover(args, svg, d.data); - } - - if (args.mouseover) { - args.mouseover(d, i); - } - }; - }; - - this.rolloverOff = function (args) { - var svg = mg_get_svg_child_of(args.target); - - return function (d, i) { - if (args.linked && MG.globals.link) { - MG.globals.link = false; - - d3.selectAll('.mg-voronoi .path-' + i).each(function () { - d3.select(_this2).on('mouseout')(d, i); - }); - } - - //reset active point - var pts = svg.selectAll('.mg-points circle').classed('unselected', false).classed('selected', false); - - if (args.size_accessor) { - pts.attr('r', args.scalefns.sizef); - } else { - pts.attr('r', args.point_size); - } - - //reset active data point text - if (args.data[0].length > 1) mg_clear_mouseover_container(svg); - - if (args.mouseout) { - args.mouseout(d, i); - } - }; - }; - - this.rolloverMove = function (args) { - return function (d, i) { - if (args.mousemove) { - args.mousemove(d, i); - } - }; - }; - - this.update = function (args) { - return this; - }; - - this.windowListeners = function () { - mg_window_listeners(this.args); - return this; - }; - - this.init(args); - }; - - var _defaults2 = { - y_padding_percentage: 0.05, // for categorical scales - y_outer_padding_percentage: 0.2, // for categorical scales - ygroup_padding_percentage: 0, // for categorical scales - ygroup_outer_padding_percentage: 0, // for categorical scales - x_padding_percentage: 0.05, // for categorical scales - x_outer_padding_percentage: 0.2, // for categorical scales - xgroup_padding_percentage: 0, // for categorical scales - xgroup_outer_padding_percentage: 0, // for categorical scales - y_categorical_show_guides: true, - x_categorical_show_guides: true, - buffer: 16, - ls: false, - lowess: false, - point_size: 2.5, - label_accessor: null, - size_accessor: null, - color_accessor: null, - size_range: null, // when we set a size_accessor option, this array determines the size range, e.g. [1,5] - color_range: null, // e.g. ['blue', 'red'] to color different groups of points - size_domain: null, - color_domain: null, - active_point_size_increase: 1, - color_type: 'number' // can be either 'number' - the color scale is quantitative - or 'category' - the color scale is qualitative. - }; - - MG.register('point', pointChart, _defaults2); -} - -{ - // TODO add styles to stylesheet instead - var scaffold = function scaffold(_ref36) { - var target = _ref36.target, - width = _ref36.width, - height = _ref36.height, - top = _ref36.top, - left = _ref36.left, - right = _ref36.right, - buffer = _ref36.buffer; - - var svg = mg_get_svg_child_of(target); - // main margins - svg.append('line').attr('x1', 0).attr('x2', width).attr('y1', top).attr('y2', top).attr('stroke', 'black'); - svg.append('line').attr('x1', 0).attr('x2', width).attr('y1', height - bottom).attr('y2', height - bottom).attr('stroke', 'black'); - - svg.append('line').attr('x1', left).attr('x2', left).attr('y1', 0).attr('y2', height).attr('stroke', 'black'); - - svg.append('line').attr('x1', width - right).attr('x2', width - right).attr('y1', 0).attr('y2', height).attr('stroke', 'black'); - - // plot area margins - svg.append('line').attr('x1', 0).attr('x2', width).attr('y1', height - bottom - buffer).attr('y2', height - bottom - buffer).attr('stroke', 'gray'); - - svg.append('line').attr('x1', 0).attr('x2', width).attr('y1', top + buffer).attr('y2', top + buffer).attr('stroke', 'gray'); - - svg.append('line').attr('x1', left + buffer).attr('x2', left + buffer).attr('y1', 0).attr('y2', args.height).attr('stroke', 'gray'); - svg.append('line').attr('x1', width - right - buffer).attr('x2', width - right - buffer).attr('y1', 0).attr('y2', height).attr('stroke', 'gray'); - }; - - // barchart re-write. - - - var mg_targeted_legend = function mg_targeted_legend(_ref37) { - var legend_target = _ref37.legend_target, - orientation = _ref37.orientation, - scales = _ref37.scales; - - var labels = void 0; - var plot = ''; - if (legend_target) { - - var div = d3.select(legend_target).append('div').classed('mg-bar-target-legend', true); - - if (orientation == 'horizontal') labels = scales.Y.domain();else labels = scales.X.domain(); - - labels.forEach(function (label) { - var outer_span = div.append('span').classed('mg-bar-target-element', true); - outer_span.append('span').classed('mg-bar-target-legend-shape', true).style('color', scales.COLOR(label)).text('\u25FC '); - outer_span.append('span').classed('mg-bar-target-legend-text', true).text(label); - }); - } - }; - - var legend_on_graph = function legend_on_graph(svg, args) { - // draw each element at the top right - // get labels - - var labels = void 0; - if (args.orientation == 'horizontal') labels = args.scales.Y.domain();else labels = args.scales.X.domain(); - - var lineCount = 0; - var lineHeight = 1.1; - var g = svg.append('g').classed("mg-bar-legend", true); - var textContainer = g.append('text'); - - textContainer.selectAll('*').remove(); - textContainer.attr('width', args.right).attr('height', 100).attr('text-anchor', 'start'); - - labels.forEach(function (label) { - var sub_container = textContainer.append('tspan').attr('x', mg_get_plot_right(args)).attr('y', args.height / 2).attr('dy', lineCount * lineHeight + 'em'); - sub_container.append('tspan').text('\u25A0 ').attr('fill', args.scales.COLOR(label)).attr('font-size', 20); - sub_container.append('tspan').text(label).attr('font-weight', 300).attr('font-size', 10); - lineCount++; - }); - - // d.values.forEach(function (datum) { - // formatted_y = mg_format_y_rollover(args, num, datum); - - // if (args.y_rollover_format !== null) { - // formatted_y = number_rollover_format(args.y_rollover_format, datum, args.y_accessor); - // } else { - // formatted_y = args.yax_units + num(datum[args.y_accessor]); - // } - - // sub_container = textContainer.append('tspan').attr('x', 0).attr('y', (lineCount * lineHeight) + 'em'); - // formatted_y = mg_format_y_rollover(args, num, datum); - // mouseover_tspan(sub_container, '\u2014 ') - // .color(args, datum); - // mouseover_tspan(sub_container, formatted_x + ' ' + formatted_y); - - // lineCount++; - // }); - }; - - var barChart = function barChart(args) { - var _this3 = this; - - this.args = args; - - this.init = function (args) { - _this3.args = args; - args.x_axis_type = mg_infer_type(args, 'x'); - args.y_axis_type = mg_infer_type(args, 'y'); - - // this is specific to how rects work in svg, let's keep track of the bar orientation to - // plot appropriately. - if (args.x_axis_type == 'categorical') { - args.orientation = 'vertical'; - } else if (args.y_axis_type == 'categorical') { - args.orientation = 'horizontal'; - } else if (args.x_axis_type != 'categorical' && args.y_axis_type != 'categorical') { - // histogram. - args.orientation = 'vertical'; - } - - raw_data_transformation(args); - - process_point(args); - init(args); - - var xMaker = void 0; - var yMaker = void 0; - - if (args.x_axis_type === 'categorical') { - xMaker = MG.scale_factory(args).namespace('x').categoricalDomainFromData().categoricalRangeBands([0, args.xgroup_height], args.xgroup_accessor === null); - - if (args.xgroup_accessor) { - new MG.scale_factory(args).namespace('xgroup').categoricalDomainFromData().categoricalRangeBands('bottom'); - } else { - args.scales.XGROUP = function (d) { - return mg_get_plot_left(args); - }; - args.scalefns.xgroupf = function (d) { - return mg_get_plot_left(args); - }; - } - - args.scalefns.xoutf = function (d) { - return args.scalefns.xf(d) + args.scalefns.xgroupf(d); - }; - } else { - xMaker = MG.scale_factory(args).namespace('x').inflateDomain(true).zeroBottom(args.y_axis_type === 'categorical').numericalDomainFromData((args.baselines || []).map(function (d) { - return d[args.x_accessor]; - })).numericalRange('bottom'); - - args.scalefns.xoutf = args.scalefns.xf; - } - - // y-scale generation. This needs to get simplified. - if (args.y_axis_type === 'categorical') { - yMaker = MG.scale_factory(args).namespace('y').zeroBottom(true).categoricalDomainFromData().categoricalRangeBands([0, args.ygroup_height], true); - - if (args.ygroup_accessor) { - - new MG.scale_factory(args).namespace('ygroup').categoricalDomainFromData().categoricalRangeBands('left'); - } else { - args.scales.YGROUP = function () { - return mg_get_plot_top(args); - }; - args.scalefns.ygroupf = function (d) { - return mg_get_plot_top(args); - }; - } - args.scalefns.youtf = function (d) { - return args.scalefns.yf(d) + args.scalefns.ygroupf(d); - }; - } else { - var baselines = (args.baselines || []).map(function (d) { - return d[args.y_accessor]; - }); - - yMaker = MG.scale_factory(args).namespace('y').inflateDomain(true).zeroBottom(args.x_axis_type === 'categorical').numericalDomainFromData(baselines).numericalRange('left'); - - args.scalefns.youtf = function (d) { - return args.scalefns.yf(d); - }; - } - - if (args.ygroup_accessor !== null) { - args.ycolor_accessor = args.y_accessor; - MG.scale_factory(args).namespace('ycolor').scaleName('color').categoricalDomainFromData().categoricalColorRange(); - } - - if (args.xgroup_accessor !== null) { - args.xcolor_accessor = args.x_accessor; - MG.scale_factory(args).namespace('xcolor').scaleName('color').categoricalDomainFromData().categoricalColorRange(); - } - - // if (args.ygroup_accessor !== null) { - // MG.scale_factory(args) - // .namespace('ygroup') - // .categoricalDomainFromData() - // .categoricalColorRange(); - // } - - new MG.axis_factory(args).namespace('x').type(args.x_axis_type).zeroLine(args.y_axis_type === 'categorical').position(args.x_axis_position).draw(); - - new MG.axis_factory(args).namespace('y').type(args.y_axis_type).zeroLine(args.x_axis_type === 'categorical').position(args.y_axis_position).draw(); - - //mg_categorical_group_color_scale(args); - - _this3.mainPlot(); - _this3.markers(); - _this3.rollover(); - _this3.windowListeners(); - //scaffold(args) - - return _this3; - }; - - this.mainPlot = function () { - var svg = mg_get_svg_child_of(args.target); - var data = args.data[0]; - var barplot = svg.select('g.mg-barplot'); - var fresh_render = barplot.empty(); - - var bars = void 0, - predictor_bars = void 0, - pp = void 0, - pp0 = void 0, - baseline_marks = void 0; - - var perform_load_animation = fresh_render && args.animate_on_load; - var should_transition = perform_load_animation || args.transition_on_update; - var transition_duration = args.transition_duration || 1000; - - // draw the plot on first render - if (fresh_render) { - barplot = svg.append('g').classed('mg-barplot', true); - } - - bars = barplot.selectAll('.mg-bar').data(data).enter().append('rect').classed('mg-bar', true).classed('default-bar', args.scales.hasOwnProperty('COLOR') ? false : true); - - // TODO - reimplement - - // reference_accessor {} - - // if (args.predictor_accessor) { - // predictor_bars = barplot.selectAll('.mg-bar-prediction') - // .data(data.filter(function(d) { - // return d.hasOwnProperty(args.predictor_accessor) })); - - // predictor_bars.exit().remove(); - - // predictor_bars.enter().append('rect') - // .classed('mg-bar-prediction', true); - // } - - // if (args.baseline_accessor) { - // baseline_marks = barplot.selectAll('.mg-bar-baseline') - // .data(data.filter(function(d) { - // return d.hasOwnProperty(args.baseline_accessor) })); - - // baseline_marks.exit().remove(); - - // baseline_marks.enter().append('line') - // .classed('mg-bar-baseline', true); - // } - - var appropriate_size = void 0; - - // setup transitions - // if (should_transition) { - // bars = bars.transition() - // .duration(transition_duration); - - // if (predictor_bars) { - // predictor_bars = predictor_bars.transition() - // .duration(transition_duration); - // } - - // if (baseline_marks) { - // baseline_marks = baseline_marks.transition() - // .duration(transition_duration); - // } - // } - - //appropriate_size = args.scales.Y_ingroup.rangeBand()/1.5; - var length = void 0, - width = void 0, - length_type = void 0, - width_type = void 0, - length_coord = void 0, - width_coord = void 0, - length_scalefn = void 0, - width_scalefn = void 0, - length_scale = void 0, - width_scale = void 0, - length_accessor = void 0, - width_accessor = void 0, - length_coord_map = void 0, - width_coord_map = void 0, - length_map = void 0, - width_map = void 0; - - var reference_length_map = void 0, - reference_length_coord_fn = void 0; - - if (args.orientation == 'vertical') { - length = 'height'; - width = 'width'; - length_type = args.y_axis_type; - width_type = args.x_axis_type; - length_coord = 'y'; - width_coord = 'x'; - length_scalefn = length_type == 'categorical' ? args.scalefns.youtf : args.scalefns.yf; - width_scalefn = width_type == 'categorical' ? args.scalefns.xoutf : args.scalefns.xf; - length_scale = args.scales.Y; - width_scale = args.scales.X; - length_accessor = args.y_accessor; - width_accessor = args.x_accessor; - - length_coord_map = function length_coord_map(d) { - var l = void 0; - l = length_scalefn(d); - if (d[length_accessor] < 0) { - l = length_scale(0); - } - return l; - }; - - length_map = function length_map(d) { - return Math.abs(length_scalefn(d) - length_scale(0)); - }; - - reference_length_map = function reference_length_map(d) { - return Math.abs(length_scale(d[args.reference_accessor]) - length_scale(0)); - }; - - reference_length_coord_fn = function reference_length_coord_fn(d) { - return length_scale(d[args.reference_accessor]); - }; - } - - if (args.orientation == 'horizontal') { - length = 'width'; - width = 'height'; - length_type = args.x_axis_type; - width_type = args.y_axis_type; - length_coord = 'x'; - width_coord = 'y'; - length_scalefn = length_type == 'categorical' ? args.scalefns.xoutf : args.scalefns.xf; - width_scalefn = width_type == 'categorical' ? args.scalefns.youtf : args.scalefns.yf; - length_scale = args.scales.X; - width_scale = args.scales.Y; - length_accessor = args.x_accessor; - width_accessor = args.y_accessor; - - length_coord_map = function length_coord_map(d) { - var l = void 0; - l = length_scale(0); - return l; - }; - - length_map = function length_map(d) { - return Math.abs(length_scalefn(d) - length_scale(0)); - }; - - reference_length_map = function reference_length_map(d) { - return Math.abs(length_scale(d[args.reference_accessor]) - length_scale(0)); - }; - - reference_length_coord_fn = function reference_length_coord_fn(d) { - return length_scale(0); - }; - } - - // if (perform_load_animation) { - // bars.attr(length, 0); - - // if (predictor_bars) { - // predictor_bars.attr(length, 0); - // } - - // // if (baseline_marks) { - // // baseline_marks.attr({ - // // x1: args.scales.X(0), - // // x2: args.scales.X(0) - // // }); - // // } - // } - - bars.attr(length_coord, length_coord_map); - - // bars.attr(length_coord, 40) - //bars.attr(width_coord, 70) - - bars.attr(width_coord, function (d) { - var w = void 0; - if (width_type == 'categorical') { - w = width_scalefn(d); - } else { - w = width_scale(0); - if (d[width_accessor] < 0) { - w = width_scalefn(d); - } - } - w = w - args.bar_thickness / 2; - return w; - }); - - if (args.scales.COLOR) { - bars.attr('fill', args.scalefns.colorf); - } - - bars.attr(length, length_map).attr(width, function (d) { - return args.bar_thickness; - }); - - if (args.reference_accessor !== null) { - var reference_data = data.filter(function (d) { - return d.hasOwnProperty(args.reference_accessor); - }); - var reference_bars = barplot.selectAll('.mg-categorical-reference').data(reference_data).enter().append('rect'); - - reference_bars.attr(length_coord, reference_length_coord_fn).attr(width_coord, function (d) { - return width_scalefn(d) - args.reference_thickness / 2; - }).attr(length, reference_length_map).attr(width, args.reference_thickness); - } - - if (args.comparison_accessor !== null) { - var comparison_thickness = null; - if (args.comparison_thickness === null) { - comparison_thickness = args.bar_thickness / 2; - } else { - comparison_thickness = args.comparison_thickness; - } - - var comparison_data = data.filter(function (d) { - return d.hasOwnProperty(args.comparison_accessor); - }); - var comparison_marks = barplot.selectAll('.mg-categorical-comparison').data(comparison_data).enter().append('line'); - - comparison_marks.attr(length_coord + '1', function (d) { - return length_scale(d[args.comparison_accessor]); - }).attr(length_coord + '2', function (d) { - return length_scale(d[args.comparison_accessor]); - }).attr(width_coord + '1', function (d) { - return width_scalefn(d) - comparison_thickness / 2; - }).attr(width_coord + '2', function (d) { - return width_scalefn(d) + comparison_thickness / 2; - }).attr('stroke', 'black').attr('stroke-width', args.comparison_width); - } - - //bars.attr(width_coord, ); - // bars.attr('width', 50); - // bars.attr('height', 50); - // bars.attr('y', function(d){ - // var y = args.scales.Y(0); - // if (d[args.y_accessor] < 0) { - // y = args.scalefns.yf(d); - // } - // return y; - // }); - - // bars.attr('x', function(d){ - // return 40; - // }) - - // bars.attr('width', function(d){ - // return 100; - // }); - - // bars.attr('height', 100); - - // bars.attr('fill', 'black'); - // bars.attr('x', function(d) { - // var x = args.scales.X(0); - // if (d[args.x_accessor] < 0) { - // x = args.scalefns.xf(d); - // } - // return x; - // }) - // TODO - reimplement. - // if (args.predictor_accessor) { - // predictor_bars - // .attr('x', args.scales.X(0)) - // .attr('y', function(d) { - // return args.scalefns.ygroupf(d) + args.scalefns.yf(d) + args.scales.Y.rangeBand() * (7 / 16) // + pp0 * appropriate_size/(pp*2) + appropriate_size / 2; - // }) - // .attr('height', args.scales.Y.rangeBand() / 8) //appropriate_size / pp) - // .attr('width', function(d) { - // return args.scales.X(d[args.predictor_accessor]) - args.scales.X(0); - // }); - // } - - // TODO - reimplement. - // if (args.baseline_accessor) { - - // baseline_marks - // .attr('x1', function(d) { - // return args.scales.X(d[args.baseline_accessor]); }) - // .attr('x2', function(d) { - // return args.scales.X(d[args.baseline_accessor]); }) - // .attr('y1', function(d) { - // return args.scalefns.ygroupf(d) + args.scalefns.yf(d) + args.scales.Y.rangeBand() / 4 - // }) - // .attr('y2', function(d) { - // return args.scalefns.ygroupf(d) + args.scalefns.yf(d) + args.scales.Y.rangeBand() * 3 / 4 - // }); - // } - if (args.legend || args.color_accessor !== null && args.ygroup_accessor !== args.color_accessor) { - if (!args.legend_target) legend_on_graph(svg, args);else mg_targeted_legend(args); - } - return _this3; - }; - - this.markers = function () { - markers(args); - return _this3; - }; - - this.rollover = function () { - var svg = mg_get_svg_child_of(args.target); - var g = void 0; - - if (svg.selectAll('.mg-active-datapoint-container').nodes().length === 0) { - mg_add_g(svg, 'mg-active-datapoint-container'); - } - - //remove the old rollovers if they already exist - svg.selectAll('.mg-rollover-rect').remove(); - svg.selectAll('.mg-active-datapoint').remove(); - - // get orientation - var length = void 0, - width = void 0, - length_type = void 0, - width_type = void 0, - length_coord = void 0, - width_coord = void 0, - length_scalefn = void 0, - width_scalefn = void 0, - length_scale = void 0, - width_scale = void 0, - length_accessor = void 0, - width_accessor = void 0; - - var length_coord_map = void 0, - width_coord_map = void 0, - length_map = void 0, - width_map = void 0; - - if (args.orientation == 'vertical') { - length = 'height'; - width = 'width'; - length_type = args.y_axis_type; - width_type = args.x_axis_type; - length_coord = 'y'; - width_coord = 'x'; - length_scalefn = length_type == 'categorical' ? args.scalefns.youtf : args.scalefns.yf; - width_scalefn = width_type == 'categorical' ? args.scalefns.xoutf : args.scalefns.xf; - length_scale = args.scales.Y; - width_scale = args.scales.X; - length_accessor = args.y_accessor; - width_accessor = args.x_accessor; - - length_coord_map = function length_coord_map(d) { - return mg_get_plot_top(args); - }; - - length_map = function length_map(d) { - return args.height - args.top - args.bottom - args.buffer * 2; - }; - } - - if (args.orientation == 'horizontal') { - length = 'width'; - width = 'height'; - length_type = args.x_axis_type; - width_type = args.y_axis_type; - length_coord = 'x'; - width_coord = 'y'; - length_scalefn = length_type == 'categorical' ? args.scalefns.xoutf : args.scalefns.xf; - width_scalefn = width_type == 'categorical' ? args.scalefns.youtf : args.scalefns.yf; - length_scale = args.scales.X; - width_scale = args.scales.Y; - length_accessor = args.x_accessor; - width_accessor = args.y_accessor; - - length_coord_map = function length_coord_map(d) { - var l = void 0; - l = length_scale(0); - return l; - }; - - length_map = function length_map(d) { - return args.width - args.left - args.right - args.buffer * 2; - }; - } - - //rollover text - var rollover_x = void 0, - rollover_anchor = void 0; - if (args.rollover_align === 'right') { - rollover_x = args.width - args.right; - rollover_anchor = 'end'; - } else if (args.rollover_align === 'left') { - rollover_x = args.left; - rollover_anchor = 'start'; - } else { - rollover_x = (args.width - args.left - args.right) / 2 + args.left; - rollover_anchor = 'middle'; - } - - svg.append('text').attr('class', 'mg-active-datapoint').attr('xml:space', 'preserve').attr('x', rollover_x).attr('y', args.top * 0.75).attr('dy', '.35em').attr('text-anchor', rollover_anchor); - - g = svg.append('g').attr('class', 'mg-rollover-rect'); - - //draw rollover bars - var bars = g.selectAll(".mg-bar-rollover").data(args.data[0]).enter().append("rect").attr('class', 'mg-bar-rollover'); - - bars.attr('opacity', 0).attr(length_coord, length_coord_map).attr(width_coord, function (d) { - var w = void 0; - if (width_type == 'categorical') { - w = width_scalefn(d); - } else { - w = width_scale(0); - if (d[width_accessor] < 0) { - w = width_scalefn(d); - } - } - w = w - args.bar_thickness / 2; - return w; - }); - - bars.attr(length, length_map); - bars.attr(width, function (d) { - return args.bar_thickness; - }); - - bars.on('mouseover', _this3.rolloverOn(args)).on('mouseout', _this3.rolloverOff(args)).on('mousemove', _this3.rolloverMove(args)); - - return _this3; - }; - - this.rolloverOn = function (args) { - var svg = mg_get_svg_child_of(args.target); - var label_accessor = _this3.is_vertical ? args.x_accessor : args.y_accessor; - var data_accessor = _this3.is_vertical ? args.y_accessor : args.x_accessor; - var label_units = _this3.is_vertical ? args.yax_units : args.xax_units; - - return function (d, i) { - - var fmt = MG.time_format(args.utc_time, '%b %e, %Y'); - var num = format_rollover_number(args); - - //highlight active bar - var bar = svg.selectAll('g.mg-barplot .mg-bar').filter(function (d, j) { - return j === i; - }).classed('active', true); - - if (args.scales.hasOwnProperty('COLOR')) { - bar.attr('fill', d3.rgb(args.scalefns.colorf(d)).darker()); - } else { - bar.classed('default-active', true); - } - - //update rollover text - if (args.show_rollover_text) { - var mouseover = mg_mouseover_text(args, { svg: svg }); - var row = mouseover.mouseover_row(); - - if (args.ygroup_accessor) row.text(d[args.ygroup_accessor] + ' ').bold(); - - row.text(mg_format_x_mouseover(args, d)); - row.text(args.y_accessor + ': ' + d[args.y_accessor]); - if (args.predictor_accessor || args.baseline_accessor) { - row = mouseover.mouseover_row(); - - if (args.predictor_accessor) row.text(mg_format_data_for_mouseover(args, d, null, args.predictor_accessor, false)); - if (args.baseline_accessor) row.text(mg_format_data_for_mouseover(args, d, null, args.baseline_accessor, false)); - } - } - if (args.mouseover) { - args.mouseover(d, i); - } - }; - }; - - this.rolloverOff = function (args) { - var svg = mg_get_svg_child_of(args.target); - - return function (d, i) { - //reset active bar - var bar = svg.selectAll('g.mg-barplot .mg-bar.active').classed('active', false); - - if (args.scales.hasOwnProperty('COLOR')) { - bar.attr('fill', args.scalefns.colorf(d)); - } else { - bar.classed('default-active', false); - } - - //reset active data point text - svg.select('.mg-active-datapoint').text(''); - - mg_clear_mouseover_container(svg); - - if (args.mouseout) { - args.mouseout(d, i); - } - }; - }; - - this.rolloverMove = function (args) { - return function (d, i) { - if (args.mousemove) { - args.mousemove(d, i); - } - }; - }; - - this.windowListeners = function () { - mg_window_listeners(_this3.args); - return _this3; - }; - - this.init(args); - }; - - var _defaults3 = { - y_padding_percentage: 0.05, // for categorical scales - y_outer_padding_percentage: 0.2, // for categorical scales - ygroup_padding_percentage: 0, // for categorical scales - ygroup_outer_padding_percentage: 0, // for categorical scales - x_padding_percentage: 0.05, // for categorical scales - x_outer_padding_percentage: 0.2, // for categorical scales - xgroup_padding_percentage: 0, // for categorical scales - xgroup_outer_padding_percentage: 0, // for categorical scales - buffer: 16, - y_accessor: 'factor', - x_accessor: 'value', - reference_accessor: null, - comparison_accessor: null, - secondary_label_accessor: null, - color_accessor: null, - color_type: 'category', - color_domain: null, - reference_thickness: 1, - comparison_width: 3, - comparison_thickness: null, - legend: false, - legend_target: null, - mouseover_align: 'right', - baseline_accessor: null, - predictor_accessor: null, - predictor_proportion: 5, - show_bar_zero: true, - binned: true, - truncate_x_labels: true, - truncate_y_labels: true - }; - - MG.register('bar', barChart, _defaults3); -} - -/* -Data Tables - -Along with histograms, bars, lines, and scatters, a simple data table can take you far. -We often just want to look at numbers, organized as a table, where columns are variables, -and rows are data points. Sometimes we want a cell to have a small graphic as the main -column element, in which case we want small multiples. sometimes we want to - -var table = New data_table(data) - .target('div#data-table') - .title({accessor: 'point_name', align: 'left'}) - .description({accessor: 'description'}) - .number({accessor: ''}) - -*/ - -MG.data_table = function (args) { - 'use strict'; - - this.args = args; - this.args.standard_col = { width: 150, font_size: 12, font_weight: 'normal' }; - this.args.columns = []; - this.formatting_options = [['color', 'color'], ['font-weight', 'font_weight'], ['font-style', 'font_style'], ['font-size', 'font_size']]; - - this._strip_punctuation = function (s) { - var punctuationless = s.replace(/[^a-zA-Z0-9 _]+/g, ''); - var finalString = punctuationless.replace(/ +?/g, ''); - return finalString; - }; - - this._format_element = function (element, value, args) { - this.formatting_options.forEach(function (fo) { - var attr = fo[0]; - var key = fo[1]; - if (args[key]) element.style(attr, typeof args[key] === 'string' || typeof args[key] === 'number' ? args[key] : args[key](value)); - }); - }; - - this._add_column = function (_args, arg_type) { - var standard_column = this.args.standard_col; - var args = merge_with_defaults(MG.clone(_args), MG.clone(standard_column)); - args.type = arg_type; - this.args.columns.push(args); - }; - - this.target = function () { - var target = arguments[0]; - this.args.target = target; - return this; - }; - - this.title = function () { - this._add_column(arguments[0], 'title'); - return this; - }; - - this.text = function () { - this._add_column(arguments[0], 'text'); - return this; - }; - - this.bullet = function () { - /* - text label - main value - comparative measure - any number of ranges - additional args: - no title - xmin, xmax - format: percentage - xax_formatter - */ - return this; - }; - - this.sparkline = function () { - return this; - }; - - this.number = function () { - this._add_column(arguments[0], 'number'); - return this; - }; - - this.display = function () { - var args = this.args; - - chart_title(args); - - var target = args.target; - var table = d3.select(target).append('table').classed('mg-data-table', true); - var colgroup = table.append('colgroup'); - var thead = table.append('thead'); - var tbody = table.append('tbody'); - var this_column; - var this_title; - - var tr, th, td_accessor, td_type, td_value, th_text, td_text, td; - var col; - var h; - - tr = thead.append('tr'); - - for (h = 0; h < args.columns.length; h++) { - var this_col = args.columns[h]; - td_type = this_col.type; - th_text = this_col.label; - th_text = th_text === undefined ? '' : th_text; - th = tr.append('th').style('width', this_col.width).style('text-align', td_type === 'title' ? 'left' : 'right').text(th_text); - - if (args.show_tooltips && this_col.description && mg_jquery_exists()) { - th.append('i').classed('fa', true).classed('fa-question-circle', true).classed('fa-inverse', true); - - $(th.node()).popover({ - html: true, - animation: false, - content: this_col.description, - trigger: 'hover', - placement: 'top', - container: $(th.node()) - }); - } - } - - for (h = 0; h < args.columns.length; h++) { - col = colgroup.append('col'); - if (args.columns[h].type === 'number') { - col.attr('align', 'char').attr('char', '.'); - } - } - - for (var i = 0; i < args.data.length; i++) { - tr = tbody.append('tr'); - for (var j = 0; j < args.columns.length; j++) { - this_column = args.columns[j]; - td_accessor = this_column.accessor; - td_value = td_text = args.data[i][td_accessor]; - td_type = this_column.type; - - if (td_type === 'number') { - //td_text may need to be rounded - if (this_column.hasOwnProperty('round') && !this_column.hasOwnProperty('format')) { - // round according to the number value in this_column.round - td_text = d3.format('0,.' + this_column.round + 'f')(td_text); - } - - if (this_column.hasOwnProperty('value_formatter')) { - // provide a function that formats the text according to the function this_column.format. - td_text = this_column.value_formatter(td_text); - } - - if (this_column.hasOwnProperty('format')) { - // this is a shorthand for percentage formatting, and others if need be. - // supported: 'percentage', 'count', 'temperature' - - if (this_column.round) { - td_text = Math.round(td_text, this_column.round); - } - - var this_format = this_column.format; - var formatter; - - if (this_format === 'percentage') formatter = d3.format('.0%'); - if (this_format === 'count') formatter = d3.format(',.0f'); - if (this_format === 'temperature') formatter = function formatter(t) { - return t + '°'; - }; - - td_text = formatter(td_text); - } - - if (this_column.hasOwnProperty('currency')) { - // this is another shorthand for formatting according to a currency amount, which gets appended to front of number - td_text = this_column.currency + td_text; - } - } - - td = tr.append('td').classed('table-' + td_type, true).classed('table-' + td_type + '-' + this._strip_punctuation(td_accessor), true).attr('data-value', td_value).style('width', this_column.width).style('text-align', td_type === 'title' || td_type === 'text' ? 'left' : 'right'); - - this._format_element(td, td_value, this_column); - - if (td_type === 'title') { - this_title = td.append('div').text(td_text); - this._format_element(this_title, td_text, this_column); - - if (args.columns[j].hasOwnProperty('secondary_accessor')) { - td.append('div').text(args.data[i][args.columns[j].secondary_accessor]).classed("secondary-title", true); - } - } else { - td.text(td_text); - } - } - } - - return this; - }; - - return this; -}; - -{ - var mg_missing_add_text = function mg_missing_add_text(svg, _ref38) { - var missing_text = _ref38.missing_text, - width = _ref38.width, - height = _ref38.height; - - svg.selectAll('.mg-missing-text').data([missing_text]).enter().append('text').attr('class', 'mg-missing-text').attr('x', width / 2).attr('y', height / 2).attr('dy', '.50em').attr('text-anchor', 'middle').text(missing_text); - }; - - var mg_missing_x_scale = function mg_missing_x_scale(args) { - args.scales.X = d3.scaleLinear().domain([0, args.data.length]).range([mg_get_plot_left(args), mg_get_plot_right(args)]); - args.scalefns.yf = function (_ref39) { - var y = _ref39.y; - return args.scales.Y(y); - }; - }; - - var mg_missing_y_scale = function mg_missing_y_scale(args) { - args.scales.Y = d3.scaleLinear().domain([-2, 2]).range([args.height - args.bottom - args.buffer * 2, args.top]); - args.scalefns.xf = function (_ref40) { - var x = _ref40.x; - return args.scales.X(x); - }; - }; - - var mg_make_fake_data = function mg_make_fake_data(args) { - var data = []; - for (var x = 1; x <= 50; x++) { - data.push({ x: x, y: Math.random() - x * 0.03 }); - } - args.data = data; - }; - - var mg_add_missing_background_rect = function mg_add_missing_background_rect(g, _ref41) { - var title = _ref41.title, - buffer = _ref41.buffer, - title_y_position = _ref41.title_y_position, - width = _ref41.width, - height = _ref41.height; - - g.append('svg:rect').classed('mg-missing-background', true).attr('x', buffer).attr('y', buffer + (title ? title_y_position : 0) * 2).attr('width', width - buffer * 2).attr('height', height - buffer * 2 - (title ? title_y_position : 0) * 2).attr('rx', 15).attr('ry', 15); - }; - - var mg_missing_add_line = function mg_missing_add_line(g, _ref42) { - var scalefns = _ref42.scalefns, - interpolate = _ref42.interpolate, - data = _ref42.data; - - var line = d3.line().x(scalefns.xf).y(scalefns.yf).curve(interpolate); - - g.append('path').attr('class', 'mg-main-line mg-line1-color').attr('d', line(data)); - }; - - var mg_missing_add_area = function mg_missing_add_area(g, _ref43) { - var scalefns = _ref43.scalefns, - scales = _ref43.scales, - interpolate = _ref43.interpolate, - data = _ref43.data; - - var area = d3.area().x(scalefns.xf).y0(scales.Y.range()[0]).y1(scalefns.yf).curve(interpolate); - - g.append('path').attr('class', 'mg-main-area mg-area1-color').attr('d', area(data)); - }; - - var mg_remove_all_children = function mg_remove_all_children(_ref44) { - var target = _ref44.target; - - d3.select(target).selectAll('svg *').remove(); - }; - - var mg_missing_remove_legend = function mg_missing_remove_legend(_ref45) { - var legend_target = _ref45.legend_target; - - if (legend_target) { - d3.select(legend_target).html(''); - } - }; - - var missingData = function missingData(args) { - var _this4 = this; - - this.init = function (args) { - _this4.args = args; - - mg_init_compute_width(args); - mg_init_compute_height(args); - - // create svg if one doesn't exist - - var container = d3.select(args.target); - mg_raise_container_error(container, args); - var svg = container.selectAll('svg'); - mg_remove_svg_if_chart_type_has_changed(svg, args); - svg = mg_add_svg_if_it_doesnt_exist(svg, args); - mg_adjust_width_and_height_if_changed(svg, args); - mg_set_viewbox_for_scaling(svg, args); - mg_remove_all_children(args); - - svg.classed('mg-missing', true); - mg_missing_remove_legend(args); - - chart_title(args); - - // are we adding a background placeholder - if (args.show_missing_background) { - mg_make_fake_data(args); - mg_missing_x_scale(args); - mg_missing_y_scale(args); - var g = mg_add_g(svg, 'mg-missing-pane'); - - mg_add_missing_background_rect(g, args); - mg_missing_add_line(g, args); - mg_missing_add_area(g, args); - } - - mg_missing_add_text(svg, args); - - _this4.windowListeners(); - - return _this4; - }; - - this.windowListeners = function () { - mg_window_listeners(_this4.args); - return _this4; - }; - - this.init(args); - }; - - var _defaults4 = { - top: 40, // the size of the top margin - bottom: 30, // the size of the bottom margin - right: 10, // size of the right margin - left: 0, // size of the left margin - buffer: 8, // the buffer between the actual chart area and the margins - legend_target: '', - width: 350, - height: 220, - missing_text: 'Data currently missing or unavailable', - scalefns: {}, - scales: {}, - show_tooltips: true, - show_missing_background: true - }; - - MG.register('missing-data', missingData, _defaults4); -} -function mg_process_scale_ticks(args, axis) { - var accessor; - var scale_ticks; - var max; - - if (axis === 'x') { - accessor = args.x_accessor; - scale_ticks = args.scales.X.ticks(args.xax_count); - max = args.processed.max_x; - } else if (axis === 'y') { - accessor = args.y_accessor; - scale_ticks = args.scales.Y.ticks(args.yax_count); - max = args.processed.max_y; - } - - function log10(val) { - if (val === 1000) { - return 3; - } - if (val === 1000000) { - return 7; - } - return Math.log(val) / Math.LN10; - } - - if (axis === 'x' && args.x_scale_type === 'log' || axis === 'y' && args.y_scale_type === 'log') { - // get out only whole logs - scale_ticks = scale_ticks.filter(function (d) { - return Math.abs(log10(d)) % 1 < 1e-6 || Math.abs(log10(d)) % 1 > 1 - 1e-6; - }); - } - - // filter out fraction ticks if our data is ints and if xmax > number of generated ticks - var number_of_ticks = scale_ticks.length; - - // is our data object all ints? - var data_is_int = true; - args.data.forEach(function (d, i) { - d.forEach(function (d, i) { - if (d[accessor] % 1 !== 0) { - data_is_int = false; - return false; - } - }); - }); - - if (data_is_int && number_of_ticks > max && args.format === 'count') { - // remove non-integer ticks - scale_ticks = scale_ticks.filter(function (d) { - return d % 1 === 0; - }); - } - - if (axis === 'x') { - args.processed.x_ticks = scale_ticks; - } else if (axis === 'y') { - args.processed.y_ticks = scale_ticks; - } -} - -function raw_data_transformation(args) { - 'use strict'; - - // dupe our data so we can modify it without adverse effect - - args.data = MG.clone(args.data); - - // we need to account for a few data format cases: - // #0 {bar1:___, bar2:___} // single object (for, say, bar charts) - // #1 [{key:__, value:__}, ...] // unnested obj-arrays - // #2 [[{key:__, value:__}, ...], [{key:__, value:__}, ...]] // nested obj-arrays - // #3 [[4323, 2343],..] // unnested 2d array - // #4 [[[4323, 2343],..] , [[4323, 2343],..]] // nested 2d array - args.single_object = false; // for bar charts. - args.array_of_objects = false; - args.array_of_arrays = false; - args.nested_array_of_arrays = false; - args.nested_array_of_objects = false; - - // is the data object a nested array? - - if (is_array_of_arrays(args.data)) { - args.nested_array_of_objects = args.data.map(function (d) { - return is_array_of_objects_or_empty(d); - }); // Case #2 - args.nested_array_of_arrays = args.data.map(function (d) { - return is_array_of_arrays(d); - }); // Case #4 - } else { - args.array_of_objects = is_array_of_objects(args.data); // Case #1 - args.array_of_arrays = is_array_of_arrays(args.data); // Case #3 - } - - if (args.chart_type === 'line') { - if (args.array_of_objects || args.array_of_arrays) { - args.data = [args.data]; - } - } else { - if (!mg_is_array(args.data[0])) { - args.data = [args.data]; - } - } - // if the y_accessor is an array, break it up and store the result in args.data - mg_process_multiple_x_accessors(args); - mg_process_multiple_y_accessors(args); - - // if user supplies keyword in args.color, change to arg.colors. - // this is so that the API remains fairly sensible and legible. - if (args.color !== undefined) { - args.colors = args.color; - } - - // if user has supplied args.colors, and that value is a string, turn it into an array. - if (args.colors !== null && typeof args.colors === 'string') { - args.colors = [args.colors]; - } - - // sort x-axis data - if (args.chart_type === 'line' && args.x_sort === true) { - for (var i = 0; i < args.data.length; i++) { - args.data[i].sort(function (a, b) { - return a[args.x_accessor] - b[args.x_accessor]; - }); - } - } - - return this; -} - -function mg_process_multiple_accessors(args, which_accessor) { - // turns an array of accessors into ... - if (mg_is_array(args[which_accessor])) { - args.data = args.data.map(function (_d) { - return args[which_accessor].map(function (ya) { - return _d.map(function (di) { - di = MG.clone(di); - - if (di[ya] === undefined) { - return undefined; - } - - di['multiline_' + which_accessor] = di[ya]; - return di; - }).filter(function (di) { - return di !== undefined; - }); - }); - })[0]; - args[which_accessor] = 'multiline_' + which_accessor; - } -} - -function mg_process_multiple_x_accessors(args) { - mg_process_multiple_accessors(args, 'x_accessor'); -} - -function mg_process_multiple_y_accessors(args) { - mg_process_multiple_accessors(args, 'y_accessor'); -} - -MG.raw_data_transformation = raw_data_transformation; - -function process_line(args) { - 'use strict'; - - var time_frame; - - // do we have a time-series? - var is_time_series = d3.sum(args.data.map(function (series) { - return series.length > 0 && mg_is_date(series[0][args.x_accessor]); - })) > 0; - - // are we replacing missing y values with zeros? - if ((args.missing_is_zero || args.missing_is_hidden) && args.chart_type === 'line' && is_time_series) { - for (var i = 0; i < args.data.length; i++) { - // we need to have a dataset of length > 2, so if it's less than that, skip - if (args.data[i].length <= 1) { - continue; - } - - var first = args.data[i][0]; - var last = args.data[i][args.data[i].length - 1]; - - // initialize our new array for storing the processed data - var processed_data = []; - - // we'll be starting from the day after our first date - var start_date = MG.clone(first[args.x_accessor]).setDate(first[args.x_accessor].getDate() + 1); - - // if we've set a max_x, add data points up to there - var from = args.min_x ? args.min_x : start_date; - var upto = args.max_x ? args.max_x : last[args.x_accessor]; - - time_frame = mg_get_time_frame((upto - from) / 1000); - - if (['four-days', 'many-days', 'many-months', 'years', 'default'].indexOf(time_frame) !== -1 && args.missing_is_hidden_accessor === null) { - for (var d = new Date(from); d <= upto; d.setDate(d.getDate() + 1)) { - var o = {}; - d.setHours(0, 0, 0, 0); - - // add the first date item, we'll be starting from the day after our first date - if (Date.parse(d) === Date.parse(new Date(start_date))) { - processed_data.push(MG.clone(args.data[i][0])); - } - - // check to see if we already have this date in our data object - var existing_o = null; - args.data[i].forEach(function (val, i) { - if (Date.parse(val[args.x_accessor]) === Date.parse(new Date(d))) { - existing_o = val; - - return false; - } - }); - - // if we don't have this date in our data object, add it and set it to zero - if (!existing_o) { - o[args.x_accessor] = new Date(d); - o[args.y_accessor] = 0; - o['_missing'] = true; //we want to distinguish between zero-value and missing observations - processed_data.push(o); - } - - // if the data point has, say, a 'missing' attribute set or if its - // y-value is null identify it internally as missing - else if (existing_o[args.missing_is_hidden_accessor] || existing_o[args.y_accessor] === null) { - existing_o['_missing'] = true; - processed_data.push(existing_o); - } - - //otherwise, use the existing object for that date - else { - processed_data.push(existing_o); - } - } - } else { - for (var j = 0; j < args.data[i].length; j += 1) { - var obj = MG.clone(args.data[i][j]); - obj['_missing'] = args.data[i][j][args.missing_is_hidden_accessor]; - processed_data.push(obj); - } - } - - // update our date object - args.data[i] = processed_data; - } - } - - return this; -} - -MG.process_line = process_line; - -function process_histogram(args) { - 'use strict'; - - // if args.binned == false, then we need to bin the data appropriately. - // if args.binned == true, then we need to make sure to compute the relevant computed data. - // the outcome of either of these should be something in args.computed_data. - // the histogram plotting function will be looking there for the data to plot. - - // we need to compute an array of objects. - // each object has an x, y, and dx. - - // histogram data is always single dimension - - var our_data = args.data[0]; - - var extracted_data; - if (args.binned === false) { - // use d3's built-in layout.histogram functionality to compute what you need. - - if (_typeof(our_data[0]) === 'object') { - // we are dealing with an array of objects. Extract the data value of interest. - extracted_data = our_data.map(function (d) { - return d[args.x_accessor]; - }); - } else if (typeof our_data[0] === 'number') { - // we are dealing with a simple array of numbers. No extraction needed. - extracted_data = our_data; - } else { - console.log('TypeError: expected an array of numbers, found ' + _typeof(our_data[0])); - return; - } - - var hist = d3.histogram(); - if (args.bins) { - hist.thresholds(args.bins); - } - - var bins = hist(extracted_data); - args.processed_data = bins.map(function (d) { - return { 'x': d.x0, 'y': d.length }; - }); - } else { - // here, we just need to reconstruct the array of objects - // take the x accessor and y accessor. - // pull the data as x and y. y is count. - - args.processed_data = our_data.map(function (d) { - return { 'x': d[args.x_accessor], 'y': d[args.y_accessor] }; - }); - - var this_pt; - var next_pt; - - // we still need to compute the dx component for each data point - for (var i = 0; i < args.processed_data.length; i++) { - this_pt = args.processed_data[i]; - if (i === args.processed_data.length - 1) { - this_pt.dx = args.processed_data[i - 1].dx; - } else { - next_pt = args.processed_data[i + 1]; - this_pt.dx = next_pt.x - this_pt.x; - } - } - } - - // capture the original data and accessors before replacing args.data - if (!args.processed) { - args.processed = {}; - } - args.processed.original_data = args.data; - args.processed.original_x_accessor = args.x_accessor; - args.processed.original_y_accessor = args.y_accessor; - - args.data = [args.processed_data]; - args.x_accessor = args.processed_x_accessor; - args.y_accessor = args.processed_y_accessor; - - return this; -} - -MG.process_histogram = process_histogram; - -// for use with bar charts, etc. -function process_categorical_variables(args) { - 'use strict'; - - var extracted_data, - processed_data = {}, - pd = []; - //var our_data = args.data[0]; - var label_accessor = args.bar_orientation === 'vertical' ? args.x_accessor : args.y_accessor; - var data_accessor = args.bar_orientation === 'vertical' ? args.y_accessor : args.x_accessor; - - return this; -} - -MG.process_categorical_variables = process_categorical_variables; - -function process_point(args) { - 'use strict'; - - var data = args.data[0]; - var x = data.map(function (d) { - return d[args.x_accessor]; - }); - var y = data.map(function (d) { - return d[args.y_accessor]; - }); - - if (args.least_squares) { - args.ls_line = least_squares(x, y); - } - - return this; -} - -MG.process_point = process_point; - -function add_ls(args) { - var svg = mg_get_svg_child_of(args.target); - var data = args.data[0]; - var min_x = d3.min(data, function (d) { - return d[args.x_accessor]; - }); - var max_x = d3.max(data, function (d) { - return d[args.x_accessor]; - }); - - d3.select(args.target).selectAll('.mg-least-squares-line').remove(); - - svg.append('svg:line').attr('x1', args.scales.X(min_x)).attr('x2', args.scales.X(max_x)).attr('y1', args.scales.Y(args.ls_line.fit(min_x))).attr('y2', args.scales.Y(args.ls_line.fit(max_x))).attr('class', 'mg-least-squares-line'); -} - -MG.add_ls = add_ls; - -function add_lowess(args) { - var svg = mg_get_svg_child_of(args.target); - var lowess = args.lowess_line; - - var line = d3.svg.line().x(function (d) { - return args.scales.X(d.x); - }).y(function (d) { - return args.scales.Y(d.y); - }).interpolate(args.interpolate); - - svg.append('path').attr('d', line(lowess)).attr('class', 'mg-lowess-line'); -} - -MG.add_lowess = add_lowess; - -function lowess_robust(x, y, alpha, inc) { - // Used http://www.unc.edu/courses/2007spring/biol/145/001/docs/lectures/Oct27.html - // for the clear explanation of robust lowess. - - // calculate the the first pass. - var _l; - var r = []; - var yhat = d3.mean(y); - var i; - for (i = 0; i < x.length; i += 1) { - r.push(1); - } - _l = _calculate_lowess_fit(x, y, alpha, inc, r); - var x_proto = _l.x; - var y_proto = _l.y; - - // Now, take the fit, recalculate the weights, and re-run LOWESS using r*w instead of w. - - for (i = 0; i < 100; i += 1) { - r = d3.zip(y_proto, y).map(function (yi) { - return Math.abs(yi[1] - yi[0]); - }); - - var q = d3.quantile(r.sort(), 0.5); - - r = r.map(function (ri) { - return _bisquare_weight(ri / (6 * q)); - }); - - _l = _calculate_lowess_fit(x, y, alpha, inc, r); - x_proto = _l.x; - y_proto = _l.y; - } - - return d3.zip(x_proto, y_proto).map(function (d) { - var p = {}; - p.x = d[0]; - p.y = d[1]; - return p; - }); -} - -MG.lowess_robust = lowess_robust; - -function lowess(x, y, alpha, inc) { - var r = []; - for (var i = 0; i < x.length; i += 1) { - r.push(1); - } - var _l = _calculate_lowess_fit(x, y, alpha, inc, r); -} - -MG.lowess = lowess; - -function least_squares(x_, y_) { - var x, - y, - xi, - yi, - _x = 0, - _y = 0, - _xy = 0, - _xx = 0; - - var n = x_.length; - if (mg_is_date(x_[0])) { - x = x_.map(function (d) { - return d.getTime(); - }); - } else { - x = x_; - } - - if (mg_is_date(y_[0])) { - y = y_.map(function (d) { - return d.getTime(); - }); - } else { - y = y_; - } - - var xhat = d3.mean(x); - var yhat = d3.mean(y); - var numerator = 0, - denominator = 0; - - for (var i = 0; i < x.length; i++) { - xi = x[i]; - yi = y[i]; - numerator += (xi - xhat) * (yi - yhat); - denominator += (xi - xhat) * (xi - xhat); - } - - var beta = numerator / denominator; - var x0 = yhat - beta * xhat; - - return { - x0: x0, - beta: beta, - fit: function fit(x) { - return x0 + x * beta; - } - }; -} - -MG.least_squares = least_squares; - -function _pow_weight(u, w) { - if (u >= 0 && u <= 1) { - return Math.pow(1 - Math.pow(u, w), w); - } else { - return 0; - } -} - -function _bisquare_weight(u) { - return _pow_weight(u, 2); -} - -function _tricube_weight(u) { - return _pow_weight(u, 3); -} - -function _neighborhood_width(x0, xis) { - return Array.max(xis.map(function (xi) { - return Math.abs(x0 - xi); - })); -} - -function _manhattan(x1, x2) { - return Math.abs(x1 - x2); -} - -function _weighted_means(wxy) { - var wsum = d3.sum(wxy.map(function (wxyi) { - return wxyi.w; - })); - - return { - xbar: d3.sum(wxy.map(function (wxyi) { - return wxyi.w * wxyi.x; - })) / wsum, - ybar: d3.sum(wxy.map(function (wxyi) { - return wxyi.w * wxyi.y; - })) / wsum - }; -} - -function _weighted_beta(wxy, xbar, ybar) { - var num = d3.sum(wxy.map(function (wxyi) { - return Math.pow(wxyi.w, 2) * (wxyi.x - xbar) * (wxyi.y - ybar); - })); - - var denom = d3.sum(wxy.map(function (wxyi) { - return Math.pow(wxyi.w, 2) * Math.pow(wxyi.x - xbar, 2); - })); - - return num / denom; -} - -function _weighted_least_squares(wxy) { - var ybar, xbar, beta_i, x0; - - var _wm = _weighted_means(wxy); - - xbar = _wm.xbar; - ybar = _wm.ybar; - - var beta = _weighted_beta(wxy, xbar, ybar); - - return { - beta: beta, - xbar: xbar, - ybar: ybar, - x0: ybar - beta * xbar - - }; -} - -function _calculate_lowess_fit(x, y, alpha, inc, residuals) { - // alpha - smoothing factor. 0 < alpha < 1/ - // - // - var k = Math.floor(x.length * alpha); - - var sorted_x = x.slice(); - - sorted_x.sort(function (a, b) { - if (a < b) { - return -1; - } else if (a > b) { - return 1; - } - - return 0; - }); - - var x_max = d3.quantile(sorted_x, 0.98); - var x_min = d3.quantile(sorted_x, 0.02); - - var xy = d3.zip(x, y, residuals).sort(); - - var size = Math.abs(x_max - x_min) / inc; - - var smallest = x_min; - var largest = x_max; - var x_proto = d3.range(smallest, largest, size); - - var xi_neighbors; - var x_i, beta_i, x0_i, delta_i, xbar, ybar; - - // for each prototype, find its fit. - var y_proto = []; - - for (var i = 0; i < x_proto.length; i += 1) { - x_i = x_proto[i]; - - // get k closest neighbors. - xi_neighbors = xy.map(function (xyi) { - return [Math.abs(xyi[0] - x_i), xyi[0], xyi[1], xyi[2]]; - }).sort().slice(0, k); - - // Get the largest distance in the neighbor set. - delta_i = d3.max(xi_neighbors)[0]; - - // Prepare the weights for mean calculation and WLS. - - xi_neighbors = xi_neighbors.map(function (wxy) { - return { - w: _tricube_weight(wxy[0] / delta_i) * wxy[3], - x: wxy[1], - y: wxy[2] - }; - }); - - // Find the weighted least squares, obviously. - var _output = _weighted_least_squares(xi_neighbors); - - x0_i = _output.x0; - beta_i = _output.beta; - - // - y_proto.push(x0_i + beta_i * x_i); - } - - return { x: x_proto, y: y_proto }; -} - -function format_rollover_number(args) { - var num; - if (args.format === 'count') { - num = function num(d) { - var is_float = d % 1 !== 0; - var pf; - - if (is_float) { - pf = d3.format(',.' + args.decimals + 'f'); - } else { - pf = d3.format(',.0f'); - } - - // are we adding units after the value or before? - if (args.yax_units_append) { - return pf(d) + args.yax_units; - } else { - return args.yax_units + pf(d); - } - }; - } else { - num = function num(d_) { - var fmt_string = (args.decimals ? '.' + args.decimals : '') + '%'; - var pf = d3.format(fmt_string); - return pf(d_); - }; - } - return num; -} - -var time_rollover_format = function time_rollover_format(f, d, accessor, utc) { - var fd; - if (typeof f === 'string') { - fd = MG.time_format(utc, f)(d[accessor]); - } else if (typeof f === 'function') { - fd = f(d); - } else { - fd = d[accessor]; - } - return fd; -}; - -// define our rollover format for numbers -var number_rollover_format = function number_rollover_format(f, d, accessor) { - var fd; - if (typeof f === 'string') { - fd = d3.format('s')(d[accessor]); - } else if (typeof f === 'function') { - fd = f(d); - } else { - fd = d[accessor]; - } - return fd; -}; - -function mg_format_y_rollover(args, num, d) { - var formatted_y; - if (args.y_mouseover !== null) { - if (args.aggregate_rollover) { - formatted_y = number_rollover_format(args.y_mouseover, d, args.y_accessor); - } else { - formatted_y = number_rollover_format(args.y_mouseover, d, args.y_accessor); - } - } else { - if (args.time_series) { - if (args.aggregate_rollover) { - formatted_y = num(d[args.y_accessor]); - } else { - formatted_y = args.yax_units + num(d[args.y_accessor]); - } - } else { - formatted_y = args.y_accessor + ': ' + args.yax_units + num(d[args.y_accessor]); - } - } - return formatted_y; -} - -function mg_format_x_rollover(args, fmt, d) { - var formatted_x; - if (args.x_mouseover !== null) { - if (args.time_series) { - if (args.aggregate_rollover) { - formatted_x = time_rollover_format(args.x_mouseover, d, 'key', args.utc); - } else { - formatted_x = time_rollover_format(args.x_mouseover, d, args.x_accessor, args.utc); - } - } else { - formatted_x = number_rollover_format(args.x_mouseover, d, args.x_accessor); - } - } else { - if (args.time_series) { - var date; - - if (args.aggregate_rollover && args.data.length > 1) { - date = new Date(d.key); - } else { - date = new Date(+d[args.x_accessor]); - date.setDate(date.getDate()); - } - - formatted_x = fmt(date) + ' '; - } else { - formatted_x = args.x_accessor + ': ' + d[args.x_accessor] + ' '; - } - } - return formatted_x; -} - -function mg_format_data_for_mouseover(args, d, mouseover_fcn, accessor, check_time) { - var formatted_data, formatter; - var time_fmt = mg_get_rollover_time_format(args); - if (typeof d[accessor] === 'string') { - formatter = function formatter(d) { - return d; - }; - } else { - formatter = format_rollover_number(args); - } - - if (mouseover_fcn !== null) { - if (check_time) formatted_data = time_rollover_format(mouseover_fcn, d, accessor, args.utc);else formatted_data = number_rollover_format(mouseover_fcn, d, accessor); - } else { - if (check_time) formatted_data = time_fmt(new Date(+d[accessor])) + ' ';else formatted_data = (args.time_series ? '' : accessor + ': ') + formatter(d[accessor]) + ' '; - } - return formatted_data; -} - -function mg_format_number_mouseover(args, d) { - return mg_format_data_for_mouseover(args, d, args.x_mouseover, args.x_accessor, false); -} - -function mg_format_x_mouseover(args, d) { - return mg_format_data_for_mouseover(args, d, args.x_mouseover, args.x_accessor, args.time_series); -} - -function mg_format_y_mouseover(args, d) { - return mg_format_data_for_mouseover(args, d, args.y_mouseover, args.y_accessor, false); -} - -function mg_format_x_aggregate_mouseover(args, d) { - return mg_format_data_for_mouseover(args, d, args.x_mouseover, 'key', args.time_series); -} - -MG.format_rollover_number = format_rollover_number; - -// http://bl.ocks.org/mbostock/3916621 -function path_tween(d1, precision) { - return function () { - var path0 = this, - path1 = path0.cloneNode(), - n0 = path0.getTotalLength() || 0, - n1 = (path1.setAttribute("d", d1), path1).getTotalLength() || 0; - - // Uniform sampling of distance based on specified precision. - var distances = [0], - i = 0, - dt = precision / Math.max(n0, n1); - while ((i += dt) < 1) { - distances.push(i); - }distances.push(1); - - // Compute point-interpolators at each distance. - var points = distances.map(function (t) { - var p0 = path0.getPointAtLength(t * n0), - p1 = path1.getPointAtLength(t * n1); - return d3.interpolate([p0.x, p0.y], [p1.x, p1.y]); - }); - - return function (t) { - return t < 1 ? "M" + points.map(function (p) { - return p(t); - }).join("L") : d1; - }; - }; -} - -MG.path_tween = path_tween; - -// influenced by https://bl.ocks.org/tomgp/c99a699587b5c5465228 - -function render_markup_for_server(callback) { - var virtual_window = MG.virtual_window; - var virtual_d3 = d3.select(virtual_window.document); - var target = virtual_window.document.createElement('div'); - - var original_d3 = global.d3; - var original_window = global.window; - var original_document = global.document; - global.d3 = virtual_d3; - global.window = virtual_window; - global.document = virtual_window.document; - - var error; - try { - callback(target); - } catch (e) { - error = e; - } - - global.d3 = original_d3; - global.window = original_window; - global.document = original_document; - - if (error) { - throw error; - } - - /* for some reason d3.select parses jsdom elements incorrectly - * but it works if we wrap the element in a function. - */ - return virtual_d3.select(function targetFn() { - return target; - }).html(); -} - -function render_markup_for_client(callback) { - var target = document.createElement('div'); - callback(target); - return d3.select(target).html(); -} - -function render_markup(callback) { - switch (typeof window === 'undefined' ? 'undefined' : _typeof(window)) { - case 'undefined': - return render_markup_for_server(callback); - default: - return render_markup_for_client(callback); - } -} - -function init_virtual_window(jsdom, force) { - if (MG.virtual_window && !force) { - return; - } - - var doc = jsdom.jsdom({ - html: '', - features: { QuerySelector: true } - }); - MG.virtual_window = doc.defaultView; -} - -MG.render_markup = render_markup; -MG.init_virtual_window = init_virtual_window; - -// call this to add a warning icon to a graph and log an error to the console -function error(args) { - console.error('ERROR : ', args.target, ' : ', args.error); - - d3.select(args.target).select('.mg-chart-title').append('tspan').attr('class', 'fa fa-x fa-exclamation-circle mg-warning').attr('dx', '0.3em').text('\uF06A'); -} - -function internal_error(args) { - console.error('INTERNAL ERROR : ', args.target, ' : ', args.internal_error); -} - -MG.error = error; -return MG; -})); diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/charts/annotations.htm b/priv/static/metrics-graphics-3.0-alpha3/examples/charts/annotations.htm deleted file mode 100644 index 5bd4d11..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/charts/annotations.htm +++ /dev/null @@ -1,338 +0,0 @@ - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='markers'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/some_percentage.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/some_percentage.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - var markers = [{ - 'date': new Date('2014-02-01T00:00:00.000Z'), - 'label': '1st Milestone' - }, { - 'date': new Date('2014-03-15T00:00:00.000Z'), - 'label': '2nd Milestone' - }]; - - MG.data_graphic({ - title: "Markers", - description: "Markers are vertical lines that can be added at arbitrary points. Markers that are close to each other won't collide.", - data: data, - width: 600, - height: 200, - right: 40, - markers: markers, - format: 'percentage', - target: '#markers' - }); -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='markers-clickable'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/some_percentage.json'>data</a></div> - - <pre><code class='javascript'>d3.json('data/some_percentage.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - var clicker = function() { - window.open('https://www.youtube.com/watch?v=dQw4w9WgXcQ', '_blank'); - }; - - var markers = [{ - 'date': new Date('2014-02-01T00:00:00.000Z'), - 'label': "Click me", - 'click': clicker - }, { - 'date': new Date('2014-03-15T00:00:00.000Z'), - 'label': "Nothing to see here" - }]; - - MG.data_graphic({ - title: "Clickable Markers", - description: "You can assign arbitrary functions to markers' click events.", - data: data, - width: 600, - height: 200, - right: 40, - markers: markers, - format: 'percentage', - target: '#markers-clickable' - }); -});</code></pre> - - </div> - </div> - - - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='markers-mouseover'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/some_percentage.json'>data</a></div> - - <pre><code class='javascript'>d3.json('data/some_percentage.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - var mouseover = function() { - alert("You are over me!"); - }; - - var markers = [{ - 'date': new Date('2014-02-01T00:00:00.000Z'), - 'label': "Place your mouse here", - 'mouseover': mouseover - }, { - 'date': new Date('2014-03-15T00:00:00.000Z'), - 'label': "Nothing to see here" - }]; - - MG.data_graphic({ - title: "Mouse Over Markers", - description: "You can assign arbitrary functions to markers' mouseover events.", - data: data, - width: 600, - height: 200, - right: 40, - markers: markers, - format: 'percentage', - target: '#markers-mouseover' - });</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='markers-mouseout'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/some_percentage.json'>data</a></div> - - <pre><code class='javascript'>d3.json('data/some_percentage.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - var mouseout = function() { - alert("You just left me!"); - }; - - var markers = [{ - 'date': new Date('2014-02-01T00:00:00.000Z'), - 'label': "Place your mouse here and out!", - 'mouseout': mouseout - }, { - 'date': new Date('2014-03-15T00:00:00.000Z'), - 'label': "Nothing to see here" - }]; - - MG.data_graphic({ - title: "Mouse Out Markers", - description: "You can assign arbitrary functions to markers' mouseout events.", - data: data, - width: 600, - height: 200, - right: 40, - markers: markers, - format: 'percentage', - target: '#markers-mouseout' - });</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='baselines'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/fake_users1.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/fake_users1.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Baselines", - description: "Baselines are horizontal lines that can added at arbitrary points.", - data: data, - baselines: [{value: 160000000, label: 'a baseline'}], - width: 600, - height: 200, - right: 40, - target: '#baselines' - }); -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center mg-main-area-solid' id='spike'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/fake_users1.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/fake_users1.json', function(data) { - data = MG.convert.date(data, 'date'); - - var markers = [{ - 'date': new Date('2014-03-17T00:00:00.000Z'), - 'label': 'Look, a spike!' - }]; - - MG.data_graphic({ - title: "Annotating a Point", - description: "By setting the graphic's target a class name of mg-main-area-solid, markers don't extend down to the bottom of the graphic, which better draws attention to, say, spikes.", - data: data, - width: 600, - height: 200, - right: 40, - markers: markers, - target: '#spike' - }); -});</code></pre> - - </div> - </div> - -<script> -MG._hooks = {}; -d3.json('data/some_percentage.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - var markers = [{ - 'date': new Date('2014-02-01T00:00:00.000Z'), - 'label': '1st Milestone' - }, { - 'date': new Date('2014-03-15T00:00:00.000Z'), - 'label': '2nd Milestone' - }]; - - MG.data_graphic({ - title: "Markers", - description: "Markers are vertical lines that can be added at arbitrary points. Markers that are close to each other won't collide.", - data: data, - width: 600, - height: 200, - right: 40, - markers: markers, - format: 'percentage', - target: '#markers' - }); - - var clicker = function() { - window.open('https://www.youtube.com/watch?v=dQw4w9WgXcQ', '_blank'); - }; - - markers = [{ - 'date': new Date('2014-02-01T00:00:00.000Z'), - 'label': "Click me", - 'click': clicker - }, { - 'date': new Date('2014-03-15T00:00:00.000Z'), - 'label': "Nothing to see here" - }]; - - MG.data_graphic({ - title: "Clickable Markers", - description: "You can assign arbitrary functions to markers' click events.", - data: data, - width: 600, - height: 200, - right: 40, - markers: markers, - format: 'percentage', - target: '#markers-clickable' - }); - - var mouseover = function() { - alert("You are over me!"); - }; - - markers = [{ - 'date': new Date('2014-02-01T00:00:00.000Z'), - 'label': "Place your mouse here", - 'mouseover': mouseover - }, { - 'date': new Date('2014-03-15T00:00:00.000Z'), - 'label': "Nothing to see here" - }]; - - MG.data_graphic({ - title: "Mouse Over Markers", - description: "You can assign arbitrary functions to markers' mouseover events.", - data: data, - width: 600, - height: 200, - right: 40, - markers: markers, - format: 'percentage', - target: '#markers-mouseover' - }); - - var mouseout = function() { - alert("You just left me!"); - }; - - markers = [{ - 'date': new Date('2014-02-01T00:00:00.000Z'), - 'label': "Place your mouse here and out!", - 'mouseout': mouseout - }, { - 'date': new Date('2014-03-15T00:00:00.000Z'), - 'label': "Nothing to see here" - }]; - - MG.data_graphic({ - title: "Mouse Out Markers", - description: "You can assign arbitrary functions to markers' mouseout events.", - data: data, - width: 600, - height: 200, - right: 40, - markers: markers, - format: 'percentage', - target: '#markers-mouseout' - }); - -}); - -d3.json('data/fake_users1.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Baselines", - description: "Baselines are horizontal lines that can added at arbitrary points.", - data: data, - baselines: [{value: 160000000, label: 'goal'}], - width: 600, - height: 200, - right: 40, - target: '#baselines' - }); -}); - -d3.json('data/fake_users1.json', function(data) { - data = MG.convert.date(data, 'date'); - - var markers = [{ - 'date': new Date('2014-03-17T00:00:00.000Z'), - 'label': 'Look, a spike!' - }]; - - MG.data_graphic({ - title: "Annotating a Point", - description: "By setting the graphic's target a class name of main-area-solid, markers don't extend down to the bottom of the graphic, which better draws attention to, say, spikes.", - data: data, - width: 600, - height: 200, - right: 40, - markers: markers, - target: '#spike' - }); -}); -</script> diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/charts/auto-time-formatting.htm b/priv/static/metrics-graphics-3.0-alpha3/examples/charts/auto-time-formatting.htm deleted file mode 100644 index af132dd..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/charts/auto-time-formatting.htm +++ /dev/null @@ -1,296 +0,0 @@ - <div class='row trunk-section'> - <div class='col-lg-7 text-center'> - <div class='row'> - <div class='col-lg-12 text-center' id='time1'></div> - <div class='col-lg-12 text-center' id='time2'></div> - <div class='col-lg-12 text-center' id='time3'></div> - <div class='col-lg-12 text-center' id='time4'></div> - <div class='col-lg-12 text-center' id='many-months'></div> - <div class='col-lg-12 text-center' id='a-few-years'></div> - <div class='col-lg-12 text-center' id='years'></div> - <div class='col-lg-12 text-center' id='decades'></div> - <div class='col-lg-12 text-center' id='centuries'></div> - - </div> - </div> - <div class='col-lg-5'> - - <pre><code class='javascript'>function fake_data(length, seconds) { - var d = new Date(); - var v = 100000; - var data=[]; - - for (var i = 0; i < length; i++) { - v += (Math.random() - 0.5) * 10000; - data.push({date: MG.clone(d), value: v}); - d = new Date(d.getTime() + seconds * 1000); - } - return data; -} - -function fake_days(length) { - var d = new Date(); - var v = 100000; - - var data = []; - for (var i = 0; i < length; i++) { - v += (Math.random() - 0.5) * 10000; - if (v < 0) v = 0; - data.push({date: MG.clone(d), value: v}); - d.setDate(d.getDate() + 1); - } - return data; -} - -function fake_years(length) { - var y = 2015; - var d = new Date(y,0,1); - out = []; - v = 100000; - for (var i = 0; i < length; i++) { - v += (Math.random()-.5) * 10000; - out.push({value:v, date: MG.clone(d)}); - y -=1; - d = new Date(y,0,1); - } - out.reverse(); - return out; -} - - -var less_than_a_minute = fake_data(25, 1); -var less_than_a_day = fake_data(25,60 * 20); -var a_few_days = fake_data(75,60 * 60); -var many_days = fake_days(60); -var many_many_many_days = fake_days(365*2); -var a_few_years = fake_days(365*4); - -MG.data_graphic({ - title: "European Clock", - description: 'By setting european_clock to true, you can default to European-style time. This is at the moment experimental, and the formatting may change.', - data: less_than_a_minute, - target: '#european', - european_clock: true, - width: 600, - height: 200, - right: 40 -}); - -MG.data_graphic({ - title: "Less Than A Minute", - data: less_than_a_minute, - target: '#time1', - width: 600, - height: 200, - right: 40 -}); - -MG.data_graphic({ - title: "Less Than A Day", - data: less_than_a_day, - target: '#time2', - width: 600, - height: 200, - right: 40 -}); - -MG.data_graphic({ - title: "A Few Days", - data: a_few_days, - target: '#time3', - width: 600, - height: 200, - right: 40 -}); - -MG.data_graphic({ - title: "Over A Large Span of Days", - data: many_days, - target: '#time4', - width: 600, - height: 200, - right: 40 -}); - -MG.data_graphic({ - title: "Over Many Months", - data: many_many_many_days, - target: '#many-months', - width: 600, - height: 200, - right: 40 -}); - -MG.data_graphic({ - title: "Over A Few Years", - data: a_few_years, - target: '#a-few-years', - width: 600, - height: 200, - right: 40 -}); - -MG.data_graphic({ - title: "Over Centuries", - data: fake_years(300), - target: '#centuries', - width: 600, - height: 200, - right: 40 -});</code></pre> - - </div> - </div> - - - <div class='row trunk-section'> - <div class='col-lg-7 text-center'> - <div class='row'> - <div class='col-lg-12 text-center' id='european'></div> - </div> - </div> - <div class='col-lg-5'> - - <pre><code class='javascript'>MG.data_graphic({ - title: "European Clock", - description: 'By setting european_clock to true, you can default to European-style time. This is at the moment experimental, and the formatting may change.', - data: less_than_a_minute, - target: '#european', - european_clock: true, - width: 600, - height: 200, - right: 40 -}); - </code></pre> - - </div> - </div> - -<script> -MG._hooks = {}; -function fake_data(length, seconds) { - var d = new Date(); - var v = 100000; - var data=[]; - - for (var i = 0; i < length; i++) { - v += (Math.random() - 0.5) * 10000; - data.push({date: MG.clone(d), value: v}); - d = new Date(d.getTime() + seconds * 1000); - } - return data; -} - -function fake_days(length) { - var d = new Date(); - var v = 100000; - - var data = []; - for (var i = 0; i < length; i++) { - v += (Math.random() - 0.5) * 10000; - if (v < 0) v = 0; - data.push({date: MG.clone(d), value: v}); - d.setDate(d.getDate() + 1); - } - return data; -} - -function fake_years(length) { - var y = 2015; - var d = new Date(y,0,1); - out = []; - v = 100000; - for (var i = 0; i < length; i++) { - v += (Math.random()-.5) * 10000; - out.push({value:v, date: MG.clone(d)}); - y -=1; - d = new Date(y,0,1); - } - out.reverse(); - return out; -} - - -var less_than_a_minute = fake_data(25, 1); -var less_than_a_day = fake_data(25,60 * 20); -var a_few_days = fake_data(75,60 * 60); -var many_days = fake_days(80); -var many_many_many_days = fake_days(365*2); -var a_few_years = fake_days(365*3); - -MG.data_graphic({ - title: "European Clock", - description: 'By setting european_clock to true, you can default to European-style time. This is at the moment experimental, and the formatting may change.', - data: less_than_a_minute, - target: '#european', - european_clock: true, - width: 600, - height: 200, - right: 40 -}); - -MG.data_graphic({ - title: "Less Than A Minute", - data: less_than_a_minute, - target: '#time1', - width: 600, - height: 200, - right: 40 -}); - -MG.data_graphic({ - title: "Less Than A Day", - data: less_than_a_day, - target: '#time2', - width: 600, - height: 200, - right: 40 -}); - -MG.data_graphic({ - title: "A Few Days", - data: a_few_days, - target: '#time3', - width: 600, - height: 200, - right: 40 -}); - -MG.data_graphic({ - title: "Over A Large Span of Days", - data: many_days, - width:600, - target: '#time4', - height: 200, - right: 40 -}); - -MG.data_graphic({ - title: "Over Many Months", - data: many_many_many_days, - target: '#many-months', - width: 600, - height: 200, - right: 40 -}); - -MG.data_graphic({ - title: "Over A Few Years", - data: a_few_years, - target: '#a-few-years', - width: 600, - height: 200, - right: 40 -}); - -MG.data_graphic({ - title: "Over Centuries", - data: fake_years(300), - target: '#centuries', - width: 600, - height: 200, - right: 40 -}); - - -</script> diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/charts/axes.htm b/priv/static/metrics-graphics-3.0-alpha3/examples/charts/axes.htm deleted file mode 100644 index 375120a..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/charts/axes.htm +++ /dev/null @@ -1,486 +0,0 @@ - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='xnotdate'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/xnotdate.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/xnotdate.json', function(data) { - MG.data_graphic({ - title: "Axis Labels", - description: "A graphic where we're not plotting dates on the x-axis and where the axes include labels and the line animates on load. We've also enabled extended ticks along the y-axis.", - data: data, - animate_on_load: true, - area: false, - width: 600, - height: 240, - right: 40, - left: 90, - bottom: 50, - y_extended_ticks: true, - target: '#xnotdate', - x_accessor: 'males', - y_accessor: 'females', - x_label: 'males', - y_label: 'females', - }); -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='percentage'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/some_percentage.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/some_percentage.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - MG.data_graphic({ - title: "Some Percentages", - description: "Here is an example that shows percentages.", - data: data, - width: 600, - height: 200, - right: 40, - format: 'percentage', - target: '#percentage' - }); -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='currency'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/some_currency.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/some_currency.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Some Currency", - description: "Here is an example that uses custom units for currency.", - data: data, - width: 600, - height: 200, - right: 40, - target: '#currency', - yax_units: '$' - }); -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='log1'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/log.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/log.json', function(data) { - data = [data]; - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - MG.data_graphic({ - title: "Log Scale", - description: "You can change the y-axis' scale to logarithmic by setting <i>y_scale_type</i> to <i>log</i>.", - data: data, - y_scale_type: 'log', - width: 600, - height: 200, - right: 40, - target: '#log1' - }); -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center'> - <div class='col-lg-12 text-center' id='hidden1'></div> - <div class='col-lg-12 text-center' id='hidden2'></div> - </div> - <div class='col-lg-5'> - <div class='data-column'> - <a href='data/fake_users1.json'>data 1</a>, - <a href='data/brief-1.json'>data 2</a> - </div> - -<pre><code class='javascript'>d3.json('data/fake_users1.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "No X Axis", - description: "You can hide either axis by setting <i>x_axis</i> or <i>y_axis</i> to false.", - data: data, - decimals: 0, - width: 600, - height: 200, - right: 40, - xax_count: 4, - target: '#hidden1', - area: false, - x_axis: false, - }); -}); - -d3.json('data/brief-1.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "No Y Axis", - description: "You can hide either axis by setting <i>x_axis</i> or <i>y_axis</i> to false.", - data: data, - decimals: 0, - width: 600, - height: 200, - right: 20, - xax_count: 4, - target: '#hidden2', - area: false, - y_axis: false - }); -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='y_rug'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/fake_users1.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/fake_users1.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Rug Plots", - description: "You can set rug plots either axis by setting <i>x_rug</i> or <i>y_rug</i> to true.", - data: data, - decimals: 0, - width: 600, - height: 200, - right: 40, - target: '#y_rug', - area: false, - y_rug: true - }); -});</code></pre> - - </div> -</div> - - - - - - - - - - -<div class='row trunk-section'> - <div class='col-lg-7 text-center'> - <div class='row'> - <div class='col-lg-6 text-center' id='axis-pos-1'></div> - <div class='col-lg-6 text-center' id='axis-pos-2'></div> - </div> - <div class='row'> - <div class='col-lg-6 text-center' id='axis-pos-3'></div> - <div class='col-lg-6 text-center' id='axis-pos-4'></div> - </div> - </div> - <div class='col-lg-5'> - <div class='data-column'> - <a href='data/fake_users1.json'>data 1</a>, - <a href='data/brief-1.json'>data 2</a> - </div> - -<pre><code class='javascript'>d3.json('data/brief-1.json', function(data) { - data = MG.convert.date(data, 'date'); - var position = [['left', 'top'],['right', 'top'], ['left', 'bottom'], ['right', 'bottom']]; - position.forEach(function(pos,i) { - console.log(pos,i) - var i = i+1; - - MG.data_graphic({ - title: "Axis Positions: " + pos[0] +', ' + pos[1], - description: "Set <i>x_axis_position: " + pos[1] + "</i> and <i>x_axis_position: " + pos[0] +"</i>.", - x_axis_position: pos[1], - y_axis_position: pos[0], - data: data, - decimals: 0, - left: pos[0] === 'right' ? 20 : 50, - right: pos[0] === 'left' ? 20 : 50, - top: pos[1] === 'bottom' ? 50 : 50, - bottom: pos[1] === 'top' ? 25 : 50, - target: '#axis-pos-'+i, - area: false - }); - }) -});</code></pre> - - </div> -</div> - - -<script> -d3.json('data/brief-1.json', function(data) { - data = MG.convert.date(data, 'date'); - var position = [['left', 'top'],['right', 'top'], ['left', 'bottom'], ['right', 'bottom']]; - position.forEach(function(pos,i) { - var i = i+1; - - MG.data_graphic({ - title: "Axis Positions: " + pos[0] +', ' + pos[1], - description: "Set <i>x_axis_position: " + pos[1] + "</i> and <i>x_axis_position: " + pos[0] +"</i>.", - x_axis_position: pos[1], - y_axis_position: pos[0], - data: data, - decimals: 0, - left: pos[0] === 'right' ? 20 : 50, - right: pos[0] === 'left' ? 20 : 50, - top: pos[1] === 'bottom' ? 50 : 50, - bottom: pos[1] === 'top' ? 25 : 50, - target: '#axis-pos-'+i, - area: false - }); - }) -}); -</script> - - - - - - - - - - <div class='row trunk-section'> - <div class='col-lg-7 text-center'> - <div class='col-lg-6 text-center' id='neg1'></div> - <div class='col-lg-6 text-center' id='neg2'></div> - <div class='col-lg-6 text-center' id='y-axis-not-zero'></div> - </div> - <div class='col-lg-5'> - <div class='data-column'> - <a href='data/neg1.json'>data 1</a>, - <a href='data/neg2.json'>data 2</a> - </div> - -<pre><code class='javascript'>d3.json('data/neg1.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Negative Values 1", - description: "MG defaults to 0 on the y-axis as min if there are no negative numbers. If there are negatives, should provide some buffer below.", - data: data, - width: 295, - height: 220, - right: 10, - target: '#neg1' - }); - - var data2 = MG.clone(data).map(function(d) { - d.value = d.value + 550; - return d; - }); - - MG.data_graphic({ - title: "Y-Axis Not Zero", - data: data2, - width: 295, - height: 220, - right: 10, - min_y_from_data: true, - yax_units: '$', - target: '#y-axis-not-zero', - x_accessor: 'date', - y_accessor: 'value' - }); -}); - -d3.json('data/neg2.json', function(data) { - MG.data_graphic({ - title: "Negative Values 2", - data: data, - width: 295, - height: 220, - right: 10, - target: '#neg2', - x_accessor: 'subject', - y_accessor: 'measure' - }); -});</code></pre> - - </div> - </div> - -<script> -MG._hooks = {}; -d3.json('data/xnotdate.json', function(data) { - MG.data_graphic({ - title: "Axis Labels", - description: "A graphic where we're not plotting dates on the x-axis and where the axes include labels and the line animates on load. We've also enabled extended ticks along the y-axis.", - data: data, - animate_on_load: true, - area: false, - width: 600, - height: 240, - right: 40, - left: 90, - bottom: 50, - y_extended_ticks: true, - target: '#xnotdate', - x_accessor: 'males', - y_accessor: 'females', - x_label: 'males', - y_label: 'females', - }); -}); - -d3.json('data/some_percentage.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - MG.data_graphic({ - title: "Some Percentages", - description: "Here is an example that shows percentages.", - data: data, - width: 600, - height: 200, - right: 40, - format: 'percentage', - target: '#percentage' - }); -}); - -d3.json('data/some_currency.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Some Currency", - description: "Here is an example that uses custom units for currency.", - data: data, - width: 600, - height: 200, - right: 40, - target: '#currency', - yax_units: '$' - }); -}); - -d3.json('data/log.json', function(data) { - data = [data]; - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - MG.data_graphic({ - title: "Log Scale", - description: "You can change the y-axis' scale to logarithmic by setting <i>y_scale_type</i> to <i>log</i>.", - data: data, - y_scale_type: 'log', - width: 600, - height: 200, - right: 40, - target: '#log1' - }); -}); - -d3.json('data/fake_users1.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "No X Axis", - description: "You can hide either axis by setting <i>x_axis</i> or <i>y_axis</i> to false.", - data: data, - decimals: 0, - width: 600, - height: 200, - right: 40, - xax_count: 4, - target: '#hidden1', - area: false, - x_axis: false, - }); -}); - -d3.json('data/brief-1.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "No Y Axis", - description: "You can hide either axis by setting <i>x_axis</i> or <i>y_axis</i> to false.", - data: data, - decimals: 0, - width: 600, - height: 200, - right: 20, - xax_count: 4, - target: '#hidden2', - area: false, - y_axis: false - }); -}); - -d3.json('data/fake_users1.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Rug Plots", - description: "You can set rug plots either axis by setting <i>x_rug</i> or <i>y_rug</i> to true.", - data: data, - decimals: 0, - width: 600, - height: 200, - right: 40, - target: '#y_rug', - area: false, - y_rug: true - }); -}); - -d3.json('data/neg1.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Negative Values 1", - description: "MG defaults to 0 on the y-axis as min if there are no negative numbers. If there are negatives, should provide some buffer below.", - data: data, - width: 295, - height: 220, - right: 10, - target: '#neg1' - }); - - var data2 = MG.clone(data).map(function(d) { - d.value = d.value + 550; - return d; - }); - - MG.data_graphic({ - title: "Y-Axis Not Zero", - data: data2, - width: 295, - height: 220, - right: 10, - min_y_from_data: true, - yax_units: '$', - target: '#y-axis-not-zero', - x_accessor: 'date', - y_accessor: 'value' - }); -}); - -d3.json('data/neg2.json', function(data) { - MG.data_graphic({ - title: "Negative Values 2", - data: data, - width: 295, - height: 220, - right: 10, - target: '#neg2', - x_accessor: 'subject', - y_accessor: 'measure' - }); -}); -</script> diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/charts/brushing_zooming.htm b/priv/static/metrics-graphics-3.0-alpha3/examples/charts/brushing_zooming.htm deleted file mode 100644 index e23e35d..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/charts/brushing_zooming.htm +++ /dev/null @@ -1,166 +0,0 @@ - <div class='row trunk-section'> - <div class='col-lg-7'> - <div class='row'> - <div class='col-lg-12 text-center' id='basic_brushing'></div> - <div class='col-lg-12 text-center' id='point_chart_brushing'></div> - </div> - </div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/fake_users3.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/fake_users2.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - MG.data_graphic({ - title: "Basic Brushing & Zooming", - description: "This is a simple example of brushing and zooming. You can set 'brush' as 'xy', 'x', 'y' to specify the axis(es) that may be brushed.", - data: data, - top: 70, - width: 600, - height: 240, - right: 40, - missing_is_hidden: true, - target: '#basic_brushing', - brush: 'xy', - }); -}); - -d3.json('data/points1.json', function(data) { - MG.data_graphic({ - title: "Point Chart Brushing", - description: "Brushing and zooming also works for point charts.", - data: data, - chart_type: 'point', - width: 600, - height: 240, - right: 40, - target: '#point_chart_brushing', - x_accessor: 'x', - y_accessor: 'y', - y_rug: true, - brush: 'xy', - }); -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7'> - <div class='row'> - <div class='col-lg-12 text-center' id='main'></div> - <div class='col-lg-12 text-center' id='overview_plot'></div> - </div> - </div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/fake_users3.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/fake_users2.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - const main = { - title: "Overview Plot", - description: "This is a simple example of an overview plot. You can create an overview plot by creating another chart with 'zoom_target' option and then setting it as the object of the main chart.", - data: data, - top: 70, - width: 600, - height: 200, - right: 40, - missing_is_hidden: true, - target: '#main', - brush: 'xy', - } - MG.data_graphic(main); - MG.data_graphic({ - data: data, - width: 600, - height: 50, - top: 8, - bottom: 0, - right: 40, - missing_is_hidden: true, - target: '#overview_plot', - brush: 'x', - zoom_target: main, - x_axis: false, - y_axis: false, - showActivePoint: false, - }); -});</code></pre> - - </div> - </div> - -<script> -d3.json('data/fake_users2.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - MG.data_graphic({ - title: "Basic Brushing & Zooming", - description: "This is a simple example of brushing and zooming. You can set 'brush' as 'xy', 'x', 'y' to specify the axis(es) that may be brushed.", - data: data, - top: 70, - width: 600, - height: 240, - right: 40, - missing_is_hidden: true, - target: '#basic_brushing', - brush: 'xy', - }); -}); - -d3.json('data/points1.json', function(data) { - MG.data_graphic({ - title: "Point Chart Brushing", - description: "Brushing and zooming also works for point charts.", - data: data, - chart_type: 'point', - width: 600, - height: 240, - right: 40, - target: '#point_chart_brushing', - x_accessor: 'x', - y_accessor: 'y', - y_rug: true, - brush: 'xy', - }); -}); - -d3.json('data/fake_users2.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - const main = { - title: "Overview Plot", - description: "This is a simple example of an overview plot. You can create an overview plot by creating another chart with 'zoom_target' option and then setting it as the object of the main chart.", - data: data, - top: 70, - width: 600, - height: 200, - right: 40, - missing_is_hidden: true, - target: '#main', - brush: 'xy', - } - MG.data_graphic(main); - MG.data_graphic({ - data: data, - width: 600, - height: 50, - top: 8, - bottom: 0, - right: 40, - missing_is_hidden: true, - target: '#overview_plot', - brush: 'x', - zoom_target: main, - x_axis: false, - y_axis: false, - showActivePoint: false, - }); -}); - -</script> diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/charts/data.htm b/priv/static/metrics-graphics-3.0-alpha3/examples/charts/data.htm deleted file mode 100644 index aa0f076..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/charts/data.htm +++ /dev/null @@ -1,386 +0,0 @@ - <div class='row trunk-section'> - <div class='col-lg-7 text-center'> - <div class='row'> - <div class='col-lg-12 text-center' id='missing-y'></div> - </div> - </div> - <div class='col-lg-5'> - <div class='data-column'> - <a href='data/missing-y.json'>data</a> - </div> - -<pre><code class='javascript'>d3.json('data/missing-y.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Few Observations", - description: "We sometimes have only a few observations. By setting <i>missing_is_zero: true</i>, missing values for a time-series will be interpreted as zeros. In this example, we've overridden the rollover callback to show 'no data' for missing observations and have set the <i>min_x</i> and <i>max_x</i> options in order to expand the date range.", - data: data, - interpolate: d3.curveLinear, - missing_is_zero: true, - width: 600, - height: 200, - right: 40, - min_x: new Date('2014-01-01'), - max_x: new Date('2014-06-01'), - target: '#missing-y', - mouseover: function(d, i) { - var df = d3.timeFormat('%b %d, %Y'); - var date = df(d.date); - var y_val = (d.value === 0) ? 'no data' : d.value; - - d3.select('#missing-y svg .mg-active-datapoint') - .text(date + ' ' + y_val); - } - }); -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='missing_is_hidden'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/missing-is-hidden.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/missing-is-hidden.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Broken Lines", - description: "Setting <i>missing_is_hidden</i> to true will hide missing ranges rather than considering them to be zeros or interpolating between the two points on either side.", - data: data, - missing_is_hidden: true, - width: 600, - height: 200, - right: 40, - target: '#missing_is_hidden', - area: false, - show_secondary_x_label: false - }); -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='missing_is_hidden_accessor'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/missing-is-hidden-accessor.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/missing-is-hidden-accessor.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Broken Lines (Missing Data Points)", - description: "You can hide individual data points on a particular attribute by setting <i>missing_is_hidden_accessor</i>. Data points whose y-accessor values are null are also hidden.", - data: data, - missing_is_hidden: true, - missing_is_hidden_accessor: 'dead', - width: 600, - height: 200, - right: 40, - target: '#missing_is_hidden_accessor' - }); -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center'> - <div class='row'> - <div class='col-lg-12 text-center' id='missing-data'></div> - </div> - </div> - <div class='col-lg-5'> - -<pre><code class='javascript'>MG.data_graphic({ - title: "Missing Data", - description: "This is an example of a graphic whose data is currently missing. We've also set the <i>error</i> option, which appends an error icon to the title and logs an error to the browser's console.", - error: 'This data is blocked by Lorem Ipsum. Get your **** together, Ipsum.', - chart_type: 'missing-data', - missing_text: 'This is an example of a missing chart', - target: '#missing-data', - width: 600, - height: 200 -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center'> - <div class='row'> - <div class='col-lg-12 text-center' id='missing1'></div> - </div> - </div> - <div class='col-lg-5'> - <div class='data-column'> - <a href='data/fake_users2.json'>data</a> - </div> - -<pre><code class='javascript'>d3.json('data/fake_users2.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - var all_the_data = MG.clone(data[0]); - for (i = 1; i < data.length; i++){ - for (var j = 0; j < data[i].length; j++) { - if (i === 2 && all_the_data[j].date < new Date('2014-02-01')) { - } else { - all_the_data[j]['value' + (i + 1)] = data[i][j].value; - } - } - } - - MG.data_graphic({ - title: "Handling Different Sized Lines in a Single Array", - description: "How do you handle data with multiple implied time series lengths?", - data: all_the_data, - width: 600, - height: 200, - right: 40, - target: '#missing1', - linked: true, - x_accessor: 'date', - y_accessor: ['value', 'value2', 'value3'] - }); -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center'> - <div class='row'> - <div class='col-lg-12 text-center' id='display_active_point_01'></div> - </div> - </div> - <div class='col-lg-5'> - <div class='data-column'> - <a href='data/fake_users2.json'>data</a> - </div> - - <pre><code class='javascript'>d3.json('data/fake_users1.json', function(data) { - - for (var i = 0; i < data.length; i++) { - data[i].active = (i % 5 === 0); - } - - data = MG.convert.date(data, 'date'); - - MG.data_graphic({ - title: "Show active points on line chart", - description: "This line chart displays pre-defined active points", - data: data, - width: 600, - height: 200, - right: 40, - point_size: 3, - active_point_on_lines: true, - active_point_accessor: 'active', - active_point_size: 2, - target: '#display_active_point_01', - aggregate_rollover: true - }); -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center'> - <div class='row'> - <div class='col-lg-12 text-center' id='display_active_point_02'></div> - </div> - </div> - <div class='col-lg-5'> - <div class='data-column'> - <a href='data/fake_users2.json'>data</a> - </div> - - <pre><code class='javascript'>d3.json('data/fake_users2.json', function(data) { - - for (var i = 0; i < data.length; i++) { - for (var j = 0; j < data[i].length; j++) { - if (i === 0) { - data[i][j].active = (j % 5 === 0); - } - if (i === 1) { - data[i][j].active = (j % 10 === 0); - } - } - data[i] = MG.convert.date(data[i], 'date'); - } - - MG.data_graphic({ - title: "Show active points on multi-lines chart", - description: "This multi-lines chart displays pre-defined active points for each lines", - data: data, - width: 600, - height: 200, - right: 40, - point_size: 3, - active_point_on_lines: true, - active_point_accessor: 'active', - active_point_size: 2, - target: '#display_active_point_01', - aggregate_rollover: true - }); -});</code></pre> - - </div> - </div> - -<script> -MG._hooks = {}; -d3.json('data/missing-y.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Few Observations", - description: "We sometimes have only a few observations. By setting <i>missing_is_zero: true</i>, missing values for a time-series will be interpreted as zeros. In this example, we've overridden the rollover callback to show 'no data' for missing observations and have set the <i>min_x</i> and <i>max_x</i> options in order to expand the date range.", - data: data, - interpolate: d3.curveLinear, - missing_is_zero: true, - width: 600, - height: 200, - right: 40, - min_x: new Date('2014-01-01'), - max_x: new Date('2014-06-01'), - target: '#missing-y', - mouseover: function(d, i) { - var df = d3.timeFormat('%b %d, %Y'); - var date = df(d.date); - var y_val = (d.value === 0) ? 'no data' : d.value; - - d3.select('#missing-y svg .mg-active-datapoint') - .text(date + ' ' + y_val); - } - }); -}); - -d3.json('data/missing-is-hidden.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Broken Lines (Missing Data Range)", - description: "Setting <i>missing_is_hidden</i> to true will hide missing ranges rather than considering them to be zeros or interpolating between the two points on either side.", - data: data, - missing_is_hidden: true, - width: 600, - height: 200, - right: 40, - target: '#missing_is_hidden', - area: false, - show_secondary_x_label: false - }); -}); - -d3.json('data/missing-is-hidden-accessor.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Broken Lines (Missing Data Points)", - description: "You can hide individual data points on a particular attribute by setting <i>missing_is_hidden_accessor</i>. Data points whose y-accessor values are null are also hidden.", - data: data, - missing_is_hidden: true, - missing_is_hidden_accessor: 'dead', - width: 600, - height: 200, - right: 40, - target: '#missing_is_hidden_accessor' - }); -}); - - -MG.data_graphic({ - title: "Missing Data", - chart_type: 'missing-data', - description: "This is an example of a graphic whose data is currently missing. We've also set the <i>error</i> option, which appends an error icon to the title and logs an error to the browser's console.", - error: 'This data is blocked by Lorem Ipsum. Get your **** together, Ipsum.', - missing_text: 'This is an example of a missing chart', - target: '#missing-data', - width: 600, - height: 200 -}); - -d3.json('data/fake_users2.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - var all_the_data = MG.clone(data[0]); - for (i = 1; i < data.length; i++){ - for (var j = 0; j < data[i].length; j++) { - if (i === 2 && all_the_data[j].date < new Date('2014-02-01')) { - } else { - all_the_data[j]['value' + (i + 1)] = data[i][j].value; - } - } - } - - MG.data_graphic({ - title: "Handling Different Sized Lines in a Single Array", - description: "How do you handle data with multiple implied time series lengths?", - data: all_the_data, - width: 600, - height: 200, - right: 40, - target: '#missing1', - linked: true, - x_accessor: 'date', - y_accessor: ['value', 'value2', 'value3'] - }); -}); - -d3.json('data/fake_users1.json', function(data) { - - for (var i = 0; i < data.length; i++) { - data[i].active = (i % 5 === 0); - } - - data = MG.convert.date(data, 'date'); - - MG.data_graphic({ - title: "Show active points on line chart", - description: "This line chart displays pre-defined active points", - data: data, - width: 600, - height: 200, - right: 40, - point_size: 3, - active_point_on_lines: true, - active_point_accessor: 'active', - active_point_size: 2, - target: '#display_active_point_01', - aggregate_rollover: true - }); -}); - -d3.json('data/fake_users2.json', function(data) { - - for (var i = 0; i < data.length; i++) { - for (var j = 0; j < data[i].length; j++) { - if (i === 0) { - data[i][j].active = (j % 5 === 0); - } - if (i === 1) { - data[i][j].active = (j % 10 === 0); - } - } - data[i] = MG.convert.date(data[i], 'date'); - } - - MG.data_graphic({ - title: "Show active points on multi-lines chart", - description: "This multi-lines chart displays pre-defined active points for each lines", - data: data, - width: 600, - height: 200, - right: 40, - point_size: 3, - active_point_on_lines: true, - active_point_accessor: 'active', - active_point_size: 2, - target: '#display_active_point_02', - aggregate_rollover: true - }); -}); -</script> diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/charts/experimental.htm b/priv/static/metrics-graphics-3.0-alpha3/examples/charts/experimental.htm deleted file mode 100644 index 725a8d3..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/charts/experimental.htm +++ /dev/null @@ -1,1159 +0,0 @@ - <div class='row trunk-section'> - <div class='col-lg-7 text-center'> - <div class='col-lg-6 text-center' id='scatter-simple'></div> - <div class='col-lg-6 text-center' id='categorical1'></div> - <div class='col-lg-6 text-center' id='categorical2'></div> - <div class='col-lg-6 text-center' id='scatter-line-best-fit'></div> - <div class='col-lg-6 text-center' id='scatter-size-and-color'></div> - <div class='col-lg-6 text-center' id='sls-time-series'></div> - <div class='col-lg-6 text-center' id='highlight'></div> - </div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/points1.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/points1.json', function(data) { - MG.data_graphic({ - title: "Simple Scatterplot", - description: "This is an example of a simple scatterplot, in which we have enabled rug plots on the y-axis by setting the <i>y_rug</i> option to true.", - data: data, - chart_type: 'point', - width: 295, - height: 225, - right: 10, - target: '#scatter-simple', - x_accessor: 'x', - y_accessor: 'y', - mouseover: function(d, i) { console.log(d,i); }, - y_rug: true - }); - - MG.data_graphic({ - title: "Automatic Category Coloring", - description: "By setting <i>color_type</i> to 'category' you can color the points according to another discrete value.", - data: data, - chart_type: 'point', - width: 295, - height: 225, - right: 10, - target: '#categorical1', - x_accessor: 'x', - y_accessor: 'y', - color_accessor: 'v', - color_type:'category', - y_rug: true - }); - - MG.data_graphic({ - title: "Custom Category Color Mapping", - description: "You can specify the color domain and the corresponding color range to get custom mapping of categories to colors.", - data: data, - chart_type: 'point', - width: 295, - height: 225, - right: 10, - target: '#categorical2', - x_accessor: 'x', - y_accessor: 'y', - color_accessor: 'v', - color_domain: ['cat_0', 'cat_1', 'other'], - color_range: ['blue', 'gray', 'black'], - color_type: 'category', - x_rug: true - }); - - MG.data_graphic({ - title: "Simple Line of Best Fit", - description: "For any scatterplot, set <i>least_squares</i> to true to add.", - data: data, - least_squares: true, - chart_type: 'point', - width: 295, - height: 225, - right: 10, - target: '#scatter-line-best-fit', - x_accessor: 'x', - y_accessor: 'y' - }); - - MG.data_graphic({ - title: "Points Highlighting", - description: "You can set <i>highlight</i> to filter the points you want to highlight.", - data: data, - chart_type: 'point', - width: 295, - height: 225, - right: 10, - target: '#highlight', - x_accessor: 'x', - y_accessor: 'y', - y_rug: true, - highlight: (d, i) => d.z > 2 - }); -}); - -d3.json('data/fake_users1.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Another Least Squares Example", - description: "Least squares effortlessly works with dates or times on axes.", - data: data, - chart_type: 'point', - width: 295, - height: 225, - left: 60, - right: 10, - least_squares: true, - target: '#sls-time-series', - x_accessor: 'date', - y_accessor: 'value' - }); -}); - -var color_range = (theme === 'light') ? null : ['white','yellow']; - -d3.json('data/points1.json', function(data) { - MG.data_graphic({ - title: "Scatterplot with Size and Color", - description: "Scatterplots have <i>x_accessor</i>, <i>y_accessor</i>, <i>size_accessor</i>, and <i>color_accessor</i>. For the last two you can also provide domain and range functions, to make it easy to change the color ranges. Colors default to red and blue, but can be overridden by passing an array of colors to <i>color_range</i>, as we've done in this example for the dark theme.", - data: data, - chart_type: 'point', - width: 295, - height: 225, - right: 10, - target: '#scatter-size-and-color', - x_accessor: 'x', - y_accessor: 'y', - color_accessor:'z', - color_range: color_range, - size_accessor:'w', - x_rug: true, - y_rug: true - }); -});</code></pre> - - </div> - </div> - - -<div class='row trunk-section'> - <div class='col-lg-7 text-center'> - <div class='row'> - <div class='col-lg-6 text-center' id='point-categorical'></div> - <div class='col-lg-6 text-center' id='bar-categorical'></div> - </div> - - <div class='row'> - <div class='col-lg-6 text-center' id='point-categorical2'></div> - <div class='col-lg-6 text-center' id='bar-categorical2'></div> - - </div> - <div class='row'> - <div class='col-lg-6 text-center' id='point-categorical-group'></div> - <div class='col-lg-6 text-center' id='bar-categorical-group'> - </div> - - </div> - <div class='row'> - <div class='col-lg-12 text-center' id='point-categorical-group-horizontal'></div> - </div> - <div class='row'> - <div class='col-lg-12 text-center' id='bar-categorical-group-horizontal'></div> - </div> - </div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/nh-gop.tsv'>data</a></div> - -<pre><code class='javascript'> -d3.tsv('data/nh-gop.tsv', function(data) { - var polls = []; - var who = ['Bush', 'Rubio', 'Trump', 'Cruz']; - data.forEach(function(p){ - who.forEach(function(d){ - var out = {}; - out.candidate = d; - out.number = p[d] === '--' ? 0 : parseFloat(p[d]); - out.poll = p.Poll; - out.size = Math.random(); - out.when = p.Date; - polls.push(out); - }) - }); - - var trump = polls.filter(function(d){ - return d.poll == 'PPP (D)'; - }) - - MG.data_graphic({ - title: 'Categorical Scale: X, points', - data: trump, - chart_type: 'point', - y_accessor: 'number', - x_accessor: 'candidate', - height:400, - width:300, - target: '#point-categorical', - }) - - MG.data_graphic({ - title: 'Categorical Scale: X, bars', - data: trump, - chart_type: 'bar', - y_accessor: 'number', - x_accessor: 'candidate', - height:400, - width:300, - target: '#bar-categorical', - }) - - MG.data_graphic({ - title: 'Categorical Scale: Y, points', - data: trump, - chart_type: 'point', - x_accessor: 'number', - y_accessor: 'candidate', - height:400, - width:300, - target: '#point-categorical2', - }) - - MG.data_graphic({ - title: 'Categorical Scale: Y, bars', - data: trump, - chart_type: 'bar', - x_accessor: 'number', - y_accessor: 'candidate', - height:400, - width:300, - target: '#bar-categorical2', - }) - - MG.data_graphic({ - title: 'Y points, groups', - data: polls, - chart_type: 'point', - y_axis_type: 'categorical', - x_accessor: 'number', - y_accessor: 'candidate', - ygroup_accessor: 'poll', - size_accessor: 'size', - size_domain: [0,1], - size_range: [3,6], - height:550, - width:300, - left:100, - target: '#point-categorical-group' - }) - - MG.data_graphic({ - title: 'Y bars, groups', - data: polls, - chart_type: 'bar', - y_axis_type: 'categorical', - x_accessor: 'number', - y_accessor: 'candidate', - ygroup_accessor: 'poll', - height:550, - width:300, - left:100, - right:40, - target: '#bar-categorical-group' - }) - - MG.data_graphic({ - title: 'Categorical Scale: Y, groups, horizontal', - data: polls, - chart_type: 'point', - y_accessor: 'number', - x_accessor: 'candidate', - xgroup_accessor: 'poll', - size_accessor: 'size', - size_domain: [0,1], - size_range: [3,6], - height:350, - width:700, - target: '#point-categorical-group-horizontal' - }) - - MG.data_graphic({ - title: 'Categorical Scale: Y, groups, horizontal', - data: polls, - chart_type: 'bar', - y_accessor: 'number', - x_accessor: 'candidate', - xgroup_accessor: 'poll', - size_accessor: 'size', - size_domain: [0,1], - size_range: [3,6], - height:350, - width:700, - target: '#bar-categorical-group-horizontal' - }) -}) -</code></pre> - - </div> -</div> - - -<script> -d3.tsv('data/nh-gop.tsv', function(data) { - var polls = []; - var who = ['Bush', 'Rubio', 'Trump', 'Cruz']; - data.forEach(function(p,j){ - who.forEach(function(d,i){ - var out = {}; - out.candidate = d; - out.number = p[d] === '--' ? 0 : parseFloat(p[d]); - out.poll = p.Poll; - out.size = Math.random(); - out.when = p.Date; - out.reference = Math.floor(Math.random() * 20 + 1); - out.comparison = j+i + 1; - polls.push(out); - }) - }); - - var trump = polls.filter(function(d){ - return d.poll == 'PPP (D)'; - }) - - MG.data_graphic({ - title: 'Categorical Scale: X, points', - data: trump, - chart_type: 'point', - y_accessor: 'number', - x_accessor: 'candidate', - height:300, - width:300, - target: '#point-categorical', - }) - - MG.data_graphic({ - title: 'Categorical Scale: X, bars', - data: trump, - chart_type: 'bar', - y_accessor: 'number', - x_accessor: 'candidate', - height:300, - width:300, - target: '#bar-categorical', - }) - - MG.data_graphic({ - title: 'Categorical Scale: Y, points', - data: trump, - chart_type: 'point', - x_accessor: 'number', - y_accessor: 'candidate', - height:300, - width:300, - target: '#point-categorical2', - }) - - MG.data_graphic({ - title: 'Categorical Scale: Y, bars', - data: trump, - chart_type: 'bar', - x_accessor: 'number', - y_accessor: 'candidate', - height:300, - width:300, - target: '#bar-categorical2', - }) - - MG.data_graphic({ - title: 'Y points, groups', - data: polls, - chart_type: 'point', - y_axis_type: 'categorical', - x_accessor: 'number', - y_accessor: 'candidate', - ygroup_accessor: 'poll', - size_accessor: 'size', - size_domain: [0,1], - size_range: [3,6], - height:550, - width:300, - left:100, - target: '#point-categorical-group' - }) - - MG.data_graphic({ - title: 'Y bars, groups', - data: polls, - chart_type: 'bar', - y_axis_type: 'categorical', - x_accessor: 'number', - y_accessor: 'candidate', - ygroup_accessor: 'poll', - height:550, - width:300, - left:100, - target: '#bar-categorical-group' - }) - - MG.data_graphic({ - title: 'Categorical Scale: Y, groups, horizontal', - data: polls, - chart_type: 'point', - y_accessor: 'number', - x_accessor: 'candidate', - xgroup_accessor: 'poll', - size_accessor: 'size', - size_domain: [0,1], - size_range: [3,6], - height:300, - width:650, - target: '#point-categorical-group-horizontal' - }) - - MG.data_graphic({ - title: 'Categorical Scale: Y, groups, horizontal', - data: polls, - chart_type: 'bar', - y_accessor: 'number', - x_accessor: 'candidate', - xgroup_accessor: 'poll', - size_accessor: 'size', - size_domain: [0,1], - size_range: [3,6], - height:300, - width:650, - target: '#bar-categorical-group-horizontal' - }) -}) -</script> - - - - - <div class='row trunk-section'> - <div class='col-lg-7 text-center'> - <div class='col-lg-6 text-center' id='histogram1'></div> - <div class='col-lg-6 text-center' id='histogram2'></div> - <div class='col-lg-6 text-center' id='histogram3'></div> - <div class='col-lg-6 text-center' id='histogram4'></div> - <div class='col-lg-12 text-center' id='time-hist'></div> - <div class='col-lg-12 text-center' id='ufos'></div> - </div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/ufo_dates.csv'>data</a></div> - -<pre><code class='javascript'>var values = d3.range(10000).map(d3.randomBates(10)); - -MG.data_graphic({ - title: "Histogram 1", - description: "Raw data values being fed in. Here, we specify the number of bins to be 50 and have bar margins set to 0. The histogram graphic type includes the ability to <a href='http://en.wikipedia.org/wiki/Freedman%E2%80%93Diaconis_rule'>bin data</a>.", - data: values, - chart_type: 'histogram', - width: 295, - height: 180, - right: 10, - bins: 50, - bar_margin: 0, - target: '#histogram1', - y_extended_ticks: true, - mouseover: function(d, i) { - var pf = d3.format(',.2f'); - d3.select('#histogram1 svg .mg-active-datapoint') - .text('Value: ' + pf(d.x) + ' Count: ' + d.y); - } -}); - -d3.csv('data/ufo_dates.csv', function(ufos){ - var data = ufos.map(function(d){ - return parseInt(d.value) / 30; - }); - data.sort(); - MG.data_graphic({ - title: "Difference in UFO Sighting and Reporting Dates (in months)", - description: "Semi-real data about the reported differences between the supposed sighting of a UFO and the date it was reported.", - data: data, - chart_type: 'histogram', - width: 600, - height: 300, - right: 40, - bar_margin: 0, - bins: 150, - target: '#ufos', - y_extended_ticks: true, - mouseover: function(d, i) { - var pf = d3.format(',.2f'); - d3.select('#ufos svg .mg-active-datapoint') - .text(pf(d.x) + ' months Volume: ' + pf(d.y)); - } - }); -}); - -var second = d3.range(10000).map(function(d) { return Math.random() * 10; }); -second = d3.histogram()(second) - .map(function(d) { - return {'count': d.y, 'value': d.x}; -}); - -MG.data_graphic({ - title: "Histogram 2", - description: "Already binned data being fed in.", - data: second, - binned: true, - chart_type: 'histogram', - width: 295, - height: 180, - right: 10, - target: '#histogram2', - y_extended_ticks: true, - x_accessor: 'value', - y_accessor: 'count', - mouseover: function(d, i) { - var pf = d3.format(',.2f'); - d3.select('#histogram2 svg .mg-active-datapoint') - .text('Value: ' + pf(d.x) + ' Count: ' + d.y); - } -}); - -var third = d3.range(10000).map(d3.randomBates(10)); -third = third.map(function(d,i){ return {val1: d, val2: i}; }); - -MG.data_graphic({ - title: "Histogram 3", - description: "Unbinned, but in same format as other line chart data.", - data: third, - chart_type: 'histogram', - width: 295, - height: 180, - right: 10, - target: '#histogram3', - linked: true, - y_extended_ticks: true, - x_accessor: 'val1', - mouseover: function(d, i) { - var pf = d3.format(',.2f'); - d3.select('#histogram3 svg .mg-active-datapoint') - .text('Value: ' + pf(d.x) + ' Count: ' + d.y); - } -}); - -// check for negative values, for sanity. -var fourth = d3.range(10000).map(d3.randomBates(10)); -fourth = fourth.map(function(d,i){ return d - 0.5; }); - -MG.data_graphic({ - title: "Histogram 4", - description: "Sanity-checking negative data.", - data: fourth, - chart_type: 'histogram', - width: 295, - height: 180, - right: 10, - target: '#histogram4', - y_extended_ticks: true, - x_accessor: 'val1', - mouseover: function(d, i) { - var pf = d3.format(',.2f'); - d3.select('#histogram4 svg .mg-active-datapoint') - .text('Value: ' + pf(d.x) + ' Count: ' + d.y); - } -}); - -var hist1 = fake_data(25, 60).map(function(d){ - d.value = Math.round(d.value); - return d; -}); - -MG.data_graphic({ - title: "Histograms can be time series as well", - data: hist1, - target: '#time-hist', - chart_type: 'histogram', - width: 600, - height: 200, - binned: true, -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='table1'></div> - <div class='col-lg-5'> - -<pre><code class='javascript'>var table_data = [ - { 'year': 1852, 'value1': 10.2, 'value2': 1030004.43423,'share': 0.12, 'total': 34003400, 'temp': 43, 'geo': 'United Kingdom', 'description': "Having a way of describing a row can be useful." }, - { 'year': 1901, 'value1': 10.1, 'value2': 54003.223, 'share': 0.11, 'total': 4302100, 'temp': 55, 'geo': 'United States', 'description': "More made-up numbers." }, - { 'year': 1732, 'value1': 4.3, 'value2': 1004.91422, 'share': 0.14, 'total': 4300240, 'temp': 42, 'geo': 'France', 'description': "We didn't specify a title for this column." }, - { 'year': 1945, 'value1': 2.9, 'value2': 2430.121, 'share': 0.23, 'total': 24000000, 'temp': 54, 'geo': 'Brazil', 'description': "Brazil, Brazil." }, - { 'year': 1910, 'value1': 1.0, 'value2': 5432.3, 'share': 0.19, 'total': 130000, 'temp': 52, 'geo': 'India', 'description': "Last description in the whole thing." } -]; - -var table1 = MG.data_table({ - title: "A Data Table", - description: "A table is often the most appropriate way to present data. We aim to make the creation of data tables very simple. We are working on implementing sparklines, bullet charts, and other niceties.", - data: table_data, - show_tooltips: true - }) - .target('#table1') - .title({ - accessor: 'geo', - secondary_accessor:'year', - label: 'Country', - description: "These are arbitrary countries with arbitrary years underneath." - }) - .number({ accessor: 'value1', label: 'Size', value_formatter: function(d){ return d + ' yrds'; }}) - .number({ accessor: 'value2', label: 'Score', round: 2, font_weight: 'bold' }) - .number({ accessor: 'temp', label: 'Temp.', format: 'temperature', width: 100, color: 'gray' }) - .number({ - accessor: 'total', - label: 'Volume', - format: 'count', currency: '$', - width: 100, - font_weight: function(d){ return d < 5000000 ? 'bold' : 'normal'; }, - color: function(d){ return d < 5000000 ? '#f70101' : 'auto'; } - }) - .number({ accessor: 'share', label: 'Share', format: 'percentage', width: 100 }) - .text({ accessor: 'description', width: 240, font_style: 'italic' }) - .display();</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='buttons'></div> - <div class='col-lg-5'> - -<pre><code class='javascript'>var bdata = [ - {a:'apples', b:'quartz'}, - {a:'bananas', b:'pyrite'}, - {a:'durian', b:'obsidian'} -]; - -var resolution_features = ['weekly', 'monthly']; - -var buttons = MG.button_layout('#buttons') - .data(bdata) - .manual_button('Time Scale', resolution_features, function(){ console.log('switched time scales'); }) - .button('a', 'Fruit') - .button('b', 'Rock') - .callback(function(){ - console.log('made it'); - return false; - }) - .display();</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center'> - <div class="tooltip"></div> - <style> - .tooltip { - display: none; - min-height: 32px; - min-width: 100px; - padding: 12px; - margin-bottom: 8px; - background-color: #333; - color: white; - opacity: 0.7; - text-align: left; - } - </style> - <div class='col-lg-12 text-center' id='tooltip-line-chart'></div> - <div class='col-lg-12 text-center' id='tooltip-point-chart'></div> - </div> - <div class='col-lg-5'> - -<pre><code class='html'><div class="tooltip"></div> -<style> -.tooltip { - display: none; - min-height: 32px; - min-width: 100px; - padding: 12px; - margin-bottom: 8px; - background-color: #333; - color: white; - opacity: 0.7; - text-align: left; -} -</style> -</code></pre> - -<pre><code class='javascript'>const tooltipEl = d3.select('.tooltip').node(); -const tooltip = new Popper(document.documentElement, tooltipEl, { placement: 'top' }); -tooltipEl.addEventListener('mouseover', () => { - tooltipEl.style.display = 'block'; -}) -tooltipEl.addEventListener('mouseout', () => { - tooltipEl.style.display = 'none'; -}) - -d3.json('data/fake_users1.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Tooltip on line chart", - description: "Using popper.js and the mouseover callback, you can easily create a tooltip when the user hovers over a particular datapoint.", - data: data, - width: 600, - height: 200, - right: 40, - target: '#tooltip-line-chart', - x_accessor: 'date', - y_accessor: 'value', - show_rollover_text: false, - mouseover: (d, i) => { - tooltipEl.style.display = 'block'; - tooltipEl.innerText = `date: ${d3.timeFormat('%b %e, %Y')(d.date)}\nvalue: ${d.value}`; - tooltip.reference = d3.select(`#tooltip-line-chart .mg-line-rollover-circle`).node(); - tooltip.update(); - }, - mouseout: () => { - tooltipEl.style.display = 'none'; - } - }); -}); - -d3.json('data/points1.json', function(data) { - MG.data_graphic({ - title: "Tooltip on point chart", - description: "This technique also works for point charts.", - data: data, - chart_type: 'point', - width: 600, - height: 350, - right: 10, - target: '#tooltip-point-chart', - x_accessor: 'x', - y_accessor: 'y', - show_rollover_text: false, - mouseover: (d, i) => { - tooltipEl.style.display = 'block'; - tooltipEl.innerText = `X: ${d.data.x}\nY: ${d.data.y}`; - tooltip.reference = d3.select(`#tooltip-point-chart .mg-points .path-${i}`).node(); - tooltip.update(); - }, - mouseout: (d, i) => { - tooltipEl.style.display = 'none'; - } - }); -});</code></pre> - - </div> - </div> - - -<script> -MG._hooks = {}; -d3.json('data/points1.json', function(data) { - MG.data_graphic({ - title: "Simple Scatterplot", - description: "This is an example of a simple scatterplot, in which we have enabled rug plots on the y-axis by setting the <i>y_rug</i> option to true.", - data: data, - chart_type: 'point', - width: 295, - height: 225, - right: 10, - target: '#scatter-simple', - x_accessor: 'x', - y_accessor: 'y', - y_rug: true - }); - - MG.data_graphic({ - title: "Automatic Category Coloring", - description: "By setting <i>color_type</i> to 'category' you can color the points according to another discrete value.", - data: data, - chart_type: 'point', - width: 295, - height: 225, - right: 10, - target: '#categorical1', - x_accessor: 'x', - y_accessor: 'y', - color_accessor: 'v', - color_type: 'category', - y_rug: true - }); - - MG.data_graphic({ - title: "Custom Category Color Mapping", - description: "You can specify the color domain and the corresponding color range to get custom mapping of categories to colors.", - data: data, - chart_type: 'point', - width: 295, - height: 225, - right: 10, - target: '#categorical2', - x_accessor: 'x', - y_accessor: 'y', - color_accessor: 'v', - color_domain: ['cat_0', 'cat_1', 'other'], - color_range: ['blue', 'gray', 'black'], - color_type: 'category', - x_rug: true - }); - - MG.data_graphic({ - title: "Simple Line of Best Fit", - description: "For any scatterplot, set <i>least_squares</i> to true to add.", - data: data, - least_squares: true, - chart_type: 'point', - width: 295, - height: 225, - right: 10, - target: '#scatter-line-best-fit', - x_accessor: 'x', - y_accessor: 'y' - }); - - MG.data_graphic({ - title: "Points Highlighting", - description: "You can set <i>highlight</i> to filter the points you want to highlight.", - data: data, - chart_type: 'point', - width: 295, - height: 225, - right: 10, - target: '#highlight', - x_accessor: 'x', - y_accessor: 'y', - y_rug: true, - highlight: (d, i) => d.z > 2 - }); -}); - -d3.json('data/fake_users1.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Another Least Squares Example", - description: "Least squares effortlessly works with dates or times on axes.", - data: data, - chart_type: 'point', - width: 295, - height: 225, - left: 60, - right: 10, - least_squares: true, - target: '#sls-time-series', - x_accessor: 'date', - y_accessor: 'value' - }); -}); - -var color_range = (theme === 'light') ? null : ['white','yellow']; - -d3.json('data/points1.json', function(data) { - MG.data_graphic({ - title: "Scatterplot with Size and Color", - description: "Scatterplots have <i>x_accessor</i>, <i>y_accessor</i>, <i>size_accessor</i>, and <i>color_accessor</i>. For the last two you can also provide domain and range functions, to make it easy to change the color ranges. Colors default to red and blue, but can be overridden by passing an array of colors to <i>color_range</i>, as we've done in this example for the dark theme.", - data: data, - chart_type: 'point', - width: 295, - height: 225, - right: 10, - target: '#scatter-size-and-color', - x_accessor: 'x', - y_accessor: 'y', - color_accessor: 'z', - color_range: color_range, - size_accessor: 'w', - x_rug: true, - y_rug: true - }); -}); - -var values = d3.range(10000).map(d3.randomBates(10)); - -MG.data_graphic({ - title: "Histogram 1", - description: "Raw data values being fed in. Here, we specify the number of bins to be 50 and have bar margins set to 0. The histogram graphic type includes the ability to <a href='http://en.wikipedia.org/wiki/Freedman%E2%80%93Diaconis_rule'>bin data</a>.", - data: values, - chart_type: 'histogram', - width: 295, - height: 180, - bins: 50, - bar_margin: 0, - target: '#histogram1', - y_extended_ticks: true, - mouseover: function(d, i) { - var pf = d3.format(',.2f'); - d3.select('#histogram1 svg .mg-active-datapoint') - .text('Value: ' + pf(d.x) + ' Count: ' + d.y); - } -}); - -d3.csv('data/ufo_dates.csv', function(ufos){ - var data = ufos.map(function(d){ - return parseInt(d.value) / 30; - }); - data.sort(); - MG.data_graphic({ - title: "Difference in UFO Sighting and Reporting Dates (in months)", - description: "Semi-real data about the reported differences between the supposed sighting of a UFO and the date it was reported.", - data: data, - chart_type: 'histogram', - width: 600, - height: 300, - right: 40, - bar_margin: 0, - bins: 150, - target: '#ufos', - y_extended_ticks: true, - mouseover: function(d, i) { - var pf = d3.format(',.2f'); - d3.select('#ufos svg .mg-active-datapoint') - .text(pf(d.x) + ' months Volume: ' + d.y); - } - }); -}); - -var second = d3.range(10000).map(function(d) { return Math.random() * 10; }); -second = d3.histogram()(second) - .map(function(d) { - return {'value': d.x0, 'count': d.length}; -}); - -MG.data_graphic({ - title: "Histogram 2", - description: "Already binned data being fed in.", - data: second, - binned: true, - chart_type: 'histogram', - width: 295, - height: 180, - target: '#histogram2', - y_extended_ticks: true, - x_accessor: 'value', - y_accessor: 'count', - mouseover: function(d, i) { - var pf = d3.format(',.2f'); - d3.select('#histogram2 svg .mg-active-datapoint') - .text('Value: ' + pf(d.x) + ' Count: ' + d.y); - } -}); - -var third = d3.range(10000).map(d3.randomBates(10)); -third = third.map(function(d,i){ return {val1: d, val2: i}; }); - -MG.data_graphic({ - title: "Histogram 3", - description: "Unbinned, but in same format as other line chart data.", - data: third, - chart_type: 'histogram', - width: 295, - height: 180, - target: '#histogram3', - linked: true, - y_extended_ticks: true, - x_accessor: 'val1', - mouseover: function(d, i) { - var pf = d3.format(',.2f'); - d3.select('#histogram3 svg .mg-active-datapoint') - .text('Value: ' + pf(d.x) + ' Count: ' + d.y); - } -}); - -// check for negative values, for sanity. -var fourth = d3.range(10000).map(d3.randomBates(10)); -fourth = fourth.map(function(d,i){ return d - 0.5; }); - -MG.data_graphic({ - title: "Histogram 4", - description: "Sanity-checking negative data.", - data: fourth, - chart_type: 'histogram', - width: 295, - height: 180, - target: '#histogram4', - y_extended_ticks: true, - x_accessor: 'val1', - mouseover: function(d, i) { - var pf = d3.format(',.2f'); - d3.select('#histogram4 svg .mg-active-datapoint') - .text('Value: ' + pf(d.x) + ' Count: ' + d.y); - } -}); - -var hist1 = fake_data(25, 60).map(function(d){ - d.value = Math.round(d.value); - return d; -}); - -MG.data_graphic({ - title: "Histograms can be time series as well", - data: hist1, - target: '#time-hist', - chart_type: 'histogram', - width: 600, - height: 200, - binned: true, -}); - -var table_data = [ - { 'year': 1852, 'value1': 10.2, 'value2': 1030004.43423,'share': 0.12, 'total': 34003400, 'temp': 43, 'geo': 'United Kingdom', 'description': "Having a way of describing a row can be useful." }, - { 'year': 1901, 'value1': 10.1, 'value2': 54003.223, 'share': 0.11, 'total': 4302100, 'temp': 55, 'geo': 'United States', 'description': "More made-up numbers." }, - { 'year': 1732, 'value1': 4.3, 'value2': 1004.91422, 'share': 0.14, 'total': 4300240, 'temp': 42, 'geo': 'France', 'description': "We didn't specify a title for this column." }, - { 'year': 1945, 'value1': 2.9, 'value2': 2430.121, 'share': 0.23, 'total': 24000000, 'temp': 54, 'geo': 'Brazil', 'description': "Brazil, Brazil." }, - { 'year': 1910, 'value1': 1.0, 'value2': 5432.3, 'share': 0.19, 'total': 130000, 'temp': 52, 'geo': 'India', 'description': "Last description in the whole thing." } -]; - -var table1 = MG.data_table({ - title: "A Data Table", - description: "A table is often the most appropriate way to present data. We aim to make the creation of data tables very simple. We are working on implementing sparklines, bullet charts, and other niceties.", - data: table_data, - show_tooltips: true - }) - .target('#table1') - .title({ - accessor: 'geo', - secondary_accessor:'year', - label: 'Country', - description: "These are arbitrary countries with arbitrary years underneath." - }) - .number({ accessor: 'value1', label: 'Size', value_formatter: function(d){ return d + ' yrds'; }}) - .number({ accessor: 'value2', label: 'Score', round: 2, font_weight: 'bold' }) - .number({ accessor: 'temp', label: 'Temp.', format: 'temperature', width: 100, color: 'gray' }) - .number({ - accessor: 'total', - label: 'Volume', - format: 'count', currency: '$', - width: 100, - font_weight: function(d){ return d < 5000000 ? 'bold' : 'normal'; }, - color: function(d){ return d < 5000000 ? '#f70101' : 'auto'; } - }) - .number({ accessor: 'share', label: 'Share', format: 'percentage', width: 100 }) - .text({ accessor: 'description', width: 240, font_style: 'italic' }) - .display(); - -var bdata = [ - {a:'apples', b:'quartz'}, - {a:'bananas', b:'pyrite'}, - {a:'durian', b:'obsidian'} -]; - -var resolution_features = ['weekly', 'monthly']; - -var buttons = MG.button_layout('#buttons') - .data(bdata) - .manual_button('Time Scale', resolution_features, function(){ console.log('switched time scales'); }) - .button('a', 'Fruit') - .button('b', 'Rock') - .callback(function(){ - console.log('made it'); - return false; - }) - .display(); - -addScatterplotSizeAndColor(theme); - -function addScatterplotSizeAndColor(theme) { - var color_range = (theme === 'light') ? null : ['white','yellow']; - - // call data_graphic again since we need to use a different color_range for the dark theme - d3.json('data/points1.json', function(data) { - MG.data_graphic({ - title: "Scatterplot with Size and Color", - description: "Scatterplots have <i>x_accessor</i>, <i>y_accessor</i>, <i>size_accessor</i>, and <i>color_accessor</i>. For the last two you can also provide domain and range functions, to make it easy to change the color ranges. Colors default to red and blue, but can be overridden by passing an array of colors to <i>color_range</i>, as we've done in this example for the dark theme.", - data: data, - chart_type: 'point', - width: 295, - height: 225, - right: 10, - target: '#scatter-size-and-color', - x_accessor: 'x', - y_accessor: 'y', - color_accessor: 'z', - color_range: color_range, - size_accessor: 'w', - x_rug: true, - y_rug: true - }); - }); -} - -function fake_data(length, seconds) { - var d = new Date(); - var v = 100000; - var data=[]; - - for (var i = 0; i < length; i++){ - v += (Math.random() - 0.5) * 10000; - data.push({date: MG.clone(d), value: v}); - d = new Date(d.getTime() + seconds * 1000); - } - return data; -} - -function fake_days(length) { - var d = new Date(); - var v = 100000; - - var data = []; - for (var i = 0; i<length; i++) { - v += (Math.random() - 0.5) * 10000; - data.push({date: MG.clone(d), value: v}); - d.setDate(d.getDate() + 1); - } - return data; -} - -const tooltipEl = d3.select('.tooltip').node(); -const tooltip = new Popper(document.documentElement, tooltipEl, { placement: 'top' }); -tooltipEl.addEventListener('mouseover', () => { - tooltipEl.style.display = 'block'; -}) -tooltipEl.addEventListener('mouseout', () => { - tooltipEl.style.display = 'none'; -}) - -d3.json('data/fake_users1.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Tooltip on line chart", - description: "Using popper.js and the mouseover callback, you can easily create a tooltip when the user hovers over a particular datapoint.", - data: data, - width: 600, - height: 200, - right: 40, - target: '#tooltip-line-chart', - x_accessor: 'date', - y_accessor: 'value', - show_rollover_text: false, - mouseover: (d, i) => { - tooltipEl.style.display = 'block'; - tooltipEl.innerText = `date: ${d3.timeFormat('%b %e, %Y')(d.date)}\nvalue: ${d.value}`; - tooltip.reference = d3.select(`#tooltip-line-chart .mg-line-rollover-circle`).node(); - tooltip.update(); - }, - mouseout: () => { - tooltipEl.style.display = 'none'; - } - }); -}); - -d3.json('data/points1.json', function(data) { - MG.data_graphic({ - title: "Tooltip on point chart", - description: "This technique also works for point charts.", - data: data, - chart_type: 'point', - width: 600, - height: 350, - right: 10, - target: '#tooltip-point-chart', - x_accessor: 'x', - y_accessor: 'y', - show_rollover_text: false, - mouseover: (d, i) => { - tooltipEl.style.display = 'block'; - tooltipEl.innerText = `X: ${d.data.x}\nY: ${d.data.y}`; - tooltip.reference = d3.select(`#tooltip-point-chart .mg-points .path-${i}`).node(); - tooltip.update(); - }, - mouseout: (d, i) => { - tooltipEl.style.display = 'none'; - } - }); -}); -</script> diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/charts/lines.htm b/priv/static/metrics-graphics-3.0-alpha3/examples/charts/lines.htm deleted file mode 100644 index b758d34..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/charts/lines.htm +++ /dev/null @@ -1,335 +0,0 @@ - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='fake_users1'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/fake_users1.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/fake_users1.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Line Chart", - description: "This is a simple line chart. You can remove the area portion by adding <i>area: false</i> to the arguments list.", - data: data, - width: 600, - height: 200, - right: 40, - target: document.getElementById('fake_users1'), - x_accessor: 'date', - y_accessor: 'value' - }); -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='confidence_band'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/confidence_band.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/confidence_band.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Confidence Band", - description: "This is an example of a graphic with a confidence band and extended x-axis ticks enabled.", - data: data, - format: 'percentage', - width: 600, - height: 200, - right: 40, - area: false, - target: '#confidence_band', - show_secondary_x_label: false, - show_confidence_band: ['l', 'u'], - x_extended_ticks: true - }); -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='small-range'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/small-range.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/small-range.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Small Range of Integers", - description: "When we have a data object of integers and a small range of values, the auto-generated set of y-axis ticks are filtered so that we don't include fractional values.", - data: data, - interpolate: d3.curveLinear, - width: 600, - height: 200, - right: 40, - target: '#small-range' - }); -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center'> - <div id='briefing-1'></div> - <div id='briefing-2'></div> - </div> - <div class='col-lg-5'> - <div class='data-column'> - <a href='data/brief-1.json'>data 1</a>, - <a href='data/brief-2.json'>data 2</a> - </div> - -<pre><code class='javascript'>d3.json('data/brief-1.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Linked Graphic", - description: "The two graphics in this section are linked together. A rollover in one causes a rollover in the other.", - data: data, - linked: true, - width: 600, - height: 200, - right: 40, - xax_count: 4, - target: '#briefing-1' - }); -}); - -d3.json('data/brief-2.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Other Linked Graphic", - description: "Roll over and watch as the graphic to the left triggers.", - data: data, - area: false, - linked: true, - width: 600, - height: 200, - right: 40, - xax_count: 4, - target: '#briefing-2' - }); -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='singleton'></div> - <div class='col-lg-5'> - -<pre><code class='javascript'>MG.data_graphic({ - title: "Singleton", - description: "Handling a solitary data point.", - data: [{'date': new Date('2015-03-05T21:00:00Z'), 'value': 12000}], - width: 600, - height: 200, - right: 40, - target: '#singleton' -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='custom-color'></div> - <div class='col-lg-5'> - -<pre><code class='javascript'>d3.json('data/fake_users1.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Changing Single Line Color", - description: "For single line charts, there are two simple ways to change a line color. The first is to change the css (described on the wiki). The other is to specify a color value using color: <em>string</em> or colors: <em>string</em>.", - data: data, - width: 600, - height: 200, - right: 40, - color: '#8C001A', - target: 'div#custom-color', - x_accessor: 'date', - y_accessor: 'value' - }); -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='area_flipped_users_gain_loss'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/fake_users1.json'>data</a></div> - - <pre><code class='javascript'>d3.json('data/fake_users1.json', function(data) { - - var max = d3.max(data, function (d) { - return d.value; - }); - var min = d3.min(data, function(d) { - return d.value; - }); - - var offsetForNegativeValues = ((max - min) / 1.75); - - for (var i = 0; i < data.length; i++) { - data[i].value = (data[i].value - offsetForNegativeValues) / 1000000; - } - - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Flipped area under Y value baseline", - description: "This is a line chart having a flipped area under a Y value baseline", - data: data, - width: 600, - height: 200, - right: 40, - area: true, - flip_area_under_y_value: 0, - target: document.getElementById('area_flipped_users_gain_loss'), - x_accessor: 'date', - y_accessor: 'value' - }); -});</code></pre> - - </div> - </div> - -<script> - - - -d3.json('data/fake_users1.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Changing Single Line Color", - description: "For single line charts, there are two simple ways to change a line color. The first is to change the css (described on the wiki). The other is to specify a color value using color: <em>string</em> or colors: <em>string</em>.", - data: data, - width: 600, - height: 200, - right: 40, - color: '#8C001A', - target: 'div#custom-color', - x_accessor: 'date', - y_accessor: 'value' - }); -}); - -MG._hooks = {}; -d3.json('data/fake_users1.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Line Chart", - description: "This is a simple line chart. You can remove the area portion by adding <i>area: false</i> to the arguments list.", - data: data, - width: 600, - height: 200, - right: 40, - target: document.getElementById('fake_users1'), - x_accessor: 'date', - y_accessor: 'value' - }); -}); - -d3.json('data/confidence_band.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Confidence Band", - description: "This is an example of a graphic with a confidence band and extended x-axis ticks enabled.", - data: data, - format: 'percentage', - width: 600, - height: 200, - right: 40, - area: false, - target: '#confidence_band', - show_secondary_x_label: false, - show_confidence_band: ['l', 'u'], - x_extended_ticks: true - }); -}); - -d3.json('data/small-range.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Small Range of Integers", - description: "When we have a data object of integers and a small range of values, the auto-generated set of y-axis ticks are filtered so that we don't include fractional values.", - data: data, - interpolate: d3.curveLinear, - width: 600, - height: 200, - right: 40, - target: '#small-range' - }); -}); - -d3.json('data/brief-1.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Linked Graphic", - description: "The two graphics in this section are linked together. A rollover in one causes a rollover in the other.", - data: data, - linked: true, - width: 600, - height: 200, - right: 40, - xax_count: 4, - target: '#briefing-1' - }); -}); - -d3.json('data/brief-2.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Other Linked Graphic", - description: "Roll over and watch as the graphic to the left triggers.", - data: data, - area: false, - linked: true, - width: 600, - height: 200, - right: 40, - xax_count: 4, - target: '#briefing-2' - }); -}); - -MG.data_graphic({ - title: "Singleton", - description: "Handling a solitary data point.", - data: [{'date': new Date('2015-03-05T21:00:00Z'), 'value': 12000}], - width: 600, - height: 200, - right: 40, - target: '#singleton' -}); - -d3.json('data/fake_users1.json', function(data) { - - var max = d3.max(data, function (d) { - return d.value; - }); - var min = d3.min(data, function(d) { - return d.value; - }); - - var offsetForNegativeValues = ((max - min) / 1.75); - - for (var i = 0; i < data.length; i++) { - data[i].value = (data[i].value - offsetForNegativeValues) / 1000000; - } - - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Flipped area under Y value baseline", - description: "This is a line chart having a flipped area under a Y value baseline", - data: data, - width: 600, - height: 200, - right: 40, - area: true, - flip_area_under_y_value: 0, - target: document.getElementById('area_flipped_users_gain_loss'), - x_accessor: 'date', - y_accessor: 'value' - }); -}); -</script> diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/charts/multilines.htm b/priv/static/metrics-graphics-3.0-alpha3/examples/charts/multilines.htm deleted file mode 100644 index d807466..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/charts/multilines.htm +++ /dev/null @@ -1,368 +0,0 @@ - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='fake_users2'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/fake_users2.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/fake_users2.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - MG.data_graphic({ - title: "Multi-Line Chart", - description: "This line chart contains multiple lines.", - data: data, - width: 600, - height: 200, - right: 40, - target: '#fake_users2', - legend: ['Line 1','Line 2','Line 3'], - legend_target: '.legend' - }); -});</code></pre> - - </div> - </div> - <div class='row'> - <div class='col-lg-7 text-center legend'></div> - <div class='col-lg-5'></div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='missing_is_hidden_multi'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/missing-is-hidden-multi.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/missing-is-hidden-multi.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - MG.data_graphic({ - title: "Broken Multi-Lines", - description: 'Setting <i>missing_is_hidden</i> works with multiple lines too.', - data: data, - width: 600, - height: 200, - right: 40, - missing_is_hidden: true, - target: '#missing_is_hidden_multi', - show_secondary_x_label: false - }); -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center'> - <div id='linked_multi1'></div> - <div id='linked_multi2'></div> - </div> - <div class='col-lg-5'> - <div class='data-column'> - <a href='data/fake_users2.json'>data 1</a>, - <a href='data/fake_users3.json'>data 2</a> - </div> - -<pre><code class='javascript'>d3.json('data/fake_users2.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - MG.data_graphic({ - title: "Multi-Line Linked", - description: "Demoing linked multi-line charts.", - data: data, - width: 600, - height: 200, - right: 40, - target: '#linked_multi1', - linked: true - }); -}) - -d3.json('data/fake_users3.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - MG.data_graphic({ - title: "Multi-Line Linked 2", - description: "Demoing linked multi-line charts.", - data: data, - width: 600, - height: 200, - right: 40, - target: '#linked_multi2', - linked: true - }); -});</code></pre> - - </div> -</div> - -<div class='row trunk-section'> - <div class='col-lg-7 text-center' id='missing-multi'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/fake_users3.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/fake_users3.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - // set this to an empty array. - // data[0] and data[2] both still arrays of objects. - data[1] = []; - - MG.data_graphic({ - title: "Missing Time Series Don't Get Drawn", - description: "We set the second array to [] instead of the loaded data. The line color order is preserved.", - data: data, - width: 600, - height: 200, - right: 40, - target: '#missing-multi' - }); -}); -});</code></pre> - - </div> -</div> - -<div class='row trunk-section'> - <div class='col-lg-7 text-center' id='multi-labelled'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/fake_users3.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/fake_users3.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - data[1][data[1].length-1].value = 50000000; - data[2][data[2].length-1] = MG.clone(data[1][data[1].length-1]); - data[2][data[2].length-1].value += 10000000; - - MG.data_graphic({ - title: "Labeling Lines", - data: data, - width: 600, - height: 200, - right: 40, - legend: ['US', 'CA', 'DE'], - target: '#multi-labelled' - }); -});</code></pre> - - </div> -</div> - - -<div class='row trunk-section'> - <div class='col-lg-7 text-center' id='custom-colors'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/fake_users3.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/fake_users2.json', function(data){ - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - }; - MG.data_graphic({ - title: "Custom Line Coloring", - description: "By passing in an array of hex / rgb / rgba / html strings, you can specify the colors of the lines. NOTE: this feature may have an API change before it is fully in Metrics Graphics. Use at your own risk.", - data: [data[0], data[1], data[2]], - width: 600, - height: 200, - right: 40, - target: '#custom-colors', - legend: ['Team A','Team B','Team C'], - legend_target: 'div#custom-color-key', - colors: ['blue', 'rgb(255,100,43)', '#CCCCFF'], - aggregate_rollover: true - }); -}) -</code></pre> - - </div> -</div> -<div class='row'> - <div class='col-lg-7 text-center legend' id='custom-color-key'></div> - <div class='col-lg-5'></div> -</div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='multiline_area_select'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/fake_users2.json'>data</a></div> - - <pre><code class='javascript'>d3.json('data/fake_users3.json', function(data) { - - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - }; - - MG.data_graphic({ - title: "Select lines of your multi-line chart having areas", - description: "By passing in an array of booleans in 'area' property, you can choose which lines has an area or not.", - data: data, - width: 600, - height: 200, - right: 40, - target: '#multiline_area_select', - area: [false, true, false], - y_extended_ticks: true, - x_accessor: 'date' - }); -});</code></pre> - -<script> -MG._hooks = {}; -d3.json('data/fake_users2.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - MG.data_graphic({ - title: "Multi-Line Chart", - description: "This line chart contains multiple lines.", - data: data, - width: 600, - height: 200, - right: 40, - target: '#fake_users2', - legend: ['Line 1','Line 2','Line 3'], - legend_target: '.legend' - }); -}); - -d3.json('data/missing-is-hidden-multi.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - MG.data_graphic({ - title: "Broken Multi-Lines", - description: 'Setting <i>missing_is_hidden</i> works with multiple lines too.', - data: data, - width: 600, - height: 200, - right: 40, - missing_is_hidden: true, - target: '#missing_is_hidden_multi', - show_secondary_x_label: false - }); -}); - -d3.json('data/fake_users2.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - MG.data_graphic({ - title: "Multi-Line Linked", - description: "Demoing linked multi-line charts.", - data: data, - width: 600, - height: 200, - right: 40, - target: '#linked_multi1', - linked: true - }); -}) - -d3.json('data/fake_users3.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - MG.data_graphic({ - title: "Multi-Line Linked 2", - description: "Demoing linked multi-line charts.", - data: data, - width: 600, - height: 200, - right: 40, - target: '#linked_multi2', - linked: true - }); -}); - -d3.json('data/fake_users3.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - // set this to an empty array. - // data[0] and data[2] both still arrays of objects. - data[1] = []; - MG.data_graphic({ - title: "Missing Time Series Don't Get Drawn", - description: "We set the second array to [] instead of the loaded data. The line color order is preserved.", - data: data, - width: 600, - height: 200, - right: 40, - target: '#missing-multi' - }); -}); - -d3.json('data/fake_users3.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - data[1][data[1].length-1].value = 50000000; - data[2][data[2].length-1] = MG.clone(data[1][data[1].length-1]); - data[2][data[2].length-1].value += 10000000; - - - MG.data_graphic({ - title: "Labeling Lines", - data: data, - width: 600, - height: 200, - right: 40, - legend: ['US', 'CA', 'DE'], - target: '#multi-labelled' - }); -}); - -d3.json('data/fake_users2.json', function(data){ - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - }; - MG.data_graphic({ - title: "Custom Line Coloring", - description: "By passing in an array of hex / rgb / rgba / html strings, you can specify the colors of the lines. NOTE: this feature may have an API change before it is fully in Metrics Graphics. Use at your own risk.", - data: [data[0], data[1], data[2]], - width: 600, - height: 200, - right: 40, - target: '#custom-colors', - legend: ['Team A','Team B','Team C'], - legend_target: 'div#custom-color-key', - colors: ['blue', 'rgb(255,100,43)', '#CCCCFF'], - aggregate_rollover: true - }); -}); - -d3.json('data/fake_users3.json', function(data) { - - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - }; - - MG.data_graphic({ - title: "Select lines of your multi-line chart having areas", - description: "By passing in an array of booleans in 'area' property, you can choose which lines has an area or not.", - data: data, - width: 600, - height: 200, - right: 40, - target: '#multiline_area_select', - area: [false, true, false], - y_extended_ticks: true, - x_accessor: 'date' - }); -}); -</script> diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/charts/other.htm b/priv/static/metrics-graphics-3.0-alpha3/examples/charts/other.htm deleted file mode 100644 index e65d641..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/charts/other.htm +++ /dev/null @@ -1,48 +0,0 @@ - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='aspect1'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/fake_users3.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/fake_users3.json', function(data) { - for(var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - MG.data_graphic({ - title: "Preserving the aspect ratio", - description: "You can automatically set the width or height of a data graphic to fit its parent element. When done the graphic will rescale to fit the size of the parent element while preserving its aspect ratio.", - data: data, - full_width: true, - height: 300, - right: 40, - x_extended_ticks: true, - target: '#aspect1', - x_accessor: 'date', - y_accessor: 'value' - }); -});</code></pre> - - </div> - </div> - -<script> -MG._hooks = {}; -d3.json('data/fake_users3.json', function(data) { - for(var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - MG.data_graphic({ - title: "Preserving the aspect ratio", - description: "You can automatically set the width or height of a data graphic to fit its parent element. When done the graphic will rescale to fit the size of the parent element while preserving its aspect ratio.", - data: data, - full_width: true, - height: 300, - right: 40, - x_extended_ticks: true, - target: '#aspect1', - x_accessor: 'date', - y_accessor: 'value' - }); -}); -</script> diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/charts/rollovers.htm b/priv/static/metrics-graphics-3.0-alpha3/examples/charts/rollovers.htm deleted file mode 100644 index 53510bb..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/charts/rollovers.htm +++ /dev/null @@ -1,309 +0,0 @@ - <div class='row trunk-section'> - <div class='col-lg-7 text-center'> - <div class='col-lg-12 text-center' id='precision1'></div> - <div class='col-lg-12 text-center' id='precision2'></div> - <div class='col-lg-12 text-center' id='custom-rollover'></div> - <div class='col-lg-12 text-center' id='no-rollover-text'></div> - </div> - <div class='col-lg-5'> - <div class='data-column'> - <a href='data/float.json'>data 1</a>, - <a href='data/some_percentage.json'>data 2</a> - </div> - -<pre><code class='javascript'>d3.json('data/float.json', function(data) { - data = MG.convert.date(data, 'date'); - - MG.data_graphic({ - title: "Changing Precision 1", - description: "We can change the precision if the axis data type is a float. We can also change both the formatting, or hide the rollover text altogether. Here we set <i>decimals: 3</i> to get three decimals in the rollover for percentages.", - data: data, - decimals: 3, - width: 600, - height: 200, - right: 40, - xax_count: 4, - target: '#precision1' - }); - - MG.data_graphic({ - title: "Custom Rollover Text", - description: "Here is an example of changing the rollover text. You could in theory actually update any DOM element with the data from that rollover - a title, for instance.", - data: data, - width: 600, - height: 200, - right: 40, - xax_count: 4, - mouseover: function(d, i) { - // custom format the rollover text, show days - var pf = d3.format('.0s'); - d3.select('#custom-rollover svg .mg-active-datapoint') - .text('Day ' + (i + 1) + ' ' + pf(d.value)); - }, - target: '#custom-rollover' - }); -}); - -d3.json('data/some_percentage.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - MG.data_graphic({ - title: "Changing Precision 2", - description: "Here we set <i>decimals: 0</i> for percentages.", - data: data, - decimals: 0, - format: 'percentage', - width: 600, - height: 200, - right: 40, - xax_count: 4, - target: '#precision2' - }); - - MG.data_graphic({ - title: "... Or No Rollover Text", - description: "By setting <i>show_rollover_text: false</i>, you can hide the default rollover text from even appearing. This, coupled with the custom callback, gives a lot of interesting options for controlling rollovers.", - data: data, - decimals: 0, - show_rollover_text: false, - format: 'percentage', - width: 600, - height: 200, - right: 40, - xax_count: 4, - target: '#no-rollover-text' - }); -});</code></pre> - - </div> - </div> - - <div class='row trunk-section'> - <div class='col-lg-7 text-center' id='aggregate'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/fake_users2.json'>data</a></div> - -<pre><code class='javascript'>d3.json('data/fake_users2.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - var all_the_data = MG.clone(data[0]); - for (i = 1; i < data.length; i++){ - for (var j = 0; j < data[i].length; j++){ - if (i === 2 && all_the_data[j].date < new Date('2014-02-01')) { - } else { - all_the_data[j]['value' + (i + 1)] = data[i][j].value; - } - } - } - - MG.data_graphic({ - title: "Aggregated Rollover Information", - description: "Aggregated information can be displayed with the <i>aggregate_rollover</i> option in order to clearly highlight the relationship between lines. Also handles non-contiguous data", - data: all_the_data, - width: 600, - height: 200, - right: 40, - target: '#aggregate', - y_extended_ticks: true, - x_accessor: 'date', - y_accessor: ['value', 'value2', 'value3'], - aggregate_rollover: true - }); -});</code></pre> - - </div> - </div> - - -<div class='row trunk-section'> - <div class='col-lg-7 text-center' id='formatting-with-strings'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/fake_users2.json'>data</a></div> - -<pre><code class='javascript'> -d3.json('data/float.json', function(data) { - - data = MG.convert.date(data, 'date'); - // check out https://github.com/mbostock/d3/wiki/Formatting for number formatting - //and https://github.com/mbostock/d3/wiki/Time-Formatting for time formatting options. - - MG.data_graphic({ - title: "Rollover Formatting With Strings", - description: "Metrics Graphics comes with two arguments: y_rollover_format and x_rollover_format. These arguments take either strings or functions. Strings are formatted according to D3's number format, or D3's time formatting, if the accessor pulls out Date objects.", - data: data, - width: 600, - height: 200, - right: 40, - y_mouseover: '%d', - x_mouseover: '%e of %b? Well, ', - target: '#y-formatting' - }); -}) -</code></pre> - - </div> -</div> - - -<div class='row trunk-section'> - <div class='col-lg-7 text-center' id='formatting-with-functions'></div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/fake_users2.json'>data</a></div> - -<pre><code class='javascript'> -d3.json('data/float.json', function(data) { - data = MG.convert.date(data, 'date'); - MG.data_graphic({ - title: "Rollover Formatting With Functions", - description: "You can also pass in a function, whose arguments are the data point and the index.", - data: data, - width: 600, - height: 200, - right: 40, - y_rollover_format: function(d){ - return Math.round(d.value) + (Math.random() > .5 ? ' + 1' : ' - 1') - }, - x_rollover_format: function(d){ - var today = new Date() - return Math.round((today - d.date)/ (1000 * 60 * 60 * 24)) + ' days ago, '; - }, - target: '#formatting-with-functions' - }); -}) -</code></pre> - - </div> -</div> - - -<script> -MG._hooks = {}; -d3.json('data/float.json', function(data) { - data = MG.convert.date(data, 'date'); - - MG.data_graphic({ - title: "Updating Rollover Accessor Formatting With Strings", - description: "Metrics Graphics comes with two arguments: y_rollover_format and x_rollover_format. These arguments take either strings or functions. Strings are formatted according to D3's number format, or D3's time formatting, if the accessor pulls out Date objects.", - data: data, - width: 600, - height: 200, - right: 40, - y_mouseover: '%d', - x_mouseover: '%e of %b? Well, ', - target: '#formatting-with-strings' - }); - - MG.data_graphic({ - title: "Updating Rollover Accessor Formatting With Functions", - description: "You can also pass in a function, whose arguments are the data point and the index.", - data: data, - width: 600, - height: 200, - right: 40, - y_mouseover: function(d){ - return Math.round(d.value) + (Math.random() > .5 ? ' + 1' : ' - 1') - }, - x_mouseover: function(d){ - var today = new Date() - return Math.round((today - d.date)/ (1000 * 60 * 60 * 24)) + ' days ago, '; - }, - target: '#formatting-with-functions' - }); - - MG.data_graphic({ - title: "Changing Precision 1", - description: "We can change the precision if the axis data type is a float. We can also change both the formatting, or hide the rollover text altogether. Here we set <i>decimals: 3</i> to get three decimals in the rollover for percentages.", - data: data, - decimals: 3, - width: 600, - height: 200, - right: 40, - xax_count: 4, - target: '#precision1' - }); - - MG.data_graphic({ - title: "Custom Rollover Text", - description: "Here is an example of changing the rollover text. You could in theory actually update any DOM element with the data from that rollover - a title, for instance.", - data: data, - width: 600, - height: 200, - right: 40, - xax_count: 4, - mouseover: function(d, i) { - // custom format the rollover text, show days - var pf = d3.format('.0s'); - d3.select('#custom-rollover svg .mg-active-datapoint') - .text('Day ' + (i + 1) + ' ' + pf(d.value)); - }, - target: '#custom-rollover' - }); -}); - -d3.json('data/some_percentage.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - MG.data_graphic({ - title: "Changing Precision 2", - description: "Here we set <i>decimals: 0</i> for percentages.", - data: data, - decimals: 0, - format: 'percentage', - width: 600, - height: 200, - right: 40, - xax_count: 4, - target: '#precision2' - }); - - MG.data_graphic({ - title: "... Or No Rollover Text", - description: "By setting <i>show_rollover_text: false</i>, you can hide the default rollover text from even appearing. This, coupled with the custom callback, gives a lot of interesting options for controlling rollovers.", - data: data, - decimals: 0, - show_rollover_text: false, - format: 'percentage', - width: 600, - height: 200, - right: 40, - xax_count: 4, - target: '#no-rollover-text' - }); -}); - -d3.json('data/fake_users2.json', function(data) { - for (var i = 0; i < data.length; i++) { - data[i] = MG.convert.date(data[i], 'date'); - } - - var all_the_data = MG.clone(data[0]); - for (i = 1; i < data.length; i++){ - for (var j = 0; j < data[i].length; j++){ - if (i === 2 && all_the_data[j].date < new Date('2014-02-01')) { - } else { - all_the_data[j]['value' + (i + 1)] = data[i][j].value; - } - } - } - - MG.data_graphic({ - title: "Aggregated Rollover Information", - description: "Aggregated information can be displayed with the <i>aggregate_rollover</i> option in order to clearly highlight the relationship between lines. Also handles non-contiguous data", - data: all_the_data, - width: 600, - height: 200, - right: 40, - target: '#aggregate', - y_extended_ticks: true, - x_accessor: 'date', - y_accessor: ['value', 'value2', 'value3'], - aggregate_rollover: true - }); -}); -</script> diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/charts/updating.htm b/priv/static/metrics-graphics-3.0-alpha3/examples/charts/updating.htm deleted file mode 100644 index af3919b..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/charts/updating.htm +++ /dev/null @@ -1,169 +0,0 @@ - <div class='row trunk-section'> - <div class='col-lg-7 text-center'> - <div class='col-lg-12' id='split_by'></div> - <div class='btn-group btn-group-sm text-center split-by-controls'> - <button type='button' class='btn btn-default active' - data-y_accessor='release'>Release</button> - <button type='button' class='btn btn-default' - data-y_accessor='beta'>Beta</button> - <button type='button' class='btn btn-default' - data-y_accessor='alpha'>Alpha</button> - </div> - <div class='col-lg-12' id='modify_time_period'></div> - <div class='btn-group btn-group-sm text-center - modify-time-period-controls'> - <button type='button' class='btn btn-default active' - data-time_period=''>All time</button> - <button type='button' class='btn btn-default' - data-time_period='61'>Past 2 months</button> - <button type='button' class='btn btn-default' - data-time_period='31'>Past month</button> - </div> - </div> - <div class='col-lg-5'> - <div class='data-column'><a href='data/split_by.json'>data</a></div> - -<pre><code class='javascript'>var globals = {}; - -var split_by_params = { - title: "Downloads by Channel", - description: "We sometimes have the need to split the data and then gracefully update the graphic with the newly selected subset of data.", - width: 600, - height: 200, - right: 40, - xax_count: 4, - target: '#split_by', - x_accessor: 'date', - y_accessor: 'release' -}; - -var modify_time_period_params = { - title: "Beta Downloads", - description: "We sometimes have the need to view data for just the past n days. Here, the <i>transition_on_update</i> option is set to false.", - width: 600, - height: 200, - right: 40, - show_secondary_x_label: false, - xax_count: 4, - target: '#modify_time_period', - x_accessor: 'date', - y_accessor: 'beta' -} - -d3.json('data/split_by.json', function(data) { - data = MG.convert.date(data, 'date'); - globals.data = data; - - split_by_params.data = data; - MG.data_graphic(split_by_params); - - modify_time_period_params.data = data; - MG.data_graphic(modify_time_period_params); -}); - -$('.split-by-controls button').click(function() { - var new_y_accessor = $(this).data('y_accessor'); - split_by_params.y_accessor = new_y_accessor; - - // change button state - $(this).addClass('active').siblings().removeClass('active'); - - // update data - delete split_by_params.xax_format; - MG.data_graphic(split_by_params); -}); - -$('.modify-time-period-controls button').click(function() { - var past_n_days = $(this).data('time_period'); - var data = modify_time_period(globals.data, past_n_days); - - // change button state - $(this).addClass('active').siblings().removeClass('active'); - - delete modify_time_period_params.xax_format; - modify_time_period_params.data = data; - MG.data_graphic(modify_time_period_params); -}); - -function modify_time_period(data, past_n_days) { - if (past_n_days !== '') { - return MG.clone(data).slice(past_n_days * -1); - } - - return data; -}</code></pre> - - </div> - </div> - -<script> -MG._hooks = {}; -var globals = {}; - -var split_by_params = { - title: "Downloads by Channel", - description: "We sometimes have the need to split the data and then gracefully update the graphic with the newly selected subset of data.", - width: 600, - height: 200, - right: 40, - xax_count: 4, - target: '#split_by', - x_accessor: 'date', - y_accessor: 'release' -}; - -var modify_time_period_params = { - title: "Beta Downloads", - description: "We sometimes have the need to view data for just the past n days. Here, the <i>transition_on_update</i> option is set to false.", - width: 600, - height: 200, - right: 40, - show_secondary_x_label: false, - xax_count: 4, - transition_on_update: false, - target: '#modify_time_period', - x_accessor: 'date', - y_accessor: 'beta' -} - -d3.json('data/split_by.json', function(data) { - data = MG.convert.date(data, 'date'); - globals.data = data; - - split_by_params.data = data; - MG.data_graphic(split_by_params); - - modify_time_period_params.data = data; - MG.data_graphic(modify_time_period_params); -}); - -$('.split-by-controls button').click(function() { - var new_y_accessor = $(this).data('y_accessor'); - split_by_params.y_accessor = new_y_accessor; - - // change button state - $(this).addClass('active').siblings().removeClass('active'); - - // update data - MG.data_graphic(split_by_params); -}); - -$('.modify-time-period-controls button').click(function() { - var past_n_days = $(this).data('time_period'); - var data = modify_time_period(globals.data, past_n_days); - - // change button state - $(this).addClass('active').siblings().removeClass('active'); - - modify_time_period_params.data = data; - MG.data_graphic(modify_time_period_params); -}); - -function modify_time_period(data, past_n_days) { - if (past_n_days !== '') { - return MG.clone(data).slice(past_n_days * -1); - } - - return data; -} -</script>
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/css/highlightjs-default.css b/priv/static/metrics-graphics-3.0-alpha3/examples/css/highlightjs-default.css deleted file mode 100644 index a7db875..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/css/highlightjs-default.css +++ /dev/null @@ -1,153 +0,0 @@ -/* - -Original style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org> - -*/ - -.hljs { - display: block; - overflow-x: auto; - padding: 0.5em; - background: #f0f0f0; - -webkit-text-size-adjust: none; -} - -.hljs, -.hljs-subst, -.hljs-tag .hljs-title, -.nginx .hljs-title { - color: black; -} - -.hljs-string, -.hljs-title, -.hljs-constant, -.hljs-parent, -.hljs-tag .hljs-value, -.hljs-rules .hljs-value, -.hljs-preprocessor, -.hljs-pragma, -.haml .hljs-symbol, -.ruby .hljs-symbol, -.ruby .hljs-symbol .hljs-string, -.hljs-template_tag, -.django .hljs-variable, -.smalltalk .hljs-class, -.hljs-addition, -.hljs-flow, -.hljs-stream, -.bash .hljs-variable, -.apache .hljs-tag, -.apache .hljs-cbracket, -.tex .hljs-command, -.tex .hljs-special, -.erlang_repl .hljs-function_or_atom, -.asciidoc .hljs-header, -.markdown .hljs-header, -.coffeescript .hljs-attribute { - color: #e6337c; -} - -.smartquote, -.hljs-comment, -.hljs-annotation, -.hljs-template_comment, -.diff .hljs-header, -.hljs-chunk, -.asciidoc .hljs-blockquote, -.markdown .hljs-blockquote { - color: #888; -} - -.hljs-number, -.hljs-date, -.hljs-regexp, -.hljs-literal, -.hljs-hexcolor, -.smalltalk .hljs-symbol, -.smalltalk .hljs-char, -.go .hljs-constant, -.hljs-change, -.lasso .hljs-variable, -.makefile .hljs-variable, -.asciidoc .hljs-bullet, -.markdown .hljs-bullet, -.asciidoc .hljs-link_url, -.markdown .hljs-link_url { - color: #366797; -} - -.hljs-label, -.hljs-javadoc, -.ruby .hljs-string, -.hljs-decorator, -.hljs-filter .hljs-argument, -.hljs-localvars, -.hljs-array, -.hljs-attr_selector, -.hljs-important, -.hljs-pseudo, -.hljs-pi, -.haml .hljs-bullet, -.hljs-doctype, -.hljs-deletion, -.hljs-envvar, -.hljs-shebang, -.apache .hljs-sqbracket, -.nginx .hljs-built_in, -.tex .hljs-formula, -.erlang_repl .hljs-reserved, -.hljs-prompt, -.asciidoc .hljs-link_label, -.markdown .hljs-link_label, -.vhdl .hljs-attribute, -.clojure .hljs-attribute, -.asciidoc .hljs-attribute, -.lasso .hljs-attribute, -.coffeescript .hljs-property, -.hljs-phony { - color: #88f; -} - -.hljs-keyword, -.hljs-id, -.hljs-title, -.hljs-built_in, -.css .hljs-tag, -.hljs-javadoctag, -.hljs-phpdoc, -.hljs-dartdoc, -.hljs-yardoctag, -.smalltalk .hljs-class, -.hljs-winutils, -.bash .hljs-variable, -.apache .hljs-tag, -.hljs-type, -.hljs-typename, -.tex .hljs-command, -.asciidoc .hljs-strong, -.markdown .hljs-strong, -.hljs-request, -.hljs-status { - font-weight: bold; -} - -.asciidoc .hljs-emphasis, -.markdown .hljs-emphasis { - font-style: italic; -} - -.nginx .hljs-built_in { - font-weight: normal; -} - -.coffeescript .javascript, -.javascript .xml, -.lasso .markup, -.tex .hljs-formula, -.xml .javascript, -.xml .vbscript, -.xml .css, -.xml .hljs-cdata { - opacity: 0.5; -} diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/css/metricsgraphics-demo-accessible.css b/priv/static/metrics-graphics-3.0-alpha3/examples/css/metricsgraphics-demo-accessible.css deleted file mode 100644 index 5ebf9b7..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/css/metricsgraphics-demo-accessible.css +++ /dev/null @@ -1,26 +0,0 @@ -html { - font-size: 16px; -} - -.mg-x-axis text, -.mg-y-axis text, -.mg-histogram .axis text { - opacity: 0.9; -} - -.mg-x-axis line, -.mg-y-axis line { - opacity: 1; -} - -.mg-markers text, -.mg-year-marker text, -.mg-baselines text { - opacity: 0.9; -} - -.mg-markers line, -.mg-year-marker line, -.mg-baselines line { - opacity: 1; -}
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/css/metricsgraphics-demo-dark.css b/priv/static/metrics-graphics-3.0-alpha3/examples/css/metricsgraphics-demo-dark.css deleted file mode 100644 index a8bfe5f..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/css/metricsgraphics-demo-dark.css +++ /dev/null @@ -1,686 +0,0 @@ -a, -a:active, -a:visited { - color: #71b4eb; -} - -a:hover { - color: #71b4eb; -} - -a.active { - color: #fff; -} - -.mg-active-datapoint { - fill: #fff; -} - -.mg-area1-color { - fill: #ffd300; -} - -.mg-area2-color { - fill: #18ff00; -} - -.mg-area3-color { - fill: #f57070; -} - -.mg-area4-color { - fill: #28c5f8; -} - -.mg-area5-color { - fill: #f7f7f7; -} - -.mg-barplot .mg-bar-prediction { - fill: #5b5b5b; -} - -.mg-barplot .mg-bar-baseline { - stroke: #5b5b5b; -} - -.mg-baselines line { - stroke: #676767; -} - -.mg-baselines text { - fill: #fff; -} - -body { - background-color: #272727; - color: #cfcfcf; -} - -.divider { - color: #f1f1f1; - opacity: 0.1; -} - -pre { - border-left: 2px solid #3b3b3b; -} - -h1 { - color: #f1f1f1; -} - -h2.chart_title span { - color: #f1f1f1; -} - -.mg-histogram .axis path, -.mg-histogram .axis line { - opacity: 0.5; - stroke: #ccc; -} - -.mg-histogram .mg-bar rect { - fill: #d8b307; -} - -tspan.hist-symbol { - fill: #d8b307; -} - -.mg-barplot rect.mg-bar.default-bar { - fill: #d8b307; -} - -.mg-histogram .mg-bar rect.active, -.mg-barplot rect.mg-bar.default-active { - fill: #b3960f; -} - -.mg-histogram .mg-bar text { - fill: #fff; -} - -.mg-histogram .axis .tick line { - opacity: 0.3; -} - -li { - color: #cfcfcf; -} - -.mg-least-squares-line { - stroke: #f57070; -} - -.mg-line1-color { - stroke: #ffd300; -} - -.mg-hover-line1-color { - fill: #ffd300; -} - -.mg-line2-color { - stroke: #18ff00; -} - -.mg-hover-line2-color { - fill: #18ff00; -} - -.mg-line3-color { - stroke: #f57070; -} - -.mg-hover-line3-color { - fill: #f57070; -} - -.mg-line4-color { - stroke: #28c5f8; -} - -.mg-hover-line4-color { - fill: #28c5f8; -} - -.mg-line5-color { - stroke: #f7f7f7; -} - -.mg-hover-line5-color { - fill: #f7f7f7; -} - -.mg-line1-legend-color { - color: #ffd300; - fill: #ffd300; -} - -.mg-line2-legend-color { - color: #18ff00; - fill: #18ff00; -} - -.mg-line3-legend-color { - color: #f57070; - fill: #f57070; -} - -.mg-line4-legend-color { - color: #28c5f8; - fill: #28c5f8; -} - -.mg-line5-legend-color { - color: #f7f7f7; - fill: #f7f7f7; -} - -#logo g path { - fill: #e8e8e8; -} - -.mg-chart-title { - fill: #cfcfcf; -} - -.mg-category-guides line { - stroke: #676767; -} - -.mg-main-area-solid svg .mg-main-area { - fill: #52491f; -} - -.mg-markers line { - stroke: #676767; -} - -.mg-markers text { - fill: #fff; -} - -circle.mg-points-mono { - fill-opacity: 0.6; - stroke: #a89641; - fill: #a89641; - stroke-opacity: 1; -} - -tspan.mg-points-mono { - fill: #a89641; - stroke: #a89641; -} - -circle.mg-points-mono.selected { - fill: #a89641; - fill-opacity: 1; - stroke-opacity: 1; -} - -.popover { - color: #737373; -} - -text { - fill: #fff; -} - -.mg-x-rug-mono, -.mg-y-rug-mono { - stroke: #a89641; -} - -.mg-x-axis line, -.mg-y-axis line { - stroke: #676767; -} - -.mg-x-axis text, -.mg-y-axis text, -.mg-histogram .axis text { - fill: #fff; -} - -.mg-year-marker text { - fill: #fff; -} - -.mg-year-marker line { - stroke: #676767; -} - -/* - CSS from http://bootswatch.com/slate - Made by Thomas Park. Contact him at thomas@bootswatch.com - Code released under the MIT License. -*/ -.btn:active, .btn.active { - outline: 0; - background-image: none; - -webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,0.125); - box-shadow: inset 0 3px 5px rgba(0,0,0,0.125); -} - -.btn.disabled,.btn[disabled],fieldset[disabled] .btn { - cursor: not-allowed; - pointer-events: none; - opacity: 0.65; - filter: alpha(opacity=65); - -webkit-box-shadow: none; - box-shadow: none; -} - -.btn-default { - color: #ffffff; - background-color: #3a3f44; - border-color: #3a3f44; -} - -.btn-default:hover, -.btn-default:focus, -.btn-default:active, -.btn-default.active, -.open .dropdown-toggle.btn-default { - color: #ffffff; - background-color: #272b2e; - border-color: #1e2023; -} - -.btn-default:active, -.btn-default.active, -.open .dropdown-toggle.btn-default { - background-image: none; -} - -.btn-default.disabled, -.btn-default[disabled], -fieldset[disabled] .btn-default, -.btn-default.disabled:hover, -.btn-default[disabled]:hover, -fieldset[disabled] .btn-default:hover, -.btn-default.disabled:focus, -.btn-default[disabled]:focus, -fieldset[disabled] .btn-default:focus, -.btn-default.disabled:active, -.btn-default[disabled]:active, -fieldset[disabled] .btn-default:active, -.btn-default.disabled.active, -.btn-default[disabled].active, -fieldset[disabled] .btn-default.active { - background-color: #3a3f44; - border-color: #3a3f44; -} - -.btn-default .badge { - color: #3a3f44; - background-color: #ffffff; -} - -.btn-primary { - color: #ffffff; - background-color: #7a8288; - border-color: #7a8288; -} - -.btn-primary:hover, -.btn-primary:focus, -.btn-primary:active, -.btn-primary.active, -.open .dropdown-toggle.btn-primary { - color: #ffffff; - background-color: #676d73; - border-color: #5d6368; -} - -.btn-primary:active, -.btn-primary.active, -.open .dropdown-toggle.btn-primary { - background-image: none; -} - -.btn-primary.disabled, -.btn-primary[disabled], -fieldset[disabled] .btn-primary, -.btn-primary.disabled:hover, -.btn-primary[disabled]:hover, -fieldset[disabled] .btn-primary:hover, -.btn-primary.disabled:focus, -.btn-primary[disabled]:focus, -fieldset[disabled] .btn-primary:focus, -.btn-primary.disabled:active, -.btn-primary[disabled]:active, -fieldset[disabled] .btn-primary:active, -.btn-primary.disabled.active, -.btn-primary[disabled].active, -fieldset[disabled] .btn-primary.active { - background-color: #7a8288; - border-color: #7a8288; -} - -.btn-primary .badge { - color: #7a8288; - background-color: #ffffff; -} - -.btn-success { - color: #ffffff; - background-color: #62c462; - border-color: #62c462; -} - -.btn-success:hover, -.btn-success:focus, -.btn-success:active, -.btn-success.active, -.open .dropdown-toggle.btn-success { - color: #ffffff; - background-color: #45b845; - border-color: #40a940; -} - -.btn-success:active, -.btn-success.active, -.open .dropdown-toggle.btn-success { - background-image: none; -} - -.btn-success.disabled, -.btn-success[disabled], -fieldset[disabled] .btn-success, -.btn-success.disabled:hover, -.btn-success[disabled]:hover, -fieldset[disabled] .btn-success:hover, -.btn-success.disabled:focus, -.btn-success[disabled]:focus, -fieldset[disabled] .btn-success:focus, -.btn-success.disabled:active, -.btn-success[disabled]:active, -fieldset[disabled] .btn-success:active, -.btn-success.disabled.active, -.btn-success[disabled].active, -fieldset[disabled] .btn-success.active { - background-color: #62c462; - border-color: #62c462; -} - -.btn-success .badge { - color: #62c462; - background-color: #ffffff; -} - -.btn-info { - color: #ffffff; - background-color: #5bc0de; - border-color: #5bc0de; -} - -.btn-info:hover, -.btn-info:focus, -.btn-info:active, -.btn-info.active, -.open .dropdown-toggle.btn-info { - color: #ffffff; - background-color: #39b3d7; - border-color: #2aabd2; -} - -.btn-info:active, -.btn-info.active, -.open .dropdown-toggle.btn-info { - background-image: none; -} - -.btn-info.disabled,.btn-info[disabled], -fieldset[disabled] .btn-info, -.btn-info.disabled:hover, -.btn-info[disabled]:hover, -fieldset[disabled] .btn-info:hover, -.btn-info.disabled:focus, -.btn-info[disabled]:focus, -fieldset[disabled] .btn-info:focus, -.btn-info.disabled:active, -.btn-info[disabled]:active, -fieldset[disabled] .btn-info:active, -.btn-info.disabled.active, -.btn-info[disabled].active, -fieldset[disabled] .btn-info.active { - background-color: #5bc0de; - border-color: #5bc0de; -} - -.btn-info .badge { - color: #5bc0de; - background-color: #ffffff; -} - -.btn-warning { - color: #ffffff; - background-color: #f89406; - border-color: #f89406; -} - -.btn-warning:hover,.btn-warning:focus, -.btn-warning:active,.btn-warning.active, -.open .dropdown-toggle.btn-warning { - color: #ffffff; - background-color: #d07c05; - border-color: #bc7005; -} - -.btn-warning:active, -.btn-warning.active, -.open .dropdown-toggle.btn-warning { - background-image: none; -} - -.btn-warning.disabled,.btn-warning[disabled], -fieldset[disabled] .btn-warning, -.btn-warning.disabled:hover, -.btn-warning[disabled]:hover, -fieldset[disabled] .btn-warning:hover, -.btn-warning.disabled:focus, -.btn-warning[disabled]:focus, -fieldset[disabled] .btn-warning:focus, -.btn-warning.disabled:active, -.btn-warning[disabled]:active, -fieldset[disabled] .btn-warning:active, -.btn-warning.disabled.active, -.btn-warning[disabled].active, -fieldset[disabled] .btn-warning.active { - background-color: #f89406; - border-color: #f89406; -} - -.btn-warning .badge { - color: #f89406; - background-color: #ffffff; -} - -.btn-danger { - color: #ffffff; - background-color: #ee5f5b; - border-color: #ee5f5b; -} - -.btn-danger:hover, -.btn-danger:focus, -.btn-danger:active, -.btn-danger.active, -.open .dropdown-toggle.btn-danger { - color: #ffffff; - background-color: #ea3b36; - border-color: #e82924; -} - -.btn-danger:active,.btn-danger.active, -.open .dropdown-toggle.btn-danger { - background-image: none; -} - -.btn-danger.disabled, -.btn-danger[disabled], -fieldset[disabled] .btn-danger, -.btn-danger.disabled:hover, -.btn-danger[disabled]:hover, -fieldset[disabled] .btn-danger:hover, -.btn-danger.disabled:focus, -.btn-danger[disabled]:focus, -fieldset[disabled] .btn-danger:focus, -.btn-danger.disabled:active, -.btn-danger[disabled]:active, -fieldset[disabled] .btn-danger:active, -.btn-danger.disabled.active, -.btn-danger[disabled].active, -fieldset[disabled] .btn-danger.active { - background-color: #ee5f5b; - border-color: #ee5f5b; -} - -.btn-danger .badge { - color: #ee5f5b; - background-color: #ffffff; -} - -.btn-link { - color: #ffffff; - font-weight: normal; - cursor: pointer; - border-radius: 0; -} - -.btn-link,.btn-link:active, -.btn-link[disabled], -fieldset[disabled] .btn-link { - background-color: transparent; - -webkit-box-shadow: none; - box-shadow: none; -} - -.btn-link,.btn-link:hover, -.btn-link:focus, -.btn-link:active { - border-color: transparent; -} - -.btn-link:hover,.btn-link:focus { - color: #ffffff; - text-decoration: underline; - background-color: transparent; -} - -.btn-link[disabled]:hover, -fieldset[disabled] .btn-link:hover, -.btn-link[disabled]:focus, -fieldset[disabled] .btn-link:focus { - color: #7a8288; - text-decoration: none; -} - -.btn,.btn:hover { - border-color: rgba(0,0,0,0.6); - text-shadow: 1px 1px 1px rgba(0,0,0,0.3); -} - -.btn-default { - background-image: -webkit-linear-gradient(#484e55, #3a3f44 60%, #313539); - background-image: linear-gradient(#484e55, #3a3f44 60%, #313539); - background-repeat: no-repeat; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff484e55', endColorstr='#ff313539', GradientType=0); - filter: none; -} - -.btn-default:hover { - background-image: -webkit-linear-gradient(#020202, #101112 40%, #191b1d); - background-image: linear-gradient(#020202, #101112 40%, #191b1d); - background-repeat: no-repeat; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff020202', endColorstr='#ff191b1d', GradientType=0); - filter: none; -} - -.btn-primary { - background-image: -webkit-linear-gradient(#8a9196, #7a8288 60%, #70787d); - background-image: linear-gradient(#8a9196, #7a8288 60%, #70787d); - background-repeat: no-repeat; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff8a9196', endColorstr='#ff70787d', GradientType=0); - filter: none; -} - -.btn-primary:hover { - background-image: -webkit-linear-gradient(#404448, #4e5458 40%, #585e62); - background-image: linear-gradient(#404448, #4e5458 40%, #585e62); - background-repeat: no-repeat; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff404448', endColorstr='#ff585e62', GradientType=0); - filter: none; -} - -.btn-success { - background-image: -webkit-linear-gradient(#78cc78, #62c462 60%, #53be53); - background-image: linear-gradient(#78cc78, #62c462 60%, #53be53); - background-repeat: no-repeat; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff78cc78', endColorstr='#ff53be53', GradientType=0); - filter: none; -} - -.btn-success:hover { - background-image: -webkit-linear-gradient(#2f7d2f, #379337 40%, #3da23d); - background-image: linear-gradient(#2f7d2f, #379337 40%, #3da23d); - background-repeat: no-repeat; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff2f7d2f', endColorstr='#ff3da23d', GradientType=0); - filter: none; -} - -.btn-info { - background-image: -webkit-linear-gradient(#74cae3, #5bc0de 60%, #4ab9db); - background-image: linear-gradient(#74cae3, #5bc0de 60%, #4ab9db); - background-repeat: no-repeat; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff74cae3', endColorstr='#ff4ab9db', GradientType=0); - filter: none; -} - -.btn-info:hover { - background-image: -webkit-linear-gradient(#20829f, #2596b8 40%, #28a4c9); - background-image: linear-gradient(#20829f, #2596b8 40%, #28a4c9); - background-repeat: no-repeat; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff20829f', endColorstr='#ff28a4c9', GradientType=0); - filter: none; -} - -.btn-warning { - background-image: -webkit-linear-gradient(#faa123, #f89406 60%, #e48806); - background-image: linear-gradient(#faa123, #f89406 60%, #e48806); - background-repeat: no-repeat; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffaa123', endColorstr='#ffe48806', GradientType=0); - filter: none; -} - -.btn-warning:hover { - background-image: -webkit-linear-gradient(#804d03, #9e5f04 40%, #b26a04); - background-image: linear-gradient(#804d03, #9e5f04 40%, #b26a04); - background-repeat: no-repeat; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff804d03', endColorstr='#ffb26a04', GradientType=0); - filter: none; -} - -.btn-danger { - background-image: -webkit-linear-gradient(#f17a77, #ee5f5b 60%, #ec4d49); - background-image: linear-gradient(#f17a77, #ee5f5b 60%, #ec4d49); - background-repeat: no-repeat; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff17a77', endColorstr='#ffec4d49', GradientType=0); - filter: none; -} - -.btn-danger:hover { - background-image: -webkit-linear-gradient(#bb1813, #d71c16 40%, #e7201a); - background-image: linear-gradient(#bb1813, #d71c16 40%, #e7201a); - background-repeat: no-repeat; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffbb1813', endColorstr='#ffe7201a', GradientType=0); - filter: none; -} - -.btn-link,.btn-link:hover { - border-color: transparent; -} - diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/css/metricsgraphics-demo.css b/priv/static/metrics-graphics-3.0-alpha3/examples/css/metricsgraphics-demo.css deleted file mode 100644 index 497b816..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/css/metricsgraphics-demo.css +++ /dev/null @@ -1,220 +0,0 @@ -a, -a:active, -a:visited { - color: steelblue; - text-decoration: none; -} - -a:hover { - color: steelblue; -} - -a.active { - background-color: steelblue; - border: 0; - border-radius: 24px; - color: #fff; - padding: 2px 8px 2px 8px; - text-decoration: none; -} - -a.examples-options.selected { - font-weight: bold; -} - -a:hover.examples-options { - text-decoration: none; -} - -body { - background-color: #fff; - color: #000; - font-family: 'Open Sans', sans-serif, Arial; -} - -.btn-group { - display: inline-block; - margin-left: 3px; - margin-right: 3px; -} - -.btn-group span.which-button { - font-weight: 300; - color: darkgray; -} - -.btn-group span.title { - margin-left: 8px; - margin-right: 8px; -} - -.data-column { - font-size: 0.9rem; - margin: 0; - position: absolute; - right: 0; -} - -#description { - margin: auto; - margin-bottom: 50px; - width: 100%; -} - -.divider { - color: #000000; - opacity: 0.2; -} - -.examples-options { - font-size: 0.8rem; -} - -.float-right { - float: right; -} - -.footer { - font-size: 0.9rem; - padding: 40px; - text-align: center; -} - -.head { - color: black; - margin: auto; - margin-bottom: 20px; - width: 100%; -} - -.head h1 { - font-size: 4.1rem; - font-weight: 300; - margin: 45px 0 0 0; -} - -ul { - clear: both; - font-size: 1.2rem; - padding: 10px 0 0 0; -} - -.head ul li, -ul.examples li { - display: inline; - list-style: none; - padding-right: 15px; -} - -ul li.no-padding { - padding: 0; -} - -ul.examples li { - line-height: 30px; -} - -html { - font-size: 12px; -} - -.legend { - font-size: 0.9rem; - padding: 25px 0 15px 0; -} - -#logo { - margin: 60px 0 30px 0; - height: 79px; - width: 400px; -} - -p { - font-family: 'PT Serif', serif; - font-size: 1.3rem; - line-height: 24px; -} - -.pill { - font-family: 'Open Sans', serif; - font-size: 1rem; - text-transform: uppercase; -} - -.pill:hover { - text-decoration: none; -} - -pre { - background-color: transparent; - border: 0; - border-left: 2px solid #ccc; - border-radius: 0; - font-size: 0.9rem; - margin: 40px 0 0 10px; - overflow-x: auto; - padding: 0; - width: 100%; - word-wrap: normal; -} - -pre code { - white-space: inherit; -} - -pre code.hljs { - background-color: transparent; -} - -pre, code, text-area { - font-family: "Menlo", monospace; -} - -svg { - margin-top: 30px; -} - -#table1 .chart_title { - margin-left: 0; -} - -#torso { - margin: 0 auto; - text-align: center; - width: 100%; -} - -#torso div { - display: inline-block; -} - -#trunk { - margin-top: 40px; -} - -#trunk h2 { - font-size: 1.2rem; -} - -#trunk h2.trunk-title { - font-size: 2.2rem; - font-weight: 300; - text-transform: uppercase; -} - - -.trunk-section { - border-top: 1px solid #ccc; - padding-bottom: 25px; - padding-top: 15px; -} - -.wip { - background-color: #f1f1f1; - font-size: 1.3rem; - margin-top: 60px; - padding: 10px; - border-top-left-radius: 6px; - border-top-right-radius: 6px; - opacity: 0.8; -}
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/css/railscasts.css b/priv/static/metrics-graphics-3.0-alpha3/examples/css/railscasts.css deleted file mode 100644 index 21efe39..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/css/railscasts.css +++ /dev/null @@ -1,187 +0,0 @@ -/* - -Railscasts-like style (c) Visoft, Inc. (Damien White) - -*/ - -.hljs { - display: block; - overflow-x: auto; - padding: 0.5em; - background: #232323; - color: #e6e1dc; - -webkit-text-size-adjust: none; -} - -.hljs-comment, -.hljs-javadoc, -.hljs-shebang { - color: #bc9458; - font-style: italic; -} - -.hljs-keyword, -.ruby .hljs-function .hljs-keyword, -.hljs-request, -.hljs-status, -.nginx .hljs-title, -.method, -.hljs-list .hljs-title { - color: #c26230; -} - -.hljs-string, -.hljs-number, -.hljs-regexp, -.hljs-tag .hljs-value, -.hljs-cdata, -.hljs-filter .hljs-argument, -.hljs-attr_selector, -.apache .hljs-cbracket, -.hljs-date, -.tex .hljs-command, -.asciidoc .hljs-link_label, -.markdown .hljs-link_label { - color: #a5c261; -} - -.hljs-subst { - color: #519f50; -} - -.hljs-tag, -.hljs-tag .hljs-keyword, -.hljs-tag .hljs-title, -.hljs-doctype, -.hljs-sub .hljs-identifier, -.hljs-pi, -.input_number { - color: #e8bf6a; -} - -.hljs-identifier { - color: #d0d0ff; -} - -.hljs-class .hljs-title, -.hljs-type, -.smalltalk .hljs-class, -.hljs-javadoctag, -.hljs-yardoctag, -.hljs-phpdoc, -.hljs-dartdoc { - text-decoration: none; -} - -.hljs-constant { - color: #da4939; -} - - -.hljs-symbol, -.hljs-built_in, -.ruby .hljs-symbol .hljs-string, -.ruby .hljs-symbol .hljs-identifier, -.asciidoc .hljs-link_url, -.markdown .hljs-link_url, -.hljs-attribute { - color: #6d9cbe; -} - -.asciidoc .hljs-link_url, -.markdown .hljs-link_url { - text-decoration: underline; -} - - - -.hljs-params, -.hljs-variable, -.clojure .hljs-attribute { - color: #d0d0ff; -} - -.css .hljs-tag, -.hljs-rules .hljs-property, -.hljs-pseudo, -.tex .hljs-special { - color: #cda869; -} - -.css .hljs-class { - color: #9b703f; -} - -.hljs-rules .hljs-keyword { - color: #c5af75; -} - -.hljs-rules .hljs-value { - color: #cf6a4c; -} - -.css .hljs-id { - color: #8b98ab; -} - -.hljs-annotation, -.apache .hljs-sqbracket, -.nginx .hljs-built_in { - color: #9b859d; -} - -.hljs-preprocessor, -.hljs-preprocessor *, -.hljs-pragma { - color: #8996a8 !important; -} - -.hljs-hexcolor, -.css .hljs-value .hljs-number { - color: #a5c261; -} - -.hljs-title, -.hljs-decorator, -.css .hljs-function { - color: #ffc66d; -} - -.diff .hljs-header, -.hljs-chunk { - background-color: #2f33ab; - color: #e6e1dc; - display: inline-block; - width: 100%; -} - -.diff .hljs-change { - background-color: #4a410d; - color: #f8f8f8; - display: inline-block; - width: 100%; -} - -.hljs-addition { - background-color: #144212; - color: #e6e1dc; - display: inline-block; - width: 100%; -} - -.hljs-deletion { - background-color: #600; - color: #e6e1dc; - display: inline-block; - width: 100%; -} - -.coffeescript .javascript, -.javascript .xml, -.tex .hljs-formula, -.xml .javascript, -.xml .vbscript, -.xml .css, -.xml .hljs-cdata { - opacity: 0.7; -} diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/brief-1.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/brief-1.json deleted file mode 100644 index f84a3ff..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/brief-1.json +++ /dev/null @@ -1,402 +0,0 @@ -[ - { - "date": "2014-02-01", - "value": 15000000 - }, - { - "date": "2014-02-02", - "value": 16487625 - }, - { - "date": "2014-02-03", - "value": 17097434 - }, - { - "date": "2014-02-04", - "value": 17694420 - }, - { - "date": "2014-02-05", - "value": 17014381 - }, - { - "date": "2014-02-06", - "value": 15578984 - }, - { - "date": "2014-02-07", - "value": 14718953 - }, - { - "date": "2014-02-08", - "value": 15020669 - }, - { - "date": "2014-02-09", - "value": 13889722 - }, - { - "date": "2014-02-10", - "value": 13979897 - }, - { - "date": "2014-02-11", - "value": 14595566 - }, - { - "date": "2014-02-12", - "value": 14123256 - }, - { - "date": "2014-02-13", - "value": 14083675 - }, - { - "date": "2014-02-14", - "value": 15068426 - }, - { - "date": "2014-02-15", - "value": 15368056 - }, - { - "date": "2014-02-16", - "value": 15277054 - }, - { - "date": "2014-02-17", - "value": 14376243 - }, - { - "date": "2014-02-18", - "value": 13058892 - }, - { - "date": "2014-02-19", - "value": 12367653 - }, - { - "date": "2014-02-20", - "value": 13184423 - }, - { - "date": "2014-02-21", - "value": 14367203 - }, - { - "date": "2014-02-22", - "value": 14656447 - }, - { - "date": "2014-02-23", - "value": 14724526 - }, - { - "date": "2014-02-24", - "value": 14938129 - }, - { - "date": "2014-02-25", - "value": 14205617 - }, - { - "date": "2014-02-26", - "value": 14596607 - }, - { - "date": "2014-02-27", - "value": 13982597 - }, - { - "date": "2014-02-28", - "value": 15107034 - }, - { - "date": "2014-03-01", - "value": 13646739 - }, - { - "date": "2014-03-02", - "value": 14214763 - }, - { - "date": "2014-03-03", - "value": 14952136 - }, - { - "date": "2014-03-04", - "value": 14643933 - }, - { - "date": "2014-03-05", - "value": 13611435 - }, - { - "date": "2014-03-06", - "value": 12569788 - }, - { - "date": "2014-03-07", - "value": 11344469 - }, - { - "date": "2014-03-08", - "value": 12687132 - }, - { - "date": "2014-03-09", - "value": 11831144 - }, - { - "date": "2014-03-10", - "value": 10480837 - }, - { - "date": "2014-03-11", - "value": 9051161 - }, - { - "date": "2014-03-12", - "value": 9964784 - }, - { - "date": "2014-03-13", - "value": 11035006 - }, - { - "date": "2014-03-14", - "value": 10081289 - }, - { - "date": "2014-03-15", - "value": 9793897 - }, - { - "date": "2014-03-16", - "value": 9177447 - }, - { - "date": "2014-03-17", - "value": 8035348 - }, - { - "date": "2014-03-18", - "value": 6770242 - }, - { - "date": "2014-03-19", - "value": 7272077 - }, - { - "date": "2014-03-20", - "value": 8216348 - }, - { - "date": "2014-03-21", - "value": 8576584 - }, - { - "date": "2014-03-22", - "value": 9421060 - }, - { - "date": "2014-03-23", - "value": 10872288 - }, - { - "date": "2014-03-24", - "value": 9537996 - }, - { - "date": "2014-03-25", - "value": 9560363 - }, - { - "date": "2014-03-26", - "value": 8182813 - }, - { - "date": "2014-03-27", - "value": 9068173 - }, - { - "date": "2014-03-28", - "value": 10390251 - }, - { - "date": "2014-03-29", - "value": 9714081 - }, - { - "date": "2014-03-30", - "value": 9994670 - }, - { - "date": "2014-03-31", - "value": 9317878 - }, - { - "date": "2014-04-01", - "value": 8209077 - }, - { - "date": "2014-04-02", - "value": 9230830 - }, - { - "date": "2014-04-03", - "value": 8978342 - }, - { - "date": "2014-04-04", - "value": 8361854 - }, - { - "date": "2014-04-05", - "value": 9345999 - }, - { - "date": "2014-04-06", - "value": 7965407 - }, - { - "date": "2014-04-07", - "value": 8909276 - }, - { - "date": "2014-04-08", - "value": 8935489 - }, - { - "date": "2014-04-09", - "value": 8634997 - }, - { - "date": "2014-04-10", - "value": 8795592 - }, - { - "date": "2014-04-11", - "value": 7513086 - }, - { - "date": "2014-04-12", - "value": 8408561 - }, - { - "date": "2014-04-13", - "value": 7780649 - }, - { - "date": "2014-04-14", - "value": 7524281 - }, - { - "date": "2014-04-15", - "value": 8498062 - }, - { - "date": "2014-04-16", - "value": 7922453 - }, - { - "date": "2014-04-17", - "value": 9304312 - }, - { - "date": "2014-04-18", - "value": 8199457 - }, - { - "date": "2014-04-19", - "value": 8926136 - }, - { - "date": "2014-04-20", - "value": 7558184 - }, - { - "date": "2014-04-21", - "value": 6417511 - }, - { - "date": "2014-04-22", - "value": 5748831 - }, - { - "date": "2014-04-23", - "value": 6503022 - }, - { - "date": "2014-04-24", - "value": 6429606 - }, - { - "date": "2014-04-25", - "value": 5057410 - }, - { - "date": "2014-04-26", - "value": 5924669 - }, - { - "date": "2014-04-27", - "value": 4728239 - }, - { - "date": "2014-04-28", - "value": 3918540 - }, - { - "date": "2014-04-29", - "value": 2821473 - }, - { - "date": "2014-04-30", - "value": 1995781 - }, - { - "date": "2014-05-01", - "value": 1123626 - }, - { - "date": "2014-05-02", - "value": 516067 - }, - { - "date": "2014-05-03", - "value": 816831 - }, - { - "date": "2014-05-04", - "value": 816831 - }, - { - "date": "2014-05-05", - "value": 816831 - }, - { - "date": "2014-05-06", - "value": 1103818 - }, - { - "date": "2014-05-07", - "value": 958188 - }, - { - "date": "2014-05-08", - "value": 592995 - }, - { - "date": "2014-05-09", - "value": 856066 - }, - { - "date": "2014-05-10", - "value": 1766761 - }, - { - "date": "2014-05-11", - "value": 1330557 - } -]
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/brief-2.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/brief-2.json deleted file mode 100644 index 6bea2bc..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/brief-2.json +++ /dev/null @@ -1,402 +0,0 @@ -[ - { - "date": "2014-02-01", - "value": 15000000 - }, - { - "date": "2014-02-02", - "value": 14603908 - }, - { - "date": "2014-02-03", - "value": 16058813 - }, - { - "date": "2014-02-04", - "value": 16751442 - }, - { - "date": "2014-02-05", - "value": 18236063 - }, - { - "date": "2014-02-06", - "value": 19276343 - }, - { - "date": "2014-02-07", - "value": 17869996 - }, - { - "date": "2014-02-08", - "value": 18283550 - }, - { - "date": "2014-02-09", - "value": 18146798 - }, - { - "date": "2014-02-10", - "value": 19114034 - }, - { - "date": "2014-02-11", - "value": 18243994 - }, - { - "date": "2014-02-12", - "value": 18230379 - }, - { - "date": "2014-02-13", - "value": 17569438 - }, - { - "date": "2014-02-14", - "value": 18237141 - }, - { - "date": "2014-02-15", - "value": 18177790 - }, - { - "date": "2014-02-16", - "value": 19278138 - }, - { - "date": "2014-02-17", - "value": 19520468 - }, - { - "date": "2014-02-18", - "value": 18074007 - }, - { - "date": "2014-02-19", - "value": 17387983 - }, - { - "date": "2014-02-20", - "value": 16303246 - }, - { - "date": "2014-02-21", - "value": 16532377 - }, - { - "date": "2014-02-22", - "value": 15992596 - }, - { - "date": "2014-02-23", - "value": 14510598 - }, - { - "date": "2014-02-24", - "value": 15242619 - }, - { - "date": "2014-02-25", - "value": 15099566 - }, - { - "date": "2014-02-26", - "value": 15786161 - }, - { - "date": "2014-02-27", - "value": 17041993 - }, - { - "date": "2014-02-28", - "value": 17792064 - }, - { - "date": "2014-03-01", - "value": 17135803 - }, - { - "date": "2014-03-02", - "value": 17902796 - }, - { - "date": "2014-03-03", - "value": 18082480 - }, - { - "date": "2014-03-04", - "value": 16599484 - }, - { - "date": "2014-03-05", - "value": 15556006 - }, - { - "date": "2014-03-06", - "value": 16095932 - }, - { - "date": "2014-03-07", - "value": 15877165 - }, - { - "date": "2014-03-08", - "value": 16184507 - }, - { - "date": "2014-03-09", - "value": 17578551 - }, - { - "date": "2014-03-10", - "value": 17397416 - }, - { - "date": "2014-03-11", - "value": 18665547 - }, - { - "date": "2014-03-12", - "value": 17599363 - }, - { - "date": "2014-03-13", - "value": 16625060 - }, - { - "date": "2014-03-14", - "value": 15823403 - }, - { - "date": "2014-03-15", - "value": 17166280 - }, - { - "date": "2014-03-16", - "value": 17214931 - }, - { - "date": "2014-03-17", - "value": 18057950 - }, - { - "date": "2014-03-18", - "value": 18467657 - }, - { - "date": "2014-03-19", - "value": 18174411 - }, - { - "date": "2014-03-20", - "value": 17726332 - }, - { - "date": "2014-03-21", - "value": 18624889 - }, - { - "date": "2014-03-22", - "value": 18442598 - }, - { - "date": "2014-03-23", - "value": 17924421 - }, - { - "date": "2014-03-24", - "value": 17943620 - }, - { - "date": "2014-03-25", - "value": 17787115 - }, - { - "date": "2014-03-26", - "value": 16707201 - }, - { - "date": "2014-03-27", - "value": 17013779 - }, - { - "date": "2014-03-28", - "value": 17468840 - }, - { - "date": "2014-03-29", - "value": 16855965 - }, - { - "date": "2014-03-30", - "value": 16198783 - }, - { - "date": "2014-03-31", - "value": 17237410 - }, - { - "date": "2014-04-01", - "value": 16157939 - }, - { - "date": "2014-04-02", - "value": 15279153 - }, - { - "date": "2014-04-03", - "value": 16007123 - }, - { - "date": "2014-04-04", - "value": 15394272 - }, - { - "date": "2014-04-05", - "value": 15753468 - }, - { - "date": "2014-04-06", - "value": 14785435 - }, - { - "date": "2014-04-07", - "value": 14894846 - }, - { - "date": "2014-04-08", - "value": 16113018 - }, - { - "date": "2014-04-09", - "value": 17083579 - }, - { - "date": "2014-04-10", - "value": 17318911 - }, - { - "date": "2014-04-11", - "value": 17301918 - }, - { - "date": "2014-04-12", - "value": 16294357 - }, - { - "date": "2014-04-13", - "value": 17006382 - }, - { - "date": "2014-04-14", - "value": 16305037 - }, - { - "date": "2014-04-15", - "value": 17173934 - }, - { - "date": "2014-04-16", - "value": 16519521 - }, - { - "date": "2014-04-17", - "value": 15741197 - }, - { - "date": "2014-04-18", - "value": 15685527 - }, - { - "date": "2014-04-19", - "value": 16593307 - }, - { - "date": "2014-04-20", - "value": 15108037 - }, - { - "date": "2014-04-21", - "value": 14280930 - }, - { - "date": "2014-04-22", - "value": 15048575 - }, - { - "date": "2014-04-23", - "value": 13925294 - }, - { - "date": "2014-04-24", - "value": 13655381 - }, - { - "date": "2014-04-25", - "value": 14083620 - }, - { - "date": "2014-04-26", - "value": 14390459 - }, - { - "date": "2014-04-27", - "value": 14253026 - }, - { - "date": "2014-04-28", - "value": 15524371 - }, - { - "date": "2014-04-29", - "value": 14810508 - }, - { - "date": "2014-04-30", - "value": 14942971 - }, - { - "date": "2014-05-01", - "value": 13849556 - }, - { - "date": "2014-05-02", - "value": 14811628 - }, - { - "date": "2014-05-03", - "value": 13489786 - }, - { - "date": "2014-05-04", - "value": 13875740 - }, - { - "date": "2014-05-05", - "value": 14581874 - }, - { - "date": "2014-05-06", - "value": 15856637 - }, - { - "date": "2014-05-07", - "value": 15377926 - }, - { - "date": "2014-05-08", - "value": 14523507 - }, - { - "date": "2014-05-09", - "value": 14629800 - }, - { - "date": "2014-05-10", - "value": 14018497 - }, - { - "date": "2014-05-11", - "value": 12917428 - } -]
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/confidence_band.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/confidence_band.json deleted file mode 100644 index 0fb6dea..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/confidence_band.json +++ /dev/null @@ -1,548 +0,0 @@ - [ - { - "value": -1.1618426259, - "date": "2012-08-28", - "l": -2.6017329022, - "u": 0.2949717757 - }, - { - "value": -0.5828247293, - "date": "2012-08-29", - "l": -1.3166963635, - "u": 0.1324086347 - }, - { - "value": -0.3790770636, - "date": "2012-08-30", - "l": -0.8712221305, - "u": 0.0956413566 - }, - { - "value": -0.2792926002, - "date": "2012-08-31", - "l": -0.6541832008, - "u": 0.0717120241 - }, - { - "value": -0.2461165469, - "date": "2012-09-01", - "l": -0.5222677907, - "u": 0.0594188803 - }, - { - "value": -0.2017354137, - "date": "2012-09-02", - "l": -0.4434280535, - "u": 0.0419213465 - }, - { - "value": -0.1457476871, - "date": "2012-09-03", - "l": -0.3543957712, - "u": 0.0623761171 - }, - { - "value": -0.002610973, - "date": "2012-09-04", - "l": -0.3339911495, - "u": 0.031286929 - }, - { - "value": -0.0080692734, - "date": "2012-09-05", - "l": -0.2951839941, - "u": 0.0301762553 - }, - { - "value": -0.0296490933, - "date": "2012-09-06", - "l": -0.2964395801, - "u": -0.0029821004 - }, - { - "value": 0.001317397, - "date": "2012-09-07", - "l": -0.2295443759, - "u": 0.037903312 - }, - { - "value": -0.0117649838, - "date": "2012-09-08", - "l": -0.2226376418, - "u": 0.0239720183 - }, - { - "value": 0.0059394263, - "date": "2012-09-09", - "l": -0.2020479849, - "u": 0.0259489347 - }, - { - "value": -0.0115565898, - "date": "2012-09-10", - "l": -0.2042048037, - "u": 0.0077863806 - }, - { - "value": 0.0041183019, - "date": "2012-09-11", - "l": -0.1837263172, - "u": 0.0137898406 - }, - { - "value": 0.0353559544, - "date": "2012-09-12", - "l": -0.136610008, - "u": 0.051403828 - }, - { - "value": 0.0070046011, - "date": "2012-09-13", - "l": -0.1569988647, - "u": 0.0202266411 - }, - { - "value": -0.0004251807, - "date": "2012-09-14", - "l": -0.1410340292, - "u": 0.0273410185 - }, - { - "value": -0.0035461023, - "date": "2012-09-15", - "l": -0.1438653689, - "u": 0.0165445684 - }, - { - "value": 0.007797889, - "date": "2012-09-16", - "l": -0.1291975355, - "u": 0.0232461153 - }, - { - "value": 0.0025402723, - "date": "2012-09-17", - "l": -0.133972479, - "u": 0.0116753921 - }, - { - "value": -0.005317381, - "date": "2012-09-18", - "l": -0.1269266586, - "u": 0.0129723291 - }, - { - "value": -0.0075841521, - "date": "2012-09-19", - "l": -0.1283478383, - "u": 0.0056371616 - }, - { - "value": -0.0391388721, - "date": "2012-09-20", - "l": -0.1571172198, - "u": -0.0311678828 - }, - { - "value": 0.0075430252, - "date": "2012-09-21", - "l": -0.1097354417, - "u": 0.0141132062 - }, - { - "value": 0.1850284663, - "date": "2012-09-22", - "l": 0.0333682152, - "u": 0.2140709422 - }, - { - "value": 0.076629596, - "date": "2012-09-23", - "l": -0.0068472967, - "u": 0.1101280569 - }, - { - "value": -0.0314292271, - "date": "2012-09-24", - "l": -0.1074281762, - "u": 0.0032669363 - }, - { - "value": -0.0232608674, - "date": "2012-09-25", - "l": -0.0905197842, - "u": 0.0164250295 - }, - { - "value": -0.01968615, - "date": "2012-09-26", - "l": -0.084319856, - "u": 0.0193319465 - }, - { - "value": -0.0310196816, - "date": "2012-09-27", - "l": -0.0914356781, - "u": 0.0094436256 - }, - { - "value": -0.0758746967, - "date": "2012-09-28", - "l": -0.1169814745, - "u": -0.019659551 - }, - { - "value": 0.0233974572, - "date": "2012-09-29", - "l": -0.0356839258, - "u": 0.0610712506 - }, - { - "value": 0.011073579, - "date": "2012-09-30", - "l": -0.0558712863, - "u": 0.0346160081 - }, - { - "value": -0.002094822, - "date": "2012-10-01", - "l": -0.0707143388, - "u": 0.0152899266 - }, - { - "value": -0.1083707096, - "date": "2012-10-02", - "l": -0.1718101335, - "u": -0.0886271057 - }, - { - "value": -0.1098258972, - "date": "2012-10-03", - "l": -0.1881274065, - "u": -0.1072157972 - }, - { - "value": -0.0872970297, - "date": "2012-10-04", - "l": -0.1731903321, - "u": -0.064381434 - }, - { - "value": -0.0761992047, - "date": "2012-10-05", - "l": -0.1770373817, - "u": 0.100085727 - }, - { - "value": -0.0416654249, - "date": "2012-10-06", - "l": -0.1502479611, - "u": 0.0751148102 - }, - { - "value": -0.0410128962, - "date": "2012-10-07", - "l": -0.1618694445, - "u": 0.0881453482 - }, - { - "value": -0.0214289042, - "date": "2012-10-08", - "l": -0.1590852977, - "u": 0.0871880288 - }, - { - "value": 0.2430880604, - "date": "2012-10-09", - "l": 0.063624221, - "u": 0.2455101587 - }, - { - "value": 0.3472823479, - "date": "2012-10-10", - "l": 0.1553854927, - "u": 0.3583991097 - }, - { - "value": 0.3360734074, - "date": "2012-10-11", - "l": 0.2055952772, - "u": 0.3812162823 - }, - { - "value": -0.0463648355, - "date": "2012-10-12", - "l": -0.0626466998, - "u": 0.0037342957 - }, - { - "value": -0.0867009379, - "date": "2012-10-13", - "l": -0.0867594055, - "u": -0.0223791074 - }, - { - "value": -0.1288672826, - "date": "2012-10-14", - "l": -0.1161709129, - "u": -0.0534789124 - }, - { - "value": -0.1474426821, - "date": "2012-10-15", - "l": -0.1559759048, - "u": -0.0646995092 - }, - { - "value": -0.1502405066, - "date": "2012-10-16", - "l": -0.1604364638, - "u": -0.0602562376 - }, - { - "value": -0.1203765529, - "date": "2012-10-17", - "l": -0.1569023195, - "u": -0.0578129637 - }, - { - "value": -0.0649122919, - "date": "2012-10-18", - "l": -0.0782987564, - "u": -0.0501999174 - }, - { - "value": -0.015525562, - "date": "2012-10-19", - "l": -0.1103873808, - "u": -0.0132131311 - }, - { - "value": -0.006051357, - "date": "2012-10-20", - "l": -0.1089644497, - "u": 0.0230384197 - }, - { - "value": 0.0003154213, - "date": "2012-10-21", - "l": -0.1073849227, - "u": 0.0017290437 - }, - { - "value": -0.0063018298, - "date": "2012-10-22", - "l": -0.1120298155, - "u": 0.0173284555 - }, - { - "value": -0.004294834, - "date": "2012-10-23", - "l": -0.1076841119, - "u": 0.0547933965 - }, - { - "value": -0.0053400832, - "date": "2012-10-24", - "l": -0.1096991408, - "u": 0.0560555803 - }, - { - "value": 0.0070057212, - "date": "2012-10-25", - "l": -0.0940613813, - "u": 0.0425517607 - }, - { - "value": 0.0082121656, - "date": "2012-10-26", - "l": -0.0906810455, - "u": 0.0396884383 - }, - { - "value": 0.0141422884, - "date": "2012-10-27", - "l": -0.0841305678, - "u": 0.0340050012 - }, - { - "value": 0.0041613553, - "date": "2012-10-28", - "l": -0.0886723749, - "u": 0.039426727 - }, - { - "value": -0.0013614287, - "date": "2012-10-29", - "l": -0.0923481608, - "u": 0.0438725574 - }, - { - "value": -0.0052144933, - "date": "2012-10-30", - "l": -0.0937763043, - "u": 0.0459998555 - }, - { - "value": 0.0078904741, - "date": "2012-10-31", - "l": -0.0807028001, - "u": 0.0334824169 - }, - { - "value": 0.0099598702, - "date": "2012-11-01", - "l": -0.0740001323, - "u": 0.0280264274 - }, - { - "value": 0.0001146029, - "date": "2012-11-02", - "l": -0.0820430294, - "u": 0.0326771125 - }, - { - "value": 0.0047572651, - "date": "2012-11-03", - "l": -0.0754113825, - "u": 0.0294912577 - }, - { - "value": 0.006204557, - "date": "2012-11-04", - "l": -0.0750627059, - "u": 0.029693607 - }, - { - "value": 0.0115231406, - "date": "2012-11-05", - "l": -0.0663484142, - "u": 0.0214084056 - }, - { - "value": -0.0032634994, - "date": "2012-11-06", - "l": -0.0793170451, - "u": 0.0355159827 - }, - { - "value": -0.0108985452, - "date": "2012-11-07", - "l": -0.0846123893, - "u": 0.0409797057 - }, - { - "value": -0.0092766813, - "date": "2012-11-08", - "l": -0.0802668328, - "u": 0.0373886301 - }, - { - "value": 0.0095972086, - "date": "2012-11-09", - "l": -0.0623739694, - "u": 0.0194918693 - }, - { - "value": -0.0111809358, - "date": "2012-11-10", - "l": -0.0819555908, - "u": 0.038335749 - }, - { - "value": -0.0023572296, - "date": "2012-11-11", - "l": -0.0745443377, - "u": 0.0306093592 - }, - { - "value": 0.0084213775, - "date": "2012-11-12", - "l": -0.0657707155, - "u": 0.0227270619 - }, - { - "value": 0.0107446453, - "date": "2012-11-13", - "l": -0.0617995017, - "u": 0.0196547867 - }, - { - "value": 0.009457792, - "date": "2012-11-14", - "l": -0.0597697849, - "u": 0.0191832343 - }, - { - "value": 0.0031194779, - "date": "2012-11-15", - "l": -0.0589126783, - "u": 0.0186409442 - }, - { - "value": -0.0115128213, - "date": "2012-11-16", - "l": -0.0767105447, - "u": 0.0370292452 - }, - { - "value": 0.0058347339, - "date": "2012-11-17", - "l": -0.0592236472, - "u": 0.0198181452 - }, - { - "value": -0.0235630436, - "date": "2012-11-18", - "l": -0.083529944, - "u": 0.046280909 - }, - { - "value": -0.0479795964, - "date": "2012-11-19", - "l": -0.1086422529, - "u": 0.0113044645 - }, - { - "value": -0.0218184359, - "date": "2012-11-21", - "l": -0.0881634878, - "u": 0.0448568265 - }, - { - "value": -0.0071361172, - "date": "2012-11-28", - "l": -0.0807350229, - "u": 0.0453599734 - }, - { - "value": -0.0151966912, - "date": "2012-12-05", - "l": -0.089995793, - "u": 0.0558329569 - }, - { - "value": -0.0097784855, - "date": "2012-12-12", - "l": -0.089466481, - "u": 0.0550191387 - }, - { - "value": -0.0095681495, - "date": "2012-12-19", - "l": -0.090513354, - "u": 0.057073314 - }, - { - "value": -0.0034165915, - "date": "2012-12-27", - "l": -0.0907151292, - "u": 0.0561479112 - }, - { - "value": 0.3297981389, - "date": "2012-12-31", - "l": 0.1537781522, - "u": 0.3499473316 - } - ]
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/fake_users1.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/fake_users1.json deleted file mode 100644 index 4550c0f..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/fake_users1.json +++ /dev/null @@ -1,483 +0,0 @@ - - [ - { - "date": "2014-01-01", - "value": 190000000 - }, - { - "date": "2014-01-02", - "value": 190379978 - }, - { - "date": "2014-01-03", - "value": 90493749 - }, - { - "date": "2014-01-04", - "value": 190785250 - }, - { - "date": "2014-01-05", - "value": 197391904 - }, - { - "date": "2014-01-06", - "value": 191576838 - }, - { - "date": "2014-01-07", - "value": 191413854 - }, - { - "date": "2014-01-08", - "value": 142177211 - }, - { - "date": "2014-01-09", - "value": 103762210 - }, - { - "date": "2014-01-10", - "value": 144381072 - }, - { - "date": "2014-01-11", - "value": 154352310 - }, - { - "date": "2014-01-12", - "value": 165531790 - }, - { - "date": "2014-01-13", - "value": 175748881 - }, - { - "date": "2014-01-14", - "value": 187064037 - }, - { - "date": "2014-01-15", - "value": 197520685 - }, - { - "date": "2014-01-16", - "value": 210176418 - }, - { - "date": "2014-01-17", - "value": 196122924 - }, - { - "date": "2014-01-18", - "value": 157337480 - }, - { - "date": "2014-01-19", - "value": 200258882 - }, - { - "date": "2014-01-20", - "value": 186829538 - }, - { - "date": "2014-01-21", - "value": 112456897 - }, - { - "date": "2014-01-22", - "value": 114299711 - }, - { - "date": "2014-01-23", - "value": 122759017 - }, - { - "date": "2014-01-24", - "value": 203596183 - }, - { - "date": "2014-01-25", - "value": 208107346 - }, - { - "date": "2014-01-26", - "value": 196359852 - }, - { - "date": "2014-01-27", - "value": 192570783 - }, - { - "date": "2014-01-28", - "value": 177967768 - }, - { - "date": "2014-01-29", - "value": 190632803 - }, - { - "date": "2014-01-30", - "value": 203725316 - }, - { - "date": "2014-01-31", - "value": 118226177 - }, - { - "date": "2014-02-01", - "value": 210698669 - }, - { - "date": "2014-02-02", - "value": 217640656 - }, - { - "date": "2014-02-03", - "value": 216142362 - }, - { - "date": "2014-02-04", - "value": 201410971 - }, - { - "date": "2014-02-05", - "value": 196704289 - }, - { - "date": "2014-02-06", - "value": 190436945 - }, - { - "date": "2014-02-07", - "value": 178891686 - }, - { - "date": "2014-02-08", - "value": 171613962 - }, - { - "date": "2014-02-09", - "value": 107579773 - }, - { - "date": "2014-02-10", - "value": 158677098 - }, - { - "date": "2014-02-11", - "value": 147129977 - }, - { - "date": "2014-02-12", - "value": 151561876 - }, - { - "date": "2014-02-13", - "value": 151627421 - }, - { - "date": "2014-02-14", - "value": 143543872 - }, - { - "date": "2014-02-15", - "value": 136581057 - }, - { - "date": "2014-02-16", - "value": 135560715 - }, - { - "date": "2014-02-17", - "value": 122625263 - }, - { - "date": "2014-02-18", - "value": 112091484 - }, - { - "date": "2014-02-19", - "value": 98810329 - }, - { - "date": "2014-02-20", - "value": 99882912 - }, - { - "date": "2014-02-21", - "value": 94943095 - }, - { - "date": "2014-02-22", - "value": 104875743 - }, - { - "date": "2014-02-23", - "value": 116383678 - }, - { - "date": "2014-02-24", - "value": 105028841 - }, - { - "date": "2014-02-25", - "value": 123967310 - }, - { - "date": "2014-02-26", - "value": 133167029 - }, - { - "date": "2014-02-27", - "value": 128577263 - }, - { - "date": "2014-02-28", - "value": 115836969 - }, - { - "date": "2014-03-01", - "value": 119264529 - }, - { - "date": "2014-03-02", - "value": 109363374 - }, - { - "date": "2014-03-03", - "value": 113985628 - }, - { - "date": "2014-03-04", - "value": 114650999 - }, - { - "date": "2014-03-05", - "value": 110866108 - }, - { - "date": "2014-03-06", - "value": 96473454 - }, - { - "date": "2014-03-07", - "value": 84075886 - }, - { - "date": "2014-03-08", - "value": 103568384 - }, - { - "date": "2014-03-09", - "value": 101534883 - }, - { - "date": "2014-03-10", - "value": 115825447 - }, - { - "date": "2014-03-11", - "value": 126133916 - }, - { - "date": "2014-03-12", - "value": 116502109 - }, - { - "date": "2014-03-13", - "value": 80169411 - }, - { - "date": "2014-03-14", - "value": 84296886 - }, - { - "date": "2014-03-15", - "value": 86347399 - }, - { - "date": "2014-03-16", - "value": 31483669 - }, - { - "date": "2014-03-17", - "value": 142811333 - }, - { - "date": "2014-03-18", - "value": 89675396 - }, - { - "date": "2014-03-19", - "value": 115514483 - }, - { - "date": "2014-03-20", - "value": 117630630 - }, - { - "date": "2014-03-21", - "value": 122340239 - }, - { - "date": "2014-03-22", - "value": 132349091 - }, - { - "date": "2014-03-23", - "value": 125613305 - }, - { - "date": "2014-03-24", - "value": 135592466 - }, - { - "date": "2014-03-25", - "value": 123408762 - }, - { - "date": "2014-03-26", - "value": 111991454 - }, - { - "date": "2014-03-27", - "value": 116123955 - }, - { - "date": "2014-03-28", - "value": 112817214 - }, - { - "date": "2014-03-29", - "value": 113029590 - }, - { - "date": "2014-03-30", - "value": 108753398 - }, - { - "date": "2014-03-31", - "value": 99383763 - }, - { - "date": "2014-04-01", - "value": 100151737 - }, - { - "date": "2014-04-02", - "value": 94985209 - }, - { - "date": "2014-04-03", - "value": 82913669 - }, - { - "date": "2014-04-04", - "value": 78748268 - }, - { - "date": "2014-04-05", - "value": 63829135 - }, - { - "date": "2014-04-06", - "value": 78694727 - }, - { - "date": "2014-04-07", - "value": 80868994 - }, - { - "date": "2014-04-08", - "value": 93799013 - }, - { - "date": "2014-04-09", - "value": 9042416 - }, - { - "date": "2014-04-10", - "value": 97298692 - }, - { - "date": "2014-04-11", - "value": 53353499 - }, - { - "date": "2014-04-12", - "value": 71248129 - }, - { - "date": "2014-04-13", - "value": 75253744 - }, - { - "date": "2014-04-14", - "value": 68976648 - }, - { - "date": "2014-04-15", - "value": 71002284 - }, - { - "date": "2014-04-16", - "value": 75052401 - }, - { - "date": "2014-04-17", - "value": 83894030 - }, - { - "date": "2014-04-18", - "value": 50236528 - }, - { - "date": "2014-04-19", - "value": 59739114 - }, - { - "date": "2014-04-20", - "value": 56407136 - }, - { - "date": "2014-04-21", - "value": 108323177 - }, - { - "date": "2014-04-22", - "value": 101578914 - }, - { - "date": "2014-04-23", - "value": 115877608 - }, - { - "date": "2014-04-24", - "value": 132088857 - }, - { - "date": "2014-04-25", - "value": 112071353 - }, - { - "date": "2014-04-26", - "value": 81790062 - }, - { - "date": "2014-04-27", - "value": 105003761 - }, - { - "date": "2014-04-28", - "value": 100457727 - }, - { - "date": "2014-04-29", - "value": 118253926 - }, - { - "date": "2014-04-30", - "value": 67956992 - } - ] diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/fake_users2.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/fake_users2.json deleted file mode 100644 index 7fc5842..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/fake_users2.json +++ /dev/null @@ -1,1448 +0,0 @@ -[ - [ - { - "date": "2014-01-01", - "value": 10000000 - }, - { - "date": "2014-01-02", - "value": 10379978 - }, - { - "date": "2014-01-03", - "value": 10493749 - }, - { - "date": "2014-01-04", - "value": 10785250 - }, - { - "date": "2014-01-05", - "value": 13901904 - }, - { - "date": "2014-01-06", - "value": 11576838 - }, - { - "date": "2014-01-07", - "value": 14413854 - }, - { - "date": "2014-01-08", - "value": 15177211 - }, - { - "date": "2014-01-09", - "value": 16622100 - }, - { - "date": "2014-01-10", - "value": 17381072 - }, - { - "date": "2014-01-11", - "value": 18802310 - }, - { - "date": "2014-01-12", - "value": 15531790 - }, - { - "date": "2014-01-13", - "value": 15748881 - }, - { - "date": "2014-01-14", - "value": 18706437 - }, - { - "date": "2014-01-15", - "value": 19752685 - }, - { - "date": "2014-01-16", - "value": 21016418 - }, - { - "date": "2014-01-17", - "value": 25622924 - }, - { - "date": "2014-01-18", - "value": 25337480 - }, - { - "date": "2014-01-19", - "value": 22258882 - }, - { - "date": "2014-01-20", - "value": 23829538 - }, - { - "date": "2014-01-21", - "value": 24245689 - }, - { - "date": "2014-01-22", - "value": 26429711 - }, - { - "date": "2014-01-23", - "value": 26259017 - }, - { - "date": "2014-01-24", - "value": 25396183 - }, - { - "date": "2014-01-25", - "value": 23107346 - }, - { - "date": "2014-01-26", - "value": 28659852 - }, - { - "date": "2014-01-27", - "value": 25270783 - }, - { - "date": "2014-01-28", - "value": 26270783 - }, - { - "date": "2014-01-29", - "value": 27270783 - }, - { - "date": "2014-01-30", - "value": 28270783 - }, - { - "date": "2014-01-31", - "value": 29270783 - }, - { - "date": "2014-02-01", - "value": 30270783 - }, - { - "date": "2014-02-02", - "value": 31270783 - }, - { - "date": "2014-02-03", - "value": 32270783 - }, - { - "date": "2014-02-04", - "value": 33270783 - }, - { - "date": "2014-02-05", - "value": 28270783 - }, - { - "date": "2014-02-06", - "value": 27270783 - }, - { - "date": "2014-02-07", - "value": 35270783 - }, - { - "date": "2014-02-08", - "value": 34270783 - }, - { - "date": "2014-02-09", - "value": 28270783 - }, - { - "date": "2014-02-10", - "value": 35270783 - }, - { - "date": "2014-02-11", - "value": 36270783 - }, - { - "date": "2014-02-12", - "value": 34127078 - }, - { - "date": "2014-02-13", - "value": 33124078 - }, - { - "date": "2014-02-14", - "value": 36227078 - }, - { - "date": "2014-02-15", - "value": 37827078 - }, - { - "date": "2014-02-16", - "value": 36427073 - }, - { - "date": "2014-02-17", - "value": 37570783 - }, - { - "date": "2014-02-18", - "value": 38627073 - }, - { - "date": "2014-02-19", - "value": 37727078 - }, - { - "date": "2014-02-20", - "value": 38827073 - }, - { - "date": "2014-02-21", - "value": 40927078 - }, - { - "date": "2014-02-22", - "value": 41027078 - }, - { - "date": "2014-02-23", - "value": 42127073 - }, - { - "date": "2014-02-24", - "value": 43220783 - }, - { - "date": "2014-02-25", - "value": 44327078 - }, - { - "date": "2014-02-26", - "value": 40427078 - }, - { - "date": "2014-02-27", - "value": 41027078 - }, - { - "date": "2014-02-28", - "value": 45627078 - }, - { - "date": "2014-03-01", - "value": 44727078 - }, - { - "date": "2014-03-02", - "value": 44227078 - }, - { - "date": "2014-03-03", - "value": 45227078 - }, - { - "date": "2014-03-04", - "value": 46027078 - }, - { - "date": "2014-03-05", - "value": 46927078 - }, - { - "date": "2014-03-06", - "value": 47027078 - }, - { - "date": "2014-03-07", - "value": 46227078 - }, - { - "date": "2014-03-08", - "value": 47027078 - }, - { - "date": "2014-03-09", - "value": 48027078 - }, - { - "date": "2014-03-10", - "value": 47027078 - }, - { - "date": "2014-03-11", - "value": 47027078 - }, - { - "date": "2014-03-12", - "value": 48017078 - }, - { - "date": "2014-03-13", - "value": 48077078 - }, - { - "date": "2014-03-14", - "value": 48087078 - }, - { - "date": "2014-03-15", - "value": 48017078 - }, - { - "date": "2014-03-16", - "value": 48047078 - }, - { - "date": "2014-03-17", - "value": 48067078 - }, - { - "date": "2014-03-18", - "value": 48077078 - }, - { - "date": "2014-03-19", - "value": 48027074 - }, - { - "date": "2014-03-20", - "value": 48927079 - }, - { - "date": "2014-03-21", - "value": 48727071 - }, - { - "date": "2014-03-22", - "value": 48127072 - }, - { - "date": "2014-03-23", - "value": 48527072 - }, - { - "date": "2014-03-24", - "value": 48627027 - }, - { - "date": "2014-03-25", - "value": 48027040 - }, - { - "date": "2014-03-26", - "value": 48027043 - }, - { - "date": "2014-03-27", - "value": 48057022 - }, - { - "date": "2014-03-28", - "value": 49057022 - }, - { - "date": "2014-03-29", - "value": 50057022 - }, - { - "date": "2014-03-30", - "value": 51057022 - }, - { - "date": "2014-03-31", - "value": 52057022 - }, - { - "date": "2014-04-01", - "value": 53057022 - }, - { - "date": "2014-04-02", - "value": 54057022 - }, - { - "date": "2014-04-03", - "value": 52057022 - }, - { - "date": "2014-04-04", - "value": 55057022 - }, - { - "date": "2014-04-05", - "value": 58270783 - }, - { - "date": "2014-04-06", - "value": 56270783 - }, - { - "date": "2014-04-07", - "value": 55270783 - }, - { - "date": "2014-04-08", - "value": 58270783 - }, - { - "date": "2014-04-09", - "value": 59270783 - }, - { - "date": "2014-04-10", - "value": 60270783 - }, - { - "date": "2014-04-11", - "value": 61270783 - }, - { - "date": "2014-04-12", - "value": 62270783 - }, - { - "date": "2014-04-13", - "value": 63270783 - }, - { - "date": "2014-04-14", - "value": 64270783 - }, - { - "date": "2014-04-15", - "value": 65270783 - }, - { - "date": "2014-04-16", - "value": 66270783 - }, - { - "date": "2014-04-17", - "value": 67270783 - }, - { - "date": "2014-04-18", - "value": 68270783 - }, - { - "date": "2014-04-19", - "value": 69270783 - }, - { - "date": "2014-04-20", - "value": 70270783 - }, - { - "date": "2014-04-21", - "value": 71270783 - }, - { - "date": "2014-04-22", - "value": 72270783 - }, - { - "date": "2014-04-23", - "value": 73270783 - }, - { - "date": "2014-04-24", - "value": 74270783 - }, - { - "date": "2014-04-25", - "value": 75270783 - }, - { - "date": "2014-04-26", - "value": 76660783 - }, - { - "date": "2014-04-27", - "value": 77270783 - }, - { - "date": "2014-04-28", - "value": 78370783 - }, - { - "date": "2014-04-29", - "value": 79470783 - }, - { - "date": "2014-04-30", - "value": 80170783 - } - ], - [ - { - "date": "2014-01-01", - "value": 150000000 - }, - { - "date": "2014-01-02", - "value": 160379978 - }, - { - "date": "2014-01-03", - "value": 170493749 - }, - { - "date": "2014-01-04", - "value": 160785250 - }, - { - "date": "2014-01-05", - "value": 167391904 - }, - { - "date": "2014-01-06", - "value": 161576838 - }, - { - "date": "2014-01-07", - "value": 161413854 - }, - { - "date": "2014-01-08", - "value": 152177211 - }, - { - "date": "2014-01-09", - "value": 143762210 - }, - { - "date": "2014-01-10", - "value": 144381072 - }, - { - "date": "2014-01-11", - "value": 154352310 - }, - { - "date": "2014-01-12", - "value": 165531790 - }, - { - "date": "2014-01-13", - "value": 175748881 - }, - { - "date": "2014-01-14", - "value": 187064037 - }, - { - "date": "2014-01-15", - "value": 197520685 - }, - { - "date": "2014-01-16", - "value": 210176418 - }, - { - "date": "2014-01-17", - "value": 196122924 - }, - { - "date": "2014-01-18", - "value": 207337480 - }, - { - "date": "2014-01-19", - "value": 200258882 - }, - { - "date": "2014-01-20", - "value": 186829538 - }, - { - "date": "2014-01-21", - "value": 192456897 - }, - { - "date": "2014-01-22", - "value": 204299711 - }, - { - "date": "2014-01-23", - "value": 192759017 - }, - { - "date": "2014-01-24", - "value": 203596183 - }, - { - "date": "2014-01-25", - "value": 208107346 - }, - { - "date": "2014-01-26", - "value": 196359852 - }, - { - "date": "2014-01-27", - "value": 192570783 - }, - { - "date": "2014-01-28", - "value": 177967768 - }, - { - "date": "2014-01-29", - "value": 190632803 - }, - { - "date": "2014-01-30", - "value": 203725316 - }, - { - "date": "2014-01-31", - "value": 218226177 - }, - { - "date": "2014-02-01", - "value": 210698669 - }, - { - "date": "2014-02-02", - "value": 217640656 - }, - { - "date": "2014-02-03", - "value": 216142362 - }, - { - "date": "2014-02-04", - "value": 201410971 - }, - { - "date": "2014-02-05", - "value": 196704289 - }, - { - "date": "2014-02-06", - "value": 190436945 - }, - { - "date": "2014-02-07", - "value": 178891686 - }, - { - "date": "2014-02-08", - "value": 171613962 - }, - { - "date": "2014-02-09", - "value": 157579773 - }, - { - "date": "2014-02-10", - "value": 158677098 - }, - { - "date": "2014-02-11", - "value": 147129977 - }, - { - "date": "2014-02-12", - "value": 151561876 - }, - { - "date": "2014-02-13", - "value": 151627421 - }, - { - "date": "2014-02-14", - "value": 143543872 - }, - { - "date": "2014-02-15", - "value": 136581057 - }, - { - "date": "2014-02-16", - "value": 135560715 - }, - { - "date": "2014-02-17", - "value": 122625263 - }, - { - "date": "2014-02-18", - "value": 112091484 - }, - { - "date": "2014-02-19", - "value": 98810329 - }, - { - "date": "2014-02-20", - "value": 99882912 - }, - { - "date": "2014-02-21", - "value": 94943095 - }, - { - "date": "2014-02-22", - "value": 104875743 - }, - { - "date": "2014-02-23", - "value": 116383678 - }, - { - "date": "2014-02-24", - "value": 125028841 - }, - { - "date": "2014-02-25", - "value": 123967310 - }, - { - "date": "2014-02-26", - "value": 133167029 - }, - { - "date": "2014-02-27", - "value": 128577263 - }, - { - "date": "2014-02-28", - "value": 115836969 - }, - { - "date": "2014-03-01", - "value": 119264529 - }, - { - "date": "2014-03-02", - "value": 109363374 - }, - { - "date": "2014-03-03", - "value": 113985628 - }, - { - "date": "2014-03-04", - "value": 114650999 - }, - { - "date": "2014-03-05", - "value": 110866108 - }, - { - "date": "2014-03-06", - "value": 96473454 - }, - { - "date": "2014-03-07", - "value": 104075886 - }, - { - "date": "2014-03-08", - "value": 103568384 - }, - { - "date": "2014-03-09", - "value": 101534883 - }, - { - "date": "2014-03-10", - "value": 115825447 - }, - { - "date": "2014-03-11", - "value": 126133916 - }, - { - "date": "2014-03-12", - "value": 116502109 - }, - { - "date": "2014-03-13", - "value": 130169411 - }, - { - "date": "2014-03-14", - "value": 124296886 - }, - { - "date": "2014-03-15", - "value": 126347399 - }, - { - "date": "2014-03-16", - "value": 131483669 - }, - { - "date": "2014-03-17", - "value": 142811333 - }, - { - "date": "2014-03-18", - "value": 129675396 - }, - { - "date": "2014-03-19", - "value": 115514483 - }, - { - "date": "2014-03-20", - "value": 117630630 - }, - { - "date": "2014-03-21", - "value": 122340239 - }, - { - "date": "2014-03-22", - "value": 132349091 - }, - { - "date": "2014-03-23", - "value": 125613305 - }, - { - "date": "2014-03-24", - "value": 135592466 - }, - { - "date": "2014-03-25", - "value": 123408762 - }, - { - "date": "2014-03-26", - "value": 111991454 - }, - { - "date": "2014-03-27", - "value": 116123955 - }, - { - "date": "2014-03-28", - "value": 112817214 - }, - { - "date": "2014-03-29", - "value": 113029590 - }, - { - "date": "2014-03-30", - "value": 108753398 - }, - { - "date": "2014-03-31", - "value": 99383763 - }, - { - "date": "2014-04-01", - "value": 100151737 - }, - { - "date": "2014-04-02", - "value": 94985209 - }, - { - "date": "2014-04-03", - "value": 82913669 - }, - { - "date": "2014-04-04", - "value": 78748268 - }, - { - "date": "2014-04-05", - "value": 63829135 - }, - { - "date": "2014-04-06", - "value": 78694727 - }, - { - "date": "2014-04-07", - "value": 80868994 - }, - { - "date": "2014-04-08", - "value": 93799013 - }, - { - "date": "2014-04-09", - "value": 99042416 - }, - { - "date": "2014-04-10", - "value": 97298692 - }, - { - "date": "2014-04-11", - "value": 83353499 - }, - { - "date": "2014-04-12", - "value": 71248129 - }, - { - "date": "2014-04-13", - "value": 75253744 - }, - { - "date": "2014-04-14", - "value": 68976648 - }, - { - "date": "2014-04-15", - "value": 71002284 - }, - { - "date": "2014-04-16", - "value": 75052401 - }, - { - "date": "2014-04-17", - "value": 83894030 - }, - { - "date": "2014-04-18", - "value": 90236528 - }, - { - "date": "2014-04-19", - "value": 99739114 - }, - { - "date": "2014-04-20", - "value": 96407136 - }, - { - "date": "2014-04-21", - "value": 108323177 - }, - { - "date": "2014-04-22", - "value": 101578914 - }, - { - "date": "2014-04-23", - "value": 115877608 - }, - { - "date": "2014-04-24", - "value": 112088857 - }, - { - "date": "2014-04-25", - "value": 112071353 - }, - { - "date": "2014-04-26", - "value": 101790062 - }, - { - "date": "2014-04-27", - "value": 115003761 - }, - { - "date": "2014-04-28", - "value": 120457727 - }, - { - "date": "2014-04-29", - "value": 118253926 - }, - { - "date": "2014-04-30", - "value": 117956992 - } - ], - [ - { - "date": "2014-01-01", - "value": 60000000 - }, - { - "date": "2014-01-02", - "value": 60379978 - }, - { - "date": "2014-01-03", - "value": 40493749 - }, - { - "date": "2014-01-04", - "value": 60785250 - }, - { - "date": "2014-01-05", - "value": 67391904 - }, - { - "date": "2014-01-06", - "value": 61576838 - }, - { - "date": "2014-01-07", - "value": 61413854 - }, - { - "date": "2014-01-08", - "value": 82177211 - }, - { - "date": "2014-01-09", - "value": 103762210 - }, - { - "date": "2014-01-10", - "value": 84381072 - }, - { - "date": "2014-01-11", - "value": 54352310 - }, - { - "date": "2014-01-12", - "value": 65531790 - }, - { - "date": "2014-01-13", - "value": 75748881 - }, - { - "date": "2014-01-14", - "value": 47064037 - }, - { - "date": "2014-01-15", - "value": 67520685 - }, - { - "date": "2014-01-16", - "value": 60176418 - }, - { - "date": "2014-01-17", - "value": 66122924 - }, - { - "date": "2014-01-18", - "value": 57337480 - }, - { - "date": "2014-01-19", - "value": 100258882 - }, - { - "date": "2014-01-20", - "value": 46829538 - }, - { - "date": "2014-01-21", - "value": 92456897 - }, - { - "date": "2014-01-22", - "value": 94299711 - }, - { - "date": "2014-01-23", - "value": 62759017 - }, - { - "date": "2014-01-24", - "value": 103596183 - }, - { - "date": "2014-01-25", - "value": 108107346 - }, - { - "date": "2014-01-26", - "value": 66359852 - }, - { - "date": "2014-01-27", - "value": 62570783 - }, - { - "date": "2014-01-28", - "value": 77967768 - }, - { - "date": "2014-01-29", - "value": 60632803 - }, - { - "date": "2014-01-30", - "value": 103725316 - }, - { - "date": "2014-01-31", - "value": 98226177 - }, - { - "date": "2014-02-01", - "value": 60698669 - }, - { - "date": "2014-02-02", - "value": 67640656 - }, - { - "date": "2014-02-03", - "value": 66142362 - }, - { - "date": "2014-02-04", - "value": 101410971 - }, - { - "date": "2014-02-05", - "value": 66704289 - }, - { - "date": "2014-02-06", - "value": 60436945 - }, - { - "date": "2014-02-07", - "value": 78891686 - }, - { - "date": "2014-02-08", - "value": 71613962 - }, - { - "date": "2014-02-09", - "value": 107579773 - }, - { - "date": "2014-02-10", - "value": 58677098 - }, - { - "date": "2014-02-11", - "value": 87129977 - }, - { - "date": "2014-02-12", - "value": 51561876 - }, - { - "date": "2014-02-13", - "value": 51627421 - }, - { - "date": "2014-02-14", - "value": 83543872 - }, - { - "date": "2014-02-15", - "value": 66581057 - }, - { - "date": "2014-02-16", - "value": 65560715 - }, - { - "date": "2014-02-17", - "value": 62625263 - }, - { - "date": "2014-02-18", - "value": 92091484 - }, - { - "date": "2014-02-19", - "value": 48810329 - }, - { - "date": "2014-02-20", - "value": 49882912 - }, - { - "date": "2014-02-21", - "value": 44943095 - }, - { - "date": "2014-02-22", - "value": 104875743 - }, - { - "date": "2014-02-23", - "value": 96383678 - }, - { - "date": "2014-02-24", - "value": 105028841 - }, - { - "date": "2014-02-25", - "value": 63967310 - }, - { - "date": "2014-02-26", - "value": 63167029 - }, - { - "date": "2014-02-27", - "value": 68577263 - }, - { - "date": "2014-02-28", - "value": 95836969 - }, - { - "date": "2014-03-01", - "value": 99264529 - }, - { - "date": "2014-03-02", - "value": 109363374 - }, - { - "date": "2014-03-03", - "value": 93985628 - }, - { - "date": "2014-03-04", - "value": 94650999 - }, - { - "date": "2014-03-05", - "value": 90866108 - }, - { - "date": "2014-03-06", - "value": 46473454 - }, - { - "date": "2014-03-07", - "value": 84075886 - }, - { - "date": "2014-03-08", - "value": 103568384 - }, - { - "date": "2014-03-09", - "value": 101534883 - }, - { - "date": "2014-03-10", - "value": 95825447 - }, - { - "date": "2014-03-11", - "value": 66133916 - }, - { - "date": "2014-03-12", - "value": 96502109 - }, - { - "date": "2014-03-13", - "value": 80169411 - }, - { - "date": "2014-03-14", - "value": 84296886 - }, - { - "date": "2014-03-15", - "value": 86347399 - }, - { - "date": "2014-03-16", - "value": 31483669 - }, - { - "date": "2014-03-17", - "value": 82811333 - }, - { - "date": "2014-03-18", - "value": 89675396 - }, - { - "date": "2014-03-19", - "value": 95514483 - }, - { - "date": "2014-03-20", - "value": 97630630 - }, - { - "date": "2014-03-21", - "value": 62340239 - }, - { - "date": "2014-03-22", - "value": 62349091 - }, - { - "date": "2014-03-23", - "value": 65613305 - }, - { - "date": "2014-03-24", - "value": 65592466 - }, - { - "date": "2014-03-25", - "value": 63408762 - }, - { - "date": "2014-03-26", - "value": 91991454 - }, - { - "date": "2014-03-27", - "value": 96123955 - }, - { - "date": "2014-03-28", - "value": 92817214 - }, - { - "date": "2014-03-29", - "value": 93029590 - }, - { - "date": "2014-03-30", - "value": 108753398 - }, - { - "date": "2014-03-31", - "value": 49383763 - }, - { - "date": "2014-04-01", - "value": 100151737 - }, - { - "date": "2014-04-02", - "value": 44985209 - }, - { - "date": "2014-04-03", - "value": 52913669 - }, - { - "date": "2014-04-04", - "value": 48748268 - }, - { - "date": "2014-04-05", - "value": 23829135 - }, - { - "date": "2014-04-06", - "value": 58694727 - }, - { - "date": "2014-04-07", - "value": 50868994 - }, - { - "date": "2014-04-08", - "value": 43799013 - }, - { - "date": "2014-04-09", - "value": 4042416 - }, - { - "date": "2014-04-10", - "value": 47298692 - }, - { - "date": "2014-04-11", - "value": 53353499 - }, - { - "date": "2014-04-12", - "value": 71248129 - }, - { - "date": "2014-04-13", - "value": 75253744 - }, - { - "date": "2014-04-14", - "value": 68976648 - }, - { - "date": "2014-04-15", - "value": 71002284 - }, - { - "date": "2014-04-16", - "value": 75052401 - }, - { - "date": "2014-04-17", - "value": 83894030 - }, - { - "date": "2014-04-18", - "value": 50236528 - }, - { - "date": "2014-04-19", - "value": 59739114 - }, - { - "date": "2014-04-20", - "value": 56407136 - }, - { - "date": "2014-04-21", - "value": 108323177 - }, - { - "date": "2014-04-22", - "value": 101578914 - }, - { - "date": "2014-04-23", - "value": 95877608 - }, - { - "date": "2014-04-24", - "value": 62088857 - }, - { - "date": "2014-04-25", - "value": 92071353 - }, - { - "date": "2014-04-26", - "value": 81790062 - }, - { - "date": "2014-04-27", - "value": 105003761 - }, - { - "date": "2014-04-28", - "value": 100457727 - }, - { - "date": "2014-04-29", - "value": 98253926 - }, - { - "date": "2014-04-30", - "value": 67956992 - } - ] -]
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/fake_users3.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/fake_users3.json deleted file mode 100644 index d0b8f16..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/fake_users3.json +++ /dev/null @@ -1,1448 +0,0 @@ -[ - [ - { - "date": "2014-01-01", - "value": 150000000 - }, - { - "date": "2014-01-02", - "value": 168799730 - }, - { - "date": "2014-01-03", - "value": 179473940 - }, - { - "date": "2014-01-04", - "value": 160525870 - }, - { - "date": "2014-01-05", - "value": 164091937 - }, - { - "date": "2014-01-06", - "value": 168386751 - }, - { - "date": "2014-01-07", - "value": 164583141 - }, - { - "date": "2014-01-08", - "value": 151127712 - }, - { - "date": "2014-01-09", - "value": 140122673 - }, - { - "date": "2014-01-10", - "value": 142701834 - }, - { - "date": "2014-01-11", - "value": 150132534 - }, - { - "date": "2014-01-12", - "value": 160971355 - }, - { - "date": "2014-01-13", - "value": 171888475 - }, - { - "date": "2014-01-14", - "value": 187304607 - }, - { - "date": "2014-01-15", - "value": 195860257 - }, - { - "date": "2014-01-16", - "value": 218146710 - }, - { - "date": "2014-01-17", - "value": 194292216 - }, - { - "date": "2014-01-18", - "value": 200847337 - }, - { - "date": "2014-01-19", - "value": 202888520 - }, - { - "date": "2014-01-20", - "value": 188359286 - }, - { - "date": "2014-01-21", - "value": 197986542 - }, - { - "date": "2014-01-22", - "value": 201179924 - }, - { - "date": "2014-01-23", - "value": 197109572 - }, - { - "date": "2014-01-24", - "value": 203816953 - }, - { - "date": "2014-01-25", - "value": 206437018 - }, - { - "date": "2014-01-26", - "value": 192589536 - }, - { - "date": "2014-01-27", - "value": 193870752 - }, - { - "date": "2014-01-28", - "value": 178677697 - }, - { - "date": "2014-01-29", - "value": 193082360 - }, - { - "date": "2014-01-30", - "value": 206135273 - }, - { - "date": "2014-01-31", - "value": 217716228 - }, - { - "date": "2014-02-01", - "value": 219668960 - }, - { - "date": "2014-02-02", - "value": 216560467 - }, - { - "date": "2014-02-03", - "value": 212632416 - }, - { - "date": "2014-02-04", - "value": 201790141 - }, - { - "date": "2014-02-05", - "value": 199824076 - }, - { - "date": "2014-02-06", - "value": 195496340 - }, - { - "date": "2014-02-07", - "value": 176861988 - }, - { - "date": "2014-02-08", - "value": 172693161 - }, - { - "date": "2014-02-09", - "value": 153779757 - }, - { - "date": "2014-02-10", - "value": 158907768 - }, - { - "date": "2014-02-11", - "value": 147799217 - }, - { - "date": "2014-02-12", - "value": 156781651 - }, - { - "date": "2014-02-13", - "value": 151247261 - }, - { - "date": "2014-02-14", - "value": 142783453 - }, - { - "date": "2014-02-15", - "value": 137501856 - }, - { - "date": "2014-02-16", - "value": 135170655 - }, - { - "date": "2014-02-17", - "value": 123625262 - }, - { - "date": "2014-02-18", - "value": 114841902 - }, - { - "date": "2014-02-19", - "value": 99230188 - }, - { - "date": "2014-02-20", - "value": 92192889 - }, - { - "date": "2014-02-21", - "value": 95903494 - }, - { - "date": "2014-02-22", - "value": 103475784 - }, - { - "date": "2014-02-23", - "value": 118763836 - }, - { - "date": "2014-02-24", - "value": 121488205 - }, - { - "date": "2014-02-25", - "value": 120137693 - }, - { - "date": "2014-02-26", - "value": 139207613 - }, - { - "date": "2014-02-27", - "value": 123627758 - }, - { - "date": "2014-02-28", - "value": 119696385 - }, - { - "date": "2014-03-01", - "value": 119254629 - }, - { - "date": "2014-03-02", - "value": 104733639 - }, - { - "date": "2014-03-03", - "value": 118265893 - }, - { - "date": "2014-03-04", - "value": 119990564 - }, - { - "date": "2014-03-05", - "value": 118016680 - }, - { - "date": "2014-03-06", - "value": 94543746 - }, - { - "date": "2014-03-07", - "value": 106885704 - }, - { - "date": "2014-03-08", - "value": 104838653 - }, - { - "date": "2014-03-09", - "value": 103884351 - }, - { - "date": "2014-03-10", - "value": 117445285 - }, - { - "date": "2014-03-11", - "value": 126193316 - }, - { - "date": "2014-03-12", - "value": 119012056 - }, - { - "date": "2014-03-13", - "value": 131149610 - }, - { - "date": "2014-03-14", - "value": 126886924 - }, - { - "date": "2014-03-15", - "value": 129937436 - }, - { - "date": "2014-03-16", - "value": 139663841 - }, - { - "date": "2014-03-17", - "value": 143331182 - }, - { - "date": "2014-03-18", - "value": 126935769 - }, - { - "date": "2014-03-19", - "value": 113844155 - }, - { - "date": "2014-03-20", - "value": 110360367 - }, - { - "date": "2014-03-21", - "value": 129320432 - }, - { - "date": "2014-03-22", - "value": 131909432 - }, - { - "date": "2014-03-23", - "value": 125033165 - }, - { - "date": "2014-03-24", - "value": 136642955 - }, - { - "date": "2014-03-25", - "value": 122678043 - }, - { - "date": "2014-03-26", - "value": 114541991 - }, - { - "date": "2014-03-27", - "value": 115593216 - }, - { - "date": "2014-03-28", - "value": 114127182 - }, - { - "date": "2014-03-29", - "value": 110959203 - }, - { - "date": "2014-03-30", - "value": 108933578 - }, - { - "date": "2014-03-31", - "value": 93673839 - }, - { - "date": "2014-04-01", - "value": 107371510 - }, - { - "date": "2014-04-02", - "value": 99025894 - }, - { - "date": "2014-04-03", - "value": 89663192 - }, - { - "date": "2014-04-04", - "value": 78628478 - }, - { - "date": "2014-04-05", - "value": 65319283 - }, - { - "date": "2014-04-06", - "value": 77274968 - }, - { - "date": "2014-04-07", - "value": 84998680 - }, - { - "date": "2014-04-08", - "value": 93109973 - }, - { - "date": "2014-04-09", - "value": 96142409 - }, - { - "date": "2014-04-10", - "value": 92968927 - }, - { - "date": "2014-04-11", - "value": 89943533 - }, - { - "date": "2014-04-12", - "value": 79218421 - }, - { - "date": "2014-04-13", - "value": 74473525 - }, - { - "date": "2014-04-14", - "value": 68466798 - }, - { - "date": "2014-04-15", - "value": 74822001 - }, - { - "date": "2014-04-16", - "value": 71042505 - }, - { - "date": "2014-04-17", - "value": 80304983 - }, - { - "date": "2014-04-18", - "value": 98256320 - }, - { - "date": "2014-04-19", - "value": 94119379 - }, - { - "date": "2014-04-20", - "value": 96317046 - }, - { - "date": "2014-04-21", - "value": 107713238 - }, - { - "date": "2014-04-22", - "value": 104198751 - }, - { - "date": "2014-04-23", - "value": 118067785 - }, - { - "date": "2014-04-24", - "value": 117588802 - }, - { - "date": "2014-04-25", - "value": 113531702 - }, - { - "date": "2014-04-26", - "value": 102600971 - }, - { - "date": "2014-04-27", - "value": 111673005 - }, - { - "date": "2014-04-28", - "value": 127277540 - }, - { - "date": "2014-04-29", - "value": 116293528 - }, - { - "date": "2014-04-30", - "value": 112996597 - } - ], - [ - { - "date": "2014-01-01", - "value": 10000000 - }, - { - "date": "2014-01-02", - "value": 18799730 - }, - { - "date": "2014-01-03", - "value": 19473940 - }, - { - "date": "2014-01-04", - "value": 10525870 - }, - { - "date": "2014-01-05", - "value": 14091093 - }, - { - "date": "2014-01-06", - "value": 18386751 - }, - { - "date": "2014-01-07", - "value": 14583144 - }, - { - "date": "2014-01-08", - "value": 11127715 - }, - { - "date": "2014-01-09", - "value": 10012266 - }, - { - "date": "2014-01-10", - "value": 12701837 - }, - { - "date": "2014-01-11", - "value": 10132088 - }, - { - "date": "2014-01-12", - "value": 10971355 - }, - { - "date": "2014-01-13", - "value": 11888475 - }, - { - "date": "2014-01-14", - "value": 17346078 - }, - { - "date": "2014-01-15", - "value": 15862579 - }, - { - "date": "2014-01-16", - "value": 28146101 - }, - { - "date": "2014-01-17", - "value": 24292265 - }, - { - "date": "2014-01-18", - "value": 20847335 - }, - { - "date": "2014-01-19", - "value": 22888522 - }, - { - "date": "2014-01-20", - "value": 28359283 - }, - { - "date": "2014-01-21", - "value": 29865424 - }, - { - "date": "2014-01-22", - "value": 21179246 - }, - { - "date": "2014-01-23", - "value": 27109526 - }, - { - "date": "2014-01-24", - "value": 23816935 - }, - { - "date": "2014-01-25", - "value": 26437013 - }, - { - "date": "2014-01-26", - "value": 22589568 - }, - { - "date": "2014-01-27", - "value": 23870725 - }, - { - "date": "2014-01-28", - "value": 23870726 - }, - { - "date": "2014-01-29", - "value": 23870727 - }, - { - "date": "2014-01-30", - "value": 23870728 - }, - { - "date": "2014-01-31", - "value": 23870729 - }, - { - "date": "2014-02-01", - "value": 33870720 - }, - { - "date": "2014-02-02", - "value": 33870721 - }, - { - "date": "2014-02-03", - "value": 33870722 - }, - { - "date": "2014-02-04", - "value": 33870723 - }, - { - "date": "2014-02-05", - "value": 23870728 - }, - { - "date": "2014-02-06", - "value": 23870727 - }, - { - "date": "2014-02-07", - "value": 33870725 - }, - { - "date": "2014-02-08", - "value": 33870724 - }, - { - "date": "2014-02-09", - "value": 23870728 - }, - { - "date": "2014-02-10", - "value": 33870725 - }, - { - "date": "2014-02-11", - "value": 33870726 - }, - { - "date": "2014-02-12", - "value": 38707214 - }, - { - "date": "2014-02-13", - "value": 38704213 - }, - { - "date": "2014-02-14", - "value": 38707226 - }, - { - "date": "2014-02-15", - "value": 38707287 - }, - { - "date": "2014-02-16", - "value": 33707246 - }, - { - "date": "2014-02-17", - "value": 33870757 - }, - { - "date": "2014-02-18", - "value": 33707268 - }, - { - "date": "2014-02-19", - "value": 38707277 - }, - { - "date": "2014-02-20", - "value": 33707288 - }, - { - "date": "2014-02-21", - "value": 48707290 - }, - { - "date": "2014-02-22", - "value": 48707201 - }, - { - "date": "2014-02-23", - "value": 43707212 - }, - { - "date": "2014-02-24", - "value": 43870223 - }, - { - "date": "2014-02-25", - "value": 48707234 - }, - { - "date": "2014-02-26", - "value": 48707240 - }, - { - "date": "2014-02-27", - "value": 48707201 - }, - { - "date": "2014-02-28", - "value": 48707265 - }, - { - "date": "2014-03-01", - "value": 48707274 - }, - { - "date": "2014-03-02", - "value": 48707224 - }, - { - "date": "2014-03-03", - "value": 48707225 - }, - { - "date": "2014-03-04", - "value": 48707206 - }, - { - "date": "2014-03-05", - "value": 48707296 - }, - { - "date": "2014-03-06", - "value": 48707207 - }, - { - "date": "2014-03-07", - "value": 48707226 - }, - { - "date": "2014-03-08", - "value": 48707207 - }, - { - "date": "2014-03-09", - "value": 48707208 - }, - { - "date": "2014-03-10", - "value": 48707207 - }, - { - "date": "2014-03-11", - "value": 48707207 - }, - { - "date": "2014-03-12", - "value": 48707108 - }, - { - "date": "2014-03-13", - "value": 48707708 - }, - { - "date": "2014-03-14", - "value": 48707808 - }, - { - "date": "2014-03-15", - "value": 48707108 - }, - { - "date": "2014-03-16", - "value": 48707408 - }, - { - "date": "2014-03-17", - "value": 48707608 - }, - { - "date": "2014-03-18", - "value": 48707708 - }, - { - "date": "2014-03-19", - "value": 44707208 - }, - { - "date": "2014-03-20", - "value": 49707298 - }, - { - "date": "2014-03-21", - "value": 41707278 - }, - { - "date": "2014-03-22", - "value": 42707218 - }, - { - "date": "2014-03-23", - "value": 42707258 - }, - { - "date": "2014-03-24", - "value": 47207268 - }, - { - "date": "2014-03-25", - "value": 40407208 - }, - { - "date": "2014-03-26", - "value": 43407208 - }, - { - "date": "2014-03-27", - "value": 42207508 - }, - { - "date": "2014-03-28", - "value": 42207509 - }, - { - "date": "2014-03-29", - "value": 52207500 - }, - { - "date": "2014-03-30", - "value": 52207501 - }, - { - "date": "2014-03-31", - "value": 52207502 - }, - { - "date": "2014-04-01", - "value": 52207503 - }, - { - "date": "2014-04-02", - "value": 52207504 - }, - { - "date": "2014-04-03", - "value": 52207502 - }, - { - "date": "2014-04-04", - "value": 52207505 - }, - { - "date": "2014-04-05", - "value": 53870728 - }, - { - "date": "2014-04-06", - "value": 53870726 - }, - { - "date": "2014-04-07", - "value": 53870725 - }, - { - "date": "2014-04-08", - "value": 53870728 - }, - { - "date": "2014-04-09", - "value": 53870729 - }, - { - "date": "2014-04-10", - "value": 63870720 - }, - { - "date": "2014-04-11", - "value": 63870721 - }, - { - "date": "2014-04-12", - "value": 63870722 - }, - { - "date": "2014-04-13", - "value": 63870723 - }, - { - "date": "2014-04-14", - "value": 63870724 - }, - { - "date": "2014-04-15", - "value": 63870725 - }, - { - "date": "2014-04-16", - "value": 63870726 - }, - { - "date": "2014-04-17", - "value": 63870727 - }, - { - "date": "2014-04-18", - "value": 63870728 - }, - { - "date": "2014-04-19", - "value": 63870729 - }, - { - "date": "2014-04-20", - "value": 73870720 - }, - { - "date": "2014-04-21", - "value": 73870721 - }, - { - "date": "2014-04-22", - "value": 73870722 - }, - { - "date": "2014-04-23", - "value": 73870723 - }, - { - "date": "2014-04-24", - "value": 73870724 - }, - { - "date": "2014-04-25", - "value": 73870725 - }, - { - "date": "2014-04-26", - "value": 73870666 - }, - { - "date": "2014-04-27", - "value": 73870727 - }, - { - "date": "2014-04-28", - "value": 73870738 - }, - { - "date": "2014-04-29", - "value": 73870749 - }, - { - "date": "2014-04-30", - "value": 83870710 - } - ], - [ - { - "date": "2014-01-01", - "value": 60000000 - }, - { - "date": "2014-01-02", - "value": 68799730 - }, - { - "date": "2014-01-03", - "value": 49473940 - }, - { - "date": "2014-01-04", - "value": 60525870 - }, - { - "date": "2014-01-05", - "value": 64091937 - }, - { - "date": "2014-01-06", - "value": 68386751 - }, - { - "date": "2014-01-07", - "value": 64583141 - }, - { - "date": "2014-01-08", - "value": 81127712 - }, - { - "date": "2014-01-09", - "value": 100122673 - }, - { - "date": "2014-01-10", - "value": 82701834 - }, - { - "date": "2014-01-11", - "value": 50132534 - }, - { - "date": "2014-01-12", - "value": 60971355 - }, - { - "date": "2014-01-13", - "value": 71888475 - }, - { - "date": "2014-01-14", - "value": 47304607 - }, - { - "date": "2014-01-15", - "value": 65860257 - }, - { - "date": "2014-01-16", - "value": 68146710 - }, - { - "date": "2014-01-17", - "value": 64292216 - }, - { - "date": "2014-01-18", - "value": 50847337 - }, - { - "date": "2014-01-19", - "value": 102888520 - }, - { - "date": "2014-01-20", - "value": 48359286 - }, - { - "date": "2014-01-21", - "value": 97986542 - }, - { - "date": "2014-01-22", - "value": 91179924 - }, - { - "date": "2014-01-23", - "value": 67109572 - }, - { - "date": "2014-01-24", - "value": 103816953 - }, - { - "date": "2014-01-25", - "value": 106437018 - }, - { - "date": "2014-01-26", - "value": 62589536 - }, - { - "date": "2014-01-27", - "value": 63870752 - }, - { - "date": "2014-01-28", - "value": 78677697 - }, - { - "date": "2014-01-29", - "value": 63082360 - }, - { - "date": "2014-01-30", - "value": 106135273 - }, - { - "date": "2014-01-31", - "value": 97716228 - }, - { - "date": "2014-02-01", - "value": 69668960 - }, - { - "date": "2014-02-02", - "value": 66560467 - }, - { - "date": "2014-02-03", - "value": 62632416 - }, - { - "date": "2014-02-04", - "value": 101790141 - }, - { - "date": "2014-02-05", - "value": 69824076 - }, - { - "date": "2014-02-06", - "value": 65496340 - }, - { - "date": "2014-02-07", - "value": 76861988 - }, - { - "date": "2014-02-08", - "value": 72693161 - }, - { - "date": "2014-02-09", - "value": 103779757 - }, - { - "date": "2014-02-10", - "value": 58907768 - }, - { - "date": "2014-02-11", - "value": 87799217 - }, - { - "date": "2014-02-12", - "value": 56781651 - }, - { - "date": "2014-02-13", - "value": 51247261 - }, - { - "date": "2014-02-14", - "value": 82783453 - }, - { - "date": "2014-02-15", - "value": 67501856 - }, - { - "date": "2014-02-16", - "value": 65170655 - }, - { - "date": "2014-02-17", - "value": 63625262 - }, - { - "date": "2014-02-18", - "value": 94841902 - }, - { - "date": "2014-02-19", - "value": 49230188 - }, - { - "date": "2014-02-20", - "value": 42192889 - }, - { - "date": "2014-02-21", - "value": 45903494 - }, - { - "date": "2014-02-22", - "value": 103475784 - }, - { - "date": "2014-02-23", - "value": 98763836 - }, - { - "date": "2014-02-24", - "value": 101488205 - }, - { - "date": "2014-02-25", - "value": 60137693 - }, - { - "date": "2014-02-26", - "value": 69207613 - }, - { - "date": "2014-02-27", - "value": 63627758 - }, - { - "date": "2014-02-28", - "value": 99696385 - }, - { - "date": "2014-03-01", - "value": 99254629 - }, - { - "date": "2014-03-02", - "value": 104733639 - }, - { - "date": "2014-03-03", - "value": 98265893 - }, - { - "date": "2014-03-04", - "value": 99990564 - }, - { - "date": "2014-03-05", - "value": 98016680 - }, - { - "date": "2014-03-06", - "value": 44543746 - }, - { - "date": "2014-03-07", - "value": 86885704 - }, - { - "date": "2014-03-08", - "value": 104838653 - }, - { - "date": "2014-03-09", - "value": 103884351 - }, - { - "date": "2014-03-10", - "value": 97445285 - }, - { - "date": "2014-03-11", - "value": 66193316 - }, - { - "date": "2014-03-12", - "value": 99012056 - }, - { - "date": "2014-03-13", - "value": 81149610 - }, - { - "date": "2014-03-14", - "value": 86886924 - }, - { - "date": "2014-03-15", - "value": 89937436 - }, - { - "date": "2014-03-16", - "value": 39663841 - }, - { - "date": "2014-03-17", - "value": 83331182 - }, - { - "date": "2014-03-18", - "value": 86935769 - }, - { - "date": "2014-03-19", - "value": 93844155 - }, - { - "date": "2014-03-20", - "value": 90360367 - }, - { - "date": "2014-03-21", - "value": 69320432 - }, - { - "date": "2014-03-22", - "value": 61909432 - }, - { - "date": "2014-03-23", - "value": 65033165 - }, - { - "date": "2014-03-24", - "value": 66642955 - }, - { - "date": "2014-03-25", - "value": 62678043 - }, - { - "date": "2014-03-26", - "value": 94541991 - }, - { - "date": "2014-03-27", - "value": 95593216 - }, - { - "date": "2014-03-28", - "value": 94127182 - }, - { - "date": "2014-03-29", - "value": 90959203 - }, - { - "date": "2014-03-30", - "value": 108933578 - }, - { - "date": "2014-03-31", - "value": 43673839 - }, - { - "date": "2014-04-01", - "value": 107371510 - }, - { - "date": "2014-04-02", - "value": 49025894 - }, - { - "date": "2014-04-03", - "value": 59663192 - }, - { - "date": "2014-04-04", - "value": 48628478 - }, - { - "date": "2014-04-05", - "value": 25319283 - }, - { - "date": "2014-04-06", - "value": 57274968 - }, - { - "date": "2014-04-07", - "value": 54998680 - }, - { - "date": "2014-04-08", - "value": 43109973 - }, - { - "date": "2014-04-09", - "value": 6142404 - }, - { - "date": "2014-04-10", - "value": 42968927 - }, - { - "date": "2014-04-11", - "value": 59943533 - }, - { - "date": "2014-04-12", - "value": 79218421 - }, - { - "date": "2014-04-13", - "value": 74473525 - }, - { - "date": "2014-04-14", - "value": 68466798 - }, - { - "date": "2014-04-15", - "value": 74822001 - }, - { - "date": "2014-04-16", - "value": 71042505 - }, - { - "date": "2014-04-17", - "value": 80304983 - }, - { - "date": "2014-04-18", - "value": 58256320 - }, - { - "date": "2014-04-19", - "value": 54119379 - }, - { - "date": "2014-04-20", - "value": 56317046 - }, - { - "date": "2014-04-21", - "value": 107713238 - }, - { - "date": "2014-04-22", - "value": 104198751 - }, - { - "date": "2014-04-23", - "value": 98067785 - }, - { - "date": "2014-04-24", - "value": 67588802 - }, - { - "date": "2014-04-25", - "value": 93531702 - }, - { - "date": "2014-04-26", - "value": 82600971 - }, - { - "date": "2014-04-27", - "value": 101673005 - }, - { - "date": "2014-04-28", - "value": 107277540 - }, - { - "date": "2014-04-29", - "value": 96293528 - }, - { - "date": "2014-04-30", - "value": 62996597 - } - ] -]
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/firefox_releases.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/firefox_releases.json deleted file mode 100644 index 0c40fbe..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/firefox_releases.json +++ /dev/null @@ -1,168 +0,0 @@ -{ - "releases": [ - { - "version": "30.0", - "date": "2014-06-01", - "end": "2014-08-01" - }, - { - "version": "29.0", - "date": "2014-04-29", - "end": "2014-06-01" - - }, - { - "version": "28.0", - "date": "2014-03-18", - "end": "2014-04-29" - }, - { - "version": "27.0", - "date": "2014-01-21", - "end": "2014-03-18" - }, - { - "version": "26.0", - "date": "2013-12-10", - "end": "2014-01-21" - }, - { - "version": "25.0", - "date": "2013-10-29", - "end": "2013-12-10" - - }, - { - "version": "24.0", - "date": "2013-09-17", - "end": "2013-10-29" - - }, - { - "version": "23.0", - "date": "2013-08-06", - "end": "2013-09-17" - - }, - { - "version": "22.0", - "date": "2013-06-25" - }, - { - "version": "21.0", - "date": "2013-05-14" - }, - { - "version": "20.0", - "date": "2013-04-02" - }, - { - "version": "19.0", - "date": "2013-02-19" - }, - { - "version": "18.0", - "date": "2013-01-08" - }, - { - "version": "17.0.1", - "date": "2012-11-30" - }, - { - "version": "17.0", - "date": "2012-11-20" - }, - { - "version": "16.0.2", - "date": "2012-10-26" - }, - { - "version": "16.0.1", - "date": "2012-10-11" - }, - { - "version": "16.0", - "date": "2012-10-09" - }, - { - "version": "15.0.1", - "date": "2012-09-06" - }, - { - "version": "15.0", - "date": "2012-08-28" - }, - { - "version": "14.0", - "date": "2012-07-17" - }, - { - "version": "13.0.1", - "date": "2012-06-15" - }, - { - "version": "13.0", - "date": "2012-06-05" - }, - { - "version": "12.0", - "date": "2012-04-24" - }, - { - "version": "11.0", - "date": "2012-03-13" - }, - { - "version": "10.0", - "date": "2012-01-31" - }, - { - "version": "9.0", - "date": "2011-12-20" - }, - { - "version": "8.0", - "date": "2011-11-08" - }, - { - "version": "7.0", - "date": "2011-09-27" - }, - { - "version": "6.0", - "date": "2011-08-16" - }, - { - "version": "5.0", - "date": "2011-06-21" - }, - { - "version": "4.0", - "date": "2011-03-22" - }, - { - "version": "3.6", - "date": "2010-01-21" - }, - { - "version": "3.5", - "date": "2009-06-30" - }, - { - "version": "3.0", - "date": "2008-06-17" - }, - { - "version": "2.0", - "date": "2006-10-24" - }, - { - "version": "1.5", - "date": "2005-11-29" - }, - { - "version": "1.0", - "date": "2004-11-09" - } - ] -} diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/float.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/float.json deleted file mode 100644 index a799832..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/float.json +++ /dev/null @@ -1,802 +0,0 @@ -[ - { - "date": "2013-10-01", - "value": 150.0 - }, - { - "date": "2013-10-02", - "value": 152.38052769378947 - }, - { - "date": "2013-10-03", - "value": 154.26923077120756 - }, - { - "date": "2013-10-04", - "value": 155.37842413996768 - }, - { - "date": "2013-10-05", - "value": 154.91598408222126 - }, - { - "date": "2013-10-06", - "value": 155.6051503275322 - }, - { - "date": "2013-10-07", - "value": 156.020995422744 - }, - { - "date": "2013-10-08", - "value": 153.1518021247084 - }, - { - "date": "2013-10-09", - "value": 151.21729814562673 - }, - { - "date": "2013-10-10", - "value": 151.38433609966495 - }, - { - "date": "2013-10-11", - "value": 150.78872781927018 - }, - { - "date": "2013-10-12", - "value": 153.9134389141148 - }, - { - "date": "2013-10-13", - "value": 156.94601290283427 - }, - { - "date": "2013-10-14", - "value": 158.86305615638318 - }, - { - "date": "2013-10-15", - "value": 159.25111032644563 - }, - { - "date": "2013-10-16", - "value": 157.70892050744425 - }, - { - "date": "2013-10-17", - "value": 156.5166885320253 - }, - { - "date": "2013-10-18", - "value": 159.2391477211863 - }, - { - "date": "2013-10-19", - "value": 156.15457859306844 - }, - { - "date": "2013-10-20", - "value": 157.32962414620647 - }, - { - "date": "2013-10-21", - "value": 153.83264840368938 - }, - { - "date": "2013-10-22", - "value": 152.8551947020626 - }, - { - "date": "2013-10-23", - "value": 153.38853405036897 - }, - { - "date": "2013-10-24", - "value": 152.93427670642123 - }, - { - "date": "2013-10-25", - "value": 153.1469976790017 - }, - { - "date": "2013-10-26", - "value": 156.32209665860327 - }, - { - "date": "2013-10-27", - "value": 155.3284262677578 - }, - { - "date": "2013-10-28", - "value": 154.90051183690736 - }, - { - "date": "2013-10-29", - "value": 152.21341963762546 - }, - { - "date": "2013-10-30", - "value": 154.8384882355127 - }, - { - "date": "2013-10-31", - "value": 153.49778206006178 - }, - { - "date": "2013-11-01", - "value": 150.69077772414497 - }, - { - "date": "2013-11-02", - "value": 148.3688534222137 - }, - { - "date": "2013-11-03", - "value": 147.1517262760622 - }, - { - "date": "2013-11-04", - "value": 146.64232264462947 - }, - { - "date": "2013-11-05", - "value": 143.7977476766292 - }, - { - "date": "2013-11-06", - "value": 142.82657667368557 - }, - { - "date": "2013-11-07", - "value": 144.37296514065383 - }, - { - "date": "2013-11-08", - "value": 145.59894477345333 - }, - { - "date": "2013-11-09", - "value": 145.88560250329667 - }, - { - "date": "2013-11-10", - "value": 148.28518729606375 - }, - { - "date": "2013-11-11", - "value": 147.02769155090894 - }, - { - "date": "2013-11-12", - "value": 146.69585270653417 - }, - { - "date": "2013-11-13", - "value": 145.45574401363186 - }, - { - "date": "2013-11-14", - "value": 148.18505057473558 - }, - { - "date": "2013-11-15", - "value": 148.36757870086083 - }, - { - "date": "2013-11-16", - "value": 145.1284637176675 - }, - { - "date": "2013-11-17", - "value": 143.38783013080223 - }, - { - "date": "2013-11-18", - "value": 145.58507244067314 - }, - { - "date": "2013-11-19", - "value": 148.16482741338075 - }, - { - "date": "2013-11-20", - "value": 151.30824629651008 - }, - { - "date": "2013-11-21", - "value": 148.94149732547913 - }, - { - "date": "2013-11-22", - "value": 149.08060427013632 - }, - { - "date": "2013-11-23", - "value": 151.10349313471838 - }, - { - "date": "2013-11-24", - "value": 151.38042365227193 - }, - { - "date": "2013-11-25", - "value": 153.61246750490707 - }, - { - "date": "2013-11-26", - "value": 152.3819387058022 - }, - { - "date": "2013-11-27", - "value": 154.7666777810689 - }, - { - "date": "2013-11-28", - "value": 156.20049982296294 - }, - { - "date": "2013-11-29", - "value": 157.60570664431154 - }, - { - "date": "2013-11-30", - "value": 158.83110208147457 - }, - { - "date": "2013-12-01", - "value": 157.05145284891836 - }, - { - "date": "2013-12-02", - "value": 160.5636817325332 - }, - { - "date": "2013-12-03", - "value": 158.52309803850414 - }, - { - "date": "2013-12-04", - "value": 159.5481262069485 - }, - { - "date": "2013-12-05", - "value": 162.66665660028468 - }, - { - "date": "2013-12-06", - "value": 164.14412262081478 - }, - { - "date": "2013-12-07", - "value": 167.24305427243902 - }, - { - "date": "2013-12-08", - "value": 167.26032062671646 - }, - { - "date": "2013-12-09", - "value": 168.74492234114962 - }, - { - "date": "2013-12-10", - "value": 165.37752588946347 - }, - { - "date": "2013-12-11", - "value": 166.97673724876898 - }, - { - "date": "2013-12-12", - "value": 165.24083072211786 - }, - { - "date": "2013-12-13", - "value": 163.91840295642777 - }, - { - "date": "2013-12-14", - "value": 161.21392266343142 - }, - { - "date": "2013-12-15", - "value": 161.09086330318053 - }, - { - "date": "2013-12-16", - "value": 159.72436012634117 - }, - { - "date": "2013-12-17", - "value": 162.92718203581796 - }, - { - "date": "2013-12-18", - "value": 166.05289239617858 - }, - { - "date": "2013-12-19", - "value": 167.8303488173302 - }, - { - "date": "2013-12-20", - "value": 169.1076706115558 - }, - { - "date": "2013-12-21", - "value": 172.18214540311942 - }, - { - "date": "2013-12-22", - "value": 173.60361186108835 - }, - { - "date": "2013-12-23", - "value": 170.3333738357524 - }, - { - "date": "2013-12-24", - "value": 171.44904351284399 - }, - { - "date": "2013-12-25", - "value": 171.4237348889382 - }, - { - "date": "2013-12-26", - "value": 170.63558145007596 - }, - { - "date": "2013-12-27", - "value": 168.67744459688063 - }, - { - "date": "2013-12-28", - "value": 170.87359507435463 - }, - { - "date": "2013-12-29", - "value": 170.91071470721673 - }, - { - "date": "2013-12-30", - "value": 173.52457327401646 - }, - { - "date": "2013-12-31", - "value": 175.89856657641783 - }, - { - "date": "2014-01-01", - "value": 175.9115683446306 - }, - { - "date": "2014-01-02", - "value": 178.12945782320122 - }, - { - "date": "2014-01-03", - "value": 179.9335431435273 - }, - { - "date": "2014-01-04", - "value": 180.4112576197819 - }, - { - "date": "2014-01-05", - "value": 179.7701613992972 - }, - { - "date": "2014-01-06", - "value": 177.4686229951754 - }, - { - "date": "2014-01-07", - "value": 175.172988264621 - }, - { - "date": "2014-01-08", - "value": 172.89816035941323 - }, - { - "date": "2014-01-09", - "value": 169.32566831004084 - }, - { - "date": "2014-01-10", - "value": 166.200899808268 - }, - { - "date": "2014-01-11", - "value": 163.47733139260433 - }, - { - "date": "2014-01-12", - "value": 166.14564943514935 - }, - { - "date": "2014-01-13", - "value": 162.6972855825834 - }, - { - "date": "2014-01-14", - "value": 163.8285391707244 - }, - { - "date": "2014-01-15", - "value": 162.83765973354699 - }, - { - "date": "2014-01-16", - "value": 159.48461419107502 - }, - { - "date": "2014-01-17", - "value": 158.38069135440546 - }, - { - "date": "2014-01-18", - "value": 159.36210753864273 - }, - { - "date": "2014-01-19", - "value": 155.9389059732206 - }, - { - "date": "2014-01-20", - "value": 159.44340217055645 - }, - { - "date": "2014-01-21", - "value": 157.1252301818101 - }, - { - "date": "2014-01-22", - "value": 155.0515461360151 - }, - { - "date": "2014-01-23", - "value": 154.31662985182166 - }, - { - "date": "2014-01-24", - "value": 156.2405729119896 - }, - { - "date": "2014-01-25", - "value": 154.4303911259191 - }, - { - "date": "2014-01-26", - "value": 156.96007254763632 - }, - { - "date": "2014-01-27", - "value": 156.88984607757212 - }, - { - "date": "2014-01-28", - "value": 158.46953270592533 - }, - { - "date": "2014-01-29", - "value": 159.9760971292252 - }, - { - "date": "2014-01-30", - "value": 158.6064520244421 - }, - { - "date": "2014-01-31", - "value": 159.30396031924434 - }, - { - "date": "2014-02-01", - "value": 158.27130616930083 - }, - { - "date": "2014-02-02", - "value": 156.76310105114038 - }, - { - "date": "2014-02-03", - "value": 158.01962557788505 - }, - { - "date": "2014-02-04", - "value": 155.5601666102677 - }, - { - "date": "2014-02-05", - "value": 152.5655582330515 - }, - { - "date": "2014-02-06", - "value": 153.83308497210635 - }, - { - "date": "2014-02-07", - "value": 155.0906250736871 - }, - { - "date": "2014-02-08", - "value": 156.6661412607239 - }, - { - "date": "2014-02-09", - "value": 154.487982130377 - }, - { - "date": "2014-02-10", - "value": 151.80870052397174 - }, - { - "date": "2014-02-11", - "value": 152.6566948046261 - }, - { - "date": "2014-02-12", - "value": 153.3776096334368 - }, - { - "date": "2014-02-13", - "value": 151.52116899747688 - }, - { - "date": "2014-02-14", - "value": 154.99799005974643 - }, - { - "date": "2014-02-15", - "value": 153.78962974183693 - }, - { - "date": "2014-02-16", - "value": 155.5614787876006 - }, - { - "date": "2014-02-17", - "value": 155.50672366114722 - }, - { - "date": "2014-02-18", - "value": 155.2247468326664 - }, - { - "date": "2014-02-19", - "value": 157.04530694488096 - }, - { - "date": "2014-02-20", - "value": 159.7683676258508 - }, - { - "date": "2014-02-21", - "value": 156.19049862244253 - }, - { - "date": "2014-02-22", - "value": 157.77626968451625 - }, - { - "date": "2014-02-23", - "value": 157.85540343546958 - }, - { - "date": "2014-02-24", - "value": 157.606624912295 - }, - { - "date": "2014-02-25", - "value": 154.29310962212645 - }, - { - "date": "2014-02-26", - "value": 151.47520450013815 - }, - { - "date": "2014-02-27", - "value": 153.29471917494737 - }, - { - "date": "2014-02-28", - "value": 156.704724984211 - }, - { - "date": "2014-03-01", - "value": 155.04358060019956 - }, - { - "date": "2014-03-02", - "value": 153.2334356350558 - }, - { - "date": "2014-03-03", - "value": 152.03821354498334 - }, - { - "date": "2014-03-04", - "value": 154.19199847895723 - }, - { - "date": "2014-03-05", - "value": 152.06664190112994 - }, - { - "date": "2014-03-06", - "value": 153.2986037364113 - }, - { - "date": "2014-03-07", - "value": 156.4046061310383 - }, - { - "date": "2014-03-08", - "value": 154.42925835672014 - }, - { - "date": "2014-03-09", - "value": 155.18025911896245 - }, - { - "date": "2014-03-10", - "value": 153.37647431770608 - }, - { - "date": "2014-03-11", - "value": 150.61799083023823 - }, - { - "date": "2014-03-12", - "value": 153.66746188173215 - }, - { - "date": "2014-03-13", - "value": 156.3151844520418 - }, - { - "date": "2014-03-14", - "value": 153.95015669138036 - }, - { - "date": "2014-03-15", - "value": 155.29282634003127 - }, - { - "date": "2014-03-16", - "value": 158.5090157803603 - }, - { - "date": "2014-03-17", - "value": 155.14902966934457 - }, - { - "date": "2014-03-18", - "value": 156.85877093764927 - }, - { - "date": "2014-03-19", - "value": 159.97825057884495 - }, - { - "date": "2014-03-20", - "value": 160.0756240788441 - }, - { - "date": "2014-03-21", - "value": 163.71251312564075 - }, - { - "date": "2014-03-22", - "value": 160.35896864910785 - }, - { - "date": "2014-03-23", - "value": 159.6979743839615 - }, - { - "date": "2014-03-24", - "value": 160.64504978193472 - }, - { - "date": "2014-03-25", - "value": 161.35500716559707 - }, - { - "date": "2014-03-26", - "value": 160.2606961200085 - }, - { - "date": "2014-03-27", - "value": 158.57932628000506 - }, - { - "date": "2014-03-28", - "value": 161.07173063651766 - }, - { - "date": "2014-03-29", - "value": 164.7598991714389 - }, - { - "date": "2014-03-30", - "value": 165.51463489538983 - }, - { - "date": "2014-03-31", - "value": 168.03477347136803 - }, - { - "date": "2014-04-01", - "value": 164.8919155855522 - }, - { - "date": "2014-04-02", - "value": 162.43871270413882 - }, - { - "date": "2014-04-03", - "value": 160.56491168480784 - }, - { - "date": "2014-04-04", - "value": 160.6231106692656 - }, - { - "date": "2014-04-05", - "value": 158.51347739227052 - }, - { - "date": "2014-04-06", - "value": 157.05813234785617 - }, - { - "date": "2014-04-07", - "value": 159.7471186342081 - }, - { - "date": "2014-04-08", - "value": 161.25579641704525 - }, - { - "date": "2014-04-09", - "value": 161.35157834105863 - }, - { - "date": "2014-04-10", - "value": 164.93059854718956 - }, - { - "date": "2014-04-11", - "value": 162.2509201417386 - }, - { - "date": "2014-04-12", - "value": 162.73580527992038 - }, - { - "date": "2014-04-13", - "value": 166.48398412407607 - }, - { - "date": "2014-04-14", - "value": 163.15310481696565 - }, - { - "date": "2014-04-15", - "value": 164.5079907470571 - }, - { - "date": "2014-04-16", - "value": 164.2005466198294 - }, - { - "date": "2014-04-17", - "value": 165.77632203055697 - }, - { - "date": "2014-04-18", - "value": 168.99155761340631 - } -]
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/log.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/log.json deleted file mode 100644 index 1f57231..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/log.json +++ /dev/null @@ -1,802 +0,0 @@ -[ - { - "date": "2014-01-01", - "value": 2062.025150690567 - }, - { - "date": "2014-01-02", - "value": 9490.615524570567 - }, - { - "date": "2014-01-03", - "value": 49143.35242208582 - }, - { - "date": "2014-01-04", - "value": 83781.24929181556 - }, - { - "date": "2014-01-05", - "value": 109648.70666620035 - }, - { - "date": "2014-01-06", - "value": 46173.741222724544 - }, - { - "date": "2014-01-07", - "value": 165309.1825970328 - }, - { - "date": "2014-01-08", - "value": 134390.76197886752 - }, - { - "date": "2014-01-09", - "value": 382245.0764417244 - }, - { - "date": "2014-01-10", - "value": 261951.04021767154 - }, - { - "date": "2014-01-11", - "value": 365476.76967184874 - }, - { - "date": "2014-01-12", - "value": 307933.33112867293 - }, - { - "date": "2014-01-13", - "value": 122142.84412918231 - }, - { - "date": "2014-01-14", - "value": 439273.6427485952 - }, - { - "date": "2014-01-15", - "value": 283379.5623780852 - }, - { - "date": "2014-01-16", - "value": 238943.45026934962 - }, - { - "date": "2014-01-17", - "value": 363906.78317270277 - }, - { - "date": "2014-01-18", - "value": 1018001.8313018363 - }, - { - "date": "2014-01-19", - "value": 1138159.039774829 - }, - { - "date": "2014-01-20", - "value": 316399.43565288646 - }, - { - "date": "2014-01-21", - "value": 94835.07271610542 - }, - { - "date": "2014-01-22", - "value": 18781.513209857534 - }, - { - "date": "2014-01-23", - "value": 18249.48928239598 - }, - { - "date": "2014-01-24", - "value": 3999.643726105876 - }, - { - "date": "2014-01-25", - "value": 14221.763703455596 - }, - { - "date": "2014-01-26", - "value": 3444.9725583557893 - }, - { - "date": "2014-01-27", - "value": 7147.116251563855 - }, - { - "date": "2014-01-28", - "value": 14502.314013448287 - }, - { - "date": "2014-01-29", - "value": 44911.76232177228 - }, - { - "date": "2014-01-30", - "value": 122174.22764316449 - }, - { - "date": "2014-01-31", - "value": 54225.475099677475 - }, - { - "date": "2014-02-01", - "value": 29195.867918886433 - }, - { - "date": "2014-02-02", - "value": 30485.050577153477 - }, - { - "date": "2014-02-03", - "value": 4960.742108121759 - }, - { - "date": "2014-02-04", - "value": 5814.4040147487185 - }, - { - "date": "2014-02-05", - "value": 2075.4863124795897 - }, - { - "date": "2014-02-06", - "value": 11365.620177539273 - }, - { - "date": "2014-02-07", - "value": 6818.763378635227 - }, - { - "date": "2014-02-08", - "value": 7265.042372143863 - }, - { - "date": "2014-02-09", - "value": 1288.1919040639705 - }, - { - "date": "2014-02-10", - "value": 2903.318504081354 - }, - { - "date": "2014-02-11", - "value": 3476.3564765091846 - }, - { - "date": "2014-02-12", - "value": 428.6416126782084 - }, - { - "date": "2014-02-13", - "value": 4566.4372898258425 - }, - { - "date": "2014-02-14", - "value": 711.2536837438607 - }, - { - "date": "2014-02-15", - "value": 384.520808469771 - }, - { - "date": "2014-02-16", - "value": 126.37136078741982 - }, - { - "date": "2014-02-17", - "value": 1709.721519931354 - }, - { - "date": "2014-02-18", - "value": 10148.81839728999 - }, - { - "date": "2014-02-19", - "value": 3819.8318150089253 - }, - { - "date": "2014-02-20", - "value": 1911.5698109115874 - }, - { - "date": "2014-02-21", - "value": 1237.0465606485475 - }, - { - "date": "2014-02-22", - "value": 82.83456054447824 - }, - { - "date": "2014-02-23", - "value": 247.0567207206995 - }, - { - "date": "2014-02-24", - "value": 2203.4022567407605 - }, - { - "date": "2014-02-25", - "value": 200.68097764702628 - }, - { - "date": "2014-02-26", - "value": 1121.5673568474388 - }, - { - "date": "2014-02-27", - "value": 627.5130197784911 - }, - { - "date": "2014-02-28", - "value": 1962.9915978862207 - }, - { - "date": "2014-03-01", - "value": 4167.075152352931 - }, - { - "date": "2014-03-02", - "value": 3849.2422430353718 - }, - { - "date": "2014-03-03", - "value": 26024.15104428929 - }, - { - "date": "2014-03-04", - "value": 45516.77289686834 - }, - { - "date": "2014-03-05", - "value": 7027.573697798366 - }, - { - "date": "2014-03-06", - "value": 17669.906070121062 - }, - { - "date": "2014-03-07", - "value": 31044.119274296314 - }, - { - "date": "2014-03-08", - "value": 16408.707887136083 - }, - { - "date": "2014-03-09", - "value": 3892.134863935774 - }, - { - "date": "2014-03-10", - "value": 11938.967226184868 - }, - { - "date": "2014-03-11", - "value": 1553.5233934189364 - }, - { - "date": "2014-03-12", - "value": 11862.515702018087 - }, - { - "date": "2014-03-13", - "value": 11158.305407269254 - }, - { - "date": "2014-03-14", - "value": 1334.4016354870455 - }, - { - "date": "2014-03-15", - "value": 2187.7480927633233 - }, - { - "date": "2014-03-16", - "value": 4024.375328815201 - }, - { - "date": "2014-03-17", - "value": 2395.3870463434037 - }, - { - "date": "2014-03-18", - "value": 1087.1435238277254 - }, - { - "date": "2014-03-19", - "value": 677.9406955253385 - }, - { - "date": "2014-03-20", - "value": 1684.7330261245882 - }, - { - "date": "2014-03-21", - "value": 3009.7657573084657 - }, - { - "date": "2014-03-22", - "value": 13969.174225175822 - }, - { - "date": "2014-03-23", - "value": 68108.10656837105 - }, - { - "date": "2014-03-24", - "value": 188573.87239187933 - }, - { - "date": "2014-03-25", - "value": 559783.3612696081 - }, - { - "date": "2014-03-26", - "value": 209480.2451268065 - }, - { - "date": "2014-03-27", - "value": 139144.43213947577 - }, - { - "date": "2014-03-28", - "value": 365608.9134261734 - }, - { - "date": "2014-03-29", - "value": 320844.7892292448 - }, - { - "date": "2014-03-30", - "value": 211943.9255856596 - }, - { - "date": "2014-03-31", - "value": 762121.6146144189 - }, - { - "date": "2014-04-01", - "value": 1553918.287468606 - }, - { - "date": "2014-04-02", - "value": 2776190.8340374744 - }, - { - "date": "2014-04-03", - "value": 2132982.883619252 - }, - { - "date": "2014-04-04", - "value": 3034471.5222186935 - }, - { - "date": "2014-04-05", - "value": 8334267.184667878 - }, - { - "date": "2014-04-06", - "value": 19096849.199135397 - }, - { - "date": "2014-04-07", - "value": 35173655.63395549 - }, - { - "date": "2014-04-08", - "value": 35284088.03655991 - }, - { - "date": "2014-04-09", - "value": 15386352.945048828 - }, - { - "date": "2014-04-10", - "value": 16092176.925682666 - }, - { - "date": "2014-04-11", - "value": 17800747.264360324 - }, - { - "date": "2014-04-12", - "value": 9022272.93207202 - }, - { - "date": "2014-04-13", - "value": 19539255.318293292 - }, - { - "date": "2014-04-14", - "value": 18632765.170638006 - }, - { - "date": "2014-04-15", - "value": 22207773.697823893 - }, - { - "date": "2014-04-16", - "value": 20513350.14760112 - }, - { - "date": "2014-04-17", - "value": 8644588.740459614 - }, - { - "date": "2014-04-18", - "value": 3866972.7646409343 - }, - { - "date": "2014-04-19", - "value": 8627791.327706825 - }, - { - "date": "2014-04-20", - "value": 21876288.3070209 - }, - { - "date": "2014-04-21", - "value": 13065156.692366121 - }, - { - "date": "2014-04-22", - "value": 7006977.18803938 - }, - { - "date": "2014-04-23", - "value": 7322004.070875965 - }, - { - "date": "2014-04-24", - "value": 9144087.906869492 - }, - { - "date": "2014-04-25", - "value": 15712634.308609735 - }, - { - "date": "2014-04-26", - "value": 11675332.990584275 - }, - { - "date": "2014-04-27", - "value": 5276441.428244869 - }, - { - "date": "2014-04-28", - "value": 2098065.0498573617 - }, - { - "date": "2014-04-29", - "value": 4274196.893315845 - }, - { - "date": "2014-04-30", - "value": 6837182.692798125 - }, - { - "date": "2014-05-01", - "value": 5762561.20563913 - }, - { - "date": "2014-05-02", - "value": 8597818.493391953 - }, - { - "date": "2014-05-03", - "value": 15162543.40157677 - }, - { - "date": "2014-05-04", - "value": 10330812.046296848 - }, - { - "date": "2014-05-05", - "value": 8535447.031729257 - }, - { - "date": "2014-05-06", - "value": 3486240.413358828 - }, - { - "date": "2014-05-07", - "value": 2402788.773306244 - }, - { - "date": "2014-05-08", - "value": 2289950.291292259 - }, - { - "date": "2014-05-09", - "value": 3518464.1366947945 - }, - { - "date": "2014-05-10", - "value": 2218638.123249026 - }, - { - "date": "2014-05-11", - "value": 3024707.6308568935 - }, - { - "date": "2014-05-12", - "value": 1481284.8173510565 - }, - { - "date": "2014-05-13", - "value": 3804459.7482742644 - }, - { - "date": "2014-05-14", - "value": 3166547.5499812495 - }, - { - "date": "2014-05-15", - "value": 1244140.8712990445 - }, - { - "date": "2014-05-16", - "value": 1176461.8065991711 - }, - { - "date": "2014-05-17", - "value": 348538.1604919795 - }, - { - "date": "2014-05-18", - "value": 630138.4502415754 - }, - { - "date": "2014-05-19", - "value": 263415.04074479925 - }, - { - "date": "2014-05-20", - "value": 316526.39152859966 - }, - { - "date": "2014-05-21", - "value": 429475.93857651815 - }, - { - "date": "2014-05-22", - "value": 1384523.2440813945 - }, - { - "date": "2014-05-23", - "value": 1422251.2082510514 - }, - { - "date": "2014-05-24", - "value": 2982780.2273946116 - }, - { - "date": "2014-05-25", - "value": 1592004.698676512 - }, - { - "date": "2014-05-26", - "value": 705823.7238808231 - }, - { - "date": "2014-05-27", - "value": 382341.76239653886 - }, - { - "date": "2014-05-28", - "value": 117304.37608341743 - }, - { - "date": "2014-05-29", - "value": 103270.103426627 - }, - { - "date": "2014-05-30", - "value": 189088.38503418514 - }, - { - "date": "2014-05-31", - "value": 67547.73907513174 - }, - { - "date": "2014-06-01", - "value": 152445.22088057562 - }, - { - "date": "2014-06-02", - "value": 616622.4572364822 - }, - { - "date": "2014-06-03", - "value": 1330103.0525501214 - }, - { - "date": "2014-06-04", - "value": 4077706.361059827 - }, - { - "date": "2014-06-05", - "value": 4338332.117707394 - }, - { - "date": "2014-06-06", - "value": 9626054.268217776 - }, - { - "date": "2014-06-07", - "value": 6269805.105786423 - }, - { - "date": "2014-06-08", - "value": 2834343.2338959207 - }, - { - "date": "2014-06-09", - "value": 2175015.158688689 - }, - { - "date": "2014-06-10", - "value": 812456.163680258 - }, - { - "date": "2014-06-11", - "value": 2175163.4473366365 - }, - { - "date": "2014-06-12", - "value": 3808510.5886766836 - }, - { - "date": "2014-06-13", - "value": 5640689.343213645 - }, - { - "date": "2014-06-14", - "value": 4790537.231192042 - }, - { - "date": "2014-06-15", - "value": 4120824.1460910775 - }, - { - "date": "2014-06-16", - "value": 5302994.492796655 - }, - { - "date": "2014-06-17", - "value": 5186664.730492513 - }, - { - "date": "2014-06-18", - "value": 4044030.4941446534 - }, - { - "date": "2014-06-19", - "value": 8581214.856586913 - }, - { - "date": "2014-06-20", - "value": 15013739.74932458 - }, - { - "date": "2014-06-21", - "value": 5719554.417262289 - }, - { - "date": "2014-06-22", - "value": 2453002.234262133 - }, - { - "date": "2014-06-23", - "value": 7264081.292628654 - }, - { - "date": "2014-06-24", - "value": 3809522.1941388543 - }, - { - "date": "2014-06-25", - "value": 2357350.1101749516 - }, - { - "date": "2014-06-26", - "value": 1451776.5422490966 - }, - { - "date": "2014-06-27", - "value": 1951158.0790648684 - }, - { - "date": "2014-06-28", - "value": 942477.7660032308 - }, - { - "date": "2014-06-29", - "value": 284438.3044602669 - }, - { - "date": "2014-06-30", - "value": 395774.63111623266 - }, - { - "date": "2014-07-01", - "value": 181209.66166852613 - }, - { - "date": "2014-07-02", - "value": 99093.59454012293 - }, - { - "date": "2014-07-03", - "value": 112785.84621170859 - }, - { - "date": "2014-07-04", - "value": 268022.501587529 - }, - { - "date": "2014-07-05", - "value": 624290.8018990511 - }, - { - "date": "2014-07-06", - "value": 836181.367972055 - }, - { - "date": "2014-07-07", - "value": 565108.5866839852 - }, - { - "date": "2014-07-08", - "value": 293702.2823721791 - }, - { - "date": "2014-07-09", - "value": 128190.39198775633 - }, - { - "date": "2014-07-10", - "value": 57180.40753508925 - }, - { - "date": "2014-07-11", - "value": 62878.27977730392 - }, - { - "date": "2014-07-12", - "value": 204999.77253837787 - }, - { - "date": "2014-07-13", - "value": 95022.40040256473 - }, - { - "date": "2014-07-14", - "value": 41401.200972437386 - }, - { - "date": "2014-07-15", - "value": 183846.47705915576 - }, - { - "date": "2014-07-16", - "value": 114247.21116015536 - }, - { - "date": "2014-07-17", - "value": 34743.36459470002 - }, - { - "date": "2014-07-18", - "value": 11872.77812834004 - }, - { - "date": "2014-07-19", - "value": 28822.077421492377 - } -]
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/make_fake_data.py b/priv/static/metrics-graphics-3.0-alpha3/examples/data/make_fake_data.py deleted file mode 100644 index f350eab..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/make_fake_data.py +++ /dev/null @@ -1,56 +0,0 @@ -import sys -from datetime import datetime, date, timedelta -import json -from random import random -import argparse - -parser = argparse.ArgumentParser(description="Fake data maker.") -parser.add_argument('-s', '--start', help="start date", nargs=1) -parser.add_argument('-d', '--small', help="allow decimal values", action="store_true") -parser.add_argument('-r', '--range', help="how many days from start date", nargs=1) -parser.add_argument('-m', '--magnitude', help="size of change", nargs=1) -parser.add_argument('-p', '--percentage', help="whether or not this is a percentage", action="store_true") -parser.add_argument('-n', '--let_negative', help="let the data values go negative", action="store_true") -parser.add_argument('-v', '--start_value', help='start value', nargs=1) -args = parser.parse_args() - -doy = { - 0: 1, - 1:.9, - 2:1, - 3:1.1, - 4:1.05, - 5:.7, - 6:.75 -} -if args.percentage: convert = lambda x: float(x) -elif args.small: convert = lambda x: float(x) -else: convert = lambda x: int(x) - -current_date = datetime.strptime(args.start[0], '%Y-%m-%d').date() -length = int(args.range[0]) - -baseline = convert(args.start_value[0]) - -if args.magnitude: magnitude = convert(args.magnitude[0]) -elif args.percentage: magnitude = baseline/50. -elif args.small: magnitude = baseline/20. -else: magnitude = baseline/5 -out = [] - -# Needed to automatically convert dates to strings in json. -dthandler = lambda obj: obj.isoformat() if isinstance(obj, date) else None - -for i in xrange(length): - out.append({'date': current_date, 'value': baseline}) - nb = convert(magnitude * (random()-.5)) - if args.percentage: - if (baseline+nb < 0 or baseline+nb > 1) and (not args.let_negative): pass - else: baseline += nb - else: - if baseline+nb < 0 and not args.let_negative: pass - else: baseline += nb - - current_date += timedelta(days=1) - -sys.stdout.write(json.dumps(out,default=dthandler, indent=4))
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/missing-is-hidden-accessor.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/missing-is-hidden-accessor.json deleted file mode 100644 index 088ec47..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/missing-is-hidden-accessor.json +++ /dev/null @@ -1,57 +0,0 @@ - - [ - { - "date": "2014-01-08", - "value": 500 - }, - { - "date": "2014-01-09", - "value": 500 - }, - { - "date": "2014-01-10", - "value": 400 - }, - { - "date": "2014-01-11", - "value": 500, - "dead": true - }, - { - "date": "2014-01-12", - "value": 400 - }, - { - "date": "2014-01-13", - "value": 430 - }, - { - "date": "2014-01-14", - "value": 410 - }, - { - "date": "2014-01-15", - "value": 200, - "dead": true - }, - { - "date": "2014-01-16", - "value": 500 - }, - { - "date": "2014-01-17", - "value": 100 - }, - { - "date": "2014-01-18", - "value": 30 - }, - { - "date": "2014-01-19", - "value": 300 - }, - { - "date": "2014-01-20", - "value": 200 - } - ] diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/missing-is-hidden-multi.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/missing-is-hidden-multi.json deleted file mode 100644 index e64a30b..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/missing-is-hidden-multi.json +++ /dev/null @@ -1,1436 +0,0 @@ -[ - [ - { - "date": "2014-01-01", - "value": 10000000 - }, - { - "date": "2014-01-02", - "value": 10379978 - }, - { - "date": "2014-01-03", - "value": 10493749 - }, - { - "date": "2014-01-04", - "value": 10785250 - }, - { - "date": "2014-01-08", - "value": 15177211 - }, - { - "date": "2014-01-09", - "value": 16622100 - }, - { - "date": "2014-01-10", - "value": 17381072 - }, - { - "date": "2014-01-11", - "value": 18802310 - }, - { - "date": "2014-01-12", - "value": 15531790 - }, - { - "date": "2014-01-13", - "value": 15748881 - }, - { - "date": "2014-01-14", - "value": 18706437 - }, - { - "date": "2014-01-15", - "value": 19752685 - }, - { - "date": "2014-01-16", - "value": 21016418 - }, - { - "date": "2014-01-17", - "value": 25622924 - }, - { - "date": "2014-01-18", - "value": 25337480 - }, - { - "date": "2014-01-19", - "value": 22258882 - }, - { - "date": "2014-01-20", - "value": 23829538 - }, - { - "date": "2014-01-21", - "value": 24245689 - }, - { - "date": "2014-01-22", - "value": 26429711 - }, - { - "date": "2014-01-23", - "value": 26259017 - }, - { - "date": "2014-01-24", - "value": 25396183 - }, - { - "date": "2014-01-25", - "value": 23107346 - }, - { - "date": "2014-01-26", - "value": 28659852 - }, - { - "date": "2014-01-27", - "value": 25270783 - }, - { - "date": "2014-01-28", - "value": 26270783 - }, - { - "date": "2014-01-29", - "value": 27270783 - }, - { - "date": "2014-01-30", - "value": 28270783 - }, - { - "date": "2014-01-31", - "value": 29270783 - }, - { - "date": "2014-02-01", - "value": 30270783 - }, - { - "date": "2014-02-02", - "value": 31270783 - }, - { - "date": "2014-02-03", - "value": 32270783 - }, - { - "date": "2014-02-04", - "value": 33270783 - }, - { - "date": "2014-02-05", - "value": 28270783 - }, - { - "date": "2014-02-06", - "value": 27270783 - }, - { - "date": "2014-02-07", - "value": 35270783 - }, - { - "date": "2014-02-08", - "value": 34270783 - }, - { - "date": "2014-02-09", - "value": 28270783 - }, - { - "date": "2014-02-10", - "value": 35270783 - }, - { - "date": "2014-02-11", - "value": 36270783 - }, - { - "date": "2014-02-12", - "value": 34127078 - }, - { - "date": "2014-02-13", - "value": 33124078 - }, - { - "date": "2014-02-14", - "value": 36227078 - }, - { - "date": "2014-02-15", - "value": 37827078 - }, - { - "date": "2014-02-16", - "value": 36427073 - }, - { - "date": "2014-02-17", - "value": 37570783 - }, - { - "date": "2014-02-18", - "value": 38627073 - }, - { - "date": "2014-02-19", - "value": 37727078 - }, - { - "date": "2014-02-20", - "value": 38827073 - }, - { - "date": "2014-02-21", - "value": 40927078 - }, - { - "date": "2014-02-22", - "value": 41027078 - }, - { - "date": "2014-02-23", - "value": 42127073 - }, - { - "date": "2014-02-24", - "value": 43220783 - }, - { - "date": "2014-02-25", - "value": 44327078 - }, - { - "date": "2014-02-26", - "value": 40427078 - }, - { - "date": "2014-02-27", - "value": 41027078 - }, - { - "date": "2014-02-28", - "value": 45627078 - }, - { - "date": "2014-03-01", - "value": 44727078 - }, - { - "date": "2014-03-02", - "value": 44227078 - }, - { - "date": "2014-03-03", - "value": 45227078 - }, - { - "date": "2014-03-04", - "value": 46027078 - }, - { - "date": "2014-03-05", - "value": 46927078 - }, - { - "date": "2014-03-06", - "value": 47027078 - }, - { - "date": "2014-03-07", - "value": 46227078 - }, - { - "date": "2014-03-08", - "value": 47027078 - }, - { - "date": "2014-03-09", - "value": 48027078 - }, - { - "date": "2014-03-10", - "value": 47027078 - }, - { - "date": "2014-03-11", - "value": 47027078 - }, - { - "date": "2014-03-12", - "value": 48017078 - }, - { - "date": "2014-03-13", - "value": 48077078 - }, - { - "date": "2014-03-14", - "value": 48087078 - }, - { - "date": "2014-03-15", - "value": 48017078 - }, - { - "date": "2014-03-16", - "value": 48047078 - }, - { - "date": "2014-03-17", - "value": 48067078 - }, - { - "date": "2014-03-18", - "value": 48077078 - }, - { - "date": "2014-03-19", - "value": 48027074 - }, - { - "date": "2014-03-20", - "value": 48927079 - }, - { - "date": "2014-03-21", - "value": 48727071 - }, - { - "date": "2014-03-22", - "value": 48127072 - }, - { - "date": "2014-03-23", - "value": 48527072 - }, - { - "date": "2014-03-24", - "value": 48627027 - }, - { - "date": "2014-03-25", - "value": 48027040 - }, - { - "date": "2014-03-26", - "value": 48027043 - }, - { - "date": "2014-03-27", - "value": 48057022 - }, - { - "date": "2014-03-28", - "value": 49057022 - }, - { - "date": "2014-03-29", - "value": 50057022 - }, - { - "date": "2014-03-30", - "value": 51057022 - }, - { - "date": "2014-03-31", - "value": 52057022 - }, - { - "date": "2014-04-01", - "value": 53057022 - }, - { - "date": "2014-04-02", - "value": 54057022 - }, - { - "date": "2014-04-03", - "value": 52057022 - }, - { - "date": "2014-04-04", - "value": 55057022 - }, - { - "date": "2014-04-05", - "value": 58270783 - }, - { - "date": "2014-04-06", - "value": 56270783 - }, - { - "date": "2014-04-07", - "value": 55270783 - }, - { - "date": "2014-04-08", - "value": 58270783 - }, - { - "date": "2014-04-09", - "value": 59270783 - }, - { - "date": "2014-04-10", - "value": 60270783 - }, - { - "date": "2014-04-11", - "value": 61270783 - }, - { - "date": "2014-04-12", - "value": 62270783 - }, - { - "date": "2014-04-13", - "value": 63270783 - }, - { - "date": "2014-04-14", - "value": 64270783 - }, - { - "date": "2014-04-15", - "value": 65270783 - }, - { - "date": "2014-04-16", - "value": 66270783 - }, - { - "date": "2014-04-17", - "value": 67270783 - }, - { - "date": "2014-04-18", - "value": 68270783 - }, - { - "date": "2014-04-19", - "value": 69270783 - }, - { - "date": "2014-04-20", - "value": 70270783 - }, - { - "date": "2014-04-21", - "value": 71270783 - }, - { - "date": "2014-04-22", - "value": 72270783 - }, - { - "date": "2014-04-23", - "value": 73270783 - }, - { - "date": "2014-04-24", - "value": 74270783 - }, - { - "date": "2014-04-25", - "value": 75270783 - }, - { - "date": "2014-04-26", - "value": 76660783 - }, - { - "date": "2014-04-27", - "value": 77270783 - }, - { - "date": "2014-04-28", - "value": 78370783 - }, - { - "date": "2014-04-29", - "value": 79470783 - }, - { - "date": "2014-04-30", - "value": 80170783 - } - ], - [ - { - "date": "2014-01-01", - "value": 150000000 - }, - { - "date": "2014-01-02", - "value": 160379978 - }, - { - "date": "2014-01-03", - "value": 170493749 - }, - { - "date": "2014-01-04", - "value": 160785250 - }, - { - "date": "2014-01-05", - "value": 167391904 - }, - { - "date": "2014-01-06", - "value": 161576838 - }, - { - "date": "2014-01-07", - "value": 161413854 - }, - { - "date": "2014-01-08", - "value": 152177211 - }, - { - "date": "2014-01-09", - "value": 143762210 - }, - { - "date": "2014-01-10", - "value": 144381072 - }, - { - "date": "2014-01-11", - "value": 154352310 - }, - { - "date": "2014-01-12", - "value": 165531790 - }, - { - "date": "2014-01-13", - "value": 175748881 - }, - { - "date": "2014-01-14", - "value": 187064037 - }, - { - "date": "2014-01-15", - "value": 197520685 - }, - { - "date": "2014-01-16", - "value": 210176418 - }, - { - "date": "2014-01-17", - "value": 196122924 - }, - { - "date": "2014-01-18", - "value": 207337480 - }, - { - "date": "2014-01-19", - "value": 200258882 - }, - { - "date": "2014-01-20", - "value": 186829538 - }, - { - "date": "2014-01-21", - "value": 192456897 - }, - { - "date": "2014-01-22", - "value": 204299711 - }, - { - "date": "2014-01-23", - "value": 192759017 - }, - { - "date": "2014-01-24", - "value": 203596183 - }, - { - "date": "2014-01-25", - "value": 208107346 - }, - { - "date": "2014-01-26", - "value": 196359852 - }, - { - "date": "2014-01-27", - "value": 192570783 - }, - { - "date": "2014-01-28", - "value": 177967768 - }, - { - "date": "2014-01-29", - "value": 190632803 - }, - { - "date": "2014-01-30", - "value": 203725316 - }, - { - "date": "2014-01-31", - "value": 218226177 - }, - { - "date": "2014-02-01", - "value": 210698669 - }, - { - "date": "2014-02-02", - "value": 217640656 - }, - { - "date": "2014-02-03", - "value": 216142362 - }, - { - "date": "2014-02-04", - "value": 201410971 - }, - { - "date": "2014-02-05", - "value": 196704289 - }, - { - "date": "2014-02-06", - "value": 190436945 - }, - { - "date": "2014-02-07", - "value": 178891686 - }, - { - "date": "2014-02-08", - "value": 171613962 - }, - { - "date": "2014-02-09", - "value": 157579773 - }, - { - "date": "2014-02-10", - "value": 158677098 - }, - { - "date": "2014-02-11", - "value": 147129977 - }, - { - "date": "2014-02-12", - "value": 151561876 - }, - { - "date": "2014-02-13", - "value": 151627421 - }, - { - "date": "2014-02-14", - "value": 143543872 - }, - { - "date": "2014-02-15", - "value": 136581057 - }, - { - "date": "2014-02-16", - "value": 135560715 - }, - { - "date": "2014-02-17", - "value": 122625263 - }, - { - "date": "2014-02-18", - "value": 112091484 - }, - { - "date": "2014-02-19", - "value": 98810329 - }, - { - "date": "2014-02-20", - "value": 99882912 - }, - { - "date": "2014-02-21", - "value": 94943095 - }, - { - "date": "2014-02-22", - "value": 104875743 - }, - { - "date": "2014-02-23", - "value": 116383678 - }, - { - "date": "2014-02-24", - "value": 125028841 - }, - { - "date": "2014-02-25", - "value": 123967310 - }, - { - "date": "2014-02-26", - "value": 133167029 - }, - { - "date": "2014-02-27", - "value": 128577263 - }, - { - "date": "2014-02-28", - "value": 115836969 - }, - { - "date": "2014-03-01", - "value": 119264529 - }, - { - "date": "2014-03-02", - "value": 109363374 - }, - { - "date": "2014-03-03", - "value": 113985628 - }, - { - "date": "2014-03-04", - "value": 114650999 - }, - { - "date": "2014-03-05", - "value": 110866108 - }, - { - "date": "2014-03-06", - "value": 96473454 - }, - { - "date": "2014-03-07", - "value": 104075886 - }, - { - "date": "2014-03-08", - "value": 103568384 - }, - { - "date": "2014-03-09", - "value": 101534883 - }, - { - "date": "2014-03-10", - "value": 115825447 - }, - { - "date": "2014-03-11", - "value": 126133916 - }, - { - "date": "2014-03-12", - "value": 116502109 - }, - { - "date": "2014-03-13", - "value": 130169411 - }, - { - "date": "2014-03-14", - "value": 124296886 - }, - { - "date": "2014-03-15", - "value": 126347399 - }, - { - "date": "2014-03-16", - "value": 131483669 - }, - { - "date": "2014-03-17", - "value": 142811333 - }, - { - "date": "2014-03-18", - "value": 129675396 - }, - { - "date": "2014-03-19", - "value": 115514483 - }, - { - "date": "2014-03-20", - "value": 117630630 - }, - { - "date": "2014-03-21", - "value": 122340239 - }, - { - "date": "2014-03-22", - "value": 132349091 - }, - { - "date": "2014-03-23", - "value": 125613305 - }, - { - "date": "2014-03-24", - "value": 135592466 - }, - { - "date": "2014-03-25", - "value": 123408762 - }, - { - "date": "2014-03-26", - "value": 111991454 - }, - { - "date": "2014-03-27", - "value": 116123955 - }, - { - "date": "2014-03-28", - "value": 112817214 - }, - { - "date": "2014-03-29", - "value": 113029590 - }, - { - "date": "2014-03-30", - "value": 108753398 - }, - { - "date": "2014-03-31", - "value": 99383763 - }, - { - "date": "2014-04-01", - "value": 100151737 - }, - { - "date": "2014-04-02", - "value": 94985209 - }, - { - "date": "2014-04-03", - "value": 82913669 - }, - { - "date": "2014-04-04", - "value": 78748268 - }, - { - "date": "2014-04-05", - "value": 63829135 - }, - { - "date": "2014-04-06", - "value": 78694727 - }, - { - "date": "2014-04-07", - "value": 80868994 - }, - { - "date": "2014-04-08", - "value": 93799013 - }, - { - "date": "2014-04-09", - "value": 99042416 - }, - { - "date": "2014-04-10", - "value": 97298692 - }, - { - "date": "2014-04-11", - "value": 83353499 - }, - { - "date": "2014-04-12", - "value": 71248129 - }, - { - "date": "2014-04-13", - "value": 75253744 - }, - { - "date": "2014-04-14", - "value": 68976648 - }, - { - "date": "2014-04-15", - "value": 71002284 - }, - { - "date": "2014-04-16", - "value": 75052401 - }, - { - "date": "2014-04-17", - "value": 83894030 - }, - { - "date": "2014-04-18", - "value": 90236528 - }, - { - "date": "2014-04-19", - "value": 99739114 - }, - { - "date": "2014-04-20", - "value": 96407136 - }, - { - "date": "2014-04-21", - "value": 108323177 - }, - { - "date": "2014-04-22", - "value": 101578914 - }, - { - "date": "2014-04-23", - "value": 115877608 - }, - { - "date": "2014-04-24", - "value": 112088857 - }, - { - "date": "2014-04-25", - "value": 112071353 - }, - { - "date": "2014-04-26", - "value": 101790062 - }, - { - "date": "2014-04-27", - "value": 115003761 - }, - { - "date": "2014-04-28", - "value": 120457727 - }, - { - "date": "2014-04-29", - "value": 118253926 - }, - { - "date": "2014-04-30", - "value": 117956992 - } - ], - [ - { - "date": "2014-01-01", - "value": 60000000 - }, - { - "date": "2014-01-02", - "value": 60379978 - }, - { - "date": "2014-01-03", - "value": 40493749 - }, - { - "date": "2014-01-04", - "value": 60785250 - }, - { - "date": "2014-01-05", - "value": 67391904 - }, - { - "date": "2014-01-06", - "value": 61576838 - }, - { - "date": "2014-01-07", - "value": 61413854 - }, - { - "date": "2014-01-08", - "value": 82177211 - }, - { - "date": "2014-01-09", - "value": 103762210 - }, - { - "date": "2014-01-10", - "value": 84381072 - }, - { - "date": "2014-01-11", - "value": 54352310 - }, - { - "date": "2014-01-12", - "value": 65531790 - }, - { - "date": "2014-01-13", - "value": 75748881 - }, - { - "date": "2014-01-14", - "value": 47064037 - }, - { - "date": "2014-01-15", - "value": 67520685 - }, - { - "date": "2014-01-16", - "value": 60176418 - }, - { - "date": "2014-01-17", - "value": 66122924 - }, - { - "date": "2014-01-18", - "value": 57337480 - }, - { - "date": "2014-01-19", - "value": 100258882 - }, - { - "date": "2014-01-20", - "value": 46829538 - }, - { - "date": "2014-01-21", - "value": 92456897 - }, - { - "date": "2014-01-22", - "value": 94299711 - }, - { - "date": "2014-01-23", - "value": 62759017 - }, - { - "date": "2014-01-24", - "value": 103596183 - }, - { - "date": "2014-01-25", - "value": 108107346 - }, - { - "date": "2014-01-26", - "value": 66359852 - }, - { - "date": "2014-01-27", - "value": 62570783 - }, - { - "date": "2014-01-28", - "value": 77967768 - }, - { - "date": "2014-01-29", - "value": 60632803 - }, - { - "date": "2014-01-30", - "value": 103725316 - }, - { - "date": "2014-01-31", - "value": 98226177 - }, - { - "date": "2014-02-01", - "value": 60698669 - }, - { - "date": "2014-02-02", - "value": 67640656 - }, - { - "date": "2014-02-03", - "value": 66142362 - }, - { - "date": "2014-02-04", - "value": 101410971 - }, - { - "date": "2014-02-05", - "value": 66704289 - }, - { - "date": "2014-02-06", - "value": 60436945 - }, - { - "date": "2014-02-07", - "value": 78891686 - }, - { - "date": "2014-02-08", - "value": 71613962 - }, - { - "date": "2014-02-09", - "value": 107579773 - }, - { - "date": "2014-02-10", - "value": 58677098 - }, - { - "date": "2014-02-11", - "value": 87129977 - }, - { - "date": "2014-02-12", - "value": 51561876 - }, - { - "date": "2014-02-13", - "value": 51627421 - }, - { - "date": "2014-02-14", - "value": 83543872 - }, - { - "date": "2014-02-15", - "value": 66581057 - }, - { - "date": "2014-02-16", - "value": 65560715 - }, - { - "date": "2014-02-17", - "value": 62625263 - }, - { - "date": "2014-02-18", - "value": 92091484 - }, - { - "date": "2014-02-19", - "value": 48810329 - }, - { - "date": "2014-02-20", - "value": 49882912 - }, - { - "date": "2014-02-21", - "value": 44943095 - }, - { - "date": "2014-02-22", - "value": 104875743 - }, - { - "date": "2014-02-23", - "value": 96383678 - }, - { - "date": "2014-02-24", - "value": 105028841 - }, - { - "date": "2014-02-25", - "value": 63967310 - }, - { - "date": "2014-02-26", - "value": 63167029 - }, - { - "date": "2014-02-27", - "value": 68577263 - }, - { - "date": "2014-02-28", - "value": 95836969 - }, - { - "date": "2014-03-01", - "value": 99264529 - }, - { - "date": "2014-03-02", - "value": 109363374 - }, - { - "date": "2014-03-03", - "value": 93985628 - }, - { - "date": "2014-03-04", - "value": 94650999 - }, - { - "date": "2014-03-05", - "value": 90866108 - }, - { - "date": "2014-03-06", - "value": 46473454 - }, - { - "date": "2014-03-07", - "value": 84075886 - }, - { - "date": "2014-03-08", - "value": 103568384 - }, - { - "date": "2014-03-09", - "value": 101534883 - }, - { - "date": "2014-03-10", - "value": 95825447 - }, - { - "date": "2014-03-11", - "value": 66133916 - }, - { - "date": "2014-03-12", - "value": 96502109 - }, - { - "date": "2014-03-13", - "value": 80169411 - }, - { - "date": "2014-03-14", - "value": 84296886 - }, - { - "date": "2014-03-15", - "value": 86347399 - }, - { - "date": "2014-03-16", - "value": 31483669 - }, - { - "date": "2014-03-17", - "value": 82811333 - }, - { - "date": "2014-03-18", - "value": 89675396 - }, - { - "date": "2014-03-19", - "value": 95514483 - }, - { - "date": "2014-03-20", - "value": 97630630 - }, - { - "date": "2014-03-21", - "value": 62340239 - }, - { - "date": "2014-03-22", - "value": 62349091 - }, - { - "date": "2014-03-23", - "value": 65613305 - }, - { - "date": "2014-03-24", - "value": 65592466 - }, - { - "date": "2014-03-25", - "value": 63408762 - }, - { - "date": "2014-03-26", - "value": 91991454 - }, - { - "date": "2014-03-27", - "value": 96123955 - }, - { - "date": "2014-03-28", - "value": 92817214 - }, - { - "date": "2014-03-29", - "value": 93029590 - }, - { - "date": "2014-03-30", - "value": 108753398 - }, - { - "date": "2014-03-31", - "value": 49383763 - }, - { - "date": "2014-04-01", - "value": 100151737 - }, - { - "date": "2014-04-02", - "value": 44985209 - }, - { - "date": "2014-04-03", - "value": 52913669 - }, - { - "date": "2014-04-04", - "value": 48748268 - }, - { - "date": "2014-04-05", - "value": 23829135 - }, - { - "date": "2014-04-06", - "value": 58694727 - }, - { - "date": "2014-04-07", - "value": 50868994 - }, - { - "date": "2014-04-08", - "value": 43799013 - }, - { - "date": "2014-04-09", - "value": 4042416 - }, - { - "date": "2014-04-10", - "value": 47298692 - }, - { - "date": "2014-04-11", - "value": 53353499 - }, - { - "date": "2014-04-12", - "value": 71248129 - }, - { - "date": "2014-04-13", - "value": 75253744 - }, - { - "date": "2014-04-14", - "value": 68976648 - }, - { - "date": "2014-04-15", - "value": 71002284 - }, - { - "date": "2014-04-16", - "value": 75052401 - }, - { - "date": "2014-04-17", - "value": 83894030 - }, - { - "date": "2014-04-18", - "value": 50236528 - }, - { - "date": "2014-04-19", - "value": 59739114 - }, - { - "date": "2014-04-20", - "value": 56407136 - }, - { - "date": "2014-04-21", - "value": 108323177 - }, - { - "date": "2014-04-22", - "value": 101578914 - }, - { - "date": "2014-04-23", - "value": 95877608 - }, - { - "date": "2014-04-24", - "value": 62088857 - }, - { - "date": "2014-04-25", - "value": 92071353 - }, - { - "date": "2014-04-26", - "value": 81790062 - }, - { - "date": "2014-04-27", - "value": 105003761 - }, - { - "date": "2014-04-28", - "value": 100457727 - }, - { - "date": "2014-04-29", - "value": 98253926 - }, - { - "date": "2014-04-30", - "value": 67956992 - } - ] -]
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/missing-is-hidden.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/missing-is-hidden.json deleted file mode 100644 index 582d08a..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/missing-is-hidden.json +++ /dev/null @@ -1,39 +0,0 @@ - - [ - { - "date": "2014-01-08", - "value": 500 - }, - { - "date": "2014-01-09", - "value": 500 - }, - { - "date": "2014-01-10", - "value": 400 - }, - { - "date": "2014-02-12", - "value": 500 - }, - { - "date": "2014-02-13", - "value": 100 - }, - { - "date": "2014-02-14", - "value": null - }, - { - "date": "2014-02-15", - "value": 30 - }, - { - "date": "2014-02-16", - "value": 300 - }, - { - "date": "2014-02-17", - "value": 200 - } - ] diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/missing-y.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/missing-y.json deleted file mode 100644 index 9ec8f18..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/missing-y.json +++ /dev/null @@ -1,35 +0,0 @@ - - [ - { - "date": "2014-01-08", - "value": 500 - }, - { - "date": "2014-01-12", - "value": 500 - }, - { - "date": "2014-01-19", - "value": 2000 - }, - { - "date": "2014-01-20", - "value": 2200 - }, - { - "date": "2014-01-21", - "value": 2300 - }, - { - "date": "2014-04-23", - "value": 500 - }, - { - "date": "2014-04-24", - "value": 1500 - }, - { - "date": "2014-04-25", - "value": 3000 - } - ] diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/multiline.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/multiline.json deleted file mode 100644 index 90102ba..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/multiline.json +++ /dev/null @@ -1,902 +0,0 @@ -[ - { - "date": "2013-11-30", - "value3": 40770, - "value2": 38327, - "value1": 43564 - }, - { - "date": "2013-12-01", - "value3": 39705, - "value2": 39998, - "value1": 43104 - }, - { - "date": "2013-12-02", - "value3": 39209, - "value2": 40158, - "value1": 40300 - }, - { - "date": "2013-12-03", - "value3": 35539, - "value2": 37155, - "value1": 37078 - }, - { - "date": "2013-12-04", - "value3": 33231, - "value2": 37554, - "value1": 38526 - }, - { - "date": "2013-12-05", - "value3": 29792, - "value2": 40383, - "value1": 36456 - }, - { - "date": "2013-12-06", - "value3": 33533, - "value2": 42351, - "value1": 39354 - }, - { - "date": "2013-12-07", - "value3": 31903, - "value2": 45058, - "value1": 42378 - }, - { - "date": "2013-12-08", - "value3": 30748, - "value2": 47100, - "value1": 38812 - }, - { - "date": "2013-12-09", - "value3": 30380, - "value2": 44866, - "value1": 37220 - }, - { - "date": "2013-12-10", - "value3": 29189, - "value2": 41967, - "value1": 39755 - }, - { - "date": "2013-12-11", - "value3": 31210, - "value2": 39328, - "value1": 40757 - }, - { - "date": "2013-12-12", - "value3": 35036, - "value2": 35949, - "value1": 39377 - }, - { - "date": "2013-12-13", - "value3": 35619, - "value2": 33159, - "value1": 38073 - }, - { - "date": "2013-12-14", - "value3": 36377, - "value2": 33589, - "value1": 35086 - }, - { - "date": "2013-12-15", - "value3": 38730, - "value2": 33746, - "value1": 34582 - }, - { - "date": "2013-12-16", - "value3": 34850, - "value2": 36825, - "value1": 36423 - }, - { - "date": "2013-12-17", - "value3": 33172, - "value2": 38092, - "value1": 37563 - }, - { - "date": "2013-12-18", - "value3": 29390, - "value2": 36368, - "value1": 38391 - }, - { - "date": "2013-12-19", - "value3": 27097, - "value2": 32403, - "value1": 38486 - }, - { - "date": "2013-12-20", - "value3": 25922, - "value2": 35803, - "value1": 35076 - }, - { - "date": "2013-12-21", - "value3": 29734, - "value2": 37922, - "value1": 32287 - }, - { - "date": "2013-12-22", - "value3": 31860, - "value2": 35274, - "value1": 28294 - }, - { - "date": "2013-12-23", - "value3": 29052, - "value2": 35216, - "value1": 31195 - }, - { - "date": "2013-12-24", - "value3": 27400, - "value2": 35466, - "value1": 28475 - }, - { - "date": "2013-12-25", - "value3": 29042, - "value2": 33327, - "value1": 26174 - }, - { - "date": "2013-12-26", - "value3": 28410, - "value2": 35632, - "value1": 28177 - }, - { - "date": "2013-12-27", - "value3": 27045, - "value2": 35348, - "value1": 28660 - }, - { - "date": "2013-12-28", - "value3": 26506, - "value2": 37153, - "value1": 27007 - }, - { - "date": "2013-12-29", - "value3": 26331, - "value2": 35442, - "value1": 29527 - }, - { - "date": "2013-12-30", - "value3": 23209, - "value2": 37541, - "value1": 30305 - }, - { - "date": "2013-12-31", - "value3": 24124, - "value2": 34335, - "value1": 32349 - }, - { - "date": "2014-01-01", - "value3": 21329, - "value2": 32894, - "value1": 32782 - }, - { - "date": "2014-01-02", - "value3": 21989, - "value2": 30909, - "value1": 29583 - }, - { - "date": "2014-01-03", - "value3": 23481, - "value2": 33794, - "value1": 25680 - }, - { - "date": "2014-01-04", - "value3": 20253, - "value2": 37516, - "value1": 24292 - }, - { - "date": "2014-01-05", - "value3": 21150, - "value2": 36692, - "value1": 24372 - }, - { - "date": "2014-01-06", - "value3": 23170, - "value2": 35783, - "value1": 20990 - }, - { - "date": "2014-01-07", - "value3": 19767, - "value2": 38478, - "value1": 24691 - }, - { - "date": "2014-01-08", - "value3": 17130, - "value2": 40333, - "value1": 22481 - }, - { - "date": "2014-01-09", - "value3": 16280, - "value2": 39265, - "value1": 25239 - }, - { - "date": "2014-01-10", - "value3": 12306, - "value2": 40702, - "value1": 24248 - }, - { - "date": "2014-01-11", - "value3": 14425, - "value2": 39793, - "value1": 24395 - }, - { - "date": "2014-01-12", - "value3": 14555, - "value2": 36282, - "value1": 25580 - }, - { - "date": "2014-01-13", - "value3": 14582, - "value2": 32495, - "value1": 24165 - }, - { - "date": "2014-01-14", - "value3": 15216, - "value2": 36217, - "value1": 26088 - }, - { - "date": "2014-01-15", - "value3": 18650, - "value2": 39448, - "value1": 29528 - }, - { - "date": "2014-01-16", - "value3": 16567, - "value2": 36157, - "value1": 27990 - }, - { - "date": "2014-01-17", - "value3": 16512, - "value2": 33246, - "value1": 24218 - }, - { - "date": "2014-01-18", - "value3": 19777, - "value2": 35543, - "value1": 20837 - }, - { - "date": "2014-01-19", - "value3": 20399, - "value2": 34715, - "value1": 22407 - }, - { - "date": "2014-01-20", - "value3": 18816, - "value2": 32680, - "value1": 19989 - }, - { - "date": "2014-01-21", - "value3": 19986, - "value2": 29250, - "value1": 23828 - }, - { - "date": "2014-01-22", - "value3": 22251, - "value2": 30438, - "value1": 26714 - }, - { - "date": "2014-01-23", - "value3": 25922, - "value2": 28387, - "value1": 30514 - }, - { - "date": "2014-01-24", - "value3": 26428, - "value2": 29612, - "value1": 33155 - }, - { - "date": "2014-01-25", - "value3": 25424, - "value2": 25831, - "value1": 34462 - }, - { - "date": "2014-01-26", - "value3": 27621, - "value2": 22203, - "value1": 32276 - }, - { - "date": "2014-01-27", - "value3": 23961, - "value2": 22855, - "value1": 31899 - }, - { - "date": "2014-01-28", - "value3": 25591, - "value2": 22024, - "value1": 29327 - }, - { - "date": "2014-01-29", - "value3": 26847, - "value2": 22686, - "value1": 32158 - }, - { - "date": "2014-01-30", - "value3": 27853, - "value2": 24676, - "value1": 29473 - }, - { - "date": "2014-01-31", - "value3": 24178, - "value2": 27591, - "value1": 32247 - }, - { - "date": "2014-02-01", - "value3": 20626, - "value2": 24225, - "value1": 30117 - }, - { - "date": "2014-02-02", - "value3": 17938, - "value2": 27842, - "value1": 29435 - }, - { - "date": "2014-02-03", - "value3": 21312, - "value2": 24541, - "value1": 27320 - }, - { - "date": "2014-02-04", - "value3": 17385, - "value2": 27164, - "value1": 30515 - }, - { - "date": "2014-02-05", - "value3": 17638, - "value2": 23288, - "value1": 28635 - }, - { - "date": "2014-02-06", - "value3": 18946, - "value2": 21521, - "value1": 27292 - }, - { - "date": "2014-02-07", - "value3": 21089, - "value2": 22467, - "value1": 24966 - }, - { - "date": "2014-02-08", - "value3": 22956, - "value2": 20604, - "value1": 24670 - }, - { - "date": "2014-02-09", - "value3": 23081, - "value2": 20732, - "value1": 27518 - }, - { - "date": "2014-02-10", - "value3": 25334, - "value2": 21436, - "value1": 24862 - }, - { - "date": "2014-02-11", - "value3": 21989, - "value2": 23315, - "value1": 27263 - }, - { - "date": "2014-02-12", - "value3": 20933, - "value2": 23816, - "value1": 25352 - }, - { - "date": "2014-02-13", - "value3": 21185, - "value2": 22416, - "value1": 22396 - }, - { - "date": "2014-02-14", - "value3": 22801, - "value2": 19348, - "value1": 18497 - }, - { - "date": "2014-02-15", - "value3": 20072, - "value2": 20167, - "value1": 21890 - }, - { - "date": "2014-02-16", - "value3": 23120, - "value2": 23505, - "value1": 22635 - }, - { - "date": "2014-02-17", - "value3": 26351, - "value2": 27294, - "value1": 23970 - }, - { - "date": "2014-02-18", - "value3": 27078, - "value2": 30219, - "value1": 20245 - }, - { - "date": "2014-02-19", - "value3": 26042, - "value2": 28226, - "value1": 17369 - }, - { - "date": "2014-02-20", - "value3": 28763, - "value2": 26489, - "value1": 19326 - }, - { - "date": "2014-02-21", - "value3": 31668, - "value2": 23210, - "value1": 17781 - }, - { - "date": "2014-02-22", - "value3": 31141, - "value2": 22636, - "value1": 15731 - }, - { - "date": "2014-02-23", - "value3": 34681, - "value2": 24430, - "value1": 11917 - }, - { - "date": "2014-02-24", - "value3": 32836, - "value2": 22607, - "value1": 8723 - }, - { - "date": "2014-02-25", - "value3": 29452, - "value2": 22561, - "value1": 7930 - }, - { - "date": "2014-02-26", - "value3": 31958, - "value2": 21692, - "value1": 7898 - }, - { - "date": "2014-02-27", - "value3": 30526, - "value2": 24281, - "value1": 4909 - }, - { - "date": "2014-02-28", - "value3": 30271, - "value2": 23369, - "value1": 1564 - }, - { - "date": "2014-03-01", - "value3": 30977, - "value2": 21954, - "value1": 1564 - }, - { - "date": "2014-03-02", - "value3": 27892, - "value2": 24495, - "value1": 3179 - }, - { - "date": "2014-03-03", - "value3": 26752, - "value2": 20644, - "value1": 4147 - }, - { - "date": "2014-03-04", - "value3": 28318, - "value2": 20201, - "value1": 7271 - }, - { - "date": "2014-03-05", - "value3": 30646, - "value2": 19919, - "value1": 8747 - }, - { - "date": "2014-03-06", - "value3": 32219, - "value2": 20166, - "value1": 10704 - }, - { - "date": "2014-03-07", - "value3": 36175, - "value2": 24020, - "value1": 13698 - }, - { - "date": "2014-03-08", - "value3": 33312, - "value2": 23848, - "value1": 10890 - }, - { - "date": "2014-03-09", - "value3": 30792, - "value2": 23966, - "value1": 7044 - }, - { - "date": "2014-03-10", - "value3": 31162, - "value2": 24539, - "value1": 6461 - }, - { - "date": "2014-03-11", - "value3": 33510, - "value2": 26713, - "value1": 5604 - }, - { - "date": "2014-03-12", - "value3": 37339, - "value2": 23373, - "value1": 4937 - }, - { - "date": "2014-03-13", - "value3": 36413, - "value2": 20127, - "value1": 4007 - }, - { - "date": "2014-03-14", - "value3": 34026, - "value2": 18112, - "value1": 7673 - }, - { - "date": "2014-03-15", - "value3": 33383, - "value2": 20099, - "value1": 7768 - }, - { - "date": "2014-03-16", - "value3": 33358, - "value2": 17391, - "value1": 11123 - }, - { - "date": "2014-03-17", - "value3": 33433, - "value2": 16720, - "value1": 13294 - }, - { - "date": "2014-03-18", - "value3": 33898, - "value2": 17686, - "value1": 15860 - }, - { - "date": "2014-03-19", - "value3": 32549, - "value2": 19989, - "value1": 12153 - }, - { - "date": "2014-03-20", - "value3": 32990, - "value2": 17285, - "value1": 15822 - }, - { - "date": "2014-03-21", - "value3": 31703, - "value2": 15461, - "value1": 13681 - }, - { - "date": "2014-03-22", - "value3": 28348, - "value2": 18088, - "value1": 11944 - }, - { - "date": "2014-03-23", - "value3": 32284, - "value2": 19755, - "value1": 12479 - }, - { - "date": "2014-03-24", - "value3": 34991, - "value2": 19796, - "value1": 12171 - }, - { - "date": "2014-03-25", - "value3": 34395, - "value2": 20606, - "value1": 12889 - }, - { - "date": "2014-03-26", - "value3": 35467, - "value2": 23220, - "value1": 13169 - }, - { - "date": "2014-03-27", - "value3": 36434, - "value2": 26524, - "value1": 12952 - }, - { - "date": "2014-03-28", - "value3": 34007, - "value2": 27261, - "value1": 12141 - }, - { - "date": "2014-03-29", - "value3": 36605, - "value2": 28143, - "value1": 8420 - }, - { - "date": "2014-03-30", - "value3": 35324, - "value2": 29999, - "value1": 9551 - }, - { - "date": "2014-03-31", - "value3": 35077, - "value2": 33650, - "value1": 5917 - }, - { - "date": "2014-04-01", - "value3": 32331, - "value2": 37641, - "value1": 4555 - }, - { - "date": "2014-04-02", - "value3": 32161, - "value2": 40591, - "value1": 8205 - }, - { - "date": "2014-04-03", - "value3": 28921, - "value2": 39738, - "value1": 7119 - }, - { - "date": "2014-04-04", - "value3": 32534, - "value2": 39608, - "value1": 8866 - }, - { - "date": "2014-04-05", - "value3": 31463, - "value2": 40618, - "value1": 10712 - }, - { - "date": "2014-04-06", - "value3": 27973, - "value2": 36821, - "value1": 12396 - }, - { - "date": "2014-04-07", - "value3": 29953, - "value2": 34470, - "value1": 9679 - }, - { - "date": "2014-04-08", - "value3": 26788, - "value2": 31653, - "value1": 12035 - }, - { - "date": "2014-04-09", - "value3": 28319, - "value2": 30246, - "value1": 15903 - }, - { - "date": "2014-04-10", - "value3": 25536, - "value2": 32591, - "value1": 12835 - }, - { - "date": "2014-04-11", - "value3": 26710, - "value2": 34847, - "value1": 10734 - }, - { - "date": "2014-04-12", - "value3": 28521, - "value2": 36313, - "value1": 8157 - }, - { - "date": "2014-04-13", - "value3": 29304, - "value2": 37283, - "value1": 7307 - }, - { - "date": "2014-04-14", - "value3": 26847, - "value2": 35552, - "value1": 3414 - }, - { - "date": "2014-04-15", - "value3": 23252, - "value2": 33905, - "value1": 622 - }, - { - "date": "2014-04-16", - "value3": 21251, - "value2": 37098, - "value1": 3710 - }, - { - "date": "2014-04-17", - "value3": 21938, - "value2": 35414, - "value1": 2900 - }, - { - "date": "2014-04-18", - "value3": 19210, - "value2": 35479, - "value1": 4723 - }, - { - "date": "2014-04-19", - "value3": 17765, - "value2": 35822, - "value1": 7656 - }, - { - "date": "2014-04-20", - "value3": 15064, - "value2": 32006, - "value1": 5948 - }, - { - "date": "2014-04-21", - "value3": 16166, - "value2": 35829, - "value1": 4471 - }, - { - "date": "2014-04-22", - "value3": 14336, - "value2": 38851, - "value1": 6870 - }, - { - "date": "2014-04-23", - "value3": 18145, - "value2": 42598, - "value1": 4625 - }, - { - "date": "2014-04-24", - "value3": 20986, - "value2": 41071, - "value1": 4396 - }, - { - "date": "2014-04-25", - "value3": 21492, - "value2": 43611, - "value1": 5542 - }, - { - "date": "2014-04-26", - "value3": 20712, - "value2": 41320, - "value1": 7280 - }, - { - "date": "2014-04-27", - "value3": 18048, - "value2": 39232, - "value1": 3426 - }, - { - "date": "2014-04-28", - "value3": 17747, - "value2": 42156, - "value1": 4539 - } -]
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/neg1.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/neg1.json deleted file mode 100644 index f12a4ca..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/neg1.json +++ /dev/null @@ -1,602 +0,0 @@ -[ - { - "date": "2013-10-01", - "value": 0.0 - }, - { - "date": "2013-10-02", - "value": -20.27860065952477 - }, - { - "date": "2013-10-03", - "value": -12.426109787612926 - }, - { - "date": "2013-10-04", - "value": -17.699256257379318 - }, - { - "date": "2013-10-05", - "value": -22.019134369994354 - }, - { - "date": "2013-10-06", - "value": -41.59885296861614 - }, - { - "date": "2013-10-07", - "value": -31.867314787877127 - }, - { - "date": "2013-10-08", - "value": -16.68549399939984 - }, - { - "date": "2013-10-09", - "value": -14.214554612147637 - }, - { - "date": "2013-10-10", - "value": -37.100703439565635 - }, - { - "date": "2013-10-11", - "value": -41.716391973782905 - }, - { - "date": "2013-10-12", - "value": -60.65986986496344 - }, - { - "date": "2013-10-13", - "value": -65.88269292682585 - }, - { - "date": "2013-10-14", - "value": -85.89811733657307 - }, - { - "date": "2013-10-15", - "value": -87.57011580082312 - }, - { - "date": "2013-10-16", - "value": -69.1076591319889 - }, - { - "date": "2013-10-17", - "value": -69.71829820893743 - }, - { - "date": "2013-10-18", - "value": -48.07710064468784 - }, - { - "date": "2013-10-19", - "value": -42.02312145221815 - }, - { - "date": "2013-10-20", - "value": -36.94872786920486 - }, - { - "date": "2013-10-21", - "value": -26.283993993694217 - }, - { - "date": "2013-10-22", - "value": -41.683357633072106 - }, - { - "date": "2013-10-23", - "value": -48.410135784779435 - }, - { - "date": "2013-10-24", - "value": -24.647894376874603 - }, - { - "date": "2013-10-25", - "value": -24.48313857183973 - }, - { - "date": "2013-10-26", - "value": -30.775646331124953 - }, - { - "date": "2013-10-27", - "value": -42.353653361246884 - }, - { - "date": "2013-10-28", - "value": -56.408927207093086 - }, - { - "date": "2013-10-29", - "value": -40.78984664417509 - }, - { - "date": "2013-10-30", - "value": -41.42605076469138 - }, - { - "date": "2013-10-31", - "value": -18.09604151517472 - }, - { - "date": "2013-11-01", - "value": 2.0546535501343186 - }, - { - "date": "2013-11-02", - "value": 16.427200269275257 - }, - { - "date": "2013-11-03", - "value": 36.26021813729312 - }, - { - "date": "2013-11-04", - "value": 17.943623384419123 - }, - { - "date": "2013-11-05", - "value": 17.640349147379087 - }, - { - "date": "2013-11-06", - "value": 28.733924995418647 - }, - { - "date": "2013-11-07", - "value": 43.17866048300303 - }, - { - "date": "2013-11-08", - "value": 42.352421757240364 - }, - { - "date": "2013-11-09", - "value": 20.96374796987576 - }, - { - "date": "2013-11-10", - "value": 0.4817825186157414 - }, - { - "date": "2013-11-11", - "value": 4.454052949905262 - }, - { - "date": "2013-11-12", - "value": 9.903521845328488 - }, - { - "date": "2013-11-13", - "value": -9.659938196685449 - }, - { - "date": "2013-11-14", - "value": -1.6572458262441714 - }, - { - "date": "2013-11-15", - "value": -19.421347615158197 - }, - { - "date": "2013-11-16", - "value": -5.133047713617817 - }, - { - "date": "2013-11-17", - "value": 7.142073986101426 - }, - { - "date": "2013-11-18", - "value": 19.965752044244944 - }, - { - "date": "2013-11-19", - "value": 34.06855156342502 - }, - { - "date": "2013-11-20", - "value": 32.035712731383306 - }, - { - "date": "2013-11-21", - "value": 26.800280474507574 - }, - { - "date": "2013-11-22", - "value": 36.74472173965269 - }, - { - "date": "2013-11-23", - "value": 17.635258758794258 - }, - { - "date": "2013-11-24", - "value": 21.70157569545806 - }, - { - "date": "2013-11-25", - "value": 12.880215322765117 - }, - { - "date": "2013-11-26", - "value": -1.6952234072651535 - }, - { - "date": "2013-11-27", - "value": -25.709873487640706 - }, - { - "date": "2013-11-28", - "value": -24.333141952222054 - }, - { - "date": "2013-11-29", - "value": -23.101049395363514 - }, - { - "date": "2013-11-30", - "value": -30.77467592550588 - }, - { - "date": "2013-12-01", - "value": -52.484803998469324 - }, - { - "date": "2013-12-02", - "value": -59.967129097767554 - }, - { - "date": "2013-12-03", - "value": -58.54448864190029 - }, - { - "date": "2013-12-04", - "value": -35.733861688599625 - }, - { - "date": "2013-12-05", - "value": -49.95861223226006 - }, - { - "date": "2013-12-06", - "value": -68.88793877584408 - }, - { - "date": "2013-12-07", - "value": -50.428275259634844 - }, - { - "date": "2013-12-08", - "value": -40.26117556623101 - }, - { - "date": "2013-12-09", - "value": -38.891176869589806 - }, - { - "date": "2013-12-10", - "value": -59.758690871453695 - }, - { - "date": "2013-12-11", - "value": -71.1695554284355 - }, - { - "date": "2013-12-12", - "value": -90.63524940599096 - }, - { - "date": "2013-12-13", - "value": -79.23423804726241 - }, - { - "date": "2013-12-14", - "value": -71.25861388735568 - }, - { - "date": "2013-12-15", - "value": -60.61596323199725 - }, - { - "date": "2013-12-16", - "value": -62.93902244769705 - }, - { - "date": "2013-12-17", - "value": -41.22170848850722 - }, - { - "date": "2013-12-18", - "value": -27.226208027424434 - }, - { - "date": "2013-12-19", - "value": -7.309085309368637 - }, - { - "date": "2013-12-20", - "value": 3.670426015191861 - }, - { - "date": "2013-12-21", - "value": 19.473948613489632 - }, - { - "date": "2013-12-22", - "value": 40.415945876438144 - }, - { - "date": "2013-12-23", - "value": 31.289641086998923 - }, - { - "date": "2013-12-24", - "value": 17.434969637396232 - }, - { - "date": "2013-12-25", - "value": 30.21158378387427 - }, - { - "date": "2013-12-26", - "value": 30.727072719951824 - }, - { - "date": "2013-12-27", - "value": 20.184828808977333 - }, - { - "date": "2013-12-28", - "value": 27.76791048820225 - }, - { - "date": "2013-12-29", - "value": 34.40666779673991 - }, - { - "date": "2013-12-30", - "value": 28.662553475743806 - }, - { - "date": "2013-12-31", - "value": 20.816765875588956 - }, - { - "date": "2014-01-01", - "value": 30.498234516361673 - }, - { - "date": "2014-01-02", - "value": 6.549837407292948 - }, - { - "date": "2014-01-03", - "value": -17.03978957481648 - }, - { - "date": "2014-01-04", - "value": -6.201247455250156 - }, - { - "date": "2014-01-05", - "value": -9.481910347672848 - }, - { - "date": "2014-01-06", - "value": -1.4927745588584092 - }, - { - "date": "2014-01-07", - "value": 7.015746206056052 - }, - { - "date": "2014-01-08", - "value": 16.24056736124951 - }, - { - "date": "2014-01-09", - "value": 40.86145060910893 - }, - { - "date": "2014-01-10", - "value": 30.561347738520645 - }, - { - "date": "2014-01-11", - "value": 7.104703671937518 - }, - { - "date": "2014-01-12", - "value": 30.52693531793409 - }, - { - "date": "2014-01-13", - "value": 43.612806638528454 - }, - { - "date": "2014-01-14", - "value": 20.25247412642843 - }, - { - "date": "2014-01-15", - "value": 7.141936114658641 - }, - { - "date": "2014-01-16", - "value": -10.81374417310036 - }, - { - "date": "2014-01-17", - "value": 13.268210809685325 - }, - { - "date": "2014-01-18", - "value": 9.593303343135403 - }, - { - "date": "2014-01-19", - "value": 9.190238080819555 - }, - { - "date": "2014-01-20", - "value": -7.087595978474408 - }, - { - "date": "2014-01-21", - "value": 16.112869601906773 - }, - { - "date": "2014-01-22", - "value": 19.92397510159386 - }, - { - "date": "2014-01-23", - "value": 33.4964486295363 - }, - { - "date": "2014-01-24", - "value": 46.4831931105589 - }, - { - "date": "2014-01-25", - "value": 22.484343494394732 - }, - { - "date": "2014-01-26", - "value": 9.574360390216658 - }, - { - "date": "2014-01-27", - "value": 12.56929545850477 - }, - { - "date": "2014-01-28", - "value": -0.14595957202229037 - }, - { - "date": "2014-01-29", - "value": -14.696983674286617 - }, - { - "date": "2014-01-30", - "value": -15.237944850705059 - }, - { - "date": "2014-01-31", - "value": -1.7882058112963062 - }, - { - "date": "2014-02-01", - "value": -7.860538889362351 - }, - { - "date": "2014-02-02", - "value": 8.444727352087527 - }, - { - "date": "2014-02-03", - "value": 32.30058738777103 - }, - { - "date": "2014-02-04", - "value": 16.055786840333848 - }, - { - "date": "2014-02-05", - "value": -0.36610893414817625 - }, - { - "date": "2014-02-06", - "value": -1.1025132187248678 - }, - { - "date": "2014-02-07", - "value": 16.48048170957292 - }, - { - "date": "2014-02-08", - "value": 30.920083106250665 - }, - { - "date": "2014-02-09", - "value": 9.793945311635703 - }, - { - "date": "2014-02-10", - "value": -14.741798239121763 - }, - { - "date": "2014-02-11", - "value": 9.788165531444847 - }, - { - "date": "2014-02-12", - "value": -8.119237390130131 - }, - { - "date": "2014-02-13", - "value": -1.1782643021314554 - }, - { - "date": "2014-02-14", - "value": 7.310002841362066 - }, - { - "date": "2014-02-15", - "value": -6.0549226820141255 - }, - { - "date": "2014-02-16", - "value": 8.311998864819806 - }, - { - "date": "2014-02-17", - "value": 2.2233224632177393 - }, - { - "date": "2014-02-18", - "value": -18.946268533746085 - }, - { - "date": "2014-02-19", - "value": -5.889102580833665 - }, - { - "date": "2014-02-20", - "value": -0.19481412319894353 - }, - { - "date": "2014-02-21", - "value": -1.9196952442973252 - }, - { - "date": "2014-02-22", - "value": -25.056284352606756 - }, - { - "date": "2014-02-23", - "value": -32.09293779807747 - }, - { - "date": "2014-02-24", - "value": -55.77733578681833 - }, - { - "date": "2014-02-25", - "value": -73.55650805303047 - }, - { - "date": "2014-02-26", - "value": -78.44939933625979 - }, - { - "date": "2014-02-27", - "value": -61.75086522568682 - } -]
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/neg2.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/neg2.json deleted file mode 100644 index 00bdbcc..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/neg2.json +++ /dev/null @@ -1,30 +0,0 @@ -[ - { - "measure": 43.34, - "subject": 32.0 - }, - { - "measure": 53.3423, - "subject": 20.27 - }, - { - "measure": -10.343, - "subject": 12.42 - }, - { - "measure": -1, - "subject": -1.69 - }, - { - "measure": 10, - "subject": -10.01 - }, - { - "measure": 25, - "subject": -21.59 - }, - { - "measure": -20.343, - "subject": -31.86 - } -]
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/nh-gop.tsv b/priv/static/metrics-graphics-3.0-alpha3/examples/data/nh-gop.tsv deleted file mode 100644 index e0dc414..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/nh-gop.tsv +++ /dev/null @@ -1,6 +0,0 @@ -Poll Date Trump Rubio Cruz Christie Kasich Bush Carson Fiorina Paul Huckabee Santorum Pataki Graham Spread -RCP Average 12/13 - 1/6 27.0 13.8 11.5 11.3 10.0 8.3 5.0 4.8 3.8 0.3 0.3 0.0 0.0 Trump +13.2 -PPP (D) 1/4 - 1/6 29 15 10 11 11 10 4 4 3 1 1 -- -- Trump +14 -ARG 12/20 - 12/20 21 15 10 12 13 7 6 5 4 0 0 0 -- Trump +6 -CBS News/YouGov 12/14 - 12/17 32 13 14 11 8 6 5 4 5 0 0 0 0 Trump +18 -Boston Herald 12/13 - 12/17 26 12 12 11 8 10 5 6 3 0 0 0 0 Trump +14
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/points1.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/points1.json deleted file mode 100644 index c3b17f7..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/points1.json +++ /dev/null @@ -1,802 +0,0 @@ -[ - { - "u": "cat_10", - "w": 1.243871075541485, - "v": "other", - "y": 211.80029085913867, - "x": 156.56698521169255, - "z": 1.2592730408041488 - }, - { - "u": "cat_9", - "w": 0.18317089873596637, - "v": "other", - "y": 196.93116746887526, - "x": 182.9226627644747, - "z": 1.5420852412869692 - }, - { - "u": "cat_11", - "w": 1.6440310398846552, - "v": "other", - "y": 198.15275935129918, - "x": 180.46587284398524, - "z": 1.0607952297441374 - }, - { - "u": "cat_7", - "w": -0.7500939816017782, - "v": "other", - "y": 146.31202991730444, - "x": 102.35636312891461, - "z": 0.30940991631448456 - }, - { - "u": "cat_10", - "w": 0.46988959503208527, - "v": "other", - "y": 118.66304545624911, - "x": 175.8035980586206, - "z": 1.589820005614669 - }, - { - "u": "cat_3", - "w": 2.4359184943127667, - "v": "other", - "y": 214.0123663650676, - "x": 146.24883586964125, - "z": -0.8716888194991463 - }, - { - "u": "cat_8", - "w": -1.2794477449179462, - "v": "other", - "y": 165.45000531931404, - "x": 138.83167553877533, - "z": 0.365531221729956 - }, - { - "u": "other", - "w": 0.6533051004485967, - "v": "cat_0", - "y": 133.99465910929834, - "x": 119.39730303633817, - "z": 1.270978774871001 - }, - { - "u": "cat_13", - "w": -0.4527608603464446, - "v": "other", - "y": 262.89541671133776, - "x": 209.42459012646566, - "z": 0.15317285949553272 - }, - { - "u": "cat_12", - "w": 0.06915365942882012, - "v": "cat_0", - "y": 139.0123425273913, - "x": 140.27809963809628, - "z": 1.0850789531923752 - }, - { - "u": "cat_5", - "w": 0.18422289588498686, - "v": "other", - "y": 123.5696526089444, - "x": 178.47540577185424, - "z": 0.40291991519951875 - }, - { - "u": "cat_4", - "w": -0.4338210953783319, - "v": "cat_1", - "y": 161.93728020049016, - "x": 166.16502625602917, - "z": 0.5093424182003234 - }, - { - "u": "cat_7", - "w": 1.40583885575462, - "v": "other", - "y": 155.63962440916566, - "x": 99.85204107456539, - "z": 1.2530442449107233 - }, - { - "u": "cat_10", - "w": -0.4275099099676807, - "v": "other", - "y": 176.85285727542032, - "x": 161.42701652535786, - "z": 0.8230669881454445 - }, - { - "u": "cat_4", - "w": 1.463656501437303, - "v": "cat_1", - "y": 246.6642430026098, - "x": 73.48368170456627, - "z": 1.0052929735375302 - }, - { - "u": "cat_11", - "w": 0.013089161287933138, - "v": "other", - "y": 156.36354536529558, - "x": 243.2026715373837, - "z": 0.39667694750274274 - }, - { - "u": "cat_12", - "w": 0.36730326802039404, - "v": "other", - "y": 156.71697413402487, - "x": 148.27450037397765, - "z": -1.4105618351561287 - }, - { - "u": "cat_14", - "w": -0.06953747774947772, - "v": "other", - "y": 141.22433267951084, - "x": 69.06616491304716, - "z": 0.475924622911404 - }, - { - "u": "other", - "w": 0.517415189557197, - "v": "other", - "y": 115.95680666029197, - "x": 153.0898637311175, - "z": 0.9443947812526814 - }, - { - "u": "cat_3", - "w": 0.5670223685982718, - "v": "other", - "y": 227.27960266143467, - "x": 153.22490080491232, - "z": 1.32067405076989 - }, - { - "u": "cat_7", - "w": 0.5376290623874869, - "v": "other", - "y": 260.9119300068415, - "x": 158.76997596111525, - "z": 0.26196386810779426 - }, - { - "u": "cat_8", - "w": 2.168516664994767, - "v": "other", - "y": 170.77570545745968, - "x": 135.65940169018805, - "z": 0.9162849263421061 - }, - { - "u": "cat_5", - "w": 2.311955371948698, - "v": "other", - "y": 243.37468134084048, - "x": 20.66820288532847, - "z": -0.322645627898664 - }, - { - "u": "cat_4", - "w": 1.8314759939943595, - "v": "other", - "y": 214.1727802647768, - "x": 216.61746891013505, - "z": 2.4147498286441165 - }, - { - "u": "other", - "w": 0.8365279958031904, - "v": "other", - "y": 100.90575192733515, - "x": 151.6306779403549, - "z": 0.8606212265228668 - }, - { - "u": "cat_13", - "w": -0.26452281419648993, - "v": "cat_0", - "y": 194.59598730955793, - "x": 129.361227705571, - "z": 1.0322894496099724 - }, - { - "u": "cat_13", - "w": 2.6043512596594365, - "v": "other", - "y": 213.8128177957785, - "x": 194.6414121394208, - "z": 3.280204884184917 - }, - { - "u": "cat_6", - "w": 1.6310983407120137, - "v": "other", - "y": 163.2658097189387, - "x": 187.70506769054072, - "z": 1.3488889788600984 - }, - { - "u": "cat_8", - "w": 0.6487974580274094, - "v": "other", - "y": 194.3209257079902, - "x": 192.10028088047798, - "z": -0.07036372606337338 - }, - { - "u": "cat_10", - "w": 1.3927144738318111, - "v": "other", - "y": 161.3486689563104, - "x": 86.73894049392862, - "z": 0.1537876062955914 - }, - { - "u": "cat_9", - "w": -0.3771368838057665, - "v": "other", - "y": 182.55687300867896, - "x": 201.1112292465731, - "z": -0.058098755927163515 - }, - { - "u": "cat_0", - "w": -0.6345913552330389, - "v": "other", - "y": 165.80314397714827, - "x": 206.7182591446124, - "z": 1.4845564495064427 - }, - { - "u": "cat_0", - "w": 0.6855019579009463, - "v": "cat_1", - "y": 159.66118937446728, - "x": 192.39649008863876, - "z": 0.055873071009385766 - }, - { - "u": "cat_6", - "w": 2.964882131756106, - "v": "other", - "y": 241.84769149238159, - "x": 111.35023940160411, - "z": 0.167414971004892 - }, - { - "u": "other", - "w": -0.4506378010737888, - "v": "other", - "y": 90.4639669582562, - "x": 158.90001697899683, - "z": 1.1696787253371819 - }, - { - "u": "cat_0", - "w": 1.2656151949587624, - "v": "other", - "y": 183.02945581640645, - "x": 180.4213167593254, - "z": 2.0539930046863035 - }, - { - "u": "cat_13", - "w": 1.228801369090003, - "v": "other", - "y": 277.13369884311936, - "x": 80.15664163346004, - "z": 2.2937904251948638 - }, - { - "u": "cat_5", - "w": 2.0896213510871937, - "v": "other", - "y": 163.72382240169802, - "x": 215.41216187620037, - "z": 2.553028570447125 - }, - { - "u": "cat_15", - "w": 1.0981586322470924, - "v": "other", - "y": 109.2838491053391, - "x": 184.09570421897956, - "z": 0.44759620112619647 - }, - { - "u": "other", - "w": 1.3457067544720736, - "v": "other", - "y": 171.16629782677862, - "x": 213.12963803437316, - "z": 0.7270493828061404 - }, - { - "u": "cat_13", - "w": -0.7076617244518462, - "v": "other", - "y": 144.05587078713071, - "x": 184.28906651578978, - "z": 1.382134562867984 - }, - { - "u": "cat_0", - "w": -0.2800595737017382, - "v": "other", - "y": 193.27473606725474, - "x": 154.94633537134789, - "z": -0.33791235399367947 - }, - { - "u": "cat_14", - "w": 0.4456793621586681, - "v": "other", - "y": 125.1308061934427, - "x": 123.90267987241343, - "z": 2.3230978938654645 - }, - { - "u": "cat_5", - "w": 3.075103103171694, - "v": "cat_0", - "y": 154.8755877624397, - "x": 61.020238047163375, - "z": 1.6674654330131888 - }, - { - "u": "other", - "w": 0.16319305741807733, - "v": "cat_0", - "y": 114.08645682777497, - "x": 225.28654361195518, - "z": 0.4242182000961613 - }, - { - "u": "cat_6", - "w": 1.9417162589422323, - "v": "other", - "y": 185.28537858495014, - "x": 155.5736376536581, - "z": 1.1747492195973144 - }, - { - "u": "cat_4", - "w": 1.155787735870216, - "v": "cat_1", - "y": 183.24930292147863, - "x": 115.40643586463635, - "z": 0.19242660628339903 - }, - { - "u": "other", - "w": 0.6070329867687532, - "v": "other", - "y": 57.398818613660296, - "x": 219.87611544574744, - "z": 1.1095208041769122 - }, - { - "u": "cat_6", - "w": 0.4083905726447342, - "v": "other", - "y": 175.40387812166918, - "x": 224.68335734038368, - "z": -0.42207104629857617 - }, - { - "u": "cat_5", - "w": 0.6585907631358738, - "v": "cat_1", - "y": 124.05051069396585, - "x": 127.07766432478591, - "z": 0.1354114111502046 - }, - { - "u": "cat_10", - "w": 1.734882212854999, - "v": "cat_1", - "y": 143.78518104207086, - "x": 198.75776145611215, - "z": -0.12283925137929064 - }, - { - "u": "other", - "w": 0.20503963437937356, - "v": "other", - "y": 151.75327292745928, - "x": 148.9695770940796, - "z": 0.564428194218838 - }, - { - "u": "cat_15", - "w": 1.8574692523422356, - "v": "other", - "y": 306.0898140884456, - "x": 147.43144660079602, - "z": -0.22413411708624853 - }, - { - "u": "cat_4", - "w": 1.1062688896220425, - "v": "other", - "y": 212.44397654702615, - "x": 195.86829581464062, - "z": 0.7453160939357952 - }, - { - "u": "cat_15", - "w": -0.27774340110996487, - "v": "cat_0", - "y": 122.63707978879633, - "x": 95.64182307323996, - "z": 0.6430476399500114 - }, - { - "u": "cat_11", - "w": 1.693891428609414, - "v": "other", - "y": 161.59041244043587, - "x": 64.83892325218056, - "z": 0.6409468598992659 - }, - { - "u": "cat_0", - "w": 1.8192638452039414, - "v": "cat_0", - "y": 203.44169192711857, - "x": 175.9035258508178, - "z": 1.0101903553514529 - }, - { - "u": "cat_10", - "w": 1.6693901234237167, - "v": "other", - "y": 266.02281722067806, - "x": 193.7229721388815, - "z": 1.3287927803604402 - }, - { - "u": "cat_2", - "w": 1.6276382654036277, - "v": "cat_0", - "y": 174.54476940927518, - "x": 85.70090208863968, - "z": 1.3166929052154481 - }, - { - "u": "cat_4", - "w": 0.893609545984623, - "v": "other", - "y": 135.20127141724655, - "x": 161.0852992807473, - "z": 0.7423369081120028 - }, - { - "u": "cat_8", - "w": -0.25726080091728387, - "v": "other", - "y": 87.98074634203813, - "x": 194.6466767641028, - "z": 1.171709779521613 - }, - { - "u": "cat_6", - "w": 1.4386749809763226, - "v": "other", - "y": 154.56889252680085, - "x": 137.16494490842896, - "z": 1.8319953052292166 - }, - { - "u": "cat_1", - "w": 1.9751827147081238, - "v": "other", - "y": 150.52324196509258, - "x": 51.69078624012406, - "z": -0.23529144151246717 - }, - { - "u": "cat_14", - "w": 1.3843184328271165, - "v": "other", - "y": 160.51323171649904, - "x": 169.7361988952806, - "z": 1.3970600816965812 - }, - { - "u": "cat_15", - "w": -0.475868599212677, - "v": "other", - "y": 132.27225542990598, - "x": 103.56729490389614, - "z": 0.4512210085364755 - }, - { - "u": "cat_4", - "w": 1.2081442447975173, - "v": "cat_0", - "y": 56.102440394233255, - "x": 124.56829572524175, - "z": 1.2994110022657026 - }, - { - "u": "cat_13", - "w": 1.736143244910195, - "v": "cat_0", - "y": 212.5650565277553, - "x": 140.4278102663895, - "z": 2.3771380059458744 - }, - { - "u": "cat_14", - "w": -0.461785512082463, - "v": "cat_1", - "y": 101.5707842719089, - "x": 196.16957370342342, - "z": 2.0950787429883846 - }, - { - "u": "cat_5", - "w": 1.3260330340794257, - "v": "cat_1", - "y": 195.74556071781365, - "x": 36.939138857293585, - "z": -0.05847270264086335 - }, - { - "u": "cat_9", - "w": 0.3220908087517964, - "v": "other", - "y": 221.78294482102933, - "x": 74.76586558666337, - "z": -0.05817419869022866 - }, - { - "u": "cat_5", - "w": 0.8170251870816604, - "v": "other", - "y": 179.17790605043118, - "x": 232.48747575985655, - "z": 1.7029885149441673 - }, - { - "u": "cat_3", - "w": 0.2659811986182221, - "v": "cat_1", - "y": 192.81824199631728, - "x": 140.710358385573, - "z": 1.5793646916427102 - }, - { - "u": "cat_8", - "w": 1.2271687489820546, - "v": "other", - "y": 111.59013545108343, - "x": 101.3489243773156, - "z": 3.21128318091031 - }, - { - "u": "cat_13", - "w": 1.3499209090064648, - "v": "other", - "y": 91.89209852687142, - "x": 154.6035518322702, - "z": 0.6817267324899431 - }, - { - "u": "cat_0", - "w": 2.159235435849202, - "v": "other", - "y": 158.63631854616588, - "x": 120.35802170671863, - "z": 0.6067162231097979 - }, - { - "u": "cat_14", - "w": 0.8523794752014957, - "v": "other", - "y": 76.05793322732642, - "x": 138.4115475783541, - "z": 0.2967991752860232 - }, - { - "u": "cat_12", - "w": 1.0558373735944235, - "v": "other", - "y": 124.74002651703651, - "x": 157.02907657551447, - "z": -0.025374565392791038 - }, - { - "u": "cat_0", - "w": 1.3648422432834806, - "v": "cat_1", - "y": 203.82847317695288, - "x": 152.02003088030492, - "z": -0.4421819240850271 - }, - { - "u": "cat_4", - "w": 0.8156055831409262, - "v": "other", - "y": 95.97296459484079, - "x": 78.51455593195435, - "z": 1.1994133990162583 - }, - { - "u": "cat_3", - "w": 0.727605537039985, - "v": "other", - "y": 168.70196209212494, - "x": 212.41730028904536, - "z": 0.6997491454171789 - }, - { - "u": "cat_6", - "w": 1.262490286926595, - "v": "other", - "y": 134.65200754480446, - "x": 42.54634367887225, - "z": 0.5177600909542267 - }, - { - "u": "cat_8", - "w": 1.4837053114286998, - "v": "cat_0", - "y": 112.28208956177541, - "x": 193.95863032046006, - "z": 1.0019859410064678 - }, - { - "u": "cat_8", - "w": -0.16895357221403362, - "v": "cat_0", - "y": 192.98985884826888, - "x": 144.96182365337268, - "z": 1.4190462447457899 - }, - { - "u": "cat_16", - "w": 1.0468806482899717, - "v": "cat_0", - "y": 152.86277692393685, - "x": 137.2022037296142, - "z": 0.4593974450208086 - }, - { - "u": "cat_6", - "w": 2.462089222004976, - "v": "cat_1", - "y": 178.5621123552027, - "x": 142.01082685227874, - "z": 0.580699096900331 - }, - { - "u": "other", - "w": -0.9097490420343397, - "v": "other", - "y": 137.21823856264854, - "x": 94.98376759227347, - "z": 2.118286289288478 - }, - { - "u": "cat_5", - "w": 0.6155123359814616, - "v": "other", - "y": 52.94291552982141, - "x": 85.57431217669814, - "z": -0.09704681018895633 - }, - { - "u": "cat_11", - "w": 1.9468348457441005, - "v": "other", - "y": 243.07706417763518, - "x": 163.35061475046334, - "z": 1.178015608927323 - }, - { - "u": "cat_13", - "w": -0.11396040656336393, - "v": "other", - "y": 102.69550510842956, - "x": 105.80547059051209, - "z": 1.7309952065474825 - }, - { - "u": "cat_0", - "w": 1.0201819734167836, - "v": "other", - "y": 226.24093931458543, - "x": 128.26413056781655, - "z": 0.602354545792653 - }, - { - "u": "cat_9", - "w": 0.41269060095932775, - "v": "other", - "y": 22.06560060765568, - "x": 169.41836118747312, - "z": 0.6422396319927962 - }, - { - "u": "cat_13", - "w": 1.1423761297271733, - "v": "other", - "y": 122.16006750791158, - "x": 64.32267243426844, - "z": 0.5677725122287971 - }, - { - "u": "cat_0", - "w": -0.4940883354815302, - "v": "other", - "y": 146.45339448820994, - "x": 172.009924725858, - "z": 0.5733149663059203 - }, - { - "u": "cat_12", - "w": 2.0427267231236836, - "v": "other", - "y": 105.09233739863171, - "x": 151.8604441328228, - "z": -1.0417341971519445 - }, - { - "u": "cat_0", - "w": -0.06844772614894712, - "v": "cat_0", - "y": 208.74646965359665, - "x": 211.0589178490544, - "z": 3.033892234816319 - }, - { - "u": "cat_10", - "w": 0.1407531030532979, - "v": "other", - "y": 212.1295737404453, - "x": 157.62156278215423, - "z": -0.17802781876760476 - }, - { - "u": "cat_7", - "w": 0.654514275645782, - "v": "cat_1", - "y": 127.45107550739947, - "x": 94.87901525572023, - "z": 1.169027403658316 - }, - { - "u": "cat_15", - "w": 2.7361843748627708, - "v": "other", - "y": 184.8888620082486, - "x": 116.81017887336674, - "z": -0.5196787907040106 - }, - { - "u": "other", - "w": 0.7134526835944346, - "v": "other", - "y": 169.9779808978828, - "x": 108.48468655071922, - "z": 2.4985146493801524 - }, - { - "u": "cat_1", - "w": 2.0017599837707474, - "v": "other", - "y": 193.69331303548242, - "x": 161.953677145996, - "z": 0.9928254618909004 - } -]
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/small-range.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/small-range.json deleted file mode 100644 index c50d5df..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/small-range.json +++ /dev/null @@ -1,26 +0,0 @@ - [ - { - "date": "2014-01-01", - "value": 1 - }, - { - "date": "2014-01-02", - "value": 3 - }, - { - "date": "2014-01-03", - "value": 2 - }, - { - "date": "2014-01-04", - "value": 2 - }, - { - "date": "2014-01-05", - "value": 2 - }, - { - "date": "2014-01-06", - "value": 1 - } - ] diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/some_currency.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/some_currency.json deleted file mode 100644 index f84a3ff..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/some_currency.json +++ /dev/null @@ -1,402 +0,0 @@ -[ - { - "date": "2014-02-01", - "value": 15000000 - }, - { - "date": "2014-02-02", - "value": 16487625 - }, - { - "date": "2014-02-03", - "value": 17097434 - }, - { - "date": "2014-02-04", - "value": 17694420 - }, - { - "date": "2014-02-05", - "value": 17014381 - }, - { - "date": "2014-02-06", - "value": 15578984 - }, - { - "date": "2014-02-07", - "value": 14718953 - }, - { - "date": "2014-02-08", - "value": 15020669 - }, - { - "date": "2014-02-09", - "value": 13889722 - }, - { - "date": "2014-02-10", - "value": 13979897 - }, - { - "date": "2014-02-11", - "value": 14595566 - }, - { - "date": "2014-02-12", - "value": 14123256 - }, - { - "date": "2014-02-13", - "value": 14083675 - }, - { - "date": "2014-02-14", - "value": 15068426 - }, - { - "date": "2014-02-15", - "value": 15368056 - }, - { - "date": "2014-02-16", - "value": 15277054 - }, - { - "date": "2014-02-17", - "value": 14376243 - }, - { - "date": "2014-02-18", - "value": 13058892 - }, - { - "date": "2014-02-19", - "value": 12367653 - }, - { - "date": "2014-02-20", - "value": 13184423 - }, - { - "date": "2014-02-21", - "value": 14367203 - }, - { - "date": "2014-02-22", - "value": 14656447 - }, - { - "date": "2014-02-23", - "value": 14724526 - }, - { - "date": "2014-02-24", - "value": 14938129 - }, - { - "date": "2014-02-25", - "value": 14205617 - }, - { - "date": "2014-02-26", - "value": 14596607 - }, - { - "date": "2014-02-27", - "value": 13982597 - }, - { - "date": "2014-02-28", - "value": 15107034 - }, - { - "date": "2014-03-01", - "value": 13646739 - }, - { - "date": "2014-03-02", - "value": 14214763 - }, - { - "date": "2014-03-03", - "value": 14952136 - }, - { - "date": "2014-03-04", - "value": 14643933 - }, - { - "date": "2014-03-05", - "value": 13611435 - }, - { - "date": "2014-03-06", - "value": 12569788 - }, - { - "date": "2014-03-07", - "value": 11344469 - }, - { - "date": "2014-03-08", - "value": 12687132 - }, - { - "date": "2014-03-09", - "value": 11831144 - }, - { - "date": "2014-03-10", - "value": 10480837 - }, - { - "date": "2014-03-11", - "value": 9051161 - }, - { - "date": "2014-03-12", - "value": 9964784 - }, - { - "date": "2014-03-13", - "value": 11035006 - }, - { - "date": "2014-03-14", - "value": 10081289 - }, - { - "date": "2014-03-15", - "value": 9793897 - }, - { - "date": "2014-03-16", - "value": 9177447 - }, - { - "date": "2014-03-17", - "value": 8035348 - }, - { - "date": "2014-03-18", - "value": 6770242 - }, - { - "date": "2014-03-19", - "value": 7272077 - }, - { - "date": "2014-03-20", - "value": 8216348 - }, - { - "date": "2014-03-21", - "value": 8576584 - }, - { - "date": "2014-03-22", - "value": 9421060 - }, - { - "date": "2014-03-23", - "value": 10872288 - }, - { - "date": "2014-03-24", - "value": 9537996 - }, - { - "date": "2014-03-25", - "value": 9560363 - }, - { - "date": "2014-03-26", - "value": 8182813 - }, - { - "date": "2014-03-27", - "value": 9068173 - }, - { - "date": "2014-03-28", - "value": 10390251 - }, - { - "date": "2014-03-29", - "value": 9714081 - }, - { - "date": "2014-03-30", - "value": 9994670 - }, - { - "date": "2014-03-31", - "value": 9317878 - }, - { - "date": "2014-04-01", - "value": 8209077 - }, - { - "date": "2014-04-02", - "value": 9230830 - }, - { - "date": "2014-04-03", - "value": 8978342 - }, - { - "date": "2014-04-04", - "value": 8361854 - }, - { - "date": "2014-04-05", - "value": 9345999 - }, - { - "date": "2014-04-06", - "value": 7965407 - }, - { - "date": "2014-04-07", - "value": 8909276 - }, - { - "date": "2014-04-08", - "value": 8935489 - }, - { - "date": "2014-04-09", - "value": 8634997 - }, - { - "date": "2014-04-10", - "value": 8795592 - }, - { - "date": "2014-04-11", - "value": 7513086 - }, - { - "date": "2014-04-12", - "value": 8408561 - }, - { - "date": "2014-04-13", - "value": 7780649 - }, - { - "date": "2014-04-14", - "value": 7524281 - }, - { - "date": "2014-04-15", - "value": 8498062 - }, - { - "date": "2014-04-16", - "value": 7922453 - }, - { - "date": "2014-04-17", - "value": 9304312 - }, - { - "date": "2014-04-18", - "value": 8199457 - }, - { - "date": "2014-04-19", - "value": 8926136 - }, - { - "date": "2014-04-20", - "value": 7558184 - }, - { - "date": "2014-04-21", - "value": 6417511 - }, - { - "date": "2014-04-22", - "value": 5748831 - }, - { - "date": "2014-04-23", - "value": 6503022 - }, - { - "date": "2014-04-24", - "value": 6429606 - }, - { - "date": "2014-04-25", - "value": 5057410 - }, - { - "date": "2014-04-26", - "value": 5924669 - }, - { - "date": "2014-04-27", - "value": 4728239 - }, - { - "date": "2014-04-28", - "value": 3918540 - }, - { - "date": "2014-04-29", - "value": 2821473 - }, - { - "date": "2014-04-30", - "value": 1995781 - }, - { - "date": "2014-05-01", - "value": 1123626 - }, - { - "date": "2014-05-02", - "value": 516067 - }, - { - "date": "2014-05-03", - "value": 816831 - }, - { - "date": "2014-05-04", - "value": 816831 - }, - { - "date": "2014-05-05", - "value": 816831 - }, - { - "date": "2014-05-06", - "value": 1103818 - }, - { - "date": "2014-05-07", - "value": 958188 - }, - { - "date": "2014-05-08", - "value": 592995 - }, - { - "date": "2014-05-09", - "value": 856066 - }, - { - "date": "2014-05-10", - "value": 1766761 - }, - { - "date": "2014-05-11", - "value": 1330557 - } -]
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/some_percentage.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/some_percentage.json deleted file mode 100644 index 38e73a8..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/some_percentage.json +++ /dev/null @@ -1,482 +0,0 @@ -[[ - { - "date": "2014-01-01", - "value": 0.5 - }, - { - "date": "2014-01-02", - "value": 0.5038520341226763 - }, - { - "date": "2014-01-03", - "value": 0.501041575106488 - }, - { - "date": "2014-01-04", - "value": 0.4984465228974178 - }, - { - "date": "2014-01-05", - "value": 0.5003884470629179 - }, - { - "date": "2014-01-06", - "value": 0.5031564481343913 - }, - { - "date": "2014-01-07", - "value": 0.5078607730320586 - }, - { - "date": "2014-01-08", - "value": 0.5041111109212457 - }, - { - "date": "2014-01-09", - "value": 0.5069321806604172 - }, - { - "date": "2014-01-10", - "value": 0.5026154784253497 - }, - { - "date": "2014-01-11", - "value": 0.5065241796178874 - }, - { - "date": "2014-01-12", - "value": 0.5018867686214743 - }, - { - "date": "2014-01-13", - "value": 0.5043001746033196 - }, - { - "date": "2014-01-14", - "value": 0.504404210966798 - }, - { - "date": "2014-01-15", - "value": 0.5075142056997484 - }, - { - "date": "2014-01-16", - "value": 0.5040481679854495 - }, - { - "date": "2014-01-17", - "value": 0.5079346812032152 - }, - { - "date": "2014-01-18", - "value": 0.5049685486383059 - }, - { - "date": "2014-01-19", - "value": 0.501658667449764 - }, - { - "date": "2014-01-20", - "value": 0.5062171996366631 - }, - { - "date": "2014-01-21", - "value": 0.5099836766672865 - }, - { - "date": "2014-01-22", - "value": 0.5142091385990467 - }, - { - "date": "2014-01-23", - "value": 0.51791294997185 - }, - { - "date": "2014-01-24", - "value": 0.515437378755626 - }, - { - "date": "2014-01-25", - "value": 0.5108648416664958 - }, - { - "date": "2014-01-26", - "value": 0.5066707579977331 - }, - { - "date": "2014-01-27", - "value": 0.5082993886500073 - }, - { - "date": "2014-01-28", - "value": 0.508072158918364 - }, - { - "date": "2014-01-29", - "value": 0.5118157526668022 - }, - { - "date": "2014-01-30", - "value": 0.5086344978955772 - }, - { - "date": "2014-01-31", - "value": 0.5044280885188968 - }, - { - "date": "2014-02-01", - "value": 0.5030791435263089 - }, - { - "date": "2014-02-02", - "value": 0.502718430201384 - }, - { - "date": "2014-02-03", - "value": 0.5049505139164281 - }, - { - "date": "2014-02-04", - "value": 0.5004045433833447 - }, - { - "date": "2014-02-05", - "value": 0.49766880474999803 - }, - { - "date": "2014-02-06", - "value": 0.4974778854176423 - }, - { - "date": "2014-02-07", - "value": 0.4985548716459768 - }, - { - "date": "2014-02-08", - "value": 0.5023737776839208 - }, - { - "date": "2014-02-09", - "value": 0.504603230338525 - }, - { - "date": "2014-02-10", - "value": 0.504432332684573 - }, - { - "date": "2014-02-11", - "value": 0.5037437093637779 - }, - { - "date": "2014-02-12", - "value": 0.5086112226114583 - }, - { - "date": "2014-02-13", - "value": 0.5053845731032296 - }, - { - "date": "2014-02-14", - "value": 0.5015637131811963 - }, - { - "date": "2014-02-15", - "value": 0.5021784674076278 - }, - { - "date": "2014-02-16", - "value": 0.5063559353265494 - }, - { - "date": "2014-02-17", - "value": 0.5061080613055542 - }, - { - "date": "2014-02-18", - "value": 0.5088703428084825 - }, - { - "date": "2014-02-19", - "value": 0.5096209075909987 - }, - { - "date": "2014-02-20", - "value": 0.5128114425067571 - }, - { - "date": "2014-02-21", - "value": 0.5166249796532173 - }, - { - "date": "2014-02-22", - "value": 0.5139670211970626 - }, - { - "date": "2014-02-23", - "value": 0.5142364616064596 - }, - { - "date": "2014-02-24", - "value": 0.509528966467216 - }, - { - "date": "2014-02-25", - "value": 0.5061758737477107 - }, - { - "date": "2014-02-26", - "value": 0.5107159178338729 - }, - { - "date": "2014-02-27", - "value": 0.508788445629648 - }, - { - "date": "2014-02-28", - "value": 0.5104817721021337 - }, - { - "date": "2014-03-01", - "value": 0.5078546349712474 - }, - { - "date": "2014-03-02", - "value": 0.5034753798731827 - }, - { - "date": "2014-03-03", - "value": 0.5007772580143368 - }, - { - "date": "2014-03-04", - "value": 0.5038655942824244 - }, - { - "date": "2014-03-05", - "value": 0.5005272030781814 - }, - { - "date": "2014-03-06", - "value": 0.5051827393254152 - }, - { - "date": "2014-03-07", - "value": 0.5005534190016493 - }, - { - "date": "2014-03-08", - "value": 0.5018578155863522 - }, - { - "date": "2014-03-09", - "value": 0.5040739797833739 - }, - { - "date": "2014-03-10", - "value": 0.501067869219016 - }, - { - "date": "2014-03-11", - "value": 0.49814427475390644 - }, - { - "date": "2014-03-12", - "value": 0.4963610004168396 - }, - { - "date": "2014-03-13", - "value": 0.4930795253820748 - }, - { - "date": "2014-03-14", - "value": 0.49079904429566784 - }, - { - "date": "2014-03-15", - "value": 0.48809922877941647 - }, - { - "date": "2014-03-16", - "value": 0.4877332115117854 - }, - { - "date": "2014-03-17", - "value": 0.48411898100901407 - }, - { - "date": "2014-03-18", - "value": 0.4845248458179287 - }, - { - "date": "2014-03-19", - "value": 0.4831193157053157 - }, - { - "date": "2014-03-20", - "value": 0.4819550362933503 - }, - { - "date": "2014-03-21", - "value": 0.4786897823467451 - }, - { - "date": "2014-03-22", - "value": 0.4761045288827436 - }, - { - "date": "2014-03-23", - "value": 0.478630898886419 - }, - { - "date": "2014-03-24", - "value": 0.4790840508114705 - }, - { - "date": "2014-03-25", - "value": 0.4794318346558028 - }, - { - "date": "2014-03-26", - "value": 0.4748848817015309 - }, - { - "date": "2014-03-27", - "value": 0.47815004291090735 - }, - { - "date": "2014-03-28", - "value": 0.47980437734217457 - }, - { - "date": "2014-03-29", - "value": 0.4817800142504527 - }, - { - "date": "2014-03-30", - "value": 0.4768033811913309 - }, - { - "date": "2014-03-31", - "value": 0.47223012774930034 - }, - { - "date": "2014-04-01", - "value": 0.467614878310697 - }, - { - "date": "2014-04-02", - "value": 0.4690382217852809 - }, - { - "date": "2014-04-03", - "value": 0.4707312671717389 - }, - { - "date": "2014-04-04", - "value": 0.46874599002888123 - }, - { - "date": "2014-04-05", - "value": 0.4695232950365088 - }, - { - "date": "2014-04-06", - "value": 0.46812382634056693 - }, - { - "date": "2014-04-07", - "value": 0.4638152377393435 - }, - { - "date": "2014-04-08", - "value": 0.46846294509572217 - }, - { - "date": "2014-04-09", - "value": 0.46537117781745313 - }, - { - "date": "2014-04-10", - "value": 0.46667486617647175 - }, - { - "date": "2014-04-11", - "value": 0.4700567595482735 - }, - { - "date": "2014-04-12", - "value": 0.4722401087279864 - }, - { - "date": "2014-04-13", - "value": 0.4754113422480582 - }, - { - "date": "2014-04-14", - "value": 0.47237758499686866 - }, - { - "date": "2014-04-15", - "value": 0.476321568527422 - }, - { - "date": "2014-04-16", - "value": 0.4782068702675784 - }, - { - "date": "2014-04-17", - "value": 0.4745382598882709 - }, - { - "date": "2014-04-18", - "value": 0.4778251241650657 - }, - { - "date": "2014-04-19", - "value": 0.48001845981032665 - }, - { - "date": "2014-04-20", - "value": 0.47797297492254276 - }, - { - "date": "2014-04-21", - "value": 0.473354228995828 - }, - { - "date": "2014-04-22", - "value": 0.470896702947272 - }, - { - "date": "2014-04-23", - "value": 0.4745305949746629 - }, - { - "date": "2014-04-24", - "value": 0.47596513680604596 - }, - { - "date": "2014-04-25", - "value": 0.4731953889995623 - }, - { - "date": "2014-04-26", - "value": 0.4737532034837451 - }, - { - "date": "2014-04-27", - "value": 0.4710481041669472 - }, - { - "date": "2014-04-28", - "value": 0.46605544080317923 - }, - { - "date": "2014-04-29", - "value": 0.4631336037812991 - }, - { - "date": "2014-04-30", - "value": 0.46305963624370283 - } -]]
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/split_by.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/split_by.json deleted file mode 100644 index 3f06d9d..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/split_by.json +++ /dev/null @@ -1,548 +0,0 @@ - [ - { - "date": "2014-01-01", - "release": 110000000, - "beta": 4200000, - "alpha": 2600000 - }, - { - "date": "2014-01-02", - "release": 110379978, - "beta": 5379978, - "alpha": 2779978 - }, - { - "date": "2014-01-03", - "release": 110493749, - "beta": 5493749, - "alpha": 2893749 - }, - { - "date": "2014-01-04", - "release": 110785250, - "beta": 5785250, - "alpha": 2485250 - }, - { - "date": "2014-01-05", - "release": 113901904, - "beta": 13901904, - "alpha": 23901904 - }, - { - "date": "2014-01-06", - "release": 111576838, - "beta": 6576838, - "alpha": 5576838 - }, - { - "date": "2014-01-07", - "release": 114413854, - "beta": 7413854, - "alpha": 6413854 - }, - { - "date": "2014-01-08", - "release": 115177211, - "beta": 8177211, - "alpha": 5977211 - }, - { - "date": "2014-01-09", - "release": 116622100, - "beta": 9622100, - "alpha": 9122100 - }, - { - "date": "2014-01-10", - "release": 117381072, - "beta": 11381072, - "alpha": 11381072 - }, - { - "date": "2014-01-11", - "release": 118802310, - "beta": 10802310, - "alpha": 8802310 - }, - { - "date": "2014-01-12", - "release": 115531790, - "beta": 8531790, - "alpha": 8131790 - }, - { - "date": "2014-01-13", - "release": 115748881, - "beta": 8748881, - "alpha": 8848881 - }, - { - "date": "2014-01-14", - "release": 118706437, - "beta": 10706437, - "alpha": 10006437 - }, - { - "date": "2014-01-15", - "release": 119752685, - "beta": 12752685, - "alpha": 12752685 - }, - { - "date": "2014-01-16", - "release": 121016418, - "beta": 13016418, - "alpha": 13016418 - }, - { - "date": "2014-01-17", - "release": 125622924, - "beta": 17622924, - "alpha": 17622924 - }, - { - "date": "2014-01-18", - "release": 125337480, - "beta": 17337480, - "alpha": 12337480 - }, - { - "date": "2014-01-19", - "release": 122258882, - "beta": 14258882, - "alpha": 11218882 - }, - { - "date": "2014-01-20", - "release": 123829538, - "beta": 15829538, - "alpha": 15129538 - }, - { - "date": "2014-01-21", - "release": 124245689, - "beta": 16245689, - "alpha": 15215689 - }, - { - "date": "2014-01-22", - "release": 126429711, - "beta": 18429711, - "alpha": 18429711 - }, - { - "date": "2014-01-23", - "release": 126259017, - "beta": 18259017, - "alpha": 18259017 - }, - { - "date": "2014-01-24", - "release": 125396183, - "beta": 17396183, - "alpha": 12396183 - }, - { - "date": "2014-01-25", - "release": 123107346, - "beta": 15107346, - "alpha": 15107346 - }, - { - "date": "2014-01-26", - "release": 128659852, - "beta": 20659852, - "alpha": 10659852 - }, - { - "date": "2014-01-27", - "release": 125270783, - "beta": 17270783, - "alpha": 17270783 - }, - { - "date": "2014-01-28", - "release": 126270783, - "beta": 18270783, - "alpha": 18270783 - }, - { - "date": "2014-01-29", - "release": 127270783, - "beta": 19270783, - "alpha": 11270783 - }, - { - "date": "2014-01-30", - "release": 128270783, - "beta": 20270783, - "alpha": 20270783 - }, - { - "date": "2014-01-31", - "release": 129270783, - "beta": 21270783, - "alpha": 21270783 - }, - { - "date": "2014-02-01", - "release": 130270783, - "beta": 22270783, - "alpha": 22270783 - }, - { - "date": "2014-02-02", - "release": 131270783, - "beta": 23270783, - "alpha": 23270783 - }, - { - "date": "2014-02-03", - "release": 132270783, - "beta": 24270783, - "alpha": 24270783 - }, - { - "date": "2014-02-04", - "release": 133270783, - "beta": 25270783, - "alpha": 23270783 - }, - { - "date": "2014-02-05", - "release": 128270783, - "beta": 20270783, - "alpha": 20270783 - }, - { - "date": "2014-02-06", - "release": 127270783, - "beta": 19270783, - "alpha": 19270783 - }, - { - "date": "2014-02-07", - "release": 135270783, - "beta": 27270783, - "alpha": 27270783 - }, - { - "date": "2014-02-08", - "release": 134270783, - "beta": 26270783, - "alpha": 26270783 - }, - { - "date": "2014-02-09", - "release": 128270783, - "beta": 20270783, - "alpha": 20270783 - }, - { - "date": "2014-02-10", - "release": 135270783, - "beta": 27270783, - "alpha": 24270783 - }, - { - "date": "2014-02-11", - "release": 136270783, - "beta": 28270783, - "alpha": 28270783 - }, - { - "date": "2014-02-12", - "release": 134127078, - "beta": 26127078, - "alpha": 26127078 - }, - { - "date": "2014-02-13", - "release": 133124078, - "beta": 25124078, - "alpha": 25124078 - }, - { - "date": "2014-02-14", - "release": 136227078, - "beta": 28227078, - "alpha": 26127078 - }, - { - "date": "2014-02-15", - "release": 137827078, - "beta": 29827078, - "alpha": 29827078 - }, - { - "date": "2014-02-16", - "release": 136427073, - "beta": 28427073, - "alpha": 28427073 - }, - { - "date": "2014-02-17", - "release": 137570783, - "beta": 29570783, - "alpha": 29570783 - }, - { - "date": "2014-02-18", - "release": 138627073, - "beta": 30627073, - "alpha": 30627073 - }, - { - "date": "2014-02-19", - "release": 137727078, - "beta": 29727078, - "alpha": 29727078 - }, - { - "date": "2014-02-20", - "release": 138827073, - "beta": 30827073, - "alpha": 30827073 - }, - { - "date": "2014-02-21", - "release": 140927078, - "beta": 32927078, - "alpha": 32927078 - }, - { - "date": "2014-02-22", - "release": 141027078, - "beta": 33027078, - "alpha": 40027078 - }, - { - "date": "2014-02-23", - "release": 142127073, - "beta": 34127073, - "alpha": 34127073 - }, - { - "date": "2014-02-24", - "release": 143220783, - "beta": 35220783, - "alpha": 35220783 - }, - { - "date": "2014-02-25", - "release": 144327078, - "beta": 36327078, - "alpha": 36327078 - }, - { - "date": "2014-02-26", - "release": 140427078, - "beta": 32427078, - "alpha": 32427078 - }, - { - "date": "2014-02-27", - "release": 141027078, - "beta": 33027078, - "alpha": 33027078 - }, - { - "date": "2014-02-28", - "release": 145627078, - "beta": 37627078, - "alpha": 37627078 - }, - { - "date": "2014-03-01", - "release": 144727078, - "beta": 36727078, - "alpha": 36727078 - }, - { - "date": "2014-03-02", - "release": 144227078, - "beta": 36227078, - "alpha": 36227078 - }, - { - "date": "2014-03-03", - "release": 145227078, - "beta": 37227078, - "alpha": 37227078 - }, - { - "date": "2014-03-04", - "release": 146027078, - "beta": 38027078, - "alpha": 38027078 - }, - { - "date": "2014-03-05", - "release": 146927078, - "beta": 38927078, - "alpha": 38927078 - }, - { - "date": "2014-03-06", - "release": 147027078, - "beta": 39027078, - "alpha": 39027078 - }, - { - "date": "2014-03-07", - "release": 146227078, - "beta": 38227078, - "alpha": 32427078 - }, - { - "date": "2014-03-08", - "release": 147027078, - "beta": 39027078, - "alpha": 39027078 - }, - { - "date": "2014-03-09", - "release": 148027078, - "beta": 40027078, - "alpha": 40027078 - }, - { - "date": "2014-03-10", - "release": 147027078, - "beta": 39027078, - "alpha": 39027078 - }, - { - "date": "2014-03-11", - "release": 147027078, - "beta": 39027078, - "alpha": 37027078 - }, - { - "date": "2014-03-12", - "release": 148017078, - "beta": 40017078, - "alpha": 38817078 - }, - { - "date": "2014-03-13", - "release": 148077078, - "beta": 40077078, - "alpha": 40077078 - }, - { - "date": "2014-03-14", - "release": 148087078, - "beta": 40087078, - "alpha": 40087078 - }, - { - "date": "2014-03-15", - "release": 148017078, - "beta": 40017078, - "alpha": 40017078 - }, - { - "date": "2014-03-16", - "release": 148047078, - "beta": 40047078, - "alpha": 40047078 - }, - { - "date": "2014-03-17", - "release": 148067078, - "beta": 40067078, - "alpha": 40067078 - }, - { - "date": "2014-03-18", - "release": 148077078, - "beta": 40077078, - "alpha": 39977078 - }, - { - "date": "2014-03-19", - "release": 148027074, - "beta": 40027074, - "alpha": 40027074 - }, - { - "date": "2014-03-20", - "release": 148927079, - "beta": 40927079, - "alpha": 40927079 - }, - { - "date": "2014-03-21", - "release": 148727071, - "beta": 40727071, - "alpha": 40727071 - }, - { - "date": "2014-03-22", - "release": 148127072, - "beta": 40127072, - "alpha": 37127072 - }, - { - "date": "2014-03-23", - "release": 148527072, - "beta": 40527072, - "alpha": 40527072 - }, - { - "date": "2014-03-24", - "release": 148627027, - "beta": 40627027, - "alpha": 40627027 - }, - { - "date": "2014-03-25", - "release": 148027040, - "beta": 40027040, - "alpha": 40027040 - }, - { - "date": "2014-03-26", - "release": 148027043, - "beta": 40027043, - "alpha": 40027043 - }, - { - "date": "2014-03-27", - "release": 148057022, - "beta": 40057022, - "alpha": 40057022 - }, - { - "date": "2014-03-28", - "release": 149057022, - "beta": 41057022, - "alpha": 40057022 - }, - { - "date": "2014-03-29", - "release": 150057022, - "beta": 42057022, - "alpha": 42057022 - }, - { - "date": "2014-03-30", - "release": 151057022, - "beta": 43057022, - "alpha": 43057022 - }, - { - "date": "2014-03-31", - "release": 152057022, - "beta": 44057022, - "alpha": 44057022 - }, - { - "date": "2014-04-01", - "release": 152056143, - "beta": 45056143, - "alpha": 42056143 - } - ]
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/ufo-sightings.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/ufo-sightings.json deleted file mode 100644 index 26caedd..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/ufo-sightings.json +++ /dev/null @@ -1,266 +0,0 @@ -[ - { - "year": "1945", - "sightings": 6 - }, - { - "year": "1946", - "sightings": 8 - }, - { - "year": "1947", - "sightings": 34 - }, - { - "year": "1948", - "sightings": 8 - }, - { - "year": "1949", - "sightings": 15 - }, - { - "year": "1950", - "sightings": 25 - }, - { - "year": "1951", - "sightings": 20 - }, - { - "year": "1952", - "sightings": 48 - }, - { - "year": "1953", - "sightings": 34 - }, - { - "year": "1954", - "sightings": 50 - }, - { - "year": "1955", - "sightings": 31 - }, - { - "year": "1956", - "sightings": 38 - }, - { - "year": "1957", - "sightings": 67 - }, - { - "year": "1958", - "sightings": 40 - }, - { - "year": "1959", - "sightings": 47 - }, - { - "year": "1960", - "sightings": 64 - }, - { - "year": "1961", - "sightings": 39 - }, - { - "year": "1962", - "sightings": 55 - }, - { - "year": "1963", - "sightings": 75 - }, - { - "year": "1964", - "sightings": 77 - }, - { - "year": "1965", - "sightings": 167 - }, - { - "year": "1966", - "sightings": 169 - }, - { - "year": "1967", - "sightings": 178 - }, - { - "year": "1968", - "sightings": 183 - }, - { - "year": "1969", - "sightings": 138 - }, - { - "year": "1970", - "sightings": 126 - }, - { - "year": "1971", - "sightings": 110 - }, - { - "year": "1972", - "sightings": 146 - }, - { - "year": "1973", - "sightings": 209 - }, - { - "year": "1974", - "sightings": 241 - }, - { - "year": "1975", - "sightings": 279 - }, - { - "year": "1976", - "sightings": 246 - }, - { - "year": "1977", - "sightings": 239 - }, - { - "year": "1978", - "sightings": 301 - }, - { - "year": "1979", - "sightings": 221 - }, - { - "year": "1980", - "sightings": 211 - }, - { - "year": "1981", - "sightings": 146 - }, - { - "year": "1982", - "sightings": 182 - }, - { - "year": "1983", - "sightings": 132 - }, - { - "year": "1984", - "sightings": 172 - }, - { - "year": "1985", - "sightings": 192 - }, - { - "year": "1986", - "sightings": 173 - }, - { - "year": "1987", - "sightings": 193 - }, - { - "year": "1988", - "sightings": 203 - }, - { - "year": "1989", - "sightings": 220 - }, - { - "year": "1990", - "sightings": 217 - }, - { - "year": "1991", - "sightings": 210 - }, - { - "year": "1992", - "sightings": 228 - }, - { - "year": "1993", - "sightings": 285 - }, - { - "year": "1994", - "sightings": 381 - }, - { - "year": "1995", - "sightings": 1336 - }, - { - "year": "1996", - "sightings": 862 - }, - { - "year": "1997", - "sightings": 1248 - }, - { - "year": "1998", - "sightings": 1812 - }, - { - "year": "1999", - "sightings": 2906 - }, - { - "year": "2000", - "sightings": 2780 - }, - { - "year": "2001", - "sightings": 3105 - }, - { - "year": "2002", - "sightings": 3176 - }, - { - "year": "2003", - "sightings": 3896 - }, - { - "year": "2004", - "sightings": 4208 - }, - { - "year": "2005", - "sightings": 3996 - }, - { - "year": "2006", - "sightings": 3590 - }, - { - "year": "2007", - "sightings": 4195 - }, - { - "year": "2008", - "sightings": 4705 - }, - { - "year": "2009", - "sightings": 4297 - }, - { - "year": "2010", - "sightings": 2531 - } -]
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/ufo_dates.csv b/priv/static/metrics-graphics-3.0-alpha3/examples/data/ufo_dates.csv deleted file mode 100644 index b7fe149..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/ufo_dates.csv +++ /dev/null @@ -1,22841 +0,0 @@ -value -30 -0 -203 -0 -30 -0 -0 -116 -180 -57 -0 -0 -2 -75 -0 -0 -21 -25 -2 -0 -29 -0 -101 -27 -43 -0 -770 -0 -24 -0 -0 -39 -0 -2 -24 -21 -25 -1 -27 -1866 -113 -0 -1 -1 -876 -1 -0 -0 -68 -287 -1 -257 -31 -299 -176 -21 -51 -51 -51 -25 -20 -91 -24 -0 -0 -48 -279 -70 -52 -22 -100 -50 -80 -1 -10 -0 -3059 -3059 -3059 -4 -74 -26 -383 -0 -3227 -32 -315 -0 -0 -28 -34 -1 -35 -84 -20 -0 -94 -21 -730 -203 -3 -30 -5 -0 -1 -1013 -84 -8 -2056 -7 -75 -291 -291 -291 -570 -4582 -4582 -4582 -148 -415 -139 -30 -0 -6 -40 -237 -3318 -3318 -3318 -253 -106 -162 -356 -121 -1172 -41 -525 -320 -320 -320 -1632 -1632 -1632 -1437 -1267 -64 -149 -67 -0 -29 -33 -115 -482 -1 -434 -65 -219 -0 -142 -157 -13 -0 -27 -24 -1464 -1464 -1464 -56 -422 -1 -775 -367 -90 -189 -0 -1636 -631 -3261 -3261 -3261 -137 -20 -30 -1268 -1268 -1268 -115 -153 -193 -3 -20 -0 -1 -0 -162 -726 -16 -2069 -53 -786 -552 -46 -148 -28 -205 -3 -0 -0 -98 -4006 -4006 -4006 -37 -2 -49 -25 -211 -135 -541 -549 -56 -184 -1398 -1398 -1398 -2602 -2602 -2602 -178 -331 -49 -598 -2219 -28 -8 -65 -3653 -3653 -3653 -2552 -2552 -2552 -31 -1233 -28 -69 -126 -585 -22 -89 -35 -97 -36 -32 -430 -4241 -4241 -4241 -4513 -4513 -4513 -132 -701 -21 -493 -119 -784 -346 -149 -0 -43 -101 -20 -28 -398 -23 -980 -343 -51 -1183 -58 -61 -358 -977 -938 -1 -22 -567 -622 -2341 -1166 -194 -1044 -292 -942 -754 -39 -2 -642 -99 -35 -23 -140 -2534 -280 -3228 -3228 -3228 -36 -40 -37 -1424 -40 -309 -36 -48 -87 -1 -627 -155 -155 -155 -326 -178 -481 -1321 -1321 -1321 -2310 -2310 -2310 -32 -3773 -3773 -3773 -63 -729 -406 -369 -119 -119 -119 -4193 -4193 -4193 -799 -677 -912 -2197 -2197 -2197 -23 -56 -1203 -1203 -1203 -1030 -224 -363 -1746 -1746 -1746 -23 -417 -2340 -4634 -4634 -4634 -610 -350 -320 -3 -115 -3 -23 -202 -47 -4001 -4001 -4001 -0 -0 -211 -211 -211 -0 -2 -133 -1588 -1588 -1588 -53 -34 -4 -12 -21 -238 -144 -144 -144 -11 -74 -280 -107 -24 -343 -68 -46 -38 -339 -1922 -0 -1947 -1947 -1947 -3187 -29 -61 -55 -47 -104 -179 -1446 -1 -238 -669 -3 -79 -61 -5 -581 -1112 -24 -52 -316 -203 -39 -226 -106 -106 -106 -0 -203 -137 -4411 -4411 -4411 -120 -36 -722 -27 -681 -105 -135 -21 -215 -0 -69 -81 -65 -4 -104 -792 -2327 -74 -20 -30 -42 -0 -4300 -4300 -4300 -92 -113 -28 -392 -20 -37 -115 -31 -607 -241 -169 -104 -27 -84 -403 -2205 -3447 -3447 -3447 -213 -21 -36 -989 -888 -888 -888 -0 -206 -14 -98 -98 -98 -325 -87 -172 -299 -1193 -208 -2862 -203 -727 -727 -727 -409 -3770 -3770 -3770 -56 -87 -582 -582 -582 -614 -3067 -3067 -3067 -252 -2272 -2272 -2272 -3911 -21 -451 -894 -49 -268 -268 -268 -0 -151 -212 -575 -23 -1063 -2 -21 -159 -440 -979 -3183 -3183 -3183 -1805 -217 -280 -90 -1110 -2480 -444 -1382 -2523 -2523 -2523 -22 -131 -35 -125 -388 -3502 -3502 -3502 -30 -26 -64 -1830 -1830 -1830 -1268 -3604 -3604 -3604 -967 -41 -483 -46 -972 -84 -21 -906 -0 -0 -3 -576 -365 -2885 -2885 -2885 -365 -1 -236 -634 -99 -477 -49 -114 -34 -1381 -702 -395 -775 -255 -4660 -4660 -4660 -116 -803 -289 -2432 -2432 -2432 -148 -28 -1206 -98 -67 -2639 -185 -1205 -1511 -1463 -24 -1290 -450 -1 -1370 -3315 -2558 -181 -0 -1380 -1380 -1380 -174 -2507 -2507 -2507 -29 -286 -525 -1732 -70 -99 -8 -21 -95 -2163 -664 -664 -664 -21 -33 -56 -3138 -28 -1 -1361 -37 -0 -36 -33 -38 -260 -90 -0 -582 -972 -302 -4854 -4854 -4854 -7 -485 -53 -4636 -4636 -4636 -55 -89 -255 -186 -93 -22 -2032 -23 -63 -3524 -3524 -3524 -2596 -2596 -2596 -2843 -4589 -4589 -4589 -1172 -367 -26 -22 -350 -15 -278 -122 -1202 -185 -0 -1593 -1593 -1593 -32 -39 -916 -23 -577 -526 -1231 -36 -34 -502 -52 -0 -2084 -2084 -2084 -853 -853 -853 -21 -82 -195 -1592 -1592 -1592 -22 -4372 -4372 -4372 -1 -9 -904 -904 -904 -474 -1135 -100 -1490 -1284 -25 -2415 -2415 -2415 -44 -140 -352 -220 -345 -48 -25 -147 -82 -360 -1487 -1487 -1487 -1601 -1601 -1601 -20 -1536 -29 -410 -1077 -0 -161 -161 -161 -3949 -3949 -3949 -1139 -257 -29 -44 -62 -62 -62 -582 -582 -582 -130 -1076 -320 -1 -61 -214 -2782 -64 -41 -283 -30 -520 -454 -2454 -2454 -2454 -388 -7 -950 -45 -80 -190 -5 -189 -1933 -1933 -1933 -26 -2 -470 -73 -1513 -434 -1410 -1410 -1410 -559 -3363 -3363 -3363 -0 -441 -525 -1070 -0 -1834 -1506 -41 -32 -404 -0 -808 -166 -53 -2 -834 -0 -136 -24 -404 -1056 -1 -3284 -3284 -3284 -4662 -4662 -4662 -1009 -1009 -1009 -40 -1326 -25 -1542 -195 -49 -31 -45 -21 -1436 -25 -1476 -1476 -1476 -1194 -49 -2002 -51 -2 -3734 -3734 -3734 -455 -1209 -243 -48 -34 -393 -1160 -1160 -1160 -1020 -368 -34 -1 -31 -47 -103 -109 -540 -3212 -3212 -3212 -460 -1958 -1958 -1958 -30 -1121 -1959 -1959 -1959 -411 -93 -203 -1425 -190 -245 -2088 -280 -280 -280 -2290 -94 -4755 -4755 -4755 -1 -25 -3512 -3512 -3512 -53 -59 -1887 -1887 -1887 -33 -45 -55 -24 -1872 -741 -1405 -1405 -1405 -1098 -85 -31 -92 -94 -148 -397 -393 -445 -2476 -56 -1182 -711 -789 -0 -48 -264 -104 -839 -780 -780 -780 -360 -533 -0 -27 -2625 -1851 -697 -53 -1342 -4443 -4443 -4443 -23 -1 -112 -3118 -1535 -4705 -4705 -4705 -1 -3 -397 -679 -1489 -202 -202 -202 -72 -1199 -1275 -1259 -2028 -2028 -2028 -32 -360 -1076 -1076 -1076 -1042 -1776 -155 -63 -39 -3698 -563 -146 -40 -125 -1218 -3873 -4683 -4683 -4683 -68 -811 -79 -22 -514 -31 -362 -153 -714 -1188 -1188 -1188 -501 -4037 -4037 -4037 -900 -2653 -2653 -2653 -1557 -1557 -1557 -2174 -29 -0 -32 -3332 -3332 -3332 -32 -31 -349 -2 -307 -349 -828 -4 -764 -27 -4044 -1 -14 -3327 -3327 -3327 -480 -480 -480 -171 -99 -22 -4321 -4321 -4321 -35 -101 -20 -68 -101 -59 -0 -489 -27 -55 -43 -1648 -1648 -1648 -1 -4 -1769 -68 -1273 -646 -639 -1557 -452 -216 -1070 -1229 -1229 -1229 -701 -142 -3494 -2 -149 -365 -608 -370 -30 -0 -2388 -2388 -2388 -27 -314 -603 -24 -333 -333 -333 -2736 -2736 -2736 -365 -417 -2808 -2808 -2808 -2201 -3341 -3341 -3341 -1327 -42 -366 -366 -366 -249 -23 -56 -1258 -486 -93 -210 -2581 -2581 -2581 -810 -49 -251 -251 -251 -205 -1100 -135 -75 -155 -160 -82 -960 -2037 -2110 -75 -3421 -3421 -3421 -158 -37 -873 -70 -674 -4606 -4606 -4606 -192 -4435 -4435 -4435 -2251 -1 -848 -220 -0 -155 -768 -768 -768 -54 -31 -1460 -1460 -1460 -168 -102 -342 -3147 -3147 -3147 -128 -37 -1856 -161 -614 -520 -27 -480 -54 -4166 -838 -92 -512 -219 -219 -219 -661 -75 -220 -812 -27 -1976 -1899 -41 -172 -4975 -4975 -4975 -4709 -4709 -4709 -2734 -2734 -2734 -3147 -3147 -3147 -505 -231 -231 -231 -44 -31 -271 -62 -862 -276 -36 -18 -228 -497 -4279 -4279 -4279 -606 -1 -29 -496 -152 -223 -63 -1196 -156 -78 -221 -368 -1954 -1954 -1954 -271 -4 -101 -2336 -398 -262 -2297 -2060 -4252 -2905 -2905 -2905 -35 -598 -1417 -175 -1280 -1280 -1280 -55 -1176 -2453 -1921 -1921 -1921 -48 -1729 -1397 -71 -0 -1748 -2 -223 -336 -1603 -1332 -28 -90 -1545 -2630 -1347 -120 -3668 -3668 -3668 -0 -477 -2780 -2399 -2399 -2399 -2497 -46 -1250 -282 -26 -28 -2064 -7 -58 -4926 -4926 -4926 -160 -392 -281 -1006 -1025 -133 -4877 -4877 -4877 -185 -139 -399 -276 -4065 -4065 -4065 -4840 -4840 -4840 -1948 -25 -184 -184 -184 -154 -1636 -30 -71 -497 -698 -698 -698 -1813 -21 -3 -135 -47 -729 -207 -804 -31 -5 -252 -32 -657 -2 -1342 -497 -166 -522 -102 -1657 -1657 -1657 -157 -1282 -1282 -1282 -365 -365 -365 -3726 -3726 -3726 -263 -84 -170 -562 -27 -43 -2045 -2045 -2045 -3 -325 -144 -4646 -4646 -4646 -1611 -82 -1601 -1601 -1601 -1656 -1656 -1656 -259 -963 -900 -1107 -1225 -543 -56 -0 -876 -2235 -2235 -2235 -218 -378 -378 -378 -4806 -4806 -4806 -276 -53 -176 -2050 -3659 -1167 -804 -117 -3113 -3113 -3113 -130 -1118 -133 -48 -2 -1 -206 -55 -55 -55 -2049 -366 -558 -64 -1729 -85 -95 -608 -91 -28 -105 -153 -342 -15 -0 -438 -20 -644 -1750 -276 -3458 -3458 -3458 -89 -1274 -551 -971 -294 -302 -1000 -172 -107 -21 -23 -1 -371 -104 -2222 -2 -27 -4976 -4976 -4976 -1663 -1663 -1663 -3121 -3121 -3121 -296 -672 -754 -83 -38 -710 -4678 -4678 -4678 -2 -2128 -2128 -2128 -48 -198 -489 -8 -798 -580 -0 -34 -4840 -4840 -4840 -44 -1419 -2838 -2838 -2838 -22 -463 -4657 -4657 -4657 -1651 -310 -0 -35 -31 -3618 -3618 -3618 -3795 -3795 -3795 -1498 -2 -1377 -347 -147 -32 -114 -303 -52 -510 -510 -510 -30 -35 -683 -0 -4983 -4983 -4983 -579 -42 -1162 -3189 -3189 -3189 -165 -1 -2872 -2872 -2872 -47 -1355 -1092 -2108 -2108 -2108 -4373 -15 -322 -1053 -213 -331 -344 -23 -1477 -1477 -1477 -2190 -2190 -2190 -114 -62 -650 -41 -1439 -1439 -1439 -30 -595 -1882 -1186 -25 -334 -4677 -4677 -4677 -91 -4091 -528 -1756 -1756 -1756 -45 -40 -316 -0 -279 -1634 -673 -61 -1517 -66 -407 -106 -251 -22 -3731 -3731 -3731 -218 -533 -85 -1050 -1050 -1050 -458 -1435 -363 -94 -1431 -126 -930 -3655 -1461 -1 -755 -231 -36 -271 -2843 -92 -48 -0 -603 -30 -320 -131 -24 -1369 -30 -1390 -308 -1 -2823 -2823 -2823 -3691 -3691 -3691 -1934 -373 -548 -726 -50 -1406 -783 -304 -353 -35 -670 -365 -344 -628 -1885 -1885 -1885 -30 -60 -34 -34 -2550 -691 -3172 -3172 -3172 -35 -978 -4810 -4810 -4810 -127 -7 -4430 -4430 -4430 -2173 -378 -340 -719 -26 -642 -646 -4585 -4585 -4585 -549 -3227 -3227 -3227 -50 -378 -67 -2 -66 -89 -308 -964 -467 -4986 -4986 -4986 -4343 -4343 -4343 -789 -139 -32 -18 -172 -954 -44 -3285 -3285 -3285 -2 -1485 -24 -885 -81 -12 -2364 -292 -415 -1376 -4366 -4366 -4366 -29 -902 -140 -85 -1208 -0 -522 -26 -1847 -622 -701 -701 -701 -1072 -1072 -1072 -59 -25 -190 -921 -55 -77 -53 -4387 -4387 -4387 -2173 -2173 -2173 -749 -63 -0 -703 -703 -703 -143 -125 -181 -15 -190 -715 -4029 -4029 -4029 -27 -2042 -2042 -2042 -2221 -195 -253 -605 -96 -62 -48 -47 -36 -2387 -2387 -2387 -22 -192 -38 -91 -1721 -396 -396 -396 -42 -374 -64 -85 -584 -25 -1944 -46 -1052 -1052 -1052 -340 -22 -33 -104 -0 -852 -21 -419 -2292 -2292 -2292 -57 -64 -1815 -312 -1843 -1843 -1843 -320 -79 -269 -369 -369 -369 -78 -3141 -3141 -3141 -44 -64 -4418 -30 -92 -175 -97 -4724 -4724 -4724 -828 -3451 -415 -4148 -4148 -4148 -46 -224 -0 -2198 -2198 -2198 -1212 -1212 -1212 -31 -1129 -161 -1908 -1908 -1908 -714 -322 -42 -3816 -3816 -3816 -33 -249 -249 -249 -3 -22 -48 -1641 -3635 -3788 -3788 -3788 -215 -592 -1660 -1471 -447 -2 -0 -1 -665 -1202 -615 -1575 -277 -277 -277 -38 -397 -30 -1166 -1118 -116 -76 -52 -946 -21 -57 -153 -55 -41 -1900 -31 -2964 -2964 -2964 -473 -4095 -4095 -4095 -0 -1771 -733 -21 -162 -625 -1118 -20 -376 -395 -395 -395 -4 -4023 -4023 -4023 -628 -3671 -3671 -3671 -1 -781 -675 -334 -83 -619 -580 -56 -95 -85 -44 -23 -1096 -150 -31 -1811 -1811 -1811 -3033 -3033 -3033 -747 -747 -747 -146 -243 -2149 -497 -25 -206 -764 -764 -764 -4357 -4357 -4357 -4720 -4720 -4720 -339 -25 -0 -310 -188 -4041 -4041 -4041 -50 -706 -733 -64 -722 -4077 -4077 -4077 -4515 -4515 -4515 -1213 -1448 -1165 -0 -26 -67 -2379 -2379 -2379 -59 -84 -38 -1474 -351 -494 -808 -26 -311 -311 -311 -180 -1638 -1638 -1638 -1834 -1834 -1834 -22 -3732 -3732 -3732 -70 -237 -96 -2878 -133 -610 -4369 -4369 -4369 -53 -1017 -1017 -1017 -765 -765 -765 -1050 -1050 -1050 -23 -1253 -282 -318 -375 -7 -2054 -409 -31 -18 -0 -37 -3 -42 -370 -91 -31 -914 -270 -733 -31 -183 -31 -1 -11 -633 -1 -101 -101 -101 -27 -70 -186 -248 -24 -1836 -243 -28 -880 -30 -133 -27 -20 -792 -363 -1063 -27 -24 -5 -633 -633 -633 -37 -722 -1562 -1562 -1562 -0 -0 -16 -54 -39 -277 -857 -15 -1097 -38 -802 -1065 -34 -3223 -3223 -3223 -38 -1957 -1957 -1957 -513 -604 -23 -3337 -3337 -3337 -881 -590 -30 -9 -7 -274 -22 -23 -3253 -3253 -3253 -105 -58 -130 -843 -843 -843 -160 -191 -223 -223 -223 -196 -1844 -1844 -1844 -1 -9 -1 -53 -25 -908 -769 -398 -2116 -22 -263 -2974 -3442 -3442 -3442 -49 -801 -24 -24 -911 -68 -69 -255 -321 -26 -41 -0 -337 -20 -817 -1865 -2922 -2922 -2922 -350 -55 -71 -1974 -1974 -1974 -131 -911 -911 -911 -4947 -4947 -4947 -1 -25 -21 -372 -41 -141 -44 -3 -1 -761 -23 -1960 -1960 -1960 -25 -76 -269 -799 -799 -799 -903 -903 -903 -11 -7 -48 -3 -28 -4737 -4737 -4737 -176 -1 -3344 -800 -0 -132 -1869 -1869 -1869 -21 -24 -199 -27 -43 -1 -71 -1 -4176 -4176 -4176 -1843 -1843 -1843 -4106 -4106 -4106 -80 -1015 -1015 -1015 -110 -1460 -122 -2947 -28 -12 -0 -30 -36 -112 -141 -756 -61 -71 -282 -27 -1816 -1816 -1816 -2302 -1726 -125 -89 -41 -234 -0 -124 -22 -4127 -4127 -4127 -4546 -4546 -4546 -805 -70 -0 -1592 -568 -851 -28 -4449 -4449 -4449 -0 -0 -327 -884 -1 -1261 -338 -322 -64 -90 -85 -0 -43 -239 -8 -118 -1512 -841 -452 -251 -859 -45 -789 -1550 -22 -1 -26 -120 -1370 -24 -50 -0 -231 -1056 -21 -218 -885 -129 -20 -2590 -2590 -2590 -377 -0 -2639 -2639 -2639 -1556 -1556 -1556 -33 -872 -24 -0 -1080 -0 -4145 -4145 -4145 -32 -0 -33 -1122 -3058 -51 -1561 -2263 -2263 -2263 -34 -39 -0 -4443 -4443 -4443 -889 -346 -1295 -1 -1894 -1894 -1894 -21 -32 -3303 -3303 -3303 -23 -102 -1 -59 -46 -836 -3319 -3319 -3319 -1408 -20 -924 -563 -563 -563 -2846 -2846 -2846 -1 -370 -1646 -4339 -46 -915 -952 -3609 -548 -1220 -2 -369 -539 -539 -539 -4528 -4528 -4528 -513 -148 -3166 -1910 -1910 -1910 -930 -79 -127 -21 -545 -864 -591 -3723 -539 -120 -367 -20 -24 -222 -162 -56 -23 -484 -4 -59 -1 -162 -240 -9 -458 -952 -1022 -32 -20 -155 -131 -51 -26 -1 -4414 -4414 -4414 -1134 -0 -360 -0 -147 -70 -890 -126 -29 -114 -771 -860 -609 -22 -68 -977 -173 -1181 -20 -2668 -2668 -2668 -45 -40 -367 -113 -958 -863 -863 -863 -180 -26 -1 -43 -1611 -1611 -1611 -1376 -24 -4714 -4714 -4714 -2983 -2983 -2983 -3 -0 -0 -1096 -31 -64 -4195 -4195 -4195 -185 -3939 -3939 -3939 -784 -334 -22 -26 -3531 -3531 -3531 -1599 -1599 -1599 -4127 -4127 -4127 -54 -126 -1055 -79 -371 -1187 -28 -0 -116 -1645 -170 -22 -1960 -458 -550 -25 -39 -43 -269 -892 -1 -0 -592 -592 -592 -1 -555 -555 -555 -1822 -1822 -1822 -14 -1463 -1463 -1463 -52 -365 -92 -41 -36 -3079 -3079 -3079 -1156 -525 -604 -2606 -1671 -201 -2249 -2249 -2249 -29 -345 -2938 -24 -3875 -3875 -3875 -925 -925 -925 -366 -31 -298 -177 -185 -36 -189 -546 -486 -1 -52 -1267 -71 -1718 -2325 -2325 -2325 -4059 -47 -1646 -1687 -38 -739 -499 -37 -608 -23 -22 -6 -103 -38 -0 -101 -3431 -3431 -3431 -4044 -4044 -4044 -225 -527 -905 -905 -905 -3387 -3387 -3387 -46 -519 -376 -376 -376 -2344 -216 -743 -743 -743 -3671 -3671 -3671 -328 -508 -41 -4001 -4001 -4001 -88 -1 -25 -365 -40 -1543 -374 -461 -324 -2402 -2 -1983 -1983 -1983 -2073 -441 -24 -145 -137 -4993 -4993 -4993 -36 -1 -155 -317 -54 -276 -260 -2396 -3463 -3463 -3463 -1137 -4 -96 -3201 -3201 -3201 -2 -60 -2369 -1567 -1 -235 -113 -52 -392 -2360 -175 -175 -175 -415 -1269 -1269 -1269 -0 -30 -632 -207 -365 -3434 -3434 -3434 -222 -167 -1428 -3867 -3867 -3867 -1723 -172 -99 -1030 -192 -316 -911 -124 -1066 -43 -236 -3589 -575 -449 -65 -366 -76 -1382 -547 -104 -2 -1947 -1947 -1947 -187 -198 -3554 -3554 -3554 -1378 -51 -4624 -185 -217 -3 -258 -4650 -4650 -4650 -47 -1071 -61 -976 -37 -978 -978 -978 -1717 -1717 -1717 -12 -493 -0 -784 -22 -1193 -1193 -1193 -50 -2310 -1299 -7 -1271 -1271 -1271 -3098 -62 -29 -667 -341 -358 -4075 -4075 -4075 -2738 -2738 -2738 -3564 -3564 -3564 -2472 -186 -2 -132 -409 -545 -1283 -1283 -1283 -1479 -593 -592 -231 -231 -231 -1 -2524 -2524 -2524 -157 -3725 -151 -334 -2503 -1063 -1063 -1063 -11 -761 -29 -53 -579 -74 -129 -32 -233 -3821 -3821 -3821 -1287 -102 -923 -339 -79 -146 -2470 -2470 -2470 -101 -64 -2965 -2965 -2965 -209 -1 -1731 -367 -156 -223 -194 -20 -1081 -1081 -1081 -62 -40 -518 -220 -317 -1081 -4213 -4213 -4213 -1743 -3607 -3607 -3607 -1487 -664 -519 -1 -2511 -321 -3370 -3370 -3370 -32 -36 -1738 -111 -1228 -1228 -1228 -30 -35 -421 -942 -942 -942 -18 -29 -611 -205 -4981 -4981 -4981 -998 -974 -2763 -2856 -2856 -2856 -3996 -3996 -3996 -99 -1036 -1036 -1036 -367 -1664 -367 -367 -367 -1167 -111 -372 -796 -796 -796 -113 -113 -113 -210 -56 -127 -791 -47 -855 -65 -1140 -22 -448 -1224 -21 -33 -1147 -113 -119 -557 -26 -48 -226 -315 -0 -302 -60 -1189 -1189 -1189 -3124 -3124 -3124 -5 -25 -47 -37 -923 -1733 -1733 -1733 -22 -0 -21 -179 -0 -679 -692 -1 -1059 -1059 -1059 -24 -43 -0 -3843 -3843 -3843 -4 -1 -2728 -1727 -2536 -1123 -0 -2947 -10 -3874 -3874 -3874 -4260 -962 -225 -1821 -84 -0 -3576 -3576 -3576 -138 -3474 -3474 -3474 -4045 -4045 -4045 -1093 -36 -3406 -133 -113 -236 -249 -2737 -53 -1757 -157 -968 -0 -848 -59 -2094 -2094 -2094 -304 -1978 -29 -921 -1 -3757 -3757 -3757 -306 -20 -145 -26 -189 -4678 -4678 -4678 -202 -76 -28 -94 -74 -18 -1429 -634 -0 -1420 -35 -147 -339 -2240 -2240 -2240 -22 -1752 -101 -4878 -4878 -4878 -230 -112 -38 -71 -359 -39 -74 -1795 -30 -3990 -3990 -3990 -40 -2572 -2572 -2572 -383 -30 -836 -55 -29 -356 -1738 -35 -1839 -1839 -1839 -2125 -2125 -2125 -761 -96 -23 -204 -6 -53 -1 -1829 -125 -284 -743 -26 -20 -301 -1867 -3889 -3889 -3889 -327 -281 -2999 -2999 -2999 -1151 -22 -66 -725 -1367 -4 -4601 -4601 -4601 -6 -706 -89 -25 -545 -44 -30 -91 -26 -21 -1218 -52 -1520 -456 -1741 -2496 -2496 -2496 -278 -1050 -362 -54 -1 -37 -249 -21 -1269 -38 -1 -2021 -2021 -2021 -89 -179 -1126 -1126 -1126 -2 -752 -752 -752 -29 -2356 -2356 -2356 -373 -1120 -190 -31 -1376 -4318 -4683 -20 -45 -55 -0 -111 -930 -464 -25 -1812 -265 -696 -906 -326 -326 -326 -51 -294 -685 -2309 -2309 -2309 -298 -333 -2545 -2545 -2545 -70 -1540 -559 -501 -710 -1159 -41 -617 -1200 -1125 -849 -1437 -1437 -1437 -916 -390 -138 -175 -0 -227 -332 -1472 -2550 -2550 -2550 -1130 -16 -1796 -0 -393 -366 -26 -2817 -1 -711 -907 -26 -41 -4320 -4320 -4320 -1510 -1510 -1510 -2 -132 -1379 -1501 -605 -64 -186 -1101 -89 -1574 -80 -187 -329 -118 -59 -56 -2 -212 -1025 -174 -1 -25 -253 -1431 -2193 -2193 -2193 -1956 -916 -916 -916 -2446 -2620 -21 -43 -6 -139 -0 -2607 -2607 -2607 -0 -1365 -274 -33 -241 -2285 -52 -1 -61 -235 -235 -235 -183 -30 -0 -1 -1 -765 -1 -3533 -3533 -3533 -1042 -29 -4190 -4190 -4190 -26 -1615 -27 -229 -368 -368 -368 -250 -8 -1 -0 -32 -355 -31 -432 -32 -20 -22 -22 -44 -146 -1763 -491 -491 -491 -0 -180 -39 -30 -50 -941 -1180 -328 -1 -100 -1778 -707 -293 -32 -1790 -31 -825 -31 -11 -24 -429 -0 -20 -1852 -79 -109 -0 -0 -2579 -2579 -2579 -74 -30 -29 -112 -3392 -3087 -3087 -3087 -19 -1554 -1554 -1554 -23 -2393 -131 -347 -444 -1842 -1681 -3 -6 -999 -34 -1193 -183 -880 -880 -880 -919 -919 -919 -966 -966 -966 -1242 -3275 -3275 -3275 -1 -0 -137 -665 -25 -31 -65 -70 -1389 -3097 -845 -2669 -91 -370 -213 -1850 -38 -138 -218 -624 -624 -624 -93 -1955 -1955 -1955 -265 -1297 -21 -1577 -1994 -1994 -1994 -113 -552 -57 -834 -75 -0 -1187 -3400 -3400 -3400 -2250 -34 -61 -2885 -2885 -2885 -0 -35 -35 -35 -1892 -1862 -1897 -1897 -1897 -235 -45 -43 -3906 -3906 -3906 -121 -2751 -21 -2072 -2072 -2072 -36 -83 -1881 -483 -2506 -2987 -2987 -2987 -419 -6 -32 -4860 -4860 -4860 -82 -385 -4 -1578 -1578 -1578 -3072 -3072 -3072 -7 -574 -104 -265 -853 -0 -60 -1626 -91 -242 -58 -1 -4465 -3005 -3005 -3005 -250 -1864 -2215 -1858 -20 -105 -458 -20 -46 -26 -29 -220 -3818 -3818 -3818 -88 -22 -462 -339 -0 -2 -0 -1239 -1239 -1239 -33 -40 -87 -2687 -2687 -2687 -0 -856 -28 -35 -2496 -2496 -2496 -20 -44 -498 -205 -61 -557 -60 -1984 -646 -1511 -182 -6 -625 -29 -246 -2044 -475 -4162 -4162 -4162 -21 -1971 -0 -1998 -3016 -20 -44 -29 -32 -35 -110 -125 -1470 -737 -33 -803 -1036 -1861 -31 -0 -4866 -4866 -4866 -12 -44 -889 -889 -889 -367 -1810 -1172 -1172 -1172 -24 -892 -307 -1585 -900 -191 -2985 -0 -1946 -1946 -1946 -344 -344 -344 -4551 -4551 -4551 -1670 -1670 -1670 -852 -123 -1598 -22 -366 -23 -69 -132 -3373 -3373 -3373 -366 -27 -148 -1654 -599 -72 -4561 -4561 -4561 -502 -1731 -1731 -1731 -2186 -2184 -197 -22 -189 -933 -457 -2372 -2504 -488 -889 -3976 -3976 -3976 -1122 -988 -38 -1393 -1393 -1393 -1877 -393 -470 -1513 -343 -362 -175 -42 -390 -818 -0 -68 -3096 -3096 -3096 -1002 -1277 -332 -1189 -2058 -171 -650 -650 -650 -792 -105 -2215 -21 -112 -23 -118 -2470 -46 -4422 -4422 -4422 -294 -105 -716 -28 -57 -222 -4616 -4616 -4616 -372 -1146 -1202 -1202 -1202 -4119 -4119 -4119 -444 -1326 -1326 -1326 -1 -4898 -4898 -4898 -941 -603 -4385 -4385 -4385 -46 -573 -181 -219 -3481 -3481 -3481 -518 -0 -4143 -4143 -4143 -366 -20 -1618 -104 -157 -74 -46 -173 -1 -3373 -3373 -3373 -950 -950 -950 -1 -492 -2372 -2372 -2372 -1 -28 -1873 -1873 -1873 -1108 -1108 -1108 -566 -302 -2848 -2848 -2848 -39 -2366 -2366 -2366 -40 -2379 -2379 -2379 -542 -134 -4232 -4232 -4232 -866 -920 -3135 -3135 -3135 -533 -97 -22 -258 -2166 -3157 -1101 -1101 -1101 -43 -64 -340 -25 -4973 -4973 -4973 -3421 -3421 -3421 -377 -1163 -1220 -22 -1299 -1664 -1664 -1664 -42 -185 -171 -58 -705 -26 -43 -33 -671 -49 -0 -53 -1107 -165 -1743 -556 -3062 -3062 -3062 -4932 -4932 -4932 -366 -38 -44 -4845 -4845 -4845 -746 -3155 -36 -119 -2979 -218 -4093 -129 -1485 -73 -30 -43 -25 -4201 -4201 -4201 -38 -21 -896 -2 -70 -49 -34 -1905 -467 -2748 -132 -478 -500 -1 -38 -365 -2442 -521 -0 -101 -1383 -62 -4633 -4633 -4633 -601 -2061 -64 -2353 -2353 -2353 -718 -717 -2245 -786 -1562 -41 -27 -1254 -1254 -1254 -588 -190 -102 -24 -43 -2217 -24 -2452 -2452 -2452 -26 -1452 -1187 -1187 -1187 -211 -446 -81 -21 -48 -1 -85 -255 -1874 -1874 -1874 -3813 -97 -2221 -154 -429 -1463 -1463 -1463 -1032 -28 -479 -48 -2047 -4980 -4980 -4980 -1927 -1927 -1927 -4605 -4605 -4605 -1 -0 -1486 -4299 -4299 -4299 -369 -506 -367 -37 -1313 -1313 -1313 -1621 -9 -4727 -4727 -4727 -3164 -3164 -3164 -1252 -1252 -1252 -1144 -1144 -1144 -1514 -1514 -1514 -0 -1435 -213 -575 -58 -1548 -187 -339 -64 -60 -205 -1176 -1176 -1176 -378 -1119 -3780 -3780 -3780 -1 -246 -25 -1083 -1083 -1083 -66 -101 -2463 -3925 -3925 -3925 -471 -2171 -366 -244 -478 -3174 -3174 -3174 -247 -201 -0 -2431 -4348 -4348 -4348 -29 -808 -263 -1444 -1444 -1444 -80 -122 -378 -174 -2659 -2659 -2659 -415 -21 -42 -3059 -3059 -3059 -1 -1222 -2060 -40 -49 -288 -572 -3942 -3942 -3942 -1449 -2106 -2106 -2106 -1186 -40 -1201 -1952 -203 -48 -898 -421 -31 -2226 -2226 -2226 -45 -400 -184 -195 -2790 -2790 -2790 -99 -4239 -4239 -4239 -78 -177 -793 -545 -3252 -3252 -3252 -78 -86 -2310 -2310 -2310 -1345 -1721 -1 -115 -174 -3626 -57 -1696 -1696 -1696 -492 -492 -492 -2330 -2285 -2285 -2285 -40 -2867 -2867 -2867 -2513 -2513 -2513 -85 -2099 -1759 -4508 -4508 -4508 -4951 -4951 -4951 -21 -564 -1068 -29 -1696 -433 -55 -1943 -4264 -4264 -4264 -994 -21 -2707 -0 -10 -258 -258 -258 -948 -51 -504 -268 -251 -1 -856 -2629 -2629 -2629 -19 -407 -4431 -4431 -4431 -1 -505 -3883 -607 -48 -115 -3477 -3477 -3477 -54 -80 -2827 -2827 -2827 -1101 -526 -1034 -102 -47 -921 -228 -32 -1 -58 -20 -2398 -893 -1730 -414 -47 -224 -334 -246 -928 -338 -1948 -1948 -1948 -4161 -4161 -4161 -1517 -1241 -2094 -2094 -2094 -2380 -98 -3690 -3690 -3690 -578 -439 -0 -145 -190 -1217 -1 -3538 -3538 -3538 -512 -1125 -2 -138 -713 -367 -476 -73 -62 -544 -1387 -76 -550 -0 -126 -248 -967 -967 -967 -826 -975 -181 -446 -1266 -34 -460 -31 -1568 -1 -2 -2201 -2201 -2201 -13 -36 -24 -234 -234 -234 -368 -1468 -1478 -4221 -4221 -4221 -248 -2673 -2673 -2673 -4552 -4552 -4552 -4664 -4664 -4664 -227 -29 -222 -4439 -3184 -3184 -3184 -886 -98 -2492 -103 -193 -1775 -332 -332 -332 -365 -59 -108 -302 -39 -3406 -3406 -3406 -212 -599 -599 -599 -264 -2 -250 -979 -663 -325 -0 -1105 -2124 -2470 -55 -151 -1533 -1533 -1533 -507 -294 -294 -294 -38 -2150 -1562 -202 -202 -202 -323 -235 -756 -48 -4345 -4345 -4345 -371 -2863 -2863 -2863 -274 -712 -325 -529 -1019 -1019 -1019 -4481 -4481 -4481 -232 -4254 -4254 -4254 -312 -3827 -3827 -3827 -150 -1030 -2779 -2779 -2779 -4979 -4979 -4979 -373 -28 -277 -806 -658 -35 -154 -36 -1571 -148 -295 -3614 -4 -262 -1 -2019 -30 -600 -2991 -2991 -2991 -1021 -1404 -33 -38 -75 -531 -667 -376 -2050 -19 -3807 -3807 -3807 -199 -89 -2187 -3599 -3599 -3599 -389 -2123 -3409 -716 -716 -716 -1861 -1753 -1753 -1753 -107 -53 -2105 -2105 -2105 -645 -1707 -301 -36 -1812 -1785 -1785 -1785 -190 -112 -901 -2622 -2622 -2622 -0 -580 -4022 -1259 -282 -1269 -1269 -1269 -2990 -2990 -2990 -99 -2800 -64 -4621 -4621 -4621 -154 -0 -1385 -85 -240 -691 -0 -24 -1965 -191 -105 -49 -2 -273 -381 -3669 -3669 -3669 -1771 -282 -478 -708 -51 -290 -671 -122 -122 -122 -3453 -3453 -3453 -1045 -62 -4394 -4394 -4394 -2201 -310 -948 -2271 -658 -1516 -2852 -1714 -2130 -2160 -56 -60 -2447 -2447 -2447 -232 -373 -2240 -2240 -2240 -64 -3 -1119 -34 -2224 -0 -5 -1390 -1390 -1390 -3708 -3708 -3708 -345 -609 -23 -255 -352 -188 -1280 -1203 -168 -58 -703 -189 -31 -532 -1087 -627 -21 -24 -903 -1314 -33 -991 -991 -991 -561 -271 -2245 -1228 -4 -4905 -4905 -4905 -155 -203 -2821 -32 -183 -32 -1042 -1780 -7 -1597 -279 -86 -43 -4 -2084 -2084 -2084 -20 -3630 -3630 -3630 -1065 -1414 -1414 -1414 -4667 -4667 -4667 -21 -3598 -3598 -3598 -164 -1102 -546 -27 -25 -233 -910 -0 -808 -808 -808 -1800 -59 -97 -41 -10 -23 -0 -1493 -2525 -2525 -2525 -121 -6 -29 -706 -41 -143 -98 -1564 -674 -674 -674 -1119 -82 -3417 -3417 -3417 -24 -429 -2042 -1651 -3287 -3287 -3287 -27 -30 -25 -5 -0 -373 -381 -103 -24 -231 -3419 -3419 -3419 -475 -31 -60 -60 -60 -502 -1374 -477 -21 -4 -4 -3 -881 -674 -1017 -1017 -1017 -2185 -2185 -2185 -0 -30 -1053 -1053 -1053 -0 -0 -2273 -2273 -2273 -1007 -32 -400 -26 -441 -22 -61 -171 -39 -1086 -58 -2580 -2580 -2580 -4193 -4193 -4193 -43 -111 -1755 -155 -380 -1 -3978 -27 -2851 -31 -458 -1 -23 -1120 -35 -40 -3 -3491 -4734 -4734 -4734 -4750 -4750 -4750 -93 -1 -29 -72 -4012 -4012 -4012 -4448 -4448 -4448 -324 -855 -1683 -1683 -1683 -3013 -3013 -3013 -0 -1381 -10 -1393 -1513 -1513 -1513 -0 -519 -36 -692 -36 -26 -243 -174 -307 -2336 -2336 -2336 -132 -1540 -91 -229 -20 -1 -635 -4927 -4927 -4927 -4029 -4029 -4029 -803 -67 -1367 -55 -44 -206 -47 -4444 -4444 -4444 -9 -74 -134 -1071 -1071 -1071 -1443 -1443 -1443 -714 -757 -124 -282 -1258 -64 -46 -96 -365 -92 -4083 -79 -398 -2258 -2258 -2258 -30 -2858 -86 -40 -3196 -1054 -46 -1 -187 -2111 -173 -763 -59 -1026 -774 -89 -28 -3075 -3075 -3075 -753 -23 -0 -1358 -0 -3655 -3655 -3655 -89 -21 -56 -1993 -5 -14 -700 -700 -700 -2920 -2981 -1929 -1538 -5 -458 -278 -79 -33 -1017 -0 -737 -2 -43 -20 -0 -860 -39 -28 -330 -25 -1158 -173 -318 -0 -260 -71 -45 -16 -1358 -420 -1086 -122 -482 -0 -1561 -110 -3687 -3687 -3687 -2988 -1060 -32 -12 -4 -381 -59 -4287 -4287 -4287 -65 -2355 -1171 -1171 -1171 -67 -68 -87 -1012 -524 -33 -0 -1998 -1998 -1998 -823 -823 -823 -28 -21 -1086 -1086 -1086 -1 -3459 -3459 -3459 -3 -883 -4 -198 -2282 -2282 -2282 -478 -651 -2638 -28 -4010 -54 -53 -41 -336 -2251 -2907 -2907 -2907 -731 -2171 -30 -21 -3393 -1 -734 -1509 -3042 -3042 -3042 -27 -2362 -2362 -2362 -39 -26 -91 -26 -117 -656 -2284 -1 -0 -1 -2341 -0 -239 -4008 -4008 -4008 -4539 -4539 -4539 -196 -69 -24 -34 -90 -1808 -2530 -2530 -2530 -389 -377 -22 -39 -0 -1564 -1564 -1564 -22 -3745 -3745 -3745 -2061 -375 -28 -28 -796 -796 -796 -67 -2612 -87 -38 -63 -816 -10 -77 -63 -346 -68 -4032 -4032 -4032 -0 -653 -0 -41 -2243 -2243 -2243 -4365 -4365 -4365 -1 -177 -21 -408 -32 -4707 -134 -1 -5 -2564 -0 -89 -2313 -4065 -4065 -4065 -508 -508 -508 -1542 -208 -249 -1901 -103 -544 -26 -1926 -197 -1558 -1558 -1558 -26 -3740 -3740 -3740 -49 -274 -1831 -54 -388 -100 -1558 -3037 -3037 -3037 -102 -27 -1612 -3382 -1 -436 -1913 -4690 -4690 -4690 -1242 -0 -170 -4292 -4292 -4292 -37 -1793 -1793 -1793 -967 -967 -967 -1 -1 -4719 -4719 -4719 -2340 -2340 -2340 -553 -1851 -1851 -1851 -1143 -113 -71 -65 -143 -50 -0 -2392 -1298 -2 -88 -2524 -2524 -2524 -1558 -1558 -1558 -32 -120 -0 -74 -479 -705 -4094 -21 -2217 -1820 -3 -143 -3410 -3410 -3410 -2165 -1271 -1271 -1271 -44 -1 -77 -0 -45 -21 -1411 -20 -595 -97 -3 -919 -3895 -3895 -3895 -32 -587 -30 -140 -521 -521 -521 -199 -68 -26 -247 -4441 -4441 -4441 -21 -45 -2363 -2363 -2363 -1 -33 -25 -2625 -1581 -1581 -1581 -4761 -4761 -4761 -434 -4 -3101 -44 -3 -20 -3216 -3216 -3216 -118 -173 -751 -4537 -4537 -4537 -0 -31 -2362 -2362 -2362 -1423 -469 -49 -33 -222 -1176 -1 -300 -4933 -4933 -4933 -1139 -2409 -2409 -2409 -554 -45 -1144 -25 -35 -73 -120 -1988 -105 -1929 -0 -4 -208 -39 -23 -473 -2901 -2901 -2901 -1644 -1644 -1644 -2329 -2329 -2329 -46 -1642 -74 -34 -2 -537 -69 -2770 -17 -45 -601 -601 -601 -1 -641 -0 -813 -2004 -35 -105 -26 -77 -1534 -9 -922 -27 -3 -330 -0 -609 -63 -810 -17 -0 -1146 -344 -1 -365 -365 -365 -25 -685 -49 -108 -1128 -1128 -1128 -21 -3154 -3154 -3154 -792 -354 -749 -1165 -1165 -1165 -1195 -1613 -1613 -1613 -1718 -1718 -1718 -118 -22 -804 -1375 -111 -1145 -615 -6 -334 -1490 -76 -71 -521 -199 -1297 -222 -323 -507 -2 -217 -431 -38 -22 -1 -337 -4184 -4184 -4184 -371 -891 -4339 -4339 -4339 -888 -1206 -4408 -4408 -4408 -1374 -75 -2301 -1 -1726 -0 -1 -62 -1622 -392 -21 -31 -2776 -2279 -2279 -2279 -454 -90 -1 -38 -35 -3537 -3537 -3537 -454 -377 -375 -22 -1671 -1671 -1671 -2204 -2204 -2204 -37 -129 -47 -43 -2012 -44 -225 -889 -920 -38 -148 -3830 -3830 -3830 -829 -2538 -2538 -2538 -585 -611 -117 -150 -396 -1827 -1 -1336 -189 -708 -359 -1980 -70 -5 -1676 -725 -150 -150 -150 -95 -60 -213 -118 -103 -133 -965 -32 -2 -2308 -2308 -2308 -1204 -146 -4767 -21 -2156 -2156 -2156 -22 -391 -391 -391 -264 -153 -24 -50 -34 -365 -2666 -63 -4440 -1131 -1155 -1155 -1155 -29 -3500 -3500 -3500 -156 -1702 -930 -365 -124 -0 -508 -4585 -4585 -4585 -87 -84 -38 -609 -609 -609 -102 -3495 -3495 -3495 -1654 -146 -3570 -3570 -3570 -288 -1 -159 -2386 -598 -93 -23 -4913 -4913 -4913 -36 -72 -651 -1286 -2158 -2158 -2158 -71 -456 -1238 -728 -4265 -0 -2107 -1760 -1760 -1760 -22 -1284 -25 -204 -4435 -4435 -4435 -941 -424 -1395 -3126 -3126 -3126 -2688 -547 -83 -8 -146 -4390 -4390 -4390 -499 -510 -1 -2130 -51 -148 -0 -25 -171 -701 -3773 -3773 -3773 -206 -3611 -3611 -3611 -28 -1083 -5 -560 -529 -114 -3156 -115 -20 -4597 -4597 -4597 -1515 -145 -2 -712 -32 -181 -165 -695 -127 -2113 -108 -52 -775 -775 -775 -0 -28 -30 -117 -117 -117 -174 -32 -1658 -1658 -1658 -2721 -211 -255 -255 -255 -173 -63 -112 -108 -67 -2646 -69 -1022 -1422 -1422 -1422 -20 -2893 -2893 -2893 -8 -15 -3255 -3255 -3255 -778 -231 -25 -974 -1368 -217 -637 -30 -141 -2169 -117 -1 -48 -63 -708 -688 -2015 -2015 -2015 -158 -158 -158 -3284 -3284 -3284 -0 -882 -37 -2 -1444 -4343 -4343 -4343 -3084 -3084 -3084 -325 -27 -1416 -1416 -1416 -569 -1826 -1826 -1826 -927 -1285 -38 -44 -28 -190 -3197 -3197 -3197 -1471 -83 -1748 -1748 -1748 -1615 -1615 -1615 -60 -2799 -2799 -2799 -4971 -4971 -4971 -282 -134 -444 -32 -616 -427 -209 -1063 -3891 -816 -139 -1115 -932 -2152 -815 -407 -407 -407 -313 -103 -1536 -3278 -47 -1345 -512 -3204 -3204 -3204 -20 -2218 -4480 -4480 -4480 -1753 -1486 -316 -16 -1826 -67 -4002 -4002 -4002 -1764 -1764 -1764 -46 -2088 -0 -3999 -3999 -3999 -2880 -2880 -2880 -4980 -4980 -4980 -1657 -1657 -1657 -169 -2039 -2039 -2039 -237 -5 -42 -1002 -1636 -1636 -1636 -1291 -26 -10 -4502 -4502 -4502 -198 -237 -1 -1000 -187 -36 -144 -955 -79 -2051 -233 -2269 -2269 -2269 -1713 -1713 -1713 -2908 -911 -911 -911 -130 -89 -666 -22 -1969 -1969 -1969 -3234 -3234 -3234 -905 -676 -23 -11 -985 -1448 -180 -180 -180 -165 -330 -126 -6 -671 -2855 -2855 -2855 -1826 -26 -1 -322 -3252 -3252 -3252 -589 -78 -721 -1732 -1732 -1732 -749 -21 -1102 -118 -530 -2096 -2724 -2724 -2724 -1077 -110 -45 -48 -74 -30 -101 -343 -2515 -2515 -2515 -1585 -1461 -551 -1047 -354 -1959 -223 -337 -4371 -4371 -4371 -0 -1488 -254 -950 -950 -950 -576 -100 -578 -578 -578 -3650 -3917 -3917 -3917 -2466 -926 -303 -2191 -925 -1206 -1206 -1206 -0 -315 -1826 -1826 -1826 -3 -223 -31 -147 -661 -661 -661 -1081 -704 -87 -717 -9 -108 -993 -166 -27 -83 -174 -263 -28 -708 -708 -708 -1239 -2396 -2396 -2396 -998 -307 -1814 -2662 -2662 -2662 -4294 -4294 -4294 -4702 -4702 -4702 -31 -133 -54 -2 -80 -22 -1967 -4562 -4562 -4562 -158 -2467 -97 -480 -705 -1290 -1511 -3403 -1117 -1117 -1117 -1872 -283 -178 -738 -738 -738 -1431 -1753 -66 -210 -3423 -3423 -3423 -33 -473 -62 -1078 -1085 -56 -4312 -4312 -4312 -41 -20 -622 -2160 -920 -56 -118 -1 -34 -45 -20 -398 -22 -730 -481 -481 -481 -1142 -1551 -1551 -1551 -35 -3590 -3590 -3590 -357 -2973 -2973 -2973 -24 -531 -365 -365 -365 -31 -1119 -744 -2593 -2593 -2593 -90 -0 -2121 -2121 -2121 -367 -263 -4998 -4998 -4998 -52 -1127 -1127 -1127 -77 -54 -2965 -2965 -2965 -1359 -1365 -553 -91 -114 -62 -45 -1211 -1 -2599 -2599 -2599 -2218 -2218 -2218 -198 -33 -194 -1014 -1 -840 -1498 -1498 -1498 -1494 -1494 -1494 -1 -2454 -2454 -2454 -619 -393 -206 -189 -4658 -1036 -238 -439 -34 -96 -1080 -2020 -2128 -665 -1448 -1 -369 -1844 -177 -2787 -2787 -2787 -36 -827 -1302 -1435 -0 -4 -1785 -725 -607 -8 -32 -2605 -2605 -2605 -365 -1 -37 -263 -0 -24 -4658 -4658 -4658 -2187 -130 -136 -160 -0 -2 -1062 -750 -158 -2515 -1 -30 -1243 -104 -427 -207 -3280 -3280 -3280 -465 -28 -141 -161 -4705 -4705 -4705 -268 -41 -65 -65 -65 -326 -3729 -3729 -3729 -32 -1897 -1897 -1897 -1930 -94 -927 -90 -339 -254 -270 -270 -270 -11 -1333 -1333 -1333 -301 -1085 -730 -84 -1855 -20 -71 -1062 -21 -21 -3271 -3271 -3271 -1859 -245 -61 -1507 -1507 -1507 -368 -2203 -1389 -1389 -1389 -437 -51 -147 -1 -2565 -2524 -1239 -22 -290 -0 -4363 -4363 -4363 -1947 -1947 -1947 -36 -11 -3 -516 -459 -4785 -4785 -4785 -1 -303 -2470 -2470 -2470 -728 -34 -20 -41 -161 -72 -1517 -1438 -1690 -1443 -3132 -3132 -3132 -123 -51 -522 -1 -29 -23 -375 -365 -1257 -1257 -1257 -72 -1760 -1760 -1760 -1366 -968 -1 -1 -4404 -4404 -4404 -2958 -2958 -2958 -2301 -29 -261 -169 -31 -1889 -0 -328 -123 -1898 -1898 -1898 -1475 -42 -31 -737 -101 -0 -596 -596 -596 -39 -24 -231 -26 -2251 -2251 -2251 -924 -599 -24 -2981 -2981 -2981 -1379 -1379 -1379 -1060 -1525 -755 -42 -2154 -1620 -128 -2105 -1075 -193 -738 -1240 -27 -776 -3134 -3134 -3134 -4830 -4830 -4830 -241 -35 -987 -0 -1439 -1439 -1439 -53 -1728 -3718 -3718 -3718 -6 -182 -220 -3910 -3910 -3910 -1 -25 -1209 -79 -408 -110 -28 -413 -4851 -4851 -4851 -0 -411 -36 -316 -65 -2503 -2503 -2503 -193 -32 -176 -4816 -4816 -4816 -264 -223 -29 -1108 -408 -53 -162 -100 -788 -788 -788 -32 -75 -25 -29 -41 -4155 -4155 -4155 -2777 -2777 -2777 -425 -401 -1565 -445 -35 -1424 -753 -3501 -31 -2589 -1 -3271 -1112 -1112 -1112 -2129 -0 -4411 -4411 -4411 -1168 -1168 -1168 -1198 -1752 -1752 -1752 -0 -66 -33 -1501 -430 -2719 -2719 -2719 -0 -1111 -711 -4 -678 -0 -141 -1198 -1198 -1198 -0 -282 -301 -10 -3664 -3664 -3664 -23 -4 -20 -410 -3358 -3358 -3358 -37 -4637 -4637 -4637 -3386 -3386 -3386 -33 -2271 -2271 -2271 -778 -48 -1536 -580 -339 -2 -0 -3599 -2566 -2566 -2566 -1780 -1780 -1780 -645 -45 -1456 -1456 -1456 -10 -41 -33 -4 -741 -288 -25 -113 -2131 -0 -4 -21 -2172 -372 -21 -1720 -1720 -1720 -63 -63 -63 -81 -896 -896 -896 -22 -3 -470 -148 -46 -536 -3024 -1 -2954 -2954 -2954 -356 -1968 -67 -2022 -2022 -2022 -2196 -2203 -2203 -2203 -2798 -3 -20 -37 -31 -32 -230 -21 -73 -1999 -1999 -1999 -50 -0 -488 -1759 -1756 -4598 -4598 -4598 -763 -763 -763 -4260 -4260 -4260 -393 -176 -2940 -1208 -1208 -1208 -0 -302 -2559 -2351 -2351 -2351 -0 -395 -886 -381 -2924 -0 -27 -602 -260 -151 -1 -767 -767 -767 -2996 -2996 -2996 -37 -383 -383 -383 -351 -696 -190 -0 -1 -1091 -2986 -2122 -82 -2054 -335 -750 -0 -182 -776 -2633 -2582 -2582 -2582 -71 -755 -2 -1 -50 -378 -122 -2571 -1292 -1292 -1292 -1469 -39 -4873 -4873 -4873 -0 -31 -122 -120 -336 -61 -74 -31 -1487 -1159 -1159 -1159 -776 -1848 -16 -4571 -4571 -4571 -54 -225 -225 -225 -1626 -0 -4482 -4482 -4482 -41 -3 -0 -45 -45 -45 -24 -0 -391 -4871 -4871 -4871 -1286 -55 -123 -5 -46 -200 -55 -130 -1185 -51 -193 -234 -43 -43 -43 -40 -133 -2571 -32 -48 -328 -29 -3979 -3979 -3979 -487 -2680 -2680 -2680 -0 -4263 -4263 -4263 -1620 -1620 -1620 -28 -1 -31 -2111 -216 -816 -4 -229 -28 -3103 -3103 -3103 -79 -51 -120 -782 -107 -24 -435 -435 -435 -52 -9 -876 -876 -876 -503 -3043 -3043 -3043 -30 -326 -4488 -4488 -4488 -84 -35 -1 -846 -846 -846 -469 -469 -469 -0 -538 -25 -3171 -3171 -3171 -124 -51 -1 -197 -36 -53 -4747 -4747 -4747 -3010 -4526 -4526 -4526 -1794 -29 -497 -22 -914 -139 -404 -2937 -1078 -4473 -4473 -4473 -0 -2928 -2967 -2967 -2967 -50 -0 -208 -572 -572 -572 -2932 -2932 -2932 -171 -0 -1 -844 -844 -844 -2 -1 -1880 -26 -2770 -2770 -2770 -33 -42 -28 -2923 -4146 -4146 -4146 -1153 -958 -1973 -141 -29 -1570 -14 -154 -132 -3779 -3779 -3779 -176 -3823 -3823 -3823 -1470 -474 -20 -0 -1 -63 -1082 -59 -1 -32 -215 -161 -1687 -1687 -1687 -32 -0 -63 -100 -81 -20 -32 -1653 -1653 -1653 -4935 -4935 -4935 -22 -1963 -1284 -20 -43 -1954 -731 -80 -178 -1027 -783 -783 -783 -4937 -4937 -4937 -2746 -2746 -2746 -415 -153 -158 -0 -1362 -1127 -24 -21 -27 -300 -2529 -2529 -2529 -3095 -3095 -3095 -66 -2725 -2725 -2725 -30 -132 -178 -2337 -2337 -2337 -1663 -2655 -2655 -2655 -47 -816 -1017 -1043 -1576 -1576 -1576 -4719 -4719 -4719 -3041 -3041 -3041 -2281 -665 -665 -665 -722 -151 -151 -151 -795 -1648 -1648 -1648 -2762 -36 -28 -1 -114 -1202 -1202 -1202 -168 -1218 -186 -306 -2016 -2459 -1131 -68 -129 -75 -29 -0 -138 -1085 -1259 -1259 -1259 -4162 -4162 -4162 -720 -0 -26 -2522 -2522 -2522 -1139 -23 -4 -142 -150 -23 -608 -608 -608 -32 -1987 -8 -3498 -3498 -3498 -1836 -22 -29 -365 -365 -365 -34 -775 -1862 -487 -61 -3833 -3833 -3833 -708 -708 -708 -1251 -1251 -1251 -102 -52 -1670 -4379 -4379 -4379 -0 -2020 -2020 -2020 -3002 -1213 -2 -6 -546 -2170 -2170 -2170 -325 -27 -4915 -4915 -4915 -1577 -61 -3294 -2012 -87 -58 -20 -4459 -4459 -4459 -4145 -20 -0 -3834 -3834 -3834 -96 -55 -2175 -2175 -2175 -24 -365 -107 -3388 -3388 -3388 -608 -60 -4080 -4080 -4080 -2053 -31 -1640 -1568 -1568 -1568 -171 -4106 -4106 -4106 -2579 -1831 -1831 -1831 -2181 -35 -2152 -1518 -1518 -1518 -147 -209 -0 -1296 -1296 -1296 -117 -0 -214 -15 -3149 -3149 -3149 -106 -1549 -1549 -1549 -61 -495 -112 -471 -3429 -3429 -3429 -0 -181 -36 -89 -3456 -365 -26 -830 -151 -4170 -4170 -4170 -140 -860 -1517 -1517 -1517 -106 -471 -0 -223 -550 -3989 -3989 -3989 -5 -0 -2449 -2449 -2449 -2214 -307 -0 -2788 -2788 -2788 -0 -91 -1 -308 -3839 -3839 -3839 -4522 -4522 -4522 -3818 -3818 -3818 -3411 -91 -0 -3951 -3951 -3951 -60 -1550 -1550 -1550 -2015 -3006 -3006 -3006 -12 -1 -71 -212 -155 -21 -72 -24 -201 -2137 -2137 -2137 -34 -4484 -4484 -4484 -462 -64 -28 -0 -56 -2437 -2437 -2437 -1522 -1522 -1522 -116 -2083 -2083 -2083 -390 -1879 -1879 -1879 -2649 -2649 -2649 -1633 -1292 -32 -4610 -4610 -4610 -375 -164 -2076 -2076 -2076 -1866 -2978 -4 -4844 -4844 -4844 -4229 -4229 -4229 -45 -28 -156 -546 -1336 -1201 -3879 -3879 -3879 -857 -2090 -3147 -46 -190 -3154 -3154 -3154 -3511 -3511 -3511 -34 -1314 -161 -2149 -2149 -2149 -162 -4985 -4985 -4985 -4462 -4462 -4462 -4769 -4769 -4769 -627 -233 -175 -2647 -4225 -4225 -4225 -3653 -1834 -471 -1241 -1241 -1241 -899 -35 -150 -705 -1652 -1306 -0 -1297 -1297 -1297 -2071 -499 -1 -67 -1246 -586 -6 -1 -50 -3857 -3857 -3857 -29 -0 -374 -1639 -156 -3549 -3549 -3549 -9 -175 -42 -563 -0 -1 -226 -2296 -111 -23 -36 -479 -3403 -3403 -3403 -3167 -206 -1874 -87 -20 -64 -2685 -1654 -1654 -1654 -1334 -90 -2225 -242 -242 -242 -31 -230 -59 -1 -883 -1377 -818 -448 -4184 -4184 -4184 -362 -913 -106 -950 -950 -950 -562 -38 -144 -2807 -37 -102 -4110 -4110 -4110 -2422 -2422 -2422 -4277 -4277 -4277 -99 -377 -0 -169 -102 -501 -165 -0 -611 -1115 -39 -4785 -4785 -4785 -1140 -3539 -3539 -3539 -645 -841 -841 -841 -378 -3897 -3897 -3897 -2699 -1 -62 -234 -1950 -1428 -1428 -1428 -211 -211 -1825 -0 -1 -26 -31 -1349 -1349 -1349 -925 -75 -185 -32 -56 -368 -171 -2 -389 -485 -31 -1557 -1079 -4813 -4813 -4813 -155 -498 -113 -3898 -3898 -3898 -1293 -42 -4972 -4972 -4972 -236 -42 -1782 -1782 -1782 -1667 -3010 -3010 -3010 -26 -2446 -2446 -2446 -538 -3913 -3913 -3913 -367 -248 -433 -2257 -519 -461 -2263 -2263 -2263 -130 -40 -54 -166 -46 -231 -0 -3937 -3937 -3937 -1575 -4460 -4460 -4460 -0 -692 -27 -842 -842 -842 -163 -618 -0 -186 -230 -2714 -838 -1134 -113 -504 -20 -598 -284 -7 -176 -66 -3873 -3873 -3873 -0 -368 -368 -368 -187 -203 -75 -3183 -3183 -3183 -93 -326 -1331 -186 -2577 -2577 -2577 -29 -1050 -3593 -3593 -3593 -1076 -573 -2239 -31 -1536 -1536 -1536 -41 -0 -4378 -4378 -4378 -3238 -3238 -3238 -77 -0 -584 -847 -4890 -4890 -4890 -205 -545 -978 -2504 -36 -296 -190 -1566 -33 -701 -701 -701 -961 -2218 -4266 -4266 -4266 -0 -23 -36 -2056 -2056 -2056 -5 -331 -571 -30 -166 -32 -4628 -4628 -4628 -641 -681 -40 -65 -2463 -276 -2191 -2191 -2191 -71 -90 -2124 -2124 -2124 -266 -32 -28 -4067 -4067 -4067 -39 -649 -4228 -85 -3345 -3345 -3345 -73 -3999 -3999 -3999 -25 -844 -2502 -2502 -2502 -3 -219 -323 -25 -917 -2508 -2508 -2508 -1514 -1514 -1514 -922 -62 -2764 -2764 -2764 -48 -29 -2072 -184 -1921 -741 -741 -741 -25 -31 -40 -306 -65 -1513 -1400 -1400 -1400 -355 -3623 -3623 -3623 -4703 -4703 -4703 -1429 -1440 -42 -3721 -3721 -3721 -69 -705 -2718 -265 -29 -21 -21 -1727 -192 -2820 -98 -19 -269 -2 -5 -2195 -2195 -2195 -37 -25 -2050 -1718 -1718 -1718 -23 -21 -3155 -3155 -3155 -190 -1 -99 -1213 -1213 -1213 -0 -114 -1693 -1693 -1693 -168 -43 -0 -368 -1457 -21 -1489 -1489 -1489 -900 -1142 -0 -616 -27 -2113 -2113 -2113 -29 -47 -875 -305 -27 -252 -3722 -3722 -3722 -1636 -3558 -3558 -3558 -57 -2082 -789 -344 -1246 -4286 -247 -20 -66 -10 -197 -666 -111 -59 -2179 -2179 -2179 -326 -3732 -3732 -3732 -59 -20 -818 -1941 -30 -317 -142 -52 -42 -895 -35 -561 -42 -137 -640 -1276 -105 -4943 -4943 -4943 -297 -65 -1 -628 -161 -3712 -3712 -3712 -1 -653 -966 -80 -251 -21 -2490 -43 -276 -80 -262 -1262 -1383 -23 -692 -1271 -80 -115 -136 -1 -1044 -151 -79 -1735 -1361 -1361 -1361 -90 -3191 -152 -48 -29 -61 -1389 -240 -2468 -2433 -88 -696 -696 -696 -1755 -1755 -1755 -906 -906 -906 -293 -532 -526 -240 -1 -845 -845 -845 -2500 -1766 -85 -87 -671 -245 -914 -689 -37 -86 -332 -481 -735 -112 -2 -0 -1 -4646 -4646 -4646 -4298 -4298 -4298 -179 -181 -1367 -365 -164 -2529 -9 -946 -216 -30 -23 -4564 -4564 -4564 -4657 -4657 -4657 -293 -284 -233 -94 -1418 -1418 -1418 -258 -1002 -139 -398 -608 -56 -2504 -2504 -2504 -204 -87 -274 -49 -542 -62 -27 -1 -3664 -2716 -2716 -2716 -25 -706 -1370 -2590 -1 -396 -31 -1070 -1070 -1070 -2312 -2312 -2312 -92 -0 -673 -30 -38 -2499 -2499 -2499 -1412 -427 -2129 -3284 -3284 -3284 -162 -305 -3258 -3258 -3258 -703 -645 -3615 -3615 -3615 -341 -276 -1366 -93 -697 -697 -697 -54 -355 -37 -57 -4015 -4015 -4015 -1100 -1100 -1100 -149 -1762 -1762 -1762 -1262 -65 -20 -4897 -4897 -4897 -753 -0 -679 -63 -3279 -32 -4856 -4856 -4856 -1 -28 -4716 -4716 -4716 -65 -750 -2 -29 -23 -4790 -4790 -4790 -127 -894 -260 -2164 -3 -1175 -236 -583 -1098 -1 -42 -335 -4629 -4629 -4629 -2 -1799 -399 -121 -2266 -441 -2122 -72 -172 -1472 -0 -3059 -3059 -3059 -1403 -1403 -1403 -44 -4425 -4425 -4425 -339 -339 -339 -0 -3364 -3364 -3364 -1114 -1753 -1753 -1753 -755 -30 -1136 -399 -82 -1102 -617 -61 -3422 -173 -105 -3778 -3778 -3778 -712 -318 -3635 -30 -1419 -49 -65 -65 -0 -324 -787 -18 -1 -2718 -2718 -2718 -4 -1391 -34 -33 -3826 -3826 -3826 -73 -0 -6 -59 -1005 -165 -4732 -4732 -4732 -56 -1823 -334 -4759 -4759 -4759 -732 -55 -182 -37 -361 -26 -3965 -3965 -3965 -365 -382 -1531 -115 -4758 -4758 -4758 -1417 -110 -1110 -121 -219 -4784 -4784 -4784 -0 -4034 -3942 -3942 -3942 -46 -2595 -2197 -3665 -3665 -3665 -30 -76 -2859 -2859 -2859 -4380 -4380 -4380 -1850 -731 -2507 -800 -0 -34 -1327 -24 -325 -57 -3 -24 -70 -30 -1339 -4 -64 -324 -324 -324 -4830 -4830 -4830 -681 -133 -2202 -2202 -2202 -203 -2 -2239 -381 -1108 -1108 -1108 -3156 -3156 -3156 -3 -307 -40 -3315 -30 -2918 -22 -3716 -3716 -3716 -2528 -3284 -3284 -3284 -254 -56 -1 -365 -3164 -3164 -3164 -53 -0 -0 -2531 -634 -300 -4610 -4610 -4610 -3121 -4397 -4397 -4397 -1388 -1388 -1388 -31 -371 -70 -0 -3656 -3656 -3656 -5 -2137 -2389 -2389 -2389 -26 -6 -4737 -4737 -4737 -1513 -1195 -22 -233 -328 -182 -180 -100 -1897 -1897 -1897 -26 -171 -2602 -1815 -1815 -1815 -11 -88 -178 -0 -27 -4741 -4741 -4741 -21 -121 -4734 -4734 -4734 -505 -505 -505 -31 -703 -4083 -4083 -4083 -2428 -1867 -1992 -3168 -3168 -3168 -188 -509 -509 -509 -2823 -1320 -3144 -152 -3082 -3710 -3710 -3710 -2998 -50 -50 -50 -1559 -689 -1372 -1372 -1372 -2091 -1010 -1010 -1010 -2267 -1835 -3246 -3246 -3246 -2900 -2900 -2900 -21 -1 -4476 -4476 -4476 -337 -201 -29 -4057 -4057 -4057 -42 -33 -3318 -3318 -3318 -1047 -84 -64 -24 -4042 -4042 -4042 -20 -2367 -33 -3555 -3555 -3555 -0 -105 -1684 -1 -1379 -25 -29 -92 -455 -455 -455 -1541 -1541 -1541 -1995 -2290 -447 -33 -101 -1455 -1455 -1455 -31 -2507 -2045 -2045 -2045 -7 -20 -31 -21 -0 -387 -374 -100 -32 -3349 -3349 -3349 -37 -1267 -373 -1 -200 -68 -339 -40 -532 -532 -532 -1492 -1886 -5 -1400 -7 -468 -951 -472 -1193 -1930 -1930 -1930 -29 -4211 -4211 -4211 -119 -1 -0 -94 -371 -28 -183 -21 -1502 -1502 -1502 -46 -491 -491 -491 -1416 -1416 -1416 -3359 -3359 -3359 -2511 -4 -773 -0 -3 -100 -0 -21 -0 -45 -1496 -1496 -1496 -116 -4727 -4727 -4727 -394 -1993 -138 -2229 -2229 -2229 -1476 -3652 -3652 -3652 -21 -351 -3781 -3781 -3781 -28 -2113 -1510 -2930 -2930 -2930 -22 -22 -3254 -3254 -3254 -203 -4056 -3024 -1159 -37 -58 -46 -1779 -355 -1091 -40 -21 -0 -880 -2882 -2882 -2882 -1144 -3614 -3614 -3614 -0 -399 -20 -30 -92 -1673 -256 -2735 -2735 -2735 -4 -40 -2964 -2964 -2964 -45 -436 -3090 -3090 -3090 -403 -983 -1549 -1058 -1712 -22 -1539 -376 -357 -24 -9 -3066 -3066 -3066 -2897 -2910 -34 -8 -4 -549 -3589 -3589 -3589 -717 -191 -60 -24 -0 -33 -25 -4825 -4825 -4825 -1860 -52 -35 -4401 -4401 -4401 -3221 -83 -1893 -39 -603 -53 -991 -2615 -197 -197 -197 -7 -75 -2825 -31 -775 -775 -775 -2854 -2854 -2854 -714 -3093 -3093 -3093 -80 -745 -5 -1815 -69 -618 -1840 -2279 -2279 -2279 -847 -426 -390 -753 -178 -284 -284 -284 -248 -1 -8 -1537 -594 -1537 -1537 -1537 -74 -0 -2352 -2352 -2352 -3487 -3487 -3487 -2989 -2989 -2989 -1 -26 -4110 -4110 -4110 -1824 -2318 -2318 -2318 -3669 -139 -391 -704 -1 -49 -1 -37 -21 -2930 -2863 -2863 -2863 -785 -785 -785 -924 -3519 -40 -27 -1822 -0 -25 -0 -1108 -4700 -4700 -4700 -507 -1831 -1 -4432 -4432 -4432 -2566 -0 -1810 -212 -82 -22 -28 -685 -33 -143 -638 -638 -638 -203 -1166 -1166 -1166 -37 -22 -35 -36 -798 -798 -798 -330 -283 -42 -284 -1994 -73 -2941 -2638 -2638 -2638 -35 -1311 -3 -274 -1059 -1059 -1059 -757 -2304 -4628 -4628 -4628 -5 -3258 -3258 -3258 -799 -2373 -11 -635 -2634 -2634 -2634 -2537 -2654 -28 -4450 -2304 -0 -378 -2478 -2478 -2478 -35 -1380 -1090 -396 -396 -396 -428 -428 -428 -28 -34 -692 -692 -692 -3534 -3534 -3534 -1 -99 -58 -3 -1 -4608 -4608 -4608 -1 -506 -293 -3326 -882 -2188 -3033 -3033 -3033 -29 -5 -27 -514 -2690 -2690 -2690 -207 -130 -23 -67 -30 -1356 -1356 -1356 -3933 -3933 -3933 -3610 -3610 -3610 -430 -26 -1786 -2652 -2652 -2652 -62 -460 -760 -3787 -3787 -3787 -43 -2 -91 -3628 -3628 -3628 -3825 -3825 -3825 -1952 -45 -1740 -21 -2642 -21 -109 -1118 -1509 -1509 -1509 -30 -4 -20 -522 -295 -60 -131 -2263 -2263 -2263 -1801 -1801 -1801 -0 -111 -731 -731 -731 -0 -2133 -96 -20 -3970 -3970 -3970 -203 -4146 -4146 -4146 -518 -518 -518 -24 -3040 -3040 -3040 -2091 -1908 -795 -795 -795 -21 -1849 -51 -150 -230 -4 -36 -61 -1128 -472 -473 -473 -473 -35 -387 -34 -3426 -2111 -22 -697 -1241 -26 -1470 -1269 -849 -3350 -3350 -3350 -3058 -3058 -3058 -52 -9 -3363 -3363 -3363 -21 -3720 -3720 -3720 -65 -36 -2900 -2900 -2900 -986 -30 -0 -38 -748 -1747 -1126 -4 -4406 -4406 -4406 -4202 -86 -2688 -1529 -0 -33 -1591 -1591 -1591 -15 -1957 -3119 -30 -5 -4629 -4629 -4629 -34 -1490 -1490 -1490 -55 -1862 -1862 -1862 -96 -190 -1433 -416 -850 -3494 -3494 -3494 -830 -28 -169 -4658 -4658 -4658 -2577 -140 -652 -1586 -0 -370 -1365 -201 -1 -82 -3030 -61 -74 -380 -1080 -4217 -4217 -4217 -5 -1 -3748 -3748 -3748 -2255 -411 -508 -201 -3 -21 -198 -29 -2196 -2237 -24 -1376 -1421 -5 -1295 -3604 -3604 -3604 -149 -149 -149 -376 -1473 -1473 -1473 -2371 -215 -489 -184 -184 -184 -62 -1418 -1418 -1418 -23 -23 -820 -96 -574 -32 -3492 -3492 -3492 -1454 -2985 -2985 -2985 -119 -38 -1591 -2271 -2271 -2271 -10 -2232 -3009 -3009 -3009 -3785 -3785 -3785 -1399 -2856 -2856 -2856 -4201 -4201 -4201 -22 -545 -38 -69 -1904 -1904 -1904 -2818 -97 -25 -510 -1524 -122 -1931 -1931 -1931 -3444 -3444 -3444 -878 -803 -41 -146 -31 -3359 -3359 -3359 -3724 -3724 -3724 -2938 -2938 -2938 -50 -478 -13 -2 -286 -112 -2626 -2626 -2626 -766 -156 -42 -2895 -1052 -60 -3655 -3655 -3655 -181 -634 -2625 -3149 -1821 -24 -402 -219 -20 -44 -48 -57 -73 -468 -1194 -32 -5 -49 -4729 -46 -205 -3782 -1 -2 -302 -111 -3749 -28 -412 -1520 -36 -2892 -2892 -2892 -68 -1626 -2226 -1198 -0 -173 -216 -216 -216 -1965 -20 -1776 -757 -23 -4366 -4366 -4366 -95 -139 -1566 -188 -1375 -0 -2248 -2248 -2248 -4836 -4836 -4836 -1002 -32 -4533 -4533 -4533 -2207 -104 -0 -592 -458 -21 -1986 -1986 -1986 -256 -1954 -1954 -1954 -829 -115 -1532 -1532 -1532 -1 -214 -2976 -669 -4860 -4860 -4860 -1601 -1601 -1601 -29 -31 -216 -2227 -113 -4351 -4351 -4351 -1230 -3110 -397 -41 -3 -1 -110 -77 -1994 -1994 -1994 -4041 -1219 -588 -338 -22 -27 -2667 -2667 -2667 -2009 -2009 -2009 -31 -222 -91 -2 -3012 -4582 -4582 -4582 -0 -1736 -2442 -88 -505 -2718 -4497 -4497 -4497 -155 -3352 -3352 -3352 -10 -24 -4889 -4889 -4889 -520 -1856 -53 -2 -33 -2187 -2187 -2187 -1 -2965 -2965 -2965 -117 -30 -3991 -3991 -3991 -633 -40 -385 -1964 -57 -34 -3962 -2163 -2281 -3828 -3828 -3828 -157 -4493 -4493 -4493 -2782 -577 -70 -4448 -4448 -4448 -56 -3344 -3344 -3344 -3 -39 -149 -149 -149 -352 -759 -61 -89 -22 -1128 -1128 -1128 -35 -142 -2367 -2367 -2367 -159 -966 -2992 -2992 -2992 -3398 -3398 -3398 -372 -376 -21 -107 -3824 -3824 -3824 -4854 -4854 -4854 -1867 -339 -383 -755 -819 -81 -864 -75 -32 -258 -396 -3080 -3080 -3080 -45 -1243 -107 -3100 -3061 -3061 -3061 -1 -62 -61 -3236 -3236 -3236 -1955 -1955 -1955 -1336 -0 -0 -1292 -1292 -1292 -95 -1953 -30 -488 -4836 -4836 -4836 -153 -135 -839 -839 -839 -1284 -2916 -3056 -1555 -206 -1924 -1924 -1924 -2928 -3138 -3138 -3138 -2589 -2589 -2589 -59 -2659 -25 -0 -20 -106 -31 -31 -233 -4495 -4495 -4495 -835 -847 -1149 -381 -51 -27 -2619 -120 -836 -836 -836 -4878 -4878 -4878 -1585 -1585 -1585 -32 -1243 -90 -329 -44 -2166 -2166 -2166 -4033 -4033 -4033 -3051 -1 -34 -845 -285 -1 -2101 -0 -4137 -4137 -4137 -141 -52 -3824 -3824 -3824 -2450 -2 -69 -2619 -0 -36 -1530 -1201 -69 -1153 -4076 -4076 -4076 -1829 -1829 -1829 -132 -4701 -4701 -4701 -32 -99 -2327 -3074 -3074 -3074 -55 -2403 -2403 -2403 -27 -2156 -381 -3 -124 -1092 -3818 -3818 -3818 -4827 -4827 -4827 -625 -68 -29 -0 -2 -109 -1242 -1242 -1242 -187 -33 -225 -93 -35 -117 -2171 -18 -71 -49 -0 -3755 -1158 -137 -137 -137 -2402 -2402 -2402 -100 -1893 -2618 -2618 -2618 -309 -953 -1426 -1426 -1426 -3651 -3651 -3651 -458 -1 -161 -415 -3844 -3844 -3844 -2337 -3039 -3039 -3039 -1892 -2 -1417 -1417 -1417 -1770 -140 -53 -801 -2367 -2816 -2816 -2816 -2553 -4194 -4194 -4194 -723 -6 -25 -219 -1852 -103 -1822 -43 -365 -34 -1847 -34 -58 -4929 -4929 -4929 -731 -2540 -2540 -2540 -1611 -99 -2502 -2328 -1549 -1273 -1273 -1273 -6 -736 -4045 -4045 -4045 -1084 -24 -438 -0 -572 -4206 -4206 -4206 -1 -237 -2605 -2605 -2605 -3100 -1566 -1566 -1566 -1372 -1372 -1372 -31 -120 -176 -2680 -2680 -2680 -362 -214 -2787 -210 -1976 -1976 -1976 -77 -1803 -49 -25 -2012 -2012 -2012 -438 -438 -438 -1973 -361 -28 -366 -4032 -4032 -4032 -91 -4110 -4110 -4110 -63 -2410 -28 -9 -49 -194 -26 -95 -99 -982 -3277 -3277 -3277 -116 -923 -697 -1170 -54 -2537 -2537 -2537 -1267 -1204 -3565 -3565 -3565 -2498 -107 -42 -1708 -66 -28 -573 -997 -0 -1512 -1512 -1512 -4477 -4477 -4477 -46 -30 -81 -67 -186 -4 -31 -78 -4382 -2174 -366 -1933 -1034 -179 -6 -231 -1737 -1737 -1737 -1161 -156 -97 -4917 -4917 -4917 -4236 -4236 -4236 -0 -446 -27 -71 -55 -36 -825 -1 -823 -823 -823 -327 -327 -327 -81 -173 -0 -2740 -46 -46 -2719 -2719 -2719 -845 -26 -21 -1 -4276 -4276 -4276 -1282 -0 -2110 -3971 -63 -4614 -4614 -4614 -495 -3572 -2314 -1412 -79 -3128 -3128 -3128 -578 -2536 -2536 -2536 -4490 -86 -1872 -3543 -3543 -3543 -977 -977 -977 -303 -0 -2087 -2574 -2574 -2574 -907 -28 -589 -71 -32 -31 -3593 -3593 -3593 -84 -338 -153 -2408 -2408 -2408 -62 -814 -3170 -3170 -3170 -83 -22 -1288 -212 -1788 -47 -1 -2346 -2346 -2346 -4922 -4922 -4922 -2 -561 -50 -4086 -4086 -4086 -135 -22 -1085 -1085 -1085 -177 -80 -0 -23 -20 -2506 -2122 -2122 -2122 -367 -2837 -2837 -2837 -23 -985 -10 -1323 -1323 -1323 -2795 -1527 -4083 -4083 -4083 -72 -2 -31 -432 -1723 -534 -3075 -127 -2708 -2708 -2708 -365 -538 -2771 -2771 -2771 -119 -920 -4669 -4669 -4669 -861 -366 -173 -67 -159 -49 -2738 -124 -22 -123 -72 -27 -3428 -39 -57 -2769 -64 -956 -11 -63 -13 -588 -2415 -2415 -2415 -383 -1120 -3658 -3658 -3658 -661 -661 -661 -1984 -153 -29 -2163 -988 -37 -43 -0 -0 -980 -6 -27 -1985 -875 -2017 -2927 -2927 -2927 -2757 -613 -4718 -4718 -4718 -367 -17 -242 -200 -28 -1331 -216 -257 -257 -257 -29 -251 -2021 -2527 -2527 -2527 -1153 -29 -177 -75 -1185 -485 -2212 -389 -43 -36 -590 -1812 -1812 -1812 -1620 -59 -80 -3192 -3192 -3192 -21 -925 -245 -630 -32 -2961 -29 -2636 -1 -390 -935 -336 -25 -4567 -4567 -4567 -128 -95 -1 -2117 -4 -30 -574 -554 -2328 -2328 -2328 -97 -43 -106 -25 -1364 -573 -0 -622 -0 -2066 -4978 -4978 -4978 -2185 -2185 -2185 -151 -338 -0 -2375 -31 -1 -0 -250 -94 -4163 -4163 -4163 -282 -165 -3546 -3546 -3546 -3199 -229 -3774 -3774 -3774 -2001 -192 -40 -2534 -2534 -2534 -0 -109 -4812 -4812 -4812 -91 -1181 -1181 -1181 -125 -269 -4737 -4737 -4737 -2797 -2797 -2797 -315 -34 -0 -20 -66 -1 -334 -4991 -4991 -4991 -84 -202 -488 -28 -1009 -1009 -1009 -1626 -2283 -2283 -2283 -2450 -1168 -143 -38 -582 -160 -1936 -1936 -1936 -147 -31 -4560 -4560 -4560 -139 -26 -1 -75 -72 -2884 -2884 -2884 -732 -66 -163 -16 -5 -366 -249 -4203 -4203 -4203 -23 -3128 -3128 -3128 -0 -1008 -1008 -1008 -55 -560 -560 -560 -1346 -0 -1919 -26 -0 -26 -635 -658 -4 -44 -112 -112 -112 -0 -5 -221 -4683 -4683 -4683 -264 -264 -264 -0 -32 -148 -29 -835 -881 -1 -2434 -2434 -2434 -98 -176 -1382 -80 -48 -62 -42 -57 -47 -1511 -147 -235 -2891 -2891 -2891 -410 -3400 -81 -4984 -4984 -4984 -2534 -2534 -2534 -3598 -3598 -3598 -732 -732 -732 -54 -422 -21 -1855 -3197 -3197 -3197 -117 -2122 -2122 -2122 -1024 -41 -138 -2859 -2859 -2859 -0 -66 -0 -768 -768 -768 -1 -4794 -4794 -4794 -38 -2635 -226 -3958 -3958 -3958 -662 -71 -71 -71 -0 -2827 -2827 -2827 -96 -367 -2768 -2768 -2768 -277 -2196 -0 -1969 -60 -688 -2288 -23 -46 -4986 -4986 -4986 -1741 -2397 -2397 -2397 -604 -117 -47 -1 -3665 -2241 -72 -208 -1570 -1570 -1570 -145 -67 -23 -170 -2 -247 -35 -2574 -2852 -1639 -1639 -1639 -22 -1385 -2641 -20 -77 -72 -3506 -365 -0 -68 -77 -2743 -2743 -2743 -26 -4514 -4514 -4514 -2 -30 -3 -230 -3667 -1371 -1371 -1371 -3923 -3923 -3923 -128 -59 -59 -59 -4327 -4327 -4327 -86 -1678 -3 -2504 -1579 -1579 -1579 -0 -1033 -2398 -2398 -2398 -4238 -4238 -4238 -3307 -3480 -37 -1460 -116 -4 -2015 -2015 -2015 -2220 -2220 -2220 -232 -583 -667 -3689 -3689 -3689 -3 -4083 -4083 -4083 -394 -83 -310 -0 -168 -4419 -4419 -4419 -969 -969 -969 -528 -402 -1587 -4859 -4859 -4859 -572 -572 -572 -674 -3903 -3903 -3903 -0 -26 -2255 -68 -3 -34 -51 -3293 -3293 -3293 -1061 -2456 -2456 -2456 -176 -188 -1 -2130 -31 -30 -339 -368 -368 -368 -1 -166 -275 -255 -341 -751 -31 -657 -657 -657 -330 -841 -53 -1760 -1760 -1760 -210 -258 -1000 -3881 -3881 -3881 -41 -3974 -3974 -3974 -1827 -1547 -1547 -1547 -1499 -1499 -1499 -30 -318 -52 -41 -37 -37 -37 -21 -99 -677 -2534 -2156 -2156 -2156 -1742 -637 -1690 -1690 -1690 -2511 -1291 -3297 -3297 -3297 -131 -505 -452 -0 -3670 -3670 -3670 -1 -28 -3173 -3173 -3173 -25 -1366 -28 -103 -56 -63 -2495 -2495 -2495 -2255 -2255 -2255 -2872 -33 -1166 -68 -1 -1086 -69 -69 -69 -2609 -2609 -2609 -269 -20 -2770 -2770 -2770 -2 -1130 -1130 -1130 -1285 -1225 -527 -33 -2308 -45 -2164 -2164 -2164 -2369 -2369 -2369 -20 -642 -642 -642 -1127 -1590 -626 -3462 -3462 -3462 -1788 -78 -129 -0 -2089 -2089 -2089 -30 -26 -1030 -59 -3961 -568 -1 -1376 -171 -23 -9 -0 -96 -75 -264 -1348 -1348 -1348 -3235 -3235 -3235 -0 -2 -2840 -2840 -2840 -405 -3933 -1719 -3192 -22 -32 -664 -689 -159 -292 -55 -2855 -2855 -2855 -109 -2457 -2457 -2457 -2158 -812 -1 -600 -302 -852 -0 -395 -223 -2572 -2572 -2572 -105 -40 -1730 -4361 -20 -0 -2101 -22 -57 -4667 -4667 -4667 -526 -177 -177 -177 -284 -783 -25 -68 -562 -4053 -4053 -4053 -169 -26 -524 -89 -2 -0 -326 -256 -26 -0 -1283 -756 -1236 -104 -35 -302 -4304 -4304 -4304 -2351 -2351 -2351 -1868 -3622 -1298 -12 -21 -2931 -2931 -2931 -2802 -2802 -2802 -138 -63 -2816 -2816 -2816 -254 -6 -99 -11 -32 -1007 -2512 -88 -88 -88 -375 -61 -44 -4568 -4568 -4568 -3389 -3389 -3389 -39 -24 -4673 -4673 -4673 -4685 -4685 -4685 -2911 -2911 -2911 -0 -153 -344 -344 -344 -3270 -2192 -264 -2803 -2803 -2803 -0 -114 -650 -2859 -2859 -2859 -204 -279 -6 -525 -26 -20 -1070 -63 -132 -132 -132 -756 -61 -258 -269 -436 -0 -2656 -37 -41 -805 -1551 -1551 -1551 -110 -33 -10 -1753 -1753 -1753 -0 -103 -103 -103 -876 -876 -876 -3290 -3290 -3290 -3430 -58 -0 -336 -92 -1460 -1507 -1818 -1818 -1818 -25 -2542 -1006 -1006 -1006 -3306 -3306 -3306 -97 -33 -23 -26 -30 -0 -2862 -2 -20 -141 -1276 -825 -365 -360 -42 -103 -698 -413 -1321 -2517 -2517 -2517 -62 -1100 -687 -1116 -1331 -62 -36 -3430 -2915 -1366 -277 -2970 -2970 -2970 -10 -2274 -24 -4169 -4169 -4169 -36 -1 -366 -21 -1752 -1752 -1752 -26 -3355 -3355 -3355 -325 -351 -522 -22 -722 -950 -950 -950 -0 -23 -50 -34 -1621 -1621 -1621 -2028 -2028 -2028 -36 -4793 -4793 -4793 -957 -1387 -91 -756 -1 -139 -328 -450 -3003 -71 -1 -224 -4866 -4866 -4866 -2347 -2347 -2347 -2330 -2330 -2330 -24 -35 -130 -301 -1784 -146 -731 -3914 -3914 -3914 -1 -3192 -27 -1598 -172 -990 -24 -1141 -286 -310 -1673 -1673 -1673 -40 -3653 -3653 -3653 -2039 -2039 -2039 -25 -20 -27 -3264 -3264 -3264 -303 -751 -4467 -4467 -4467 -1 -101 -1443 -120 -98 -4 -4281 -4281 -4281 -5 -121 -20 -3245 -3245 -3245 -75 -1555 -1555 -1555 -428 -82 -27 -1060 -4364 -4364 -4364 -2981 -2981 -2981 -186 -4437 -4437 -4437 -125 -0 -2298 -2298 -2298 -1337 -109 -2560 -2560 -2560 -30 -2241 -1877 -30 -2299 -22 -241 -580 -91 -2759 -2759 -2759 -704 -463 -51 -435 -0 -204 -31 -2676 -0 -4295 -4295 -4295 -40 -1539 -37 -1531 -1 -1525 -290 -2184 -26 -28 -171 -2313 -84 -184 -368 -4 -2303 -3719 -3719 -3719 -7 -3288 -3288 -3288 -4 -110 -443 -127 -314 -20 -7 -1537 -1537 -1537 -67 -21 -2 -2585 -214 -589 -0 -456 -3653 -3653 -3653 -128 -1 -519 -151 -0 -67 -360 -0 -41 -2565 -2565 -2565 -31 -3 -730 -1167 -2220 -84 -28 -24 -43 -0 -1 -1828 -2413 -2413 -2413 -1081 -1081 -1081 -1864 -2123 -410 -2257 -2257 -2257 -2559 -25 -1598 -1598 -1598 -910 -0 -784 -2589 -2589 -2589 -38 -951 -316 -316 -316 -14 -200 -526 -23 -54 -3213 -3213 -3213 -75 -40 -675 -741 -23 -164 -5 -2447 -2447 -2447 -23 -0 -4344 -4344 -4344 -2 -2684 -2684 -2684 -719 -719 -719 -2273 -1068 -1856 -1856 -1856 -159 -1045 -0 -62 -172 -26 -874 -2785 -2973 -2973 -2973 -1259 -3211 -24 -45 -0 -2534 -1 -7 -32 -23 -21 -4134 -4134 -4134 -1873 -50 -22 -2912 -99 -5 -2094 -41 -29 -32 -24 -2594 -29 -28 -2927 -1740 -1740 -1740 -195 -72 -103 -4729 -4729 -4729 -36 -3783 -3783 -3783 -4091 -4091 -4091 -348 -4989 -2763 -3049 -4 -22 -349 -57 -2711 -1012 -299 -0 -245 -2317 -123 -41 -23 -1096 -31 -1009 -1108 -1108 -1108 -73 -61 -2 -56 -33 -0 -71 -311 -311 -918 -32 -274 -97 -767 -767 -767 -2641 -4746 -4746 -4746 -62 -0 -34 -777 -53 -129 -54 -21 -398 -3293 -3293 -3293 -1348 -35 -806 -259 -150 -1090 -792 -1189 -27 -2315 -48 -0 -0 -759 -40 -363 -93 -104 -37 -3687 -3687 -3687 -68 -26 -71 -37 -63 -57 -20 -2662 -2662 -2662 -21 -35 -470 -2998 -2998 -2998 -40 -848 -54 -72 -93 -322 -5 -26 -29 -2965 -2965 -2965 -276 -23 -32 -127 -239 -239 -239 -1160 -53 -1548 -27 -57 -34 -0 -60 -58 -8 -1928 -1928 -1928 -300 -434 -45 -410 -4278 -4278 -4278 -1154 -3683 -3683 -3683 -31 -1 -198 -32 -796 -4024 -4024 -4024 -1110 -53 -32 -58 -4540 -4540 -4540 -4116 -4116 -4116 -761 -67 -328 -603 -21 -3953 -3953 -3953 -4387 -4387 -4387 -476 -29 -1 -0 -1259 -73 -0 -203 -1509 -2505 -3305 -2439 -2340 -214 -2283 -0 -34 -381 -0 -7 -3049 -3049 -3049 -364 -3090 -3090 -3090 -844 -844 -844 -0 -178 -5 -2995 -2995 -2995 -21 -387 -4709 -4709 -4709 -2740 -2740 -2740 -26 -213 -3581 -3581 -3581 -221 -59 -2664 -2664 -2664 -380 -380 -380 -498 -25 -56 -3195 -3195 -3195 -225 -670 -3122 -3122 -3122 -0 -65 -1098 -49 -132 -945 -945 -945 -50 -731 -620 -620 -620 -58 -1464 -100 -59 -131 -65 -58 -58 -21 -0 -357 -536 -4844 -4844 -4844 -2947 -2947 -2947 -93 -769 -28 -20 -21 -48 -58 -1144 -83 -58 -1095 -1531 -0 -44 -3959 -3959 -3959 -95 -4045 -69 -3073 -3073 -3073 -182 -27 -66 -26 -120 -30 -4060 -4060 -4060 -27 -0 -29 -194 -86 -44 -4 -28 -431 -789 -1489 -743 -155 -22 -733 -132 -0 -115 -67 -1 -1087 -30 -117 -0 -1 -2318 -4068 -104 -2358 -2358 -2358 -88 -1913 -1913 -1913 -4826 -4826 -4826 -2612 -41 -20 -624 -4 -98 -796 -1777 -589 -589 -589 -3514 -3514 -3514 -1026 -434 -2644 -0 -5 -0 -59 -21 -4852 -4852 -4852 -2201 -35 -1198 -4382 -4382 -4382 -35 -71 -800 -33 -32 -20 -42 -52 -34 -29 -772 -2267 -2267 -2267 -1097 -107 -0 -2208 -4 -1103 -134 -3168 -3168 -3168 -7 -48 -1753 -29 -107 -0 -310 -82 -124 -1171 -3788 -3788 -3788 -1 -62 -66 -93 -0 -4748 -4748 -4748 -94 -418 -53 -4966 -4966 -4966 -29 -27 -1097 -3442 -176 -1672 -837 -0 -185 -0 -1023 -128 -64 -1464 -31 -31 -1 -2076 -2076 -2076 -214 -616 -1549 -32 -3090 -3090 -3090 -4502 -4502 -4502 -37 -98 -89 -3328 -3328 -3328 -3774 -3774 -3774 -2775 -517 -78 -30 -869 -0 -32 -186 -2256 -66 -3451 -3451 -3451 -836 -2208 -98 -85 -32 -260 -3005 -3005 -3005 -441 -441 -441 -139 -91 -102 -47 -517 -76 -41 -1792 -1792 -1792 -1705 -4153 -4153 -4153 -933 -90 -2221 -2221 -2221 -2040 -1769 -1769 -1769 -7 -2753 -37 -812 -139 -94 -3636 -67 -24 -4786 -4786 -4786 -2846 -4 -29 -1296 -46 -33 -62 -39 -1 -2772 -0 -183 -319 -188 -914 -1278 -2992 -3595 -136 -3388 -3388 -3388 -62 -681 -1 -50 -26 -122 -26 -147 -94 -150 -63 -366 -915 -1 -133 -3051 -1403 -99 -486 -0 -1290 -515 -1670 -30 -58 -1741 -1741 -1741 -641 -23 -52 -0 -3409 -3409 -3409 -133 -1942 -1942 -1942 -559 -407 -2054 -367 -93 -109 -367 -80 -201 -0 -2922 -106 -106 -106 -56 -4284 -4284 -4284 -1464 -72 -2307 -71 -31 -1299 -1299 -1299 -4382 -4382 -4382 -28 -310 -1 -2042 -3141 -371 -2827 -2827 -2827 -2051 -71 -0 -24 -123 -191 -2373 -2373 -2373 -1 -24 -0 -25 -634 -4 -3 -140 -148 -369 -0 -55 -372 -216 -4516 -4516 -4516 -41 -129 -1 -4081 -2645 -124 -3766 -246 -116 -62 -243 -659 -659 -659 -0 -126 -23 -150 -3544 -276 -276 -276 -830 -173 -210 -854 -514 -34 -195 -105 -2625 -2625 -2625 -1489 -1 -20 -1548 -21 -1 -5 -857 -78 -26 -2270 -2648 -2648 -2648 -2889 -2889 -2889 -861 -4942 -4942 -4942 -37 -1 -0 -3309 -3309 -3309 -3613 -3613 -3613 -25 -338 -898 -113 -32 -2336 -2336 -2336 -2024 -1623 -3302 -3302 -3302 -3167 -3167 -3167 -1268 -2762 -2762 -2762 -151 -73 -48 -114 -2945 -2945 -2945 -4136 -4136 -4136 -102 -2057 -2057 -2057 -79 -928 -928 -928 -320 -4537 -4537 -4537 -0 -626 -3653 -72 -58 -814 -2408 -2408 -2408 -54 -168 -3622 -3622 -3622 -2288 -71 -1255 -1735 -1735 -1735 -221 -103 -297 -435 -435 -435 -858 -5 -0 -248 -1436 -1436 -1436 -1766 -1766 -1766 -2525 -2525 -2525 -34 -60 -299 -24 -3843 -3843 -3843 -508 -3116 -3116 -3116 -35 -0 -839 -2700 -79 -3013 -3628 -3628 -3628 -2732 -2732 -2732 -1 -275 -73 -945 -98 -2365 -2365 -2365 -1266 -568 -568 -568 -3 -367 -111 -2106 -1741 -896 -3961 -510 -510 -510 -4134 -4134 -4134 -60 -3499 -3499 -3499 -4189 -4189 -4189 -101 -101 -101 -20 -20 -11 -3560 -3560 -3560 -104 -23 -506 -31 -217 -1411 -1 -2291 -2291 -2291 -21 -101 -1254 -1254 -1254 -93 -3 -377 -105 -1761 -39 -0 -3 -2 -62 -53 -60 -152 -450 -44 -502 -4847 -4847 -4847 -1264 -1509 -1509 -1509 -25 -1778 -2380 -2380 -2380 -74 -2803 -2803 -2803 -299 -1027 -1466 -4635 -4635 -4635 -119 -127 -1334 -23 -1731 -231 -381 -2781 -2781 -2781 -304 -29 -28 -4364 -1459 -2268 -4590 -4590 -4590 -2225 -2225 -2225 -216 -2441 -4082 -101 -266 -3542 -368 -1218 -27 -615 -4206 -785 -3851 -3851 -3851 -1262 -1 -101 -1263 -1263 -1263 -2919 -29 -1275 -1641 -624 -1056 -4759 -4759 -4759 -4604 -4604 -4604 -2 -261 -4704 -4704 -4704 -632 -1586 -2460 -2460 -2460 -137 -61 -1114 -785 -625 -2003 -1891 -81 -133 -2854 -2854 -2854 -2888 -2382 -2382 -2382 -1660 -4252 -4252 -4252 -2811 -2811 -2811 -1947 -1947 -1947 -593 -4553 -4553 -4553 -4839 -4839 -4839 -1386 -1386 -1386 -2360 -2360 -2360 -4930 -4930 -4930 -463 -55 -294 -294 -294 -815 -565 -3 -549 -4973 -4973 -4973 -4423 -4423 -4423 -545 -3983 -3983 -3983 -1165 -2013 -327 -327 -327 -1422 -1422 -1422 -620 -1853 -3173 -3173 -3173 -2772 -2772 -2772 -69 -682 -523 -3946 -3946 -3946 -1275 -1275 -1275 -4182 -4182 -4182 -1876 -1876 -1876 -2383 -2383 -2383 -2442 -581 -684 -564 -1009 -1267 -418 -367 -4580 -4580 -4580 -188 -1002 -7 -495 -4933 -4933 -4933 -1752 -62 -559 -989 -989 -989 -2 -124 -4471 -4471 -4471 -788 -691 -2081 -0 -1729 -3171 -2905 -2905 -2905 -2386 -2386 -2386 -33 -52 -2013 -0 -65 -2989 -4495 -4495 -4495 -0 -409 -2081 -1314 -190 -2262 -2262 -2262 -76 -127 -2314 -0 -4089 -4089 -4089 -237 -375 -1965 -252 -137 -137 -137 -602 -2031 -2031 -2031 -2081 -2081 -2081 -299 -23 -3165 -3165 -3165 -72 -1771 -309 -71 -1903 -1836 -3434 -3434 -3434 -2173 -4024 -1036 -485 -695 -695 -695 -4666 -4666 -4666 -4877 -4877 -4877 -203 -3221 -3221 -3221 -1114 -1940 -223 -2905 -2905 -2905 -69 -0 -2781 -254 -3974 -63 -1027 -1027 -1027 -70 -2008 -2008 -2008 -4729 -4729 -4729 -1514 -60 -4511 -3558 -3558 -3558 -623 -18 -50 -1365 -1365 -1365 -134 -3455 -3455 -3455 -82 -1041 -254 -502 -1350 -879 -967 -967 -967 -248 -3115 -3115 -3115 -509 -2906 -4009 -4009 -4009 -374 -208 -1819 -1819 -1819 -1928 -4987 -4987 -4987 -3609 -3609 -3609 -2102 -1 -360 -918 -0 -3748 -3748 -3748 -327 -2283 -1263 -627 -2084 -1 -325 -1776 -1776 -1776 -4042 -4042 -4042 -2823 -269 -687 -3157 -3157 -3157 -159 -88 -509 -20 -570 -4759 -4759 -4759 -163 -22 -4623 -4623 -4623 -1979 -3252 -3252 -3252 -70 -2905 -2905 -2905 -1936 -4269 -4269 -4269 -1 -1200 -2769 -4863 -4863 -4863 -4222 -1898 -1898 -1898 -890 -4624 -4624 -4624 -1830 -1830 -1830 -23 -2823 -2823 -2823 -467 -82 -2038 -2038 -2038 -61 -3671 -4430 -4430 -4430 -40 -1114 -1114 -1114 -3436 -27 -1668 -3119 -4916 -4916 -4916 -349 -30 -60 -1313 -1 -1930 -643 -985 -29 -1624 -1624 -1624 -2016 -1295 -226 -1309 -1309 -1309 -3888 -3888 -3888 -2415 -1754 -2372 -285 -4244 -4244 -4244 -2459 -3968 -3968 -3968 -1071 -36 -1458 -1458 -1458 -78 -1824 -385 -1236 -7 -942 -20 -1446 -1446 -1446 -2859 -2859 -2859 -51 -20 -284 -2715 -2715 -2715 -2406 -22 -1616 -0 -1530 -42 -49 -995 -33 -20 -1216 -1 -24 -582 -499 -852 -852 -852 -726 -1532 -49 -88 -100 -2903 -2903 -2903 -1188 -32 -556 -3923 -3923 -3923 -662 -775 -595 -2075 -175 -2487 -2487 -2487 -2963 -4205 -4205 -4205 -236 -3924 -3924 -3924 -53 -55 -604 -604 -604 -293 -125 -54 -2246 -22 -8 -25 -224 -1 -1678 -365 -4123 -4123 -4123 -1024 -1307 -1307 -1307 -247 -4610 -4610 -4610 -3215 -727 -1502 -1 -53 -2829 -3968 -3968 -3968 -1420 -1420 -1420 -29 -29 -29 -179 -39 -611 -1084 -1821 -1821 -1821 -261 -2794 -2794 -2794 -1633 -2176 -2176 -2176 -582 -3234 -359 -359 -359 -0 -365 -576 -4305 -4305 -4305 -61 -4567 -4567 -4567 -2573 -2573 -2573 -366 -1247 -1247 -1247 -1283 -446 -3591 -3591 -3591 -2142 -343 -3152 -3152 -3152 -42 -93 -3163 -236 -630 -2920 -2920 -2920 -64 -1602 -1602 -1602 -1745 -1745 -1745 -235 -365 -31 -901 -1176 -1 -335 -13 -24 -29 -888 -888 -888 -1051 -2773 -2773 -2773 -2918 -2918 -2918 -60 -99 -30 -1603 -54 -33 -835 -1082 -3878 -3878 -3878 -67 -906 -2 -9 -1244 -1244 -1244 -369 -30 -53 -0 -3973 -3973 -3973 -2491 -455 -887 -73 -37 -269 -29 -1 -38 -28 -410 -1076 -3948 -3948 -3948 -973 -26 -280 -203 -2566 -2566 -2566 -632 -260 -151 -3616 -3616 -3616 -2473 -2285 -2372 -0 -0 -34 -706 -2765 -2765 -2765 -2619 -2619 -2619 -34 -0 -60 -936 -51 -2 -109 -167 -33 -391 -23 -2434 -253 -106 -227 -404 -254 -3503 -3503 -3503 -1175 -37 -140 -1 -23 -28 -2319 -104 -2423 -2423 -2423 -0 -2115 -700 -462 -0 -1511 -2448 -2448 -2448 -61 -40 -2451 -1651 -1053 -1053 -1053 -635 -1677 -177 -985 -985 -985 -3351 -3351 -3351 -32 -2954 -96 -279 -257 -24 -24 -24 -108 -2369 -272 -2031 -23 -2954 -2954 -2954 -306 -318 -365 -2583 -2583 -2583 -271 -254 -48 -0 -3643 -3643 -3643 -5 -51 -1081 -50 -36 -3028 -3028 -3028 -710 -2 -447 -466 -4844 -4844 -4844 -1887 -1887 -1887 -1802 -8 -41 -73 -96 -1082 -1082 -1082 -1882 -281 -229 -2510 -2510 -2510 -780 -780 -780 -33 -31 -163 -92 -136 -3029 -3029 -3029 -150 -67 -3660 -727 -2150 -729 -28 -291 -0 -61 -35 -105 -1086 -34 -159 -0 -38 -75 -2907 -2907 -2907 -1256 -2143 -27 -368 -249 -1 -342 -342 -342 -2405 -327 -61 -3032 -86 -3738 -3738 -3738 -21 -4003 -4003 -4003 -4 -1313 -9 -633 -2 -3666 -49 -59 -1821 -4732 -4732 -4732 -184 -1734 -3636 -2918 -2918 -2918 -1355 -36 -255 -0 -91 -33 -47 -159 -29 -1916 -1916 -1916 -117 -584 -584 -584 -303 -303 -303 -352 -452 -33 -115 -1197 -4064 -4064 -4064 -369 -2826 -2826 -2826 -425 -1 -3696 -3696 -3696 -3300 -3300 -3300 -1 -3408 -3408 -3408 -74 -407 -271 -319 -24 -43 -96 -90 -2924 -49 -32 -746 -277 -3176 -3976 -3976 -3976 -356 -356 -356 -375 -34 -1778 -2 -29 -1486 -4027 -4027 -4027 -1848 -1848 -1848 -262 -9 -1195 -31 -2909 -2909 -2909 -1172 -1172 -1172 -49 -2 -3302 -3302 -3302 -4076 -4076 -4076 -1 -27 -3271 -25 -676 -90 -1662 -20 -3214 -11 -57 -4781 -4781 -4781 -47 -1977 -281 -0 -325 -112 -60 -1 -2158 -2379 -2379 -2379 -434 -65 -53 -87 -2501 -2501 -2501 -64 -20 -33 -3149 -3149 -3149 -25 -90 -30 -1366 -73 -594 -3244 -3244 -3244 -696 -696 -696 -11 -687 -208 -1444 -1444 -1444 -162 -47 -3956 -3956 -3956 -51 -2916 -709 -2984 -2984 -2984 -0 -1 -79 -256 -393 -393 -393 -275 -3 -191 -2912 -2912 -2912 -57 -348 -670 -4093 -4093 -4093 -526 -3040 -3040 -3040 -367 -33 -1039 -1039 -1039 -1732 -1279 -0 -535 -317 -1027 -35 -1 -4551 -4551 -4551 -4662 -4662 -4662 -183 -25 -1147 -1147 -1147 -3673 -3673 -3673 -60 -2121 -83 -3667 -3667 -3667 -75 -365 -1797 -305 -10 -1403 -4 -3205 -3205 -3205 -3623 -3623 -3623 -370 -1407 -54 -1311 -0 -441 -31 -4772 -4772 -4772 -27 -1412 -2750 -2750 -2750 -540 -388 -936 -1528 -2 -32 -1736 -1736 -1736 -57 -26 -1392 -3293 -3293 -3293 -3326 -282 -1057 -143 -7 -12 -23 -2595 -2595 -2595 -0 -32 -310 -54 -130 -86 -6 -2644 -2644 -2644 -28 -3048 -3048 -3048 -681 -2182 -2182 -2182 -136 -41 -92 -64 -2133 -2133 -2133 -1393 -1393 -1393 -4360 -4360 -4360 -314 -114 -1512 -1349 -1349 -1349 -1555 -423 -3 -29 -72 -23 -728 -329 -3695 -3695 -3695 -1745 -20 -1138 -133 -7 -39 -103 -2201 -2201 -2201 -2202 -2202 -2202 -37 -378 -4694 -4694 -4694 -25 -401 -63 -2681 -4354 -4354 -4354 -290 -557 -463 -272 -382 -44 -22 -124 -2274 -2274 -2274 -35 -1 -188 -2581 -4668 -62 -1507 -33 -3123 -3123 -3123 -1369 -0 -59 -34 -46 -20 -795 -247 -7 -789 -4220 -736 -31 -2679 -138 -120 -30 -2114 -4174 -4174 -4174 -47 -331 -49 -147 -2798 -3170 -3170 -3170 -44 -160 -0 -649 -1191 -4844 -4844 -4844 -15 -58 -45 -969 -32 -4264 -4264 -4264 -173 -2566 -2566 -2566 -0 -361 -2690 -25 -47 -4637 -4637 -4637 -400 -2682 -2682 -2682 -174 -0 -1 -1467 -2985 -0 -65 -2615 -2615 -2615 -86 -2816 -2816 -2816 -2827 -2827 -2827 -1150 -1150 -1150 -99 -185 -2934 -2133 -3964 -3964 -3964 -2938 -2938 -2938 -4854 -4854 -4854 -34 -1694 -1694 -1694 -2610 -32 -88 -373 -2988 -3659 -3659 -3659 -2900 -779 -248 -2411 -26 -16 -1067 -154 -197 -36 -63 -137 -3256 -25 -49 -73 -45 -279 -2708 -2708 -2708 -47 -41 -2223 -3931 -3931 -3931 -52 -141 -95 -251 -28 -29 -4445 -4445 -4445 -4054 -4054 -4054 -262 -1427 -2621 -2621 -2621 -4917 -4917 -4917 -458 -2193 -2193 -2193 -3934 -3934 -3934 -35 -81 -25 -309 -2257 -2257 -2257 -30 -26 -76 -2021 -2021 -2021 -93 -2596 -2596 -2596 -73 -294 -49 -435 -494 -2497 -497 -1315 -1878 -2 -243 -529 -39 -787 -787 -787 -67 -21 -0 -1 -4410 -4410 -4410 -36 -158 -2633 -4054 -4054 -4054 -1 -59 -1463 -57 -2231 -188 -701 -276 -1629 -902 -902 -902 -502 -0 -2829 -0 -501 -2813 -2813 -2813 -354 -310 -1569 -3391 -3391 -3391 -2806 -2806 -2806 -2519 -2519 -2519 -27 -33 -3673 -3673 -3673 -860 -1888 -126 -70 -451 -366 -61 -1 -873 -2954 -155 -722 -722 -722 -145 -365 -13 -1219 -1219 -1219 -1 -0 -2707 -259 -130 -41 -751 -2 -882 -145 -36 -0 -4 -3284 -3284 -3284 -4847 -4847 -4847 -104 -368 -2583 -1620 -1620 -1620 -94 -2940 -2940 -2940 -10 -110 -23 -365 -252 -20 -1 -2218 -4368 -4368 -4368 -1046 -4798 -4798 -4798 -49 -485 -0 -1184 -4830 -4830 -4830 -2195 -2195 -2195 -243 -0 -2544 -1834 -1834 -1834 -1473 -790 -321 -23 -1053 -41 -1109 -3690 -3690 -3690 -50 -55 -2521 -2521 -2521 -2631 -406 -202 -202 -202 -119 -55 -61 -1363 -711 -686 -3428 -3428 -3428 -785 -452 -45 -11 -1706 -460 -460 -460 -1478 -2483 -225 -2120 -388 -296 -1454 -113 -102 -382 -181 -117 -70 -99 -38 -1213 -1213 -1213 -2639 -2639 -2639 -2944 -1509 -70 -109 -23 -340 -38 -39 -156 -105 -0 -3006 -332 -234 -0 -3 -3656 -3749 -3749 -3749 -4410 -4410 -4410 -2006 -133 -819 -1526 -37 -344 -0 -4383 -4383 -4383 -512 -753 -235 -0 -385 -95 -2 -53 -120 -21 -380 -50 -4005 -4005 -4005 -0 -4088 -4088 -4088 -298 -3713 -3713 -3713 -21 -37 -91 -1 -431 -24 -561 -62 -62 -36 -130 -751 -3096 -3096 -3096 -56 -89 -113 -0 -2 -415 -583 -782 -54 -782 -73 -0 -3694 -2 -25 -2323 -2323 -2323 -4066 -3019 -428 -428 -428 -0 -70 -70 -117 -117 -117 -74 -3561 -3561 -3561 -1 -1 -1 -3258 -3258 -3258 -0 -0 -2345 -2345 -2345 -3744 -3744 -3744 -413 -443 -144 -42 -1428 -1428 -1428 -345 -231 -27 -4527 -4527 -4527 -682 -410 -3710 -3710 -3710 -48 -380 -97 -3301 -3301 -3301 -549 -0 -71 -1558 -1558 -1558 -1273 -688 -107 -2967 -423 -0 -1625 -163 -3071 -33 -364 -2410 -3211 -3211 -3211 -2259 -31 -1084 -1084 -1084 -58 -0 -2181 -2181 -2181 -44 -287 -38 -1 -39 -26 -26 -3440 -3440 -3440 -3313 -29 -148 -148 -148 -2955 -2955 -2955 -2213 -61 -68 -27 -155 -21 -2 -92 -47 -1 -3823 -305 -683 -683 -683 -4 -21 -2029 -1 -20 -4772 -4772 -4772 -52 -65 -2253 -38 -181 -209 -1843 -1843 -1843 -45 -859 -32 -125 -2983 -2983 -2983 -28 -4108 -4108 -4108 -1963 -170 -32 -1 -1354 -86 -1459 -1459 -1459 -23 -0 -56 -84 -26 -34 -66 -319 -32 -1018 -73 -3526 -3526 -3526 -28 -271 -2042 -2042 -2042 -489 -341 -1 -26 -81 -48 -4077 -4077 -4077 -32 -0 -32 -689 -0 -1005 -31 -4245 -1 -0 -2 -3368 -3368 -3368 -4407 -170 -3135 -849 -222 -128 -41 -222 -222 -222 -32 -1868 -1868 -1868 -140 -547 -1004 -111 -24 -424 -3508 -3508 -3508 -1046 -1046 -1046 -2326 -2326 -2326 -2395 -42 -95 -142 -229 -304 -0 -368 -262 -262 -262 -80 -20 -28 -148 -57 -48 -46 -3488 -3488 -3488 -36 -30 -43 -816 -2928 -1523 -40 -907 -22 -3764 -3575 -3575 -3575 -222 -3 -275 -371 -773 -4866 -4866 -4866 -1243 -1128 -4190 -4190 -4190 -6 -35 -135 -138 -206 -1754 -22 -21 -241 -278 -1273 -6 -171 -22 -274 -1575 -1575 -1575 -403 -2650 -2650 -2650 -314 -1969 -310 -190 -163 -1346 -405 -167 -2370 -2370 -2370 -135 -65 -31 -895 -1740 -0 -0 -339 -0 -79 -4672 -4672 -4672 -1421 -921 -452 -1182 -372 -0 -763 -4158 -4158 -4158 -38 -946 -177 -1919 -1100 -4265 -4265 -4265 -1869 -48 -511 -511 -511 -2300 -589 -372 -372 -372 -2261 -64 -24 -0 -2373 -2373 -2373 -533 -2995 -2995 -2995 -110 -141 -123 -648 -123 -910 -31 -0 -518 -1156 -3056 -44 -142 -99 -99 -99 -131 -4185 -4185 -4185 -1593 -746 -94 -268 -2684 -2684 -2684 -415 -38 -140 -149 -424 -1388 -24 -2742 -160 -1 -1 -577 -136 -925 -925 -925 -25 -661 -79 -1086 -383 -1 -4570 -4570 -4570 -55 -3347 -3 -26 -376 -14 -2734 -2734 -2734 -193 -193 -193 -1398 -1398 -1398 -805 -3918 -3918 -3918 -1680 -178 -196 -2765 -2765 -2765 -1146 -500 -853 -4969 -4969 -4969 -3209 -3993 -3993 -3993 -264 -60 -4544 -372 -2627 -2627 -2627 -2 -1 -2305 -2305 -2305 -365 -4552 -4552 -4552 -217 -3825 -3825 -3825 -2573 -2573 -2573 -3088 -3088 -3088 -106 -205 -3280 -3280 -3280 -4942 -4942 -4942 -83 -2798 -2798 -2798 -16 -868 -868 -868 -938 -30 -22 -23 -809 -95 -84 -70 -261 -894 -3556 -3556 -3556 -390 -4179 -4179 -4179 -3861 -3861 -3861 -2 -1010 -1010 -1010 -175 -21 -3778 -3778 -3778 -405 -156 -8 -4905 -4905 -4905 -2027 -2027 -2027 -947 -38 -30 -1677 -1677 -1677 -2 -135 -1992 -1992 -1992 -1633 -170 -859 -85 -742 -634 -634 -634 -107 -22 -132 -9 -189 -47 -33 -2881 -763 -2971 -2971 -2971 -1826 -147 -314 -314 -314 -55 -62 -681 -96 -1475 -0 -3 -109 -847 -4626 -4626 -4626 -4941 -4941 -4941 -28 -47 -4682 -4682 -4682 -1273 -0 -81 -172 -24 -337 -2 -1937 -115 -157 -96 -914 -3147 -3147 -3147 -106 -142 -859 -7 -511 -1519 -1519 -1519 -4666 -4666 -4666 -309 -365 -63 -24 -429 -3441 -3441 -3441 -2034 -2034 -2034 -2358 -51 -80 -20 -3077 -1032 -3398 -3398 -3398 -1259 -888 -269 -600 -64 -643 -232 -4860 -4860 -4860 -615 -45 -3180 -3180 -3180 -159 -159 -159 -3465 -3465 -3465 -915 -2001 -2018 -1519 -38 -2050 -2050 -2050 -764 -4974 -4974 -4974 -4302 -4302 -4302 -1551 -1551 -1551 -30 -21 -67 -67 -67 -3451 -3451 -3451 -3834 -3834 -3834 -2 -0 -0 -365 -1540 -1540 -1540 -24 -336 -2642 -2642 -2642 -175 -163 -470 -0 -31 -908 -103 -27 -108 -80 -3291 -3291 -3291 -273 -293 -111 -1350 -447 -96 -247 -40 -0 -3285 -3285 -3285 -119 -96 -0 -31 -29 -127 -2786 -2786 -2786 -438 -241 -42 -1236 -1236 -1236 -1962 -636 -704 -21 -305 -126 -119 -256 -2081 -590 -1351 -4962 -4962 -4962 -214 -580 -1668 -1668 -1668 -4258 -4258 -4258 -1 -228 -228 -228 -1 -129 -2842 -23 -58 -110 -4204 -180 -134 -3235 -3235 -3235 -2087 -77 -161 -142 -65 -72 -68 -1089 -3286 -3286 -3286 -135 -1627 -1818 -2047 -36 -1 -112 -112 -112 -124 -0 -72 -855 -855 -855 -3170 -3170 -3170 -1668 -1668 -1668 -698 -517 -108 -39 -36 -0 -60 -54 -2811 -300 -4 -1586 -599 -243 -1762 -0 -969 -969 -969 -26 -555 -555 -555 -1 -492 -206 -308 -105 -3291 -3291 -3291 -883 -2753 -0 -342 -138 -190 -21 -4298 -4298 -4298 -48 -105 -122 -622 -171 -3149 -1 -2731 -115 -2928 -2928 -2928 -4258 -4258 -4258 -3270 -3270 -3270 -1298 -2227 -34 -2295 -65 -36 -36 -142 -256 -1937 -650 -1497 -25 -259 -55 -219 -212 -212 -212 -0 -365 -2816 -2816 -2816 -319 -56 -4191 -4191 -4191 -301 -134 -272 -620 -1355 -1347 -151 -2859 -1 -559 -215 -1097 -9 -251 -1972 -1972 -1972 -110 -3108 -3108 -3108 -533 -2424 -3511 -138 -56 -105 -1 -3642 -3642 -3642 -180 -1 -39 -139 -656 -346 -2484 -1 -1691 -1691 -1691 -38 -37 -3299 -3299 -3299 -374 -1 -2211 -2211 -2211 -2245 -4258 -4258 -4258 -365 -43 -25 -2072 -1751 -12 -81 -367 -129 -3883 -3883 -3883 -2803 -2 -1 -32 -42 -241 -1075 -112 -179 -4654 -4654 -4654 -56 -588 -225 -351 -44 -1029 -453 -3402 -3402 -3402 -369 -4654 -4654 -4654 -3281 -3281 -3281 -106 -3850 -4302 -4302 -4302 -471 -0 -976 -976 -976 -2725 -2372 -2372 -2372 -201 -585 -547 -99 -134 -252 -437 -85 -3167 -651 -2913 -38 -95 -857 -857 -857 -27 -34 -2152 -1462 -591 -3446 -3446 -3446 -1789 -112 -2193 -2193 -2193 -887 -605 -4889 -4889 -4889 -3286 -3286 -3286 -1331 -1569 -1569 -1569 -1 -1725 -366 -734 -4018 -4018 -4018 -11 -2411 -2411 -2411 -1990 -3811 -1096 -51 -126 -0 -36 -999 -3596 -3596 -3596 -154 -376 -1043 -226 -330 -3965 -3965 -3965 -365 -4877 -4877 -4877 -3880 -3880 -3880 -292 -1898 -1898 -1898 -2870 -169 -4997 -4997 -4997 -21 -3535 -3535 -3535 -30 -3809 -364 -338 -3521 -3521 -3521 -285 -49 -1913 -640 -1408 -259 -144 -1026 -164 -3591 -3591 -3591 -369 -4524 -4524 -4524 -1438 -1438 -1438 -704 -704 -704 -609 -67 -358 -2973 -2973 -2973 -63 -299 -3277 -3277 -3277 -306 -3582 -16 -3970 -3970 -3970 -1013 -1013 -1013 -1410 -1410 -1410 -376 -2963 -88 -579 -2174 -2174 -2174 -87 -59 -2875 -549 -966 -155 -362 -38 -37 -1 -1 -169 -45 -883 -1050 -29 -116 -1778 -1013 -1013 -1013 -71 -66 -1687 -47 -482 -1098 -22 -2849 -1256 -1256 -1256 -276 -73 -175 -225 -20 -84 -382 -770 -1601 -1601 -1601 -2085 -4028 -4028 -4028 -3255 -3255 -3255 -62 -664 -664 -664 -369 -0 -1325 -4158 -4158 -4158 -35 -6 -1 -0 -2891 -2891 -2891 -32 -422 -928 -18 -3963 -3963 -3963 -94 -2848 -2848 -2848 -758 -1 -2901 -2901 -2901 -335 -0 -799 -21 -1820 -1820 -1820 -4 -3980 -3980 -3980 -3253 -3253 -3253 -186 -1745 -44 -4355 -4355 -4355 -0 -1992 -1992 -1992 -1013 -456 -0 -42 -152 -758 -758 -758 -1548 -83 -67 -44 -54 -680 -3039 -3039 -3039 -45 -1276 -33 -1733 -1772 -90 -1010 -25 -2343 -2343 -2343 -1688 -105 -2972 -2972 -2972 -0 -648 -694 -694 -694 -1011 -1 -326 -15 -312 -2877 -1799 -3543 -3543 -3543 -97 -868 -163 -3713 -3713 -3713 -27 -328 -4490 -186 -1404 -4709 -514 -2146 -654 -337 -243 -559 -582 -1124 -3203 -3203 -3203 -814 -28 -1733 -1733 -1733 -0 -3885 -3885 -3885 -557 -1796 -1832 -2484 -2484 -2484 -186 -3998 -3998 -3998 -69 -3223 -139 -137 -1762 -1 -298 -158 -0 -2022 -3123 -3123 -3123 -31 -242 -25 -3039 -3039 -3039 -2822 -2822 -2822 -747 -156 -3269 -2289 -3670 -3670 -3670 -4412 -4412 -4412 -3870 -293 -460 -53 -660 -4 -2561 -3257 -3257 -3257 -2119 -2119 -2119 -90 -216 -62 -29 -2272 -0 -151 -49 -106 -43 -2 -774 -27 -217 -540 -34 -118 -0 -67 -27 -140 -0 -3576 -3576 -3576 -3659 -3659 -3659 -640 -1587 -32 -4459 -4459 -4459 -175 -4768 -4768 -4768 -242 -1323 -1 -128 -34 -1834 -1834 -1834 -0 -2438 -2095 -1806 -30 -62 -4784 -4784 -4784 -3045 -3045 -3045 -3316 -3316 -3316 -4495 -4495 -4495 -4116 -4116 -4116 -63 -1611 -1611 -1611 -49 -74 -0 -20 -621 -94 -289 -20 -64 -84 -31 -74 -23 -500 -3435 -3435 -3435 -516 -1485 -0 -123 -955 -1485 -232 -138 -59 -23 -58 -545 -30 -2376 -119 -424 -0 -264 -1065 -3412 -2 -93 -48 -1781 -381 -1 -40 -2623 -2623 -2623 -4968 -4968 -4968 -141 -21 -727 -727 -727 -1097 -1097 -1097 -61 -0 -21 -274 -1092 -1092 -1092 -4007 -21 -358 -358 -358 -606 -260 -20 -2295 -8 -2337 -2337 -2337 -120 -60 -4172 -3 -0 -31 -3223 -0 -0 -0 -848 -332 -3015 -275 -1105 -0 -3335 -3335 -3335 -57 -1500 -21 -53 -61 -814 -2483 -2483 -2483 -2155 -32 -1 -77 -1 -4314 -4314 -4314 -108 -828 -21 -4 -252 -1802 -72 -264 -169 -4609 -4609 -4609 -1054 -31 -30 -2474 -32 -13 -186 -3373 -3373 -3373 -0 -672 -976 -976 -976 -31 -50 -4863 -4863 -4863 -4029 -665 -665 -665 -353 -723 -1 -2956 -86 -26 -365 -1 -2232 -0 -2319 -2319 -2319 -298 -34 -42 -72 -56 -2935 -91 -147 -0 -151 -438 -468 -404 -202 -766 -26 -34 -68 -35 -43 -83 -0 -3297 -3297 -3297 -0 -177 -3229 -4142 -4142 -4142 -184 -31 -1 -2192 -2192 -2192 -31 -4803 -4803 -4803 -2780 -1608 -60 -4509 -4509 -4509 -23 -23 -23 -1 -135 -781 -35 -181 -380 -152 -416 -1513 -1513 -1513 -24 -1 -827 -376 -762 -119 -32 -2199 -206 -206 -206 -4854 -4854 -4854 -137 -2582 -2582 -2582 -60 -310 -93 -0 -1876 -54 -329 -329 -329 -310 -40 -3690 -3690 -3690 -35 -0 -2230 -2230 -2230 -4422 -4422 -4422 -35 -744 -5 -4388 -4388 -4388 -48 -724 -43 -3432 -67 -281 -4754 -4754 -4754 -3 -9 -764 -336 -351 -651 -178 -147 -699 -55 -395 -38 -2000 -23 -1253 -1253 -1253 -155 -3161 -33 -0 -34 -0 -122 -2013 -3297 -3297 -3297 -1880 -3442 -3442 -3442 -1552 -1552 -1552 -26 -322 -31 -525 -313 -2528 -2528 -2528 -1464 -2485 -2485 -2485 -2177 -25 -0 -4803 -4803 -4803 -28 -1 -35 -2289 -2289 -2289 -574 -36 -1831 -55 -26 -2240 -3 -408 -22 -31 -1172 -24 -33 -31 -136 -1057 -0 -2228 -33 -28 -2 -4391 -4391 -4391 -32 -50 -31 -64 -1048 -4149 -4149 -4149 -0 -36 -40 -31 -61 -1524 -1524 -1524 -332 -1904 -36 -28 -3 -3621 -3621 -3621 -805 -86 -28 -498 -2900 -2900 -2900 -4963 -4963 -4963 -273 -2557 -27 -89 -51 -37 -62 -682 -1934 -160 -1 -33 -264 -3985 -3985 -3985 -47 -303 -970 -970 -970 -2249 -0 -59 -31 -22 -121 -4357 -4357 -4357 -419 -2803 -1 -26 -2 -89 -47 -124 -160 -38 -720 -720 -720 -47 -2644 -2927 -2927 -2927 -457 -365 -365 -365 -1385 -369 -1871 -288 -624 -315 -1090 -29 -2 -83 -1336 -488 -85 -75 -15 -0 -24 -461 -897 -21 -29 -62 -377 -194 -700 -4974 -4974 -4974 -102 -104 -789 -1186 -1186 -1186 -2681 -20 -443 -443 -443 -30 -100 -148 -1569 -1569 -1569 -672 -3748 -3748 -3748 -62 -62 -62 -24 -367 -313 -3783 -3783 -3783 -32 -0 -1 -108 -31 -140 -4 -6 -366 -80 -24 -33 -62 -569 -1 -281 -6 -454 -4045 -4045 -4045 -2300 -4433 -4433 -4433 -964 -180 -150 -37 -63 -3827 -3827 -3827 -2074 -2 -34 -26 -446 -852 -155 -243 -90 -1309 -2283 -170 -71 -94 -2342 -2342 -2342 -3116 -3116 -3116 -347 -780 -780 -780 -130 -836 -836 -836 -455 -3283 -3283 -3283 -111 -2 -3424 -0 -0 -22 -0 -526 -20 -734 -68 -302 -94 -107 -1031 -1031 -1031 -2071 -590 -4133 -4133 -4133 -890 -67 -22 -21 -2954 -2885 -2308 -37 -40 -135 -34 -1 -160 -29 -1292 -1292 -1292 -150 -4550 -4550 -4550 -20 -1145 -1 -1 -2728 -138 -42 -30 -1544 -2451 -2451 -2451 -1352 -1352 -1352 -121 -32 -2266 -3377 -3377 -3377 -65 -310 -33 -156 -61 -34 -41 -26 -31 -3679 -2 -1307 -120 -37 -41 -1803 -1803 -1803 -30 -196 -26 -2 -2630 -2630 -2630 -958 -811 -113 -20 -36 -97 -394 -907 -1122 -59 -227 -4401 -4401 -4401 -4975 -4975 -4975 -4129 -4129 -4129 -4386 -4386 -4386 -2039 -122 -37 -0 -3047 -3047 -3047 -2448 -2448 -2448 -4003 -125 -138 -2542 -2542 -2542 -37 -0 -3068 -32 -128 -128 -128 -538 -178 -0 -1767 -1767 -1767 -2569 -2569 -2569 -3057 -3770 -3770 -3770 -852 -0 -1564 -30 -52 -776 -69 -4562 -4562 -4562 -3517 -3517 -3517 -45 -23 -1 -607 -0 -4924 -4924 -4924 -0 -1496 -119 -471 -43 -779 -1124 -1124 -1124 -2487 -4511 -4511 -4511 -30 -392 -35 -126 -19 -43 -86 -36 -2 -1944 -53 -89 -89 -89 -124 -4 -4487 -4487 -4487 -412 -94 -78 -116 -2343 -2343 -2343 -851 -53 -1596 -1596 -1596 -401 -401 -401 -2194 -33 -471 -158 -26 -125 -1034 -9 -32 -45 -425 -60 -4580 -4580 -4580 -53 -21 -3008 -3008 -3008 -2275 -2275 -2275 -30 -38 -25 -148 -148 -148 -171 -3031 -3031 -3031 -480 -66 -236 -4546 -4546 -4546 -39 -4507 -4507 -4507 -31 -0 -1140 -1140 -1140 -2609 -3 -207 -60 -31 -3974 -50 -58 -479 -479 -479 -68 -244 -1 -91 -0 -262 -2366 -2366 -2366 -54 -84 -132 -30 -20 -0 -71 -451 -1900 -1865 -1247 -1247 -1247 -353 -353 -353 -2439 -1 -630 -4191 -4191 -4191 -367 -4893 -4893 -4893 -44 -20 -4952 -4952 -4952 -50 -1739 -23 -2989 -2989 -2989 -242 -0 -732 -10 -2258 -1 -128 -35 -1020 -1020 -1020 -748 -57 -69 -367 -108 -534 -1519 -2 -73 -2699 -219 -694 -694 -694 -7 -2065 -3492 -3492 -3492 -2381 -228 -873 -4220 -4220 -4220 -1464 -0 -830 -20 -4285 -4285 -4285 -1001 -4353 -4353 -4353 -380 -439 -492 -719 -802 -81 -333 -900 -896 -3391 -26 -4554 -4554 -4554 -4566 -4566 -4566 -377 -513 -0 -121 -88 -2 -1438 -3819 -3819 -3819 -249 -4834 -4834 -4834 -108 -102 -3659 -3659 -3659 -3604 -3604 -3604 -182 -447 -520 -1542 -1542 -1542 -4479 -4479 -4479 -5 -21 -137 -812 -812 -812 -23 -84 -45 -1 -2305 -60 -3100 -3100 -3100 -0 -411 -3149 -54 -29 -366 -43 -0 -3464 -3049 -3049 -3049 -498 -4567 -4567 -4567 -519 -22 -50 -544 -218 -139 -3105 -366 -148 -4705 -4705 -4705 -100 -839 -4576 -4576 -4576 -166 -1181 -516 -378 -2065 -30 -3512 -3512 -3512 -1378 -27 -3799 -3799 -3799 -29 -0 -0 -365 -2012 -722 -37 -588 -876 -3721 -3721 -3721 -1668 -3315 -3315 -3315 -112 -428 -129 -4150 -4150 -4150 -422 -4378 -3584 -505 -2 -7 -477 -191 -4829 -4829 -4829 -852 -108 -834 -58 -366 -799 -4932 -4932 -4932 -0 -32 -10 -0 -172 -2315 -68 -61 -84 -365 -57 -163 -35 -4623 -4623 -4623 -74 -291 -27 -357 -2 -2749 -2749 -2749 -1 -30 -145 -1638 -1 -4297 -4297 -4297 -4641 -4641 -4641 -1793 -1605 -1605 -1605 -574 -39 -3297 -3297 -3297 -35 -582 -57 -944 -944 -944 -366 -2122 -2122 -2122 -24 -2003 -280 -40 -4 -28 -938 -29 -81 -343 -361 -361 -361 -1165 -1165 -1165 -2 -1953 -3835 -3835 -3835 -240 -0 -3889 -3889 -3889 -209 -2671 -20 -509 -20 -366 -506 -58 -36 -4125 -4125 -4125 -142 -1903 -51 -72 -1644 -1602 -1512 -1512 -1512 -94 -180 -4103 -121 -356 -1 -1258 -1258 -1258 -108 -4557 -4557 -4557 -3645 -97 -3043 -3043 -3043 -0 -1614 -58 -3431 -3425 -196 -464 -212 -809 -82 -4261 -4261 -4261 -1206 -1206 -1206 -140 -14 -0 -196 -4 -179 -143 -143 -143 -4351 -4959 -4959 -4959 -28 -29 -116 -2936 -4112 -4112 -4112 -870 -112 -112 -112 -71 -4190 -4190 -4190 -572 -341 -23 -4537 -4537 -4537 -1953 -213 -31 -173 -0 -3389 -292 -1 -152 -31 -235 -2990 -2990 -2990 -4897 -4897 -4897 -856 -366 -20 -536 -161 -187 -20 -500 -500 -500 -25 -34 -1163 -4620 -4620 -4620 -21 -2998 -96 -296 -296 -296 -787 -11 -1 -95 -2725 -2725 -2725 -138 -3756 -3756 -3756 -38 -124 -217 -3300 -3300 -3300 -4096 -4096 -4096 -2419 -2419 -2419 -249 -0 -186 -26 -1 -5 -7 -1492 -1492 -1492 -2664 -2664 -2664 -90 -962 -2411 -32 -34 -0 -772 -1673 -2500 -2500 -2500 -4097 -4097 -4097 -120 -343 -961 -1648 -26 -47 -311 -21 -105 -26 -297 -297 -297 -223 -1312 -518 -120 -1655 -1655 -1655 -1462 -21 -2332 -2332 -2332 -1564 -1564 -1564 -1 -10 -56 -1951 -1951 -1951 -2326 -2326 -2326 -487 -1976 -1976 -1976 -123 -121 -98 -2592 -2592 -2592 -345 -80 -1745 -1745 -1745 -25 -1594 -98 -2894 -253 -3907 -3907 -3907 -81 -29 -678 -4653 -4653 -4653 -22 -34 -389 -24 -963 -148 -22 -3786 -3786 -3786 -2629 -2629 -2629 -37 -45 -22 -31 -28 -27 -4185 -4185 -4185 -1 -4341 -4341 -4341 -489 -605 -81 -2 -1083 -3 -365 -31 -1458 -1458 -1458 -111 -1620 -453 -2841 -2841 -2841 -168 -219 -2439 -700 -700 -700 -1 -49 -4851 -4851 -4851 -139 -0 -2649 -2649 -2649 -4199 -4199 -4199 -85 -4 -645 -29 -305 -264 -112 -27 -2799 -262 -171 -38 -366 -1 -0 -78 -50 -595 -43 -116 -470 -2744 -2744 -2744 -1298 -4651 -4651 -4651 -282 -2049 -107 -69 -2422 -131 -130 -73 -137 -729 -2458 -40 -8 -559 -3655 -3655 -3655 -3497 -154 -327 -94 -2391 -2391 -2391 -475 -2432 -128 -329 -2449 -368 -3916 -3916 -3916 -3620 -3620 -3620 -29 -0 -949 -137 -66 -581 -3609 -55 -1310 -160 -175 -2121 -2121 -2121 -57 -2894 -2894 -2894 -2550 -2550 -2550 -389 -33 -246 -52 -31 -299 -513 -1714 -21 -108 -210 -1684 -1684 -1684 -20 -36 -857 -4210 -78 -498 -344 -1518 -271 -550 -23 -4621 -4621 -4621 -375 -364 -4996 -4996 -4996 -1086 -3636 -3636 -3636 -516 -3443 -3443 -3443 -37 -123 -24 -65 -600 -22 -92 -0 -369 -57 -31 -0 -125 -4 -49 -158 -93 -37 -516 -3174 -38 -2187 -2187 -2187 -4765 -4765 -4765 -188 -1 -2 -1385 -726 -726 -726 -171 -4640 -4640 -4640 -496 -424 -594 -29 -1016 -1778 -2867 -2867 -2867 -804 -6 -308 -3611 -3611 -3611 -789 -789 -789 -2786 -2786 -2786 -641 -138 -1206 -317 -219 -47 -14 -3227 -3227 -3227 -314 -3149 -2757 -30 -59 -16 -3295 -3295 -3295 -367 -2315 -46 -550 -1035 -1035 -1035 -218 -3987 -3987 -3987 -67 -1098 -3817 -3817 -3817 -2517 -573 -185 -133 -244 -244 -244 -1785 -102 -367 -30 -147 -248 -1191 -1191 -1191 -89 -0 -4379 -4379 -4379 -59 -59 -59 -235 -30 -3991 -116 -302 -1 -316 -20 -1016 -701 -701 -701 -1096 -3992 -3992 -3992 -0 -317 -1 -297 -297 -297 -31 -3607 -3607 -3607 -21 -153 -732 -4091 -4091 -4091 -21 -0 -27 -1 -54 -292 -150 -8 -253 -69 -1 -3565 -3565 -3565 -1796 -1796 -1796 -512 -2996 -86 -287 -321 -2529 -3267 -3267 -3267 -2898 -2898 -2898 -38 -40 -125 -388 -2251 -2251 -2251 -1108 -69 -132 -2672 -0 -3654 -3654 -3654 -3858 -3858 -3858 -287 -4488 -4488 -4488 -113 -141 -1 -31 -2259 -2259 -2259 -51 -63 -3235 -3235 -3235 -1 -4137 -4137 -4137 -2919 -2610 -2610 -2610 -2816 -2816 -2816 -32 -1 -4 -84 -1594 -3614 -3614 -3614 -30 -32 -3224 -3224 -3224 -55 -2443 -2443 -2443 -54 -1294 -1294 -1294 -221 -28 -146 -317 -317 -317 -1783 -4355 -4355 -4355 -914 -126 -151 -168 -345 -692 -637 -637 -637 -2986 -2986 -2986 -230 -338 -43 -269 -4350 -4350 -4350 -23 -226 -0 -120 -23 -0 -24 -20 -505 -31 -4371 -4371 -4371 -1 -61 -3117 -3117 -3117 -394 -973 -973 -973 -213 -4140 -4140 -4140 -30 -85 -2003 -636 -31 -390 -537 -52 -198 -254 -1 -189 -4641 -4641 -4641 -4273 -4273 -4273 -299 -139 -1098 -128 -128 -128 -685 -6 -22 -0 -52 -2069 -2069 -2069 -100 -4729 -4729 -4729 -620 -554 -1399 -96 -209 -209 -209 -63 -1 -207 -289 -988 -358 -1 -25 -679 -679 -679 -20 -1 -28 -35 -1037 -1379 -2180 -32 -365 -22 -22 -3968 -3968 -3968 -62 -665 -206 -94 -4670 -4670 -4670 -98 -212 -2947 -2 -38 -38 -38 -668 -0 -418 -2000 -2000 -2000 -4013 -4013 -4013 -337 -4417 -4417 -4417 -79 -1415 -1415 -1415 -3927 -3927 -3927 -2168 -2168 -2168 -20 -30 -96 -580 -1100 -221 -4040 -4040 -4040 -0 -2577 -2101 -2 -249 -1104 -488 -95 -0 -2042 -43 -0 -36 -4404 -4404 -4404 -44 -1 -653 -550 -550 -550 -37 -2898 -2898 -2898 -1861 -1861 -1861 -3287 -196 -35 -104 -30 -3653 -4015 -4015 -4015 -2601 -800 -49 -140 -106 -28 -54 -228 -44 -1844 -33 -35 -0 -135 -2 -96 -713 -5 -94 -3807 -3807 -3807 -26 -2175 -29 -41 -4600 -4600 -4600 -110 -358 -21 -53 -0 -104 -4332 -4332 -4332 -24 -42 -341 -21 -624 -918 -3 -22 -21 -42 -322 -322 -322 -1867 -0 -922 -922 -922 -3750 -3750 -3750 -452 -452 -452 -1675 -0 -27 -608 -2818 -575 -575 -575 -0 -0 -1387 -1387 -1387 -175 -121 -0 -4361 -4361 -4361 -749 -368 -366 -2602 -2602 -2602 -3232 -4705 -4705 -4705 -3296 -0 -1199 -21 -1768 -1768 -1768 -1 -3796 -3796 -3796 -156 -2577 -235 -20 -4052 -4052 -4052 -0 -4 -249 -77 -77 -77 -415 -115 -0 -281 -1 -2095 -371 -355 -3752 -3752 -3752 -26 -185 -342 -27 -6 -32 -1 -365 -37 -0 -0 -5 -2379 -2379 -2379 -0 -233 -4 -3774 -3774 -3774 -139 -680 -3366 -96 -96 -96 -1057 -230 -4636 -4636 -4636 -1784 -31 -3263 -3263 -3263 -4568 -4568 -4568 -1946 -1356 -4785 -4785 -4785 -120 -31 -48 -244 -1466 -354 -0 -1436 -41 -29 -3966 -3966 -3966 -4359 -4359 -4359 -49 -365 -4552 -4552 -4552 -31 -3 -30 -294 -49 -1234 -38 -820 -1481 -1481 -1481 -465 -79 -770 -2264 -2264 -2264 -21 -40 -309 -25 -100 -3014 -3014 -3014 -80 -34 -4668 -4668 -4668 -140 -34 -74 -31 -149 -48 -3710 -152 -1 -2157 -445 -30 -2061 -701 -282 -0 -206 -2 -0 -804 -28 -2987 -2987 -2987 -0 -34 -4704 -4704 -4704 -0 -147 -2874 -1 -710 -3700 -396 -40 -50 -163 -1766 -75 -824 -1 -31 -85 -51 -3339 -3023 -1099 -209 -60 -40 -2 -4480 -4480 -4480 -93 -2262 -2262 -2262 -33 -0 -71 -32 -1571 -2258 -11 -32 -31 -25 -1800 -267 -445 -0 -54 -337 -28 -1 -20 -91 -180 -53 -33 -23 -24 -478 -1 -4783 -4783 -4783 -23 -22 -12 -523 -3331 -3331 -3331 -33 -4307 -4307 -4307 -26 -3442 -3442 -3442 -2 -214 -24 -35 -80 -105 -0 -13 -104 -1 -2241 -42 -2585 -2585 -2585 -0 -2302 -145 -23 -96 -0 -33 -27 -32 -1836 -0 -369 -287 -396 -581 -148 -199 -40 -47 -23 -0 -70 -3 -2494 -2494 -2494 -3199 -1 -31 -0 -240 -87 -1468 -2 -3347 -3347 -3347 -204 -20 -1076 -21 -35 -4288 -4288 -4288 -33 -100 -190 -2774 -179 -1 -22 -57 -2004 -2004 -2004 -114 -2 -3636 -3636 -3636 -20 -1 -91 -3824 -3824 -3824 -25 -350 -3362 -3362 -3362 -22 -3312 -4797 -4797 -4797 -2184 -981 -3516 -3516 -3516 -279 -31 -32 -25 -125 -68 -0 -1219 -113 -34 -25 -0 -0 -3203 -2082 -166 -4881 -4881 -4881 -4016 -4016 -4016 -59 -533 -1451 -1451 -1451 -4160 -4160 -4160 -27 -97 -32 -4058 -4058 -4058 -414 -49 -421 -89 -31 -74 -911 -3898 -3898 -3898 -3423 -3423 -3423 -1 -39 -28 -1901 -197 -86 -47 -2359 -2359 -2359 -4159 -4159 -4159 -26 -35 -25 -30 -410 -31 -68 -1920 -1920 -1920 -22 -866 -22 -4865 -4865 -4865 -2776 -3256 -3256 -3256 -32 -30 -64 -577 -31 -1 -1123 -1123 -1123 -23 -3415 -3415 -3415 -1139 -1139 -1139 -0 -4792 -4792 -4792 -4822 -4822 -4822 -805 -95 -1369 -1369 -1369 -3957 -3957 -3957 -27 -61 -46 -1080 -1080 -1080 -4243 -4243 -4243 -870 -3 -98 -98 -98 -3993 -3993 -3993 -1273 -1273 -1273 -0 -1939 -25 -4516 -4516 -4516 -140 -1 -209 -4384 -4384 -4384 -90 -31 -1545 -25 -3 -1 -27 -2198 -37 -1889 -1 -115 -443 -992 -276 -812 -5 -29 -300 -43 -43 -43 -1036 -134 -3152 -3152 -3152 -3 -365 -884 -3764 -3764 -3764 -31 -86 -547 -2194 -43 -2993 -2993 -2993 -70 -361 -1232 -528 -0 -867 -95 -3212 -669 -705 -4522 -4522 -4522 -1918 -374 -21 -134 -1 -237 -3107 -3107 -3107 -0 -128 -107 -286 -126 -0 -18 -61 -45 -45 -45 -232 -2077 -2077 -2077 -178 -2675 -2823 -2823 -2823 -1105 -0 -76 -22 -39 -915 -36 -6 -10 -959 -0 -37 -3820 -2008 -10 -60 -23 -209 -1076 -0 -4336 -10 -4696 -4696 -4696 -238 -115 -3787 -21 -77 -0 -4849 -4523 -4523 -4523 -3811 -3811 -3811 -38 -0 -31 -3894 -3894 -3894 -299 -511 -1938 -1938 -1938 -4818 -4818 -4818 -8 -1353 -1353 -1353 -740 -2669 -2669 -2669 -102 -264 -514 -4359 -4359 -4359 -148 -29 -2490 -2490 -2490 -54 -31 -1 -38 -51 -32 -1602 -25 -885 -148 -3639 -3639 -3639 -135 -135 -135 -231 -3 -182 -1374 -1374 -1374 -2692 -2692 -2692 -1213 -1213 -1213 -30 -53 -3905 -3905 -3905 -462 -34 -3 -366 -366 -366 -3839 -3839 -3839 -31 -6 -0 -4225 -4225 -4225 -2726 -1946 -67 -258 -4412 -4412 -4412 -3482 -3482 -3482 -365 -3278 -3278 -3278 -76 -55 -1997 -1997 -1997 -365 -565 -125 -841 -841 -841 -45 -3404 -3404 -3404 -184 -2344 -4511 -4511 -4511 -223 -56 -2 -33 -365 -31 -2675 -3 -71 -2741 -2741 -2741 -0 -4935 -4935 -4935 -21 -690 -56 -3709 -3709 -3709 -481 -481 -481 -55 -162 -361 -1107 -2999 -2999 -2999 -106 -16 -38 -559 -1 -24 -2556 -905 -31 -106 -387 -192 -8 -4101 -3479 -3479 -3479 -101 -0 -230 -0 -58 -2424 -2424 -2424 -72 -3429 -3429 -3429 -554 -52 -70 -0 -28 -169 -4193 -4193 -4193 -3 -36 -248 -9 -4193 -4193 -4193 -4526 -4526 -4526 -0 -43 -228 -524 -144 -144 -144 -650 -741 -31 -567 -30 -368 -169 -4459 -40 -184 -2241 -1260 -793 -90 -1160 -0 -47 -345 -514 -62 -1262 -1495 -3475 -3475 -3475 -3075 -221 -90 -25 -51 -55 -38 -746 -39 -869 -24 -33 -0 -595 -3883 -3883 -3883 -71 -1256 -1256 -1256 -238 -293 -528 -2 -368 -75 -1146 -4726 -4726 -4726 -163 -106 -452 -3873 -3873 -3873 -46 -25 -184 -26 -1363 -1996 -78 -30 -641 -380 -62 -733 -235 -53 -0 -90 -163 -145 -52 -24 -2266 -128 -25 -98 -206 -834 -239 -372 -34 -164 -537 -88 -151 -0 -1639 -1639 -1639 -27 -20 -60 -4560 -4560 -4560 -78 -1 -0 -40 -0 -44 -32 -413 -22 -158 -115 -21 -1504 -1504 -1504 -546 -546 -546 -471 -180 -180 -180 -0 -2433 -40 -3850 -3850 -3850 -4440 -4440 -4440 -1036 -20 -60 -3332 -3332 -3332 -1151 -1151 -1151 -115 -24 -46 -63 -2948 -105 -0 -610 -229 -229 -229 -0 -88 -169 -123 -407 -136 -862 -2905 -2905 -2905 -0 -480 -391 -30 -5 -190 -17 -266 -52 -76 -196 -367 -28 -366 -2 -60 -1 -2270 -259 -135 -1436 -365 -55 -338 -0 -70 -580 -46 -532 -29 -96 -91 -91 -31 -22 -71 -71 -71 -40 -4145 -4145 -4145 -22 -365 -184 -1360 -176 -1 -122 -991 -80 -4386 -4386 -4386 -3278 -58 -181 -21 -832 -37 -4283 -4283 -4283 -156 -3153 -34 -125 -276 -33 -3869 -3869 -3869 -496 -318 -88 -1370 -0 -4601 -4601 -4601 -75 -65 -3175 -3175 -3175 -58 -525 -1483 -365 -565 -1307 -184 -26 -4640 -4640 -4640 -4333 -4333 -4333 -3 -4645 -4645 -4645 -1844 -434 -1659 -1659 -1659 -1 -952 -952 -952 -2923 -51 -3579 -3579 -3579 -1240 -28 -23 -1871 -49 -874 -366 -53 -123 -0 -1 -3816 -25 -36 -888 -3099 -41 -597 -1518 -1518 -1518 -562 -0 -28 -21 -3954 -3954 -3954 -148 -188 -30 -54 -520 -53 -2320 -3894 -3894 -3894 -40 -8 -104 -650 -4187 -4187 -4187 -2961 -2961 -2961 -48 -1276 -34 -572 -796 -23 -21 -0 -0 -4815 -4815 -4815 -27 -174 -4671 -4671 -4671 -145 -356 -2761 -2145 -149 -2522 -127 -3553 -3553 -3553 -48 -22 -1515 -71 -1449 -206 -0 -1001 -69 -24 -21 -226 -53 -4804 -4804 -4804 -4439 -4439 -4439 -56 -0 -42 -509 -0 -201 -1992 -72 -25 -2 -0 -588 -588 -588 -1360 -1022 -938 -938 -938 -1728 -179 -654 -32 -2256 -1002 -65 -1065 -1065 -1065 -118 -440 -151 -1 -3964 -3964 -3964 -205 -1067 -7 -243 -27 -4637 -4637 -4637 -328 -3577 -3577 -3577 -165 -950 -137 -50 -860 -225 -3897 -554 -931 -365 -23 -852 -3169 -2 -186 -24 -3976 -3976 -3976 -3980 -3980 -3980 -0 -2 -4129 -4129 -4129 -1426 -36 -0 -4569 -4569 -4569 -2809 -3549 -3549 -3549 -45 -365 -883 -883 -883 -677 -23 -368 -365 -196 -1621 -1334 -3880 -1419 -1 -2 -1297 -1772 -1951 -206 -33 -3461 -1 -26 -57 -4237 -3717 -3717 -3717 -22 -20 -3967 -3967 -3967 -29 -3132 -3132 -3132 -33 -1 -3764 -93 -97 -16 -983 -983 -983 -3967 -3967 -3967 -1380 -20 -937 -1 -3882 -3882 -3882 -36 -54 -0 -21 -29 -55 -2822 -2822 -2822 -120 -365 -20 -44 -97 -132 -220 -149 -3045 -2124 -2124 -2124 -22 -4993 -4993 -4993 -983 -365 -106 -0 -182 -4144 -4144 -4144 -4046 -4046 -4046 -1038 -0 -143 -100 -1470 -1470 -1470 -880 -17 -1749 -74 -1 -110 -0 -20 -216 -261 -153 -26 -877 -3910 -58 -293 -2401 -2401 -2401 -0 -611 -115 -100 -847 -304 -113 -22 -255 -2497 -97 -992 -34 -31 -0 -52 -1727 -1727 -1727 -37 -3513 -3513 -3513 -4885 -4885 -4885 -31 -25 -632 -632 -632 -3965 -3965 -3965 -1045 -265 -265 -265 -4688 -4688 -4688 -3430 -705 -2367 -285 -0 -2532 -2532 -2532 -614 -494 -2312 -2312 -2312 -303 -303 -303 -74 -40 -3184 -3184 -3184 -4974 -4974 -4974 -612 -378 -4058 -4058 -4058 -358 -1 -84 -795 -4577 -4577 -4577 -727 -174 -2312 -0 -4045 -4045 -4045 -2182 -4823 -4823 -4823 -54 -368 -2381 -56 -60 -2739 -2739 -2739 -0 -3004 -3004 -3004 -98 -8 -37 -367 -367 -50 -102 -70 -53 -3788 -3788 -3788 -697 -201 -0 -4874 -4874 -4874 -126 -126 -126 -88 -1036 -1036 -1036 -1732 -8 -244 -4822 -4822 -4822 -31 -305 -1 -206 -1 -74 -0 -58 -4070 -4070 -4070 -2922 -2922 -2922 -1 -1305 -1305 -1305 -24 -28 -0 -34 -38 -130 -40 -0 -26 -2573 -2573 -2573 -44 -2200 -253 -253 -253 -346 -76 -4306 -4306 -4306 -83 -671 -0 -266 -1 -931 -229 -2369 -2369 -2369 -195 -38 -65 -28 -39 -2782 -42 -46 -924 -116 -3188 -3188 -3188 -1 -37 -37 -37 -4910 -4910 -4910 -26 -0 -70 -112 -784 -163 -411 -2 -3158 -3158 -3158 -2375 -4249 -4249 -4249 -33 -65 -39 -31 -454 -230 -0 -74 -597 -139 -26 -3249 -3249 -3249 -2464 -92 -38 -33 -4627 -2122 -2122 -2122 -25 -0 -386 -8 -344 -1000 -1000 -1000 -622 -1962 -101 -2 -1365 -1365 -1365 -330 -46 -401 -36 -1 -21 -3607 -3607 -3607 -70 -29 -45 -199 -26 -21 -20 -31 -1 -1947 -53 -31 -4842 -4842 -4842 -28 -71 -23 -42 -31 -474 -1077 -188 -201 -217 -33 -0 -29 -34 -0 -3 -3990 -3990 -3990 -39 -25 -24 -64 -47 -31 -4361 -4361 -4361 -76 -55 -40 -29 -4306 -4306 -4306 -32 -49 -235 -1762 -1762 -1762 -38 -335 -4 -3961 -3961 -3961 -73 -396 -553 -0 -44 -25 -2518 -43 -30 -0 -33 -0 -35 -159 -159 -159 -2825 -2825 -2825 -40 -3895 -29 -74 -0 -723 -189 -642 -642 -642 -30 -481 -51 -64 -68 -1157 -1157 -1157 -288 -38 -21 -31 -440 -256 -170 -3 -0 -4871 -4871 -4871 -29 -37 -26 -1337 -298 -393 -2436 -2436 -2436 -2 -1571 -1571 -1571 -27 -291 -27 -39 -400 -278 -25 -4068 -28 -1290 -1290 -1290 -54 -919 -319 -808 -2 -35 -4338 -4338 -4338 -594 -668 -32 -3975 -3975 -3975 -480 -179 -0 -95 -395 -4359 -4359 -4359 -897 -4646 -4646 -4646 -1466 -1466 -1466 -687 -35 -33 -336 -109 -195 -45 -174 -4713 -4713 -4713 -59 -525 -274 -2 -29 -26 -692 -692 -692 -34 -62 -4707 -4707 -4707 -1 -1 -28 -427 -873 -873 -873 -33 -36 -59 -174 -2825 -2825 -2825 -33 -45 -43 -1735 -0 -27 -182 -25 -42 -0 -90 -0 -0 -0 -29 -3170 -4125 -4125 -4125 -231 -4346 -4346 -4346 -32 -242 -28 -33 -3609 -141 -1 -44 -34 -28 -3658 -3658 -3658 -310 -2717 -4967 -4967 -4967 -353 -293 -1157 -100 -4072 -4072 -4072 -4594 -156 -31 -0 -37 -298 -1773 -1773 -1773 -22 -2130 -96 -1724 -37 -34 -245 -35 -256 -33 -34 -263 -525 -38 -731 -1 -36 -53 -29 -76 -20 -894 -561 -32 -389 -61 -29 -33 -24 -38 -2494 -29 -4158 -4158 -4158 -28 -40 -418 -3054 -3054 -3054 -29 -56 -25 -34 -780 -780 -780 -1 -2474 -2474 -2474 -3531 -3531 -3531 -0 -269 -939 -26 -148 -40 -47 -79 -945 -45 -44 -64 -156 -648 -1 -403 -94 -27 -4400 -4400 -4400 -24 -33 -21 -30 -204 -33 -2049 -736 -1415 -37 -28 -2571 -2571 -2571 -30 -2505 -0 -77 -1 -1 -0 -24 -0 -71 -4184 -1103 -818 -553 -2553 -914 -230 -4795 -4795 -4795 -86 -359 -163 -389 -20 -0 -2302 -2302 -2302 -88 -29 -36 -4031 -4031 -4031 -3164 -688 -207 -71 -1 -0 -4339 -4339 -4339 -3326 -258 -30 -1395 -28 -1570 -2574 -33 -432 -2819 -2819 -2819 -1 -3348 -26 -396 -20 -1554 -20 -0 -1379 -27 -3083 -3083 -3083 -3028 -3028 -3028 -4385 -4385 -4385 -134 -101 -53 -24 -205 -59 -22 -205 -22 -1 -45 -1395 -413 -118 -1973 -1973 -1973 -122 -4141 -562 -149 -2151 -2151 -2151 -2936 -2936 -2936 -845 -845 -845 -1203 -1098 -1098 -1098 -44 -1536 -1536 -1536 -4879 -4879 -4879 -34 -31 -615 -36 -2 -92 -0 -92 -92 -69 -103 -1206 -1206 -1206 -1 -4309 -4309 -4309 -41 -731 -20 -34 -2940 -183 -4299 -2205 -2205 -2205 -16 -71 -699 -53 -67 -2572 -2572 -2572 -776 -0 -99 -80 -369 -2 -2922 -2922 -2922 -38 -60 -951 -951 -951 -21 -4811 -4811 -4811 -2 -2993 -2993 -2993 -24 -4343 -4343 -4343 -82 -297 -44 -1268 -2536 -2536 -2536 -21 -3606 -3606 -3606 -0 -2096 -0 -673 -47 -342 -27 -42 -132 -22 -44 -127 -102 -654 -1810 -2820 -26 -630 -45 -30 -147 -4225 -4225 -4225 -1 -92 -2465 -44 -279 -322 -68 -30 -231 -3571 -2193 -3104 -4060 -4060 -4060 -31 -1075 -20 -32 -1492 -146 -1178 -4 -27 -314 -33 -20 -127 -64 -558 -0 -34 -1445 -1445 -1445 -146 -1 -70 -1 -978 -4289 -4289 -4289 -177 -44 -1 -54 -3757 -3757 -3757 -35 -35 -35 -240 -1 -269 -32 -83 -408 -21 -31 -1789 -41 -413 -58 -1096 -191 -33 -1203 -0 -994 -2 -443 -756 -756 -756 -1050 -39 -21 -153 -1174 -162 -357 -69 -4270 -4270 -4270 -32 -27 -364 -33 -0 -103 -491 -75 -72 -182 -48 -615 -615 -615 -439 -509 -84 -31 -274 -61 -392 -4127 -366 -1 -734 -55 -83 -22 -101 -22 -333 -0 -50 -113 -21 -404 -3081 -3081 -3081 -0 -27 -178 -62 -38 -374 -2 -0 -95 -1 -38 -55 -32 -35 -4201 -489 -489 -489 -1174 -987 -125 -4462 -4462 -4462 -822 -1036 -302 -178 -46 -21 -34 -171 -171 -171 -1538 -1 -1829 -1829 -1829 -21 -2 -3033 -3033 -3033 -68 -731 -33 -863 -4218 -4218 -4218 -287 -753 -55 -21 -0 -488 -61 -82 -2518 -54 -35 -25 -43 -367 -852 -852 -852 -26 -23 -20 -21 -168 -31 -18 -417 -235 -8 -35 -0 -295 -10 -3380 -3380 -3380 -3712 -3712 -3712 -1529 -1624 -3 -45 -323 -64 -3 -785 -1097 -23 -30 -3033 -9 -0 -76 -2 -25 -0 -65 -1147 -84 -218 -41 -4448 -91 -30 -4728 -4728 -4728 -35 -32 -3536 -3536 -3536 -0 -2193 -88 -371 -910 -0 -1 -999 -350 -260 -31 -20 -311 -2106 -0 -1159 -189 -1 -3230 -3230 -3230 -55 -145 -86 -1 -59 -379 -0 -2192 -21 -1 -104 -264 -1428 -2829 -2829 -2829 -91 -29 -1948 -1948 -1948 -1 -28 -97 -1209 -366 -26 -4846 -4846 -4846 -272 -0 -1401 -1401 -1401 -2 -50 -3654 -3654 -3654 -2 -221 -4929 -4929 -4929 -92 -56 -1 -1097 -4814 -4814 -4814 -148 -156 -1 -24 -270 -270 -270 -22 -29 -234 -954 -3444 -3444 -3444 -690 -690 -690 -79 -3653 -30 -2560 -2560 -2560 -1126 -476 -8 -280 -2196 -100 -1584 -1234 -1 -0 -22 -5 -0 -4 -2065 -2065 -2065 -181 -145 -0 -129 -463 -89 -839 -0 -894 -3322 -3322 -3322 -75 -3 -3862 -3862 -3862 -393 -412 -113 -653 -47 -45 -0 -0 -63 -2 -1570 -353 -136 -31 -118 -134 -1823 -431 -89 -2 -74 -733 -733 -733 -440 -20 -35 -84 -43 -33 -828 -16 -821 -202 -121 -1327 -1327 -1327 -645 -6 -305 -112 -401 -26 -67 -61 -41 -450 -317 -1 -4121 -4121 -4121 -100 -0 -2014 -2014 -2014 -2 -1 -27 -31 -277 -4140 -4140 -4140 -118 -3 -29 -26 -3301 -3301 -3301 -22 -22 -1 -0 -230 -0 -875 -39 -4121 -4121 -4121 -910 -910 -910 -8 -0 -93 -153 -12 -11 -295 -3300 -3300 -3300 -2505 -2505 -2505 -484 -484 -484 -216 -150 -0 -35 -47 -0 -0 -0 -495 -4512 -64 -205 -0 -352 -274 -128 -4940 -4940 -4940 -367 -39 -149 -4781 -4781 -4781 -296 -74 -60 -44 -2820 -0 -0 -86 -288 -734 -119 -30 -44 -1 -135 -370 -21 -3702 -3702 -3702 -1 -304 -26 -58 -24 -4184 -4184 -4184 -1191 -1191 -1191 -356 -3656 -7 -1526 -1526 -1526 -2 -208 -1200 -21 -3506 -3506 -3506 -40 -63 -804 -266 -1161 -1161 -1161 -24 -2685 -31 -140 -25 -251 -3862 -3862 -3862 -24 -263 -61 -55 -33 -48 -108 -31 -495 -2017 -2017 -2017 -49 -114 -439 -1022 -32 -29 -475 -2 -29 -3268 -3268 -3268 -1539 -50 -268 -45 -160 -513 -0 -64 -1239 -342 -342 -342 -172 -4027 -4027 -4027 -1237 -1237 -1237 -210 -279 -279 -279 -6 -515 -1 -20 -0 -104 -23 -3 -32 -389 -3737 -3737 -3737 -1 -3259 -3259 -3259 -3830 -911 -566 -0 -54 -169 -283 -30 -304 -2908 -712 -31 -0 -23 -1 -0 -79 -94 -834 -170 -0 -4292 -4292 -4292 -0 -326 -68 -779 -25 -3844 -3844 -3844 -64 -5 -232 -4128 -4128 -4128 -4162 -4162 -4162 -109 -728 -235 -406 -164 -41 -3091 -4577 -4577 -4577 -23 -1 -267 -161 -510 -55 -1151 -136 -0 -44 -683 -9 -356 -38 -4028 -4028 -4028 -3374 -3374 -3374 -2995 -407 -39 -31 -236 -895 -196 -3275 -3275 -3275 -1656 -338 -2142 -2662 -4013 -4013 -4013 -666 -0 -67 -184 -182 -397 -450 -450 -450 -578 -3938 -1373 -544 -578 -372 -48 -0 -48 -2424 -590 -919 -13 -0 -859 -2800 -2800 -2800 -60 -79 -0 -549 -0 -4138 -4138 -4138 -2380 -2380 -2380 -10 -4534 -4534 -4534 -3872 -3872 -3872 -30 -147 -802 -48 -2661 -2661 -2661 -4072 -1613 -44 -560 -24 -169 -35 -4281 -4281 -4281 -309 -468 -3268 -3268 -3268 -148 -0 -124 -318 -60 -179 -62 -1 -29 -30 -50 -3368 -22 -738 -216 -367 -367 -367 -1877 -107 -224 -111 -1 -22 -2402 -3 -21 -39 -0 -278 -366 -602 -3343 -3343 -3343 -32 -189 -205 -48 -22 -2709 -160 -2728 -4991 -4991 -4991 -3232 -3232 -3232 -189 -0 -23 -595 -606 -1218 -1218 -1218 -38 -214 -1219 -1219 -1219 -1319 -590 -590 -590 -233 -4131 -4131 -4131 -940 -622 -588 -1698 -4700 -4700 -4700 -110 -3813 -3813 -3813 -26 -0 -4 -1116 -37 -3129 -3129 -3129 -0 -95 -95 -95 -33 -308 -413 -69 -49 -908 -220 -577 -577 -577 -366 -3092 -3092 -3092 -1 -64 -9 -1 -4405 -4405 -4405 -97 -218 -0 -29 -1 -50 -1 -94 -3539 -77 -1661 -20 -110 -0 -1304 -257 -815 -211 -23 -1 -91 -688 -45 -230 -864 -0 -2218 -2218 -2218 -106 -2 -2696 -2696 -2696 -202 -397 -2798 -1317 -30 -382 -2728 -4334 -4334 -4334 -3914 -3914 -3914 -32 -32 -4834 -4834 -4834 -4833 -4833 -4833 -1598 -1598 -1598 -473 -1 -2 -438 -4213 -4213 -4213 -3221 -3221 -3221 -26 -103 -135 -0 -3834 -3834 -3834 -3861 -3861 -3861 -84 -82 -82 -82 -598 -2559 -21 -28 -367 -367 -367 -1 -78 -895 -33 -236 -123 -907 -4018 -4018 -4018 -352 -352 -352 -380 -575 -1638 -1638 -1638 -666 -2944 -115 -2029 -2029 -2029 -857 -178 -45 -27 -96 -282 -582 -176 -44 -1 -368 -4880 -4880 -4880 -1622 -2064 -0 -1 -237 -30 -101 -0 -204 -248 -248 -248 -82 -1290 -1290 -1290 -489 -47 -56 -31 -31 -210 -1159 -1664 -1664 -1664 -30 -1185 -1074 -1074 -1074 -367 -1024 -45 -4995 -4995 -4995 -548 -548 -548 -5 -322 -1197 -581 -46 -2134 -2134 -2134 -211 -622 -0 -49 -31 -1550 -239 -129 -2 -20 -991 -0 -576 -576 -576 -337 -4329 -4329 -4329 -57 -2733 -41 -46 -4367 -4367 -4367 -4635 -4635 -4635 -0 -868 -868 -868 -863 -25 -113 -125 -56 -32 -367 -0 -883 -2770 -2770 -2770 -3852 -46 -24 -28 -32 -926 -112 -3834 -0 -67 -0 -1650 -1650 -1650 -0 -474 -474 -474 -1 -369 -104 -47 -253 -253 -253 -1373 -2020 -2020 -2020 -0 -313 -1050 -1352 -1352 -1352 -2316 -2316 -2316 -0 -4286 -4286 -4286 -1004 -1348 -73 -292 -0 -966 -63 -176 -176 -176 -3331 -3331 -3331 -286 -3477 -21 -4172 -4172 -4172 -2 -659 -41 -718 -718 -718 -67 -28 -977 -42 -50 -32 -61 -4299 -4299 -4299 -262 -70 -54 -1364 -1364 -1364 -1 -1 -333 -107 -0 -189 -50 -287 -1659 -0 -3114 -3114 -3114 -732 -90 -3449 -3449 -3449 -2126 -2126 -2126 -522 -942 -307 -29 -1472 -1278 -2421 -1617 -109 -281 -42 -50 -2509 -2509 -2509 -367 -0 -1998 -1998 -1998 -4015 -4015 -4015 -142 -69 -9 -244 -2246 -2607 -72 -2521 -2521 -2521 -3119 -3119 -3119 -1 -452 -225 -0 -38 -3976 -74 -0 -93 -4565 -4565 -4565 -78 -32 -62 -2849 -2849 -2849 -63 -314 -12 -0 -362 -562 -34 -931 -275 -52 -155 -281 -4391 -4391 -4391 -276 -120 -120 -120 -1764 -44 -34 -3615 -1 -29 -53 -90 -369 -22 -26 -2543 -2543 -2543 -226 -29 -331 -95 -337 -635 -197 -0 -35 -1404 -1134 -0 -54 -118 -985 -1570 -28 -370 -163 -3936 -975 -975 -975 -238 -300 -51 -246 -22 -652 -365 -73 -117 -117 -117 -497 -269 -1995 -2024 -2856 -53 -22 -82 -189 -1 -48 -152 -4032 -4032 -4032 -28 -1147 -1147 -1147 -90 -2539 -0 -3285 -3285 -3285 -586 -15 -2737 -4276 -4276 -4276 -98 -86 -2958 -2106 -3483 -3634 -0 -4382 -1294 -1294 -1294 -57 -559 -559 -559 -61 -202 -2745 -27 -700 -700 -700 -115 -0 -1 -1823 -1 -4204 -178 -2355 -27 -1 -236 -28 -284 -197 -0 -8 -171 -749 -157 -37 -590 -457 -1224 -2576 -687 -687 -687 -33 -829 -202 -2139 -24 -1328 -1328 -1328 -0 -1 -31 -31 -0 -76 -0 -257 -28 -101 -2142 -2142 -2142 -1766 -306 -30 -42 -0 -1285 -1 -216 -2360 -2360 -2360 -20 -82 -46 -37 -335 -408 -1462 -1462 -1462 -4342 -4342 -4342 -22 -468 -1 -4007 -4007 -4007 -1097 -1 -3655 -42 -2150 -1809 -1809 -1809 -0 -1 -1793 -1793 -1793 -335 -223 -1253 -306 -1766 -4052 -1 -2001 -2001 -2001 -1562 -1562 -1562 -611 -28 -4355 -1521 -196 -0 -1732 -5 -2574 -2574 -2574 -173 -40 -623 -1313 -430 -88 -1 -769 -769 -769 -0 -345 -4768 -4768 -4768 -1 -385 -1176 -1176 -1176 -26 -30 -79 -129 -4 -44 -224 -641 -0 -355 -82 -142 -24 -122 -621 -1709 -3657 -3657 -3657 -154 -0 -3704 -0 -424 -280 -280 -280 -3610 -3610 -3610 -31 -1 -32 -335 -1 -20 -0 -0 -3 -1 -4678 -4678 -4678 -27 -109 -121 -2231 -701 -814 -814 -814 -36 -304 -691 -210 -1 -1842 -1 -0 -31 -0 -95 -1464 -1464 -1464 -5 -281 -0 -49 -4073 -4073 -4073 -4411 -4411 -4411 -640 -640 -640 -0 -55 -67 -55 -3906 -3906 -3906 -31 -2 -1 -60 -31 -6 -31 -1475 -226 -2931 -670 -670 -670 -373 -373 -373 -331 -0 -1476 -3 -1578 -519 -2 -183 -69 -294 -2057 -2057 -2057 -0 -102 -62 -41 -4278 -4278 -4278 -3612 -3612 -3612 -53 -1 -26 -31 -1680 -329 -32 -311 -40 -30 -37 -31 -46 -4788 -3210 -3210 -3210 -20 -49 -1134 -3771 -3771 -3771 -683 -0 -0 -1088 -25 -29 -2912 -2912 -2912 -0 -1 -177 -0 -3668 -3668 -3668 -294 -40 -33 -30 -1 -4705 -4705 -4705 -0 -0 -357 -103 -11 -298 -4784 -4784 -4784 -26 -1 -4382 -4382 -4382 -167 -22 -0 -3061 -3061 -3061 -119 -531 -367 -201 -30 -0 -177 -31 -0 -58 -29 -4 -155 -4095 -4095 -4095 -682 -55 -2256 -2256 -2256 -101 -693 -20 -240 -31 -41 -4494 -4494 -4494 -769 -4 -800 -25 -752 -1 -238 -24 -32 -53 -0 -0 -28 -1 -2109 -46 -200 -168 -398 -87 -3297 -351 -0 -67 -338 -2249 -1190 -24 -340 -340 -340 -3117 -3117 -3117 -229 -408 -31 -1887 -1887 -1887 -574 -574 -574 -2 -2563 -2563 -2563 -24 -378 -53 -3754 -3754 -3754 -0 -47 -50 -2151 -85 -4019 -4019 -4019 -4390 -4390 -4390 -946 -18 -2830 -374 -410 -410 -410 -1 -1081 -54 -1 -3274 -82 -375 -945 -139 -0 -3273 -3273 -3273 -2219 -2219 -2219 -4753 -4753 -4753 -354 -28 -395 -25 -332 -63 -0 -2 -3285 -29 -0 -49 -106 -75 -30 -0 -4100 -4100 -4100 -1 -1 -327 -15 -31 -27 -1 -1876 -31 -1153 -30 -46 -308 -1545 -1545 -1545 -21 -180 -3 -22 -119 -174 -202 -700 -27 -31 -4163 -4163 -4163 -2200 -2200 -2200 -1 -140 -31 -55 -20 -47 -36 -253 -0 -168 -27 -31 -1 -200 -1903 -1903 -1903 -437 -27 -601 -1 -32 -51 -983 -1 -3472 -3472 -3472 -91 -35 -37 -1173 -1173 -1173 -1 -59 -20 -0 -1 -4090 -4090 -4090 -77 -530 -2556 -1807 -1807 -1807 -3184 -3184 -3184 -10 -23 -1630 -62 -34 -7 -55 -0 -1572 -0 -28 -2 -35 -84 -1 -79 -1769 -1769 -1769 -92 -3086 -3086 -3086 -419 -10 -4877 -4877 -4877 -1857 -4504 -4504 -4504 -34 -0 -4010 -4010 -4010 -37 -24 -40 -0 -135 -437 -0 -0 -0 -3784 -3784 -3784 -31 -20 -78 -1 -31 -32 -0 -92 -60 -268 -140 -480 -2962 -2962 -2962 -23 -58 -44 -1582 -1582 -1582 -665 -22 -0 -44 -28 -87 -489 -3 -2917 -90 -418 -32 -24 -3291 -562 -93 -3792 -3792 -3792 -90 -3046 -31 -1 -1832 -1832 -1832 -22 -4068 -4042 -4042 -4042 -257 -20 -22 -0 -345 -440 -421 -68 -0 -3795 -4038 -4038 -4038 -31 -1090 -98 -25 -25 -25 -2383 -65 -98 -358 -2269 -2269 -2269 -42 -173 -59 -0 -143 -0 -2303 -3988 -3988 -3988 -767 -176 -1 -746 -827 -33 -730 -197 -269 -47 -24 -1 -1498 -1498 -1498 -2683 -6 -51 -0 -440 -4515 -4515 -4515 -30 -1586 -33 -597 -52 -1079 -915 -915 -915 -21 -79 -106 -62 -611 -102 -2924 -132 -2981 -2981 -2981 -2716 -2716 -2716 -51 -2954 -78 -24 -61 -532 -660 -1523 -1523 -1523 -2484 -0 -95 -233 -25 -16 -1485 -28 -181 -3127 -31 -0 -1 -1244 -49 -59 -4 -255 -155 -30 -0 -2576 -171 -3840 -3840 -3840 -484 -3443 -3443 -3443 -61 -4808 -4808 -4808 -67 -2016 -2016 -2016 -4513 -4513 -4513 -3472 -3472 -3472 -57 -2 -22 -45 -127 -34 -30 -1 -619 -142 -0 -118 -507 -1636 -1069 -634 -46 -2991 -3 -1590 -61 -466 -741 -1837 -1837 -1837 -36 -3638 -24 -4633 -4633 -4633 -103 -21 -437 -20 -23 -513 -565 -58 -991 -112 -3795 -3795 -3795 -1846 -1846 -1846 -481 -60 -559 -27 -204 -2758 -2758 -2758 -32 -1346 -255 -1 -258 -68 -238 -28 -0 -370 -72 -1505 -1505 -1505 -1371 -61 -1 -61 -809 -463 -1140 -505 -3468 -741 -100 -357 -357 -357 -1 -1 -149 -2597 -2597 -2597 -486 -486 -486 -67 -211 -2251 -761 -14 -0 -664 -4 -213 -258 -476 -65 -4958 -4958 -4958 -851 -91 -20 -841 -841 -841 -41 -1581 -1581 -1581 -23 -2477 -143 -174 -127 -52 -73 -107 -59 -1446 -1446 -1446 -261 -1 -24 -489 -1 -458 -58 -305 -45 -397 -1 -26 -4004 -4004 -4004 -465 -1 -4687 -4687 -4687 -4210 -4210 -4210 -433 -3750 -3750 -3750 -97 -31 -89 -112 -0 -1526 -1526 -1526 -564 -28 -564 -1200 -25 -21 -1933 -1933 -1933 -359 -4131 -4131 -4131 -320 -2994 -98 -4361 -4361 -4361 -0 -138 -191 -103 -124 -0 -67 -1776 -3321 -3321 -3321 -500 -0 -918 -1553 -1553 -1553 -474 -21 -0 -1187 -700 -95 -4548 -4548 -4548 -583 -583 -583 -2484 -2484 -2484 -58 -878 -134 -3548 -3548 -3548 -532 -63 -26 -130 -2 -101 -27 -23 -248 -58 -31 -0 -1962 -157 -52 -0 -0 -1 -376 -233 -315 -1337 -2401 -522 -57 -188 -156 -249 -350 -39 -225 -276 -92 -276 -31 -2 -37 -460 -2555 -2555 -2555 -4609 -4609 -4609 -0 -26 -366 -1178 -390 -57 -0 -112 -605 -645 -365 -483 -22 -221 -59 -54 -94 -23 -4419 -4419 -4419 -4585 -3843 -3843 -3843 -250 -250 -250 -1695 -1695 -1695 -611 -46 -65 -3 -1008 -1008 -1008 -115 -68 -0 -561 -42 -50 -3032 -3032 -3032 -2391 -0 -1975 -28 -1409 -1409 -1409 -36 -463 -206 -0 -71 -90 -0 -0 -605 -52 -78 -4809 -4809 -4809 -336 -38 -0 -244 -42 -493 -0 -50 -406 -406 -406 -24 -4433 -4433 -4433 -0 -3909 -3909 -3909 -4589 -4589 -4589 -68 -46 -1666 -21 -1 -2479 -113 -1 -230 -2832 -2832 -2832 -46 -1150 -1150 -1150 -4666 -4666 -4666 -32 -364 -0 -0 -178 -109 -96 -2 -2282 -2282 -2282 -48 -717 -3080 -32 -78 -1937 -1937 -1937 -1 -96 -186 -607 -80 -4985 -4985 -4985 -281 -254 -1 -168 -2 -88 -2476 -2476 -2476 -32 -20 -4782 -4782 -4782 -2482 -193 -698 -791 -791 -791 -243 -122 -173 -270 -980 -612 -574 -21 -1432 -27 -30 -23 -5 -24 -105 -3778 -3778 -3778 -147 -118 -1697 -1697 -1697 -32 -1466 -26 -1548 -1078 -1078 -1078 -1561 -3757 -3757 -3757 -0 -109 -252 -125 -110 -58 -216 -237 -0 -119 -1826 -1748 -0 -75 -6 -321 -61 -285 -28 -78 -587 -46 -1349 -328 -295 -879 -273 -71 -224 -21 -270 -27 -0 -246 -3173 -32 -2142 -129 -3805 -392 -290 -39 -394 -28 -0 -0 -53 -0 -32 -94 -1710 -0 -101 -111 -242 -1 -3507 -3507 -3507 -34 -1427 -1427 -1427 -3863 -3863 -3863 -1 -601 -215 -981 -981 -981 -0 -48 -0 -21 -249 -249 -249 -0 -286 -38 -1754 -1404 -1404 -1404 -3 -27 -1740 -1740 -1740 -323 -30 -134 -118 -202 -2390 -384 -365 -60 -78 -31 -73 -1813 -3616 -3616 -3616 -735 -15 -0 -3827 -3827 -3827 -562 -1821 -640 -1016 -0 -21 -2 -1 -0 -33 -95 -21 -1758 -3208 -1 -0 -1 -0 -587 -0 -365 -4456 -4456 -4456 -3253 -51 -247 -918 -50 -3298 -3298 -3298 -461 -3827 -1 -3590 -3590 -3590 -1 -1471 -370 -4839 -4839 -4839 -32 -42 -32 -356 -3515 -14 -4 -0 -0 -1042 -5 -1 -0 -14 -20 -1 -33 -727 -3 -27 -41 -146 -0 -1159 -1824 -1 -20 -1442 -1442 -1442 -0 -212 -2303 -2303 -2303 -3875 -636 -0 -0 -29 -1 -2 -36 -1402 -1402 -1402 -118 -673 -4732 -4732 -4732 -36 -61 -1064 -33 -708 -125 -3 -319 -1013 -1 -1 -373 -373 -373 -180 -362 -1 -21 -1324 -380 -123 -123 -123 -1 -106 -2500 -804 -646 -91 -575 -229 -309 -0 -215 -33 -3609 -36 -771 -38 -4978 -4978 -4978 -477 -30 -24 -0 -1457 -1457 -1457 -31 -2264 -0 -4 -1 -0 -885 -3 -722 -303 -539 -122 -31 -95 -36 -254 -345 -5 -0 -0 -13 -1 -34 -1306 -1468 -808 -808 -808 -0 -543 -77 -415 -4656 -4656 -4656 -374 -1189 -30 -2303 -2303 -2303 -214 -22 -26 -160 -25 -4694 -21 -25 -27 -20 -1 -406 -0 -21 -6 -30 -368 -1 -26 -4161 -4161 -4161 -1 -33 -835 -146 -3269 -3269 -3269 -0 -2 -35 -33 -0 -0 -23 -13 -0 -1581 -302 -4763 -4763 -4763 -4794 -4794 -4794 -24 -365 -1 -2 -266 -30 -4327 -4327 -4327 -29 -146 -3234 -35 -5 -156 -1 -1 -1 -369 -22 -641 -2 -3482 -3482 -3482 -25 -30 -4684 -4684 -4684 -2 -436 -0 -62 -48 -1 -6 -1 -0 -37 -2564 -2564 -2564 -0 -4775 -4775 -4775 -26 -1220 -1220 -1220 -3993 -3993 -3993 -2193 -2563 -0 -156 -22 -0 -3 -926 -2047 -2047 -2047 -364 -3829 -3829 -3829 -53 -27 -1063 -2056 -40 -208 -0 -2111 -157 -20 -266 -34 -0 -88 -819 -7 -433 -3895 -3895 -3895 -39 -27 -90 -3 -41 -111 -30 -2828 -2828 -2828 -12 -464 -729 -729 -729 -417 -408 -0 -25 -1514 -35 -0 -415 -35 -4389 -4389 -4389 -55 -99 -4845 -4845 -4845 -3980 -52 -901 -0 -408 -4894 -4894 -4894 -59 -756 -46 -4822 -4822 -4822 -35 -1512 -155 -58 -2232 -447 -1 -246 -32 -38 -514 -50 -1100 -0 -745 -225 -225 -225 -33 -41 -37 -47 -20 -2 -1097 -32 -0 -59 -31 -447 -24 -37 -58 -36 -333 -4429 -4429 -4429 -248 -1497 -477 -63 -21 -0 -34 -0 -477 -0 -30 -23 -22 -145 -4791 -4791 -4791 -0 -31 -3129 -3129 -3129 -2477 -2477 -2477 -2191 -2191 -2191 -2 -31 -79 -36 -243 -120 -54 -1975 -1975 -1975 -34 -948 -948 -948 -0 -1975 -1975 -1975 -54 -239 -44 -857 -119 -0 -222 -58 -58 -58 -483 -1940
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/data/xnotdate.json b/priv/static/metrics-graphics-3.0-alpha3/examples/data/xnotdate.json deleted file mode 100644 index 989a08a..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/data/xnotdate.json +++ /dev/null @@ -1,34 +0,0 @@ -[ - { - "males": 50, - "females": 12 - }, - { - "males": 95, - "females": 66 - }, - { - "males": 143, - "females": 89 - }, - { - "males": 198, - "females": 105 - }, - { - "males": 244, - "females": 533 - }, - { - "males": 277, - "females": 175 - }, - { - "males": 344, - "females": 401 - }, - { - "males": 441, - "females": 1299 - } -] diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/examples.htm b/priv/static/metrics-graphics-3.0-alpha3/examples/examples.htm deleted file mode 100644 index 1219425..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/examples.htm +++ /dev/null @@ -1,113 +0,0 @@ -<html lang='en'> -<head> - <meta content='text/html; charset=utf-8' http-equiv='Content-Type'> - - <title>MetricsGraphics.js - Examples</title> - - <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,700' rel='stylesheet' type='text/css'> - <link href='https://fonts.googleapis.com/css?family=PT+Serif:400,700,400italic' rel='stylesheet' type='text/css'> - <link href='https://netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.css' rel='stylesheet' type='text/css'> - <link href='https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css' rel='stylesheet' type='text/css'> - - <link href='metricsgraphics.css' rel='stylesheet' type='text/css'> - <link href='css/metricsgraphics-demo.css' rel='stylesheet' type='text/css' id='light'> - <link href='' rel='stylesheet' type='text/css' id='dark'> - <link href='' rel='stylesheet' type='text/css' id='accessible'> - <link href='css/highlightjs-default.css' rel='stylesheet' type='text/css' id='light-code'> - <link href='' rel='stylesheet' type='text/css' id='dark-code'> - - <script src='js/lib/highlight.pack.js'></script> - <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script> - <script src="https://d3js.org/d3.v4.min.js"></script> - <script src='https://unpkg.com/popper.js/dist/umd/popper.min.js'></script> - - <!-- dev start --> - <script src='js/MG.js'></script> - <script src='js/misc/utility.js'></script> - <script src='js/common/data_graphic.js'></script> - <script src='js/common/hooks.js'></script> - <script src='js/common/register.js'></script> - <script src='js/common/bootstrap_tooltip_popover.js'></script> - <script src='js/common/scales.js'></script> - <script src='js/common/chart_title.js'></script> - <script src='js/common/y_axis.js'></script> - <script src='js/common/x_axis.js'></script> - <script src='js/common/scales.js'></script> - <script src='js/common/init.js'></script> - <script src='js/common/markers.js'></script> - <script src='js/common/rollover.js'></script> - <script src='js/common/zoom.js'></script> - <script src='js/common/brush.js'></script> - <script src='js/common/window_listeners.js'></script> - <script src='js/layout/bootstrap_dropdown.js'></script> - <script src='js/layout/button.js'></script> - <script src='js/charts/line.js'></script> - <script src='js/charts/histogram.js'></script> - <script src='js/charts/point.js'></script> - <script src='js/charts/bar.js'></script> - <script src='js/charts/table.js'></script> - <script src='js/charts/missing.js'></script> - <script src='js/misc/process.js'></script> - <script src='js/misc/smoothers.js'></script> - <script src='js/misc/formatters.js'></script> - <script src='js/misc/transitions.js'></script> - <script src='js/misc/error.js'></script> - <!-- dev end --> - - <script> - (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ - (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), - m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) - })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); - - ga('create', 'UA-51487512-1', 'metricsgraphicsjs.org'); - ga('send', 'pageview'); - </script> -</head> - -<body> - <div class='container'> - <div class='head'> - <ul> - <li><a href='./'>Home</a></li> - <li><a href='https://github.com/metricsgraphics/metrics-graphics/releases'>Download</a></li> - <li><a href='interactive-demo.htm'>Interactive</a></li> - <li><a href='https://github.com/metricsgraphics/metrics-graphics'>Code</a></li> - <li><a href='https://github.com/metricsgraphics/metrics-graphics/issues'>Issues</a></li> - <li class='divider'>|</li> - <li><a href='#' id='light-css' class='pill active'>Light style</a></li> - <li><a href='#' id='dark-css' class='pill'>Dark style</a></li> - <li><a href='#' id='accessible-css' class='pill'>Accessible style</a></li> - </ul> - - <img src='images/logo.svg' id='logo' class='svg' /> - </div> - - <ul class='examples text-center'> - <li><a href='#' id='goto-lines' class='pill'>Lines</a></li> - <li><a href='#' id='goto-multilines' class='pill'>Multiple Lines</a></li> - <li><a href='#' id='goto-data' class='pill'>Data</a></li> - <li><a href='#' id='goto-axes' class='pill'>Axes</a></li> - <li><a href='#' id='goto-rollovers' class='pill'>Rollovers</a></li> - <li><a href='#' id='goto-auto-time-formatting' class='pill'>Automatic time formatting</a></li> - <li><a href='#' id='goto-annotations' class='pill'>Annotations</a></li> - <li><a href='#' id='goto-updating' class='pill'>Updating</a></li> - <li><a href='#' id='goto-other' class='pill'>Other</a></li> - <li><a href='#' id='goto-brushing_zooming' class='pill'>Brushing & Zooming</a></li> - <li><a href='#' id='goto-experimental' class='pill'>Experimental</a></li> - </ul> - - <div id='trunk'></div> - - <div class='footer'> - Created by <a href='https://twitter.com/alialmossawi'>Ali Almossawi</a>, - <a href='https://github.com/hamilton'>Hamilton Ulmer</a> — Metrics at - <a href='https://www.mozilla.org/en-US/'>Mozilla</a> - <br />Shared under the <a href='http://www.mozilla.org/MPL/2.0/'> - Mozilla Public License</a>. - </div> - </div> <!-- end container --> - - <script src='js/main.js'></script> -</body> -</html> diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/images/divider.png b/priv/static/metrics-graphics-3.0-alpha3/examples/images/divider.png Binary files differdeleted file mode 100644 index 9647b67..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/images/divider.png +++ /dev/null diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/images/logo.svg b/priv/static/metrics-graphics-3.0-alpha3/examples/images/logo.svg deleted file mode 100644 index c847025..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/images/logo.svg +++ /dev/null @@ -1,242 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
- width="480px" height="79px" viewBox="0 0 480 79" enable-background="new 0 0 480 79" xml:space="preserve">
-<g>
- <path fill="#101111" d="M96.164,52.427c2.84-4.839,5.58-9.709,8.22-14.61c2.64-4.899,5.24-9.875,7.8-14.924
- c0.56,0.038,1.149,0.064,1.77,0.083c0.62,0.019,1.27,0.027,1.95,0.027c0.56,0,1.11-0.027,1.65-0.083
- c0.54-0.055,1.089-0.083,1.65-0.083c0.64,0,0.96,0.185,0.96,0.554c0,0.407-0.22,0.619-0.66,0.638
- c-0.441,0.019-0.96,0.064-1.56,0.138c-1.121,0.121-1.821,0.904-2.1,2.348l-5.52,29.436c-0.12,0.683-0.18,1.225-0.18,1.626
- c0,1.284,0.58,1.926,1.74,1.926c0.36,0,0.649,0.03,0.87,0.091c0.219,0.06,0.33,0.271,0.33,0.632c0,0.161-0.081,0.311-0.24,0.451
- c-0.16,0.141-0.4,0.211-0.72,0.211c-0.32,0-0.86-0.051-1.62-0.149c-0.761-0.101-1.74-0.151-2.94-0.151
- c-1.44,0-2.57,0.062-3.39,0.181c-0.82,0.119-1.331,0.181-1.53,0.181c-0.52,0-0.78-0.261-0.78-0.783c0-0.48,0.2-0.722,0.6-0.722
- c0.399,0,0.879-0.08,1.44-0.241c0.879-0.24,1.449-0.672,1.71-1.295c0.26-0.621,0.53-1.574,0.81-2.859l5.88-29.676l-17.76,33.951
- c-0.36,0.723-0.74,1.084-1.14,1.084c-0.24,0-0.39-0.14-0.45-0.421s-0.11-0.702-0.15-1.265l-1.38-31.844
- c-2.961,9.15-5.081,16.204-6.36,21.16c-1.28,4.956-1.92,7.796-1.92,8.518c0,0.843,0.17,1.445,0.51,1.806
- c0.339,0.362,0.72,0.623,1.14,0.783c0.42,0.16,0.8,0.29,1.14,0.391c0.339,0.101,0.51,0.312,0.51,0.632
- c0,0.241-0.09,0.441-0.27,0.602c-0.18,0.161-0.39,0.241-0.63,0.241c-0.4,0-0.96-0.08-1.68-0.24c-0.72-0.159-1.661-0.239-2.82-0.239
- c-0.999,0-1.83,0.06-2.49,0.18s-1.149,0.18-1.47,0.18c-0.519,0-0.78-0.199-0.78-0.6c0-0.439,0.24-0.71,0.72-0.811
- c0.48-0.099,1.08-0.249,1.8-0.449c0.48-0.12,0.87-0.29,1.17-0.511c0.3-0.219,0.57-0.519,0.81-0.899c0.24-0.38,0.459-0.88,0.66-1.5
- c0.2-0.62,0.439-1.39,0.72-2.311l7.62-26.16c0.08-0.2,0.14-0.459,0.18-0.78c0.039-0.32,0.06-0.68,0.06-1.08
- c0-0.64-0.16-1.06-0.48-1.26c-0.32-0.2-0.67-0.33-1.05-0.39c-0.381-0.06-0.73-0.12-1.05-0.18c-0.321-0.06-0.48-0.25-0.48-0.57
- c0-0.44,0.3-0.66,0.9-0.66c0.159,0,0.699,0.038,1.62,0.111c0.919,0.074,2.34,0.11,4.26,0.11c0.8,0,1.25,0.112,1.35,0.333
- c0.099,0.221,0.169,0.657,0.21,1.306L96.164,52.427z"/>
- <path fill="#101111" d="M122.144,51.947c0,2.24,0.489,3.96,1.47,5.16c0.979,1.199,2.25,1.8,3.81,1.8c2.16,0,4.26-1.22,6.3-3.66
- c0.6-0.72,0.979-1.32,1.14-1.8c0.159-0.48,0.42-0.721,0.78-0.721c0.24,0,0.36,0.201,0.36,0.601c0,0.32-0.15,0.78-0.45,1.38
- c-0.3,0.6-0.771,1.32-1.41,2.16c-2.601,3.359-5.3,5.04-8.1,5.04c-1.08,0-2.09-0.251-3.03-0.75c-0.94-0.5-1.761-1.2-2.46-2.101
- c-0.7-0.899-1.25-1.989-1.65-3.27c-0.4-1.279-0.6-2.7-0.6-4.26c0-2.199,0.422-4.41,1.268-6.63c0.845-2.221,2.091-4.329,3.741-6.331
- c1.528-1.879,3.128-3.279,4.797-4.2c1.67-0.92,3.269-1.38,4.798-1.38c1.81,0,3.278,0.561,4.405,1.68
- c1.127,1.12,1.69,2.561,1.69,4.32c0,2.96-1.4,5.321-4.2,7.081c-2.8,1.761-6.96,2.86-12.479,3.3
- C122.204,50.647,122.144,51.508,122.144,51.947z M132.074,44.807c2.22-1.879,3.33-4.199,3.33-6.959c0-1.12-0.27-2.02-0.81-2.7
- c-0.54-0.68-1.271-1.02-2.19-1.02c-0.921,0-1.851,0.3-2.79,0.9c-0.94,0.6-1.851,1.491-2.73,2.67c-0.88,1.18-1.71,2.631-2.49,4.35
- c-0.78,1.721-1.431,3.681-1.95,5.88C126.644,47.728,129.854,46.688,132.074,44.807z"/>
- <path fill="#101111" d="M150.043,34.307h4.38c0.279,0,0.42,0.12,0.42,0.36c0,0.72-0.24,1.08-0.72,1.08h-4.38l-3.24,12.18
- c-0.6,2.28-1.08,4.131-1.44,5.55c-0.36,1.421-0.54,2.431-0.54,3.03c0,0.4,0.09,0.72,0.27,0.96c0.18,0.24,0.369,0.36,0.57,0.36
- c0.56,0,1.52-1.04,2.88-3.12c0.56-0.84,0.91-1.489,1.05-1.95c0.14-0.459,0.35-0.689,0.63-0.689c0.32,0,0.48,0.2,0.48,0.6
- c0,0.6-0.681,1.9-2.04,3.9c-1.041,1.56-2.061,2.74-3.06,3.54c-1,0.799-1.84,1.199-2.52,1.199c-0.6,0-1.09-0.27-1.47-0.81
- c-0.381-0.54-0.57-1.29-0.57-2.25c0-1.959,0.76-5.619,2.28-10.98l3.24-11.52h-3.66c-0.12,0-0.221-0.04-0.3-0.12
- c-0.081-0.08-0.12-0.159-0.12-0.24c0-0.72,0.24-1.08,0.72-1.08h3.78l1.5-5.64c0.159-0.56,0.41-0.919,0.75-1.08
- c0.339-0.159,0.89-0.24,1.65-0.24c0.799,0,1.2,0.201,1.2,0.6c0,0.16-0.1,0.6-0.3,1.32L150.043,34.307z"/>
- <path fill="#101111" d="M161.383,50.17c2.28-5.588,4.329-9.758,6.15-12.512c1.82-2.754,3.57-4.132,5.25-4.132
- c0.68,0,1.27,0.27,1.77,0.808c0.5,0.539,0.75,1.268,0.75,2.186c0,0.999-0.24,1.817-0.72,2.455c-0.48,0.639-1.02,0.958-1.62,0.958
- c-0.48,0-0.87-0.149-1.17-0.449c-0.3-0.299-0.45-0.729-0.45-1.287c0-0.439-0.101-0.788-0.3-1.047
- c-0.201-0.259-0.42-0.389-0.66-0.389c-0.681,0-1.93,1.557-3.75,4.67c-1.821,3.113-3.951,7.823-6.39,14.129
- c-0.44,1.157-0.771,2.075-0.99,2.754c-0.221,0.679-0.42,1.197-0.6,1.557c-0.18,0.359-0.39,0.59-0.63,0.688
- c-0.24,0.1-0.621,0.149-1.14,0.149c-0.96,0-1.44-0.239-1.44-0.718c0-0.08,0.06-0.34,0.18-0.778l4.44-16.879
- c0.28-1.076,0.5-2.014,0.66-2.812c0.16-0.798,0.24-1.477,0.24-2.035c0-0.758-0.3-1.137-0.9-1.137c-0.52,0-1.041,0.28-1.56,0.84
- c-0.521,0.561-1.011,1.17-1.47,1.83c-0.46,0.66-0.88,1.26-1.26,1.8c-0.381,0.54-0.651,0.81-0.81,0.81c-0.28,0-0.42-0.199-0.42-0.6
- c0-0.16,0.199-0.6,0.6-1.32c0.399-0.72,1.06-1.62,1.98-2.7c2.16-2.559,3.98-3.84,5.46-3.84c0.6,0,1.08,0.229,1.44,0.689
- c0.36,0.459,0.54,1.147,0.54,2.065c0,0.319-0.06,0.978-0.18,1.975c-0.12,0.999-0.36,2.195-0.72,3.593L161.383,50.17z"/>
- <path fill="#101111" d="M179.802,55.007c-0.36,1.2-0.54,1.98-0.54,2.34c0,0.841,0.279,1.261,0.84,1.261c1,0,2.08-1.021,3.24-3.061
- c0.639-1.08,1.069-1.869,1.29-2.37c0.219-0.499,0.41-0.75,0.57-0.75c0.279,0,0.42,0.141,0.42,0.42c0,0.681-0.801,2.241-2.4,4.681
- c-0.921,1.4-1.84,2.45-2.76,3.149c-0.92,0.699-1.78,1.05-2.58,1.05c-1.601,0-2.4-1-2.4-3c0-1.039,0.22-2.329,0.66-3.869
- c0.439-1.54,1.04-3.391,1.8-5.551l2.46-7.199c0.36-1.08,0.66-2.01,0.9-2.791c0.24-0.78,0.36-1.449,0.36-2.01
- c0-0.44-0.051-0.759-0.15-0.96c-0.101-0.2-0.33-0.3-0.69-0.3c-0.48,0-0.96,0.25-1.44,0.75c-0.48,0.501-0.93,1.061-1.35,1.68
- c-0.42,0.621-0.801,1.18-1.14,1.68c-0.34,0.501-0.591,0.75-0.75,0.75c-0.201,0-0.3-0.181-0.3-0.54c0-0.16,0.159-0.54,0.48-1.14
- c0.319-0.6,0.84-1.359,1.56-2.28c2.04-2.56,3.84-3.84,5.4-3.84c0.68,0,1.22,0.22,1.62,0.66c0.399,0.44,0.6,1.06,0.6,1.86
- c0,0.84-0.141,1.761-0.42,2.76c-0.28,1-0.621,2.099-1.02,3.3L179.802,55.007z M184.872,23.837c0.58-0.819,1.23-1.23,1.95-1.23
- c0.519,0,0.939,0.201,1.26,0.6c0.32,0.4,0.48,0.92,0.48,1.56c0,1.161-0.28,2.16-0.84,3c-0.561,0.84-1.2,1.26-1.92,1.26
- c-0.561,0-1-0.219-1.32-0.66c-0.32-0.44-0.48-1.06-0.48-1.86C184.002,25.547,184.292,24.657,184.872,23.837z"/>
- <path fill="#101111" d="M209.082,33.917c0.919,0.581,1.38,1.41,1.38,2.49c0,0.4-0.16,0.78-0.48,1.14
- c-0.321,0.36-0.76,0.54-1.32,0.54c-0.681,0-1.251-0.18-1.71-0.54c-0.46-0.36-0.88-0.75-1.26-1.17c-0.38-0.42-0.741-0.81-1.08-1.17
- c-0.34-0.36-0.73-0.54-1.17-0.54c-0.88,0-1.87,0.4-2.97,1.2c-1.101,0.8-2.14,1.911-3.12,3.33c-0.981,1.42-1.811,3.13-2.49,5.13
- c-0.681,2.001-1.02,4.2-1.02,6.6c0,2.561,0.51,4.521,1.53,5.88c1.02,1.36,2.45,2.04,4.29,2.04c1.879,0,3.9-1.199,6.06-3.6
- c0.64-0.72,1.05-1.32,1.23-1.8c0.18-0.48,0.45-0.721,0.81-0.721c0.28,0,0.42,0.201,0.42,0.601c0,0.32-0.21,0.84-0.63,1.56
- c-0.42,0.721-1.07,1.581-1.95,2.58c-1.281,1.48-2.571,2.591-3.87,3.33c-1.3,0.74-2.65,1.11-4.05,1.11
- c-1.161,0-2.23-0.251-3.21-0.75c-0.98-0.5-1.84-1.2-2.58-2.101c-0.741-0.899-1.32-1.989-1.74-3.27c-0.42-1.279-0.63-2.7-0.63-4.26
- c0-2.199,0.439-4.41,1.32-6.63c0.879-2.221,2.18-4.25,3.9-6.09c1.68-2.04,3.47-3.51,5.37-4.41c1.899-0.9,3.63-1.35,5.19-1.35
- C206.901,33.047,208.161,33.338,209.082,33.917z"/>
- <path fill="#101111" d="M222.342,46.901c0.96,1.206,1.72,2.34,2.28,3.405c0.56,1.064,0.84,2.2,0.84,3.404
- c0,1.086-0.23,2.11-0.69,3.074s-1.06,1.808-1.8,2.531s-1.61,1.307-2.61,1.748c-1,0.441-2.04,0.662-3.12,0.662
- c-0.84,0-1.68-0.11-2.52-0.329c-0.84-0.221-1.6-0.511-2.28-0.87c-0.68-0.36-1.23-0.76-1.65-1.2c-0.42-0.439-0.63-0.859-0.63-1.26
- c0-1.28,0.13-2.271,0.39-2.971c0.261-0.699,0.57-1.05,0.93-1.05c0.24,0,0.44,0.09,0.6,0.271c0.159,0.18,0.309,0.42,0.45,0.72
- c0.14,0.3,0.27,0.62,0.39,0.96s0.279,0.69,0.48,1.05c0.64,1.161,1.359,2.021,2.16,2.58c0.8,0.561,1.659,0.84,2.58,0.84
- c1.119,0,2.079-0.47,2.88-1.41c0.8-0.939,1.2-2.089,1.2-3.449c0-0.92-0.19-1.771-0.57-2.551c-0.38-0.779-0.91-1.59-1.59-2.43
- l-2.52-3.06c-0.96-1.16-1.701-2.26-2.22-3.301c-0.52-1.039-0.78-2.079-0.78-3.119c0-1,0.21-1.98,0.63-2.94s0.979-1.81,1.68-2.55
- c0.699-0.74,1.509-1.33,2.43-1.77c0.92-0.44,1.899-0.66,2.94-0.66c0.76,0,1.51,0.074,2.25,0.222s1.41,0.351,2.01,0.609
- c0.601,0.259,1.08,0.575,1.44,0.948c0.36,0.374,0.54,0.781,0.54,1.221c0,1.92-0.381,2.88-1.14,2.88c-0.321,0-0.681-0.229-1.08-0.69
- c-0.4-0.459-0.87-0.969-1.41-1.53c-0.54-0.56-1.14-1.07-1.8-1.53c-0.66-0.459-1.41-0.69-2.25-0.69c-0.92,0-1.73,0.372-2.43,1.116
- c-0.701,0.743-1.05,1.677-1.05,2.802c0,0.724,0.16,1.417,0.48,2.079c0.32,0.663,0.78,1.375,1.38,2.139L222.342,46.901z"/>
- <path fill="#101111" d="M259.182,31.007c-0.12,0.521-0.4,0.78-0.84,0.78c-0.48,0-0.721-0.42-0.721-1.26
- c0-0.36,0.021-0.789,0.061-1.29c0.039-0.5,0.06-1.089,0.06-1.77c0-1.479-0.13-2.499-0.39-3.06c-0.261-0.56-0.971-0.84-2.13-0.84
- c-1.721,0-3.641,0.42-5.76,1.26c-2.121,0.84-4.121,2.1-6,3.78c-2.801,2.52-4.941,5.43-6.42,8.73c-1.48,3.3-2.221,6.771-2.221,10.41
- c0,3.921,0.88,6.971,2.641,9.15c1.76,2.181,4.159,3.27,7.199,3.27c1.2,0,2.229-0.12,3.091-0.36c0.859-0.239,1.569-0.639,2.13-1.199
- c0.439-1.44,0.77-2.68,0.989-3.721c0.22-1.039,0.391-1.839,0.511-2.399l0.899-4.561c0.12-0.759,0.181-1.2,0.181-1.319
- c0-1.04-0.42-1.681-1.261-1.92c-0.28-0.08-0.561-0.12-0.84-0.12c-0.28,0-0.54-0.01-0.78-0.03c-0.239-0.02-0.44-0.08-0.6-0.18
- c-0.16-0.1-0.24-0.29-0.24-0.57c0-0.48,0.36-0.72,1.08-0.72c0.56,0,1.26,0.04,2.101,0.12c0.84,0.08,1.819,0.119,2.939,0.119
- c1.16,0,2.12-0.06,2.88-0.18s1.32-0.18,1.681-0.18c0.479,0,0.72,0.2,0.72,0.6c0,0.32-0.081,0.531-0.24,0.63
- c-0.16,0.101-0.37,0.181-0.63,0.24c-0.261,0.06-0.54,0.12-0.84,0.18c-0.3,0.061-0.591,0.19-0.87,0.391c-0.48,0.4-0.87,1-1.17,1.8
- c-0.3,0.801-0.591,1.881-0.87,3.24l-0.66,3.359c-0.12,0.641-0.28,1.44-0.479,2.4c-0.201,0.96-0.36,2.141-0.48,3.54
- c-2.8,1.72-5.961,2.58-9.479,2.58c-2.081,0-3.99-0.351-5.73-1.05c-1.74-0.7-3.24-1.689-4.5-2.971
- c-1.26-1.279-2.24-2.819-2.939-4.62c-0.701-1.8-1.051-3.779-1.051-5.939c0-3.92,0.9-7.55,2.7-10.89c1.8-3.339,4.46-6.33,7.98-8.97
- c2.6-1.92,5.399-3.369,8.399-4.35c3-0.98,5.9-1.47,8.7-1.47c2,0,3,0.4,3,1.2c0,0.201-0.021,0.34-0.06,0.42L259.182,31.007z"/>
- <path fill="#101111" d="M268.721,50.17c2.28-5.588,4.329-9.758,6.15-12.512c1.819-2.754,3.569-4.132,5.25-4.132
- c0.68,0,1.269,0.27,1.77,0.808c0.5,0.539,0.75,1.268,0.75,2.186c0,0.999-0.24,1.817-0.72,2.455c-0.48,0.639-1.021,0.958-1.62,0.958
- c-0.48,0-0.87-0.149-1.17-0.449c-0.3-0.299-0.45-0.729-0.45-1.287c0-0.439-0.101-0.788-0.3-1.047
- c-0.201-0.259-0.42-0.389-0.66-0.389c-0.681,0-1.931,1.557-3.75,4.67c-1.82,3.113-3.951,7.823-6.39,14.129
- c-0.441,1.157-0.771,2.075-0.99,2.754c-0.221,0.679-0.42,1.197-0.601,1.557c-0.18,0.359-0.39,0.59-0.63,0.688
- c-0.239,0.1-0.62,0.149-1.14,0.149c-0.96,0-1.44-0.239-1.44-0.718c0-0.08,0.061-0.34,0.181-0.778l4.439-16.879
- c0.279-1.076,0.5-2.014,0.66-2.812c0.159-0.798,0.24-1.477,0.24-2.035c0-0.758-0.3-1.137-0.9-1.137c-0.521,0-1.04,0.28-1.56,0.84
- c-0.521,0.561-1.011,1.17-1.47,1.83c-0.461,0.66-0.881,1.26-1.261,1.8s-0.65,0.81-0.81,0.81c-0.28,0-0.42-0.199-0.42-0.6
- c0-0.16,0.199-0.6,0.6-1.32c0.399-0.72,1.06-1.62,1.98-2.7c2.16-2.559,3.979-3.84,5.46-3.84c0.6,0,1.08,0.229,1.439,0.689
- c0.36,0.459,0.54,1.147,0.54,2.065c0,0.319-0.06,0.978-0.18,1.975c-0.12,0.999-0.36,2.195-0.72,3.593L268.721,50.17z"/>
- <path fill="#101111" d="M302.141,53.207c-0.24,0.84-0.4,1.521-0.48,2.04c-0.08,0.521-0.12,0.86-0.12,1.02
- c0,0.841,0.22,1.261,0.66,1.261c0.68,0,1.62-0.84,2.82-2.521c0.52-0.72,0.859-1.279,1.02-1.68c0.16-0.399,0.399-0.601,0.721-0.601
- c0.199,0,0.3,0.141,0.3,0.421c0,0.84-0.641,2.159-1.92,3.96c-2.2,3.2-4.141,4.8-5.82,4.8c-1.28,0-1.92-0.86-1.92-2.58
- c0-0.999,0.13-2.03,0.39-3.09s0.55-2.17,0.87-3.33l1.801-6.66c-3,5.16-5.641,9.04-7.921,11.64c-2.279,2.601-4.42,3.9-6.42,3.9
- c-1.479,0-2.66-0.561-3.54-1.68c-0.879-1.12-1.319-2.74-1.319-4.86c0-2.199,0.51-4.539,1.529-7.021
- c1.021-2.479,2.59-5.039,4.71-7.68c2-2.52,4.051-4.389,6.15-5.61c2.1-1.22,3.95-1.83,5.55-1.83c1.08,0,1.95,0.21,2.61,0.63
- c0.66,0.42,1.13,0.63,1.41,0.63c0.159,0,0.31-0.09,0.45-0.27c0.14-0.18,0.309-0.38,0.51-0.6c0.199-0.219,0.45-0.42,0.75-0.6
- s0.669-0.27,1.109-0.27c0.561,0,0.939,0.051,1.141,0.15c0.199,0.101,0.3,0.371,0.3,0.81c0,0.28-0.101,0.72-0.3,1.32L302.141,53.207
- z M294.671,36.557c-1.821,1.5-3.631,3.81-5.431,6.93c-1.4,2.44-2.44,4.649-3.12,6.63c-0.681,1.979-1.02,3.65-1.02,5.01
- c0,1.161,0.26,2.04,0.78,2.64c0.519,0.601,1.179,0.9,1.979,0.9c1.119,0,2.35-0.669,3.69-2.01c1.34-1.34,2.91-3.33,4.71-5.97
- c4.2-6.16,6.3-10.4,6.3-12.721c0-1.16-0.3-2.06-0.9-2.7c-0.6-0.64-1.439-0.96-2.52-0.96
- C297.979,34.307,296.49,35.057,294.671,36.557z"/>
- <path fill="#101111" d="M320.08,33.827c0.8-0.2,1.569-0.35,2.31-0.45c0.74-0.099,1.45-0.15,2.131-0.15c2.76,0,4.89,0.801,6.39,2.4
- c1.5,1.601,2.25,3.9,2.25,6.9c0,2.279-0.411,4.58-1.23,6.899c-0.82,2.32-2.01,4.5-3.569,6.54c-2.961,3.801-6,5.7-9.12,5.7
- c-1.041,0-1.971-0.21-2.79-0.63c-0.82-0.42-1.631-1.069-2.43-1.95l-2.101,10.32c-0.08,0.399-0.12,0.739-0.12,1.02
- c0,0.601,0.181,1.029,0.54,1.29c0.36,0.26,0.77,0.46,1.23,0.601c0.459,0.14,0.87,0.26,1.229,0.359c0.36,0.1,0.54,0.29,0.54,0.57
- c0,0.439-0.22,0.66-0.66,0.66s-1.18-0.07-2.22-0.21c-1.04-0.141-2.359-0.21-3.96-0.21c-1.119,0-2.04,0.069-2.76,0.21
- c-0.72,0.14-1.28,0.21-1.68,0.21c-0.68,0-1.021-0.16-1.021-0.48c0-0.44,0.25-0.7,0.75-0.779c0.501-0.081,1.17-0.28,2.01-0.601
- c0.48-0.2,0.851-0.39,1.11-0.57c0.261-0.18,0.471-0.399,0.63-0.659c0.16-0.261,0.291-0.591,0.39-0.99
- c0.101-0.4,0.231-0.921,0.391-1.561l7.68-31.68c-0.921,0.48-1.641,0.87-2.16,1.17c-0.521,0.3-0.88,0.45-1.08,0.45
- c-0.32,0-0.479-0.1-0.479-0.3c0-0.52,0.339-0.99,1.02-1.41c0.68-0.42,1.72-0.909,3.12-1.47l1.32-5.76c0.12-0.48,0.26-0.78,0.42-0.9
- c0.159-0.12,0.439-0.18,0.84-0.18h0.78c0.56,0,0.949,0.01,1.17,0.03c0.22,0.021,0.33,0.13,0.33,0.33v0.24
- c0,0.12-0.04,0.28-0.12,0.48L320.08,33.827z M315.28,53.837c-0.16,0.844-0.24,1.608-0.24,2.29c0,1.287,0.33,2.292,0.99,3.016
- s1.55,1.084,2.67,1.084c2.84,0,5.199-1.828,7.08-5.485c1.359-2.612,2.359-5.094,3-7.445c0.64-2.351,0.96-4.33,0.96-5.938
- c0-2.09-0.54-3.698-1.62-4.823s-2.64-1.688-4.68-1.688c-0.96,0-2.2,0.221-3.721,0.663l-3.779,15.373
- C315.66,52.008,315.439,52.993,315.28,53.837z"/>
- <path fill="#101111" d="M341.499,46.907c2.36-4.6,4.53-8.03,6.51-10.29c1.98-2.26,3.931-3.39,5.851-3.39
- c1.479,0,2.68,0.648,3.6,1.941c0.92,1.294,1.38,3.136,1.38,5.525c0,2.15-0.359,4.46-1.08,6.928c-0.72,2.47-1.739,4.799-3.06,6.988
- c-1.4,2.27-2.87,3.994-4.41,5.172c-1.54,1.176-2.91,1.766-4.109,1.766c-1.001,0-1.78-0.25-2.341-0.75s-0.84-1.169-0.84-2.007
- c0-0.597,0.159-1.074,0.48-1.433c0.319-0.358,0.699-0.538,1.14-0.538c0.36,0,0.66,0.14,0.9,0.418
- c0.239,0.279,0.459,0.588,0.66,0.927c0.199,0.338,0.429,0.646,0.689,0.925c0.26,0.279,0.609,0.418,1.05,0.418
- c0.8,0,1.51-0.457,2.13-1.372s1.311-2.309,2.07-4.18c0.56-1.353,1.04-2.696,1.44-4.029c0.399-1.333,0.72-2.606,0.96-3.82
- c0.239-1.213,0.42-2.328,0.54-3.343s0.18-1.86,0.18-2.537c0-1.393-0.25-2.448-0.75-3.164c-0.501-0.716-1.15-1.075-1.95-1.075
- c-1.601,0-3.471,1.38-5.609,4.14c-2.141,2.76-4.211,6.72-6.21,11.88c-1.041,2.76-1.771,4.821-2.19,6.181s-0.67,2.1-0.75,2.22
- c-0.2,0.359-0.761,0.54-1.68,0.54c-0.44,0-0.75-0.051-0.931-0.15c-0.18-0.1-0.27-0.369-0.27-0.81c0-0.2,0.06-0.54,0.18-1.021
- l8.7-33.84c0.279-1.08,0.42-1.86,0.42-2.34c0-0.279-0.12-0.53-0.36-0.75c-0.239-0.219-0.58-0.33-1.02-0.33
- c-0.12,0-0.23,0.01-0.33,0.03c-0.101,0.021-0.21,0.03-0.33,0.03c-0.641,0-0.96-0.2-0.96-0.6c0-0.24,0.09-0.41,0.271-0.51
- c0.18-0.1,0.42-0.17,0.72-0.21c0.3-0.04,0.669-0.07,1.109-0.09c0.44-0.02,0.92-0.09,1.44-0.21c1.08-0.2,1.86-0.5,2.34-0.9
- c0.48-0.399,0.9-0.6,1.26-0.6c0.2,0,0.301,0.16,0.301,0.48c0,0.041-0.011,0.111-0.03,0.21c-0.021,0.101-0.051,0.25-0.09,0.45
- L341.499,46.907z"/>
- <path fill="#101111" d="M366.579,55.007c-0.36,1.2-0.54,1.98-0.54,2.34c0,0.841,0.279,1.261,0.84,1.261
- c0.999,0,2.079-1.021,3.24-3.061c0.64-1.08,1.069-1.869,1.29-2.37c0.219-0.499,0.409-0.75,0.569-0.75
- c0.28,0,0.421,0.141,0.421,0.42c0,0.681-0.801,2.241-2.4,4.681c-0.921,1.4-1.841,2.45-2.76,3.149c-0.921,0.699-1.78,1.05-2.58,1.05
- c-1.601,0-2.4-1-2.4-3c0-1.039,0.22-2.329,0.66-3.869c0.439-1.54,1.04-3.391,1.8-5.551l2.46-7.199c0.36-1.08,0.66-2.01,0.9-2.791
- c0.24-0.78,0.359-1.449,0.359-2.01c0-0.44-0.05-0.759-0.149-0.96c-0.101-0.2-0.33-0.3-0.69-0.3c-0.479,0-0.96,0.25-1.439,0.75
- c-0.48,0.501-0.931,1.061-1.351,1.68c-0.42,0.621-0.8,1.18-1.14,1.68c-0.34,0.501-0.591,0.75-0.75,0.75c-0.2,0-0.3-0.181-0.3-0.54
- c0-0.16,0.159-0.54,0.479-1.14s0.84-1.359,1.561-2.28c2.04-2.56,3.84-3.84,5.399-3.84c0.68,0,1.22,0.22,1.62,0.66
- c0.399,0.44,0.601,1.06,0.601,1.86c0,0.84-0.141,1.761-0.42,2.76c-0.28,1-0.621,2.099-1.021,3.3L366.579,55.007z M371.649,23.837
- c0.579-0.819,1.229-1.23,1.949-1.23c0.52,0,0.939,0.201,1.261,0.6c0.319,0.4,0.479,0.92,0.479,1.56c0,1.161-0.28,2.16-0.84,3
- c-0.561,0.84-1.2,1.26-1.92,1.26c-0.561,0-1-0.219-1.32-0.66c-0.32-0.44-0.479-1.06-0.479-1.86
- C370.779,25.547,371.068,24.657,371.649,23.837z"/>
- <path fill="#101111" d="M395.858,33.917c0.92,0.581,1.38,1.41,1.38,2.49c0,0.4-0.16,0.78-0.48,1.14
- c-0.32,0.36-0.76,0.54-1.319,0.54c-0.681,0-1.251-0.18-1.71-0.54c-0.461-0.36-0.881-0.75-1.26-1.17
- c-0.381-0.42-0.741-0.81-1.08-1.17c-0.341-0.36-0.73-0.54-1.17-0.54c-0.881,0-1.871,0.4-2.971,1.2c-1.101,0.8-2.14,1.911-3.12,3.33
- c-0.98,1.42-1.81,3.13-2.489,5.13c-0.681,2.001-1.021,4.2-1.021,6.6c0,2.561,0.51,4.521,1.53,5.88c1.02,1.36,2.449,2.04,4.29,2.04
- c1.88,0,3.899-1.199,6.06-3.6c0.64-0.72,1.05-1.32,1.23-1.8c0.18-0.48,0.45-0.721,0.81-0.721c0.279,0,0.42,0.201,0.42,0.601
- c0,0.32-0.21,0.84-0.63,1.56c-0.42,0.721-1.07,1.581-1.95,2.58c-1.28,1.48-2.57,2.591-3.87,3.33c-1.3,0.74-2.649,1.11-4.05,1.11
- c-1.16,0-2.23-0.251-3.21-0.75c-0.98-0.5-1.84-1.2-2.58-2.101c-0.74-0.899-1.319-1.989-1.739-3.27
- c-0.421-1.279-0.631-2.7-0.631-4.26c0-2.199,0.44-4.41,1.32-6.63c0.88-2.221,2.18-4.25,3.9-6.09c1.68-2.04,3.47-3.51,5.37-4.41
- c1.899-0.9,3.63-1.35,5.189-1.35C393.678,33.047,394.938,33.338,395.858,33.917z"/>
- <path fill="#101111" d="M409.118,46.901c0.96,1.206,1.72,2.34,2.28,3.405c0.56,1.064,0.84,2.2,0.84,3.404
- c0,1.086-0.23,2.11-0.69,3.074s-1.06,1.808-1.8,2.531s-1.61,1.307-2.609,1.748c-1.001,0.441-2.04,0.662-3.12,0.662
- c-0.84,0-1.681-0.11-2.521-0.329c-0.84-0.221-1.6-0.511-2.279-0.87c-0.68-0.36-1.23-0.76-1.65-1.2
- c-0.42-0.439-0.63-0.859-0.63-1.26c0-1.28,0.13-2.271,0.39-2.971c0.261-0.699,0.57-1.05,0.93-1.05c0.24,0,0.441,0.09,0.601,0.271
- c0.159,0.18,0.31,0.42,0.45,0.72c0.14,0.3,0.27,0.62,0.39,0.96s0.279,0.69,0.48,1.05c0.639,1.161,1.359,2.021,2.159,2.58
- c0.8,0.561,1.66,0.84,2.58,0.84c1.12,0,2.08-0.47,2.88-1.41c0.8-0.939,1.2-2.089,1.2-3.449c0-0.92-0.19-1.771-0.569-2.551
- c-0.381-0.779-0.911-1.59-1.591-2.43l-2.52-3.06c-0.96-1.16-1.701-2.26-2.22-3.301c-0.521-1.039-0.78-2.079-0.78-3.119
- c0-1,0.21-1.98,0.63-2.94s0.979-1.81,1.68-2.55c0.7-0.74,1.51-1.33,2.431-1.77c0.919-0.44,1.899-0.66,2.939-0.66
- c0.76,0,1.51,0.074,2.25,0.222s1.41,0.351,2.01,0.609c0.601,0.259,1.08,0.575,1.44,0.948c0.36,0.374,0.54,0.781,0.54,1.221
- c0,1.92-0.381,2.88-1.14,2.88c-0.321,0-0.681-0.229-1.08-0.69c-0.4-0.459-0.87-0.969-1.41-1.53c-0.54-0.56-1.14-1.07-1.8-1.53
- c-0.66-0.459-1.41-0.69-2.25-0.69c-0.921,0-1.73,0.372-2.431,1.116c-0.7,0.743-1.05,1.677-1.05,2.802
- c0,0.724,0.159,1.417,0.48,2.079c0.319,0.663,0.779,1.375,1.38,2.139L409.118,46.901z"/>
- <path fill="#101111" d="M416.708,56.717c0.459-0.619,1.01-0.93,1.649-0.93c1.12,0,1.681,0.78,1.681,2.34
- c0,0.801-0.23,1.54-0.69,2.22s-1.011,1.021-1.649,1.021c-1.121,0-1.681-0.78-1.681-2.34
- C416.018,58.107,416.248,57.338,416.708,56.717z"/>
- <path fill="#101111" d="M431.678,61.188c-0.6,2.279-1.311,4.249-2.13,5.909c-0.82,1.66-1.68,3.05-2.58,4.17
- c-0.899,1.12-1.83,1.95-2.79,2.49s-1.88,0.811-2.76,0.811c-1.239,0-2.27-0.36-3.09-1.08c-0.819-0.721-1.23-1.541-1.23-2.46
- c0-0.641,0.181-1.141,0.54-1.5c0.36-0.36,0.761-0.54,1.2-0.54c0.48,0,0.87,0.199,1.17,0.6c0.3,0.399,0.58,0.84,0.84,1.32
- c0.261,0.479,0.521,0.92,0.78,1.319c0.261,0.399,0.61,0.601,1.05,0.601c0.601,0,1.141-0.341,1.62-1.021
- c0.48-0.681,0.971-1.739,1.47-3.18c0.501-1.439,1.041-3.261,1.62-5.46c0.579-2.2,1.29-4.819,2.13-7.86l4.32-15.959
- c0.199-0.68,0.33-1.24,0.39-1.68c0.061-0.439,0.091-0.72,0.091-0.84c0-0.44-0.281-0.66-0.841-0.66c-0.4,0-0.82,0.25-1.26,0.75
- c-0.44,0.5-0.87,1.041-1.29,1.62c-0.42,0.58-0.801,1.12-1.14,1.62c-0.341,0.501-0.591,0.75-0.75,0.75c-0.24,0-0.36-0.181-0.36-0.54
- c0-0.16,0.17-0.54,0.51-1.14s0.87-1.359,1.591-2.28c1.039-1.28,1.989-2.24,2.85-2.88c0.859-0.639,1.71-0.96,2.55-0.96
- c0.601,0,1.1,0.201,1.5,0.6c0.399,0.4,0.601,0.98,0.601,1.74c0,0.44-0.051,0.93-0.15,1.47c-0.101,0.54-0.25,1.15-0.45,1.83
- L431.678,61.188z M437.738,23.837c0.56-0.819,1.199-1.23,1.92-1.23c0.52,0,0.939,0.201,1.26,0.6c0.319,0.4,0.479,0.92,0.479,1.56
- c0,1.161-0.27,2.16-0.81,3s-1.17,1.26-1.89,1.26c-0.561,0-1.001-0.219-1.32-0.66c-0.32-0.44-0.48-1.06-0.48-1.86
- C436.897,25.547,437.178,24.657,437.738,23.837z"/>
- <path fill="#101111" d="M451.417,46.901c0.96,1.206,1.72,2.34,2.28,3.405c0.56,1.064,0.84,2.2,0.84,3.404
- c0,1.086-0.23,2.11-0.69,3.074s-1.06,1.808-1.8,2.531s-1.61,1.307-2.609,1.748c-1.001,0.441-2.04,0.662-3.12,0.662
- c-0.84,0-1.681-0.11-2.521-0.329c-0.84-0.221-1.6-0.511-2.279-0.87c-0.68-0.36-1.23-0.76-1.65-1.2
- c-0.42-0.439-0.63-0.859-0.63-1.26c0-1.28,0.13-2.271,0.39-2.971c0.261-0.699,0.57-1.05,0.93-1.05c0.24,0,0.441,0.09,0.601,0.271
- c0.159,0.18,0.31,0.42,0.45,0.72c0.14,0.3,0.27,0.62,0.39,0.96s0.279,0.69,0.48,1.05c0.639,1.161,1.359,2.021,2.159,2.58
- c0.8,0.561,1.66,0.84,2.58,0.84c1.12,0,2.08-0.47,2.88-1.41c0.8-0.939,1.2-2.089,1.2-3.449c0-0.92-0.19-1.771-0.569-2.551
- c-0.381-0.779-0.911-1.59-1.591-2.43l-2.52-3.06c-0.96-1.16-1.701-2.26-2.22-3.301c-0.521-1.039-0.78-2.079-0.78-3.119
- c0-1,0.21-1.98,0.63-2.94s0.979-1.81,1.68-2.55c0.7-0.74,1.51-1.33,2.431-1.77c0.919-0.44,1.899-0.66,2.939-0.66
- c0.76,0,1.51,0.074,2.25,0.222s1.41,0.351,2.01,0.609c0.601,0.259,1.08,0.575,1.44,0.948c0.36,0.374,0.54,0.781,0.54,1.221
- c0,1.92-0.381,2.88-1.14,2.88c-0.321,0-0.681-0.229-1.08-0.69c-0.4-0.459-0.87-0.969-1.41-1.53c-0.54-0.56-1.14-1.07-1.8-1.53
- c-0.66-0.459-1.41-0.69-2.25-0.69c-0.921,0-1.73,0.372-2.431,1.116c-0.7,0.743-1.05,1.677-1.05,2.802
- c0,0.724,0.159,1.417,0.48,2.079c0.319,0.663,0.779,1.375,1.38,2.139L451.417,46.901z"/>
-</g>
-<g>
- <path fill="#101111" d="M3.802,51.254V24.525c0-0.928,0.267-1.775,0.8-2.541s1.241-1.311,2.123-1.636l24.502-8.91
- c0.51-0.186,1.021-0.279,1.531-0.279c0.51,0,1.021,0.093,1.531,0.279l24.501,8.91c0.882,0.325,1.589,0.87,2.123,1.636
- s0.801,1.613,0.801,2.541v26.729c0,0.812-0.209,1.566-0.626,2.263c-0.418,0.696-0.987,1.241-1.706,1.636L34.882,68.517
- c-0.65,0.371-1.357,0.558-2.123,0.558s-1.474-0.187-2.123-0.558L6.134,55.152c-0.72-0.395-1.288-0.939-1.706-1.636
- S3.802,52.066,3.802,51.254z M8.466,24.456l24.293,8.84l24.292-8.84l-24.292-8.84L8.466,24.456z M34.986,63.4L57.26,51.254V29.12
- l-22.274,8.109V63.4z"/>
-</g>
-<g>
-</g>
-<g>
-</g>
-<g>
-</g>
-<g>
-</g>
-<g>
-</g>
-<g>
-</g>
-<g>
-</g>
-<g>
-</g>
-<g>
-</g>
-<g>
-</g>
-<g>
-</g>
-<g>
-</g>
-<g>
-</g>
-<g>
-</g>
-<g>
-</g>
-</svg>
diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/index.htm b/priv/static/metrics-graphics-3.0-alpha3/examples/index.htm deleted file mode 100644 index e4c1ed0..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/index.htm +++ /dev/null @@ -1,269 +0,0 @@ -<html lang='en'> -<head> - <meta content='text/html; charset=utf-8' http-equiv='Content-Type'> - - <title>MetricsGraphics.js - a library based on D3.js, optimized for visualizing and laying out time-series data</title> - - <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,700' rel='stylesheet' type='text/css'> - <link href='https://fonts.googleapis.com/css?family=PT+Serif:400,700,400italic' rel='stylesheet' type='text/css'> - <link href='https://netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.css' rel='stylesheet' type='text/css'> - <link href='https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css' rel='stylesheet' type='text/css'> - - <link href='metricsgraphics.css' rel='stylesheet' type='text/css'> - <link href='css/metricsgraphics-demo.css' rel='stylesheet' type='text/css'> - <link href='css/highlightjs-default.css' rel='stylesheet' type='text/css'> - - <script src='js/lib/highlight.pack.js'></script> - <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'></script> - <script src='https://d3js.org/d3.v4.min.js' charset='utf-8'></script> - <script src='metricsgraphics.min.js'></script> - - <script> - (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ - (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), - m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) - })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); - - ga('create', 'UA-51487512-1', 'metricsgraphicsjs.org'); - ga('send', 'pageview'); - </script> -</head> - -<body> - <a href="https://github.com/metrics-graphics/metrics-graphics"><img style="z-index: 2; position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a> - - <div class='container'> - <div id='content-body'> - <img src='images/logo.svg' id='logo' class='svg' /> - <iframe src="https://ghbtns.com/github-btn.html?user=mozilla&repo=metrics-graphics&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20" class='github-stars-top'></iframe> - - <div id='description'> - <p><i>MetricsGraphics.js</i> is a library built on top of - <a href='http://d3js.org/'>D3</a> that is optimized for visualizing and - laying out time-series data. It provides a simple way to produce common types of - graphics in a principled, consistent and responsive way. The library - currently supports line charts, scatterplots, histograms, bar charts and data - tables as well as features like rug plots and basic linear regression.</p> - </div> - - <div id='torso'> - <div class='thumb'><a href='https://github.com/metricsgraphics/metrics-graphics/releases'><i class="fa fa-download fa-4x"></i><br /><span class='text'>Download</span></a></div> - <div class='thumb'><a href='examples.htm'><i class="fa fa-area-chart fa-4x"></i><br /><span class='text'>Examples</span></a></div> - <div class='thumb'><a href='https://github.com/metricsgraphics/metrics-graphics'><i class="fa fa-github fa-4x"></i><br /><span class='text'>Github</span></a></div> - </div> - </div> - </div> - - <div class='api-example'> - <div class='container'> - -<pre><code class='javascript'>MG.data_graphic({ - title: "Downloads", - description: "This graphic shows a time-series of downloads.", - data: [{'date':new Date('2014-11-01'),'value':12}, - {'date':new Date('2014-11-02'),'value':18}], - width: 600, - height: 250, - target: '#downloads', - x_accessor: 'date', - y_accessor: 'value', -})</code></pre> - - </div> - </div> - - <div class='container'> - <p>The API is simple. All that's needed to create a graphic is to specify a few default parameters and then, if desired, override one or more of the <a href='https://github.com/metricsgraphics/metrics-graphics/wiki/List-of-Options'>optional parameters on offer</a>. We don't maintain state. To update a graphic, one would call <i>MG.data_graphic</i> on the same target element.</p> - <p>The library is data-source agnostic. While it provides a number of convenience functions and options that allow for graphics to better handle things like missing observations, it doesn't care where the data comes from.</p> - <p>The library makes it easy to construct narratives by providing a layout template based on Bootstrap. Take a look at <a href='examples.htm'>the examples</a> to see that in action.</p> - <p>MetricsGraphics.js <a href='https://www.youtube.com/watch?v=ZmkeAlut7KI#t=399'>takes the misery out of</a> creating beautiful interactive graphics. <a href='http://blog.mozilla.org/metrics/2014/11/10/introducing-metricsgraphics-js/'>Read our blog post for more details</a>.</p> - - <h1>A bit about the library's design philosophy</h1> - <p>MetricsGraphics.js is an opinionated library that aims to take the mystery and complication out of presenting simple data. It offers only line charts, scatterplots, bar charts, histograms and data tables, while maintaining a wide variety of options for each, and elevates the layout and explanation of these graphics to the same level of priority as the graphics themselves. The emergent philosophy is one of efficiency and practicality - by following the standards embodied by the library, you will make beautiful, concise and impactful presentations and dashboards.</p> - - <h1>Creating your first graphic</h1> - <p>Here's a quick tutorial to get you started. Say that we have some data on a scholarly topic like <a href='http://geocommons.com/overlays/134594'>UFO sightings</a>. We decide that we're interested in creating a line chart of yearly sightings.</p> - <p>We create a JSON file called <a href='data/ufo-sightings.json'>data/ufo-sightings.json</a> based on the original dataset, where we aggregate yearly sightings. The data doesn't have to be JSON of course, but that will mean less work later on.</p> - <p>The next thing we do is load the data:</p> - -<pre class='highbottom'><code class='javascript'>d3.json('data/ufo-sightings.json', function(data) { -})</code></pre> - - <p><i>MG.data_graphic</i> expects the data object to be an array of objects, which is already the case for us. That's good. It also needs dates to be timestamps if they're in a format like <i>yyyy-mm-dd</i>. We've got aggregated yearly data, so we don't need to worry about that. Otherwise, we'd add a line like this one.</p> - -<pre class='highbottom'><code class='javascript'>d3.json('data/ufo-sightings.json', function(data) { - data = MG.convert.date(data, 'year'); -})</code></pre> - - <p>Finally, we create the graphic and place it in the element specified in <i>target</i>.</p> - -<pre class='highbottom'><code class='javascript'>d3.json('data/ufo-sightings.json', function(data) { - MG.data_graphic({ - title: "UFO Sightings", - description: "Yearly UFO sightings from the year 1945 to 2010.", - data: data, - width: 650, - height: 150, - target: '#ufo-sightings', - x_accessor: 'year', - y_accessor: 'sightings', - markers: [{'year': 1964, 'label': '"The Creeping Terror" released'}] - }) -})</code></pre> - - <p class='highbottom'>And this is what we end up with. In this example, we're adding a marker to draw attention to a particular data point. This is optional of course.</p> - <div id='ufo-sightings'></div> - <p class='hightop'>It's as easy as that. If for whatever reason we decide to update the data in the graphic, we call <i>MG.data_graphic</i> with the updated data object on the same target element. The library will gracefully transition the existing plot to the new one. It's ridiculously easy to modify every aspect of the graphic by setting one or more of the <a href='https://github.com/metricsgraphics/metrics-graphics/wiki/List-of-Options'>available options</a>.</p> - - <h1>Still not convinced?</h1> - <p>We've set up an interactive version of this example that you can play around with. You don't need to download anything. <a href='interactive-demo.htm'>Check it out</a>.</p> - <p>Take the library out for a spin, file bugs and don't forget to star the project on Github!</p> - </div> - - <div class='container footer'> - Created by <a href='https://twitter.com/alialmossawi'>Ali Almossawi</a>, - <a href='https://github.com/hamilton'>Hamilton Ulmer</a> — Metrics at - <a href='https://www.mozilla.org/en-US/'>Mozilla</a> - <br />Shared under the <a href='http://www.mozilla.org/MPL/2.0/'> - Mozilla Public License</a>. - </div> - - <style> - body { - background-color: #fcfcfc; - } - - .api-example { - margin: 80px 0 40px 0; - width: 100%; - background-color: #f1f1f1; - border-top: 1px solid #ccc; - border-bottom: 1px solid #ccc; - } - - .container { - width: 680px; - } - - #fb-block { - display: inline; - padding: 0 0 0 6px; - position: relative; - top: 0; - width: 60px; - } - - @media only screen - and (min-device-width : 320px) - and (max-device-width : 480px) { - #fb-block { - top: -5px; - } - } - - .github-stars-top { - margin: 95px 0 0 160px; - position: absolute; - } - - h1 { - font-size: 24px; - padding-top: 40px; - } - - .highbottom { - margin-bottom: 40px; - } - - .hightop { - margin-top: 40px; - } - - p { - padding-top: 6px; - } - - pre { - background-color: #f1f1f1; - border: none; - margin: 0 0 0 0 ; - } - - .social-buttons { - background-image: url(images/divider.png); - background-repeat: no-repeat; - background-position: center 35px; - padding-top: 80px; - } - - .thumb { - padding: 0 35px 0 35px; - } - - .thumb a { - color: #227dc4; - } - - .thumb a i.fa { - background-color: #036bbc; - color: transparent; - text-shadow: 0px 1px 1px rgba(255,255,255,0.5); - -webkit-background-clip: text; - -moz-background-clip: text; - background-clip: text; - padding: 10px; - } - - @-moz-document url-prefix() { - .thumb a i.fa { - background-color: transparent; - color: #60a2d5; - } - } - - .thumb a span.text { - color: white; - font-size: 12px; - letter-spacing: 1; - text-transform: uppercase; - background: #60a2d5; - border-radius: 6px; - padding: 1px 5px 1px 5px; - } - - /*.thumb a:hover span.text { - border-bottom: 1px solid #227dc4; - }*/ - - .thumb a:hover { - text-decoration: none; - } - - #twitter-block { - display: inline; - overflow: hidden; - padding-top: 2px; - position: relative; - top: 0; - } - </style> - - <script> - hljs.initHighlightingOnLoad(); - - d3.json('data/ufo-sightings.json', function(data) { - MG.data_graphic({ - title: "UFO Sightings", - description: "Yearly UFO sightings from the year 1945 to 2010.", - data: data, - markers: [{'year': 1964, 'label': '"The Creeping Terror" released'}], - width: 650, - height: 180, - target: '#ufo-sightings', - x_accessor: 'year', - y_accessor: 'sightings' - }) - }) - </script> -</body> -</html> diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/interactive-demo.htm b/priv/static/metrics-graphics-3.0-alpha3/examples/interactive-demo.htm deleted file mode 100644 index f87f060..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/interactive-demo.htm +++ /dev/null @@ -1,236 +0,0 @@ -<html lang='en'> -<head> - <meta content='text/html; charset=utf-8' http-equiv='Content-Type'> - - <title>MetricsGraphics.js - a library based on D3.js, optimized for visualizing and laying out time-series data</title> - - <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,700' rel='stylesheet' type='text/css'> - <link href='https://fonts.googleapis.com/css?family=PT+Serif:400,700,400italic' rel='stylesheet' type='text/css'> - <link href='https://netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.css' rel='stylesheet' type='text/css'> - <link href='https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css' rel='stylesheet' type='text/css'> - - <link href='metricsgraphics.css' rel='stylesheet' type='text/css'> - <link href='css/metricsgraphics-demo.css' rel='stylesheet' type='text/css'> - - <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script> - <script src="https://d3js.org/d3.v4.min.js"></script> - <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js" charset="utf-8"></script> - - <!-- dev start --> - <script src='js/MG.js'></script> - <script src='js/misc/utility.js'></script> - <script src='js/common/data_graphic.js'></script> - <script src='js/common/hooks.js'></script> - <script src='js/common/register.js'></script> - <script src='js/common/bootstrap_tooltip_popover.js'></script> - <script src='js/common/chart_title.js'></script> - <script src='js/common/scales.js'></script> - <script src='js/common/y_axis.js'></script> - <script src='js/common/x_axis.js'></script> - <script src='js/common/init.js'></script> - <script src='js/common/markers.js'></script> - <script src='js/common/rollover.js'></script> - <script src='js/common/zoom.js'></script> - <script src='js/common/brush.js'></script> - <script src='js/common/window_listeners.js'></script> - <script src='js/layout/bootstrap_dropdown.js'></script> - <script src='js/layout/button.js'></script> - <script src='js/charts/line.js'></script> - <script src='js/charts/histogram.js'></script> - <script src='js/charts/point.js'></script> - <script src='js/charts/bar.js'></script> - <script src='js/charts/table.js'></script> - <script src='js/charts/missing.js'></script> - <script src='js/misc/process.js'></script> - <script src='js/misc/smoothers.js'></script> - <script src='js/misc/formatters.js'></script> - <script src='js/misc/transitions.js'></script> - <script src='js/misc/error.js'></script> - <!-- dev end --> - - <script> - (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ - (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), - m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) - })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); - - ga('create', 'UA-51487512-1', 'metricsgraphicsjs.org'); - ga('send', 'pageview'); - </script> -</head> - -<body> - <div class='container'> - <div class='head'> - <ul> - <li><a href='./'>Home</a></li> - <li><a href='https://github.com/metricsgraphics/metrics-graphics/releases'>Download</a></li> - <li><a href='https://github.com/metricsgraphics/metrics-graphics'>Code</a></li> - <li><a href='https://github.com/metricsgraphics/metrics-graphics/issues'>Issues</a></li> - <li><a href='examples.htm'>Examples</a></li> - </ul> - - <img src='images/logo.svg' id='logo' class='svg' /> - </div> - - <div id='description'> - <p><i>MetricsGraphics.js</i> is a library built on top of - <a href='http://d3js.org/'>D3</a> that is optimized for visualizing and - laying out time-series data. It provides a simple way to produce common - types of graphics in a principled, consistent and responsive way. The - library currently supports line charts, scatterplots and histograms as - well as features like rug plots and basic linear regression.</p> - - <p>This demo allows you to play around with the library without having to - download it. Try doubling the number of sightings in, say, 1995 and see - how that affects the graphic. Or how about changing any of the options in - <i>MG.data_graphic</i>? Or perhaps change the chart type to a scatterplot by - setting <code>chart_type:'point'</code>, switching the <i>x</i> and <i>y</i> - accessors and increasing the <i>height</i>? The data object is set to the - contents of the <i>Data</i> text area. Errors are logged to the console.</p> - </div> - </div> - - <div class='container'> - <div class='row main-windows-titles'> - <div class='col-xs-2'>Data</div> - <div class='js-title col-xs-5'> - JavaScript <a href='https://github.com/metricsgraphics/metrics-graphics/wiki/List-of-Options#list-of-options' target='_blank'>See Full List of Options</a> - <button type='button' class='update btn'>Run</button> - </div> - </div> - <div class='row main-windows'> - <div class='data col-xs-2'> - <textarea></textarea> - </div> - <div class='js col-xs-5' id='editor'></div> - <div class='result text-center col-xs-5'></div> - </div> - </div> - - <div class='container footer'> - Created by <a href='https://twitter.com/alialmossawi'>Ali Almossawi</a>, - <a href='https://github.com/hamilton'>Hamilton Ulmer</a> — Metrics at - <a href='https://www.mozilla.org/en-US/'>Mozilla</a> - <br />Shared under the <a href='http://www.mozilla.org/MPL/2.0/'> - Mozilla Public License</a>. - </div> - - <style> - body { - background-color: #fcfcfc; - } - - .container { - width: 90%; - min-width: 960px; - } - - .data textarea { - font-family: Menlo,Monaco,Consolas,"Courier New",monospace; - font-size: 11px; - height: 100%; - width: 100%; - } - - .footer { - background-image: url(images/divider.png); - background-repeat: no-repeat; - background-position: center 115px; - padding-top: 70px; - margin-bottom: 20px; - } - - .hightop { - margin-top: 40px; - } - - #logo { - margin: 15px 0 10px 0; - } - - .main-windows-titles { - color: #3b3b3b; - font-size: 16px; - padding-bottom: 5px; - text-align: center; - } - - .main-windows-titles .js-title a { - position: absolute; - right: 0; - font-size: 70%; - margin: 7px 1px 0 0; - } - - .main-windows .data, - .main-windows .js, - .main-windows .result { - height: 400px; - } - - p { - padding-top: 6px; - } - - textarea, - #editor { - border-radius: 3px; - border: none; - overflow: auto; - outline: none; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; - padding: 10px; - border: 1px solid #ccc; - } - - .btn.update { - background-color: steelblue; - color: white; - margin-top: 34px; - outline: none; - position: absolute; - right: 7px; - z-index: 99; - } - - .btn.update:hover, - .btn.update:active, - .btn.update:visited { - color: #efefef; - outline: none; - } - </style> - <script> - var default_call = '//modify away!\n' - + 'MG.data_graphic({\n' - + ' title: "UFO Sightings",\n' - + ' description: "Yearly UFO sightings from 1945 to 2010.",\n' - + ' data: JSON.parse(document.querySelector(\'.data textarea\').value),\n' - + ' markers: [{\'year\': 1964, \'label\': \'"The Creeping Terror" released\'}],\n' - + ' width: 400,\n' - + ' height: 250,\n' - + ' target: ".result",\n' - + ' x_accessor: "year",\n' - + ' y_accessor: "sightings",\n' - + '});'; - - var editor = ace.edit("editor"); - editor.getSession().setMode("ace/mode/javascript"); - editor.setValue(default_call); - editor.gotoLine(1); - editor.setHighlightActiveLine(false); - - d3.json('data/ufo-sightings.json', function(data) { - document.querySelector('.data textarea').value = JSON.stringify(data, null, 2); - eval(editor.getValue()); - }) - - d3.select('.update').on('click', function() { - eval(editor.getValue()); - }) - </script> -</body> -</html> diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/js/lib/highlight.pack.js b/priv/static/metrics-graphics-3.0-alpha3/examples/js/lib/highlight.pack.js deleted file mode 100644 index 470e125..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/js/lib/highlight.pack.js +++ /dev/null @@ -1 +0,0 @@ -var hljs=new function(){function e(e){return e.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">")}function t(e){return e.nodeName.toLowerCase()}function n(e,t){var n=e&&e.exec(t);return n&&0==n.index}function r(e){var t=(e.className+" "+(e.parentNode?e.parentNode.className:"")).split(/\s+/);return t=t.map(function(e){return e.replace(/^lang(uage)?-/,"")}),t.filter(function(e){return m(e)||/no(-?)highlight/.test(e)})[0]}function i(e,t){var n={};for(var r in e)n[r]=e[r];if(t)for(var r in t)n[r]=t[r];return n}function a(e){var n=[];return function r(e,i){for(var a=e.firstChild;a;a=a.nextSibling)3==a.nodeType?i+=a.nodeValue.length:1==a.nodeType&&(n.push({event:"start",offset:i,node:a}),i=r(a,i),t(a).match(/br|hr|img|input/)||n.push({event:"stop",offset:i,node:a}));return i}(e,0),n}function s(n,r,i){function a(){return n.length&&r.length?n[0].offset!=r[0].offset?n[0].offset<r[0].offset?n:r:"start"==r[0].event?n:r:n.length?n:r}function s(n){function r(t){return" "+t.nodeName+'="'+e(t.value)+'"'}l+="<"+t(n)+Array.prototype.map.call(n.attributes,r).join("")+">"}function o(e){l+="</"+t(e)+">"}function c(e){("start"==e.event?s:o)(e.node)}for(var u=0,l="",f=[];n.length||r.length;){var h=a();if(l+=e(i.substr(u,h[0].offset-u)),u=h[0].offset,h==n){f.reverse().forEach(o);do c(h.splice(0,1)[0]),h=a();while(h==n&&h.length&&h[0].offset==u);f.reverse().forEach(s)}else"start"==h[0].event?f.push(h[0].node):f.pop(),c(h.splice(0,1)[0])}return l+e(i.substr(u))}function o(e){function t(e){return e&&e.source||e}function n(n,r){return RegExp(t(n),"m"+(e.cI?"i":"")+(r?"g":""))}function r(a,s){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var o={},c=function(t,n){e.cI&&(n=n.toLowerCase()),n.split(" ").forEach(function(e){var n=e.split("|");o[n[0]]=[t,n[1]?Number(n[1]):1]})};"string"==typeof a.k?c("keyword",a.k):Object.keys(a.k).forEach(function(e){c(e,a.k[e])}),a.k=o}a.lR=n(a.l||/\b[A-Za-z0-9_]+\b/,!0),s&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),a.b||(a.b=/\B|\b/),a.bR=n(a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=n(a.e)),a.tE=t(a.e)||"",a.eW&&s.tE&&(a.tE+=(a.e?"|":"")+s.tE)),a.i&&(a.iR=n(a.i)),void 0===a.r&&(a.r=1),a.c||(a.c=[]);var u=[];a.c.forEach(function(e){e.v?e.v.forEach(function(t){u.push(i(e,t))}):u.push("self"==e?a:e)}),a.c=u,a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,s);var l=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(t).filter(Boolean);a.t=l.length?n(l.join("|"),!0):{exec:function(){return null}}}}r(e)}function c(t,r,i,a){function s(e,t){for(var r=0;r<t.c.length;r++)if(n(t.c[r].bR,e))return t.c[r]}function l(e,t){return n(e.eR,t)?e:e.eW?l(e.parent,t):void 0}function f(e,t){return!i&&n(t.iR,e)}function h(e,t){var n=x.cI?t[0].toLowerCase():t[0];return e.k.hasOwnProperty(n)&&e.k[n]}function g(e,t,n,r){var i=r?"":N.classPrefix,a='<span class="'+i,s=n?"":"</span>";return a+=e+'">',a+t+s}function p(){if(!w.k)return e(B);var t="",n=0;w.lR.lastIndex=0;for(var r=w.lR.exec(B);r;){t+=e(B.substr(n,r.index-n));var i=h(w,r);i?(y+=i[1],t+=g(i[0],e(r[0]))):t+=e(r[0]),n=w.lR.lastIndex,r=w.lR.exec(B)}return t+e(B.substr(n))}function v(){if(w.sL&&!E[w.sL])return e(B);var t=w.sL?c(w.sL,B,!0,L[w.sL]):u(B);return w.r>0&&(y+=t.r),"continuous"==w.subLanguageMode&&(L[w.sL]=t.top),g(t.language,t.value,!1,!0)}function b(){return void 0!==w.sL?v():p()}function d(t,n){var r=t.cN?g(t.cN,"",!0):"";t.rB?(M+=r,B=""):t.eB?(M+=e(n)+r,B=""):(M+=r,B=n),w=Object.create(t,{parent:{value:w}})}function R(t,n){if(B+=t,void 0===n)return M+=b(),0;var r=s(n,w);if(r)return M+=b(),d(r,n),r.rB?0:n.length;var i=l(w,n);if(i){var a=w;a.rE||a.eE||(B+=n),M+=b();do w.cN&&(M+="</span>"),y+=w.r,w=w.parent;while(w!=i.parent);return a.eE&&(M+=e(n)),B="",i.starts&&d(i.starts,""),a.rE?0:n.length}if(f(n,w))throw new Error('Illegal lexeme "'+n+'" for mode "'+(w.cN||"<unnamed>")+'"');return B+=n,n.length||1}var x=m(t);if(!x)throw new Error('Unknown language: "'+t+'"');o(x);for(var w=a||x,L={},M="",k=w;k!=x;k=k.parent)k.cN&&(M=g(k.cN,"",!0)+M);var B="",y=0;try{for(var C,I,j=0;;){if(w.t.lastIndex=j,C=w.t.exec(r),!C)break;I=R(r.substr(j,C.index-j),C[0]),j=C.index+I}R(r.substr(j));for(var k=w;k.parent;k=k.parent)k.cN&&(M+="</span>");return{r:y,value:M,language:t,top:w}}catch(A){if(-1!=A.message.indexOf("Illegal"))return{r:0,value:e(r)};throw A}}function u(t,n){n=n||N.languages||Object.keys(E);var r={r:0,value:e(t)},i=r;return n.forEach(function(e){if(m(e)){var n=c(e,t,!1);n.language=e,n.r>i.r&&(i=n),n.r>r.r&&(i=r,r=n)}}),i.language&&(r.second_best=i),r}function l(e){return N.tabReplace&&(e=e.replace(/^((<[^>]+>|\t)+)/gm,function(e,t){return t.replace(/\t/g,N.tabReplace)})),N.useBR&&(e=e.replace(/\n/g,"<br>")),e}function f(e,t,n){var r=t?R[t]:n,i=[e.trim()];return e.match(/(\s|^)hljs(\s|$)/)||i.push("hljs"),r&&i.push(r),i.join(" ").trim()}function h(e){var t=r(e);if(!/no(-?)highlight/.test(t)){var n;N.useBR?(n=document.createElementNS("http://www.w3.org/1999/xhtml","div"),n.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ \/]*>/g,"\n")):n=e;var i=n.textContent,o=t?c(t,i,!0):u(i),h=a(n);if(h.length){var g=document.createElementNS("http://www.w3.org/1999/xhtml","div");g.innerHTML=o.value,o.value=s(h,a(g),i)}o.value=l(o.value),e.innerHTML=o.value,e.className=f(e.className,t,o.language),e.result={language:o.language,re:o.r},o.second_best&&(e.second_best={language:o.second_best.language,re:o.second_best.r})}}function g(e){N=i(N,e)}function p(){if(!p.called){p.called=!0;var e=document.querySelectorAll("pre code");Array.prototype.forEach.call(e,h)}}function v(){addEventListener("DOMContentLoaded",p,!1),addEventListener("load",p,!1)}function b(e,t){var n=E[e]=t(this);n.aliases&&n.aliases.forEach(function(t){R[t]=e})}function d(){return Object.keys(E)}function m(e){return E[e]||E[R[e]]}var N={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0},E={},R={};this.highlight=c,this.highlightAuto=u,this.fixMarkup=l,this.highlightBlock=h,this.configure=g,this.initHighlighting=p,this.initHighlightingOnLoad=v,this.registerLanguage=b,this.listLanguages=d,this.getLanguage=m,this.inherit=i,this.IR="[a-zA-Z][a-zA-Z0-9_]*",this.UIR="[a-zA-Z_][a-zA-Z0-9_]*",this.NR="\\b\\d+(\\.\\d+)?",this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",this.BNR="\\b(0b[01]+)",this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",this.BE={b:"\\\\[\\s\\S]",r:0},this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE]},this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE]},this.PWM={b:/\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such)\b/},this.CLCM={cN:"comment",b:"//",e:"$",c:[this.PWM]},this.CBCM={cN:"comment",b:"/\\*",e:"\\*/",c:[this.PWM]},this.HCM={cN:"comment",b:"#",e:"$",c:[this.PWM]},this.NM={cN:"number",b:this.NR,r:0},this.CNM={cN:"number",b:this.CNR,r:0},this.BNM={cN:"number",b:this.BNR,r:0},this.CSSNM={cN:"number",b:this.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},this.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[this.BE,{b:/\[/,e:/\]/,r:0,c:[this.BE]}]},this.TM={cN:"title",b:this.IR,r:0},this.UTM={cN:"title",b:this.UIR,r:0}};hljs.registerLanguage("javascript",function(r){return{aliases:["js"],k:{keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const class",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document"},c:[{cN:"pi",b:/^\s*('|")use strict('|")/,r:10},r.ASM,r.QSM,r.CLCM,r.CBCM,r.CNM,{b:"("+r.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[r.CLCM,r.CBCM,r.RM,{b:/</,e:/>;/,r:0,sL:"xml"}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[r.inherit(r.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,c:[r.CLCM,r.CBCM],i:/["'\(]/}],i:/\[|%/},{b:/\$[(.]/},{b:"\\."+r.IR,r:0}]}});hljs.registerLanguage("http",function(){return{i:"\\S",c:[{cN:"status",b:"^HTTP/[0-9\\.]+",e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{cN:"request",b:"^[A-Z]+ (.*?) HTTP/[0-9\\.]+$",rB:!0,e:"$",c:[{cN:"string",b:" ",e:" ",eB:!0,eE:!0}]},{cN:"attribute",b:"^\\w",e:": ",eE:!0,i:"\\n|\\s|=",starts:{cN:"string",e:"$"}},{b:"\\n\\n",starts:{sL:"",eW:!0}}]}});hljs.registerLanguage("json",function(e){var t={literal:"true false null"},i=[e.QSM,e.CNM],l={cN:"value",e:",",eW:!0,eE:!0,c:i,k:t},c={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:!0,eE:!0,c:[e.BE],i:"\\n",starts:l}],i:"\\S"},n={b:"\\[",e:"\\]",c:[e.inherit(l,{cN:null})],i:"\\S"};return i.splice(i.length,0,c,n),{c:i,k:t,i:"\\S"}});hljs.registerLanguage("xml",function(){var t="[A-Za-z0-9\\._:-]+",e={b:/<\?(php)?(?!\w)/,e:/\?>/,sL:"php",subLanguageMode:"continuous"},c={eW:!0,i:/</,r:0,c:[e,{cN:"attribute",b:t,r:0},{b:"=",r:0,c:[{cN:"value",c:[e],v:[{b:/"/,e:/"/},{b:/'/,e:/'/},{b:/[^\s\/>]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xsl","plist"],cI:!0,c:[{cN:"doctype",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"<!--",e:"-->",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"<style(?=\\s|>|$)",e:">",k:{title:"style"},c:[c],starts:{e:"</style>",rE:!0,sL:"css"}},{cN:"tag",b:"<script(?=\\s|>|$)",e:">",k:{title:"script"},c:[c],starts:{e:"</script>",rE:!0,sL:"javascript"}},e,{cN:"pi",b:/<\?\w+/,e:/\?>/,r:10},{cN:"tag",b:"</?",e:"/?>",c:[{cN:"title",b:/[^ \/><\n\t]+/,r:0},c]}]}});hljs.registerLanguage("css",function(e){var c="[a-zA-Z-][a-zA-Z0-9_-]*",a={cN:"function",b:c+"\\(",rB:!0,eE:!0,e:"\\("};return{cI:!0,i:"[=/|']",c:[e.CBCM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{cN:"at_rule",b:"@",e:"[{;]",c:[{cN:"keyword",b:/\S+/},{b:/\s/,eW:!0,eE:!0,r:0,c:[a,e.ASM,e.QSM,e.CSSNM]}]},{cN:"tag",b:c,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[e.CBCM,{cN:"rule",b:"[^\\s]",rB:!0,e:";",eW:!0,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:!0,i:"[^\\s]",starts:{cN:"value",eW:!0,eE:!0,c:[a,e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"hexcolor",b:"#[0-9A-Fa-f]+"},{cN:"important",b:"!important"}]}}]}]}]}});
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/js/lib/mode-javascript.js b/priv/static/metrics-graphics-3.0-alpha3/examples/js/lib/mode-javascript.js deleted file mode 100755 index a80f564..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/js/lib/mode-javascript.js +++ /dev/null @@ -1 +0,0 @@ -define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc.tag",regex:"\\bTODO\\b"},{defaultToken:"comment.doc"}]}};r.inherits(s,i),s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=function(e){var t=this.createKeywordMapper({"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",keyword:"const|yield|import|get|set|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier"),n="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",r="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b",s="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)";this.$rules={no_regex:[{token:"comment",regex:"\\/\\/",next:"line_comment"},i.getStartRule("doc-start"),{token:"comment",regex:/\/\*/,next:"comment"},{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0[xX][0-9a-fA-F]+\b/},{token:"constant.numeric",regex:/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+r+")(\\.)(prototype)(\\.)("+r+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+r+")(\\.)("+r+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+r+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+r+")(\\.)("+r+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+r+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+r+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"(?:"+n+")\\b",next:"start"},{token:["punctuation.operator","support.function"],regex:/(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:["punctuation.operator","support.function.dom"],regex:/(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:["punctuation.operator","support.constant"],regex:/(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:["support.constant"],regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/},{token:t,regex:r},{token:"keyword.operator",regex:/--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],start:[i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment_regex_allowed"},{token:"comment",regex:"\\/\\/",next:"line_comment_regex_allowed"},{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],function_arguments:[{token:"variable.parameter",regex:r},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],comment_regex_allowed:[{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}],comment:[{token:"comment",regex:"\\*\\/",next:"no_regex"},{defaultToken:"comment"}],line_comment_regex_allowed:[{token:"comment",regex:"$|^",next:"start"},{defaultToken:"comment"}],line_comment:[{token:"comment",regex:"$|^",next:"no_regex"},{defaultToken:"comment"}],qqstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]},(!e||!e.noES6)&&this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(e,t,n){this.next=e=="{"?this.nextState:"";if(e=="{"&&n.length)return n.unshift("start",t),"paren";if(e=="}"&&n.length){n.shift(),this.next=n.shift();if(this.next.indexOf("string")!=-1)return"paren.quasi.end"}return e=="{"?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:s},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]}),this.embedRules(i,"doc-",[i.getEndRule("no_regex")]),this.normalizeRules()};r.inherits(o,s),t.JavaScriptHighlightRules=o}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],f,l={},c=function(e){var t=-1;e.multiSelect&&(t=e.selection.id,l.rangeCount!=e.multiSelect.rangeCount&&(l={rangeCount:e.multiSelect.rangeCount}));if(l[t])return f=l[t];f=l[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},h=function(){this.add("braces","insertion",function(e,t,n,r,i){var s=n.getCursorPosition(),u=r.doc.getLine(s.row);if(i=="{"){c(n);var a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(l!==""&&l!=="{"&&n.getWrapBehavioursEnabled())return{text:"{"+l+"}",selection:!1};if(h.isSaneInsertion(n,r))return/[\]\}\)]/.test(u[s.column])||n.inMultiSelectMode?(h.recordAutoInsert(n,r,"}"),{text:"{}",selection:[1,1]}):(h.recordMaybeInsert(n,r,"{"),{text:"{",selection:[1,1]})}else if(i=="}"){c(n);var p=u.substring(s.column,s.column+1);if(p=="}"){var d=r.$findOpeningBracket("}",{column:s.column+1,row:s.row});if(d!==null&&h.isAutoInsertedClosing(s,u,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if(i=="\n"||i=="\r\n"){c(n);var v="";h.isMaybeInsertedClosing(s,u)&&(v=o.stringRepeat("}",f.maybeInsertedBrackets),h.clearMaybeInsertedClosing());var p=u.substring(s.column,s.column+1);if(p==="}"){var m=r.findMatchingBracket({row:s.row,column:s.column+1},"}");if(!m)return null;var g=this.$getIndent(r.getLine(m.row))}else{if(!v){h.clearMaybeInsertedClosing();return}var g=this.$getIndent(u)}var y=g+r.getTabString();return{text:"\n"+y+"\n"+g+v,selection:[1,y.length,1,y.length]}}h.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;f.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"("+o+")",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"["+o+"]",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){c(n);var s=i,o=n.getSelectionRange(),u=r.doc.getTextRange(o);if(u!==""&&u!=="'"&&u!='"'&&n.getWrapBehavioursEnabled())return{text:s+u+s,selection:!1};var a=n.getCursorPosition(),f=r.doc.getLine(a.row),l=f.substring(a.column-1,a.column);if(l=="\\")return null;var p=r.getTokens(o.start.row),d=0,v,m=-1;for(var g=0;g<p.length;g++){v=p[g],v.type=="string"?m=-1:m<0&&(m=v.value.indexOf(s));if(v.value.length+d>o.start.column)break;d+=p[g].value.length}if(!v||m<0&&v.type!=="comment"&&(v.type!=="string"||o.start.column!==v.value.length+d-1&&v.value.lastIndexOf(s)===v.value.length-1)){if(!h.isSaneInsertion(n,r))return;return{text:s+s,selection:[1,1]}}if(v&&v.type==="string"){var y=f.substring(a.column,a.column+1);if(y==s)return{text:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}})};h.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},h.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},h.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},h.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},h.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},h.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},h.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},h.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(h,i),t.CstyleBehaviour=h}),define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n),s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++t<a){n=e.getLine(t);var f=n.search(/\S/);if(f===-1)continue;if(r>f)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)}}.call(o.prototype)}),define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript_highlight_rules").JavaScriptHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("../range").Range,a=e("../worker/worker_client").WorkerClient,f=e("./behaviour/cstyle").CstyleBehaviour,l=e("./folding/cstyle").FoldMode,c=function(){this.HighlightRules=s,this.$outdent=new o,this.$behaviour=new f,this.foldingRules=new l};r.inherits(c,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"||e=="no_regex"){var u=t.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);u&&(r+=n)}else if(e=="doc-start"){if(o=="start"||o=="no_regex")return"";var u=t.match(/^\s*(\/?)\*/);u&&(u[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new a(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("jslint",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/javascript"}.call(c.prototype),t.Mode=c})
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/js/lib/worker-javascript.js b/priv/static/metrics-graphics-3.0-alpha3/examples/js/lib/worker-javascript.js deleted file mode 100755 index f4935e8..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/js/lib/worker-javascript.js +++ /dev/null @@ -1 +0,0 @@ -"no use strict";(function(e){if(typeof e.window!="undefined"&&e.document)return;e.console=function(){var e=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:e})},e.console.error=e.console.warn=e.console.log=e.console.trace=e.console,e.window=e,e.ace=e,e.onerror=function(e,t,n,r,i){postMessage({type:"error",data:{message:e,file:t,line:n,col:r,stack:i.stack}})},e.normalizeModule=function(t,n){if(n.indexOf("!")!==-1){var r=n.split("!");return e.normalizeModule(t,r[0])+"!"+e.normalizeModule(t,r[1])}if(n.charAt(0)=="."){var i=t.split("/").slice(0,-1).join("/");n=(i?i+"/":"")+n;while(n.indexOf(".")!==-1&&s!=n){var s=n;n=n.replace(/^\.\//,"").replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return n},e.require=function(t,n){n||(n=t,t=null);if(!n.charAt)throw new Error("worker.js require() accepts only (parentId, id) as arguments");n=e.normalizeModule(t,n);var r=e.require.modules[n];if(r)return r.initialized||(r.initialized=!0,r.exports=r.factory().exports),r.exports;var i=n.split("/");if(!e.require.tlns)return console.log("unable to load "+n);i[0]=e.require.tlns[i[0]]||i[0];var s=i.join("/")+".js";return e.require.id=n,importScripts(s),e.require(t,n)},e.require.modules={},e.require.tlns={},e.define=function(t,n,r){arguments.length==2?(r=n,typeof t!="string"&&(n=t,t=e.require.id)):arguments.length==1&&(r=t,n=[],t=e.require.id);if(typeof r!="function"){e.require.modules[t]={exports:r,initialized:!0};return}n.length||(n=["require","exports","module"]);var i=function(n){return e.require(t,n)};e.require.modules[t]={exports:{},factory:function(){var e=this,t=r.apply(this,n.map(function(t){switch(t){case"require":return i;case"exports":return e.exports;case"module":return e;default:return i(t)}}));return t&&(e.exports=t),e}}},e.define.amd={},e.initBaseUrls=function(t){require.tlns=t},e.initSender=function(){var n=e.require("ace/lib/event_emitter").EventEmitter,r=e.require("ace/lib/oop"),i=function(){};return function(){r.implement(this,n),this.callback=function(e,t){postMessage({type:"call",id:t,data:e})},this.emit=function(e,t){postMessage({type:"event",name:e,data:t})}}.call(i.prototype),new i};var t=e.main=null,n=e.sender=null;e.onmessage=function(r){var i=r.data;if(i.command){if(!t[i.command])throw new Error("Unknown command:"+i.command);t[i.command].apply(t,i.args)}else if(i.init){initBaseUrls(i.tlns),require("ace/lib/es5-shim"),n=e.sender=initSender();var s=require(i.module)[i.classname];t=e.main=new s(n)}else i.event&&n&&n._signal(i.event,i.data)}})(this),define("ace/lib/oop",["require","exports","module"],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),define("ace/lib/event_emitter",["require","exports","module"],function(e,t,n){"use strict";var r={},i=function(){this.propagationStopped=!0},s=function(){this.defaultPrevented=!0};r._emit=r._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var n=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(!n.length&&!r)return;if(typeof t!="object"||!t)t={};t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=i),t.preventDefault||(t.preventDefault=s),n=n.slice();for(var o=0;o<n.length;o++){n[o](t,this);if(t.propagationStopped)break}if(r&&!t.defaultPrevented)return r(t,this)},r._signal=function(e,t){var n=(this._eventRegistry||{})[e];if(!n)return;n=n.slice();for(var r=0;r<n.length;r++)n[r](t,this)},r.once=function(e,t){var n=this;t&&this.addEventListener(e,function r(){n.removeEventListener(e,r),t.apply(null,arguments)})},r.setDefaultHandler=function(e,t){var n=this._defaultHandlers;n||(n=this._defaultHandlers={_disabled_:{}});if(n[e]){var r=n[e],i=n._disabled_[e];i||(n._disabled_[e]=i=[]),i.push(r);var s=i.indexOf(t);s!=-1&&i.splice(s,1)}n[e]=t},r.removeDefaultHandler=function(e,t){var n=this._defaultHandlers;if(!n)return;var r=n._disabled_[e];if(n[e]==t){var i=n[e];r&&this.setDefaultHandler(e,r.pop())}else if(r){var s=r.indexOf(t);s!=-1&&r.splice(s,1)}},r.on=r.addEventListener=function(e,t,n){this._eventRegistry=this._eventRegistry||{};var r=this._eventRegistry[e];return r||(r=this._eventRegistry[e]=[]),r.indexOf(t)==-1&&r[n?"unshift":"push"](t),t},r.off=r.removeListener=r.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];if(!n)return;var r=n.indexOf(t);r!==-1&&n.splice(r,1)},r.removeAllListeners=function(e){this._eventRegistry&&(this._eventRegistry[e]=[])},t.EventEmitter=r}),define("ace/range",["require","exports","module"],function(e,t,n){"use strict";var r=function(e,t){return e.row-t.row||e.column-t.column},i=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return this.compare(e,t)==0},this.compareRange=function(e){var t,n=e.end,r=e.start;return t=this.compare(n.row,n.column),t==1?(t=this.compare(r.row,r.column),t==1?2:t==0?1:0):t==-1?-2:(t=this.compare(r.row,r.column),t==-1?-1:t==1?42:0)},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return this.comparePoint(e.start)==0&&this.comparePoint(e.end)==0},this.intersects=function(e){var t=this.compareRange(e);return t==-1||t==0||t==1},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){typeof e=="object"?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){typeof e=="object"?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)||this.isStart(e,t)?!1:!0:!1},this.insideStart=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)?!1:!0:!1},this.insideEnd=function(e,t){return this.compare(e,t)==0?this.isStart(e,t)?!1:!0:!1},this.compare=function(e,t){return!this.isMultiLine()&&e===this.start.row?t<this.start.column?-1:t>this.end.column?1:0:e<this.start.row?-1:e>this.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else if(this.end.row<e)var n={row:e,column:0};if(this.start.row>t)var r={row:t+1,column:0};else if(this.start.row<e)var r={row:e,column:0};return i.fromPoints(r||this.start,n||this.end)},this.extend=function(e,t){var n=this.compare(e,t);if(n==0)return this;if(n==-1)var r={row:e,column:t};else var s={row:e,column:t};return i.fromPoints(r||this.start,s||this.end)},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return i.fromPoints(this.start,this.end)},this.collapseRows=function(){return this.end.column==0?new i(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new i(this.start.row,0,this.end.row,0)},this.toScreenRange=function(e){var t=e.documentToScreenPosition(this.start),n=e.documentToScreenPosition(this.end);return new i(t.row,t.column,n.row,n.column)},this.moveBy=function(e,t){this.start.row+=e,this.start.column+=t,this.end.row+=e,this.end.column+=t}}).call(i.prototype),i.fromPoints=function(e,t){return new i(e.row,e.column,t.row,t.column)},i.comparePoints=r,i.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},t.Range=i}),define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,s=t.Anchor=function(e,t,n){this.$onChange=this.onChange.bind(this),this.attach(e),typeof n=="undefined"?this.setPosition(t.row,t.column):this.setPosition(t,n)};(function(){r.implement(this,i),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.$insertRight=!1,this.onChange=function(e){var t=e.data,n=t.range;if(n.start.row==n.end.row&&n.start.row!=this.row)return;if(n.start.row>this.row)return;if(n.start.row==this.row&&n.start.column>this.column)return;var r=this.row,i=this.column,s=n.start,o=n.end;if(t.action==="insertText")if(s.row===r&&s.column<=i){if(s.column!==i||!this.$insertRight)s.row===o.row?i+=o.column-s.column:(i-=s.column,r+=o.row-s.row)}else s.row!==o.row&&s.row<r&&(r+=o.row-s.row);else t.action==="insertLines"?(s.row!==r||i!==0||!this.$insertRight)&&s.row<=r&&(r+=o.row-s.row):t.action==="removeText"?s.row===r&&s.column<i?o.column>=i?i=s.column:i=Math.max(0,i-(o.column-s.column)):s.row!==o.row&&s.row<r?(o.row===r&&(i=Math.max(0,i-o.column)+s.column),r-=o.row-s.row):o.row===r&&(r-=o.row-s.row,i=Math.max(0,i-o.column)+s.column):t.action=="removeLines"&&s.row<=r&&(o.row<=r?r-=o.row-s.row:(r=s.row,i=0));this.setPosition(r,i,!0)},this.setPosition=function(e,t,n){var r;n?r={row:e,column:t}:r=this.$clipPositionToDocument(e,t);if(this.row==r.row&&this.column==r.column)return;var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),define("ace/document",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,s=e("./range").Range,o=e("./anchor").Anchor,u=function(e){this.$lines=[],e.length===0?this.$lines=[""]:Array.isArray(e)?this._insertLines(0,e):this.insert({row:0,column:0},e)};(function(){r.implement(this,i),this.setValue=function(e){var t=this.getLength();this.remove(new s(0,0,t,this.getLine(t-1).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new o(this,e,t)},"aaa".split(/a/).length===0?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){if(this.$newLineMode===e)return;this.$newLineMode=e,this._signal("changeNewLineMode")},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return e=="\r\n"||e=="\r"||e=="\n"},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){if(e.start.row==e.end.row)return this.getLine(e.start.row).substring(e.start.column,e.end.column);var t=this.getLines(e.start.row,e.end.row);t[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;return e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column)),t.join(this.getNewLineCharacter())},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):e.row<0&&(e.row=0),e},this.insert=function(e,t){if(!t||t.length===0)return e;e=this.$clipPosition(e),this.getLength()<=1&&this.$detectNewLine(t);var n=this.$split(t),r=n.splice(0,1)[0],i=n.length==0?null:n.splice(n.length-1,1)[0];return e=this.insertInLine(e,r),i!==null&&(e=this.insertNewLine(e),e=this._insertLines(e.row,n),e=this.insertInLine(e,i||"")),e},this.insertLines=function(e,t){return e>=this.getLength()?this.insert({row:e,column:0},"\n"+t.join("\n")):this._insertLines(Math.max(e,0),t)},this._insertLines=function(e,t){if(t.length==0)return{row:e,column:0};while(t.length>61440){var n=this._insertLines(e,t.slice(0,61440));t=t.slice(61440),e=n.row}var r=[e,0];r.push.apply(r,t),this.$lines.splice.apply(this.$lines,r);var i=new s(e,0,e+t.length,0),o={action:"insertLines",range:i,lines:t};return this._signal("change",{data:o}),i.end},this.insertNewLine=function(e){e=this.$clipPosition(e);var t=this.$lines[e.row]||"";this.$lines[e.row]=t.substring(0,e.column),this.$lines.splice(e.row+1,0,t.substring(e.column,t.length));var n={row:e.row+1,column:0},r={action:"insertText",range:s.fromPoints(e,n),text:this.getNewLineCharacter()};return this._signal("change",{data:r}),n},this.insertInLine=function(e,t){if(t.length==0)return e;var n=this.$lines[e.row]||"";this.$lines[e.row]=n.substring(0,e.column)+t+n.substring(e.column);var r={row:e.row,column:e.column+t.length},i={action:"insertText",range:s.fromPoints(e,r),text:t};return this._signal("change",{data:i}),r},this.remove=function(e){e instanceof s||(e=s.fromPoints(e.start,e.end)),e.start=this.$clipPosition(e.start),e.end=this.$clipPosition(e.end);if(e.isEmpty())return e.start;var t=e.start.row,n=e.end.row;if(e.isMultiLine()){var r=e.start.column==0?t:t+1,i=n-1;e.end.column>0&&this.removeInLine(n,0,e.end.column),i>=r&&this._removeLines(r,i),r!=t&&(this.removeInLine(t,e.start.column,this.getLine(t).length),this.removeNewLine(e.start.row))}else this.removeInLine(t,e.start.column,e.end.column);return e.start},this.removeInLine=function(e,t,n){if(t==n)return;var r=new s(e,t,e,n),i=this.getLine(e),o=i.substring(t,n),u=i.substring(0,t)+i.substring(n,i.length);this.$lines.splice(e,1,u);var a={action:"removeText",range:r,text:o};return this._signal("change",{data:a}),r.start},this.removeLines=function(e,t){return e<0||t>=this.getLength()?this.remove(new s(e,0,t+1,0)):this._removeLines(e,t)},this._removeLines=function(e,t){var n=new s(e,0,t+1,0),r=this.$lines.splice(e,t-e+1),i={action:"removeLines",range:n,nl:this.getNewLineCharacter(),lines:r};return this._signal("change",{data:i}),r},this.removeNewLine=function(e){var t=this.getLine(e),n=this.getLine(e+1),r=new s(e,t.length,e+1,0),i=t+n;this.$lines.splice(e,2,i);var o={action:"removeText",range:r,text:this.getNewLineCharacter()};this._signal("change",{data:o})},this.replace=function(e,t){e instanceof s||(e=s.fromPoints(e.start,e.end));if(t.length==0&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);if(t)var n=this.insert(e.start,t);else n=e.start;return n},this.applyDeltas=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=s.fromPoints(n.range.start,n.range.end);n.action=="insertLines"?this.insertLines(r.start.row,n.lines):n.action=="insertText"?this.insert(r.start,n.text):n.action=="removeLines"?this._removeLines(r.start.row,r.end.row-1):n.action=="removeText"&&this.remove(r)}},this.revertDeltas=function(e){for(var t=e.length-1;t>=0;t--){var n=e[t],r=s.fromPoints(n.range.start,n.range.end);n.action=="insertLines"?this._removeLines(r.start.row,r.end.row-1):n.action=="insertText"?this.remove(r):n.action=="removeLines"?this._insertLines(r.start.row,n.lines):n.action=="removeText"&&this.insert(r.start,n.text)}},this.indexToPosition=function(e,t){var n=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length;for(var i=t||0,s=n.length;i<s;i++){e-=n[i].length+r;if(e<0)return{row:i,column:e+n[i].length+r}}return{row:s-1,column:n[s-1].length}},this.positionToIndex=function(e,t){var n=this.$lines||this.getAllLines(),r=this.getNewLineCharacter().length,i=0,s=Math.min(e.row,n.length);for(var o=t||0;o<s;++o)i+=n[o].length+r;return i+e.column}}).call(u.prototype),t.Document=u}),define("ace/lib/lang",["require","exports","module"],function(e,t,n){"use strict";t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){var n="";while(t>0){t&1&&(n+=e);if(t>>=1)e+=e}return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){var t=[];for(var n=0,r=e.length;n<r;n++)e[n]&&typeof e[n]=="object"?t[n]=this.copyObject(e[n]):t[n]=e[n];return t},t.deepCopy=function(e){if(typeof e!="object"||!e)return e;var n=e.constructor;if(n===RegExp)return e;var r=n();for(var i in e)typeof e[i]=="object"?r[i]=t.deepCopy(e[i]):r[i]=e[i];return r},t.arrayToMap=function(e){var t={};for(var n=0;n<e.length;n++)t[e[n]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var n in e)t[n]=e[n];return t},t.arrayRemove=function(e,t){for(var n=0;n<=e.length;n++)t===e[n]&&e.splice(n,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<")},t.getMatchOffsets=function(e,t){var n=[];return e.replace(t,function(e){n.push({offset:arguments[arguments.length-2],length:e.length})}),n},t.deferredCall=function(e){var t=null,n=function(){t=null,e()},r=function(e){return r.cancel(),t=setTimeout(n,e||0),r};return r.schedule=r,r.call=function(){return this.cancel(),e(),r},r.cancel=function(){return clearTimeout(t),t=null,r},r.isPending=function(){return t},r},t.delayedCall=function(e,t){var n=null,r=function(){n=null,e()},i=function(e){n==null&&(n=setTimeout(r,e||t))};return i.delay=function(e){n&&clearTimeout(n),n=setTimeout(r,e||t)},i.schedule=i,i.call=function(){this.cancel(),e()},i.cancel=function(){n&&clearTimeout(n),n=null},i.isPending=function(){return n},i}}),define("ace/worker/mirror",["require","exports","module","ace/document","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../document").Document,i=e("../lib/lang"),s=t.Mirror=function(e){this.sender=e;var t=this.doc=new r(""),n=this.deferredUpdate=i.delayedCall(this.onUpdate.bind(this)),s=this;e.on("change",function(e){t.applyDeltas(e.data);if(s.$timeout)return n.schedule(s.$timeout);s.onUpdate()})};(function(){this.$timeout=500,this.setTimeout=function(e){this.$timeout=e},this.setValue=function(e){this.doc.setValue(e),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(e){this.sender.callback(this.doc.getValue(),e)},this.onUpdate=function(){},this.isPending=function(){return this.deferredUpdate.isPending()}}).call(s.prototype)}),define("ace/mode/javascript/jshint",["require","exports","module"],function(e,t,n){n.exports=function r(t,n,i){function s(u,a){if(!n[u]){if(!t[u]){var f=typeof e=="function"&&e;if(!a&&f)return f(u,!0);if(o)return o(u,!0);throw new Error("Cannot find module '"+u+"'")}var l=n[u]={exports:{}};t[u][0].call(l.exports,function(e){var n=t[u][1][e];return s(n?n:e)},l,l.exports,r,t,n,i)}return n[u].exports}var o=typeof e=="function"&&e;for(var u=0;u<i.length;u++)s(i[u]);return s}({1:[function(e,t,n){var r=[];for(var i=0;i<128;i++)r[i]=i===36||i>=65&&i<=90||i===95||i>=97&&i<=122;var s=[];for(var i=0;i<128;i++)s[i]=r[i]||i>=48&&i<=57;t.exports={asciiIdentifierStartTable:r,asciiIdentifierPartTable:s}},{}],2:[function(e,t,n){(function(){var e=this,r=e._,i={},s=Array.prototype,o=Object.prototype,u=Function.prototype,a=s.push,f=s.slice,l=s.concat,c=o.toString,h=o.hasOwnProperty,p=s.forEach,d=s.map,v=s.reduce,m=s.reduceRight,g=s.filter,y=s.every,b=s.some,w=s.indexOf,E=s.lastIndexOf,S=Array.isArray,x=Object.keys,T=u.bind,N=function(e){if(e instanceof N)return e;if(!(this instanceof N))return new N(e);this._wrapped=e};typeof n!="undefined"?(typeof t!="undefined"&&t.exports&&(n=t.exports=N),n._=N):e._=N,N.VERSION="1.6.0";var C=N.each=N.forEach=function(e,t,n){if(e==null)return e;if(p&&e.forEach===p)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,s=e.length;r<s;r++)if(t.call(n,e[r],r,e)===i)return}else{var o=N.keys(e);for(var r=0,s=o.length;r<s;r++)if(t.call(n,e[o[r]],o[r],e)===i)return}return e};N.map=N.collect=function(e,t,n){var r=[];return e==null?r:d&&e.map===d?e.map(t,n):(C(e,function(e,i,s){r.push(t.call(n,e,i,s))}),r)};var k="Reduce of empty array with no initial value";N.reduce=N.foldl=N.inject=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(v&&e.reduce===v)return r&&(t=N.bind(t,r)),i?e.reduce(t,n):e.reduce(t);C(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError(k);return n},N.reduceRight=N.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(m&&e.reduceRight===m)return r&&(t=N.bind(t,r)),i?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=N.keys(e);s=o.length}C(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError(k);return n},N.find=N.detect=function(e,t,n){var r;return L(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},N.filter=N.select=function(e,t,n){var r=[];return e==null?r:g&&e.filter===g?e.filter(t,n):(C(e,function(e,i,s){t.call(n,e,i,s)&&r.push(e)}),r)},N.reject=function(e,t,n){return N.filter(e,function(e,r,i){return!t.call(n,e,r,i)},n)},N.every=N.all=function(e,t,n){t||(t=N.identity);var r=!0;return e==null?r:y&&e.every===y?e.every(t,n):(C(e,function(e,s,o){if(!(r=r&&t.call(n,e,s,o)))return i}),!!r)};var L=N.some=N.any=function(e,t,n){t||(t=N.identity);var r=!1;return e==null?r:b&&e.some===b?e.some(t,n):(C(e,function(e,s,o){if(r||(r=t.call(n,e,s,o)))return i}),!!r)};N.contains=N.include=function(e,t){return e==null?!1:w&&e.indexOf===w?e.indexOf(t)!=-1:L(e,function(e){return e===t})},N.invoke=function(e,t){var n=f.call(arguments,2),r=N.isFunction(t);return N.map(e,function(e){return(r?t:e[t]).apply(e,n)})},N.pluck=function(e,t){return N.map(e,N.property(t))},N.where=function(e,t){return N.filter(e,N.matches(t))},N.findWhere=function(e,t){return N.find(e,N.matches(t))},N.max=function(e,t,n){if(!t&&N.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);var r=-Infinity,i=-Infinity;return C(e,function(e,s,o){var u=t?t.call(n,e,s,o):e;u>i&&(r=e,i=u)}),r},N.min=function(e,t,n){if(!t&&N.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);var r=Infinity,i=Infinity;return C(e,function(e,s,o){var u=t?t.call(n,e,s,o):e;u<i&&(r=e,i=u)}),r},N.shuffle=function(e){var t,n=0,r=[];return C(e,function(e){t=N.random(n++),r[n-1]=r[t],r[t]=e}),r},N.sample=function(e,t,n){return t==null||n?(e.length!==+e.length&&(e=N.values(e)),e[N.random(e.length-1)]):N.shuffle(e).slice(0,Math.max(0,t))};var A=function(e){return e==null?N.identity:N.isFunction(e)?e:N.property(e)};N.sortBy=function(e,t,n){return t=A(t),N.pluck(N.map(e,function(e,r,i){return{value:e,index:r,criteria:t.call(n,e,r,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||n===void 0)return 1;if(n<r||r===void 0)return-1}return e.index-t.index}),"value")};var O=function(e){return function(t,n,r){var i={};return n=A(n),C(t,function(s,o){var u=n.call(r,s,o,t);e(i,u,s)}),i}};N.groupBy=O(function(e,t,n){N.has(e,t)?e[t].push(n):e[t]=[n]}),N.indexBy=O(function(e,t,n){e[t]=n}),N.countBy=O(function(e,t){N.has(e,t)?e[t]++:e[t]=1}),N.sortedIndex=function(e,t,n,r){n=A(n);var i=n.call(r,t),s=0,o=e.length;while(s<o){var u=s+o>>>1;n.call(r,e[u])<i?s=u+1:o=u}return s},N.toArray=function(e){return e?N.isArray(e)?f.call(e):e.length===+e.length?N.map(e,N.identity):N.values(e):[]},N.size=function(e){return e==null?0:e.length===+e.length?e.length:N.keys(e).length},N.first=N.head=N.take=function(e,t,n){return e==null?void 0:t==null||n?e[0]:t<0?[]:f.call(e,0,t)},N.initial=function(e,t,n){return f.call(e,0,e.length-(t==null||n?1:t))},N.last=function(e,t,n){return e==null?void 0:t==null||n?e[e.length-1]:f.call(e,Math.max(e.length-t,0))},N.rest=N.tail=N.drop=function(e,t,n){return f.call(e,t==null||n?1:t)},N.compact=function(e){return N.filter(e,N.identity)};var M=function(e,t,n){return t&&N.every(e,N.isArray)?l.apply(n,e):(C(e,function(e){N.isArray(e)||N.isArguments(e)?t?a.apply(n,e):M(e,t,n):n.push(e)}),n)};N.flatten=function(e,t){return M(e,t,[])},N.without=function(e){return N.difference(e,f.call(arguments,1))},N.partition=function(e,t){var n=[],r=[];return C(e,function(e){(t(e)?n:r).push(e)}),[n,r]},N.uniq=N.unique=function(e,t,n,r){N.isFunction(t)&&(r=n,n=t,t=!1);var i=n?N.map(e,n,r):e,s=[],o=[];return C(i,function(n,r){if(t?!r||o[o.length-1]!==n:!N.contains(o,n))o.push(n),s.push(e[r])}),s},N.union=function(){return N.uniq(N.flatten(arguments,!0))},N.intersection=function(e){var t=f.call(arguments,1);return N.filter(N.uniq(e),function(e){return N.every(t,function(t){return N.contains(t,e)})})},N.difference=function(e){var t=l.apply(s,f.call(arguments,1));return N.filter(e,function(e){return!N.contains(t,e)})},N.zip=function(){var e=N.max(N.pluck(arguments,"length").concat(0)),t=new Array(e);for(var n=0;n<e;n++)t[n]=N.pluck(arguments,""+n);return t},N.object=function(e,t){if(e==null)return{};var n={};for(var r=0,i=e.length;r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n},N.indexOf=function(e,t,n){if(e==null)return-1;var r=0,i=e.length;if(n){if(typeof n!="number")return r=N.sortedIndex(e,t),e[r]===t?r:-1;r=n<0?Math.max(0,i+n):n}if(w&&e.indexOf===w)return e.indexOf(t,n);for(;r<i;r++)if(e[r]===t)return r;return-1},N.lastIndexOf=function(e,t,n){if(e==null)return-1;var r=n!=null;if(E&&e.lastIndexOf===E)return r?e.lastIndexOf(t,n):e.lastIndexOf(t);var i=r?n:e.length;while(i--)if(e[i]===t)return i;return-1},N.range=function(e,t,n){arguments.length<=1&&(t=e||0,e=0),n=arguments[2]||1;var r=Math.max(Math.ceil((t-e)/n),0),i=0,s=new Array(r);while(i<r)s[i++]=e,e+=n;return s};var _=function(){};N.bind=function(e,t){var n,r;if(T&&e.bind===T)return T.apply(e,f.call(arguments,1));if(!N.isFunction(e))throw new TypeError;return n=f.call(arguments,2),r=function(){if(this instanceof r){_.prototype=e.prototype;var i=new _;_.prototype=null;var s=e.apply(i,n.concat(f.call(arguments)));return Object(s)===s?s:i}return e.apply(t,n.concat(f.call(arguments)))}},N.partial=function(e){var t=f.call(arguments,1);return function(){var n=0,r=t.slice();for(var i=0,s=r.length;i<s;i++)r[i]===N&&(r[i]=arguments[n++]);while(n<arguments.length)r.push(arguments[n++]);return e.apply(this,r)}},N.bindAll=function(e){var t=f.call(arguments,1);if(t.length===0)throw new Error("bindAll must be passed function names");return C(t,function(t){e[t]=N.bind(e[t],e)}),e},N.memoize=function(e,t){var n={};return t||(t=N.identity),function(){var r=t.apply(this,arguments);return N.has(n,r)?n[r]:n[r]=e.apply(this,arguments)}},N.delay=function(e,t){var n=f.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},N.defer=function(e){return N.delay.apply(N,[e,1].concat(f.call(arguments,1)))},N.throttle=function(e,t,n){var r,i,s,o=null,u=0;n||(n={});var a=function(){u=n.leading===!1?0:N.now(),o=null,s=e.apply(r,i),r=i=null};return function(){var f=N.now();!u&&n.leading===!1&&(u=f);var l=t-(f-u);return r=this,i=arguments,l<=0?(clearTimeout(o),o=null,u=f,s=e.apply(r,i),r=i=null):!o&&n.trailing!==!1&&(o=setTimeout(a,l)),s}},N.debounce=function(e,t,n){var r,i,s,o,u,a=function(){var f=N.now()-o;f<t?r=setTimeout(a,t-f):(r=null,n||(u=e.apply(s,i),s=i=null))};return function(){s=this,i=arguments,o=N.now();var f=n&&!r;return r||(r=setTimeout(a,t)),f&&(u=e.apply(s,i),s=i=null),u}},N.once=function(e){var t=!1,n;return function(){return t?n:(t=!0,n=e.apply(this,arguments),e=null,n)}},N.wrap=function(e,t){return N.partial(t,e)},N.compose=function(){var e=arguments;return function(){var t=arguments;for(var n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},N.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},N.keys=function(e){if(!N.isObject(e))return[];if(x)return x(e);var t=[];for(var n in e)N.has(e,n)&&t.push(n);return t},N.values=function(e){var t=N.keys(e),n=t.length,r=new Array(n);for(var i=0;i<n;i++)r[i]=e[t[i]];return r},N.pairs=function(e){var t=N.keys(e),n=t.length,r=new Array(n);for(var i=0;i<n;i++)r[i]=[t[i],e[t[i]]];return r},N.invert=function(e){var t={},n=N.keys(e);for(var r=0,i=n.length;r<i;r++)t[e[n[r]]]=n[r];return t},N.functions=N.methods=function(e){var t=[];for(var n in e)N.isFunction(e[n])&&t.push(n);return t.sort()},N.extend=function(e){return C(f.call(arguments,1),function(t){if(t)for(var n in t)e[n]=t[n]}),e},N.pick=function(e){var t={},n=l.apply(s,f.call(arguments,1));return C(n,function(n){n in e&&(t[n]=e[n])}),t},N.omit=function(e){var t={},n=l.apply(s,f.call(arguments,1));for(var r in e)N.contains(n,r)||(t[r]=e[r]);return t},N.defaults=function(e){return C(f.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e},N.clone=function(e){return N.isObject(e)?N.isArray(e)?e.slice():N.extend({},e):e},N.tap=function(e,t){return t(e),e};var D=function(e,t,n,r){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e instanceof N&&(e=e._wrapped),t instanceof N&&(t=t._wrapped);var i=c.call(e);if(i!=c.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if(typeof e!="object"||typeof t!="object")return!1;var s=n.length;while(s--)if(n[s]==e)return r[s]==t;var o=e.constructor,u=t.constructor;if(o!==u&&!(N.isFunction(o)&&o instanceof o&&N.isFunction(u)&&u instanceof u)&&"constructor"in e&&"constructor"in t)return!1;n.push(e),r.push(t);var a=0,f=!0;if(i=="[object Array]"){a=e.length,f=a==t.length;if(f)while(a--)if(!(f=D(e[a],t[a],n,r)))break}else{for(var l in e)if(N.has(e,l)){a++;if(!(f=N.has(t,l)&&D(e[l],t[l],n,r)))break}if(f){for(l in t)if(N.has(t,l)&&!(a--))break;f=!a}}return n.pop(),r.pop(),f};N.isEqual=function(e,t){return D(e,t,[],[])},N.isEmpty=function(e){if(e==null)return!0;if(N.isArray(e)||N.isString(e))return e.length===0;for(var t in e)if(N.has(e,t))return!1;return!0},N.isElement=function(e){return!!e&&e.nodeType===1},N.isArray=S||function(e){return c.call(e)=="[object Array]"},N.isObject=function(e){return e===Object(e)},C(["Arguments","Function","String","Number","Date","RegExp"],function(e){N["is"+e]=function(t){return c.call(t)=="[object "+e+"]"}}),N.isArguments(arguments)||(N.isArguments=function(e){return!!e&&!!N.has(e,"callee")}),typeof /./!="function"&&(N.isFunction=function(e){return typeof e=="function"}),N.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},N.isNaN=function(e){return N.isNumber(e)&&e!=+e},N.isBoolean=function(e){return e===!0||e===!1||c.call(e)=="[object Boolean]"},N.isNull=function(e){return e===null},N.isUndefined=function(e){return e===void 0},N.has=function(e,t){return h.call(e,t)},N.noConflict=function(){return e._=r,this},N.identity=function(e){return e},N.constant=function(e){return function(){return e}},N.property=function(e){return function(t){return t[e]}},N.matches=function(e){return function(t){if(t===e)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0}},N.times=function(e,t,n){var r=Array(Math.max(0,e));for(var i=0;i<e;i++)r[i]=t.call(n,i);return r},N.random=function(e,t){return t==null&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},N.now=Date.now||function(){return(new Date).getTime()};var P={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}};P.unescape=N.invert(P.escape);var H={escape:new RegExp("["+N.keys(P.escape).join("")+"]","g"),unescape:new RegExp("("+N.keys(P.unescape).join("|")+")","g")};N.each(["escape","unescape"],function(e){N[e]=function(t){return t==null?"":(""+t).replace(H[e],function(t){return P[e][t]})}}),N.result=function(e,t){if(e==null)return void 0;var n=e[t];return N.isFunction(n)?n.call(e):n},N.mixin=function(e){C(N.functions(e),function(t){var n=N[t]=e[t];N.prototype[t]=function(){var e=[this._wrapped];return a.apply(e,arguments),q.call(this,n.apply(N,e))}})};var B=0;N.uniqueId=function(e){var t=++B+"";return e?e+t:t},N.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var j=/(.)^/,F={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},I=/\\|'|\r|\n|\t|\u2028|\u2029/g;N.template=function(e,t,n){var r;n=N.defaults({},n,N.templateSettings);var i=new RegExp([(n.escape||j).source,(n.interpolate||j).source,(n.evaluate||j).source].join("|")+"|$","g"),s=0,o="__p+='";e.replace(i,function(t,n,r,i,u){return o+=e.slice(s,u).replace(I,function(e){return"\\"+F[e]}),n&&(o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(o+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),i&&(o+="';\n"+i+"\n__p+='"),s=u+t.length,t}),o+="';\n",n.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{r=new Function(n.variable||"obj","_",o)}catch(u){throw u.source=o,u}if(t)return r(t,N);var a=function(e){return r.call(this,e,N)};return a.source="function("+(n.variable||"obj")+"){\n"+o+"}",a},N.chain=function(e){return N(e).chain()};var q=function(e){return this._chain?N(e).chain():e};N.mixin(N),C(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=s[e];N.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],q.call(this,n)}}),C(["concat","join","slice"],function(e){var t=s[e];N.prototype[e]=function(){return q.call(this,t.apply(this._wrapped,arguments))}}),N.extend(N.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),typeof define=="function"&&define.amd&&define("underscore",[],function(){return N})}).call(this)},{}],3:[function(e,t,n){var r=e("underscore"),i=e("events"),s=e("./vars.js"),o=e("./messages.js"),u=e("./lex.js").Lexer,a=e("./reg.js"),f=e("./state.js").state,l=e("./style.js"),c=function(){"use strict";function I(e,t){return e=e.trim(),/^[+-]W\d{3}$/g.test(e)?!0:p[e]===undefined&&h[e]===undefined&&t.type!=="jslint"&&!m[e]?(G("E001",t,e),!1):!0}function q(e){return Object.prototype.toString.call(e)==="[object String]"}function R(e,t){return e?!e.identifier||e.value!==t?!1:!0:!1}function U(e){if(!e.reserved)return!1;var t=e.meta;if(t&&t.isFutureReservedWord&&f.option.inES5()){if(!t.es5)return!1;if(t.strictOnly&&!f.option.strict&&!f.directive["use strict"])return!1;if(e.isProperty)return!1}return!0}function z(e,t){return e.replace(/\{([^{}]*)\}/g,function(e,n){var r=t[n];return typeof r=="string"||typeof r=="number"?r:e})}function W(e,t){Object.keys(t).forEach(function(n){if(r.has(c.blacklist,n))return;e[n]=t[n]})}function X(){f.option.esnext&&W(M,s.newEcmaIdentifiers),f.option.couch&&W(M,s.couch),f.option.qunit&&W(M,s.qunit),f.option.rhino&&W(M,s.rhino),f.option.shelljs&&(W(M,s.shelljs),W(M,s.node)),f.option.typed&&W(M,s.typed),f.option.phantom&&W(M,s.phantom),f.option.prototypejs&&W(M,s.prototypejs),f.option.node&&(W(M,s.node),W(M,s.typed)),f.option.devel&&W(M,s.devel),f.option.dojo&&W(M,s.dojo),f.option.browser&&(W(M,s.browser),W(M,s.typed)),f.option.nonstandard&&W(M,s.nonstandard),f.option.jasmine&&W(M,s.jasmine),f.option.jquery&&W(M,s.jquery),f.option.mootools&&W(M,s.mootools),f.option.worker&&W(M,s.worker),f.option.wsh&&W(M,s.wsh),f.option.globalstrict&&f.option.strict!==!1&&(f.option.strict=!0),f.option.yui&&W(M,s.yui),f.option.mocha&&W(M,s.mocha),f.option.inMoz=function(e){return f.option.moz},f.option.inESNext=function(e){return f.option.moz||f.option.esnext},f.option.inES5=function(){return!f.option.es3},f.option.inES3=function(e){return e?!f.option.moz&&!f.option.esnext&&f.option.es3:f.option.es3}}function V(e,t,n){var r=Math.floor(t/f.lines.length*100),i=o.errors[e].desc;throw{name:"JSHintError",line:t,character:n,message:i+" ("+r+"% scanned).",raw:i,code:e}}function $(e,t,n,r){return c.undefs.push([e,t,n,r])}function J(){var e=f.ignoredLines;if(r.isEmpty(e))return;c.errors=r.reject(c.errors,function(t){return e[t.line]})}function K(e,t,n,r,i,s){var u,a,l,h;if(/^W\d{3}$/.test(e)){if(f.ignored[e])return;h=o.warnings[e]}else/E\d{3}/.test(e)?h=o.errors[e]:/I\d{3}/.test(e)&&(h=o.info[e]);return t=t||f.tokens.next,t.id==="(end)"&&(t=f.tokens.curr),a=t.line||0,u=t.from||0,l={id:"(error)",raw:h.desc,code:h.code,evidence:f.lines[a-1]||"",line:a,character:u,scope:c.scope,a:n,b:r,c:i,d:s},l.reason=z(h.desc,l),c.errors.push(l),J(),c.errors.length>=f.option.maxerr&&V("E043",a,u),l}function Q(e,t,n,r,i,s,o){return K(e,{line:t,from:n},r,i,s,o)}function G(e,t,n,r,i,s){K(e,t,n,r,i,s)}function Y(e,t,n,r,i,s,o){return G(e,{line:t,from:n},r,i,s,o)}function Z(e,t){var n;return n={id:"(internal)",elem:e,value:t},c.internals.push(n),n}function et(e,t){t=t||{};var n=t.type,i=t.token,s=t.islet;n==="exception"&&r.has(w["(context)"],e)&&w[e]!==!0&&!f.option.node&&K("W002",f.tokens.next,e),r.has(w,e)&&!w["(global)"]&&(w[e]===!0?f.option.latedef&&(f.option.latedef===!0&&r.contains([w[e],n],"unction")||!r.contains([w[e],n],"unction"))&&K("W003",f.tokens.next,e):((!f.option.shadow||r.contains(["inner","outer"],f.option.shadow))&&n!=="exception"||w["(blockscope)"].getlabel(e))&&K("W004",f.tokens.next,e)),w["(context)"]&&r.has(w["(context)"],e)&&n!=="function"&&f.option.shadow==="outer"&&K("W123",f.tokens.next,e),s?w["(blockscope)"].current.add(e,n,f.tokens.curr):(w["(blockscope)"].shadow(e),w[e]=n,i&&(w["(tokens)"][e]=i),Xt(w,e,{unused:t.unused||!1}),w["(global)"]?(S[e]=w,r.has(x,e)&&(f.option.latedef&&(f.option.latedef===!0&&r.contains([w[e],n],"unction")||!r.contains([w[e],n],"unction"))&&K("W003",f.tokens.next,e),delete x[e])):D[e]=w)}function tt(){var e=f.tokens.next,t=e.body.match(/(-\s+)?[^\s,:]+(?:\s*:\s*(-\s+)?[^\s,]+)?/g)||[],n={};if(e.type==="globals"){t.forEach(function(e){e=e.split(":");var t=(e[0]||"").trim(),r=(e[1]||"").trim();t.charAt(0)==="-"?(t=t.slice(1),r=!1,c.blacklist[t]=t,delete M[t]):n[t]=r==="true"}),W(M,n);for(var i in n)r.has(n,i)&&(g[i]=e)}e.type==="exported"&&t.forEach(function(e){y[e]=!0}),e.type==="members"&&(A=A||{},t.forEach(function(e){var t=e.charAt(0),n=e.charAt(e.length-1);t===n&&(t==='"'||t==="'")&&(e=e.substr(1,e.length-2).replace('\\"','"')),A[e]=!1}));var s=["maxstatements","maxparams","maxdepth","maxcomplexity","maxerr","maxlen","indent"];if(e.type==="jshint"||e.type==="jslint")t.forEach(function(t){t=t.split(":");var n=(t[0]||"").trim(),r=(t[1]||"").trim();if(!I(n,e))return;if(s.indexOf(n)>=0){if(r!=="false"){r=+r;if(typeof r!="number"||!isFinite(r)||r<=0||Math.floor(r)!==r){G("E032",e,t[1].trim());return}f.option[n]=r}else f.option[n]=n==="indent"?4:!1;return}if(n==="validthis"){if(w["(global)"])return void G("E009");if(r!=="true"&&r!=="false")return void G("E002",e);f.option.validthis=r==="true";return}if(n==="quotmark"){switch(r){case"true":case"false":f.option.quotmark=r==="true";break;case"double":case"single":f.option.quotmark=r;break;default:G("E002",e)}return}if(n==="shadow"){switch(r){case"true":f.option.shadow=!0;break;case"outer":f.option.shadow="outer";break;case"false":case"inner":f.option.shadow="inner";break;default:G("E002",e)}return}if(n==="unused"){switch(r){case"true":f.option.unused=!0;break;case"false":f.option.unused=!1;break;case"vars":case"strict":f.option.unused=r;break;default:G("E002",e)}return}if(n==="latedef"){switch(r){case"true":f.option.latedef=!0;break;case"false":f.option.latedef=!1;break;case"nofunc":f.option.latedef="nofunc";break;default:G("E002",e)}return}if(n==="ignore"){switch(r){case"start":f.ignoreLinterErrors=!0;break;case"end":f.ignoreLinterErrors=!1;break;case"line":f.ignoredLines[e.line]=!0,J();break;default:G("E002",e)}return}var i=/^([+-])(W\d{3})$/g.exec(n);if(i){f.ignored[i[2]]=i[1]==="-";return}var o;if(r==="true"||r==="false"){e.type==="jslint"?(o=v[n]||n,f.option[o]=r==="true",d[o]!==undefined&&(f.option[o]=!f.option[o])):f.option[n]=r==="true",n==="newcap"&&(f.option["(explicitNewcap)"]=!0);return}G("E002",e)}),X()}function nt(e){var t=e||0,n=0,r;while(n<=t)r=C[n],r||(r=C[n]=k.token()),n+=1;return r}function rt(t,n){switch(f.tokens.curr.id){case"(number)":f.tokens.next.id==="."&&K("W005",f.tokens.curr);break;case"-":(f.tokens.next.id==="-"||f.tokens.next.id==="--")&&K("W006");break;case"+":(f.tokens.next.id==="+"||f.tokens.next.id==="++")&&K("W007")}if(f.tokens.curr.type==="(string)"||f.tokens.curr.identifier)e=f.tokens.curr.value;t&&f.tokens.next.id!==t&&(n?f.tokens.next.id==="(end)"?G("E019",n,n.id):G("E020",f.tokens.next,t,n.id,n.line,f.tokens.next.value):(f.tokens.next.type!=="(identifier)"||f.tokens.next.value!==t)&&K("W116",f.tokens.next,t,f.tokens.next.value)),f.tokens.prev=f.tokens.curr,f.tokens.curr=f.tokens.next;for(;;){f.tokens.next=C.shift()||k.token(),f.tokens.next||V("E041",f.tokens.curr.line);if(f.tokens.next.id==="(end)"||f.tokens.next.id==="(error)")return;f.tokens.next.check&&f.tokens.next.check();if(f.tokens.next.isSpecial)tt();else if(f.tokens.next.id!=="(endline)")break}}function it(e){return e.infix||!e.identifier&&!!e.led}function st(){var e=f.tokens.curr,t=f.tokens.next;return t.id===";"||t.id==="}"||t.id===":"?!0:it(t)===it(e)||e.id==="yield"&&f.option.inMoz(!0)?e.line!==t.line:!1}function ot(t,n){var i,s=!1,o=!1,u=!1;!n&&f.tokens.next.value==="let"&&nt(0).value==="("&&(f.option.inMoz(!0)||K("W118",f.tokens.next,"let expressions"),u=!0,w["(blockscope)"].stack(),rt("let"),rt("("),f.syntax.let.fud.call(f.syntax.let.fud,!1),rt(")")),f.tokens.next.id==="(end)"&&G("E006",f.tokens.curr);var a=f.option.asi&&f.tokens.prev.line<f.tokens.curr.line&&r.contains(["]",")"],f.tokens.prev.id)&&r.contains(["[","("],f.tokens.curr.id);a&&K("W014",f.tokens.curr,f.tokens.curr.id),rt(),n&&(e="anonymous",w["(verb)"]=f.tokens.curr.value);if(n===!0&&f.tokens.curr.fud)i=f.tokens.curr.fud();else{f.tokens.curr.nud?i=f.tokens.curr.nud():G("E030",f.tokens.curr,f.tokens.curr.id);while(t<f.tokens.next.lbp&&!st())s=f.tokens.curr.value==="Array",o=f.tokens.curr.value==="Object",i&&(i.value||i.first&&i.first.value)&&(i.value!=="new"||i.first&&i.first.value&&i.first.value===".")&&(s=!1,i.value!==f.tokens.curr.value&&(o=!1)),rt(),s&&f.tokens.curr.id==="("&&f.tokens.next.id===")"&&K("W009",f.tokens.curr),o&&f.tokens.curr.id==="("&&f.tokens.next.id===")"&&K("W010",f.tokens.curr),i&&f.tokens.curr.led?i=f.tokens.curr.led(i):G("E033",f.tokens.curr,f.tokens.curr.id)}return u&&w["(blockscope)"].unstack(),i}function ut(e,t){e=e||f.tokens.curr,t=t||f.tokens.next,!f.option.laxbreak&&e.line!==t.line&&K("W014",t,t.value)}function at(e){e=e||f.tokens.curr,e.line!==f.tokens.next.line&&K("E022",e,e.value)}function ft(e,t){e.line!==t.line&&(f.option.laxcomma||(lt.first&&(K("I001"),lt.first=!1),K("W014",e,t.value)))}function lt(e){e=e||{},e.peek?ft(f.tokens.prev,f.tokens.curr):(ft(f.tokens.curr,f.tokens.next),rt(","));if(f.tokens.next.identifier&&(!e.property||!f.option.inES5()))switch(f.tokens.next.value){case"break":case"case":case"catch":case"continue":case"default":case"do":case"else":case"finally":case"for":case"if":case"in":case"instanceof":case"return":case"switch":case"throw":case"try":case"var":case"let":case"while":case"with":return G("E024",f.tokens.next,f.tokens.next.value),!1}if(f.tokens.next.type==="(punctuator)")switch(f.tokens.next.value){case"}":case"]":case",":if(e.allowTrailing)return!0;case")":return G("E024",f.tokens.next,f.tokens.next.value),!1}return!0}function ct(e,t){var n=f.syntax[e];if(!n||typeof n!="object")f.syntax[e]=n={id:e,lbp:t,value:e};return n}function ht(e){return ct(e,0)}function pt(e,t){var n=ht(e);return n.identifier=n.reserved=!0,n.fud=t,n}function dt(e,t){var n=pt(e,t);return n.block=!0,n}function vt(e){var t=e.id.charAt(0);if(t>="a"&&t<="z"||t>="A"&&t<="Z")e.identifier=e.reserved=!0;return e}function mt(e,t){var n=ct(e,150);return vt(n),n.nud=typeof t=="function"?t:function(){this.right=ot(150),this.arity="unary";if(this.id==="++"||this.id==="--")f.option.plusplus?K("W016",this,this.id):this.right&&(!this.right.identifier||U(this.right))&&this.right.id!=="."&&this.right.id!=="["&&K("W017",this);return this},n}function gt(e,t){var n=ht(e);return n.type=e,n.nud=t,n}function yt(e,t){var n=gt(e,t);return n.identifier=!0,n.reserved=!0,n}function bt(e,t){var n=gt(e,t&&t.nud||function(){return this});return t=t||{},t.isFutureReservedWord=!0,n.value=e,n.identifier=!0,n.reserved=!0,n.meta=t,n}function wt(e,t){return yt(e,function(){return typeof t=="function"&&t(this),this})}function Et(e,t,n,r){var i=ct(e,n);return vt(i),i.infix=!0,i.led=function(i){return r||ut(f.tokens.prev,f.tokens.curr),e==="in"&&i.id==="!"&&K("W018",i,"!"),typeof t=="function"?t(i,this):(this.left=i,this.right=ot(n),this)},i}function St(e){var t=ct(e,42);return t.led=function(e){return f.option.inESNext()||K("W104",f.tokens.curr,"arrow function syntax (=>)"),ut(f.tokens.prev,f.tokens.curr),this.left=e,this.right=Jt(undefined,undefined,!1,e),this},t}function xt(e,t){var n=ct(e,100);return n.led=function(e){ut(f.tokens.prev,f.tokens.curr);var n=ot(100);return R(e,"NaN")||R(n,"NaN")?K("W019",this):t&&t.apply(this,[e,n]),(!e||!n)&&V("E041",f.tokens.curr.line),e.id==="!"&&K("W018",e,"!"),n.id==="!"&&K("W018",n,"!"),this.left=e,this.right=n,this},n}function Tt(e){return e&&(e.type==="(number)"&&+e.value===0||e.type==="(string)"&&e.value===""||e.type==="null"&&!f.option.eqnull||e.type==="true"||e.type==="false"||e.type==="undefined")}function Nt(e,t){if(f.option.notypeof)return!1;if(!e||!t)return!1;var n=["undefined","object","boolean","number","string","function","xml","object","unknown"];return t.type==="(identifier)"&&t.value==="typeof"&&e.type==="(string)"?!r.contains(n,e.value):!1}function Ct(e){function n(e){if(typeof e!="object")return;return e.right==="prototype"?e:n(e.left)}function r(e){while(!e.identifier&&typeof e.left=="object")e=e.left;if(e.identifier&&t.indexOf(e.value)>=0)return e.value}var t=["Array","ArrayBuffer","Boolean","Collator","DataView","Date","DateTimeFormat","Error","EvalError","Float32Array","Float64Array","Function","Infinity","Intl","Int16Array","Int32Array","Int8Array","Iterator","Number","NumberFormat","Object","RangeError","ReferenceError","RegExp","StopIteration","String","SyntaxError","TypeError","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","URIError"],i=n(e);if(i)return r(i)}function kt(e,t,n){var r=Et(e,typeof t=="function"?t:function(e,t){t.left=e;if(e){if(f.option.freeze){var n=Ct(e);n&&K("W121",e,n)}M[e.value]===!1&&D[e.value]["(global)"]===!0?K("W020",e):e["function"]&&K("W021",e,e.value),w[e.value]==="const"&&G("E013",e,e.value);if(e.id===".")return e.left?e.left.value==="arguments"&&!f.directive["use strict"]&&K("E031",t):K("E031",t),t.right=ot(10),t;if(e.id==="[")return f.tokens.curr.left.first?f.tokens.curr.left.first.forEach(function(e){e&&w[e.value]==="const"&&G("E013",e,e.value)}):e.left?e.left.value==="arguments"&&!f.directive["use strict"]&&K("E031",t):K("E031",t),t.right=ot(10),t;if(e.identifier&&!U(e))return w[e.value]==="exception"&&K("W022",e),t.right=ot(10),t;e===f.syntax["function"]&&K("W023",f.tokens.curr)}G("E031",t)},n);return r.exps=!0,r.assign=!0,r}function Lt(e,t,n){var r=ct(e,n);return vt(r),r.led=typeof t=="function"?t:function(e){return f.option.bitwise&&K("W016",this,this.id),this.left=e,this.right=ot(n),this},r}function At(e){return kt(e,function(e,t){f.option.bitwise&&K("W016",t,t.id);if(e)return e.id==="."||e.id==="["||e.identifier&&!U(e)?(ot(10),t):(e===f.syntax["function"]&&K("W023",f.tokens.curr),t);G("E031",t)},20)}function Ot(e){var t=ct(e,150);return t.led=function(e){return f.option.plusplus?K("W016",this,this.id):(!e.identifier||U(e))&&e.id!=="."&&e.id!=="["&&K("W017",this),this.left=e,this},t}function Mt(e,t){if(!f.tokens.next.identifier)return;rt();var n=f.tokens.curr,r=f.tokens.curr.value;return U(n)?t&&f.option.inES5()?r:e&&r==="undefined"?r:(K("W024",f.tokens.curr,f.tokens.curr.id),r):r}function _t(e,t){var n=Mt(e,t);if(n)return n;f.tokens.curr.id==="function"&&f.tokens.next.id==="("?K("W025"):G("E030",f.tokens.next,f.tokens.next.value)}function Dt(e){var t=0,n;if(f.tokens.next.id!==";"||O)return;for(;;){do n=nt(t),t+=1;while(n.id!="(end)"&&n.id==="(comment)");if(n.reach)return;if(n.id!=="(endline)"){if(n.id==="function"){f.option.latedef===!0&&K("W026",n);break}K("W027",n,n.value,e);break}}}function Pt(){f.tokens.next.id!==";"?f.option.asi||(!f.option.lastsemic||f.tokens.next.id!=="}"||f.tokens.next.line!==f.tokens.curr.line)&&Q("W033",f.tokens.curr.line,f.tokens.curr.character):rt(";")}function Ht(){var e,t=N,n,i=D,s=f.tokens.next;if(s.id===";"){rt(";");return}var o=U(s);o&&s.meta&&s.meta.isFutureReservedWord&&nt().id===":"&&(K("W024",s,s.id),o=!1);if(s.value==="module"&&s.type==="(identifier)"&&nt().type==="(identifier)"){f.option.inESNext()||K("W119",f.tokens.curr,"module"),rt("module");var u=_t();et(u,{type:"unused",token:f.tokens.curr}),rt("from"),rt("(string)"),Pt();return}if(r.has(["[","{"],s.value)&&on().isDestAssign){f.option.inESNext()||K("W104",f.tokens.curr,"destructuring expression"),e=Yt(),e.forEach(function(e){$(w,"W117",e.token,e.id)}),rt("="),Zt(e,ot(10,!0)),rt(";");return}s.identifier&&!o&&nt().id===":"&&(rt(),rt(":"),D=Object.create(i),et(s.value,{type:"label"}),!f.tokens.next.labelled&&f.tokens.next.value!=="{"&&K("W028",f.tokens.next,s.value,f.tokens.next.value),f.tokens.next.label=s.value,s=f.tokens.next);if(s.id==="{"){var a=w["(verb)"]==="case"&&f.tokens.curr.value===":";Ft(!0,!0,!1,!1,a);return}return n=ot(0,!0),n&&(!n.identifier||n.value!=="function")&&n.type!=="(punctuator)"&&!f.directive["use strict"]&&f.option.globalstrict&&f.option.strict&&K("E007"),s.block||(!f.option.expr&&(!n||!n.exps)?K("W030",f.tokens.curr):f.option.nonew&&n&&n.left&&n.id==="("&&n.left.id==="new"&&K("W031",s),Pt()),N=t,D=i,n}function Bt(e){var t=[],n;while(!f.tokens.next.reach&&f.tokens.next.id!=="(end)")f.tokens.next.id===";"?(n=nt(),(!n||n.id!=="("&&n.id!=="[")&&K("W032"),rt(";")):t.push(Ht(e===f.tokens.next.line));return t}function jt(){var e,t,n;for(;;){if(f.tokens.next.id==="(string)"){t=nt(0);if(t.id==="(endline)"){e=1;do n=nt(e),e+=1;while(n.id==="(endline)");if(n.id!==";"){if(n.id!=="(string)"&&n.id!=="(number)"&&n.id!=="(regexp)"&&n.identifier!==!0&&n.id!=="}")break;K("W033",f.tokens.next)}else t=n}else if(t.id==="}")K("W033",t);else if(t.id!==";")break;rt(),f.directive[f.tokens.curr.value]&&K("W034",f.tokens.curr,f.tokens.curr.value),f.tokens.curr.value==="use strict"&&(f.option["(explicitNewcap)"]||(f.option.newcap=!0),f.option.undef=!0),f.directive[f.tokens.curr.value]=!0,t.id===";"&&rt(";");continue}break}}function Ft(e,t,n,i,s){var o,u=T,a=N,l,c=D,h,p,d;T=e;if(!e||!f.option.funcscope)D=Object.create(D);h=f.tokens.next;var v=w["(metrics)"];v.nestedBlockDepth+=1,v.verifyMaxNestedBlockDepthPerFunction();if(f.tokens.next.id==="{"){rt("{"),w["(blockscope)"].stack(),p=f.tokens.curr.line;if(f.tokens.next.id!=="}"){N+=f.option.indent;while(!e&&f.tokens.next.from>N)N+=f.option.indent;if(n){l={};for(d in f.directive)r.has(f.directive,d)&&(l[d]=f.directive[d]);jt(),f.option.strict&&w["(context)"]["(global)"]&&!l["use strict"]&&!f.directive["use strict"]&&K("E007")}o=Bt(p),v.statementCount+=o.length,n&&(f.directive=l),N-=f.option.indent}rt("}",h),w["(blockscope)"].unstack(),N=a}else if(!e)if(n){l={},t&&!i&&!f.option.inMoz(!0)&&G("W118",f.tokens.curr,"function closure expressions");if(!t)for(d in f.directive)r.has(f.directive,d)&&(l[d]=f.directive[d]);ot(10),f.option.strict&&w["(context)"]["(global)"]&&!l["use strict"]&&!f.directive["use strict"]&&K("E007")}else G("E021",f.tokens.next,"{",f.tokens.next.value);else w["(nolet)"]=!0,(!t||f.option.curly)&&K("W116",f.tokens.next,"{",f.tokens.next.value),O=!0,N+=f.option.indent,o=[Ht()],N-=f.option.indent,O=!1,delete w["(nolet)"];switch(w["(verb)"]){case"break":case"continue":case"return":case"throw":if(s)break;default:w["(verb)"]=null}if(!e||!f.option.funcscope)D=c;return T=u,e&&f.option.noempty&&(!o||o.length===0)&&K("W035"),v.nestedBlockDepth-=1,o}function It(e){A&&typeof A[e]!="boolean"&&K("W036",f.tokens.curr,e),typeof L[e]=="number"?L[e]+=1:L[e]=1}function qt(e){var t=e.value,n=Object.getOwnPropertyDescriptor(x,t);n?n.value.push(e.line):x[t]=[e.line]}function Ut(){var e={};e.exps=!0,w["(comparray)"].stack();var t=!1;return f.tokens.next.value!=="for"&&(t=!0,f.option.inMoz(!0)||K("W116",f.tokens.next,"for",f.tokens.next.value),w["(comparray)"].setState("use"),e.right=ot(10)),rt("for"),f.tokens.next.value==="each"&&(rt("each"),f.option.inMoz(!0)||K("W118",f.tokens.curr,"for each")),rt("("),w["(comparray)"].setState("define"),e.left=ot(130),r.contains(["in","of"],f.tokens.next.value)?rt():G("E045",f.tokens.curr),w["(comparray)"].setState("generate"),ot(10),rt(")"),f.tokens.next.value==="if"&&(rt("if"),rt("("),w["(comparray)"].setState("filter"),e.filter=ot(10),rt(")")),t||(w["(comparray)"].setState("use"),e.right=ot(10)),rt("]"),w["(comparray)"].unstack(),e}function zt(){var e=Mt(!1,!0);return e||(f.tokens.next.id==="(string)"?(e=f.tokens.next.value,rt()):f.tokens.next.id==="(number)"&&(e=f.tokens.next.value.toString(),rt())),e==="hasOwnProperty"&&K("W001"),e}function Wt(e){var t,n,i=[],s,o=[],u,a=!1;if(e){if(Array.isArray(e)){for(var l in e){t=e[l];if(t.value==="..."){f.option.inESNext()||K("W104",t,"spread/rest operator");continue}t.value!==","&&(i.push(t.value),et(t.value,{type:"unused",token:t}))}return i}if(e.identifier===!0)return et(e.value,{type:"unused",token:e}),[e]}n=f.tokens.next,rt("(");if(f.tokens.next.id===")"){rt(")");return}for(;;){if(r.contains(["{","["],f.tokens.next.id)){o=Yt();for(u in o)u=o[u],u.id&&(i.push(u.id),et(u.id,{type:"unused",token:u.token}))}else f.tokens.next.value==="..."?(f.option.inESNext()||K("W104",f.tokens.next,"spread/rest operator"),rt("..."),s=_t(!0),i.push(s),et(s,{type:"unused",token:f.tokens.curr})):(s=_t(!0),i.push(s),et(s,{type:"unused",token:f.tokens.curr}));a&&f.tokens.next.id!=="="&&G("E051",f.tokens.current),f.tokens.next.id==="="&&(f.option.inESNext()||K("W119",f.tokens.next,"default parameters"),rt("="),a=!0,ot(10));if(f.tokens.next.id!==",")return rt(")",n),i;lt()}}function Xt(e,t,n){e["(properties)"][t]||(e["(properties)"][t]={unused:!1}),r.extend(e["(properties)"][t],n)}function Vt(e,t,n){return e["(properties)"][t]?e["(properties)"][t][n]||null:null}function $t(e,t,n,i){var s={"(name)":e,"(breakage)":0,"(loopage)":0,"(scope)":n,"(tokens)":{},"(properties)":{},"(catch)":!1,"(global)":!1,"(line)":null,"(character)":null,"(metrics)":null,"(statement)":null,"(context)":null,"(blockscope)":null,"(comparray)":null,"(generator)":null,"(params)":null};return t&&r.extend(s,{"(line)":t.line,"(character)":t.character,"(metrics)":Kt(t)}),r.extend(s,i),s["(context)"]&&(s["(blockscope)"]=s["(context)"]["(blockscope)"],s["(comparray)"]=s["(context)"]["(comparray)"]),s}function Jt(t,n,i,s){var o,u=f.option,a=f.ignored,l=D;return f.option=Object.create(f.option),f.ignored=Object.create(f.ignored),D=Object.create(D),w=$t(t||'"'+e+'"',f.tokens.next,D,{"(statement)":n,"(context)":w,"(generator)":i?!0:null}),o=w,f.tokens.curr.funct=w,E.push(w),t&&et(t,{type:"function"}),w["(params)"]=Wt(s),w["(metrics)"].verifyMaxParametersPerFunction(w["(params)"]),c.undefs=r.filter(c.undefs,function(e){return!r.contains(r.union(s),e[2])}),Ft(!1,!0,!0,s?!0:!1),!f.option.noyield&&i&&w["(generator)"]!=="yielded"&&K("W124",f.tokens.curr),w["(metrics)"].verifyMaxStatementsPerFunction(),w["(metrics)"].verifyMaxComplexityPerFunction(),w["(unusedOption)"]=f.option.unused,D=l,f.option=u,f.ignored=a,w["(last)"]=f.tokens.curr.line,w["(lastcharacter)"]=f.tokens.curr.character,r.map(Object.keys(w),function(e){if(e[0]==="(")return;w["(blockscope)"].unshadow(e)}),w=w["(context)"],o}function Kt(e){return{statementCount:0,nestedBlockDepth:-1,ComplexityCount:1,verifyMaxStatementsPerFunction:function(){f.option.maxstatements&&this.statementCount>f.option.maxstatements&&K("W071",e,this.statementCount)},verifyMaxParametersPerFunction:function(t){t=t||[],f.option.maxparams&&t.length>f.option.maxparams&&K("W072",e,t.length)},verifyMaxNestedBlockDepthPerFunction:function(){f.option.maxdepth&&this.nestedBlockDepth>0&&this.nestedBlockDepth===f.option.maxdepth+1&&K("W073",null,this.nestedBlockDepth)},verifyMaxComplexityPerFunction:function(){var t=f.option.maxcomplexity,n=this.ComplexityCount;t&&n>t&&K("W074",e,n)}}}function Qt(){w["(metrics)"].ComplexityCount+=1}function Gt(e){var t,n;e&&(t=e.id,n=e.paren,t===","&&(e=e.exprs[e.exprs.length-1])&&(t=e.id,n=n||e.paren));switch(t){case"=":case"+=":case"-=":case"*=":case"%=":case"&=":case"|=":case"^=":case"/=":!n&&!f.option.boss&&K("W084")}}function Yt(){var e,t,n=[];f.option.inESNext()||K("W104",f.tokens.curr,"destructuring expression");var i=function(){var e;if(r.contains(["[","{"],f.tokens.next.value)){t=Yt();for(var s in t)s=t[s],n.push({id:s.id,token:s.token})}else f.tokens.next.value===","?n.push({id:null,token:f.tokens.curr}):f.tokens.next.value==="("?(rt("("),i(),rt(")")):(e=_t(),e&&n.push({id:e,token:f.tokens.curr}))};if(f.tokens.next.value==="["){rt("["),i();while(f.tokens.next.value!=="]")rt(","),i();rt("]")}else if(f.tokens.next.value==="{"){rt("{"),e=_t(),f.tokens.next.value===":"?(rt(":"),i()):n.push({id:e,token:f.tokens.curr});while(f.tokens.next.value!=="}")rt(","),e=_t(),f.tokens.next.value===":"?(rt(":"),i()):n.push({id:e,token:f.tokens.curr});rt("}")}return n}function Zt(e,t){var n=t.first;if(!n)return;r.zip(e,Array.isArray(n)?n:[n]).forEach(function(e){var t=e[0],n=e[1];t&&n?t.first=n:t&&t.first&&!n&&K("W080",t.first,t.first.value)})}function rn(e){return f.option.inESNext()||K("W104",f.tokens.curr,"class"),e?(this.name=_t(),et(this.name,{type:"unused",token:f.tokens.curr})):f.tokens.next.identifier&&f.tokens.next.value!=="extends"&&(this.name=_t()),sn(this),this}function sn(e){var t=f.directive["use strict"];f.tokens.next.value==="extends"&&(rt("extends"),e.heritage=ot(10)),f.directive["use strict"]=!0,rt("{"),e.body=f.syntax["{"].nud(!0),f.directive["use strict"]=t}function un(){var e=on();e.notJson?(!f.option.inESNext()&&e.isDestAssign&&K("W104",f.tokens.curr,"destructuring assignment"),Bt()):(f.option.laxbreak=!0,f.jsonMode=!0,fn())}function fn(){function e(){var e={},t=f.tokens.next;rt("{");if(f.tokens.next.id!=="}")for(;;){if(f.tokens.next.id==="(end)")G("E026",f.tokens.next,t.line);else{if(f.tokens.next.id==="}"){K("W094",f.tokens.curr);break}f.tokens.next.id===","?G("E028",f.tokens.next):f.tokens.next.id!=="(string)"&&K("W095",f.tokens.next,f.tokens.next.value)}e[f.tokens.next.value]===!0?K("W075",f.tokens.next,f.tokens.next.value):f.tokens.next.value==="__proto__"&&!f.option.proto||f.tokens.next.value==="__iterator__"&&!f.option.iterator?K("W096",f.tokens.next,f.tokens.next.value):e[f.tokens.next.value]=!0,rt(),rt(":"),fn();if(f.tokens.next.id!==",")break;rt(",")}rt("}")}function t(){var e=f.tokens.next;rt("[");if(f.tokens.next.id!=="]")for(;;){if(f.tokens.next.id==="(end)")G("E027",f.tokens.next,e.line);else{if(f.tokens.next.id==="]"){K("W094",f.tokens.curr);break}f.tokens.next.id===","&&G("E028",f.tokens.next)}fn();if(f.tokens.next.id!==",")break;rt(",")}rt("]")}switch(f.tokens.next.id){case"{":e();break;case"[":t();break;case"true":case"false":case"null":case"(number)":case"(string)":rt();break;case"-":rt("-"),rt("(number)");break;default:G("E003",f.tokens.next)}}var e,t,n={"<":!0,"<=":!0,"==":!0,"===":!0,"!==":!0,"!=":!0,">":!0,">=":!0,"+":!0,"-":!0,"*":!0,"/":!0,"%":!0},h={asi:!0,bitwise:!0,boss:!0,browser:!0,camelcase:!0,couch:!0,curly:!0,debug:!0,devel:!0,dojo:!0,eqeqeq:!0,eqnull:!0,notypeof:!0,es3:!0,es5:!0,esnext:!0,moz:!0,evil:!0,expr:!0,forin:!0,funcscope:!0,globalstrict:!0,immed:!0,iterator:!0,jasmine:!0,jquery:!0,lastsemic:!0,laxbreak:!0,laxcomma:!0,loopfunc:!0,mootools:!0,multistr:!0,freeze:!0,newcap:!0,noarg:!0,node:!0,noempty:!0,nonbsp:!0,nonew:!0,nonstandard:!0,phantom:!0,plusplus:!0,proto:!0,prototypejs:!0,qunit:!0,rhino:!0,shelljs:!0,typed:!0,undef:!0,scripturl:!0,strict:!0,sub:!0,supernew:!0,validthis:!0,withstmt:!0,worker:!0,wsh:!0,yui:!0,mocha:!0,noyield:!0,onecase:!0,regexp:!0,regexdash:!0},p={maxlen:!1,indent:!1,maxerr:!1,predef:!1,globals:!1,quotmark:!1,scope:!1,maxstatements:!1,maxdepth:!1,maxparams:!1,maxcomplexity:!1,shadow:!1,unused:!0,latedef:!1,ignore:!1},d={bitwise:!0,forin:!0,newcap:!0,plusplus:!0,regexp:!0,undef:!0,eqeqeq:!0,strict:!0},v={eqeq:"eqeqeq",windows:"wsh",sloppy:"strict"},m={nomen:!0,onevar:!0,passfail:!0,white:!0,gcl:!0,smarttabs:!0,trailing:!0},g,y,b=["closure","exception","global","label","outer","unused","var"],w,E,S,x,T,N,C,k,L,A,O,M,D,P,H,B,j=[],F=new i.EventEmitter;gt("(number)",function(){return this}),gt("(string)",function(){return this}),gt("(template)",function(){return this}),f.syntax["(identifier)"]={type:"(identifier)",lbp:0,identifier:!0,nud:function(){var t=this.value,n=D[t],r,i;typeof n=="function"?n=undefined:!w["(blockscope)"].current.has(t)&&typeof n=="boolean"&&(r=w,w=E[0],et(t,{type:"var"}),n=w,w=r),i=w["(blockscope)"].getlabel(t);if(w===n||i)switch(i?i[t]["(type)"]:w[t]){case"unused":i?i[t]["(type)"]="var":w[t]="var";break;case"unction":i?i[t]["(type)"]="function":w[t]="function",this["function"]=!0;break;case"const":Xt(w,t,{unused:!1});break;case"function":this["function"]=!0;break;case"label":K("W037",f.tokens.curr,t)}else if(w["(global)"])typeof M[t]!="boolean"&&(e!=="typeof"&&e!=="delete"||f.tokens.next&&(f.tokens.next.value==="."||f.tokens.next.value==="["))&&(w["(comparray)"].check(t)||$(w,"W117",f.tokens.curr,t)),qt(f.tokens.curr);else switch(w[t]){case"closure":case"function":case"var":case"unused":K("W038",f.tokens.curr,t);break;case"label":K("W037",f.tokens.curr,t);break;case"outer":case"global":break;default:if(n===!0)w[t]=!0;else if(n===null)K("W039",f.tokens.curr,t),qt(f.tokens.curr);else if(typeof n!="object")(e!=="typeof"&&e!=="delete"||f.tokens.next&&(f.tokens.next.value==="."||f.tokens.next.value==="["))&&$(w,"W117",f.tokens.curr,t),w[t]=!0,qt(f.tokens.curr);else switch(n[t]){case"function":case"unction":this["function"]=!0,n[t]="closure",w[t]=n["(global)"]?"global":"outer";break;case"var":case"unused":n[t]="closure",w[t]=n["(global)"]?"global":"outer";break;case"const":Xt(n,t,{unused:!1});break;case"closure":w[t]=n["(global)"]?"global":"outer";break;case"label":K("W037",f.tokens.curr,t)}}return this},led:function(){G("E033",f.tokens.next,f.tokens.next.value)}},gt("(regexp)",function(){return this}),ht("(endline)"),ht("(begin)"),ht("(end)").reach=!0,ht("(error)").reach=!0,ht("}").reach=!0,ht(")"),ht("]"),ht('"').reach=!0,ht("'").reach=!0,ht(";"),ht(":").reach=!0,ht("#"),yt("else"),yt("case").reach=!0,yt("catch"),yt("default").reach=!0,yt("finally"),wt("arguments",function(e){f.directive["use strict"]&&w["(global)"]&&K("E008",e)}),wt("eval"),wt("false"),wt("Infinity"),wt("null"),wt("this",function(e){f.directive["use strict"]&&!f.option.validthis&&(w["(statement)"]&&w["(name)"].charAt(0)>"Z"||w["(global)"])&&K("W040",e)}),wt("true"),wt("undefined"),kt("=","assign",20),kt("+=","assignadd",20),kt("-=","assignsub",20),kt("*=","assignmult",20),kt("/=","assigndiv",20).nud=function(){G("E014")},kt("%=","assignmod",20),At("&=","assignbitand",20),At("|=","assignbitor",20),At("^=","assignbitxor",20),At("<<=","assignshiftleft",20),At(">>=","assignshiftright",20),At(">>>=","assignshiftrightunsigned",20),Et(",",function(e,t){var n;t.exprs=[e];if(!lt({peek:!0}))return t;for(;;){if(!(n=ot(10)))break;t.exprs.push(n);if(f.tokens.next.value!==","||!lt())break}return t},10,!0),Et("?",function(e,t){return Qt(),t.left=e,t.right=ot(10),rt(":"),t["else"]=ot(10),t},30);var Rt=40;Et("||",function(e,t){return Qt(),t.left=e,t.right=ot(Rt),t},Rt),Et("&&","and",50),Lt("|","bitor",70),Lt("^","bitxor",80),Lt("&","bitand",90),xt("==",function(e,t){var n=f.option.eqnull&&(e.value==="null"||t.value==="null");switch(!0){case!n&&f.option.eqeqeq:this.from=this.character,K("W116",this,"===","==");break;case Tt(e):K("W041",this,"===",e.value);break;case Tt(t):K("W041",this,"===",t.value);break;case Nt(t,e):K("W122",this,t.value);break;case Nt(e,t):K("W122",this,e.value)}return this}),xt("===",function(e,t){return Nt(t,e)?K("W122",this,t.value):Nt(e,t)&&K("W122",this,e.value),this}),xt("!=",function(e,t){var n=f.option.eqnull&&(e.value==="null"||t.value==="null");return!n&&f.option.eqeqeq?(this.from=this.character,K("W116",this,"!==","!=")):Tt(e)?K("W041",this,"!==",e.value):Tt(t)?K("W041",this,"!==",t.value):Nt(t,e)?K("W122",this,t.value):Nt(e,t)&&K("W122",this,e.value),this}),xt("!==",function(e,t){return Nt(t,e)?K("W122",this,t.value):Nt(e,t)&&K("W122",this,e.value),this}),xt("<"),xt(">"),xt("<="),xt(">="),Lt("<<","shiftleft",120),Lt(">>","shiftright",120),Lt(">>>","shiftrightunsigned",120),Et("in","in",120),Et("instanceof","instanceof",120),Et("+",function(e,t){var n=ot(130);return e&&n&&e.id==="(string)"&&n.id==="(string)"?(e.value+=n.value,e.character=n.character,!f.option.scripturl&&a.javascriptURL.test(e.value)&&K("W050",e),e):(t.left=e,t.right=n,t)},130),mt("+","num"),mt("+++",function(){return K("W007"),this.right=ot(150),this.arity="unary",this}),Et("+++",function(e){return K("W007"),this.left=e,this.right=ot(130),this},130),Et("-","sub",130),mt("-","neg"),mt("---",function(){return K("W006"),this.right=ot(150),this.arity="unary",this}),Et("---",function(e){return K("W006"),this.left=e,this.right=ot(130),this},130),Et("*","mult",140),Et("/","div",140),Et("%","mod",140),Ot("++","postinc"),mt("++","preinc"),f.syntax["++"].exps=!0,Ot("--","postdec"),mt("--","predec"),f.syntax["--"].exps=!0,mt("delete",function(){var e=ot(10);return(!e||e.id!=="."&&e.id!=="[")&&K("W051"),this.first=e,this}).exps=!0,mt("~",function(){return f.option.bitwise&&K("W052",this,"~"),ot(150),this}),mt("...",function(){return f.option.inESNext()||K("W104",this,"spread/rest operator"),f.tokens.next.identifier||G("E030",f.tokens.next,f.tokens.next.value),ot(150),this}),mt("!",function(){return this.right=ot(150),this.arity="unary",this.right||V("E041",this.line||0),n[this.right.id]===!0&&K("W018",this,"!"),this}),mt("typeof","typeof"),mt("new",function(){var e=ot(155),t;if(e&&e.id!=="function")if(e.identifier){e["new"]=!0;switch(e.value){case"Number":case"String":case"Boolean":case"Math":case"JSON":K("W053",f.tokens.prev,e.value);break;case"Function":f.option.evil||K("W054");break;case"Date":case"RegExp":case"this":break;default:e.id!=="function"&&(t=e.value.substr(0,1),f.option.newcap&&(t<"A"||t>"Z")&&!r.has(S,e.value)&&K("W055",f.tokens.curr))}}else e.id!=="."&&e.id!=="["&&e.id!=="("&&K("W056",f.tokens.curr);else f.option.supernew||K("W057",this);return f.tokens.next.id!=="("&&!f.option.supernew&&K("W058",f.tokens.curr,f.tokens.curr.value),this.first=e,this}),f.syntax["new"].exps=!0,mt("void").exps=!0,Et(".",function(e,t){var n=_t(!1,!0);return typeof n=="string"&&It(n),t.left=e,t.right=n,n&&n==="hasOwnProperty"&&f.tokens.next.value==="="&&K("W001"),!e||e.value!=="arguments"||n!=="callee"&&n!=="caller"?!f.option.evil&&e&&e.value==="document"&&(n==="write"||n==="writeln")&&K("W060",e):f.option.noarg?K("W059",e,n):f.directive["use strict"]&&G("E008"),!f.option.evil&&(n==="eval"||n==="execScript")&&K("W061"),t},160,!0),Et("(",function(e,t){f.option.immed&&e&&!e.immed&&e.id==="function"&&K("W062");var n=0,r=[];e&&e.type==="(identifier)"&&e.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)&&"Number String Boolean Date Object Error".indexOf(e.value)===-1&&(e.value==="Math"?K("W063",e):f.option.newcap&&K("W064",e));if(f.tokens.next.id!==")")for(;;){r[r.length]=ot(10),n+=1;if(f.tokens.next.id!==",")break;lt()}return rt(")"),typeof e=="object"&&(f.option.inES3()&&e.value==="parseInt"&&n===1&&K("W065",f.tokens.curr),f.option.evil||(e.value==="eval"||e.value==="Function"||e.value==="execScript"?(K("W061",e),r[0]&&[0].id==="(string)"&&Z(e,r[0].value)):!r[0]||r[0].id!=="(string)"||e.value!=="setTimeout"&&e.value!=="setInterval"?r[0]&&r[0].id==="(string)"&&e.value==="."&&e.left.value==="window"&&(e.right==="setTimeout"||e.right==="setInterval")&&(K("W066",e),Z(e,r[0].value)):(K("W066",e),Z(e,r[0].value))),!e.identifier&&e.id!=="."&&e.id!=="["&&e.id!=="("&&e.id!=="&&"&&e.id!=="||"&&e.id!=="?"&&K("W067",e)),t.left=e,t},155,!0).exps=!0,mt("(",function(){var e,t=[],n,i,s=0,o,u=1;do n=nt(s),n.value==="("?u+=1:n.value===")"&&(u-=1),s+=1,i=nt(s);while((u!==0||n.value!==")")&&i.value!=="=>"&&i.value!==";"&&i.type!=="(end)");f.tokens.next.id==="function"&&(f.tokens.next.immed=!0);var a=[];if(f.tokens.next.id!==")")for(;;){if(i.value==="=>"&&r.contains(["{","["],f.tokens.next.value)){e=f.tokens.next,e.left=Yt(),t.push(e);for(var l in e.left)a.push(e.left[l].token)}else a.push(ot(10));if(f.tokens.next.id!==",")break;lt()}rt(")",this),f.option.immed&&a[0]&&a[0].id==="function"&&f.tokens.next.id!=="("&&(f.tokens.next.id!=="."||nt().value!=="call"&&nt().value!=="apply")&&K("W068",this);if(f.tokens.next.value==="=>")return a;if(!a.length)return;return a.length>1?(o=Object.create(f.syntax[","]),o.exprs=a):o=a[0],o&&(o.paren=!0),o}),St("=>"),Et("[",function(e,t){var n=ot(10),r;return n&&n.type==="(string)"&&(!f.option.evil&&(n.value==="eval"||n.value==="execScript")&&K("W061",t),It(n.value),!f.option.sub&&a.identifier.test(n.value)&&(r=f.syntax[n.value],(!r||!U(r))&&K("W069",f.tokens.prev,n.value))),rt("]",t),n&&n.value==="hasOwnProperty"&&f.tokens.next.value==="="&&K("W001"),t.left=e,t.right=n,t},160,!0),mt("[",function(){var e=on(!0);if(e.isCompArray)return f.option.inESNext()||K("W119",f.tokens.curr,"array comprehension"),Ut();e.isDestAssign&&!f.option.inESNext()&&K("W104",f.tokens.curr,"destructuring assignment");var t=f.tokens.curr.line!==f.tokens.next.line;this.first=[],t&&(N+=f.option.indent,f.tokens.next.from===N+f.option.indent&&(N+=f.option.indent));while(f.tokens.next.id!=="(end)"){while(f.tokens.next.id===",")f.option.inES5()||K("W070"),rt(",");if(f.tokens.next.id==="]")break;this.first.push(ot(10));if(f.tokens.next.id!==",")break;lt({allowTrailing:!0});if(f.tokens.next.id==="]"&&!f.option.inES5(!0)){K("W070",f.tokens.curr);break}}return t&&(N-=f.option.indent),rt("]",this),this},160),function(e){e.nud=function(e){function c(e,t){a[e]&&r.has(a,e)?K("W075",f.tokens.next,i):a[e]={},a[e].basic=!0,a[e].basictkn=t}function h(e,t){a[e]&&r.has(a,e)?(a[e].basic||a[e].setter)&&K("W075",f.tokens.next,i):a[e]={},a[e].setter=!0,a[e].setterToken=t}function p(e){a[e]&&r.has(a,e)?(a[e].basic||a[e].getter)&&K("W075",f.tokens.next,i):a[e]={},a[e].getter=!0,a[e].getterToken=f.tokens.curr}var t,n,i,s,o,u,a={},l="";t=f.tokens.curr.line!==f.tokens.next.line,t&&(N+=f.option.indent,f.tokens.next.from===N+f.option.indent&&(N+=f.option.indent));for(;;){if(f.tokens.next.id==="}")break;e&&f.tokens.next.value==="static"&&(rt("static"),l="static ");if(f.tokens.next.value==="get"&&nt().id!==":")rt("get"),f.option.inES5(!e)||G("E034"),i=zt(),!i&&!f.option.inESNext()&&G("E035"),e&&i==="constructor"&&G("E049",f.tokens.next,"class getter method",i),i&&p(l+i),o=f.tokens.next,n=Jt(),s=n["(params)"],i&&s&&K("W076",o,s[0],i);else if(f.tokens.next.value==="set"&&nt().id!==":")rt("set"),f.option.inES5(!e)||G("E034"),i=zt(),!i&&!f.option.inESNext()&&G("E035"),e&&i==="constructor"&&G("E049",f.tokens.next,"class setter method",i),i&&h(l+i,f.tokens.next),o=f.tokens.next,n=Jt(),s=n["(params)"],i&&(!s||s.length!==1)&&K("W077",o,i);else{u=!1,f.tokens.next.value==="*"&&f.tokens.next.type==="(punctuator)"&&(f.option.inESNext()||K("W104",f.tokens.next,"generator functions"),rt("*"),u=!0),i=zt(),c(l+i,f.tokens.next);if(typeof i!="string")break;f.tokens.next.value==="("?(f.option.inESNext()||K("W104",f.tokens.curr,"concise methods"),Jt(i,undefined,u)):e||(rt(":"),ot(10))}e&&i==="prototype"&&G("E049",f.tokens.next,"class method",i),It(i);if(e){l="";continue}if(f.tokens.next.id!==",")break;lt({allowTrailing:!0,property:!0}),f.tokens.next.id===","?K("W070",f.tokens.curr):f.tokens.next.id==="}"&&!f.option.inES5(!0)&&K("W070",f.tokens.curr)}t&&(N-=f.option.indent),rt("}",this);if(f.option.inES5())for(var d in a)r.has(a,d)&&a[d].setter&&!a[d].getter&&K("W078",a[d].setterToken);return this},e.fud=function(){G("E036",f.tokens.curr)}}(ht("{"));var en=pt("const",function(e){var t,n,i;f.option.inESNext()||K("W104",f.tokens.curr,"const"),this.first=[];for(;;){var s=[];r.contains(["{","["],f.tokens.next.value)?(t=Yt(),i=!1):(t=[{id:_t(),token:f.tokens.curr}],i=!0);for(var o in t)t.hasOwnProperty(o)&&(o=t[o],w[o.id]==="const"&&K("E011",null,o.id),w["(global)"]&&M[o.id]===!1&&K("W079",o.token,o.id),o.id&&(et(o.id,{token:o.token,type:"const",unused:!0}),s.push(o.token)));if(e)break;this.first=this.first.concat(s),f.tokens.next.id!=="="&&K("E012",f.tokens.curr,f.tokens.curr.value),f.tokens.next.id==="="&&(rt("="),f.tokens.next.id==="undefined"&&K("W080",f.tokens.prev,f.tokens.prev.value),nt(0).id==="="&&f.tokens.next.identifier&&K("W120",f.tokens.next,f.tokens.next.value),n=ot(10),i?t[0].first=n:Zt(s,n));if(f.tokens.next.id!==",")break;lt()}return this});en.exps=!0;var tn=pt("var",function(e){var t,n,i;this.first=[];for(;;){var s=[];r.contains(["{","["],f.tokens.next.value)?(t=Yt(),n=!1):(t=[{id:_t(),token:f.tokens.curr}],n=!0);for(var o in t)t.hasOwnProperty(o)&&(o=t[o],f.option.inESNext()&&w[o.id]==="const"&&K("E011",null,o.id),w["(global)"]&&M[o.id]===!1&&K("W079",o.token,o.id),o.id&&(et(o.id,{type:"unused",token:o.token}),s.push(o.token)));if(e)break;this.first=this.first.concat(s),f.tokens.next.id==="="&&(rt("="),f.tokens.next.id==="undefined"&&K("W080",f.tokens.prev,f.tokens.prev.value),nt(0).id==="="&&f.tokens.next.identifier&&K("W120",f.tokens.next,f.tokens.next.value),i=ot(10),n?t[0].first=i:Zt(s,i));if(f.tokens.next.id!==",")break;lt()}return this});tn.exps=!0;var nn=pt("let",function(e){var t,n,i,s;f.option.inESNext()||K("W104",f.tokens.curr,"let"),f.tokens.next.value==="("?(f.option.inMoz(!0)||K("W118",f.tokens.next,"let block"),rt("("),w["(blockscope)"].stack(),s=!0):w["(nolet)"]&&G("E048",f.tokens.curr),this.first=[];for(;;){var o=[];r.contains(["{","["],f.tokens.next.value)?(t=Yt(),n=!1):(t=[{id:_t(),token:f.tokens.curr.value}],n=!0);for(var u in t)t.hasOwnProperty(u)&&(u=t[u],f.option.inESNext()&&w[u.id]==="const"&&K("E011",null,u.id),w["(global)"]&&M[u.id]===!1&&K("W079",u.token,u.id),u.id&&!w["(nolet)"]&&(et(u.id,{type:"unused",token:u.token,islet:!0}),o.push(u.token)));if(e)break;this.first=this.first.concat(o),f.tokens.next.id==="="&&(rt("="),f.tokens.next.id==="undefined"&&K("W080",f.tokens.prev,f.tokens.prev.value),nt(0).id==="="&&f.tokens.next.identifier&&K("W120",f.tokens.next,f.tokens.next.value),i=ot(10),n?t[0].first=i:Zt(o,i));if(f.tokens.next.id!==",")break;lt()}return s&&(rt(")"),Ft(!0,!0),this.block=!0,w["(blockscope)"].unstack()),this});nn.exps=!0,dt("class",function(){return rn.call(this,!0)}),dt("function",function(){var e=!1;f.tokens.next.value==="*"&&(rt("*"),f.option.inESNext(!0)?e=!0:K("W119",f.tokens.curr,"function*")),T&&K("W082",f.tokens.curr);var t=_t();return w[t]==="const"&&K("E011",null,t),et(t,{type:"unction",token:f.tokens.curr}),Jt(t,{statement:!0},e),f.tokens.next.id==="("&&f.tokens.next.line===f.tokens.curr.line&&G("E039"),this}),mt("function",function(){var e=!1;f.tokens.next.value==="*"&&(f.option.inESNext()||K("W119",f.tokens.curr,"function*"),rt("*"),e=!0);var t=Mt();return Jt(t,undefined,e),!f.option.loopfunc&&w["(loopage)"]&&K("W083"),this}),dt("if",function(){var e=f.tokens.next;return Qt(),f.condition=!0,rt("("),Gt(ot(0)),rt(")",e),f.condition=!1,Ft(!0,!0),f.tokens.next.id==="else"&&(rt("else"),f.tokens.next.id==="if"||f.tokens.next.id==="switch"?Ht(!0):Ft(!0,!0)),this}),dt("try",function(){function t(){var e=D,t;rt("catch"),rt("("),D=Object.create(e),t=f.tokens.next.value,f.tokens.next.type!=="(identifier)"&&(t=null,K("E030",f.tokens.next,t)),rt(),w=$t("(catch)",f.tokens.next,D,{"(context)":w,"(breakage)":w["(breakage)"],"(loopage)":w["(loopage)"],"(statement)":!1,"(catch)":!0}),t&&et(t,{type:"exception"}),f.tokens.next.value==="if"&&(f.option.inMoz(!0)||K("W118",f.tokens.curr,"catch filter"),rt("if"),ot(0)),rt(")"),f.tokens.curr.funct=w,E.push(w),Ft(!1),D=e,w["(last)"]=f.tokens.curr.line,w["(lastcharacter)"]=f.tokens.curr.character,w=w["(context)"]}var e;Ft(!0);while(f.tokens.next.id==="catch")Qt(),e&&!f.option.inMoz(!0)&&K("W118",f.tokens.next,"multiple catch blocks"),t(),e=!0;if(f.tokens.next.id==="finally"){rt("finally"),Ft(!0);return}return e||G("E021",f.tokens.next,"catch",f.tokens.next.value),this}),dt("while",function(){var e=f.tokens.next;return w["(breakage)"]+=1,w["(loopage)"]+=1,Qt(),rt("("),Gt(ot(0)),rt(")",e),Ft(!0,!0),w["(breakage)"]-=1,w["(loopage)"]-=1,this}).labelled=!0,dt("with",function(){var e=f.tokens.next;return f.directive["use strict"]?G("E010",f.tokens.curr):f.option.withstmt||K("W085",f.tokens.curr),rt("("),ot(0),rt(")",e),Ft(!0,!0),this}),dt("switch",function(){var e=f.tokens.next,t=!1,n=!1;w["(breakage)"]+=1,rt("("),Gt(ot(0)),rt(")",e),e=f.tokens.next,rt("{"),f.tokens.next.from===N&&(n=!0),n||(N+=f.option.indent),this.cases=[];for(;;)switch(f.tokens.next.id){case"case":switch(w["(verb)"]){case"yield":case"break":case"case":case"continue":case"return":case"switch":case"throw":break;default:a.fallsThrough.test(f.lines[f.tokens.next.line-2])||K("W086",f.tokens.curr,"case")}rt("case"),this.cases.push(ot(0)),Qt(),t=!0,rt(":"),w["(verb)"]="case";break;case"default":switch(w["(verb)"]){case"yield":case"break":case"continue":case"return":case"throw":break;default:this.cases.length&&(a.fallsThrough.test(f.lines[f.tokens.next.line-2])||K("W086",f.tokens.curr,"default"))}rt("default"),t=!0,rt(":");break;case"}":n||(N-=f.option.indent),rt("}",e),w["(breakage)"]-=1,w["(verb)"]=undefined;return;case"(end)":G("E023",f.tokens.next,"}");return;default:N+=f.option.indent;if(t)switch(f.tokens.curr.id){case",":G("E040");return;case":":t=!1,Bt();break;default:G("E025",f.tokens.curr);return}else{if(f.tokens.curr.id!==":"){G("E021",f.tokens.next,"case",f.tokens.next.value);return}rt(":"),G("E024",f.tokens.curr,":"),Bt()}N-=f.option.indent}}).labelled=!0,pt("debugger",function(){return f.option.debug||K("W087",this),this}).exps=!0,function(){var e=pt("do",function(){w["(breakage)"]+=1,w["(loopage)"]+=1,Qt(),this.first=Ft(!0,!0),rt("while");var e=f.tokens.next;return rt("("),Gt(ot(0)),rt(")",e),w["(breakage)"]-=1,w["(loopage)"]-=1,this});e.labelled=!0,e.exps=!0}(),dt("for",function(){var e,t=f.tokens.next,n=!1,i=null;t.value==="each"&&(i=t,rt("each"),f.option.inMoz(!0)||K("W118",f.tokens.curr,"for each")),w["(breakage)"]+=1,w["(loopage)"]+=1,Qt(),rt("(");var s,o=0,u=["in","of"];do s=nt(o),++o;while(!r.contains(u,s.value)&&s.value!==";"&&s.type!=="(end)");if(r.contains(u,s.value)){!f.option.inESNext()&&s.value==="of"&&G("W104",s,"for of");if(f.tokens.next.id==="var")rt("var"),f.syntax["var"].fud.call(f.syntax["var"].fud,!0);else if(f.tokens.next.id==="let")rt("let"),n=!0,w["(blockscope)"].stack(),f.syntax.let.fud.call(f.syntax.let.fud,!0);else if(!f.tokens.next.identifier)G("E030",f.tokens.next,f.tokens.next.type),rt();else{switch(w[f.tokens.next.value]){case"unused":w[f.tokens.next.value]="var";break;case"var":break;default:w["(blockscope)"].getlabel(f.tokens.next.value)||K("W088",f.tokens.next,f.tokens.next.value)}rt()}rt(s.value),ot(20),rt(")",t),e=Ft(!0,!0),f.option.forin&&e&&(e.length>1||typeof e[0]!="object"||e[0].value!=="if")&&K("W089",this),w["(breakage)"]-=1,w["(loopage)"]-=1}else{i&&G("E045",i);if(f.tokens.next.id!==";")if(f.tokens.next.id==="var")rt("var"),f.syntax["var"].fud.call(f.syntax["var"].fud);else if(f.tokens.next.id==="let")rt("let"),n=!0,w["(blockscope)"].stack(),f.syntax.let.fud.call(f.syntax.let.fud);else for(;;){ot(0,"for");if(f.tokens.next.id!==",")break;lt()}at(f.tokens.curr),rt(";"),f.tokens.next.id!==";"&&Gt(ot(0)),at(f.tokens.curr),rt(";"),f.tokens.next.id===";"&&G("E021",f.tokens.next,")",";");if(f.tokens.next.id!==")")for(;;){ot(0,"for");if(f.tokens.next.id!==",")break;lt()}rt(")",t),Ft(!0,!0),w["(breakage)"]-=1,w["(loopage)"]-=1}return n&&w["(blockscope)"].unstack(),this}).labelled=!0,pt("break",function(){var e=f.tokens.next.value;return w["(breakage)"]===0&&K("W052",f.tokens.next,this.value),f.option.asi||at(this),f.tokens.next.id!==";"&&!f.tokens.next.reach&&f.tokens.curr.line===f.tokens.next.line&&(w[e]!=="label"?K("W090",f.tokens.next,e):D[e]!==w&&K("W091",f.tokens.next,e),this.first=f.tokens.next,rt()),Dt("break"),this}).exps=!0,pt("continue",function(){var e=f.tokens.next.value;return w["(breakage)"]===0&&K("W052",f.tokens.next,this.value),f.option.asi||at(this),f.tokens.next.id!==";"&&!f.tokens.next.reach?f.tokens.curr.line===f.tokens.next.line&&(w[e]!=="label"?K("W090",f.tokens.next,e):D[e]!==w&&K("W091",f.tokens.next,e),this.first=f.tokens.next,rt()):w["(loopage)"]||K("W052",f.tokens.next,this.value),Dt("continue"),this}).exps=!0,pt("return",function(){return this.line===f.tokens.next.line?f.tokens.next.id!==";"&&!f.tokens.next.reach&&(this.first=ot(0),this.first&&this.first.type==="(punctuator)"&&this.first.value==="="&&!this.first.paren&&!f.option.boss&&Q("W093",this.first.line,this.first.character)):f.tokens.next.type==="(punctuator)"&&["[","{","+","-"].indexOf(f.tokens.next.value)>-1&&at(this),Dt("return"),this}).exps=!0,function(e){e.exps=!0,e.lbp=25}(mt("yield",function(){var e=f.tokens.prev;return f.option.inESNext(!0)&&!w["(generator)"]?("(catch)"!==w["(name)"]||!w["(context)"]["(generator)"])&&G("E046",f.tokens.curr,"yield"):f.option.inESNext()||K("W104",f.tokens.curr,"yield"),w["(generator)"]="yielded",this.line===f.tokens.next.line||!f.option.inMoz(!0)?(f.tokens.next.id!==";"&&!f.tokens.next.reach&&f.tokens.next.nud&&(ut(f.tokens.curr,f.tokens.next),this.first=ot(10),this.first.type==="(punctuator)"&&this.first.value==="="&&!this.first.paren&&!f.option.boss&&Q("W093",this.first.line,this.first.character)),f.option.inMoz(!0)&&f.tokens.next.id!==")"&&(e.lbp>30||!e.assign&&!st()||e.id==="yield")&&G("E050",this)):f.option.asi||at(this),this})),pt("throw",function(){return at(this),this.first=ot(20),Dt("throw"),this}).exps=!0,pt("import",function(){f.option.inESNext()||K("W119",f.tokens.curr,"import");if(f.tokens.next.type==="(string)")return rt("(string)"),this;if(f.tokens.next.identifier)this.name=_t(),et(this.name,{type:"unused",token:f.tokens.curr});else{rt("{");for(;;){if(f.tokens.next.value==="}"){rt("}");break}var e;f.tokens.next.type==="default"?(e="default",rt("default")):e=_t(),f.tokens.next.value==="as"&&(rt("as"),e=_t()),et(e,{type:"unused",token:f.tokens.curr});if(f.tokens.next.value!==","){if(f.tokens.next.value==="}"){rt("}");break}G("E024",f.tokens.next,f.tokens.next.value);break}rt(",")}}return rt("from"),rt("(string)"),this}).exps=!0,pt("export",function(){f.option.inESNext()||K("W119",f.tokens.curr,"export");if(f.tokens.next.type==="default"){rt("default");if(f.tokens.next.id==="function"||f.tokens.next.id==="class")this.block=!0;return this.exportee=ot(10),this}if(f.tokens.next.value==="{"){rt("{");for(;;){y[_t()]=!0;if(f.tokens.next.value!==","){if(f.tokens.next.value==="}"){rt("}");break}G("E024",f.tokens.next,f.tokens.next.value);break}rt(",")}return this}return f.tokens.next.id==="var"?(rt("var"),y[f.tokens.next.value]=!0,f.syntax["var"].fud.call(f.syntax["var"].fud)):f.tokens.next.id==="let"?(rt("let"),y[f.tokens.next.value]=!0,f.syntax.let.fud.call(f.syntax.let.fud)):f.tokens.next.id==="const"?(rt("const"),y[f.tokens.next.value]=!0,f.syntax["const"].fud.call(f.syntax["const"].fud)):f.tokens.next.id==="function"?(this.block=!0,rt("function"),y[f.tokens.next.value]=!0,f.syntax["function"].fud()):f.tokens.next.id==="class"?(this.block=!0,rt("class"),y[f.tokens.next.value]=!0,f.syntax["class"].fud()):G("E024",f.tokens.next,f.tokens.next.value),this}).exps=!0,bt("abstract"),bt("boolean"),bt("byte"),bt("char"),bt("class",{es5:!0,nud:rn}),bt("double"),bt("enum",{es5:!0}),bt("export",{es5:!0}),bt("extends",{es5:!0}),bt("final"),bt("float"),bt("goto"),bt("implements",{es5:!0,strictOnly:!0}),bt("import",{es5:!0}),bt("int"),bt("interface",{es5:!0,strictOnly:!0}),bt("long"),bt("native"),bt("package",{es5:!0,strictOnly:!0}),bt("private",{es5:!0,strictOnly:!0}),bt("protected",{es5:!0,strictOnly:!0}),bt("public",{es5:!0,strictOnly:!0}),bt("short"),bt("static",{es5:!0,strictOnly:!0}),bt("super",{es5:!0}),bt("synchronized"),bt("transient"),bt("volatile");var on=function(){var e,t,n=-1,i=0,s={};r.contains(["[","{"],f.tokens.curr.value)&&(i+=1);do{e=n===-1?f.tokens.next:nt(n),t=nt(n+1),n+=1,r.contains(["[","{"],e.value)?i+=1:r.contains(["]","}"],e.value)&&(i-=1);if(e.identifier&&e.value==="for"&&i===1){s.isCompArray=!0,s.notJson=!0;break}if(r.contains(["}","]"],e.value)&&t.value==="="&&i===0){s.isDestAssign=!0,s.notJson=!0;break}e.value===";"&&(s.isBlock=!0,s.notJson=!0)}while(i>0&&e.id!=="(end)"&&n<15);return s},an=function(){function i(e){var t=n.variables.filter(function(t){if(t.value===e)return t.undef=!1,e}).length;return t!==0}function s(e){var t=n.variables.filter(function(t){if(t.value===e&&!t.undef)return t.unused===!0&&(t.unused=!1),e}).length;return t===0}var e=function(){this.mode="use",this.variables=[]},t=[],n;return{stack:function(){n=new e,t.push(n)},unstack:function(){n.variables.filter(function(e){e.unused&&K("W098",e.token,e.value),e.undef&&$(e.funct,"W117",e.token,e.value)}),t.splice(-1,1),n=t[t.length-1]},setState:function(e){r.contains(["use","define","generate","filter"],e)&&(n.mode=e)},check:function(e){if(!n)return;return n&&n.mode==="use"?(s(e)&&n.variables.push({funct:w,token:f.tokens.curr,value:e,undef:!0,unused:!1}),!0):n&&n.mode==="define"?(i(e)||n.variables.push({funct:w,token:f.tokens.curr,value:e,undef:!1,unused:!0}),!0):n&&n.mode==="generate"?($(w,"W117",f.tokens.curr,e),!0):n&&n.mode==="filter"?(s(e)&&$(w,"W117",f.tokens.curr,e),!0):!1}}},ln=function(){function n(){for(var t in e)if(e[t]["(type)"]==="unused"&&f.option.unused){var n=e[t]["(token)"],r=n.line,i=n.character;Q("W098",r,i,t)}}var e={},t=[e];return{stack:function(){e={},t.push(e)},unstack:function(){n(),t.splice(t.length-1,1),e=r.last(t)},getlabel:function(e){for(var n=t.length-1;n>=0;--n)if(r.has(t[n],e)&&!t[n][e]["(shadowed)"])return t[n]},shadow:function(e){for(var n=t.length-1;n>=0;n--)r.has(t[n],e)&&(t[n][e]["(shadowed)"]=!0)},unshadow:function(e){for(var n=t.length-1;n>=0;n--)r.has(t[n],e)&&(t[n][e]["(shadowed)"]=!1)},current:{has:function(t){return r.has(e,t)},add:function(t,n,r){e[t]={"(type)":n,"(token)":r,"(shadowed)":!1}}}}},cn=function(e,n,i){function v(e,t){if(!e)return;!Array.isArray(e)&&typeof e=="object"&&(e=Object.keys(e)),e.forEach(t)}var o,a,l,h,p={},d={};n=r.clone(n),f.reset(),n&&n.scope?c.scope=n.scope:(c.errors=[],c.undefs=[],c.internals=[],c.blacklist={},c.scope="(main)"),M=Object.create(null),W(M,s.ecmaIdentifiers),W(M,s.reservedVars),W(M,i||{}),g=Object.create(null),y=Object.create(null);if(n){v(n.predef||null,function(e){var t,r;e[0]==="-"?(t=e.slice(1),c.blacklist[t]=t):(r=Object.getOwnPropertyDescriptor(n.predef,e),M[e]=r?r.value:!1)}),v(n.exported||null,function(e){y[e]=!0}),delete n.predef,delete n.exported,h=Object.keys(n);for(l=0;l<h.length;l++)/^-W\d{3}$/g.test(h[l])?d[h[l].slice(1)]=!0:(p[h[l]]=n[h[l]],h[l]==="newcap"&&n[h[l]]===!1&&(p["(explicitNewcap)"]=!0))}f.option=p,f.ignored=d,f.option.indent=f.option.indent||4,f.option.maxerr=f.option.maxerr||50,N=1,S=Object.create(M),D=S,w=$t("(global)",null,D,{"(global)":!0,"(blockscope)":ln(),"(comparray)":an(),"(metrics)":Kt(f.tokens.next)}),E=[w],B=[],P=null,L={},A=null,x={},T=!1,C=[],H=[];if(!q(e)&&!Array.isArray(e))return Y("E004",0),!1;t={get isJSON(){return f.jsonMode},getOption:function(e){return f.option[e]||null},getCache:function(e){return f.cache[e]},setCache:function(e,t){f.cache[e]=t},warn:function(e,t){Q.apply(null,[e,t.line,t.char].concat(t.data))},on:function(e,t){e.split(" ").forEach(function(e){F.on(e,t)}.bind(this))}},F.removeAllListeners(),(j||[]).forEach(function(e){e(t)}),f.tokens.prev=f.tokens.curr=f.tokens.next=f.syntax["(begin)"],k=new u(e),k.on("warning",function(e){Q.apply(null,[e.code,e.line,e.character].concat(e.data))}),k.on("error",function(e){Y.apply(null,[e.code,e.line,e.character].concat(e.data))}),k.on("fatal",function(e){V("E041",e.line,e.from)}),k.on("Identifier",function(e){F.emit("Identifier",e)}),k.on("String",function(e){F.emit("String",e)}),k.on("Number",function(e){F.emit("Number",e)}),k.start();for(var m in n)r.has(n,m)&&I(m,f.tokens.curr);X(),W(M,i||{}),lt.first=!0;try{rt();switch(f.tokens.next.id){case"{":case"[":un();break;default:jt(),f.directive["use strict"]&&!f.option.globalstrict&&!f.option.node&&!f.option.phantom&&K("W097",f.tokens.prev),Bt()}rt(f.tokens.next&&f.tokens.next.value!=="."?"(end)":undefined),w["(blockscope)"].unstack();var b=function(e,t){do{if(typeof t[e]=="string")return t[e]==="unused"?t[e]="var":t[e]==="unction"&&(t[e]="closure"),!0;t=t["(context)"]}while(t);return!1},O=function(e,t){if(!x[e])return;var n=[];for(var r=0;r<x[e].length;r+=1)x[e][r]!==t&&n.push(x[e][r]);n.length===0?delete x[e]:x[e]=n},R=function(e,t,n,r){var i=t.line,s=t.character;r===undefined&&(r=f.option.unused),r===!0&&(r="last-param");var o={vars:["var"],"last-param":["var","param"],strict:["var","param","last-param"]};r&&o[r]&&o[r].indexOf(n)!==-1&&Q("W098",i,s,e),H.push({name:e,line:i,character:s})},U=function(e,t){var n=e[t],i=e["(tokens)"][t];if(t.charAt(0)==="(")return;if(n!=="unused"&&n!=="unction"&&n!=="const")return;if(e["(params)"]&&e["(params)"].indexOf(t)!==-1)return;if(e["(global)"]&&r.has(y,t))return;if(n==="const"&&!Vt(e,t,"unused"))return;R(t,i,"var")};for(o=0;o<c.undefs.length;o+=1)a=c.undefs[o].slice(0),b(a[2].value,a[0])?O(a[2].value,a[2].line):f.option.undef&&K.apply(K,a.slice(1));E.forEach(function(e){if(e["(unusedOption)"]===!1)return;for(var t in e)r.has(e,t)&&U(e,t);if(!e["(params)"])return;var n=e["(params)"].slice(),i=n.pop(),s,o;while(i){s=e[i],o=e["(unusedOption)"]||f.option.unused,o=o===!0?"last-param":o;if(i==="undefined")return;if(s==="unused"||s==="unction")R(i,e["(tokens)"][i],"param",e["(unusedOption)"]);else if(o==="last-param")return;i=n.pop()}});for(var z in g)r.has(g,z)&&!r.has(S,z)&&!r.has(y,z)&&R(z,g[z],"var")}catch($){if(!$||$.name!=="JSHintError")throw $;var J=f.tokens.next||{};c.errors.push({scope:"(main)",raw:$.raw,code:$.code,reason:$.message,line:$.line||J.line,character:$.character||J.from},null)}if(c.scope==="(main)"){n=n||{};for(o=0;o<c.internals.length;o+=1)a=c.internals[o],n.scope=a.elem,cn(a.value,n,i)}return c.errors.length===0};return cn.addModule=function(e){j.push(e)},cn.addModule(l.register),cn.data=function(){var e={functions:[],options:f.option},t=[],n=[],i,s,o,u,a,l;cn.errors.length&&(e.errors=cn.errors),f.jsonMode&&(e.json=!0);for(a in x)r.has(x,a)&&t.push({name:a,line:x[a]});t.length>0&&(e.implieds=t),B.length>0&&(e.urls=B),l=Object.keys(D),l.length>0&&(e.globals=l);for(o=1;o<E.length;o+=1){s=E[o],i={};for(u=0;u<b.length;u+=1)i[b[u]]=[];for(u=0;u<b.length;u+=1)i[b[u]].length===0&&delete i[b[u]];i.name=s["(name)"],i.param=s["(params)"],i.line=s["(line)"],i.character=s["(character)"],i.last=s["(last)"],i.lastcharacter=s["(lastcharacter)"],i.metrics={complexity:s["(metrics)"].ComplexityCount,parameters:(s["(params)"]||[]).length,statements:s["(metrics)"].statementCount},e.functions.push(i)}H.length>0&&(e.unused=H),n=[];for(a in L)if(typeof L[a]=="number"){e.member=L;break}return e},cn.jshint=cn,cn}();typeof n=="object"&&n&&(n.JSHINT=c)},{"./lex.js":4,"./messages.js":5,"./reg.js":6,"./state.js":7,"./style.js":8,"./vars.js":9,events:10,underscore:2}],4:[function(e,t,n){"use strict";function c(){var e=[];return{push:function(t){e.push(t)},check:function(){for(var t=0;t<e.length;++t)e[t]();e.splice(0,e.length)}}}function h(e){var t=e;typeof t=="string"&&(t=t.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split("\n")),t[0]&&t[0].substr(0,2)==="#!"&&(t[0].indexOf("node")!==-1&&(o.option.node=!0),t[0]=""),this.emitter=new i.EventEmitter,this.source=e,this.setLines(t),this.prereg=!0,this.line=0,this.char=1,this.from=1,this.input="",this.inComment=!1;for(var n=0;n<o.option.indent;n+=1)o.tab+=" "}var r=e("underscore"),i=e("events"),s=e("./reg.js"),o=e("./state.js").state,u=e("../data/ascii-identifier-data.js"),a=u.asciiIdentifierStartTable,f=u.asciiIdentifierPartTable,l={Identifier:1,Punctuator:2,NumericLiteral:3,StringLiteral:4,Comment:5,Keyword:6,NullLiteral:7,BooleanLiteral:8,RegExp:9,TemplateLiteral:10};h.prototype={_lines:[],getLines:function(){return this._lines=o.lines,this._lines},setLines:function(e){this._lines=e,o.lines=this._lines},peek:function(e){return this.input.charAt(e||0)},skip:function(e){e=e||1,this.char+=e,this.input=this.input.slice(e)},on:function(e,t){e.split(" ").forEach(function(e){this.emitter.on(e,t)}.bind(this))},trigger:function(){this.emitter.emit.apply(this.emitter,Array.prototype.slice.call(arguments))},triggerAsync:function(e,t,n,r){n.push(function(){r()&&this.trigger(e,t)}.bind(this))},scanPunctuator:function(){var e=this.peek(),t,n,r;switch(e){case".":if(/^[0-9]$/.test(this.peek(1)))return null;if(this.peek(1)==="."&&this.peek(2)===".")return{type:l.Punctuator,value:"..."};case"(":case")":case";":case",":case"{":case"}":case"[":case"]":case":":case"~":case"?":return{type:l.Punctuator,value:e};case"#":return{type:l.Punctuator,value:e};case"":return null}return t=this.peek(1),n=this.peek(2),r=this.peek(3),e===">"&&t===">"&&n===">"&&r==="="?{type:l.Punctuator,value:">>>="}:e==="="&&t==="="&&n==="="?{type:l.Punctuator,value:"==="}:e==="!"&&t==="="&&n==="="?{type:l.Punctuator,value:"!=="}:e===">"&&t===">"&&n===">"?{type:l.Punctuator,value:">>>"}:e==="<"&&t==="<"&&n==="="?{type:l.Punctuator,value:"<<="}:e===">"&&t===">"&&n==="="?{type:l.Punctuator,value:">>="}:e==="="&&t===">"?{type:l.Punctuator,value:e+t}:e===t&&"+-<>&|".indexOf(e)>=0?{type:l.Punctuator,value:e+t}:"<>=!+-*%&|^".indexOf(e)>=0?t==="="?{type:l.Punctuator,value:e+t}:{type:l.Punctuator,value:e}:e==="/"?t==="="&&/\/=(?!(\S*\/[gim]?))/.test(this.input)?{type:l.Punctuator,value:"/="}:{type:l.Punctuator,value:"/"}:null},scanComments:function(){function s(e,t,n){var r=["jshint","jslint","members","member","globals","global","exported"],i=!1,s=e+t,o="plain";return n=n||{},n.isMultiline&&(s+="*/"),r.forEach(function(n){if(i)return;if(e==="//"&&n!=="jshint")return;t.substr(0,n.length)===n&&(i=!0,e+=n,t=t.substr(n.length)),!i&&t.charAt(0)===" "&&t.substr(1,n.length)===n&&(i=!0,e=e+" "+n,t=t.substr(n.length+1));if(!i)return;switch(n){case"member":o="members";break;case"global":o="globals";break;default:o=n}}),{type:l.Comment,commentType:o,value:s,body:t,isSpecial:i,isMultiline:n.isMultiline||!1,isMalformed:n.isMalformed||!1}}var e=this.peek(),t=this.peek(1),n=this.input.substr(2),r=this.line,i=this.char;if(e==="*"&&t==="/")return this.trigger("error",{code:"E018",line:r,character:i}),this.skip(2),null;if(e!=="/"||t!=="*"&&t!=="/")return null;if(t==="/")return this.skip(this.input.length),s("//",n);var o="";if(t==="*"){this.inComment=!0,this.skip(2);while(this.peek()!=="*"||this.peek(1)!=="/")if(this.peek()===""){o+="\n";if(!this.nextLine())return this.trigger("error",{code:"E017",line:r,character:i}),this.inComment=!1,s("/*",o,{isMultiline:!0,isMalformed:!0})}else o+=this.peek(),this.skip();return this.skip(2),this.inComment=!1,s("/*",o,{isMultiline:!0})}},scanKeyword:function(){var e=/^[a-zA-Z_$][a-zA-Z0-9_$]*/.exec(this.input),t=["if","in","do","var","for","new","try","let","this","else","case","void","with","enum","while","break","catch","throw","const","yield","class","super","return","typeof","delete","switch","export","import","default","finally","extends","function","continue","debugger","instanceof"];return e&&t.indexOf(e[0])>=0?{type:l.Keyword,value:e[0]}:null},scanIdentifier:function(){function i(e){return e>256}function s(e){return e>256}function o(e){return/^[0-9a-fA-F]$/.test(e)}var e="",t=0,n,r,u=function(){t+=1;if(this.peek(t)!=="u")return null;var e=this.peek(t+1),n=this.peek(t+2),r=this.peek(t+3),i=this.peek(t+4),u;return o(e)&&o(n)&&o(r)&&o(i)?(u=parseInt(e+n+r+i,16),f[u]||s(u)?(t+=5,"\\u"+e+n+r+i):null):null}.bind(this),c=function(){var e=this.peek(t),n=e.charCodeAt(0);return n===92?u():n<128?a[n]?(t+=1,e):null:i(n)?(t+=1,e):null}.bind(this),h=function(){var e=this.peek(t),n=e.charCodeAt(0);return n===92?u():n<128?f[n]?(t+=1,e):null:s(n)?(t+=1,e):null}.bind(this);r=c();if(r===null)return null;e=r;for(;;){r=h();if(r===null)break;e+=r}switch(e){case"true":case"false":n=l.BooleanLiteral;break;case"null":n=l.NullLiteral;break;default:n=l.Identifier}return{type:n,value:e}},scanNumericLiteral:function(){function s(e){return/^[0-9]$/.test(e)}function o(e){return/^[0-7]$/.test(e)}function u(e){return/^[0-9a-fA-F]$/.test(e)}function a(e){return e==="$"||e==="_"||e==="\\"||e>="a"&&e<="z"||e>="A"&&e<="Z"}var e=0,t="",n=this.input.length,r=this.peek(e),i;if(r!=="."&&!s(r))return null;if(r!=="."){t=this.peek(e),e+=1,r=this.peek(e);if(t==="0"){if(r==="x"||r==="X"){e+=1,t+=r;while(e<n){r=this.peek(e);if(!u(r))break;t+=r,e+=1}if(t.length<=2)return{type:l.NumericLiteral,value:t,isMalformed:!0};if(e<n){r=this.peek(e);if(a(r))return null}return{type:l.NumericLiteral,value:t,base:16,isMalformed:!1}}if(o(r)){e+=1,t+=r,i=!1;while(e<n){r=this.peek(e);if(s(r))i=!0;else if(!o(r))break;t+=r,e+=1}if(e<n){r=this.peek(e);if(a(r))return null}return{type:l.NumericLiteral,value:t,base:8,isMalformed:!1}}s(r)&&(e+=1,t+=r)}while(e<n){r=this.peek(e);if(!s(r))break;t+=r,e+=1}}if(r==="."){t+=r,e+=1;while(e<n){r=this.peek(e);if(!s(r))break;t+=r,e+=1}}if(r==="e"||r==="E"){t+=r,e+=1,r=this.peek(e);if(r==="+"||r==="-")t+=this.peek(e),e+=1;r=this.peek(e);if(!s(r))return null;t+=r,e+=1;while(e<n){r=this.peek(e);if(!s(r))break;t+=r,e+=1}}if(e<n){r=this.peek(e);if(a(r))return null}return{type:l.NumericLiteral,value:t,base:10,isMalformed:!isFinite(t)}},scanTemplateLiteral:function(){if(!o.option.esnext||this.peek()!=="`")return null;var e=this.line,t=this.char,n=1,r="";this.skip();while(this.peek()!=="`"){while(this.peek()===""){if(!this.nextLine())return this.trigger("error",{code:"E052",line:e,character:t}),{type:l.TemplateLiteral,value:r,isUnclosed:!0};r+="\n"}var i=this.peek();this.skip(n),r+=i}return this.skip(),{type:l.TemplateLiteral,value:r,isUnclosed:!1}},scanStringLiteral:function(e){var t=this.peek();if(t!=='"'&&t!=="'")return null;this.triggerAsync("warning",{code:"W108",line:this.line,character:this.char},e,function(){return o.jsonMode&&t!=='"'});var n="",r=this.line,i=this.char,s=!1;this.skip();e:while(this.peek()!==t){while(this.peek()===""){s?(s=!1,this.triggerAsync("warning",{code:"W043",line:this.line,character:this.char},e,function(){return!o.option.multistr}),this.triggerAsync("warning",{code:"W042",line:this.line,character:this.char},e,function(){return o.jsonMode&&o.option.multistr})):this.trigger("warning",{code:"W112",line:this.line,character:this.char});if(!this.nextLine())return this.trigger("error",{code:"E029",line:r,character:i}),{type:l.StringLiteral,value:n,isUnclosed:!0,quote:t};if(this.peek()==t)break e}s=!1;var u=this.peek(),a=1;u<" "&&this.trigger("warning",{code:"W113",line:this.line,character:this.char,data:["<non-printable>"]});if(u==="\\"){this.skip(),u=this.peek();switch(u){case"'":this.triggerAsync("warning",{code:"W114",line:this.line,character:this.char,data:["\\'"]},e,function(){return o.jsonMode});break;case"b":u="\\b";break;case"f":u="\\f";break;case"n":u="\\n";break;case"r":u="\\r";break;case"t":u="\\t";break;case"0":u="\\0";var f=parseInt(this.peek(1),10);this.triggerAsync("warning",{code:"W115",line:this.line,character:this.char},e,function(){return f>=0&&f<=7&&o.directive["use strict"]});break;case"u":u=String.fromCharCode(parseInt(this.input.substr(1,4),16)),a=5;break;case"v":this.triggerAsync("warning",{code:"W114",line:this.line,character:this.char,data:["\\v"]},e,function(){return o.jsonMode}),u="";break;case"x":var c=parseInt(this.input.substr(1,2),16);this.triggerAsync("warning",{code:"W114",line:this.line,character:this.char,data:["\\x-"]},e,function(){return o.jsonMode}),u=String.fromCharCode(c),a=3;break;case"\\":u="\\\\";break;case'"':u='\\"';break;case"/":break;case"":s=!0,u="";break;case"!":if(n.slice(n.length-2)==="<")break;default:this.trigger("warning",{code:"W044",line:this.line,character:this.char})}}n+=u,this.skip(a)}return this.skip(),{type:l.StringLiteral,value:n,isUnclosed:!1,quote:t}},scanRegExp:function(){var e=0,t=this.input.length,n=this.peek(),r=n,i="",s=[],o=!1,u=!1,a,f=function(){n<" "&&(o=!0,this.trigger("warning",{code:"W048",line:this.line,character:this.char})),n==="<"&&(o=!0,this.trigger("warning",{code:"W049",line:this.line,character:this.char,data:[n]}))}.bind(this);if(!this.prereg||n!=="/")return null;e+=1,a=!1;while(e<t){n=this.peek(e),r+=n,i+=n;if(u){n==="]"&&(this.peek(e-1)!=="\\"||this.peek(e-2)==="\\")&&(u=!1),n==="\\"&&(e+=1,n=this.peek(e),i+=n,r+=n,f()),e+=1;continue}if(n==="\\"){e+=1,n=this.peek(e),i+=n,r+=n,f();if(n==="/"){e+=1;continue}if(n==="["){e+=1;continue}}if(n==="["){u=!0,e+=1;continue}if(n==="/"){i=i.substr(0,i.length-1),a=!0,e+=1;break}e+=1}if(!a)return this.trigger("error",{code:"E015",line:this.line,character:this.from}),void this.trigger("fatal",{line:this.line,from:this.from});while(e<t){n=this.peek(e);if(!/[gim]/.test(n))break;s.push(n),r+=n,e+=1}try{new RegExp(i,s.join(""))}catch(c){o=!0,this.trigger("error",{code:"E016",line:this.line,character:this.char,data:[c.message]})}return{type:l.RegExp,value:r,flags:s,isMalformed:o}},scanNonBreakingSpaces:function(){return o.option.nonbsp?this.input.search(/(\u00A0)/):-1},scanUnsafeChars:function(){return this.input.search(s.unsafeChars)},next:function(e){this.from=this.char;var t;if(/\s/.test(this.peek())){t=this.char;while(/\s/.test(this.peek()))this.from+=1,this.skip()}var n=this.scanComments()||this.scanStringLiteral(e)||this.scanTemplateLiteral();return n?n:(n=this.scanRegExp()||this.scanPunctuator()||this.scanKeyword()||this.scanIdentifier()||this.scanNumericLiteral(),n?(this.skip(n.value.length),n):null)},nextLine:function(){var e;if(this.line>=this.getLines().length)return!1;this.input=this.getLines()[this.line],this.line+=1,this.char=1,this.from=1;var t=this.input.trim(),n=function(){return r.some(arguments,function(e){return t.indexOf(e)===0})},i=function(){return r.some(arguments,function(e){return t.indexOf(e,t.length-e.length)!==-1})};o.ignoreLinterErrors===!0&&!n("/*","//")&&!i("*/")&&(this.input=""),e=this.scanNonBreakingSpaces(),e>=0&&this.trigger("warning",{code:"W125",line:this.line,character:e+1}),this.input=this.input.replace(/\t/g,o.tab),e=this.scanUnsafeChars(),e>=0&&this.trigger("warning",{code:"W100",line:this.line,character:e});if(o.option.maxlen&&o.option.maxlen<this.input.length){var u=this.inComment||n.call(t,"//")||n.call(t,"/*"),a=!u||!s.maxlenException.test(t);a&&this.trigger("warning",{code:"W101",line:this.line,character:this.input.length})}return!0},start:function(){this.nextLine()},token:function(){function n(e,t){if(!e.reserved)return!1;var n=e.meta;if(n&&n.isFutureReservedWord&&o.option.inES5()){if(!n.es5)return!1;if(n.strictOnly&&!o.option.strict&&!o.directive["use strict"])return!1;if(t)return!1}return!0}var e=c(),t,i=function(t,i,s){var u;t!=="(endline)"&&t!=="(end)"&&(this.prereg=!1);if(t==="(punctuator)"){switch(i){case".":case")":case"~":case"#":case"]":this.prereg=!1;break;default:this.prereg=!0}u=Object.create(o.syntax[i]||o.syntax["(error)"])}if(t==="(identifier)"){if(i==="return"||i==="case"||i==="typeof")this.prereg=!0;r.has(o.syntax,i)&&(u=Object.create(o.syntax[i]||o.syntax["(error)"]),n(u,s&&t==="(identifier)")||(u=null))}return u||(u=Object.create(o.syntax[t])),u.identifier=t==="(identifier)",u.type=u.type||t,u.value=i,u.line=this.line,u.character=this.char,u.from=this.from,s&&u.identifier&&(u.isProperty=s),u.check=e.check,u}.bind(this);for(;;){if(!this.input.length)return i(this.nextLine()?"(endline)":"(end)","");t=this.next(e);if(!t){this.input.length&&(this.trigger("error",{code:"E024",line:this.line,character:this.char,data:[this.peek()]}),this.input="");continue}switch(t.type){case l.StringLiteral:return this.triggerAsync("String",{line:this.line,"char":this.char,from:this.from,value:t.value,quote:t.quote},e,function(){return!0}),i("(string)",t.value);case l.TemplateLiteral:return this.trigger("Template",{line:this.line,"char":this.char,from:this.from,value:t.value}),i("(template)",t.value);case l.Identifier:this.trigger("Identifier",{line:this.line,"char":this.char,from:this.form,name:t.value,isProperty:o.tokens.curr.id==="."});case l.Keyword:case l.NullLiteral:case l.BooleanLiteral:return i("(identifier)",t.value,o.tokens.curr.id===".");case l.NumericLiteral:return t.isMalformed&&this.trigger("warning",{code:"W045",line:this.line,character:this.char,data:[t.value]}),this.triggerAsync("warning",{code:"W114",line:this.line,character:this.char,data:["0x-"]},e,function(){return t.base===16&&o.jsonMode}),this.triggerAsync("warning",{code:"W115",line:this.line,character:this.char},e,function(){return o.directive["use strict"]&&t.base===8}),this.trigger("Number",{line:this.line,"char":this.char,from:this.from,value:t.value,base:t.base,isMalformed:t.malformed}),i("(number)",t.value);case l.RegExp:return i("(regexp)",t.value);case l.Comment:o.tokens.curr.comment=!0;if(t.isSpecial)return{id:"(comment)",value:t.value,body:t.body,type:t.commentType,isSpecial:t.isSpecial,line:this.line,character:this.char,from:this.from};break;case"":break;default:return i("(punctuator)",t.value)}}}},n.Lexer=h},{"../data/ascii-identifier-data.js":1,"./reg.js":6,"./state.js":7,events:10,underscore:2}],5:[function(e,t,n){"use strict";var r=e("underscore"),i={E001:"Bad option: '{a}'.",E002:"Bad option value.",E003:"Expected a JSON value.",E004:"Input is neither a string nor an array of strings.",E005:"Input is empty.",E006:"Unexpected early end of program.",E007:'Missing "use strict" statement.',E008:"Strict violation.",E009:"Option 'validthis' can't be used in a global scope.",E010:"'with' is not allowed in strict mode.",E011:"const '{a}' has already been declared.",E012:"const '{a}' is initialized to 'undefined'.",E013:"Attempting to override '{a}' which is a constant.",E014:"A regular expression literal can be confused with '/='.",E015:"Unclosed regular expression.",E016:"Invalid regular expression.",E017:"Unclosed comment.",E018:"Unbegun comment.",E019:"Unmatched '{a}'.",E020:"Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.",E021:"Expected '{a}' and instead saw '{b}'.",E022:"Line breaking error '{a}'.",E023:"Missing '{a}'.",E024:"Unexpected '{a}'.",E025:"Missing ':' on a case clause.",E026:"Missing '}' to match '{' from line {a}.",E027:"Missing ']' to match '[' from line {a}.",E028:"Illegal comma.",E029:"Unclosed string.",E030:"Expected an identifier and instead saw '{a}'.",E031:"Bad assignment.",E032:"Expected a small integer or 'false' and instead saw '{a}'.",E033:"Expected an operator and instead saw '{a}'.",E034:"get/set are ES5 features.",E035:"Missing property name.",E036:"Expected to see a statement and instead saw a block.",E037:null,E038:null,E039:"Function declarations are not invocable. Wrap the whole function invocation in parens.",E040:"Each value should have its own case label.",E041:"Unrecoverable syntax error.",E042:"Stopping.",E043:"Too many errors.",E044:null,E045:"Invalid for each loop.",E046:"A yield statement shall be within a generator function (with syntax: `function*`)",E047:null,E048:"Let declaration not directly within block.",E049:"A {a} cannot be named '{b}'.",E050:"Mozilla requires the yield expression to be parenthesized here.",E051:"Regular parameters cannot come after default parameters.",E052:"Unclosed template literal."},s={W001:"'hasOwnProperty' is a really bad name.",W002:"Value of '{a}' may be overwritten in IE 8 and earlier.",W003:"'{a}' was used before it was defined.",W004:"'{a}' is already defined.",W005:"A dot following a number can be confused with a decimal point.",W006:"Confusing minuses.",W007:"Confusing plusses.",W008:"A leading decimal point can be confused with a dot: '{a}'.",W009:"The array literal notation [] is preferable.",W010:"The object literal notation {} is preferable.",W011:null,W012:null,W013:null,W014:"Bad line breaking before '{a}'.",W015:null,W016:"Unexpected use of '{a}'.",W017:"Bad operand.",W018:"Confusing use of '{a}'.",W019:"Use the isNaN function to compare with NaN.",W020:"Read only.",W021:"'{a}' is a function.",W022:"Do not assign to the exception parameter.",W023:"Expected an identifier in an assignment and instead saw a function invocation.",W024:"Expected an identifier and instead saw '{a}' (a reserved word).",W025:"Missing name in function declaration.",W026:"Inner functions should be listed at the top of the outer function.",W027:"Unreachable '{a}' after '{b}'.",W028:"Label '{a}' on {b} statement.",W030:"Expected an assignment or function call and instead saw an expression.",W031:"Do not use 'new' for side effects.",W032:"Unnecessary semicolon.",W033:"Missing semicolon.",W034:'Unnecessary directive "{a}".',W035:"Empty block.",W036:"Unexpected /*member '{a}'.",W037:"'{a}' is a statement label.",W038:"'{a}' used out of scope.",W039:"'{a}' is not allowed.",W040:"Possible strict violation.",W041:"Use '{a}' to compare with '{b}'.",W042:"Avoid EOL escaping.",W043:"Bad escaping of EOL. Use option multistr if needed.",W044:"Bad or unnecessary escaping.",W045:"Bad number '{a}'.",W046:"Don't use extra leading zeros '{a}'.",W047:"A trailing decimal point can be confused with a dot: '{a}'.",W048:"Unexpected control character in regular expression.",W049:"Unexpected escaped character '{a}' in regular expression.",W050:"JavaScript URL.",W051:"Variables should not be deleted.",W052:"Unexpected '{a}'.",W053:"Do not use {a} as a constructor.",W054:"The Function constructor is a form of eval.",W055:"A constructor name should start with an uppercase letter.",W056:"Bad constructor.",W057:"Weird construction. Is 'new' necessary?",W058:"Missing '()' invoking a constructor.",W059:"Avoid arguments.{a}.",W060:"document.write can be a form of eval.",W061:"eval can be harmful.",W062:"Wrap an immediate function invocation in parens to assist the reader in understanding that the expression is the result of a function, and not the function itself.",W063:"Math is not a function.",W064:"Missing 'new' prefix when invoking a constructor.",W065:"Missing radix parameter.",W066:"Implied eval. Consider passing a function instead of a string.",W067:"Bad invocation.",W068:"Wrapping non-IIFE function literals in parens is unnecessary.",W069:"['{a}'] is better written in dot notation.",W070:"Extra comma. (it breaks older versions of IE)",W071:"This function has too many statements. ({a})",W072:"This function has too many parameters. ({a})",W073:"Blocks are nested too deeply. ({a})",W074:"This function's cyclomatic complexity is too high. ({a})",W075:"Duplicate key '{a}'.",W076:"Unexpected parameter '{a}' in get {b} function.",W077:"Expected a single parameter in set {a} function.",W078:"Setter is defined without getter.",W079:"Redefinition of '{a}'.",W080:"It's not necessary to initialize '{a}' to 'undefined'.",W081:null,W082:"Function declarations should not be placed in blocks. Use a function expression or move the statement to the top of the outer function.",W083:"Don't make functions within a loop.",W084:"Assignment in conditional expression",W085:"Don't use 'with'.",W086:"Expected a 'break' statement before '{a}'.",W087:"Forgotten 'debugger' statement?",W088:"Creating global 'for' variable. Should be 'for (var {a} ...'.",W089:"The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.",W090:"'{a}' is not a statement label.",W091:"'{a}' is out of scope.",W093:"Did you mean to return a conditional instead of an assignment?",W094:"Unexpected comma.",W095:"Expected a string and instead saw {a}.",W096:"The '{a}' key may produce unexpected results.",W097:'Use the function form of "use strict".',W098:"'{a}' is defined but never used.",W099:null,W100:"This character may get silently deleted by one or more browsers.",W101:"Line is too long.",W102:null,W103:"The '{a}' property is deprecated.",W104:"'{a}' is available in ES6 (use esnext option) or Mozilla JS extensions (use moz).",W105:"Unexpected {a} in '{b}'.",W106:"Identifier '{a}' is not in camel case.",W107:"Script URL.",W108:"Strings must use doublequote.",W109:"Strings must use singlequote.",W110:"Mixed double and single quotes.",W112:"Unclosed string.",W113:"Control character in string: {a}.",W114:"Avoid {a}.",W115:"Octal literals are not allowed in strict mode.",W116:"Expected '{a}' and instead saw '{b}'.",W117:"'{a}' is not defined.",W118:"'{a}' is only available in Mozilla JavaScript extensions (use moz option).",W119:"'{a}' is only available in ES6 (use esnext option).",W120:"You might be leaking a variable ({a}) here.",W121:"Extending prototype of native object: '{a}'.",W122:"Invalid typeof value '{a}'",W123:"'{a}' is already defined in outer scope.",W124:"A generator function shall contain a yield statement.",W125:"This line contains non-breaking spaces: http://jshint.com/doc/options/#nonbsp"},o={I001:"Comma warnings can be turned off with 'laxcomma'.",I002:null,I003:"ES5 option is now set per default"};n.errors={},n.warnings={},n.info={},r.each(i,function(e,t){n.errors[t]={code:t,desc:e}}),r.each(s,function(e,t){n.warnings[t]={code:t,desc:e}}),r.each(o,function(e,t){n.info[t]={code:t,desc:e}})},{underscore:2}],6:[function(e,t,n){"use string";n.unsafeString=/@cc|<\/?|script|\]\s*\]|<\s*!|</i,n.unsafeChars=/[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/,n.needEsc=/[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/,n.needEscGlobal=/[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n.starSlash=/\*\//,n.identifier=/^([a-zA-Z_$][a-zA-Z0-9_$]*)$/,n.javascriptURL=/^(?:javascript|jscript|ecmascript|vbscript|livescript)\s*:/i,n.fallsThrough=/^\s*\/\*\s*falls?\sthrough\s*\*\/\s*$/,n.maxlenException=/^(?:(?:\/\/|\/\*|\*) ?)?[^ ]+$/},{}],7:[function(e,t,n){"use strict";var r={syntax:{},reset:function(){this.tokens={prev:null,next:null,curr:null},this.option={},this.ignored={},this.directive={},this.jsonMode=!1,this.jsonWarnings=[],this.lines=[],this.tab="",this.cache={},this.ignoredLines={},this.ignoreLinterErrors=!1}};n.state=r},{}],8:[function(e,t,n){"use strict";n.register=function(e){e.on("Identifier",function(n){if(e.getOption("proto"))return;n.name==="__proto__"&&e.warn("W103",{line:n.line,"char":n.char,data:[n.name]})}),e.on("Identifier",function(n){if(e.getOption("iterator"))return;n.name==="__iterator__"&&e.warn("W104",{line:n.line,"char":n.char,data:[n.name]})}),e.on("Identifier",function(n){if(!e.getOption("camelcase"))return;n.name.replace(/^_+|_+$/g,"").indexOf("_")>-1&&!n.name.match(/^[A-Z0-9_]*$/)&&e.warn("W106",{line:n.line,"char":n.from,data:[n.name]})}),e.on("String",function(n){var r=e.getOption("quotmark"),i;if(!r)return;r==="single"&&n.quote!=="'"&&(i="W109"),r==="double"&&n.quote!=='"'&&(i="W108"),r===!0&&(e.getCache("quotmark")||e.setCache("quotmark",n.quote),e.getCache("quotmark")!==n.quote&&(i="W110")),i&&e.warn(i,{line:n.line,"char":n.char})}),e.on("Number",function(n){n.value.charAt(0)==="."&&e.warn("W008",{line:n.line,"char":n.char,data:[n.value]}),n.value.substr(n.value.length-1)==="."&&e.warn("W047",{line:n.line,"char":n.char,data:[n.value]}),/^00+/.test(n.value)&&e.warn("W046",{line:n.line,"char":n.char,data:[n.value]})}),e.on("String",function(n){var r=/^(?:javascript|jscript|ecmascript|vbscript|livescript)\s*:/i;if(e.getOption("scripturl"))return;r.test(n.value)&&e.warn("W107",{line:n.line,"char":n.char})})}},{}],9:[function(e,t,n){"use strict";n.reservedVars={arguments:!1,NaN:!1},n.ecmaIdentifiers={Array:!1,Boolean:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,eval:!1,EvalError:!1,Function:!1,hasOwnProperty:!1,isFinite:!1,isNaN:!1,JSON:!1,Math:!1,Number:!1,Object:!1,parseInt:!1,parseFloat:!1,RangeError:!1,ReferenceError:!1,RegExp:!1,String:!1,SyntaxError:!1,TypeError:!1,URIError:!1},n.newEcmaIdentifiers={Set:!1,Map:!1,WeakMap:!1,WeakSet:!1,Proxy:!1,Promise:!1},n.browser={Audio:!1,Blob:!1,addEventListener:!1,applicationCache:!1,atob:!1,blur:!1,btoa:!1,CanvasGradient:!1,CanvasPattern:!1,CanvasRenderingContext2D:!1,clearInterval:!1,clearTimeout:!1,close:!1,closed:!1,CustomEvent:!1,DOMParser:!1,defaultStatus:!1,document:!1,Element:!1,ElementTimeControl:!1,event:!1,FileReader:!1,FormData:!1,focus:!1,frames:!1,getComputedStyle:!1,HTMLElement:!1,HTMLAnchorElement:!1,HTMLBaseElement:!1,HTMLBlockquoteElement:!1,HTMLBodyElement:!1,HTMLBRElement:!1,HTMLButtonElement:!1,HTMLCanvasElement:!1,HTMLDirectoryElement:!1,HTMLDivElement:!1,HTMLDListElement:!1,HTMLFieldSetElement:!1,HTMLFontElement:!1,HTMLFormElement:!1,HTMLFrameElement:!1,HTMLFrameSetElement:!1,HTMLHeadElement:!1,HTMLHeadingElement:!1,HTMLHRElement:!1,HTMLHtmlElement:!1,HTMLIFrameElement:!1,HTMLImageElement:!1,HTMLInputElement:!1,HTMLIsIndexElement:!1,HTMLLabelElement:!1,HTMLLayerElement:!1,HTMLLegendElement:!1,HTMLLIElement:!1,HTMLLinkElement:!1,HTMLMapElement:!1,HTMLMenuElement:!1,HTMLMetaElement:!1,HTMLModElement:!1,HTMLObjectElement:!1,HTMLOListElement:!1,HTMLOptGroupElement:!1,HTMLOptionElement:!1,HTMLParagraphElement:!1,HTMLParamElement:!1,HTMLPreElement:!1,HTMLQuoteElement:!1,HTMLScriptElement:!1,HTMLSelectElement:!1,HTMLStyleElement:!1,HTMLTableCaptionElement:!1,HTMLTableCellElement:!1,HTMLTableColElement:!1,HTMLTableElement:!1,HTMLTableRowElement:!1,HTMLTableSectionElement:!1,HTMLTextAreaElement:!1,HTMLTitleElement:!1,HTMLUListElement:!1,HTMLVideoElement:!1,history:!1,Image:!1,length:!1,localStorage:!1,location:!1,matchMedia:!1,MessageChannel:!1,MessageEvent:!1,MessagePort:!1,MouseEvent:!1,moveBy:!1,moveTo:!1,MutationObserver:!1,name:!1,Node:!1,NodeFilter:!1,NodeList:!1,navigator:!1,onbeforeunload:!0,onblur:!0,onerror:!0,onfocus:!0,onload:!0,onresize:!0,onunload:!0,open:!1,openDatabase:!1,opener:!1,Option:!1,parent:!1,print:!1,removeEventListener:!1,resizeBy:!1,resizeTo:!1,screen:!1,scroll:!1,scrollBy:!1,scrollTo:!1,sessionStorage:!1,setInterval:!1,setTimeout:!1,SharedWorker:!1,status:!1,SVGAElement:!1,SVGAltGlyphDefElement:!1,SVGAltGlyphElement:!1,SVGAltGlyphItemElement:!1,SVGAngle:!1,SVGAnimateColorElement:!1,SVGAnimateElement:!1,SVGAnimateMotionElement:!1,SVGAnimateTransformElement:!1,SVGAnimatedAngle:!1,SVGAnimatedBoolean:!1,SVGAnimatedEnumeration:!1,SVGAnimatedInteger:!1,SVGAnimatedLength:!1,SVGAnimatedLengthList:!1,SVGAnimatedNumber:!1,SVGAnimatedNumberList:!1,SVGAnimatedPathData:!1,SVGAnimatedPoints:!1,SVGAnimatedPreserveAspectRatio:!1,SVGAnimatedRect:!1,SVGAnimatedString:!1,SVGAnimatedTransformList:!1,SVGAnimationElement:!1,SVGCSSRule:!1,SVGCircleElement:!1,SVGClipPathElement:!1,SVGColor:!1,SVGColorProfileElement:!1,SVGColorProfileRule:!1,SVGComponentTransferFunctionElement:!1,SVGCursorElement:!1,SVGDefsElement:!1,SVGDescElement:!1,SVGDocument:!1,SVGElement:!1,SVGElementInstance:!1,SVGElementInstanceList:!1,SVGEllipseElement:!1,SVGExternalResourcesRequired:!1,SVGFEBlendElement:!1,SVGFEColorMatrixElement:!1,SVGFEComponentTransferElement:!1,SVGFECompositeElement:!1,SVGFEConvolveMatrixElement:!1,SVGFEDiffuseLightingElement:!1,SVGFEDisplacementMapElement:!1,SVGFEDistantLightElement:!1,SVGFEFloodElement:!1,SVGFEFuncAElement:!1,SVGFEFuncBElement:!1,SVGFEFuncGElement:!1,SVGFEFuncRElement:!1,SVGFEGaussianBlurElement:!1,SVGFEImageElement:!1,SVGFEMergeElement:!1,SVGFEMergeNodeElement:!1,SVGFEMorphologyElement:!1,SVGFEOffsetElement:!1,SVGFEPointLightElement:!1,SVGFESpecularLightingElement:!1,SVGFESpotLightElement:!1,SVGFETileElement:!1,SVGFETurbulenceElement:!1,SVGFilterElement:!1,SVGFilterPrimitiveStandardAttributes:!1,SVGFitToViewBox:!1,SVGFontElement:!1,SVGFontFaceElement:!1,SVGFontFaceFormatElement:!1,SVGFontFaceNameElement:!1,SVGFontFaceSrcElement:!1,SVGFontFaceUriElement:!1,SVGForeignObjectElement:!1,SVGGElement:!1,SVGGlyphElement:!1,SVGGlyphRefElement:!1,SVGGradientElement:!1,SVGHKernElement:!1,SVGICCColor:!1,SVGImageElement:!1,SVGLangSpace:!1,SVGLength:!1,SVGLengthList:!1,SVGLineElement:!1,SVGLinearGradientElement:!1,SVGLocatable:!1,SVGMPathElement:!1,SVGMarkerElement:!1,SVGMaskElement:!1,SVGMatrix:!1,SVGMetadataElement:!1,SVGMissingGlyphElement:!1,SVGNumber:!1,SVGNumberList:!1,SVGPaint:!1,SVGPathElement:!1,SVGPathSeg:!1,SVGPathSegArcAbs:!1,SVGPathSegArcRel:!1,SVGPathSegClosePath:!1,SVGPathSegCurvetoCubicAbs:!1,SVGPathSegCurvetoCubicRel:!1,SVGPathSegCurvetoCubicSmoothAbs:!1,SVGPathSegCurvetoCubicSmoothRel:!1,SVGPathSegCurvetoQuadraticAbs:!1,SVGPathSegCurvetoQuadraticRel:!1,SVGPathSegCurvetoQuadraticSmoothAbs:!1,SVGPathSegCurvetoQuadraticSmoothRel:!1,SVGPathSegLinetoAbs:!1,SVGPathSegLinetoHorizontalAbs:!1,SVGPathSegLinetoHorizontalRel:!1,SVGPathSegLinetoRel:!1,SVGPathSegLinetoVerticalAbs:!1,SVGPathSegLinetoVerticalRel:!1,SVGPathSegList:!1,SVGPathSegMovetoAbs:!1,SVGPathSegMovetoRel:!1,SVGPatternElement:!1,SVGPoint:!1,SVGPointList:!1,SVGPolygonElement:!1,SVGPolylineElement:!1,SVGPreserveAspectRatio:!1,SVGRadialGradientElement:!1,SVGRect:!1,SVGRectElement:!1,SVGRenderingIntent:!1,SVGSVGElement:!1,SVGScriptElement:!1,SVGSetElement:!1,SVGStopElement:!1,SVGStringList:!1,SVGStylable:!1,SVGStyleElement:!1,SVGSwitchElement:!1,SVGSymbolElement:!1,SVGTRefElement:!1,SVGTSpanElement:!1,SVGTests:!1,SVGTextContentElement:!1,SVGTextElement:!1,SVGTextPathElement:!1,SVGTextPositioningElement:!1,SVGTitleElement:!1,SVGTransform:!1,SVGTransformList:!1,SVGTransformable:!1,SVGURIReference:!1,SVGUnitTypes:!1,SVGUseElement:!1,SVGVKernElement:!1,SVGViewElement:!1,SVGViewSpec:!1,SVGZoomAndPan:!1,TimeEvent:!1,top:!1,URL:!1,WebSocket:!1,window:!1,Worker:!1,XMLHttpRequest:!1,XMLSerializer:!1,XPathEvaluator:!1,XPathException:!1,XPathExpression:!1,XPathNamespace:!1,XPathNSResolver:!1,XPathResult:!1},n.devel={alert:!1,confirm:!1,console:!1,Debug:!1,opera:!1,prompt:!1},n.worker={importScripts:!0,postMessage:!0,self:!0},n.nonstandard={escape:!1,unescape:!1},n.couch={require:!1,respond:!1,getRow:!1,emit:!1,send:!1,start:!1,sum:!1,log:!1,exports:!1,module:!1,provides:!1},n.node={__filename:!1,__dirname:!1,GLOBAL:!1,global:!1,module:!1,require:!1,Buffer:!0,console:!0,exports:!0,process:!0,setTimeout:!0,clearTimeout:!0,setInterval:!0,clearInterval:!0,setImmediate:!0,clearImmediate:!0},n.phantom={phantom:!0,require:!0,WebPage:!0,console:!0,exports:!0},n.qunit={asyncTest:!1,deepEqual:!1,equal:!1,expect:!1,module:!1,notDeepEqual:!1,notEqual:!1,notPropEqual:!1,notStrictEqual:!1,ok:!1,propEqual:!1,QUnit:!1,raises:!1,start:!1,stop:!1,strictEqual:!1,test:!1,"throws":!1},n.rhino={defineClass:!1,deserialize:!1,gc:!1,help:!1,importClass:!1,importPackage:!1,java:!1,load:!1,loadClass:!1,Packages:!1,print:!1,quit:!1,readFile:!1,readUrl:!1,runCommand:!1,seal:!1,serialize:!1,spawn:!1,sync:!1,toint32:!1,version:!1},n.shelljs={target:!1,echo:!1,exit:!1,cd:!1,pwd:!1,ls:!1,find:!1,cp:!1,rm:!1,mv:!1,mkdir:!1,test:!1,cat:!1,sed:!1,grep:!1,which:!1,dirs:!1,pushd:!1,popd:!1,env:!1,exec:!1,chmod:!1,config:!1,error:!1,tempdir:!1},n.typed={ArrayBuffer:!1,ArrayBufferView:!1,DataView:!1,Float32Array:!1,Float64Array:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1},n.wsh={ActiveXObject:!0,Enumerator:!0,GetObject:!0,ScriptEngine:!0,ScriptEngineBuildVersion:!0,ScriptEngineMajorVersion:!0,ScriptEngineMinorVersion:!0,VBArray:!0,WSH:!0,WScript:!0,XDomainRequest:!0},n.dojo={dojo:!1,dijit:!1,dojox:!1,define:!1,require:!1},n.jquery={$:!1,jQuery:!1},n.mootools={$:!1,$$:!1,Asset:!1,Browser:!1,Chain:!1,Class:!1,Color:!1,Cookie:!1,Core:!1,Document:!1,DomReady:!1,DOMEvent:!1,DOMReady:!1,Drag:!1,Element:!1,Elements:!1,Event:!1,Events:!1,Fx:!1,Group:!1,Hash:!1,HtmlTable:!1,IFrame:!1,IframeShim:!1,InputValidator:!1,instanceOf:!1,Keyboard:!1,Locale:!1,Mask:!1,MooTools:!1,Native:!1,Options:!1,OverText:!1,Request:!1,Scroller:!1,Slick:!1,Slider:!1,Sortables:!1,Spinner:!1,Swiff:!1,Tips:!1,Type:!1,typeOf:!1,URI:!1,Window:!1},n.prototypejs={$:!1,$$:!1,$A:!1,$F:!1,$H:!1,$R:!1,$break:!1,$continue:!1,$w:!1,Abstract:!1,Ajax:!1,Class:!1,Enumerable:!1,Element:!1,Event:!1,Field:!1,Form:!1,Hash:!1,Insertion:!1,ObjectRange:!1,PeriodicalExecuter:!1,Position:!1,Prototype:!1,Selector:!1,Template:!1,Toggle:!1,Try:!1,Autocompleter:!1,Builder:!1,Control:!1,Draggable:!1,Draggables:!1,Droppables:!1,Effect:!1,Sortable:!1,SortableObserver:!1,Sound:!1,Scriptaculous:!1},n.yui={YUI:!1,Y:!1,YUI_config:!1},n.mocha={describe:!1,it:!1,before:!1,after:!1,beforeEach:!1,afterEach:!1,suite:!1,test:!1,setup:!1,teardown:!1},n.jasmine={jasmine:!1,describe:!1,it:!1,xit:!1,beforeEach:!1,afterEach:!1,setFixtures:!1,loadFixtures:!1,spyOn:!1,expect:!1,runs:!1,waitsFor:!1,waits:!1}},{}],10:[function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||undefined}function i(e){return typeof e=="function"}function s(e){return typeof e=="number"}function o(e){return typeof e=="object"&&e!==null}function u(e){return e===void 0}t.exports=r,r.EventEmitter=r,r.prototype._events=undefined,r.prototype._maxListeners=undefined,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!s(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,s,a,f;this._events||(this._events={});if(e==="error")if(!this._events.error||o(this._events.error)&&!this._events.error.length)throw t=arguments[1],t instanceof Error?t:TypeError('Uncaught, unspecified "error" event.');n=this._events[e];if(u(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:r=arguments.length,s=new Array(r-1);for(a=1;a<r;a++)s[a-1]=arguments[a];n.apply(this,s)}else if(o(n)){r=arguments.length,s=new Array(r-1);for(a=1;a<r;a++)s[a-1]=arguments[a];f=n.slice(),r=f.length;for(a=0;a<r;a++)f[a].apply(this,s)}return!0},r.prototype.addListener=function(e,t){var n;if(!i(t))throw TypeError("listener must be a function");this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,i(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t;if(o(this._events[e])&&!this._events[e].warned){var n;u(this._maxListeners)?n=r.defaultMaxListeners:n=this._maxListeners,n&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),console.trace())}return this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var n=!1;return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var n,r,s,u;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;n=this._events[e],s=n.length,r=-1;if(n===t||i(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(u=s;u-->0;)if(n[u]===t||n[u].listener&&n[u].listener===t){r=u;break}if(r<0)return this;n.length===1?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[e]&&delete this._events[e],this;if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}return this.removeAllListeners("removeListener"),this._events={},this}n=this._events[e];if(i(n))this.removeListener(e,n);else while(n.length)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){var t;return!this._events||!this._events[e]?t=[]:i(this._events[e])?t=[this._events[e]]:t=this._events[e].slice(),t},r.listenerCount=function(e,t){var n;return!e._events||!e._events[t]?n=0:i(e._events[t])?n=1:n=e._events[t].length,n}},{}]},{},[3])(3)}),define("ace/mode/javascript_worker",["require","exports","module","ace/lib/oop","ace/worker/mirror","ace/mode/javascript/jshint"],function(require,exports,module){"use strict";function startRegex(e){return RegExp("^("+e.join("|")+")")}var oop=require("../lib/oop"),Mirror=require("../worker/mirror").Mirror,lint=require("./javascript/jshint").JSHINT,disabledWarningsRe=startRegex(["Bad for in variable '(.+)'.",'Missing "use strict"']),errorsRe=startRegex(["Unexpected","Expected ","Confusing (plus|minus)","\\{a\\} unterminated regular expression","Unclosed ","Unmatched ","Unbegun comment","Bad invocation","Missing space after","Missing operator at"]),infoRe=startRegex(["Expected an assignment","Bad escapement of EOL","Unexpected comma","Unexpected space","Missing radix parameter.","A leading decimal point can","\\['{a}'\\] is better written in dot notation.","'{a}' used out of scope"]),JavaScriptWorker=exports.JavaScriptWorker=function(e){Mirror.call(this,e),this.setTimeout(500),this.setOptions()};oop.inherits(JavaScriptWorker,Mirror),function(){this.setOptions=function(e){this.options=e||{esnext:!0,moz:!0,devel:!0,browser:!0,node:!0,laxcomma:!0,laxbreak:!0,lastsemic:!0,onevar:!1,passfail:!1,maxerr:100,expr:!0,multistr:!0,globalstrict:!0},this.doc.getValue()&&this.deferredUpdate.schedule(100)},this.changeOptions=function(e){oop.mixin(this.options,e),this.doc.getValue()&&this.deferredUpdate.schedule(100)},this.isValidJS=function(str){try{eval("throw 0;"+str)}catch(e){if(e===0)return!0}return!1},this.onUpdate=function(){var e=this.doc.getValue();e=e.replace(/^#!.*\n/,"\n");if(!e){this.sender.emit("jslint",[]);return}var t=[],n=this.isValidJS(e)?"warning":"error";lint(e,this.options);var r=lint.errors,i=!1;for(var s=0;s<r.length;s++){var o=r[s];if(!o)continue;var u=o.raw,a="warning";if(u=="Missing semicolon."){var f=o.evidence.substr(o.character);f=f.charAt(f.search(/\S/)),n=="error"&&f&&/[\w\d{(['"]/.test(f)?(o.reason='Missing ";" before statement',a="error"):a="info"}else{if(disabledWarningsRe.test(u))continue;infoRe.test(u)?a="info":errorsRe.test(u)?(i=!0,a=n):u=="'{a}' is not defined."?a="warning":u=="'{a}' is defined but never used."&&(a="info")}t.push({row:o.line-1,column:o.character-1,text:o.reason,type:a,raw:u}),i}this.sender.emit("jslint",t)}}.call(JavaScriptWorker.prototype)}),define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function r(){}function w(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(t){}}function H(e){return e=+e,e!==e?e=0:e!==0&&e!==1/0&&e!==-1/0&&(e=(e>0||-1)*Math.floor(Math.abs(e))),e}function B(e){var t=typeof e;return e===null||t==="undefined"||t==="boolean"||t==="number"||t==="string"}function j(e){var t,n,r;if(B(e))return e;n=e.valueOf;if(typeof n=="function"){t=n.call(e);if(B(t))return t}r=e.toString;if(typeof r=="function"){t=r.call(e);if(B(t))return t}throw new TypeError}Function.prototype.bind||(Function.prototype.bind=function(t){var n=this;if(typeof n!="function")throw new TypeError("Function.prototype.bind called on incompatible "+n);var i=u.call(arguments,1),s=function(){if(this instanceof s){var e=n.apply(this,i.concat(u.call(arguments)));return Object(e)===e?e:this}return n.apply(t,i.concat(u.call(arguments)))};return n.prototype&&(r.prototype=n.prototype,s.prototype=new r,r.prototype=null),s});var i=Function.prototype.call,s=Array.prototype,o=Object.prototype,u=s.slice,a=i.bind(o.toString),f=i.bind(o.hasOwnProperty),l,c,h,p,d;if(d=f(o,"__defineGetter__"))l=i.bind(o.__defineGetter__),c=i.bind(o.__defineSetter__),h=i.bind(o.__lookupGetter__),p=i.bind(o.__lookupSetter__);if([1,2].splice(0).length!=2)if(!function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t=[],n;t.splice.apply(t,e(20)),t.splice.apply(t,e(26)),n=t.length,t.splice(5,0,"XXX"),n+1==t.length;if(n+1==t.length)return!0}())Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):e==void 0?e=0:e<0&&(e=Math.max(n+e,0)),e+t<n||(t=n-e);var r=this.slice(e,e+t),i=u.call(arguments,2),s=i.length;if(e===n)s&&this.push.apply(this,i);else{var o=Math.min(t,n-e),a=e+o,f=a+s-o,l=n-a,c=n-o;if(f<a)for(var h=0;h<l;++h)this[f+h]=this[a+h];else if(f>a)for(h=l;h--;)this[f+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else{this.length=c+s;for(h=0;h<s;++h)this[e+h]=i[h]}}return r};else{var v=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?v.apply(this,[e===void 0?0:e,t===void 0?this.length-e:t].concat(u.call(arguments,2))):[]}}Array.isArray||(Array.isArray=function(t){return a(t)=="[object Array]"});var m=Object("a"),g=m[0]!="a"||!(0 in m);Array.prototype.forEach||(Array.prototype.forEach=function(t){var n=F(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=arguments[1],s=-1,o=r.length>>>0;if(a(t)!="[object Function]")throw new TypeError;while(++s<o)s in r&&t.call(i,r[s],s,n)}),Array.prototype.map||(Array.prototype.map=function(t){var n=F(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0,s=Array(i),o=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var u=0;u<i;u++)u in r&&(s[u]=t.call(o,r[u],u,n));return s}),Array.prototype.filter||(Array.prototype.filter=function(t){var n=F(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0,s=[],o,u=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var f=0;f<i;f++)f in r&&(o=r[f],t.call(u,o,f,n)&&s.push(o));return s}),Array.prototype.every||(Array.prototype.every=function(t){var n=F(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0,s=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var o=0;o<i;o++)if(o in r&&!t.call(s,r[o],o,n))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(t){var n=F(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0,s=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var o=0;o<i;o++)if(o in r&&t.call(s,r[o],o,n))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(t){var n=F(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0;if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");if(!i&&arguments.length==1)throw new TypeError("reduce of empty array with no initial value");var s=0,o;if(arguments.length>=2)o=arguments[1];else do{if(s in r){o=r[s++];break}if(++s>=i)throw new TypeError("reduce of empty array with no initial value")}while(!0);for(;s<i;s++)s in r&&(o=t.call(void 0,o,r[s],s,n));return o}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(t){var n=F(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0;if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");if(!i&&arguments.length==1)throw new TypeError("reduceRight of empty array with no initial value");var s,o=i-1;if(arguments.length>=2)s=arguments[1];else do{if(o in r){s=r[o--];break}if(--o<0)throw new TypeError("reduceRight of empty array with no initial value")}while(!0);do o in this&&(s=t.call(void 0,s,r[o],o,n));while(o--);return s});if(!Array.prototype.indexOf||[0,1].indexOf(1,2)!=-1)Array.prototype.indexOf=function(t){var n=g&&a(this)=="[object String]"?this.split(""):F(this),r=n.length>>>0;if(!r)return-1;var i=0;arguments.length>1&&(i=H(arguments[1])),i=i>=0?i:Math.max(0,r+i);for(;i<r;i++)if(i in n&&n[i]===t)return i;return-1};if(!Array.prototype.lastIndexOf||[0,1].lastIndexOf(0,-3)!=-1)Array.prototype.lastIndexOf=function(t){var n=g&&a(this)=="[object String]"?this.split(""):F(this),r=n.length>>>0;if(!r)return-1;var i=r-1;arguments.length>1&&(i=Math.min(i,H(arguments[1]))),i=i>=0?i:r-Math.abs(i);for(;i>=0;i--)if(i in n&&t===n[i])return i;return-1};Object.getPrototypeOf||(Object.getPrototypeOf=function(t){return t.__proto__||(t.constructor?t.constructor.prototype:o)});if(!Object.getOwnPropertyDescriptor){var y="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(t,n){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(y+t);if(!f(t,n))return;var r,i,s;r={enumerable:!0,configurable:!0};if(d){var u=t.__proto__;t.__proto__=o;var i=h(t,n),s=p(t,n);t.__proto__=u;if(i||s)return i&&(r.get=i),s&&(r.set=s),r}return r.value=t[n],r}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(t){return Object.keys(t)});if(!Object.create){var b;Object.prototype.__proto__===null?b=function(){return{__proto__:null}}:b=function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(t,n){var r;if(t===null)r=b();else{if(typeof t!="object")throw new TypeError("typeof prototype["+typeof t+"] != 'object'");var i=function(){};i.prototype=t,r=new i,r.__proto__=t}return n!==void 0&&Object.defineProperties(r,n),r}}if(Object.defineProperty){var E=w({}),S=typeof document=="undefined"||w(document.createElement("div"));if(!E||!S)var x=Object.defineProperty}if(!Object.defineProperty||x){var T="Property description must be an object: ",N="Object.defineProperty called on non-object: ",C="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(t,n,r){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(N+t);if(typeof r!="object"&&typeof r!="function"||r===null)throw new TypeError(T+r);if(x)try{return x.call(Object,t,n,r)}catch(i){}if(f(r,"value"))if(d&&(h(t,n)||p(t,n))){var s=t.__proto__;t.__proto__=o,delete t[n],t[n]=r.value,t.__proto__=s}else t[n]=r.value;else{if(!d)throw new TypeError(C);f(r,"get")&&l(t,n,r.get),f(r,"set")&&c(t,n,r.set)}return t}}Object.defineProperties||(Object.defineProperties=function(t,n){for(var r in n)f(n,r)&&Object.defineProperty(t,r,n[r]);return t}),Object.seal||(Object.seal=function(t){return t}),Object.freeze||(Object.freeze=function(t){return t});try{Object.freeze(function(){})}catch(k){Object.freeze=function(t){return function(n){return typeof n=="function"?n:t(n)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(t){return t}),Object.isSealed||(Object.isSealed=function(t){return!1}),Object.isFrozen||(Object.isFrozen=function(t){return!1}),Object.isExtensible||(Object.isExtensible=function(t){if(Object(t)===t)throw new TypeError;var n="";while(f(t,n))n+="?";t[n]=!0;var r=f(t,n);return delete t[n],r});if(!Object.keys){var L=!0,A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],O=A.length;for(var M in{toString:null})L=!1;Object.keys=function I(e){if(typeof e!="object"&&typeof e!="function"||e===null)throw new TypeError("Object.keys called on a non-object");var I=[];for(var t in e)f(e,t)&&I.push(t);if(L)for(var n=0,r=O;n<r;n++){var i=A[n];f(e,i)&&I.push(i)}return I}}Date.now||(Date.now=function(){return(new Date).getTime()});var _=" \n\f\r \u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\ufeff";if(!String.prototype.trim||_.trim()){_="["+_+"]";var D=new RegExp("^"+_+_+"*"),P=new RegExp(_+_+"*$");String.prototype.trim=function(){return String(this).replace(D,"").replace(P,"")}}var F=function(e){if(e==null)throw new TypeError("can't convert "+e+" to object");return Object(e)}})
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/examples/js/main.js b/priv/static/metrics-graphics-3.0-alpha3/examples/js/main.js deleted file mode 100644 index a123f92..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/examples/js/main.js +++ /dev/null @@ -1,125 +0,0 @@ -var theme = 'light'; - -(function() { - 'use strict'; - - //set the active pill and section on first load - var section = (document.location.hash) ? document.location.hash.slice(1) : 'lines'; - - $('#trunk').load('charts/' + section + '.htm', function() { - $('pre code').each(function(i, block) { - hljs.highlightBlock(block); - }); - }); - - $('.examples li a#goto-' + section).addClass('active'); - - //handle mouse clicks and so on - assignEventListeners(); - - function assignEventListeners() { - $('ul.examples li a.pill').on('click', function(event) { - event.preventDefault(); - $('ul.examples li a.pill').removeClass('active'); - $(this).addClass('active'); - - var section = $(this).attr('id').slice(5); - $('#trunk').load('charts/' + section + '.htm', function() { - $('pre code').each(function(i, block) { - hljs.highlightBlock(block); - }); - }); - - document.location.hash = section; - - return false; - }) - - $('#dark-css').on('click', function () { - theme = 'dark'; - - $('.missing') - .css('background-image', 'url(images/missing-data-dark.png)'); - - $('.wip') - .css('background-color', '#3b3b3b'); - - $('.trunk-section') - .css('border-top-color', '#5e5e5e'); - - $('.mg-missing-background') - .css('stroke', '#ccc'); - - $('.head ul li a.pill').removeClass('active'); - $(this).toggleClass('active'); - $('#dark').attr({href : 'css/metricsgraphics-demo-dark.css'}); - $('#dark-code').attr({href : 'css/railscasts.css'}); - $('#accessible').attr({href : ''}); - - return false; - }); - - $('#light-css').on('click', function () { - theme = 'light'; - - $('.missing') - .css('background-image', 'url(images/missing-data.png)'); - - $('.wip') - .css('background-color', '#f1f1f1'); - - $('.trunk-section') - .css('border-top-color', '#ccc'); - - $('.mg-missing-background') - .css('stroke', 'blue'); - - $('.head ul li a.pill').removeClass('active'); - $(this).toggleClass('active'); - $('#dark').attr({href : ''}); - $('#dark-code').attr({href : ''}); - $('#accessible').attr({href : ''}); - - return false; - }); - - $('#accessible-css').on('click', function () { - $('.head ul li a.pill').removeClass('active'); - $(this).toggleClass('active'); - $('#accessible').attr({href : 'css/metricsgraphics-demo-accessible.css'}); - - return false; - }); - } - - // replace all SVG images with inline SVG - // http://stackoverflow.com/questions/11978995/how-to-change-color-of-svg - // -image-using-css-jquery-svg-image-replacement - $('img.svg').each(function() { - var $img = jQuery(this); - var imgID = $img.attr('id'); - var imgClass = $img.attr('class'); - var imgURL = $img.attr('src'); - - $.get(imgURL, function(data) { - // Get the SVG tag, ignore the rest - var $svg = jQuery(data).find('svg'); - - // Add replaced image's ID to the new SVG - if (typeof imgID !== 'undefined') { - $svg = $svg.attr('id', imgID); - } - // Add replaced image's classes to the new SVG - if (typeof imgClass !== 'undefined') { - $svg = $svg.attr('class', imgClass + ' replaced-svg'); - } - - // Remove any invalid XML tags as per http://validator.w3.org - $svg = $svg.removeAttr('xmlns:a'); - - // Replace image with new SVG - $img.replaceWith($svg); - - }, 'xml'); - }); -})(); diff --git a/priv/static/metrics-graphics-3.0-alpha3/gulp/index.js b/priv/static/metrics-graphics-3.0-alpha3/gulp/index.js deleted file mode 100644 index 5ddb739..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/gulp/index.js +++ /dev/null @@ -1,136 +0,0 @@ -// Gulp and plugins -var - gulp = require('gulp'), - umd = require('gulp-umd'), - rimraf = require('gulp-rimraf'), - uglify = require('gulp-uglify'), - concat = require('gulp-concat'), - rename = require('gulp-rename'), - //sass = require('gulp-sass'), // for building css from scss - //minifycss = require('gulp-minify-css'), // for minifiing css - jshint = require('gulp-jshint'), - testem = require('gulp-testem'), - connect = require('gulp-connect'), - babel = require('gulp-babel'); - -// paths -var - src = './src/js/', - dist = './dist/', - jsFiles = [ - 'MG.js', - 'misc/utility.js', - 'common/register.js', - 'common/hooks.js', - 'common/data_graphic.js', - 'common/bootstrap_tooltip_popover.js', - 'common/chart_title.js', - 'common/scales.js', - 'common/y_axis.js', - 'common/x_axis.js', - 'common/scales.js', - 'common/init.js', - 'common/markers.js', - 'common/rollover.js', - 'common/zoom.js', - 'common/brush.js', - 'common/window_listeners.js', - 'layout/bootstrap_dropdown.js', - 'layout/button.js', - 'charts/line.js', - 'charts/histogram.js', - 'charts/point.js', - 'charts/bar.js', - 'charts/table.js', - 'charts/missing.js', - 'misc/process.js', - 'misc/smoothers.js', - 'misc/formatters.js', - 'misc/transitions.js', - 'misc/markup.js', - 'misc/error.js' - ]; - - -gulp.task('default', ['jshint', 'test', 'build:js']); - -gulp.task('clean', function () { - return gulp.src([dist + 'metricsgraphics.js', dist + 'metricsgraphics.min.js'], {read: false}) - .pipe(rimraf()); -}); - -// build css files from scss -//gulp.task('build:css', ['clean'], function () { -// return gulp.src(scssFiles) -// .pipe(sass({includePaths: scssDependencies})) -// .pipe(minifycss()) -// .pipe(gulp.dest(dist)); -//}); - -// create 'metricsgraphics.js' and 'metricsgraphics.min.js' from source js -gulp.task('build:js', ['clean'], function () { - return gulp.src(jsFiles.map(path => src + path)) - .pipe(concat({path: 'metricsgraphics.js'})) - .pipe(babel({ - presets: ['env'] - })) - .pipe(umd( - { - dependencies:function() { - return [{ - name: 'd3', - amd: 'd3', - cjs: 'd3', - global: 'd3', - param: 'd3' - }]; - }, - exports: function() { - return "MG"; - }, - namespace: function() { - return "MG"; - } - } - )) - .pipe(gulp.dest(dist)) - .pipe(rename('metricsgraphics.min.js')) - .pipe(uglify()) - .pipe(gulp.dest(dist)); -}); - -// Check source js files with jshint -gulp.task('jshint', function () { - return gulp.src(jsFiles.map(fname => `src/js/${fname}`)) - .pipe(jshint()) - .pipe(jshint.reporter('default')) - .pipe(jshint.reporter('fail')) -}); - -// Run test suite server (testem') -gulp.task('test', function() { - return gulp.src(['']) - .pipe(testem({ - configFile: 'testem.json' - })); -}); - - -// Development server tasks -// NOTE: these paths will need changing when the SCSS source is ready -var roots = ['dist', 'examples', 'src', 'bower_components'], - watchables = roots.map(function(root) { - return root + '/**/*'; - }); - -gulp.task('dev:watch', function() { return gulp.watch(watchables, ['jshint', 'dev:reload']); }); -gulp.task('dev:reload', function() { return gulp.src(watchables).pipe(connect.reload()); }); -gulp.task('serve', ['jshint', 'dev:serve', 'dev:watch']); - -gulp.task('dev:serve', function() { - connect.server({ - root: roots, - port: 4300, - livereload: true - }); -}); diff --git a/priv/static/metrics-graphics-3.0-alpha3/gulpfile.js b/priv/static/metrics-graphics-3.0-alpha3/gulpfile.js deleted file mode 100644 index f60b303..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/gulpfile.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -require('./gulp'); diff --git a/priv/static/metrics-graphics-3.0-alpha3/index.js b/priv/static/metrics-graphics-3.0-alpha3/index.js deleted file mode 100644 index b6ac74a..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./dist/metricsgraphics') diff --git a/priv/static/metrics-graphics-3.0-alpha3/package.json b/priv/static/metrics-graphics-3.0-alpha3/package.json deleted file mode 100644 index 466febf..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "name": "metrics-graphics", - "version": "3.0.0-alpha3", - "description": "A library optimized for concise, principled data graphics and layouts", - "main": "dist/metricsgraphics.js", - "scripts": { - "build": "gulp build:js", - "lint": "gulp jshint", - "test": "gulp test", - "test-ci": "./node_modules/testem/testem.js ci testem.json", - "version": "npm run build && git add ." - }, - "repository": { - "type": "git", - "url": "git://github.com/metricsgraphics/metrics-graphics.git" - }, - "files": [ - "dist" - ], - "keywords": [ - "metrics-graphics", - "metricsgraphicsjs", - "metricsgraphics", - "metricsgraphics.js", - "d3 charts" - ], - "author": "Mozilla", - "contributors": [ - "Ali Almossawi", - "Hamilton Ulmer", - "William Lachance" - ], - "license": "MPL-2.0", - "bugs": { - "url": "https://github.com/metricsgraphics/metrics-graphics/issues" - }, - "engines": { - "node": ">=0.8.0" - }, - "homepage": "http://metricsgraphicsjs.org", - "dependencies": { - "d3": "^5.0.0" - }, - "peerDependencies": { - "jquery": ">=1.11.1" - }, - "devDependencies": { - "babel-core": "^6.26.0", - "babel-preset-env": "^1.6.1", - "gulp": "^3.8.10", - "gulp-babel": "^7.0.1", - "gulp-concat": "^2.4.2", - "gulp-connect": "^5.0.0", - "gulp-jshint": "^2.1.0", - "gulp-rename": "^1.2.0", - "gulp-rimraf": "^0.2.0", - "gulp-testem": "0.0.1", - "gulp-uglify": "3.0.1", - "gulp-umd": "^2.0.0", - "jquery": ">=1.11.1", - "jshint": "^2.9.5", - "qunitjs": "^2.0.0", - "require-dir": "^1.0.0", - "testem": "^2.0.0" - } -} diff --git a/priv/static/metrics-graphics-3.0-alpha3/renovate.json b/priv/static/metrics-graphics-3.0-alpha3/renovate.json deleted file mode 100644 index 99e531e..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/renovate.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": [ - "config:base", - ":maintainLockFilesWeekly", - ":prNotPending" - ], - "pinVersions": false -} diff --git a/priv/static/metrics-graphics-3.0-alpha3/src/index.html b/priv/static/metrics-graphics-3.0-alpha3/src/index.html deleted file mode 100644 index 4f9ce02..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/src/index.html +++ /dev/null @@ -1,238 +0,0 @@ -<html lang='en'> -<head> - <meta content='text/html; charset=utf-8' http-equiv='Content-Type'> - <link href='images/og-logo.png' rel='icon' type='image/png' /> - <title>MetricsGraphics.js (DEV)</title> - - <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,700' rel='stylesheet' type='text/css'> - <link href='https://fonts.googleapis.com/css?family=PT+Serif:400,700,400italic' rel='stylesheet' type='text/css'> - <link href='https://netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.css' rel='stylesheet' type='text/css'> - <link href='https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css' rel='stylesheet' type='text/css'> - - <!-- loaded from dist --> - <link href='metricsgraphics.css' rel='stylesheet' type='text/css'> - <!-- loaded from examples/ --> - <link href='css/metricsgraphics-demo.css' rel='stylesheet' type='text/css'> - - <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script> - <script src="https://d3js.org/d3.v4.min.js"></script> - <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js" charset="utf-8"></script> - - <!-- dev start --> - <script src='js/MG.js'></script> - <script src='js/misc/utility.js'></script> - <script src='js/common/data_graphic.js'></script> - <script src='js/common/hooks.js'></script> - <script src='js/common/register.js'></script> - <script src='js/common/bootstrap_tooltip_popover.js'></script> - <script src='js/common/chart_title.js'></script> - <script src='js/common/scales.js'></script> - <script src='js/common/y_axis.js'></script> - <script src='js/common/x_axis.js'></script> - <script src='js/common/init.js'></script> - <script src='js/common/markers.js'></script> - <script src='js/common/rollover.js'></script> - <script src='js/common/zoom.js'></script> - <script src='js/common/brush.js'></script> - <script src='js/common/window_listeners.js'></script> - <script src='js/layout/bootstrap_dropdown.js'></script> - <script src='js/layout/button.js'></script> - <script src='js/charts/line.js'></script> - <script src='js/charts/histogram.js'></script> - <script src='js/charts/point.js'></script> - <script src='js/charts/bar.js'></script> - <script src='js/charts/table.js'></script> - <script src='js/charts/missing.js'></script> - <script src='js/misc/process.js'></script> - <script src='js/misc/smoothers.js'></script> - <script src='js/misc/formatters.js'></script> - <script src='js/misc/transitions.js'></script> - <script src='js/misc/error.js'></script> - <!-- dev end --> - - <style> - body { - background-color: #fcfcfc; - } - - .container { - width: 90%; - min-width: 960px; - } - - .data textarea { - font-family: Menlo,Monaco,Consolas,"Courier New",monospace; - font-size: 11px; - height: 100%; - width: 100%; - } - - .footer { - background-image: url(images/divider.png); - background-repeat: no-repeat; - background-position: center 115px; - padding-top: 70px; - margin-bottom: 20px; - } - - .hightop { - margin-top: 40px; - } - - #logo { - margin: 15px 0 10px 0; - } - - .main-windows-titles { - color: #3b3b3b; - font-size: 16px; - padding-bottom: 5px; - text-align: center; - } - - .main-windows-titles .js-title a { - position: absolute; - right: 0; - font-size: 70%; - margin: 7px 1px 0 0; - } - - .main-windows .data, - .main-windows .js, - .main-windows .result { - height: 400px; - } - - p { - padding-top: 6px; - } - - textarea, - #editor { - border-radius: 3px; - border: none; - overflow: auto; - outline: none; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; - padding: 10px; - border: 1px solid #ccc; - } - - .btn { - background-color: steelblue; - color: white; - margin-top: 34px; - outline: none; - position: absolute; - right: 7px; - z-index: 99; - } - - .btn.reset { - right: 65px; - } - - .btn:hover, - .btn:active, - .btn:visited { - color: #efefef; - outline: none; - } - </style> -</head> - -<body> - <div class='container'> - <div class='head'> - <img src='images/logo.svg' id='logo' class='svg' /> - </div> - </div> - - <div class='container'> - <div class='row main-windows-titles'> - <div class='col-xs-2'>Data</div> - <div class='js-title col-xs-5'> - JavaScript <a href='https://github.com/mozilla/metrics-graphics/wiki/List-of-Options#list-of-options' target='_blank'>See Full List of Options</a> - <button type='button' class='update btn'>Run</button> - <button type='button' class='reset btn'>Reset</button> - </div> - </div> - <div class='row main-windows'> - <div class='data col-xs-2'> - <textarea></textarea> - </div> - <div class='js col-xs-5' id='editor'></div> - <div class='result text-center col-xs-5'></div> - </div> - </div> - - <div class='container footer'> - Created by <a href='https://twitter.com/alialmossawi'>Ali Almossawi</a> and - <a href='https://github.com/hamilton'>Hamilton Ulmer</a> - <br />2014-2015 · Shared under a <a href='http://www.mozilla.org/MPL/2.0/'> - Mozilla Public License</a> - </div> - - <script> - var mgKey = 'mg-dev', - editor, - persisted, - defaultCall = '//modify away!\n' - + 'MG.data_graphic({\n' - + ' title: "UFO Sightings",\n' - + ' description: "Yearly UFO sightings from 1945 to 2010.",\n' - + ' data: JSON.parse(document.querySelector(\'.data textarea\').value),\n' - + ' markers: [{\'year\': 1964, \'label\': \'"The Creeping Terror" released\'}],\n' - + ' width: 400,\n' - + ' height: 250,\n' - + ' target: ".result",\n' - + ' x_accessor: "year",\n' - + ' y_accessor: "sightings",\n' - + '});'; - - persisted = JSON.parse(localStorage.getItem(mgKey), null, 2) || {}; - - editor = ace.edit("editor"); - editor.getSession().setMode("ace/mode/javascript"); - editor.setValue(persisted.script || defaultCall); - editor.gotoLine(persisted.line || 1); - editor.setHighlightActiveLine(false); - - d3.select('.update').on('click', function() { - persisted.script = editor.getValue(); - persisted.data = JSON.parse(document.querySelector('.data textarea').value); - saveState(); - run(); - }); - - d3.select('.reset').on('click', function() { - clearState(); - document.location = document.location; - }); - - if (persisted.data) { - document.querySelector('.data textarea').value = JSON.stringify(persisted.data, null, 2); - run(); - } else { - d3.json('data/ufo-sightings.json', function(data) { - document.querySelector('.data textarea').value = JSON.stringify(data, null, 2); - run(); - }) - } - - function run() { - eval(editor.getValue()); - } - - function saveState(){ - localStorage.setItem(mgKey, JSON.stringify(persisted)); - } - - function clearState() { - localStorage.clear(mgKey); - } - </script> -</body> -</html> diff --git a/priv/static/metrics-graphics-3.0-alpha3/src/scss/.gitignore b/priv/static/metrics-graphics-3.0-alpha3/src/scss/.gitignore deleted file mode 100644 index e69de29..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/src/scss/.gitignore +++ /dev/null diff --git a/priv/static/metrics-graphics-3.0-alpha3/testem.json b/priv/static/metrics-graphics-3.0-alpha3/testem.json deleted file mode 100644 index 659fe12..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/testem.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "framework": "qunit", - "src_files": [ - "node_modules/jquery/dist/jquery.js", - "node_modules/d3/dist/d3.js", - - "src/js/MG.js", - "src/js/misc/utility.js", - "src/js/common/register.js", - "src/js/common/hooks.js", - "src/js/common/data_graphic.js", - "src/js/common/bootstrap_tooltip_popover.js", - "src/js/common/chart_title.js", - "src/js/common/y_axis.js", - "src/js/common/x_axis.js", - "src/js/common/init.js", - "src/js/common/scales.js", - "src/js/common/rollover.js", - "src/js/common/markers.js", - "src/js/common/window_listeners.js", - "src/js/layout/bootstrap_dropdown.js", - "src/js/layout/button.js", - "src/js/charts/line.js", - "src/js/charts/histogram.js", - "src/js/charts/point.js", - "src/js/charts/bar.js", - "src/js/charts/table.js", - "src/js/charts/missing.js", - "src/js/misc/process.js", - "src/js/misc/smoothers.js", - "src/js/misc/formatters.js", - "src/js/misc/transitions.js", - "src/js/misc/error.js", - - "tests/helpers.js", - - "tests/**/*_test.js" - ], - "launch_in_ci": [ - "Chrome" - ], - "launch_in_dev": [ - "PhantomJS", - "Chrome" - ], - "browser_args": { - "Chrome": [ "--headless", "--disable-gpu", "--remote-debugging-port=9222" ] - }, - "phantomjs_debug_port": 9000 -} diff --git a/priv/static/metrics-graphics-3.0-alpha3/tests/charts/bar_test.js b/priv/static/metrics-graphics-3.0-alpha3/tests/charts/bar_test.js deleted file mode 100644 index db02b56..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/tests/charts/bar_test.js +++ /dev/null @@ -1,95 +0,0 @@ -var target = '#qunit-fixture', - defaults; - -module('bar', { - setup: function() { - defaults = { - target: target, - chart_type: 'bar', - x_accessor: 'value', - y_accessor: 'label', - transition_on_update: false, - data: [{ - label: 'Bar 1', - value: 100 - },{ - label: 'Bar 2', - value: 200 - },{ - label: 'Bar 3', - value: 300 - }] - }; - } -}); - -test('Correct number of bars are added', function() { - expect(1); - MG.data_graphic(defaults); - equal(document.querySelectorAll('.mg-bar').length, 3, 'Should have 3 bars'); -}); - -test('Triggers callbacks when provided', function() { - var mouseoverCalled = false, - mousemoveCalled = false, - mouseoutCalled = false, - - params = extend(defaults, { - mouseover: function() { - mouseoverCalled = true; - }, - mousemove: function() { - mousemoveCalled = true; - }, - mouseout: function() { - mouseoutCalled = true; - } - }); - - MG.data_graphic(params); - - var bar = document.getElementsByClassName('mg-bar-rollover')[0]; - - bar.dispatchEvent(generateMouseEvent('mouseover')); - equal(mouseoverCalled, true, 'mouseover was called'); - - bar.dispatchEvent(generateMouseEvent('mousemove')); - equal(mousemoveCalled, true, 'mousemove was called'); - - bar.dispatchEvent(generateMouseEvent('mouseout')); - equal(mouseoutCalled, true, 'mouseout was called'); -}); - -// test('When updating', function() { -// var bars = [{ -// label: 'Bar 1', -// value: 100, -// predictor: 75, -// baseline: 50 -// }]; - -// var params = extend(defaults, { -// data: bars, -// height: 100, -// width: 300, -// orientation: 'vertical', -// predictor_accessor: 'predictor', -// baseline_accessor: 'baseline', -// animate_on_load: false, -// transition_on_update: false -// }); - -// MG.data_graphic(params); -// equal(164, d3.select(target).select('.mg-barplot .mg-bar').attr('width'), 'initial bar size is correct'); -// equal(123, d3.select(target).select('.mg-barplot .mg-bar-prediction').attr('width'), 'initial predictor size is correct'); -// equal(160, d3.select(target).select('.mg-barplot .mg-bar-baseline').attr('x1'), 'initial baseline position is correct'); - -// params.data[0][0].value = 50; -// params.data[0][0].predictor = 100; -// params.data[0][0].baseline = 75; - -// MG.data_graphic(params); -// equal(82, d3.select(target).select('.mg-barplot .mg-bar').attr('width'), 'the bars are redrawn with correct sizes'); -// equal(164, d3.select(target).select('.mg-barplot .mg-bar-prediction').attr('width'), 'the predictors are redrawn with correct sizes'); -// equal(201, d3.select(target).select('.mg-barplot .mg-bar-baseline').attr('x1'), 'the baseline is redrawn in the correct position'); -// }); diff --git a/priv/static/metrics-graphics-3.0-alpha3/tests/charts/histogram_test.js b/priv/static/metrics-graphics-3.0-alpha3/tests/charts/histogram_test.js deleted file mode 100644 index 2e69e70..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/tests/charts/histogram_test.js +++ /dev/null @@ -1,64 +0,0 @@ -module('histogram'); - - -// THIS TEST NEEDS TO BE REWRITTEN AS A RESULT OF #614 -// test('A solitary active datapoint exists', function() { -// var params = { -// target: '#qunit-fixture', -// data: d3.range(10000).map(d3.random.bates(10)), -// chart_type: 'histogram', -// linked: true -// }; - -// MG.data_graphic(params); -// equal(document.querySelectorAll('.mg-active-datapoint').length, 1, 'One active datapoint exists'); -// }); - -test('Rollovers exist', function() { - var params = { - target: '#qunit-fixture', - data: d3.range(10000).map(d3.randomBates(10)), - chart_type: 'histogram', - linked: true - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-rollover-rect'), 'Rollovers exist'); -}); - -test('We have only one set of rollovers', function() { - var params = { - target: '#qunit-fixture', - data: d3.range(10000).map(d3.randomBates(10)), - chart_type: 'histogram', - linked: true - }; - - MG.data_graphic(params); - equal(document.querySelectorAll('.mg-rollover-rect').length, 1, 'One set of rollovers exists'); -}); - -test('Linked chart has the required class set', function() { - var params = { - target: '#qunit-fixture', - data: d3.range(10000).map(d3.randomBates(10)), - chart_type: 'histogram', - linked: true - }; - - MG.data_graphic(params); - var matches = document.querySelector(params.target + ' svg').getAttribute('class').match(/linked/); - ok(matches, 'Linked chart has class `linked` set'); -}); - -test('Histogram exists', function() { - var params = { - target: '#qunit-fixture', - data: d3.range(10000).map(d3.randomBates(10)), - chart_type: 'histogram', - linked: true - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-histogram'), 'Histogram exists'); -}); diff --git a/priv/static/metrics-graphics-3.0-alpha3/tests/charts/line_test.js b/priv/static/metrics-graphics-3.0-alpha3/tests/charts/line_test.js deleted file mode 100644 index 530f76b..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/tests/charts/line_test.js +++ /dev/null @@ -1,289 +0,0 @@ -module('line'); - -test('Confidence band is added', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12, 'l': 10, 'u': 14}, - {'date': new Date('2014-03-01'), 'value': 18, 'l': 16, 'u': 20}], - show_confidence_band: ['l', 'u'] - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-confidence-band'), 'Confidence band is added'); -}); - -test('Only one confidence is added on multiple calls to the same target element', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12, 'l': 10, 'u': 14}, - {'date': new Date('2014-03-01'), 'value': 18, 'l': 16, 'u': 20}], - show_confidence_band: ['l', 'u'], - title: 'confidence added multiple calls' - }; - var params2 = MG.clone(params) - MG.data_graphic(params); - MG.data_graphic(params2); - equal(document.querySelectorAll(params.target + ' .mg-confidence-band').length, 1, 'We only have one confidence band'); -}); - -test('args.area set to true', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}] - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-main-area'), 'Path set for area'); -}); - -test('args.area set to false', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - area: false - }; - - MG.data_graphic(params); - equal(document.querySelector('.mg-main-area'), null, 'No path for area'); -}); - -// NEEDS TO BE REWRITTEN IN LIGHT OF #614 -// test('A solitary active datapoint exists', function() { -// var params = { -// target: '#qunit-fixture', -// data: [{'date': new Date('2014-01-01'), 'value': 12}, -// {'date': new Date('2014-03-01'), 'value': 18}] -// }; - -// MG.data_graphic(params); -// equal(document.querySelectorAll('.mg-active-datapoint').length, 1, 'One active datapoint exists'); -// }); - -test('A solitary rollover circle exists', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}] - }; - - MG.data_graphic(params); - equal(document.querySelectorAll('.mg-line-rollover-circle').length, 1, 'One rollover circle exists'); -}); - -test('Rollovers work for single lines', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}] - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-rollover-rect'), 'Rollovers exist'); -}); - -test('Rollovers work for multiple lines', function() { - var params = { - target: '#qunit-fixture', - data: [[{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - [{'date': new Date('2014-01-01'), 'value': 120}, - {'date': new Date('2014-03-01'), 'value': 180}]] - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-voronoi'), 'Rollovers exist'); -}); - -test('We have only one set of rollovers for single lines', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}] - }; - - MG.data_graphic(params); - equal(document.querySelectorAll('.mg-rollover-rect').length, 1, 'One set of rollovers exists'); -}); - -test('We have only one set of rollovers for multiple lines', function() { - var params = { - target: '#qunit-fixture', - data: [[{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - [{'date': new Date('2014-01-01'), 'value': 120}, - {'date': new Date('2014-03-01'), 'value': 180}]] - }; - - MG.data_graphic(params); - equal(document.querySelectorAll('.mg-voronoi').length, 1, 'One set of rollovers exists'); -}); - -test('We use the rect-style rollovers when `aggregate_rolloveres == true`', function() { - var params = { - target: '#qunit-fixture', - data: [[{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - [{'date': new Date('2014-01-01'), 'value': 120}, - {'date': new Date('2014-03-01'), 'value': 180}]], - aggregate_rollover: true - }; - - MG.data_graphic(params); - - // ensure rollover returns aggregated result data - equal(document.querySelectorAll('.mg-voronoi').length, 0, 'Voronoi rollover is not generated'); - equal(document.querySelectorAll('.mg-rollover-rect').length, 1, 'Rect rollover is generated'); -}); - -test('There are as many lines as data series (one)', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}] - }; - - MG.data_graphic(params); - equal(document.querySelectorAll('.mg-main-line').length, 1, 'One line exists'); -}); - -test('There are as many lines as data series (two)', function() { - var params = { - target: '#qunit-fixture', - data: [[{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - [{'date': new Date('2014-01-01'), 'value': 120}, - {'date': new Date('2014-03-01'), 'value': 180}]] - }; - - MG.data_graphic(params); - equal(document.querySelectorAll('.mg-main-line').length, 2, 'Two lines exist'); -}); - -test('There are as many lines as data series (two) on multiple calls to an existing chart', function() { - var params = { - target: '#qunit-fixture', - data: [[{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - [{'date': new Date('2014-01-01'), 'value': 120}, - {'date': new Date('2014-03-01'), 'value': 180}]] - }; - var params2 = MG.clone(params); - MG.data_graphic(params); - MG.data_graphic(params2); - - equal(document.querySelectorAll('.mg-main-line').length, 2, 'Two lines exist'); -}); - -test('No zombie lines when we update a chart with fewer lines', function() { - var params = { - target: '#qunit-fixture', - data: [[{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - [{'date': new Date('2014-01-01'), 'value': 120}, - {'date': new Date('2014-03-01'), 'value': 180}]] - }; - - var params2 = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}] - }; - - MG.data_graphic(params); - MG.data_graphic(params2); - - equal(document.querySelectorAll('.mg-main-line').length, 1, 'One line exists'); -}); - -test('Rollover circle is visible on load if the dataset is of length 1', function() { - var data = [{"date": '2014-02-01', "value": 6}]; - var data = MG.convert.date(data, 'date'); - - MG.data_graphic({ - data: data, - target: "#qunit-fixture" - }); - - deepEqual(d3.select('.mg-line-rollover-circle').style('opacity'), "1", 'Rollover circle is visible'); -}); - -// NEEDS TO BE REWRITTEN IN LIGHT OF #614 -// test('Only one active data point container is added on multiple calls to the same target element', function() { -// var params = { -// target: '#qunit-fixture', -// data: [{'date': new Date('2014-01-01'), 'value': 12, 'l': 10, 'u': 14}, -// {'date': new Date('2014-03-01'), 'value': 18, 'l': 16, 'u': 20}] -// }; - -// MG.data_graphic(params); -// MG.data_graphic(MG.clone(params)); - -// equal(document.querySelectorAll('.mg-active-datapoint-container').length, 1, 'We only have one active data point container'); -// }); - -test('No zombie lines when custom_line_color_map is set', function() { - var data = []; - data[0] = [{'date': new Date('2015-03-05'), 'value': 12000}]; - data[1] = [{'date': new Date('2015-03-06'), 'value': 35000}]; - data[2] = [{'date': new Date('2015-03-07'), 'value': 23000},{'date': new Date('2015-03-08'), 'value': 20000}]; - - MG.data_graphic({ - data: data, - target: '#qunit-fixture', - max_data_size: 5, - custom_line_color_map: [3,4,5] - }); - - MG.data_graphic({ - data: data, - target: '#qunit-fixture', - max_data_size: 5, - custom_line_color_map: [1,2,3] - }); - - equal(document.querySelectorAll('.mg-main-line.mg-line5-color').length, 0, 'Line 5 was removed on update'); -}); - -test('Only one line legend is added on multiple calls to the same target element', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - legend: ['US', 'CA'], - line_legends: true - }; - - MG.data_graphic(params); - MG.data_graphic(MG.clone(params)); - - equal(document.querySelectorAll('.mg-line-legend').length, 1, 'We only have one mg-line-legend'); -}); - -test('Only one active data point container added on multiple calls to the same target element (lines)', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}] - }; - - MG.data_graphic(params); - MG.data_graphic(MG.clone(params)); - - equal(document.querySelectorAll('.mg-active-datapoint-container').length, 1, 'We only have one mg-active-datapoint-container with lines'); -}); - -test('When 1 data series is empty (out of 2) and missing_is_zero is true, remaining line is rendered', function() { - var data = []; - data[0] = []; - data[1] = [{'date': new Date('2015-03-07'), 'value': 23000},{'date': new Date('2015-03-08'), 'value': 20000}]; - - MG.data_graphic({ - target: '#qunit-fixture', - data: data, - missing_is_zero: true - }); - - equal(document.querySelectorAll('.mg-main-line').length, 1, 'Line for non-empty data series is still rendered'); -}); diff --git a/priv/static/metrics-graphics-3.0-alpha3/tests/charts/missing_test.js b/priv/static/metrics-graphics-3.0-alpha3/tests/charts/missing_test.js deleted file mode 100644 index f50ee2a..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/tests/charts/missing_test.js +++ /dev/null @@ -1,90 +0,0 @@ -module('missing'); - -test('Missing chart\'s text matches specified missing_text', function() { - var params = { - target: '#qunit-fixture', - chart_type: 'missing-data', - missing_text: 'In an astral plane that was never meant to fly...' - }; - - MG.data_graphic(params); - equal(document.querySelector('.mg-missing-text').textContent, - params.missing_text, - 'Missing chart\'s text matches missing_text'); -}); - -test('Only one mg-missing-pane on multiple calls to the same target element', function() { - var params = { - target: '#qunit-fixture', - chart_type: 'missing-data', - missing_text: 'In an astral plane that was never meant to fly...' - }; - - MG.data_graphic(params); - MG.data_graphic(MG.clone(params)); - - equal(document.querySelectorAll(params.target + ' .mg-missing-pane').length, 1, 'We only have one mg-missing-pane'); -}); - -test('Only one mg-missing-text on multiple calls to the same target element', function() { - var params = { - target: '#qunit-fixture', - chart_type: 'missing-data', - missing_text: 'In an astral plane that was never meant to fly...' - }; - - MG.data_graphic(params); - MG.data_graphic(MG.clone(params)); - - equal(document.querySelectorAll(params.target + ' .mg-missing-text').length, 1, 'We only have one mg-missing-text'); -}); - -test('missing chart obeys full_width: true', function() { - var params = { - target: '#qunit-fixture', - chart_type: 'missing-data', - full_width: true, - missing_text: 'In an astral plane that was never meant to fly...' - }; - document.querySelector('#qunit-fixture').style.width='700px'; - - MG.data_graphic(params); - - equal(document.querySelector('#qunit-fixture svg').getAttribute('width'), 700, 'The missing chart svg has same width as parent element.'); -}); - -test('missing chart obeys full_height: true', function() { - var params = { - target: '#qunit-fixture', - chart_type: 'missing-data', - full_height: true, - missing_text: 'In an astral plane that was never meant to fly...' - }; - document.querySelector('#qunit-fixture').style.height='700px'; - - MG.data_graphic(params); - - equal(document.querySelector('#qunit-fixture svg').getAttribute('height'), 700, 'The missing chart svg has same width as parent element.'); -}); - -test('Missing chart\'s width is set correctly on subsequent calls to existing chart', function() { - var params_0 = { - target: '#qunit-fixture', - chart_type: 'missing-data', - missing_text: 'In an astral plane that was never meant to fly...' - }; - - var params = { - target: '#qunit-fixture', - chart_type: 'missing-data', - missing_text: 'In an astral plane that was never meant to fly...', - width: 200, - height: 100, - }; - - MG.data_graphic(params_0); - MG.data_graphic(params); - - var width = document.querySelector(params.target + ' svg').clientWidth; - ok(width == 200, 'SVG\'s width matches latest specified width'); -}); diff --git a/priv/static/metrics-graphics-3.0-alpha3/tests/charts/point_test.js b/priv/static/metrics-graphics-3.0-alpha3/tests/charts/point_test.js deleted file mode 100644 index e26fc58..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/tests/charts/point_test.js +++ /dev/null @@ -1,137 +0,0 @@ -module('point'); -// this test doesn't work properly. -// test('A solitary active datapoint exists', function() { -// var params = { -// target: '#qunit-fixture', -// data: [{'date': new Date('2014-01-01'), 'value': 12}, -// {'date': new Date('2014-03-01'), 'value': 18}], -// chart_type: 'point' -// }; - -// MG.data_graphic(params); -// equal(document.querySelectorAll('.mg-active-datapoint').length, 1, 'One active datapoint exists'); -// }); - -test('Rollovers exist', function() { - var params = { - target: '#qunit-fixture', - data: [[{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - [{'date': new Date('2014-01-01'), 'value': 120}, - {'date': new Date('2014-03-01'), 'value': 180}]], - chart_type: 'point' - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-voronoi'), 'Rollovers exist'); -}); - -test('We have only one set of rollovers', function() { - var params = { - target: '#qunit-fixture', - data: [[{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - [{'date': new Date('2014-01-01'), 'value': 120}, - {'date': new Date('2014-03-01'), 'value': 180}]], - chart_type: 'point' - }; - - MG.data_graphic(params); - equal(document.querySelectorAll('.mg-voronoi').length, 1, 'One set of rollovers exists'); -}); - -test('args.x_rug', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - x_rug: true, - chart_type: 'point' - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-x-rug'), 'X-axis rugplot exists'); -}); - -test('Only one rugplot is added on multiple calls to the same target element', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - x_rug: true, - chart_type: 'point' - }; - - MG.data_graphic(params); - MG.data_graphic(MG.clone(params)); - - equal(document.querySelectorAll('.mg-x-rug').length, 2, 'We only have one rugplot (two ticks) on the x-axis'); -}); - -test('args.y_rug', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - y_rug: true, - chart_type: 'point' - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-y-rug'), 'Y-axis rugplot exists'); -}); - -test('Only one rugplot is added on multiple calls to the same target element', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - y_rug: true, - chart_type: 'point' - }; - - MG.data_graphic(params); - MG.data_graphic(MG.clone(params)); - equal(document.querySelectorAll('.mg-y-rug').length, 2, 'We only have one rugplot (two ticks) on the y-axis'); -}); - -test('args.least_squares', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - chart_type: 'point', - least_squares: true - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-least-squares-line'), 'Least-squares line exists'); -}); - -test('Only one least-squares line is added on multiple calls to the same target element', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - chart_type: 'point', - least_squares: true - }; - - MG.data_graphic(params); - MG.data_graphic(MG.clone(params)); - equal(document.querySelectorAll('.mg-least-squares-line').length, 1, 'We only have one least-squares line'); -}); - -test('Only one active data point container added on multiple calls to the same target element (points)', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - chart_type: 'point' - }; - - MG.data_graphic(params); - MG.data_graphic(MG.clone(params)); - - equal(document.querySelectorAll('.mg-active-datapoint-container').length, 1, 'We only have one mg-active-datapoint-container with points'); -}); diff --git a/priv/static/metrics-graphics-3.0-alpha3/tests/common/.gitkeep b/priv/static/metrics-graphics-3.0-alpha3/tests/common/.gitkeep deleted file mode 100644 index e69de29..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/tests/common/.gitkeep +++ /dev/null diff --git a/priv/static/metrics-graphics-3.0-alpha3/tests/common/chart_title_test.js b/priv/static/metrics-graphics-3.0-alpha3/tests/common/chart_title_test.js deleted file mode 100644 index 6d71dff..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/tests/common/chart_title_test.js +++ /dev/null @@ -1,93 +0,0 @@ -module('chart_title'); - -test('Chart title is updated', function() { - var params = { - title: 'foo', - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}] - }; - - var params2 = MG.clone(params); - params2.title = 'bar'; - - MG.data_graphic(params); - MG.data_graphic(params2); - - equal(document.querySelector('.mg-chart-title').textContent, 'bar', 'Chart title is foo'); -}); - -test('Chart title is removed if title is set to blank', function() { - var params = { - title: 'foo', - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}] - }; - - var params2 = MG.clone(params); - params2.title = ''; - - MG.data_graphic(params); - MG.data_graphic(params2); - equal(document.querySelector('.mg-chart-title'), null, 'Chart title is not added'); -}); - -test('Chart title is removed if title is not set', function() { - var params = { - title: 'foo', - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}] - }; - - var params2 = MG.clone(params); - delete params2.title; - - MG.data_graphic(params); - MG.data_graphic(params2); - equal(document.querySelector('.mg-chart-title'), null, 'Chart title is not added'); -}); - -test('When a description is set, we get a question mark', function() { - var params = { - title: 'foo', - description: 'bar', - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - show_tooltips: true - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-chart-description'), 'Description icon exists'); -}); - -test('When an error is set, we get an exclamation icon', function() { - var params = { - title: 'foo', - description: 'bar', - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - error: 'lorem ipsum' - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-chart-title .mg-warning'), 'Error icon exists'); -}); - -test('Chart title is not duplicated on redraw', function() { - var params = { - title: 'foo', - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}] - }; - - var params2 = MG.clone(params); - MG.data_graphic(params); - MG.data_graphic(params2); - - equal(document.querySelectorAll('.mg-chart-title').length, 1, 'there is once chart title'); -}); diff --git a/priv/static/metrics-graphics-3.0-alpha3/tests/common/data_graphic_test.js b/priv/static/metrics-graphics-3.0-alpha3/tests/common/data_graphic_test.js deleted file mode 100644 index 8051483..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/tests/common/data_graphic_test.js +++ /dev/null @@ -1,59 +0,0 @@ -module('data_graphic'); - -test('Required arguments are set', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-11-01'), 'value': 12}, - {'date': new Date('2014-11-02'), 'value': 18}] - }; - - MG.data_graphic(params); - - ok(params.width, 'args.width is set'); - ok(params.height, 'args.height is set'); - ok(params.data, 'args.data is set'); - ok(params.target, 'args.target is set'); -}); - -test('Dom element works as target', function() { - var params = { - target: document.getElementById('qunit-fixture'), - data: [{'date': new Date('2014-11-01'), 'value': 12}, - {'date': new Date('2014-11-02'), 'value': 18}] - }; - - MG.data_graphic(params); - - ok(document.querySelector('#qunit-fixture svg') != null, 'passing in dom element works properly'); -}); - -// Can be removed in 2.x -test('Correctly aliases callbacks when using 1.x-style method names', function() { - var mouseoverCalled = false, - mouseoutCalled = false, - - params = { - target: '#qunit-fixture', - data: [{value: 1, label: 'One'}], - chart_type: 'bar', - rollover_callback: function() { - mouseoverCalled = true; - }, - rollout_callback: function() { - mouseoutCalled = true; - } - }; - - MG.data_graphic(params); - - var bar = document.getElementsByClassName('mg-bar-rollover')[0]; - - bar.dispatchEvent(generateMouseEvent('mouseover')); - equal(mouseoverCalled, true, 'rollover_callback was called'); - - bar.dispatchEvent(generateMouseEvent('mouseout')); - equal(mouseoutCalled, true, 'rollout_callback was called'); - - ok(MG.deprecations.rollover_callback.warned, 'rollover_callback deprecation notice displayed'); - ok(MG.deprecations.rollout_callback.warned, 'rollout_callback deprecation notice displayed'); -}); diff --git a/priv/static/metrics-graphics-3.0-alpha3/tests/common/hooks_test.js b/priv/static/metrics-graphics-3.0-alpha3/tests/common/hooks_test.js deleted file mode 100644 index 1ba30d3..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/tests/common/hooks_test.js +++ /dev/null @@ -1,159 +0,0 @@ -module('hooks', { - setup: function() { - delete MG._hooks.test; - } -}); - -test('multiple hooks with the same name execute in order', function() { - var result = ''; - - function hookOne() { - result = result + 'one'; - } - - function hookTwo() { - result = result + 'two'; - } - - MG.add_hook('test', hookOne); - MG.add_hook('test', hookTwo); - - MG.call_hook('test'); - - equal(result, 'onetwo', 'both hooks are called'); -}); - -test('hooks can have context', function() { - var result = {}; - - function contextedHook() { - this.foo = 'bar'; - } - - MG.add_hook('test', contextedHook, result); - - MG.call_hook('test'); - - equal(result.foo, 'bar', 'exectued in the correct context'); -}); - -test('hooks accept single arguments', function() { - var result; - - function singleArgHook(arg) { - result = arg; - equal(typeof arg, 'string', 'correctly passed as a string') - } - - MG.add_hook('test', singleArgHook, null); - - MG.call_hook('test', 'one'); - - equal(result, 'one', 'single argument is received'); -}); - - -test('hooks accept multiple arguments', function() { - var result; - - function multipleArgHook(arg1, arg2, arg3) { - result = [arg1, arg2, arg3].join(' '); - - ok([arg1, arg2, arg3].every(function(arg) { - return typeof arg === 'string'; - }), 'correctly passed as strings'); - } - - MG.add_hook('test', multipleArgHook); - - MG.call_hook('test', 'one', 'two', 'three'); - - equal(result, 'one two three', 'multiple arguments are passed correctly'); -}); - -test('hooks are chained - result from one passed into the next', function() { - var initial = 2, - result; - - function hookOne(arg) { - return arg * 2; - } - - function hookTwo(arg) { - return arg - 1; - } - - MG.add_hook('test', hookOne); - MG.add_hook('test', hookTwo); - - result = MG.call_hook('test', initial); - - equal(result, 3, 'result has been chained'); -}); - -test('hooks should return multiple inputs as an array', function() { - var result; - - function hookOne(arg1, arg2, arg3) { - return [arg1, arg2, arg3]; - } - - function hookTwo(arg1, arg2, arg3) { - return [arg3, arg2, arg1]; - } - - MG.add_hook('test', hookOne); - MG.add_hook('test', hookTwo); - - result = MG.call_hook('test', [1,2,3]); - - equal(result.join('-'), '3-2-1', 'array is passed in the result') -}); - -test('if the result from a chained hook is undefined', function() { - var initial = 2; - - function hookOne(arg) { - // don't return anything - } - - function hookTwo(arg) { - equal(arg, initial, 'initial value is used'); - } - - MG.add_hook('test', hookOne); - MG.add_hook('test', hookTwo); - result = MG.call_hook('test', initial); - - - delete MG._hooks.test; - - function hookThree(arg) { - return arg - 1; - } - - function hookFour(arg) { - // don't return anything - } - - function hookFive(arg) { - equal(initial, arg - 1, 'processed value is passed if it is already set'); - } - - MG.add_hook('test', hookOne); - MG.add_hook('test', hookTwo); - result = MG.call_hook('test', initial); -}); - -test('a hook can only have one registered instance of any function', function() { - function hookOne() {} - - MG.add_hook('test', hookOne); - - try { - MG.add_hook('test', hookOne); - } - catch(error) { - equal(error, 'That function is already registered.', 'an exception is raised'); - } -}); diff --git a/priv/static/metrics-graphics-3.0-alpha3/tests/common/init_test.js b/priv/static/metrics-graphics-3.0-alpha3/tests/common/init_test.js deleted file mode 100644 index b695d46..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/tests/common/init_test.js +++ /dev/null @@ -1,246 +0,0 @@ -module('init'); - -test('MG properly detects time series vs. not.', function () { - var params1 = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-11-01'), 'value': 12}, - {'date': new Date('2014-11-02'), 'value': 18}], - x_accessor: 'date' - }; - - var params2 = { - target: '#qunit-fixture', - data: [{'date': 5434, 'value': 12}, - {'date': 5435, 'value': 18}], - x_accessor: 'date' - }; - - var params3 = { - target: '#qunit-fixture', - data: [[{'date': new Date('2014-11-01'), 'value': 12}, - {'date': new Date('2014-11-02'), 'value': 18}], - [{'date': new Date('2014-11-01'), 'value': 32}, - {'date': new Date('2014-11-02'), 'value': 43}]], - x_accessor: 'date' - }; - mg_merge_args_with_defaults(params1); - mg_merge_args_with_defaults(params2); - mg_merge_args_with_defaults(params3); - mg_is_time_series(params1); - mg_is_time_series(params2); - mg_is_time_series(params3); - - ok(params1.time_series === true, 'Date-accessed data set is a time series.'); - ok(params2.time_series === false, 'Number-accessed data set is not a time series.'); - ok(params3.time_series === true, 'Nested data set w/ dates detected as time series.'); -}); - -test("Chart's width is set correctly on subsequent calls to existing chart", function () { - var params_0 = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-11-01'), 'value': 12}, - {'date': new Date('2014-11-02'), 'value': 18}], - }; - - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-11-01'), 'value': 12}, - {'date': new Date('2014-11-02'), 'value': 18}], - width: 200, - height: 100, - }; - - MG.data_graphic(params_0); - MG.data_graphic(params); - - var width = document.querySelector(params.target + ' svg').clientWidth; - ok(width === 200, "SVG's width matches latest specified width"); -}); - -test("Chart's width is set to parents if full_width: true", function () { - var params = { - target: '#qunit-fixture', - full_width: true, - data: [{'date': new Date('2014-11-01'), 'value': 12}, - {'date': new Date('2014-11-02'), 'value': 18}], - height: 100 - }; - MG.data_graphic(params); - - var svg_width = document.querySelector(params.target + ' svg').clientWidth; - var div_width = document.querySelector(params.target).clientWidth; - - equal(div_width, svg_width, "SVG's width matches parent upon using full_width: true"); -}); - -test("Chart's height is set to parents if full_height: true", function () { - var params = { - target: '#qunit-fixture', - full_height: true, - data: [{'date': new Date('2014-11-01'), 'value': 12}, - {'date': new Date('2014-11-02'), 'value': 18}], - width: 500 - }; - - document.querySelector(params.target).style.height = '500px'; - MG.data_graphic(params); - - var svg_height = document.querySelector(params.target + ' svg').clientHeight; - var div_height = document.querySelector(params.target).clientHeight; - - equal(div_height, svg_height, "SVG's height matches parent upon using full_height: true"); -}); - -test("Won't add SVG element if an SVG element already exists in parent.", function () { - var args1 = { - target: '#qunit-fixture div#exists', - width: 500, - height: 200, - linked: false, - svg: 'FLAG' - }; - - var qunit = document.querySelector('#qunit-fixture'); - var div = document.createElement('div'); - div.id = 'exists'; - div.appendChild(document.createElement('svg')); - qunit.appendChild(div); - var first_number = document.querySelectorAll('svg').length; - mg_add_svg_if_it_doesnt_exist('', args1); - var second_number = document.querySelectorAll('svg').length; - equal(first_number, second_number, 'SVG element not added if it already exists.'); -}); - -test("Chart's height is set correctly on subsequent calls to existing chart", function () { - var params_0 = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-11-01'), 'value': 12}, - {'date': new Date('2014-11-02'), 'value': 18}], - }; - - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-11-01'), 'value': 12}, - {'date': new Date('2014-11-02'), 'value': 18}], - width: 200, - height: 100, - }; - - MG.data_graphic(params_0); - MG.data_graphic(params); - - var height = document.querySelector(params.target + ' svg').clientHeight; - ok(height == params.height, "SVG's height matches latest specified height"); -}); - -test('Charts are plotted correctly when MG is called multiple times on the same target element', function () { - var params_0 = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-11-01'), 'value': 12}, - {'date': new Date('2014-11-02'), 'value': 18}] - }; - - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-11-01'), 'value': 12}, - {'date': new Date('2014-11-02'), 'value': 18}], - width: 200, - height: 100, - }; - - MG.data_graphic(params_0); - MG.data_graphic(params); - - // ensure chart types change appropriately - var line = document.querySelector('.mg-main-line'); - ok(line, 'chart_type is `line`, line chart is plotted'); - - // check all the other chart types - var chart_types = [{id: 'point', domElement: '.mg-points'}, - {id: 'histogram', domElement: '.mg-histogram'}, - {id: 'bar', domElement: '.mg-barplot'}]; - - for (var i = 0; i < chart_types.length; i++) { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-11-01'), 'value': 12}, - {'date': new Date('2014-11-02'), 'value': 18}], - chart_type: chart_types[i].id, - width: 200, - height: 100, - }; - - MG.data_graphic(params); - ok(document.querySelector(chart_types[i].domElement), - 'chart_type switched to `' + chart_types[i].id + '`, the correct chart type is plotted'); - - // ensure old chart was removed - equal(document.querySelectorAll('.mg-main-line').length, 0, 'line chart (old one) was removed'); - } -}); - -test('Missing chart has required class name set', function () { - expect(1); - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-11-01'), 'value': 12}, - {'date': new Date('2014-11-02'), 'value': 18}], - chart_type: 'missing-data' - }; - - MG.data_graphic(params); - - var matches = document.querySelector(params.target + ' svg').getAttribute('class').match(/mg-missing/); - ok(matches, 'Missing chart has class `missing` set'); -}); - -test('Linked chart has the required class set', function () { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-11-01'), 'value': 12}, - {'date': new Date('2014-11-02'), 'value': 18}], - linked: true - }; - - MG.data_graphic(params); - - var matches = document.querySelector(params.target + ' svg').getAttribute('class').match(/linked/); - ok(matches, 'Linked chart has class `linked` set'); -}); - -test('args.time_series is set to true when data is time-series', function () { - var params = { - target: '#qunit-fixture', - data: [{'foo': new Date('2014-11-01'), 'value': 12}, - {'foo': new Date('2014-11-02'), 'value': 18}], - x_accessor: 'foo' - }; - - MG.data_graphic(params); - ok(params.time_series, 'args.time_series is set to true when data is time-series'); -}); - -test('args.time_series is set to false when data is not time-series', function () { - var params = { - target: '#qunit-fixture', - data: [{'foo': 100, 'value': 12}, - {'foo': 200, 'value': 18}], - x_accessor: 'foo' - }; - - MG.data_graphic(params); - equal(params.time_series, false, 'args.time_series is set to false when data is not time-series'); -}); - -test('Only one clip path is added on multiple calls to the same target element', function () { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12, 'l': 10, 'u': 14}, - {'date': new Date('2014-03-01'), 'value': 18, 'l': 16, 'u': 20}] - }; - - MG.data_graphic(params); - MG.data_graphic(MG.clone(params)); - - equal(document.querySelectorAll('.mg-clip-path').length, 1, 'We only have one clip path'); -}); diff --git a/priv/static/metrics-graphics-3.0-alpha3/tests/common/markers_test.js b/priv/static/metrics-graphics-3.0-alpha3/tests/common/markers_test.js deleted file mode 100644 index aac7f5b..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/tests/common/markers_test.js +++ /dev/null @@ -1,160 +0,0 @@ -module('markers'); - -test('All markers are added if they lie within the visible range', function() { - var markers = [{ - 'date': new Date('2014-02-01'), - 'label': '1st Milestone' - }, { - 'date': new Date('2014-02-02'), - 'label': '2nd Milestone' - }]; - - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - markers: markers - }; - - MG.data_graphic(params); - equal(document.querySelectorAll(params.target + ' .mg-markers line').length, markers.length, 'Two markers added'); -}); - -test('Markers that lie outside the visible range are excluded', function() { - var markers = [{ - 'date': new Date('2014-02-01'), - 'label': '1st Milestone' - }, { - 'date': new Date('2014-02-03'), - 'label': '2nd Milestone' - }]; - - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-02-02'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - markers: markers - }; - - MG.data_graphic(params); - equal(document.querySelectorAll(params.target + ' .mg-markers line').length, 1, 'One marker added'); -}); - -test('Markers that lie at the edge of the visible range are included', function() { - var markers = [{ - 'date': new Date('2014-02-01'), - 'label': '1st Milestone' - }, { - 'date': new Date('2014-03-01'), - 'label': '2nd Milestone' - }]; - - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-02-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - markers: markers - }; - - MG.data_graphic(params); - equal(document.querySelectorAll(params.target + ' .mg-markers line').length, markers.length, 'Two markers added'); -}); - -test('All baselines are added', function() { - var baselines = [{value:50, label:'a baseline'}]; - - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 100}, - {'date': new Date('2014-03-01'), 'value': 10}], - baselines: baselines - }; - - MG.data_graphic(params); - equal(document.querySelectorAll(params.target + ' .mg-baselines line').length, markers.length, 'One baseline added'); -}); - -test('Markers\' texts are correctly added', function() { - var markers = [{ - 'date': new Date('2014-02-01'), - 'label': '1st Milestone' - }, { - 'date': new Date('2014-02-02'), - 'label': '2nd Milestone' - }]; - - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 100}, - {'date': new Date('2014-03-01'), 'value': 10}], - markers: markers - }; - - MG.data_graphic(params); - equal(document.querySelectorAll(params.target + ' .mg-markers text')[0].textContent, markers[0].label, 'First marker\'s text matches specified one'); - equal(document.querySelectorAll(params.target + ' .mg-markers text')[1].textContent, markers[1].label, 'Second marker\'s text matches specified one'); -}); - -test('Baseline text is correctly added', function() { - var baselines = [{value:50, label:'a baseline'}]; - - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 100}, - {'date': new Date('2014-03-01'), 'value': 10}], - baselines: baselines - }; - - MG.data_graphic(params); - equal(document.querySelectorAll(params.target + ' .mg-baselines text')[0].textContent, baselines[0].label, 'Baseline text matches specified one'); -}); - -test('When an existing chart is updated with no markers, existing markers are cleared', function() { - var markers = [{ - 'date': new Date('2014-11-02'), - 'label': 'Lorem Ipsum' - }]; - - var params_0 = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-11-01'), 'value': 12}, - {'date': new Date('2014-11-03'), 'value': 18}], - markers: markers - }; - - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-11-01'), 'value': 14}, - {'date': new Date('2014-11-03'), 'value': 20}], - }; - - MG.data_graphic(params_0); - MG.data_graphic(params); - - equal(document.querySelectorAll('.mg-markers').length, 0, 'Old markers were cleared'); -}); - -test('When an existing chart is updated with no baselines, existing baselines are cleared', function() { - var baselines = [{ - 'value': 10, - 'label': 'Lorem Ipsum' - }]; - - var params_0 = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-11-01'), 'value': 12}, - {'date': new Date('2014-11-03'), 'value': 18}], - baselines: baselines - }; - - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-11-01'), 'value': 14}, - {'date': new Date('2014-11-03'), 'value': 20}], - }; - - MG.data_graphic(params_0); - MG.data_graphic(params); - - equal(document.querySelectorAll('.mg-baselines').length, 0, 'Old baselines were cleared'); -}); diff --git a/priv/static/metrics-graphics-3.0-alpha3/tests/common/resize_test.js b/priv/static/metrics-graphics-3.0-alpha3/tests/common/resize_test.js deleted file mode 100644 index c2c380b..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/tests/common/resize_test.js +++ /dev/null @@ -1,44 +0,0 @@ -module('resize'); - -test("Resize does not leak listeners", function () { - // Instrument window event listener methods - var realWindowAddEventListener = window.addEventListener; - var realWindowRemoveEventListener = window.removeEventListener; - var resizeListeners = []; - - window.addEventListener = function () { - if (arguments[0] === 'resize' && resizeListeners.indexOf(arguments[1]) === -1) { - resizeListeners.push(arguments[1]); - } - realWindowAddEventListener.apply(this, arguments); - } - - window.removeEventListener = function () { - if (arguments[0] === 'resize') { - var index = resizeListeners.indexOf(arguments[1]); - if (index !== -1) { - resizeListeners.splice(index, 1); - } - } - realWindowRemoveEventListener.apply(this, arguments); - } - - var params = { - target: '#qunit-fixture', - full_width: true, - data: [{'date': new Date('2014-11-01'), 'value': 12}, - {'date': new Date('2014-11-02'), 'value': 18}], - height: 100 - }; - MG.data_graphic(params); - var listenerCountAfterOne = resizeListeners.length; - const REPEAT_CREATE = 20; - for (var i = 0; i < REPEAT_CREATE; i++) { - MG.data_graphic(params); - } - equal(resizeListeners.length, listenerCountAfterOne, "Listener count constant after chart recreated " + REPEAT_CREATE + " times"); - - // Restore default methods - window.addEventListener = realWindowAddEventListener; - window.removeEventListener = realWindowRemoveEventListener; -}); diff --git a/priv/static/metrics-graphics-3.0-alpha3/tests/common/x_axis_test.js b/priv/static/metrics-graphics-3.0-alpha3/tests/common/x_axis_test.js deleted file mode 100644 index 61e512c..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/tests/common/x_axis_test.js +++ /dev/null @@ -1,227 +0,0 @@ -module('x_axis'); - -test('X-axis is added', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}] - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-x-axis'), 'X-axis is added'); -}); - -test('args.x_axis set to false', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - x_axis: false - }; - - MG.data_graphic(params); - equal(document.querySelector('.mg-x-axis'), null, 'X-axis is not added'); -}); - -test('Only one x-axis is added on multiple calls to the same target element', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}] - }; - - MG.data_graphic(params); - MG.data_graphic(MG.clone(params)); - - equal(document.querySelectorAll(params.target + ' .mg-x-axis').length, 1, 'We only have one x-axis'); -}); - -test('args.show_secondary_x_label: true', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}] - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-year-marker'), 'Year marker exists'); -}); - -test('args.show_secondary_x_label: false', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - show_secondary_x_label: false - }; - - MG.data_graphic(params); - equal(document.querySelector('.mg-year-marker'), null, 'Year marker not added'); -}); - -test('args.x_label', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - x_label: 'foo bar' - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-x-axis .label'), 'X-axis label exists'); -}); - -test('args.labels (scatter plot)', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - x_label: 'foo bar', - y_label: 'bar foo', - chart_type: 'point' - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-x-axis .label'), 'X-axis label exists'); - ok(document.querySelector('.mg-y-axis .label'), 'Y-axis label exists'); -}); - -test('X-axis doesn\'t break when data object is of length 1', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}] - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-x-axis'), 'X-axis exists'); -}); - -test('args.x_rug', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - x_rug: true - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-x-rug'), 'X-axis rugplot exists'); -}); - -test('Only one rugplot is added on multiple calls to the same target element', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - x_rug: true - }; - - MG.data_graphic(params); - MG.data_graphic(MG.clone(params)); - - equal(document.querySelectorAll('.mg-x-rug').length, 2, 'We only have one rugplot on the x-axis'); -}); - -test('args.x_extended_ticks', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - x_extended_ticks: true - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-extended-xax-ticks'), 'X-axis extended ticks exist'); -}); - -test('Correctly calculates min and max values for line, point and histogram charts', function() { - // single series - var params = { - target: '#qunit-fixture', - x_accessor: 'x', - y_accessor: 'y', - data: [ - [ - {x: 4, y: 5}, - {x: 5, y: 5}, - {x: 6, y: 5}, - {x: 7, y: 5} - ] - ] - }; - MG.data_graphic(params); - equal(params.processed.min_x, 4, 'min is correct for single series'); - equal(params.processed.max_x, 7, 'max is correct for single series'); - - // multiple series - var params2 = { - target: '#qunit-fixture', - x_accessor: 'x', - y_accessor: 'y', - data: [ - [ - {x: 1, y: 5}, - {x: 2, y: 5}, - {x: 3, y: 5}, - {x: 4, y: 5} - ], [ - {x: 5, y: 5}, - {x: 6, y: 5}, - {x: 7, y: 5} - ] - ] - }; - MG.data_graphic(params2); - equal(params2.processed.min_x, 1, 'min is correct for multiple series'); - equal(params2.processed.max_x, 7, 'max is correct for multiple series'); -}); - -/*test('Correctly calculates min and max values for bar chart', function() { - var args; - - // single series - args = { - x_accessor: 'x', - baseline_accessor: 'b', - predictor_accessor: 'p', - chart_type: 'bar', - target: '#qunit-fixture', - data: [ - [ - {x: 4, b: 3, p: 2}, - {x: 5, b: 2, p: 6}, - {x: 6, b: 1, p: 10}, - {x: 7, b: 0, p: 12} - ] - ] - }; - MG.data_graphic(args); - equal(args.processed.min_x, 0, 'min is correct'); - equal(args.processed.max_x, 12, 'max is correct'); -});*/ - -test('Ensure that custom xax_format isn\'t deleted', function() { - var params = { - title: 'foo', - target: '.result', - xax_format: function(d) { return 'humbug'; }, - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}] - }; - - MG.data_graphic(params); - equal(params.xax_format(), 'humbug', 'xax_format hasn\'t been overriden'); -}); - -test('Ensure that default null xax_format is respected; allow MG to recalculate the default on redraw', function() { - var params = { - title: 'foo', - target: '.result', - xax_format: null, - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}] - }; - - MG.data_graphic(params); - equal(params.xax_format, null, 'xax_format is still null'); -}); diff --git a/priv/static/metrics-graphics-3.0-alpha3/tests/common/y_axis_test.js b/priv/static/metrics-graphics-3.0-alpha3/tests/common/y_axis_test.js deleted file mode 100644 index 7295b64..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/tests/common/y_axis_test.js +++ /dev/null @@ -1,208 +0,0 @@ -module('y_axis'); - -test('Y-axis is added', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}] - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-y-axis'), 'Y-axis is added'); -}); - -test('args.y_axis set to false', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - y_axis: false - }; - - MG.data_graphic(params); - equal(document.querySelector('.mg-y-axis'), null, 'Y-axis is not added'); -}); - -test('Only one y-axis is added on multiple calls to the same target element', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}] - }; - - MG.data_graphic(params); - MG.data_graphic(MG.clone(params)); - - equal(document.querySelectorAll(params.target + ' .mg-y-axis').length, 1, 'We only have one y-axis'); -}); - -test('Only one mg-category-guides group is added on multiple calls to the same target element', function() { - var params = { - target: '#qunit-fixture', - data: [{"year": "1945","sightings": 6},{"year": "1946","sightings": 8}], - chart_type: 'point', - y_accessor: "year", - x_accessor: "sightings", - }; - - MG.data_graphic(params); - MG.data_graphic(MG.clone(params)); - - equal(document.querySelectorAll(params.target + ' .mg-category-guides').length, 1, 'We only have one mg-category-guides'); -}); - -test('args.y_label', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - y_label: 'foo bar' - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-y-axis .label'), 'Y-axis label exists'); -}); - -test('Y-axis doesn\'t break when data object is of length 1', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}] - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-y-axis'), 'Y-axis exists'); -}); - -// test('args.small_text', function() { -// var params = { -// target: '#qunit-fixture', -// data: [{'date': new Date('2014-01-01'), 'value': 12}], -// small_text: true, -// }; - -// MG.data_graphic(params); -// ok(document.querySelector('.mg-y-axis-small'), 'Small y-axis is set'); -// }); - -test('args.y_rug', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - y_rug: true - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-y-rug'), 'Y-axis rugplot exists'); -}); - -test('Only one rugplot is added on multiple calls to the same target element', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - y_rug: true - }; - - MG.data_graphic(params); - MG.data_graphic(MG.clone(params)); - equal(document.querySelectorAll('.mg-y-rug').length, 2, 'We only have one rugplot on the y-axis'); -}); - -test('Default min_y is 0', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}] - }; - - MG.data_graphic(params); - equal(document.querySelectorAll('.mg-y-axis text')[0].textContent, 0, 'Y-axis starts at 0'); -}); - -test('args.min_y_from_data', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - min_y_from_data: true - }; - - MG.data_graphic(params); - equal(document.querySelectorAll('.mg-y-axis text')[0].textContent, 12, 'Y-axis starts at 12'); -}); - -test('args.min_y set to arbitrary value', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - min_y: 5 - }; - - MG.data_graphic(params); - equal(document.querySelectorAll('.mg-y-axis text')[0].textContent, 5, 'Y-axis starts at 5'); -}); - -test('args.y_extended_ticks', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - y_extended_ticks: true - }; - - MG.data_graphic(params); - ok(document.querySelector('.mg-extended-yax-ticks'), 'Y-axis extended ticks exist'); -}); - -test('args.format is set to percentage', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 0.12}, - {'date': new Date('2014-03-01'), 'value': 0.18}], - format: 'percentage' - }; - - MG.data_graphic(params); - equal(document.querySelectorAll('.mg-y-axis text')[0].textContent.slice(-1), '%', 'Y-axis units are %'); -}); - -test('percentage args.format is correct', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 0.80}, - {'date': new Date('2014-03-01'), 'value': 1.20}], - format: 'percentage', - height: 400, - min_y_from_data: true - }; - - MG.data_graphic(params); - equal(document.querySelectorAll('.mg-y-axis text')[2].textContent, '120%', 'Y-axis label formats correctly'); -}); - -test('args.yax_units', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 2.12}, - {'date': new Date('2014-03-01'), 'value': 4.18}], - yax_units: '$', - }; - - MG.data_graphic(params); - equal(document.querySelector('.mg-y-axis text').textContent[0], '$', 'Y-axis units are $'); -}); - -test('When args.max_y is set, ignore inflator', function() { - var params = { - target: '#qunit-fixture', - data: [{'date': new Date('2014-01-01'), 'value': 12}, - {'date': new Date('2014-03-01'), 'value': 18}], - max_y: 60, - }; - - MG.data_graphic(params); - var nodes = document.querySelectorAll('.mg-y-axis text'); - equal(nodes[nodes.length - 1].textContent, 60, 'Maximum y-axis value is 60'); -}); diff --git a/priv/static/metrics-graphics-3.0-alpha3/tests/helpers.js b/priv/static/metrics-graphics-3.0-alpha3/tests/helpers.js deleted file mode 100644 index 22d30ad..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/tests/helpers.js +++ /dev/null @@ -1,20 +0,0 @@ -function generateMouseEvent(type) { - var event = document.createEvent('MouseEvent'); - event.initEvent(type, true, true); - return event; -} - -// essentially the same as $.extend -function extend(){ - var result = {}, - $__arguments = [].slice.call(arguments); - - $__arguments.forEach(function(obj) { - for (var prop in obj) { - if (obj.hasOwnProperty(prop)) { - result[prop] = obj[prop]; - } - } - }); - return result; -} diff --git a/priv/static/metrics-graphics-3.0-alpha3/tests/misc/.gitkeep b/priv/static/metrics-graphics-3.0-alpha3/tests/misc/.gitkeep deleted file mode 100644 index e69de29..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/tests/misc/.gitkeep +++ /dev/null diff --git a/priv/static/metrics-graphics-3.0-alpha3/tests/misc/process_test.js b/priv/static/metrics-graphics-3.0-alpha3/tests/misc/process_test.js deleted file mode 100644 index 4495b75..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/tests/misc/process_test.js +++ /dev/null @@ -1,14 +0,0 @@ -module('process'); - -test('args.missing_is_zero doesn\'t throw a "args.data[0][0] is undefined" error', function() { - var data = [{"date": new Date('2014-02-02'), "value": 6}]; - var params = { - data: data, - target: "#qunit-fixture", - missing_is_zero: true - }; - - MG.data_graphic(params); - - equal(params.data.length, 1, 'args.data is defined'); -});
\ No newline at end of file diff --git a/priv/static/metrics-graphics-3.0-alpha3/tests/misc/utility_test.js b/priv/static/metrics-graphics-3.0-alpha3/tests/misc/utility_test.js deleted file mode 100644 index 7af4e00..0000000 --- a/priv/static/metrics-graphics-3.0-alpha3/tests/misc/utility_test.js +++ /dev/null @@ -1,90 +0,0 @@ -module('utility'); - -test('MG.convert.date', function() { - var data = [{'date': '2014-01-01', 'value': 12}, - {'date': '2014-03-01', 'value': 18}]; - - MG.convert.date(data, 'date'); - equal($.type(data[0].date), 'date', 'First date is of type date'); - equal($.type(data[0].date), 'date', 'Second date is of type date'); -}); - -test('MG.convert.date with an alternative timestamp style', function() { - var data = [{'date': '2014-20-12', 'value': 12}, - {'date': '2014-21-12', 'value': 18}]; - - MG.convert.date(data, 'date', '%Y-%d-%m'); - equal($.type(data[0].date), 'date', 'First date is of type date'); - equal($.type(data[0].date), 'date', 'Second date is of type date'); -}); - -test('MG.convert.number', function() { - var data = [{'date': '2014-20-12', 'value': '12'}, - {'date': '2014-21-12', 'value': '18'}]; - - MG.convert.number(data, 'value'); - equal($.type(data[0].value), 'number', 'First value is a number'); - equal($.type(data[0].value), 'number', 'Second value is a number'); -}); - -test('mg_get_svg_child_of', function(){ - d3.select('#qunit-fixture').append('svg'); - - var svg_element_with_node = mg_get_svg_child_of(document.querySelector('#qunit-fixture')); - var svg_element_with_text = mg_get_svg_child_of('#qunit-fixture'); - - equal(svg_element_with_node.nodes().length, 1, 'Node-based argument should return a d3 selection with svg.'); - equal(svg_element_with_node.nodes().length, 1, 'Selector-based argument should return a d3 selection with svg.'); -}); - - -test('mg_target_ref', function() { - var chart_area2 = document.createElement('div'); - mg_target_ref(chart_area2); - ok(chart_area2.getAttribute('data-mg-uid').match(/mg-[\d]/), 'applies generated ID to DOM element'); -}); - -test('Overlapping markers are taken care of', function() { - var params = { - data: [{ - "date": new Date('2016-01-01'), - "value": 6 - }, - { - "date": new Date('2016-01-02'), - "value": 8 - }, - { - "date": new Date('2016-01-03'), - "value": 34 - }, - { - "date": new Date('2016-01-04'), - "value": 38 - }], - markers: [{'date': new Date('2016-01-02'), 'label': 'A happened'},{'date': new Date('2016-01-02'), 'label': 'B happened'}], - target: "#qunit-fixture" - }; - - MG.data_graphic(params); - - equal(mg_is_horizontally_overlapping(d3.selectAll('.mg-marker-text').node(), d3.selectAll('.mg-marker-text').nodes()), false, 'Markers aren\'t overlapping'); -}); - -test('compare_type', function() { - [ - ['number', null, true], - ['number', 1, true], - ['number', 'str', false], - ['number[]', 1, false], - ['number[]', [1], true], - ['object[]', [{}, 1], false], - [['number', 'string'], 1, true], - [['number', 'string'], 'str', true], - [['number', 'string'], {}, false], - [['a', 'b'], 'a', true], - [['a', 'b'], 'c', false] - ].forEach(i => { - equal(compare_type(i[0], i[1]), i[2], i); - }); -}); |