Skip to content

ScalaJS facade types for D3 version 5

License

Notifications You must be signed in to change notification settings

fdietze/scala-js-d3v4

Repository files navigation

ScalaJS facade types for D3 version 5

  • Heavily inspired by spaced/scala-js-d3
  • D3 modules are imported automatically by bundler when needed.

Usage

Supported are ScalaJS 1.0 with Scala 2.12 and 2.13.

  • Set up Scalajs-Bundler for your project.

  • In your build.sbt:

    resolvers += "jitpack" at "https://jitpack.io"
    libraryDependencies += "com.github.fdietze.scala-js-d3v4" %%% "scala-js-d3v4" % "809f086"

    Don't forget to update the commit hash. You can also use the hashes of branches and PRs.

  • Use d3 like you know it from JavaScript (http://devdocs.io/d3~4):

    import d3v4._
    
    d3.___
  • Contribute missing facades as pull requests. Most of the time this can be done in a few lines of code. You get a good overview of what exists and what is missing when looking at src/main/scala. Each File corresponds to a module in d3: https://devdocs.io/d3~4. To add a new module, simply create a new file and implement the facades you need. Finally add an implicit to your module in D3.scala.

  • Don't hesitate to open new Issues.

Facade writing guidelines

  • Ref types involving null don't need a union type with Null. Provide wrapper methods mapping to Option.
  • Prefer overloading in most cases. But use union types to avoid combinatorial explosion.

About

ScalaJS facade types for D3 version 5

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages