-
-
Notifications
You must be signed in to change notification settings - Fork 545
/
Copy pathindex.html
440 lines (324 loc) · 18.2 KB
/
index.html
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
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
<!DOCTYPE html>
<html>
<head>
<!-- This page was last built at 2021-08-29 23:14 -->
<meta charset="utf-8" />
<link rel="canonical" href="https://plotly.com/scala/user-guide/" />
<!-- Media query magic - http://stackoverflow.com/questions/19945658/my-iphone-thinks-its-980px-wide -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/all_static/javascripts/algolia/instantsearch.js"></script>
<script src="/all_static/javascripts/algolia/polyfill.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
crossorigin="anonymous">
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" crossorigin="anonymous"></script>
<!-- code highlighting -->
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.8.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<!-- Mathjax -->
<script type='text/javascript'
src='//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML'></script>
<!-- Plotly.js -->
<script src="https://cdn.plot.ly/plotly-2.3.1.min.js"></script>
<!--
//// Stylesheets
-->
<!-- Fonts -->
<link
href="//fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic|Ubuntu+Mono:400,700|Asap"
rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<!-- Main Stylesheets -->
<link rel="stylesheet" type="text/css"
href="/all_static/css/main.css?version=../all_sta">
<link rel="stylesheet" type="text/css"
href="/all_static/css/improve.css?version=../all_sta">
<!-- LOCAL DEV STYLESHEET -->
<!--<link rel="stylesheet" type="text/css" href="http://api.plotly.dev/all_static/css/main.css">-->
<!-- Icon -->
<link rel="shortcut icon" href="https://plotly.com/img/favicon.ico" />
<!-- Google Tags-->
<!-- Google Tag Manager Tag -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-N6T2RXG');</script>
<!-- META TAGS -->
<!-- SEO Tags - title, meta_description -->
<title>Plotly for Scala User Guide | Scala | Plotly </title>
<meta name="description" content="User guide to the Scala Plotly client">
<!-- Bing tags -->
<meta name="msvalidate.01" content="D319859A832F9F1D15A7646E2A42150A" />
<!-- Facebook tags -->
<meta property="og:title" content="Plotly for Scala User Guide"/>
<meta property="og:type" content="website"/>
<meta property="og:image" content="https://help.plot.ly/images/twitter-default.png">
<meta property="og:description" content="User guide to the Scala Plotly client"/>
<meta property="og:url" />
<meta property="fb:admins" content="1123751525"/>
<meta property="fb:admins" content="22418"/>
<!-- twitter tags -->
<meta name="twitter:card" content="photo" />
<meta name="twitter:title" content="Plotly for Scala User Guide"/>
<meta name="twitter:url" content="https://plotly.com/scala/user-guide/"/>
<meta name="twitter:description" content="User guide to the Scala Plotly client"/>
<meta name="twitter:image" content="https://help.plot.ly/images/twitter-default.png">
<meta name="twitter:site" content="@plotlygraphs"/>
</head>
<body data-spy="scroll" data-target=".watch" style="position:relative;">
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-N6T2RXG"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<!--[if lt IE 10]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade
your browser</a> to improve your experience.</p>
<![endif]-->
<div class="header-container">
<div id="campaign-zero-banner">
✊🏿 Black Lives Matter. Please consider donating to <a target="_blank" href="https://www.blackgirlscode.com/?utm_source=plotly&utm_medium=graphing&utm_campaign=july" style="color:deeppink">Black Girls Code</a> today.
</div>
<header class="header-main --default">
<div class="--wrap">
<div class="--wrap-left">
<div class="-identity">
<a href="https://plotly.com/"><img src="/all_static/images/plotly_graphing_libraries_1.png" style="height: 45px;"></a>
<a href="/graphing-libraries/"><img src="/all_static/images/plotly_graphing_libraries_2.png" style="height: 45px;"></a>
<div class="breadcrumb-nav">
<a href="/scala">Scala</a>
><a href="#">Plotly for Scala User Guide</a>
</div>
</div>
</div>
<div class="--wrap-right">
<nav class="--nav-meta" role="navigation">
<ul>
<li><a style="font-family: verdana, tahoma, open sans, sans-serif; font-size: 14px; font-weight: bold;" href="https://plotly.com/get-pricing/">PRICING</a></li>
<li><a href="https://plotly.com/get-demo" data-mode="1" target="_blank" class="typeform-share button --enterprise-quaternary"
style="font-family: verdana, tahoma, open sans, sans-serif;">GET DEMO</a></li>
<li><a href="http://plotly.cloud" data-mode="1" target="_blank" id="teal-background" class="typeform-share button --enterprise-quaternary"
style="font-family: verdana, tahoma, open sans, sans-serif;">DASH CLOUD</a></li>
</ul>
</nav>
</div>
</div>
</header>
</div>
<main class="--page page--single --index">
<div class="--wrap">
<!-- aside - Main Sidebar-->
<aside class="--sidebar-container">
<div class="--sidebar-fixed reference" data-spy="affix" id="where">
<header class="--sidebar-header">On This Page</header>
<nav class="--sidebar-body watch" id="where">
<ul class="--sidebar-list"></ul>
</nav>
</div>
</aside>
<!-- Main-->
<section class="--page-body --tutorial-index --base">
<header class="--welcome">
<div class="--welcome-body">
<!--div.--wrap-inner-->
<div class="--title">
<div class="--body">
<div class="nav-breadcrumb-container">
<div></div>
<div class="nav-breadcrumb-right">
<div class="--fork">
<a id="forklink" href= "https://github.com/plotly/graphing-library-docs/tree/master/_posts/scala/" >
<div class="icon">
<svg style="width:20px;height:20px" viewbox="0 0 24 24">
<path fill="#000000" d="M2.6,10.59L8.38,4.8L10.07,6.5C9.83,7.35 10.22,8.28 11,8.73V14.27C10.4,14.61 10,15.26 10,16A2,2 0 0,0 12,18A2,2 0 0,0 14,16C14,15.26 13.6,14.61 13,14.27V9.41L15.07,11.5C15,11.65 15,11.82 15,12A2,2 0 0,0 17,14A2,2 0 0,0 19,12A2,2 0 0,0 17,10C16.82,10 16.65,10 16.5,10.07L13.93,7.5C14.19,6.57 13.71,5.55 12.78,5.16C12.35,5 11.9,4.96 11.5,5.07L9.8,3.38L10.59,2.6C11.37,1.81 12.63,1.81 13.41,2.6L21.4,10.59C22.19,11.37 22.19,12.63 21.4,13.41L13.41,21.4C12.63,22.19 11.37,22.19 10.59,21.4L2.6,13.41C1.81,12.63 1.81,11.37 2.6,10.59Z"></path>
</svg>
</div>
<span>Suggest an edit to this page</span>
</a>
</div>
</div>
</div>
<h1>
Plotly for Scala User Guide
in
Scala
</h1>
<p>User guide to the Scala Plotly client </p>
<br>
</div>
</div>
</div>
</header>
<!-- Start Plotly Basics Section -->
<section class="tutorial-content">
<h2> Setting credentials programmatically</h2>
<p>The simplest way to pass credentials to the Plotly client is through the <a href="scala/getting-started">credentials file</a>. However, we sometimes need more flexibility. The Scala Plotly client lets you set credentials within your program:</p>
<div class="highlight"><pre><code class="language-" data-lang="">import co.theasi.plotly._
implicit val server = new writer.Server {
val credentials = writer.Credentials("DemoAccount", "lr1c37zw81")
val url = "https://api.plot.ly/v2/"
}
val p = Plot().withScatter(Vector(1, 2), Vector(3, 4))
draw(p, "custom-credentials")
</code></pre></div>
<p>The <code>draw</code> method looks for an instance of type <code>writer.Server</code> that is present in scope. Let's, for instance, write a program that asks the user for a username and password and sends a graph to their account:</p>
<div class="highlight"><pre><code class="language-" data-lang="">import co.theasi.plotly._
object PlotlyDrawer extends App {
// Generate random data
val xs = (0 to 100).map { i => Random.nextGaussian }
val ys = (0 to 100).map { i => Random.nextGaussian }
val p = Plot().withScatter(xs, ys)
val plotFile = draw(p, "credentials-demo", writer.FileOptions(overwrite=true))
println("Plotted graph at:")
println(plotFile.fileId)
}
</code></pre></div>
</section>
<!--End Plotly Basics Section-->
</section>
</div>
</main>
<script>
var array = [];
$('.tutorial-content :header:not(h6)').each(function (i, e) {
var item = $(e);
var itemText = item.text();
var hash = itemText.replace(/[^a-z0-9\s]/gi, '').replace(/[_\s]/g, '-').replace(/^-+|-+$/g, '').toLowerCase();
item.attr("id", hash);
array.push({text: itemText, tag: item.prop("tagName"), hash: hash});
});
$(".--sidebar-list").html(array.map(function(entry) {
var text = entry.text.replace(/[^a-z0-9\s\.:\-\?\!\(\))]/gi, '');
if(entry.tag.toLowerCase() < "h4"){
return('<li class="--sidebar-item"><a href="#' + entry.hash + '">' + text + '</a></li>');
}
else {
return('<li class="--sidebar-item"><a href="#' + entry.hash + '">' + text + '</a></li>');
}
}).join(""));
//$(".tutorial-content :header:not(h6)").append( "\<div class=\"icon copy\" data-tooltip=\"Click to copy direct link\"><svg style=\"width:24px;height:24px\" viewBox=\"0 0 24 24\"><path fill=\"#000000\" d=\"M10.59,13.41C11,13.8 11,14.44 10.59,14.83C10.2,15.22 9.56,15.22 9.17,14.83C7.22,12.88 7.22,9.71 9.17,7.76V7.76L12.71,4.22C14.66,2.27 17.83,2.27 19.78,4.22C21.73,6.17 21.73,9.34 19.78,11.29L18.29,12.78C18.3,11.96 18.17,11.14 17.89,10.36L18.36,9.88C19.54,8.71 19.54,6.81 18.36,5.64C17.19,4.46 15.29,4.46 14.12,5.64L10.59,9.17C9.41,10.34 9.41,12.24 10.59,13.41M13.41,9.17C13.8,8.78 14.44,8.78 14.83,9.17C16.78,11.12 16.78,14.29 14.83,16.24V16.24L11.29,19.78C9.34,21.73 6.17,21.73 4.22,19.78C2.27,17.83 2.27,14.66 4.22,12.71L5.71,11.22C5.7,12.04 5.83,12.86 6.11,13.65L5.64,14.12C4.46,15.29 4.46,17.19 5.64,18.36C6.81,19.54 8.71,19.54 9.88,18.36L13.41,14.83C14.59,13.66 14.59,11.76 13.41,10.59C13,10.2 13,9.56 13.41,9.17Z\"/> </svg> </div>");
</script>
<footer class="--footer-main">
<section class="--footer-top">
<div class="--wrap">
<ul class="--footer-body">
<li class="--footer-column">
<h6 style="color:#e763fa" class="--footer-heading">Products</h6>			
<ul>
<li><a href="https://plotly.com/dash/" target="_self">Dash</a></li>
				
				
<li><a href="https://plotly.com/consulting-and-oem/" target="_self">Consulting and Training</a></li>
</ul>
</li>
		
<li class="--footer-column">
<h6 style="color:#636efa" class="--footer-heading">Pricing</h6>			
<ul>
<li><a href="https://plotly.com/get-pricing/" target="_self">Enterprise Pricing</a></li>
				
</ul>
</li>
		
<li class="--footer-column">
<h6 style="color:#00cc96" class="--footer-heading">About Us</h6>			
<ul>
<li><a href="https://plotly.com/company/careers" target="_self">Careers</a></li>
				
<li><a href="https://plotly.com/resources/" target="_self">Resources</a></li>
				
<li><a href="https://medium.com/@plotlygraphs" target="_self">Blog</a></li>
				
</ul>
</li>
		
<li class="--footer-column">
<h6 style="color:#EF553B" class="--footer-heading">Support</h6>			
<ul>
<li><a href="https://community.plot.ly/" target="_self">Community Support</a></li>
				
<li><a href="https://plotly.com/graphing-libraries" target="_self">Documentation</a></li>
				
</ul>
</li>
		
<li class="--footer-column">
<h6 style="color:#119dff" class="--footer-heading">JOIN OUR MAILING LIST</h6>			
<ul>
				
<li>
<p class="subscribe-text"> Sign up to stay in the loop with all things Plotly — from Dash Club to product updates, webinars, and more!</p>
<a
href="https://go.plot.ly/subscription"
class="subscribe-button"
target="_blank">
Subscribe
</a>
</li>
</ul>
</li>
</ul>
</div>
</section>
<section class="--footer-meta">
<div class="--wrap">
<div class="left">
<article class="--copyright">Copyright © 2021 Plotly. All rights reserved.</article>
</div>
<div class="right">
<article class="--tos"><a href="https://plotly.com/terms-of-service/" target="_blank">Terms of Service</a>
</article>
<article class="--privacy"><a href="https://plotly.com/privacy/" target="_blank">Privacy Policy</a>
</article>
</div>
</div>
</section>
</footer>
<div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content" id="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<span style="float: left; padding-top:13px; padding-right:10px;"><i class="fa fa-search fa-lg"></i></span>
<input id="search-input" class="search-input" type="text" placeholder=""/>
</div>
<div class="modal-body" id="modal-body">
<div id="search-results" class="search-results">
<div id="primary-search-results" class="primary-search-results"></div>
<div id="schema-search-results" class="schema-search-results"></div>
</div>
</div>
</div>
</div>
</div>
<script>
window.plotly_doc_language = "scala";
</script>
<!-- ALGOLIA SEARCH -->
<script id="algolia__template" type="text/template">
<div class="algolia__result">
<a class="algolia__result-link" onClick="$('#myModal').modal('toggle')" href="/{{ permalink }}">{{{ _highlightResult.name.value }}}</a>
<div class="algolia__result-text">{{{ _highlightResult.description.value }}}</div>
</div>
</script>
<script id="algolia__secondary-template" type="text/template">
<div class="algolia__secondary-result">
<a class="algolia__result-link" onClick="$('#myModal').modal('toggle')" href="/{{ permalink }}">{{{ _highlightResult.name.value }}}</a>
<div class="algolia__result-text">{{{ _highlightResult.description.value }}}</div>
</div>
</script>
<script id="algolia__template--no-results" type="text/template">No results found.</script>
<script src="//cdn.jsdelivr.net/hogan.js/3.0.2/hogan.min.js"></script>
<script src="/all_static/javascripts/algolia/algolia.js"></script>
<!-- Hash offset Script -->
<script src="/all_static//javascripts/hash_offset.js"></script>
<!-- Image Hover Script -->
<script src="/all_static/javascripts/imghover.js"></script>
<!-- code highlighting -->
<script src="/all_static/javascripts/codehighlight/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</body>
</html>