Last active
February 3, 2026 20:20
-
-
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/bd6ca597d5e5e22263452e8e3ec8766007e4613f
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 License Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt) | |
| // 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