/scala-js-d3v4

ScalaJS facade types for D3 version 4

Primary LanguageScalaMIT LicenseMIT

ScalaJS facade types for D3 version 4

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

Usage

  • Set up Scalajs-Bundler for your project.

  • In your build.sbt:

    libraryDependencies += "com.github.fdietze" %%% "scala-js-d3v4" % "0.1.0-SNAPSHOT"
  • Use d3 like you know it from JavaScript (http://devdocs.io/d3~4):

    import org.scalajs.d3v4._
    
    d3.___
  • Contribute missing facades as pull requests.

  • 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.