Last active
May 8, 2023 20:34
-
-
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/33a407c3080e2fffca4bce0a5377e42bc24b4b9
This file contains 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.2.2" | |
//> using dep "org.plotly-scala:plotly-render_2.13:0.8.4" | |
// --------------------- | |
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