Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OrdinalScale doesn't work with Axis #71

Open
schang1146 opened this issue Oct 16, 2020 · 1 comment
Open

OrdinalScale doesn't work with Axis #71

schang1146 opened this issue Oct 16, 2020 · 1 comment

Comments

@schang1146
Copy link

schang1146 commented Oct 16, 2020

Trying to use d3scale.scaleOrdinal(...) with d3axis.axisLeft but running into a type problem.

  • Should OrdinalScale extend ContinuousScale[OrdinalScale] similar to LogScale, LinearScale, etc.?

How I'm using it:

val jobs: js.Array[String] = js.Array("Job A", "Job B", "Job C", "Job D", "5", "6", "7", "8", "9", "10")
val y_scale = d3scale.scaleOrdinal(d3.schemeCategory10).domain(jobs)
val y_axis: d3axis.Axis = d3axis.axisLeft(y_scale)

Gives me a type mismatch for y_scale in d3axis.axisLeft()

  • Required: d3.Scale
  • Found: d3scale.OrdinalScale
@fdietze
Copy link
Owner

fdietze commented Jan 19, 2021

Sorry, I don't have time right now to look into this. But PRs are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants