Skip to content

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

Contributors 11

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy