/
dev.htm
381 lines (347 loc) · 17.9 KB
/
dev.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<meta property='og:title' content='MetricsGraphics.js' />
<meta property='og:description' content='MetricsGraphics.js is a library 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.' />
<meta property='og:image' content='http://metricsgraphicsjs.org/images/og-logo.png' />
<meta property='og:type' content='website' />
<meta property='og:url' content='http://metricsgraphicsjs.org/' />
<meta property='og:site_name' content='MetricsGraphics.js' />
<link rel='icon' type='image/png' href='images/og-logo.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'>
<link href='css/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'>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.11/d3.min.js' charset='utf-8'></script>
<!-- dev start -->
<script src='src/common/data_graphic.js'></script>
<script src='src/common/bootstrap_tooltip_popover.js'></script>
<script src='src/common/chart_title.js'></script>
<script src='src/common/y_axis.js'></script>
<script src='src/common/x_axis.js'></script>
<script src='src/common/init.js'></script>
<script src='src/common/markers.js'></script>
<script src='src/layout/bootstrap_dropdown.js'></script>
<script src='src/layout/button.js'></script>
<script src='src/charts/line.js'></script>
<script src='src/charts/histogram.js'></script>
<script src='src/charts/point.js'></script>
<script src='src/charts/bar.js'></script>
<script src='src/charts/table.js'></script>
<script src='src/charts/missing.js'></script>
<script src='src/misc/process.js'></script>
<script src='src/misc/smoothers.js'></script>
<script src='src/misc/utility.js'></script>
<script src='src/misc/error.js'></script>
<!-- dev end -->
<script src='js/main.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>
<div class='container'>
<div class='head'>
<ul>
<li><a href='http://metricsgraphicsjs.org/'>Home</a></li>
<li><a href='https://github.com/mozilla/metrics-graphics/releases'>Download</a></li>
<li><a href='interactive-demo.htm'>Interactive</a></li>
<li><a href='https://github.com/mozilla/metrics-graphics'>Code</a></li>
<li><a href='https://github.com/mozilla/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 class='float-right no-padding'><a class='selected examples-options' href='dev.htm'>DEV</a></li>
<li class='float-right'><a class='examples-options' href='examples.htm'>RELEASE</a></li>
</ul>
<img src='images/logo.svg' id='logo' class='svg' />
</div>
<div id='torso'>
<div id='fake_users1'></div>
<div id='fake_users2'></div>
<div id='missing-y'></div>
<div id='small-range'></div>
<div id='spike' class='main-area-solid'></div>
<div id='percentage'></div>
<div id='currency'></div>
<div id='xnotdate'></div>
<div id='glorious_chart'></div>
<div id='linked_multi1'></div>
<div id='linked_multi2'></div>
</div>
<div id='trunk'>
<div class='row trunk-section'>
<div class='col-lg-4'>
<h2 class='trunk-title'>Hassle-Free Layouts</h2>
<p>We use Bootstrap's grid template to lay out graphics. This means
that it is ridiculously easy to create grids of arbitrary sizes
and place graphics and their corresponding prose or associated
graphics wherever and however one pleases.</p>
<p>Setting <i>legend</i> and <i>legend_target</i> allows you to
generate a key to go with the graphic.</p>
<div class='legend'></div>
</div>
<div class='col-lg-8'>
<div class='col-lg-12 text-center extended-y-ticks' id='fake_users3'>
</div>
</div>
</div>
<div class='row trunk-section'>
<div class='col-lg-4'>
<h2 class='trunk-title'>Confidence Band</h2>
<p>We regularly make use of confidence bands with forecasts. One
can easily specify a confidence band by enabling the option and
specifying the elements that contain the lower and upper values
for each data point.</p>
</div>
<div class='col-lg-8'>
<div class='text-center extended-x-ticks' id='confidence_band'></div>
</div>
</div>
<div class='row trunk-section'>
<div class='col-lg-4'>
<h2 class='trunk-title'>Linked Graphics</h2>
<p>It can be useful to have two graphics linked together—when
a rollover in one is triggered, the same rollover is triggered on
the same date or data point in the other.</p>
</div>
<div class='col-lg-8'>
<div class='row'>
<div class='col-lg-6 text-center' id='briefing-1'></div>
<div class='col-lg-6 text-center' id='briefing-2'></div>
</div>
</div>
</div>
<div class='row trunk-section'>
<div class='col-lg-4'>
<h2 class='trunk-title'>Update Graphic Data</h2>
<p>We sometimes have the need to split the data and then
gracefully update the graphic with the newly selected subset of
data.</p>
<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>
<div class='col-lg-8'>
<div id='split_by'></div>
</div>
</div>
<div class='row trunk-section'>
<div class='col-lg-4'>
<h2 class='trunk-title'>Modify Time Period</h2>
<p>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.</p>
<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-8'>
<div id='modify_time_period'></div>
</div>
</div>
<div class='row trunk-section'>
<div class='col-lg-4'>
<h2 class='trunk-title'>Small Graphics</h2>
<p>At 150px, we change the font sizes for rollovers and axes.</p>
</div>
<div class='col-lg-8'>
<div class='row'>
<div class='col-lg-6 text-center' id='small1'></div>
<div class='col-lg-6 text-center' id='small2'></div>
</div>
</div>
</div>
<div class='row trunk-section'>
<div class='col-lg-4'>
<h2 class='trunk-title'>Hiding Axes</h2>
<p>Either axis can be hidden with an argument.</p>
</div>
<div class='col-lg-8'>
<div class='row'>
<div class='col-lg-6 text-center' id='hidden1'></div>
<div class='col-lg-6 text-center' id='hidden2'></div>
</div>
</div>
</div>
<div class='row trunk-section'>
<div class='col-lg-4'>
<h2 class='trunk-title'>Rollover Text Formatting</h2>
<p>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.</p>
</div>
<div class='col-lg-8'>
<div class='row'>
<div class='col-lg-6 text-center' id='precision1'></div>
<div class='col-lg-6 text-center' id='precision2'></div>
</div>
<div class='row'>
<div class='col-lg-6 text-center' id='custom-rollover'></div>
<div class='col-lg-6 text-center' id='no-rollover-text'></div>
</div>
</div>
</div>
<div class='row trunk-section'>
<div class='col-lg-4'>
<h2 class='trunk-title'>Logarithmic Scales</h2>
<p>One can change the y-axis' scale to logarithmic by setting
<i>y_scale_type</i> to <i>log</i>.</p>
</div>
<div class='col-lg-8'>
<div id='log1'></div>
</div>
</div>
<div class='row trunk-section'>
<div class='col-lg-4'>
<h2 class='trunk-title'>Min and Max Numbers on Y-Axis</h2>
<p>Currently this lib will default to 0 on the y-axis as min if
there are no negative numbers. If there are negatives, should
provide some buffer below.</p>
</div>
<div class='col-lg-8'>
<div class='row'>
<div class='col-lg-6 text-center' id='neg1'></div>
<div class='col-lg-6 text-center' id='neg2'></div>
</div>
<div class='row'>
<div class='col-lg-6 text-center' id='y-axis-not-zero'></div>
<div class='col-lg-6 text-center'></div>
</div>
</div>
</div>
<div class='row trunk-section'>
<div class='col-lg-4'>
<h2 class='trunk-title'>Scatterplots</h2>
<p>A few examples of scatterplots that demonstrate the graphic
type's options, smoothers and rug plots.</p>
</div>
<div class='col-lg-8'>
<div class='row'>
<div class='col-lg-6 text-center' id='scatter-simple'></div>
<div class='col-lg-6 text-center' id='scatter-size-and-color'></div>
</div>
<div class='row'>
<div class='col-lg-6 text-center' id='scatter-line-best-fit'></div>
<div class='col-lg-6 text-center' id='sls-time-series'></div>
</div>
<div class='row'>
<div class='col-lg-6 text-center' id='categorical1'></div>
<div class='col-lg-6 text-center' id='categorical2'></div>
</div>
</div>
</div>
<div class='row trunk-section'>
<div class='col-lg-4'>
<h2 class='trunk-title'>Histograms</h2>
<p>We use histograms a lot, particularly in
<a href='https://wiki.mozilla.org/Telemetry' target='_blank'>Telemetry</a>.
The histogram graphic type includes the ability to
<a href='http://en.wikipedia.org/wiki/Freedman%E2%80%93Diaconis_rule'>
bin data</a>.
</p>
</div>
<div class='col-lg-8'>
<div class='row'>
<div class='col-lg-6 text-center extended-y-ticks' id='histogram1'></div>
<div class='col-lg-6 text-center extended-y-ticks' id='histogram2'></div>
</div>
<div class='row'>
<div class='col-lg-6 text-center extended-y-ticks' id='histogram3'></div>
<div class='col-lg-6 text-center extended-y-ticks' id='histogram4'></div>
</div>
<div class='row'>
<div class='col-lg-12 text-center extended-y-ticks' id='ufos'></div>
</div>
</div>
</div>
<div class='row wip light-bg'>
<div class='col-lg-12 text-center'>
<i class='fa fa-wrench'></i> <strong>Works in Progress</strong>
subject to drastic change
</div>
</div>
<div class='row trunk-section'>
<div class='col-lg-4'>
<h2 class='trunk-title'>Handling Missing Data</h2>
<p>
MetricsGraphics.js has a number of ways of handling missing data in line charts. We are currently working on a few options, including segmenting time series to show gaps.
</p>
</div>
<div class='col-lg-8'>
<div class='row'>
<div class='col-lg-12 text-center extended-y-ticks' id='missing1'></div>
</div>
</div>
</div>
<div class='row trunk-section'>
<div class='col-lg-4'>
<h2 class='trunk-title'>Data Tables</h2>
<p>
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.
</p>
</div>
<div class='col-lg-8 text-center' id='table1'></div>
</div>
<div class='row trunk-section'>
<div class='col-lg-4'>
<h2 class='trunk-title'>Data-Based Button Layouts</h2>
<p>
It can be very useful to have buttons easily made out of a data set for easy segmenting & selecting.
</p>
</div>
<div class='col-lg-8'>
<div class='row'>
<div class='col-lg-12 text-center' id='buttons'></div>
</div>
</div>
</div>
<div class='row trunk-section'>
<div class='col-lg-4'>
<h2 class='trunk-title'>Barplots</h2>
<p>Two examples of barplots. These are still works-in-progress.
</p>
</div>
<div class='col-lg-8'>
<div class='row'>
<div class='col-lg-6 text-center' id='bar1'></div>
<div class='col-lg-6 text-center' id='bar2'></div>
</div>
</div>
</div>
</div>
<div class='footer'>
<a href='http://metricsgraphicsjs.org'>MetricsGraphics.js 1.1</a>
<br />Created by <a href='https://twitter.com/alialmossawi'>Ali Almossawi</a> and
<a href='https://github.com/hamilton'>Hamilton Ulmer</a>
<br />2014 · Shared under a <a href='http://www.mozilla.org/MPL/2.0/'>
Mozilla Public License</a>
<br /><a href='https://github.com/mozilla/metrics-graphics'>
<i class='fa fa-github fa-3x' style='line-height:42px'></i>
</a>
</div>
</div>
</body>
</html>