Last active
June 15, 2024 07:58
-
-
Save dacr/5d6ca572ddd46667d4a5608bf0c537da to your computer and use it in GitHub Desktop.
Playing with plotly through plotly-scala. / published by https://github.com/dacr/code-examples-manager #04c2e146-3f81-4fe8-9b35-1479b06c1229/77f864d075f6629a397db8354ae8cd29c0471b9e
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env amm | |
// summary : Playing with plotly through plotly-scala. | |
// keywords : scala, chart, plotly | |
// publish : gist | |
// authors : David Crosson | |
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2) | |
// id : 04c2e146-3f81-4fe8-9b35-1479b06c1229 | |
// created-on : 2020-05-31T19:54:52Z | |
// managed-by : https://github.com/dacr/code-examples-manager | |
// run-with : scala-cli $file | |
// --------------------- | |
//> using scala "3.4.2" | |
//> using dep "org.plotly-scala:plotly-render_2.13:0.8.5" | |
// --------------------- | |
import plotly._, element._, layout._, Plotly._ | |
val data = Seq( | |
Bar( | |
Seq("Banana","Apple","Grapefruit"), | |
Seq(10,8,5), | |
)) | |
val myLayout = | |
Layout() | |
.withTitle("My bars") | |
plot("plot.html", data, myLayout) | |
println( "It will even open the default browser with those two charts !") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment