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

Scatter problems with group #19

Open
AdrianP- opened this issue Jan 8, 2016 · 0 comments
Open

Scatter problems with group #19

AdrianP- opened this issue Jan 8, 2016 · 0 comments

Comments

@AdrianP-
Copy link

AdrianP- commented Jan 8, 2016

Hi,

The example of http://lightning-viz.org/visualizations/scatter/ don't run in my environment, because it has several errors:

First:

scala> lgn.scatter(x, y, group=group, size=size)
<console>:37: error: type mismatch;
 found   : Array[Float]
 required: Array[Double]
              lgn.scatter(x, y, group=group, size=size)
                          ^

So you need to change every .nextFloat() to .nextDouble() like this:

val x = Array.fill(100)(Random.nextDouble())
val y = Array.fill(100)(Random.nextDouble())
val group = Array.fill(100)(Random.nextDouble() * 5).map(_.toInt)
val size = Array.fill(100)(Random.nextDouble() * 20 + 5)

and the next error:

scala> lgn.scatter(x, y, group=group, size=size)
<console>:37: error: reassignment to val
              lgn.scatter(x, y, group=group, size=size)
                                     ^

I saw the source code and didn't see any group. What it's missing?

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

1 participant