/tyrian-chartjs-interop-example

This is an example of how to use Chart.JS and integrate it with Tyrian

Primary LanguageScala

Tyrian Chart.JS interop

This is a simple example of how to use Chart.JS leveraging Scalably Typed mappings and getting it to interop with Tyrian.

Instructions

This project makes use of the ScalaJS Bundler plugin via ScalablyTyped so all dependencies (NPM and Scala.JS) are managed by SBT. To transpile Scala JS code to JavaScript, run:

sbt fastOptJS::webpack

This will generate target/scala-3.3.0/scalajs-bundler/main/myawesomewebapp-fastopt-bundle.js which is used by index.html

You can use the following to automatically recompile when you change the code:

sbt ~fastOptJS::webpack

To run the web application, run:

npx http-server -c-1

This starts up a web server on port 8080 and does not cache any files.

Visit the root page to see the application