https://github.com/fdietze/scala-js-d3v4
ScalaJS facade types for D3 version 5
https://github.com/fdietze/scala-js-d3v4
d3 d3v4 facade scala-js
Last synced: 1 day ago
JSON representation
ScalaJS facade types for D3 version 5
- Host: GitHub
- URL: https://github.com/fdietze/scala-js-d3v4
- Owner: fdietze
- License: mit
- Created: 2017-01-10T17:27:28.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-03-17T17:03:53.000Z (7 months ago)
- Last Synced: 2025-03-31T08:12:05.395Z (6 months ago)
- Topics: d3, d3v4, facade, scala-js
- Language: Scala
- Homepage:
- Size: 351 KB
- Stars: 55
- Watchers: 7
- Forks: 26
- Open Issues: 7
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://jitpack.io/#fdietze/scala-js-d3v4)
# ScalaJS facade types for D3 version 5
* Heavily inspired by [spaced/scala-js-d3](https://github.com/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](https://scalacenter.github.io/scalajs-bundler/) for your project.
* In your `build.sbt`:
```scala
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):
```scala
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](https://github.com/fdietze/scala-js-d3v4/tree/master/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](https://github.com/fdietze/scala-js-d3v4/blob/master/src/main/scala/D3.scala#L38).
* 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.