Git Product home page Git Product logo

bokeh-scala's Introduction

Bokeh logo -- text is white in dark theme and black in light theme

Bokeh is an interactive visualization library for modern web browsers. It provides elegant, concise construction of versatile graphics and affords high-performance interactivity across large or streaming datasets. Bokeh can help anyone who wants to create interactive plots, dashboards, and data applications quickly and easily.

Package Latest package version Supported Python versions Bokeh license (BSD 3-clause)
Project Github contributors Link to NumFOCUS Link to documentation
Downloads PyPI downloads per month Conda downloads per month NPM downloads per month
Build Current Bokeh-CI github actions build status Current BokehJS-CI github actions build status Codecov coverage percentage
Community Community support on discourse.bokeh.org Bokeh-tagged questions on Stack Overflow

Consider making a donation if you enjoy using Bokeh and want to support its development.

4x9 image grid of Bokeh plots

Installation

To install Bokeh and its required dependencies using pip, enter the following command at a Bash or Windows command prompt:

pip install bokeh

To install conda, enter the following command at a Bash or Windows command prompt:

conda install bokeh

Refer to the installation documentation for more details.

Resources

Once Bokeh is installed, check out the first steps guides.

Visit the full documentation site to view the User's Guide or launch the Bokeh tutorial to learn about Bokeh in live Jupyter Notebooks.

Community support is available on the Project Discourse.

If you would like to contribute to Bokeh, please review the Contributor Guide and request an invitation to the Bokeh Dev Slack workspace.

Note: Everyone who engages in the Bokeh project's discussion forums, codebases, and issue trackers is expected to follow the Code of Conduct.

Support

Fiscal Support

The Bokeh project is grateful for individual contributions, as well as for monetary support from the organizations and companies listed below:

NumFocus Logo CZI Logo Blackstone Logo
TideLift Logo Anaconda Logo NVidia Logo Rapids Logo

If your company uses Bokeh and is able to sponsor the project, please contact [email protected]

Bokeh is a Sponsored Project of NumFOCUS, a 501(c)(3) nonprofit charity in the United States. NumFOCUS provides Bokeh with fiscal, legal, and administrative support to help ensure the health and sustainability of the project. Visit numfocus.org for more information.

Donations to Bokeh are managed by NumFOCUS. For donors in the United States, your gift is tax-deductible to the extent provided by law. As with any donation, you should consult with your tax adviser about your particular tax situation.

In-kind Support

Non-monetary support can help with development, collaboration, infrastructure, security, and vulnerability management. The Bokeh project is grateful to the following companies for their donation of services:

bokeh-scala's People

Contributors

bryevdv avatar mattpap avatar slothspot avatar superfan89 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bokeh-scala's Issues

Archive or move

@mattpap both the scala repos have not seen any activity in the better part of a decade. I would like to strongly propose either to archive them, or have them move out of the Bokeh org and into your personal GH account.

Get rid of deprecation warnings related to macros

Macros are an experimental feature of Scala and change from version to version. The difference between 2.10 and 2.11 is significant and causes a lot of warnings to be produced during compilation. Use similar compatibility layer as implemented in IScala.

Investigate a warning under -Xlog-free-types

Specifically this:

[info] /home/travis/build/bokeh/bokeh-scala/bokeh/src/main/scala/models/Sources.scala:55: free type: Ident(TypeName("M")) defined by columnImpl in Sources.scala:47:20
[info]         c.Expr[ColumnDataSource#Column[M, T]](q"new Column(Symbol($name), $value)")
[info] 

Glyphs and markers should have type parameters for X and Y dimensions

Currently glyphs and markers are naively implemented like, e.g.:

@model class Line extends Glyph {
    object x extends Spatial[Double]
    object y extends Spatial[Double]
}

This suggests that the only possible values for x and y are of type Double. However, Strings are perfectly valid for categorical plots. Sometimes also widening is not possible, so Int, Short, etc. will be rejected as well (e.g. when using new typed data sources).

The natural approach is to introduce some type class encapsulating dimensions (say Dim) and define glyphs and markers as follows:

@model class Line[X:Dim, Y:Dim] extends Glyph {
    object x extends Spatial[X]
    object y extends Spatial[Y]
}

(for simplicity I didn't write full signatures including Default and Writes type classes). This implementation has the disadvantage that new Line().x(0).y(1) wouldn't be possible anymore, because Scala won't be able to infer X and Y type parameters (due to local type inference). One would have to write new Line[Double, Double]().x(0).y(1) which is pretty verbose and annoying. The only way to infer those parameters is to pass values for x and y in the constructor, i.e. new Line(0, 1). This will require us to add a series of constructors to each glyph (note that constructors aren't inheritable).

I consider the current situation a bug, because the only way to create a categorical plot (among other issues) is to use untyped data sources, which renders using Scala pretty useless.

Consider a new versioning scheme that includes bokeh's version

Currently bokeh-scala's version number is unrelated to bokeh's version, so in fact two versions have to be carried along. Maybe we should switch to something like bokeh's_version-rN, where N would be an integer, e.g. for bokeh 0.7.1, this would be bokeh-scala 0.7.1-r3 (r3, because 0.3 is the version in the current scheme). One thing we shouldn't do is to make bokeh's and bokeh-scala's version exactly the same, because it should be possible to release bokeh-scala (e.g. with bugfixes exclusively related to Scala) in between bokeh's releases.

Minimal example for Jupyter notebooks?

I would love to combine scala-bokeh with jupyter notebooks running a scala/spark kernel. I can import scala-bokeh dependencies into my notebook - any tips as to how I can create a minimal chart and display it in the notebook?

Error when compiling on Windows 7

Compilation failed on Windows 7 64bit, and stack trace is as follows.

java.lang.RuntimeException: java.net.URISyntaxException: Illegal character in opaque part at index 2: D:\Github\bokeh-scala\project\target\scala-2.10\sbt-
0.13\classes\eco
        at org.mozilla.javascript.tools.shell.Global.installRequire(Global.java:145)
        at EcoPlugin$EcoSource.ecoScope(EcoPlugin.scala:34)
        at EcoPlugin$EcoSource$$anonfun$compile$1$$anonfun$apply$2.apply(EcoPlugin.scala:42)
        at EcoPlugin$EcoSource$$anonfun$compile$1$$anonfun$apply$2.apply(EcoPlugin.scala:41)
        at Rhino$class.withContext(Plugin.scala:9)
        at EcoPlugin$EcoSource.withContext(EcoPlugin.scala:13)
        at EcoPlugin$EcoSource$$anonfun$compile$1.apply(EcoPlugin.scala:41)
        at EcoPlugin$EcoSource$$anonfun$compile$1.apply(EcoPlugin.scala:39)
        at scala.Option.map(Option.scala:145)
        at EcoPlugin$EcoSource.compile(EcoPlugin.scala:39)
        at com.untyped.sbtgraph.Graph$$anonfun$3.apply(Graph.scala:139)
        at com.untyped.sbtgraph.Graph$$anonfun$3.apply(Graph.scala:139)
        at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
        at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
        at scala.collection.immutable.List.foreach(List.scala:318)
        at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251)
        at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105)
        at com.untyped.sbtgraph.Graph$class.compileAll(Graph.scala:139)
        at EcoPlugin$EcoGraph.compileAll(EcoPlugin.scala:53)
        at EcoPlugin$$anonfun$compileTask$1.apply(EcoPlugin.scala:102)
        at EcoPlugin$$anonfun$compileTask$1.apply(EcoPlugin.scala:99)
        at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
        at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
        at sbt.std.Transform$$anon$4.work(System.scala:63)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
        at sbt.Execute.work(Execute.scala:235)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
        at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
        at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.URISyntaxException: Illegal character in opaque part at index 2: D:\Github\bokeh-scala\project\target\scala-2.10\sbt-0.13\classes\eco
        at java.net.URI$Parser.fail(URI.java:2848)
        at java.net.URI$Parser.checkChars(URI.java:3021)
        at java.net.URI$Parser.parse(URI.java:3058)
        at java.net.URI.<init>(URI.java:588)
        at org.mozilla.javascript.tools.shell.Global.installRequire(Global.java:133)
        at EcoPlugin$EcoSource.ecoScope(EcoPlugin.scala:34)
        at EcoPlugin$EcoSource$$anonfun$compile$1$$anonfun$apply$2.apply(EcoPlugin.scala:42)
        at EcoPlugin$EcoSource$$anonfun$compile$1$$anonfun$apply$2.apply(EcoPlugin.scala:41)
        at Rhino$class.withContext(Plugin.scala:9)
        at EcoPlugin$EcoSource.withContext(EcoPlugin.scala:13)
        at EcoPlugin$EcoSource$$anonfun$compile$1.apply(EcoPlugin.scala:41)
        at EcoPlugin$EcoSource$$anonfun$compile$1.apply(EcoPlugin.scala:39)
        at scala.Option.map(Option.scala:145)
        at EcoPlugin$EcoSource.compile(EcoPlugin.scala:39)
        at com.untyped.sbtgraph.Graph$$anonfun$3.apply(Graph.scala:139)
        at com.untyped.sbtgraph.Graph$$anonfun$3.apply(Graph.scala:139)
        at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
        at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
        at scala.collection.immutable.List.foreach(List.scala:318)
        at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251)
        at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105)
        at com.untyped.sbtgraph.Graph$class.compileAll(Graph.scala:139)
        at EcoPlugin$EcoGraph.compileAll(EcoPlugin.scala:53)
        at EcoPlugin$$anonfun$compileTask$1.apply(EcoPlugin.scala:102)
        at EcoPlugin$$anonfun$compileTask$1.apply(EcoPlugin.scala:99)
        at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
        at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
        at sbt.std.Transform$$anon$4.work(System.scala:63)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
        at sbt.Execute.work(Execute.scala:235)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
        at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
        at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
[error] (bokehjs/compile:eco) java.net.URISyntaxException: Illegal character in
opaque part at index 2: D:\Github\bokeh-scala\project\target\scala-2.10\sbt-0.13\classes\eco

Automate release process

In theory, releasing a new version of bokeh-scala is as simple as issuing ./sbt +publishSigned and going to oss.sonatype.org and closing and releasing staging repository. Full process is a little more involved and is detailed here. Preferably write automation in sbt and maybe use jgit.

Requirements for basic example?

I tried building the plots using sbt (per the README), and none of the plots actually work (though ample bokeh json descriptions are indeed written to the html files). I see that bokeh-scala is finding the bokeh.js files from my local install, which has Bokeh 0.4.4 installed. Using my installed sbt and your ./sbt yield the same results.

Other potential version issues: I'm running the system standard JDK for Mavericks (1.6.0_65) and scala 2.10 / sbt installed via homebrew.

Make breeze an optional depencency

Currently bokeh depends on breeze, mainly to allow breeze.linalg.DenseVector[_] as a column type (and serialization). It would be better to make breeze optional to reduce dependency size and make a step towards scala.js compatibility. Most support for DenseVector is done through type classes, so it shouldn't be a problem to move them to a separate sub-project (e.g. lib or something like that) and then import as needed. The only issue is with serialization of Any (still required for ColumnDataSource). I tried to use a structural type instead of DenseVector[_] in anyToJson(), but this can fail with "method not found" upon reflection (the match is unchecked, resulting in a cast, possibly unsuccessful). If ColumnDataSource was improved to not use Any, then this issue would resolve by itself.

Don't publishSigned meta "all" project

Currently this makes ./sbt +publishSigned fail halfway with:

java.lang.RuntimeException: Repository for publishing is not specified.
    at scala.sys.package$.error(package.scala:27)
    at sbt.Classpaths$$anonfun$getPublishTo$1.apply(Defaults.scala:1411)
    at sbt.Classpaths$$anonfun$getPublishTo$1.apply(Defaults.scala:1411)
    at scala.Option.getOrElse(Option.scala:120)
    at sbt.Classpaths$.getPublishTo(Defaults.scala:1411)
    at com.typesafe.sbt.pgp.PgpSettings$$anonfun$signingSettings$2.apply(PgpSettings.scala:125)
    at com.typesafe.sbt.pgp.PgpSettings$$anonfun$signingSettings$2.apply(PgpSettings.scala:124)
    at scala.Function6$$anonfun$tupled$1.apply(Function6.scala:35)
    at scala.Function6$$anonfun$tupled$1.apply(Function6.scala:34)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
    at sbt.std.Transform$$anon$4.work(System.scala:63)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
    at sbt.Execute.work(Execute.scala:235)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
[error] (all/*:publishSignedConfiguration) Repository for publishing is not specified.

High-level API functionality

Hi,
In the Python version of bokeh, there are high-level helper methods like bar from bokeh.charts that make plotting really easy. Is there something similar for bokeh-scala or are there plans to add that?

ColumnDataSource.data field should not use Any

We use type class-based serialization method (through play-json) and Any doesn't play well with this approach. Using HList from shapeless is one option. I tried this once, but failed.

Add support for scala.js

scala.js doesn't allow non-JS dependencies (obviously), so all bokeh's dependencies would have to be cross-compiled with scala.js or made optional. bokeh currently depends on breeze and joda-time, both which can't be cross-compiled, so this feature is blocked on issue #4.

Broken scala-io-file dependency

com.github.scala-incubator.io:scala-io-file_2.11:jar:0.4.3 has an error in its dependencies: it points to a non-existent org.scala-lang.modules:scala-parser-combinators_2.11:jar:1.0.0. Version 0.4.3-1 fixes this, so please update your scala-io-file dependency to 0.4.3-1:

val version = "0.4.3"

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.