Created
August 7, 2017 04:26
-
-
Save spmp/5f8cf0617b62ab01fe2f01806aaec0f8 to your computer and use it in GitHub Desktop.
ipyNBTestA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Imports" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Marking io.continuum.bokeh:bokeh_2.11:0.7 for download\n", | |
"Preparing to fetch from:\n", | |
"-> file:/tmp/toree_add_deps8343821997174635635/\n", | |
"-> https://repo1.maven.org/maven2\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/io/continuum/bokeh/bokeh_2.11/0.7/bokeh_2.11-0.7.jar\n", | |
"Marking com.github.julien-truffaut:monocle-core_2.11:1.1.0 for download\n", | |
"Preparing to fetch from:\n", | |
"-> file:/tmp/toree_add_deps8343821997174635635/\n", | |
"-> https://repo1.maven.org/maven2\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/com/github/julien-truffaut/monocle-core_2.11/1.1.0/monocle-core_2.11-1.1.0.jar\n", | |
"Marking com.github.julien-truffaut:monocle-macro_2.11:1.1.0 for download\n", | |
"Preparing to fetch from:\n", | |
"-> file:/tmp/toree_add_deps8343821997174635635/\n", | |
"-> https://repo1.maven.org/maven2\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/com/github/julien-truffaut/monocle-macro_2.11/1.1.0/monocle-macro_2.11-1.1.0.jar\n", | |
"Marking org.vegas-viz:vegas_2.11:0.3.11 for download\n", | |
"Preparing to fetch from:\n", | |
"-> file:/tmp/toree_add_deps8343821997174635635/\n", | |
"-> https://repo1.maven.org/maven2\n", | |
"=> https://repo1.maven.org/maven2/org/vegas-viz/vegas_2.11/0.3.11/vegas_2.11-0.3.11.pom: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/vegas-viz/vegas_2.11/0.3.11/vegas_2.11-0.3.11.pom\n", | |
"=> https://repo1.maven.org/maven2/org/vegas-viz/vegas_2.11/0.3.11/vegas_2.11-0.3.11.pom.sha1: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/vegas-viz/vegas_2.11/0.3.11/vegas_2.11-0.3.11.pom.sha1\n", | |
"=> https://repo1.maven.org/maven2/org/vegas-viz/vegas_2.11/0.3.11/vegas_2.11-0.3.11.pom: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/vegas-viz/vegas_2.11/0.3.11/vegas_2.11-0.3.11.pom\n", | |
"=> https://repo1.maven.org/maven2/org/vegas-viz/vegas_2.11/0.3.11/vegas_2.11-0.3.11.pom.sha1: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/vegas-viz/vegas_2.11/0.3.11/vegas_2.11-0.3.11.pom.sha1\n", | |
"=> https://repo1.maven.org/maven2/com/github/julien-truffaut/monocle-macro_2.11/1.1.0/monocle-macro_2.11-1.1.0.pom: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/com/github/julien-truffaut/monocle-macro_2.11/1.1.0/monocle-macro_2.11-1.1.0.pom\n", | |
"=> https://repo1.maven.org/maven2/com/github/julien-truffaut/monocle-macro_2.11/1.1.0/monocle-macro_2.11-1.1.0.pom.sha1: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/com/github/julien-truffaut/monocle-macro_2.11/1.1.0/monocle-macro_2.11-1.1.0.pom.sha1\n", | |
"=> https://repo1.maven.org/maven2/com/github/julien-truffaut/monocle-core_2.11/1.1.0/monocle-core_2.11-1.1.0.pom: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/com/github/julien-truffaut/monocle-core_2.11/1.1.0/monocle-core_2.11-1.1.0.pom\n", | |
"=> https://repo1.maven.org/maven2/com/github/julien-truffaut/monocle-core_2.11/1.1.0/monocle-core_2.11-1.1.0.pom.sha1: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/com/github/julien-truffaut/monocle-core_2.11/1.1.0/monocle-core_2.11-1.1.0.pom.sha1\n", | |
"=> https://repo1.maven.org/maven2/com/github/julien-truffaut/monocle-macro_2.11/1.1.0/monocle-macro_2.11-1.1.0.pom.sha1: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/com/github/julien-truffaut/monocle-macro_2.11/1.1.0/monocle-macro_2.11-1.1.0.pom.sha1\n", | |
"=> https://repo1.maven.org/maven2/com/github/julien-truffaut/monocle-macro_2.11/1.1.0/monocle-macro_2.11-1.1.0.pom: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/com/github/julien-truffaut/monocle-macro_2.11/1.1.0/monocle-macro_2.11-1.1.0.pom\n", | |
"=> https://repo1.maven.org/maven2/org/vegas-viz/vegas-macros_2.11/0.3.11/vegas-macros_2.11-0.3.11.pom: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/vegas-viz/vegas-macros_2.11/0.3.11/vegas-macros_2.11-0.3.11.pom\n", | |
"=> https://repo1.maven.org/maven2/org/vegas-viz/vegas-macros_2.11/0.3.11/vegas-macros_2.11-0.3.11.pom.sha1: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/vegas-viz/vegas-macros_2.11/0.3.11/vegas-macros_2.11-0.3.11.pom.sha1\n", | |
"=> https://repo1.maven.org/maven2/com/github/julien-truffaut/monocle-core_2.11/1.1.0/monocle-core_2.11-1.1.0.pom: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/com/github/julien-truffaut/monocle-core_2.11/1.1.0/monocle-core_2.11-1.1.0.pom\n", | |
"=> https://repo1.maven.org/maven2/com/github/julien-truffaut/monocle-core_2.11/1.1.0/monocle-core_2.11-1.1.0.pom.sha1: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/com/github/julien-truffaut/monocle-core_2.11/1.1.0/monocle-core_2.11-1.1.0.pom.sha1\n", | |
"=> 1 (): Downloading https://repo1.maven.org/maven2/io/circe/circe-parser_2.11/0.7.0/circe-parser_2.11-0.7.0.pom\n", | |
"=> 2 (): Downloading https://repo1.maven.org/maven2/org/scalafx/scalafx_2.11/8.0.92-R10/scalafx_2.11-8.0.92-R10.pom.sha1\n", | |
"=> 3 (): Downloading https://repo1.maven.org/maven2/org/scalafx/scalafx_2.11/8.0.92-R10/scalafx_2.11-8.0.92-R10.pom\n", | |
"=> 4 (): Downloading https://repo1.maven.org/maven2/org/webjars/bower/vega-lite/1.2.0/vega-lite-1.2.0.pom\n", | |
"=> 5 (): Downloading https://repo1.maven.org/maven2/io/circe/circe-parser_2.11/0.7.0/circe-parser_2.11-0.7.0.pom.sha1\n", | |
"=> 6 (): Downloading https://repo1.maven.org/maven2/org/webjars/bower/vega-lite/1.2.0/vega-lite-1.2.0.pom.sha1\n", | |
"=> 1 (circe-parser_2.11-0.7.0.pom): Finished downloading\n", | |
"=> 7 (): Downloading https://repo1.maven.org/maven2/io/circe/circe-generic_2.11/0.7.0/circe-generic_2.11-0.7.0.pom\n", | |
"=> 4 (vega-lite-1.2.0.pom): Finished downloading\n", | |
"=> 5 (circe-parser_2.11-0.7.0.pom.sha1): Finished downloading\n", | |
"=> https://repo1.maven.org/maven2/org/vegas-viz/vegas-macros_2.11/0.3.11/vegas-macros_2.11-0.3.11.pom: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/vegas-viz/vegas-macros_2.11/0.3.11/vegas-macros_2.11-0.3.11.pom\n", | |
"=> https://repo1.maven.org/maven2/org/vegas-viz/vegas-macros_2.11/0.3.11/vegas-macros_2.11-0.3.11.pom.sha1: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/vegas-viz/vegas-macros_2.11/0.3.11/vegas-macros_2.11-0.3.11.pom.sha1\n", | |
"=> 8 (): Downloading https://repo1.maven.org/maven2/io/circe/circe-generic_2.11/0.7.0/circe-generic_2.11-0.7.0.pom.sha1\n", | |
"=> 3 (scalafx_2.11-8.0.92-R10.pom): Finished downloading\n", | |
"=> 9 (): Downloading https://repo1.maven.org/maven2/io/circe/circe-core_2.11/0.7.0/circe-core_2.11-0.7.0.pom\n", | |
"=> 10 (): Downloading https://repo1.maven.org/maven2/io/circe/circe-core_2.11/0.7.0/circe-core_2.11-0.7.0.pom.sha1\n", | |
"=> 7 (circe-generic_2.11-0.7.0.pom): Finished downloading\n", | |
"=> 8 (circe-generic_2.11-0.7.0.pom.sha1): Finished downloading\n", | |
"=> 6 (vega-lite-1.2.0.pom.sha1): Finished downloading\n", | |
"=> 2 (scalafx_2.11-8.0.92-R10.pom.sha1): Finished downloading\n", | |
"=> 10 (circe-core_2.11-0.7.0.pom.sha1): Finished downloading\n", | |
"=> 9 (circe-core_2.11-0.7.0.pom): Finished downloading\n", | |
"=> 11 (): Downloading https://repo1.maven.org/maven2/org/typelevel/cats-core_2.11/0.9.0/cats-core_2.11-0.9.0.pom.sha1\n", | |
"=> 12 (): Downloading https://repo1.maven.org/maven2/io/circe/circe-numbers_2.11/0.7.0/circe-numbers_2.11-0.7.0.pom.sha1\n", | |
"=> 13 (): Downloading https://repo1.maven.org/maven2/io/circe/circe-numbers_2.11/0.7.0/circe-numbers_2.11-0.7.0.pom\n", | |
"=> 14 (): Downloading https://repo1.maven.org/maven2/org/typelevel/macro-compat_2.11/1.1.1/macro-compat_2.11-1.1.1.pom\n", | |
"=> 15 (): Downloading https://repo1.maven.org/maven2/org/typelevel/macro-compat_2.11/1.1.1/macro-compat_2.11-1.1.1.pom.sha1\n", | |
"=> 16 (): Downloading https://repo1.maven.org/maven2/org/typelevel/cats-core_2.11/0.9.0/cats-core_2.11-0.9.0.pom\n", | |
"=> 11 (cats-core_2.11-0.9.0.pom.sha1): Finished downloading\n", | |
"=> 17 (): Downloading https://repo1.maven.org/maven2/org/scalaz/scalaz-core_2.11/7.1.1/scalaz-core_2.11-7.1.1.pom.sha1\n", | |
"=> 14 (macro-compat_2.11-1.1.1.pom): Finished downloading\n", | |
"=> 18 (): Downloading https://repo1.maven.org/maven2/org/scalaz/scalaz-core_2.11/7.1.1/scalaz-core_2.11-7.1.1.pom\n", | |
"=> 15 (macro-compat_2.11-1.1.1.pom.sha1): Finished downloading\n", | |
"=> 19 (): Downloading https://repo1.maven.org/maven2/com/chuusai/shapeless_2.11/2.3.2/shapeless_2.11-2.3.2.pom.sha1\n", | |
"=> 12 (circe-numbers_2.11-0.7.0.pom.sha1): Finished downloading\n", | |
"=> 20 (): Downloading https://repo1.maven.org/maven2/com/chuusai/shapeless_2.11/2.3.2/shapeless_2.11-2.3.2.pom\n" | |
] | |
}, | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"=> 13 (circe-numbers_2.11-0.7.0.pom): Finished downloading\n", | |
"=> 21 (): Downloading https://repo1.maven.org/maven2/io/circe/circe-jawn_2.11/0.7.0/circe-jawn_2.11-0.7.0.pom\n", | |
"=> 19 (shapeless_2.11-2.3.2.pom.sha1): Finished downloading\n", | |
"=> 18 (scalaz-core_2.11-7.1.1.pom): Finished downloading\n", | |
"=> 17 (scalaz-core_2.11-7.1.1.pom.sha1): Finished downloading\n", | |
"=> 22 (): Downloading https://repo1.maven.org/maven2/io/circe/circe-jawn_2.11/0.7.0/circe-jawn_2.11-0.7.0.pom.sha1\n", | |
"=> 23 (): Downloading https://repo1.maven.org/maven2/org/webjars/bower/vega/maven-metadata.xml.sha1\n", | |
"=> 24 (): Downloading https://repo1.maven.org/maven2/org/webjars/bower/vega/maven-metadata.xml\n", | |
"=> 20 (shapeless_2.11-2.3.2.pom): Finished downloading\n", | |
"=> 21 (circe-jawn_2.11-0.7.0.pom): Finished downloading\n", | |
"=> 24 (maven-metadata.xml): Finished downloading\n", | |
"=> 22 (circe-jawn_2.11-0.7.0.pom.sha1): Finished downloading\n", | |
"=> 23 (maven-metadata.xml.sha1): Finished downloading\n", | |
"=> 25 (): Downloading https://repo1.maven.org/maven2/org/webjars/bower/vega/3.0.0-rc4/vega-3.0.0-rc4.pom\n", | |
"=> 26 (): Downloading https://repo1.maven.org/maven2/org/webjars/bower/vega/3.0.0-rc4/vega-3.0.0-rc4.pom.sha1\n", | |
"=> 16 (cats-core_2.11-0.9.0.pom): Finished downloading\n", | |
"=> 26 (vega-3.0.0-rc4.pom.sha1): Finished downloading\n", | |
"=> 25 (vega-3.0.0-rc4.pom): Finished downloading\n", | |
"=> 27 (): Downloading https://repo1.maven.org/maven2/org/spire-math/jawn-parser_2.11/0.10.4/jawn-parser_2.11-0.10.4.pom\n", | |
"=> 28 (): Downloading https://repo1.maven.org/maven2/org/typelevel/machinist_2.11/0.6.1/machinist_2.11-0.6.1.pom.sha1\n", | |
"=> 29 (): Downloading https://repo1.maven.org/maven2/org/typelevel/machinist_2.11/0.6.1/machinist_2.11-0.6.1.pom\n", | |
"=> 30 (): Downloading https://repo1.maven.org/maven2/com/github/mpilquist/simulacrum_2.11/0.10.0/simulacrum_2.11-0.10.0.pom\n", | |
"=> 31 (): Downloading https://repo1.maven.org/maven2/org/spire-math/jawn-parser_2.11/0.10.4/jawn-parser_2.11-0.10.4.pom.sha1\n", | |
"=> 32 (): Downloading https://repo1.maven.org/maven2/com/github/mpilquist/simulacrum_2.11/0.10.0/simulacrum_2.11-0.10.0.pom.sha1\n", | |
"=> 27 (jawn-parser_2.11-0.10.4.pom): Finished downloading\n", | |
"=> 33 (): Downloading https://repo1.maven.org/maven2/org/typelevel/cats-kernel_2.11/0.9.0/cats-kernel_2.11-0.9.0.pom\n", | |
"=> 30 (simulacrum_2.11-0.10.0.pom): Finished downloading\n", | |
"=> 34 (): Downloading https://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.11/1.0.2/scala-xml_2.11-1.0.2.pom\n", | |
"=> 28 (machinist_2.11-0.6.1.pom.sha1): Finished downloading\n", | |
"=> 35 (): Downloading https://repo1.maven.org/maven2/org/typelevel/cats-kernel_2.11/0.9.0/cats-kernel_2.11-0.9.0.pom.sha1\n", | |
"=> 31 (jawn-parser_2.11-0.10.4.pom.sha1): Finished downloading\n", | |
"=> 29 (machinist_2.11-0.6.1.pom): Finished downloading\n", | |
"=> 36 (): Downloading https://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.11/1.0.2/scala-xml_2.11-1.0.2.pom.sha1\n", | |
"=> 37 (): Downloading https://repo1.maven.org/maven2/org/typelevel/cats-macros_2.11/0.9.0/cats-macros_2.11-0.9.0.pom\n", | |
"=> 33 (cats-kernel_2.11-0.9.0.pom): Finished downloading\n", | |
"=> 38 (): Downloading https://repo1.maven.org/maven2/org/typelevel/cats-macros_2.11/0.9.0/cats-macros_2.11-0.9.0.pom.sha1\n", | |
"=> 34 (scala-xml_2.11-1.0.2.pom): Finished downloading\n", | |
"=> 39 (): Downloading https://repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.11/1.0.2/scala-parser-combinators_2.11-1.0.2.pom\n", | |
"=> 35 (cats-kernel_2.11-0.9.0.pom.sha1): Finished downloading\n", | |
"=> 40 (): Downloading https://repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.11/1.0.2/scala-parser-combinators_2.11-1.0.2.pom.sha1\n", | |
"=> 36 (scala-xml_2.11-1.0.2.pom.sha1): Finished downloading\n", | |
"=> 37 (cats-macros_2.11-0.9.0.pom): Finished downloading\n", | |
"=> 38 (cats-macros_2.11-0.9.0.pom.sha1): Finished downloading\n", | |
"=> 40 (scala-parser-combinators_2.11-1.0.2.pom.sha1): Finished downloading\n", | |
"=> 39 (scala-parser-combinators_2.11-1.0.2.pom): Finished downloading\n", | |
"=> 32 (simulacrum_2.11-0.10.0.pom.sha1): Finished downloading\n", | |
"=> https://repo1.maven.org/maven2/com/github/julien-truffaut/monocle-core_2.11/1.1.0/monocle-core_2.11-1.1.0.jar.sha1: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/com/github/julien-truffaut/monocle-core_2.11/1.1.0/monocle-core_2.11-1.1.0.jar.sha1\n", | |
"=> https://repo1.maven.org/maven2/com/github/julien-truffaut/monocle-macro_2.11/1.1.0/monocle-macro_2.11-1.1.0.jar: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/com/github/julien-truffaut/monocle-macro_2.11/1.1.0/monocle-macro_2.11-1.1.0.jar\n", | |
"=> https://repo1.maven.org/maven2/com/github/julien-truffaut/monocle-macro_2.11/1.1.0/monocle-macro_2.11-1.1.0.jar.sha1: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/com/github/julien-truffaut/monocle-macro_2.11/1.1.0/monocle-macro_2.11-1.1.0.jar.sha1\n", | |
"=> https://repo1.maven.org/maven2/com/github/julien-truffaut/monocle-core_2.11/1.1.0/monocle-core_2.11-1.1.0.jar: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/com/github/julien-truffaut/monocle-core_2.11/1.1.0/monocle-core_2.11-1.1.0.jar\n", | |
"=> https://repo1.maven.org/maven2/org/vegas-viz/vegas_2.11/0.3.11/vegas_2.11-0.3.11.jar: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/vegas-viz/vegas_2.11/0.3.11/vegas_2.11-0.3.11.jar\n", | |
"=> https://repo1.maven.org/maven2/org/vegas-viz/vegas_2.11/0.3.11/vegas_2.11-0.3.11.jar.sha1: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/vegas-viz/vegas_2.11/0.3.11/vegas_2.11-0.3.11.jar.sha1\n", | |
"=> https://repo1.maven.org/maven2/org/vegas-viz/vegas-macros_2.11/0.3.11/vegas-macros_2.11-0.3.11.jar: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/vegas-viz/vegas-macros_2.11/0.3.11/vegas-macros_2.11-0.3.11.jar\n", | |
"=> https://repo1.maven.org/maven2/org/vegas-viz/vegas-macros_2.11/0.3.11/vegas-macros_2.11-0.3.11.jar.sha1: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/vegas-viz/vegas-macros_2.11/0.3.11/vegas-macros_2.11-0.3.11.jar.sha1\n", | |
"=> https://repo1.maven.org/maven2/com/github/julien-truffaut/monocle-core_2.11/1.1.0/monocle-core_2.11-1.1.0.jar.sha1: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/com/github/julien-truffaut/monocle-core_2.11/1.1.0/monocle-core_2.11-1.1.0.jar.sha1\n", | |
"=> https://repo1.maven.org/maven2/com/github/julien-truffaut/monocle-macro_2.11/1.1.0/monocle-macro_2.11-1.1.0.jar: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/com/github/julien-truffaut/monocle-macro_2.11/1.1.0/monocle-macro_2.11-1.1.0.jar\n", | |
"=> https://repo1.maven.org/maven2/com/github/julien-truffaut/monocle-core_2.11/1.1.0/monocle-core_2.11-1.1.0.jar: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/com/github/julien-truffaut/monocle-core_2.11/1.1.0/monocle-core_2.11-1.1.0.jar\n", | |
"=> https://repo1.maven.org/maven2/org/vegas-viz/vegas_2.11/0.3.11/vegas_2.11-0.3.11.jar: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/vegas-viz/vegas_2.11/0.3.11/vegas_2.11-0.3.11.jar\n", | |
"=> https://repo1.maven.org/maven2/com/github/julien-truffaut/monocle-macro_2.11/1.1.0/monocle-macro_2.11-1.1.0.jar.sha1: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/com/github/julien-truffaut/monocle-macro_2.11/1.1.0/monocle-macro_2.11-1.1.0.jar.sha1\n", | |
"=> https://repo1.maven.org/maven2/org/vegas-viz/vegas_2.11/0.3.11/vegas_2.11-0.3.11.jar.sha1: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/vegas-viz/vegas_2.11/0.3.11/vegas_2.11-0.3.11.jar.sha1\n", | |
"=> https://repo1.maven.org/maven2/org/vegas-viz/vegas-macros_2.11/0.3.11/vegas-macros_2.11-0.3.11.jar: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/vegas-viz/vegas-macros_2.11/0.3.11/vegas-macros_2.11-0.3.11.jar\n", | |
"=> https://repo1.maven.org/maven2/org/vegas-viz/vegas-macros_2.11/0.3.11/vegas-macros_2.11-0.3.11.jar.sha1: Found at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/vegas-viz/vegas-macros_2.11/0.3.11/vegas-macros_2.11-0.3.11.jar.sha1\n", | |
"=> 1 (): Downloading https://repo1.maven.org/maven2/org/typelevel/cats-macros_2.11/0.9.0/cats-macros_2.11-0.9.0.jar\n", | |
"=> 1 (): Downloading https://repo1.maven.org/maven2/org/typelevel/macro-compat_2.11/1.1.1/macro-compat_2.11-1.1.1.jar.sha1\n", | |
"=> 1 (): Downloading https://repo1.maven.org/maven2/com/chuusai/shapeless_2.11/2.3.2/shapeless_2.11-2.3.2.jar.sha1\n", | |
"=> 1 (): Downloading https://repo1.maven.org/maven2/io/circe/circe-parser_2.11/0.7.0/circe-parser_2.11-0.7.0.jar\n", | |
"=> 2 (): Downloading https://repo1.maven.org/maven2/org/typelevel/macro-compat_2.11/1.1.1/macro-compat_2.11-1.1.1.jar\n", | |
"=> 2 (): Downloading https://repo1.maven.org/maven2/com/chuusai/shapeless_2.11/2.3.2/shapeless_2.11-2.3.2.jar\n" | |
] | |
}, | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"=> 1 (shapeless_2.11-2.3.2.jar.sha1): Finished downloading\n", | |
"=> 1 (): Downloading https://repo1.maven.org/maven2/org/typelevel/cats-kernel_2.11/0.9.0/cats-kernel_2.11-0.9.0.jar\n", | |
"=> 1 (macro-compat_2.11-1.1.1.jar.sha1): Finished downloading\n", | |
"=> 1 (): Downloading https://repo1.maven.org/maven2/org/webjars/bower/vega/3.0.0-rc4/vega-3.0.0-rc4.jar\n", | |
"=> 2 (macro-compat_2.11-1.1.1.jar): Finished downloading\n", | |
"=> 1 (cats-macros_2.11-0.9.0.jar): Finished downloading\n", | |
"=> 1 (circe-parser_2.11-0.7.0.jar): Finished downloading\n", | |
"=> 2 (): Downloading https://repo1.maven.org/maven2/org/typelevel/cats-kernel_2.11/0.9.0/cats-kernel_2.11-0.9.0.jar.sha1\n", | |
"=> 2 (): Downloading https://repo1.maven.org/maven2/org/webjars/bower/vega/3.0.0-rc4/vega-3.0.0-rc4.jar.sha1\n", | |
"=> 1 (): Downloading https://repo1.maven.org/maven2/org/scalaz/scalaz-core_2.11/7.1.1/scalaz-core_2.11-7.1.1.jar\n", | |
"=> 2 (cats-kernel_2.11-0.9.0.jar.sha1): Finished downloading\n", | |
"=> 2 (): Downloading https://repo1.maven.org/maven2/org/scalaz/scalaz-core_2.11/7.1.1/scalaz-core_2.11-7.1.1.jar.sha1\n", | |
"=> 2 (vega-3.0.0-rc4.jar.sha1): Finished downloading\n", | |
"=> 1 (): Downloading https://repo1.maven.org/maven2/io/circe/circe-numbers_2.11/0.7.0/circe-numbers_2.11-0.7.0.jar\n", | |
"=> 2 (scalaz-core_2.11-7.1.1.jar.sha1): Finished downloading\n", | |
"=> 2 (): Downloading https://repo1.maven.org/maven2/io/circe/circe-numbers_2.11/0.7.0/circe-numbers_2.11-0.7.0.jar.sha1\n", | |
"=> 1 (circe-numbers_2.11-0.7.0.jar): Finished downloading\n", | |
"=> 1 (): Downloading https://repo1.maven.org/maven2/org/typelevel/cats-core_2.11/0.9.0/cats-core_2.11-0.9.0.jar\n", | |
"=> 2 (circe-numbers_2.11-0.7.0.jar.sha1): Finished downloading\n", | |
"=> 1 (): Downloading https://repo1.maven.org/maven2/org/webjars/bower/vega-lite/1.2.0/vega-lite-1.2.0.jar\n", | |
"=> 1 (cats-kernel_2.11-0.9.0.jar): Finished downloading\n", | |
"=> 2 (): Downloading https://repo1.maven.org/maven2/org/typelevel/cats-core_2.11/0.9.0/cats-core_2.11-0.9.0.jar.sha1\n", | |
"=> 2 (cats-core_2.11-0.9.0.jar.sha1): Finished downloading\n", | |
"=> 1 (): Downloading https://repo1.maven.org/maven2/org/scalafx/scalafx_2.11/8.0.92-R10/scalafx_2.11-8.0.92-R10.jar\n", | |
"=> 1 (vega-lite-1.2.0.jar): Finished downloading\n", | |
"=> 1 (): Downloading https://repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.11/1.0.2/scala-parser-combinators_2.11-1.0.2.jar\n", | |
"=> 1 (vega-3.0.0-rc4.jar): Finished downloading\n", | |
"=> 2 (): Downloading https://repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.11/1.0.2/scala-parser-combinators_2.11-1.0.2.jar.sha1\n", | |
"=> 1 (scala-parser-combinators_2.11-1.0.2.jar): Finished downloading\n", | |
"=> 1 (scalafx_2.11-8.0.92-R10.jar): Finished downloading\n", | |
"=> 2 (): Downloading https://repo1.maven.org/maven2/org/webjars/bower/vega-lite/1.2.0/vega-lite-1.2.0.jar.sha1\n", | |
"=> 1 (): Downloading https://repo1.maven.org/maven2/io/circe/circe-core_2.11/0.7.0/circe-core_2.11-0.7.0.jar\n", | |
"=> 2 (scala-parser-combinators_2.11-1.0.2.jar.sha1): Finished downloading\n", | |
"=> 2 (): Downloading https://repo1.maven.org/maven2/org/scalafx/scalafx_2.11/8.0.92-R10/scalafx_2.11-8.0.92-R10.jar.sha1\n", | |
"=> 2 (vega-lite-1.2.0.jar.sha1): Finished downloading\n", | |
"=> 2 (): Downloading https://repo1.maven.org/maven2/io/circe/circe-core_2.11/0.7.0/circe-core_2.11-0.7.0.jar.sha1\n", | |
"=> 2 (scalafx_2.11-8.0.92-R10.jar.sha1): Finished downloading\n", | |
"=> 1 (): Downloading https://repo1.maven.org/maven2/io/circe/circe-jawn_2.11/0.7.0/circe-jawn_2.11-0.7.0.jar\n", | |
"=> 1 (cats-core_2.11-0.9.0.jar): Finished downloading\n", | |
"=> 2 (): Downloading https://repo1.maven.org/maven2/io/circe/circe-jawn_2.11/0.7.0/circe-jawn_2.11-0.7.0.jar.sha1\n", | |
"=> 2 (circe-core_2.11-0.7.0.jar.sha1): Finished downloading\n", | |
"=> 1 (): Downloading https://repo1.maven.org/maven2/io/circe/circe-generic_2.11/0.7.0/circe-generic_2.11-0.7.0.jar\n", | |
"=> 1 (circe-jawn_2.11-0.7.0.jar): Finished downloading\n", | |
"=> 2 (): Downloading https://repo1.maven.org/maven2/io/circe/circe-generic_2.11/0.7.0/circe-generic_2.11-0.7.0.jar.sha1\n", | |
"=> 2 (shapeless_2.11-2.3.2.jar): Finished downloading\n", | |
"=> 1 (): Downloading https://repo1.maven.org/maven2/org/spire-math/jawn-parser_2.11/0.10.4/jawn-parser_2.11-0.10.4.jar.sha1\n", | |
"=> 2 (circe-jawn_2.11-0.7.0.jar.sha1): Finished downloading\n", | |
"=> 1 (): Downloading https://repo1.maven.org/maven2/com/github/mpilquist/simulacrum_2.11/0.10.0/simulacrum_2.11-0.10.0.jar.sha1\n", | |
"=> 1 (circe-generic_2.11-0.7.0.jar): Finished downloading\n", | |
"=> 2 (): Downloading https://repo1.maven.org/maven2/com/github/mpilquist/simulacrum_2.11/0.10.0/simulacrum_2.11-0.10.0.jar\n", | |
"=> 2 (circe-generic_2.11-0.7.0.jar.sha1): Finished downloading\n", | |
"=> 2 (): Downloading https://repo1.maven.org/maven2/org/spire-math/jawn-parser_2.11/0.10.4/jawn-parser_2.11-0.10.4.jar\n", | |
"=> 1 (jawn-parser_2.11-0.10.4.jar.sha1): Finished downloading\n", | |
"=> 1 (): Downloading https://repo1.maven.org/maven2/org/typelevel/machinist_2.11/0.6.1/machinist_2.11-0.6.1.jar\n", | |
"=> 1 (circe-core_2.11-0.7.0.jar): Finished downloading\n", | |
"=> 2 (): Downloading https://repo1.maven.org/maven2/org/typelevel/machinist_2.11/0.6.1/machinist_2.11-0.6.1.jar.sha1\n", | |
"=> 1 (simulacrum_2.11-0.10.0.jar.sha1): Finished downloading\n", | |
"=> 1 (): Downloading https://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.11/1.0.2/scala-xml_2.11-1.0.2.jar\n", | |
"=> 2 (simulacrum_2.11-0.10.0.jar): Finished downloading\n", | |
"=> 2 (jawn-parser_2.11-0.10.4.jar): Finished downloading\n", | |
"=> 2 (): Downloading https://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.11/1.0.2/scala-xml_2.11-1.0.2.jar.sha1\n", | |
"=> 2 (): Downloading https://repo1.maven.org/maven2/org/typelevel/cats-macros_2.11/0.9.0/cats-macros_2.11-0.9.0.jar.sha1\n", | |
"=> 1 (machinist_2.11-0.6.1.jar): Finished downloading\n", | |
"=> 2 (): Downloading https://repo1.maven.org/maven2/io/circe/circe-parser_2.11/0.7.0/circe-parser_2.11-0.7.0.jar.sha1\n", | |
"=> 2 (machinist_2.11-0.6.1.jar.sha1): Finished downloading\n", | |
"=> 2 (scala-xml_2.11-1.0.2.jar.sha1): Finished downloading\n", | |
"=> 2 (cats-macros_2.11-0.9.0.jar.sha1): Finished downloading\n", | |
"=> 2 (circe-parser_2.11-0.7.0.jar.sha1): Finished downloading\n", | |
"=> 1 (scalaz-core_2.11-7.1.1.jar): Finished downloading\n", | |
"=> 1 (scala-xml_2.11-1.0.2.jar): Finished downloading\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/com/github/julien-truffaut/monocle-core_2.11/1.1.0/monocle-core_2.11-1.1.0.jar\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/com/github/julien-truffaut/monocle-macro_2.11/1.1.0/monocle-macro_2.11-1.1.0.jar\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/vegas-viz/vegas_2.11/0.3.11/vegas_2.11-0.3.11.jar\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/vegas-viz/vegas-macros_2.11/0.3.11/vegas-macros_2.11-0.3.11.jar\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/typelevel/macro-compat_2.11/1.1.1/macro-compat_2.11-1.1.1.jar\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/io/circe/circe-numbers_2.11/0.7.0/circe-numbers_2.11-0.7.0.jar\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/typelevel/cats-kernel_2.11/0.9.0/cats-kernel_2.11-0.9.0.jar\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.11/1.0.2/scala-parser-combinators_2.11-1.0.2.jar\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/webjars/bower/vega/3.0.0-rc4/vega-3.0.0-rc4.jar\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/webjars/bower/vega-lite/1.2.0/vega-lite-1.2.0.jar\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/scalafx/scalafx_2.11/8.0.92-R10/scalafx_2.11-8.0.92-R10.jar\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/io/circe/circe-jawn_2.11/0.7.0/circe-jawn_2.11-0.7.0.jar\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/io/circe/circe-generic_2.11/0.7.0/circe-generic_2.11-0.7.0.jar\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/typelevel/cats-core_2.11/0.9.0/cats-core_2.11-0.9.0.jar\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/com/github/mpilquist/simulacrum_2.11/0.10.0/simulacrum_2.11-0.10.0.jar\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/spire-math/jawn-parser_2.11/0.10.4/jawn-parser_2.11-0.10.4.jar\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/io/circe/circe-core_2.11/0.7.0/circe-core_2.11-0.7.0.jar\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/typelevel/machinist_2.11/0.6.1/machinist_2.11-0.6.1.jar\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/com/chuusai/shapeless_2.11/2.3.2/shapeless_2.11-2.3.2.jar\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/typelevel/cats-macros_2.11/0.9.0/cats-macros_2.11-0.9.0.jar\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/io/circe/circe-parser_2.11/0.7.0/circe-parser_2.11-0.7.0.jar\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.11/1.0.2/scala-xml_2.11-1.0.2.jar\n", | |
"-> New file at /tmp/toree_add_deps8343821997174635635/https/repo1.maven.org/maven2/org/scalaz/scalaz-core_2.11/7.1.1/scalaz-core_2.11-7.1.1.jar\n" | |
] | |
} | |
], | |
"source": [ | |
"%AddDeps io.continuum.bokeh bokeh_2.11 0.7\n", | |
"%AddDeps com.github.julien-truffaut monocle-core_2.11 1.1.0\n", | |
"%AddDeps com.github.julien-truffaut monocle-macro_2.11 1.1.0\n", | |
"%AddDeps org.vegas-viz vegas_2.11 0.3.11 --verbose --abort-on-resolution-errors --transitive\n", | |
"%AddDeps org.vegas-viz vegas-macros_2.11 0.3.11\n", | |
"%AddJar -magic https://brunelvis.org/jar/spark-kernel-brunel-all-2.2.jar" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Basic Spark tests" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 10, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"val s = spark.implicits\n", | |
"import s._\n", | |
"val testDF = Seq(\n", | |
" (1,2),\n", | |
" (3,4),\n", | |
" (5,6)\n", | |
").toDF(\"a\", \"b\")" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 11, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"+---+---+\n", | |
"| a| b|\n", | |
"+---+---+\n", | |
"| 1| 2|\n", | |
"| 3| 4|\n", | |
"| 5| 6|\n", | |
"+---+---+\n", | |
"\n" | |
] | |
} | |
], | |
"source": [ | |
"testDF.show" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 15, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<table><tr><th>a</th><th>b</th></tr><tr><td>1</td><td>2</td></tr><tr><td>3</td><td>4</td></tr><tr><td>5</td><td>6</td></tr></table>" | |
] | |
}, | |
"execution_count": 15, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"%%dataframe\n", | |
"testDF" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 6, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"Array(1, 2, 3)" | |
] | |
}, | |
"execution_count": 6, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"val testRDD = sc.parallelize(Seq(1,2,3,4,5))\n", | |
"testRDD.take(3)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Bokeh tests" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"import math.{Pi=>pi,sin}\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Vegas" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 50, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"Name: Unknown Error\n", | |
"Message: <console>:82: error: could not find implicit value for parameter showRender: vegas.render.ShowRender\n", | |
" plot.show\n", | |
" ^\n", | |
"StackTrace: " | |
] | |
}, | |
"execution_count": 50, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"import vegas._\n", | |
"import vegas.render.WindowRenderer._\n", | |
"val plot = Vegas(\"Country Pop\").\n", | |
" withData(\n", | |
" Seq(\n", | |
" Map(\"country\" -> \"USA\", \"population\" -> 314),\n", | |
" Map(\"country\" -> \"UK\", \"population\" -> 64),\n", | |
" Map(\"country\" -> \"DK\", \"population\" -> 80)\n", | |
" )\n", | |
" ).\n", | |
" encodeX(\"country\", Nom).\n", | |
" encodeY(\"population\", Quant).\n", | |
" mark(Bar)\n", | |
"\n", | |
"plot.show" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"collapsed": true | |
}, | |
"source": [ | |
"## Brunel\n", | |
"See https://brunel.mybluemix.net/docs/" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 34, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"val seq = (0 until 33 by 3).map(i => (i, i, i*2)).toSeq\n", | |
"val df = seq.toDF(\"a\", \"b\", \"c\")" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 41, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"\n", | |
" <link rel=\"stylesheet\" type=\"text/css\" href=\"https://brunelvis.org/js/brunel.2.2.css\" charset=\"utf-8\">\n", | |
" <link rel=\"stylesheet\" type=\"text/css\" href=\"https://brunelvis.org/js/sumoselect.css\" charset=\"utf-8\">\n", | |
" <style> #visid9269771a-2433-4bf0-957b-d01448b3ec56.brunel .chart1 .element1 .element {\n", | |
"\tfill: red;\n", | |
"} </style>\n", | |
" <div id=\"controlsIdd37f3acc-6610-4de0-a0f7-617d2b9cd373\" class=\"brunel\"/>\n", | |
"<svg id=\"visid9269771a-2433-4bf0-957b-d01448b3ec56\" width=\"300\" height=\"300\"></svg>\n", | |
"\n", | |
"<script>\n", | |
"require.config({\n", | |
" waitSeconds: 60,\n", | |
" paths: {\n", | |
" 'd3': '//cdnjs.cloudflare.com/ajax/libs/d3/4.2.1/d3.min',\n", | |
" 'topojson' : '//cdnjs.cloudflare.com/ajax/libs/topojson/1.6.20/topojson.min',\n", | |
" 'brunel' : 'https://brunelvis.org/js/brunel.2.2.min',\n", | |
" 'brunelControls' : 'https://brunelvis.org/js/brunel.controls.2.2.min'\n", | |
" },\n", | |
"\n", | |
" shim: {\n", | |
" 'brunel' : {\n", | |
" exports: 'BrunelD3',\n", | |
" deps: ['d3', 'topojson'],\n", | |
" init: function() {\n", | |
" return {\n", | |
" BrunelD3 : BrunelD3,\n", | |
" BrunelData : BrunelData\n", | |
" }\n", | |
" }\n", | |
" },\n", | |
" 'brunelControls' : {\n", | |
" exports: 'BrunelEventHandlers',\n", | |
" init: function() {\n", | |
" return {\n", | |
" BrunelEventHandlers: BrunelEventHandlers,\n", | |
" BrunelJQueryControlFactory: BrunelJQueryControlFactory\n", | |
" }\n", | |
" }\n", | |
" }\n", | |
"\n", | |
" }\n", | |
"\n", | |
" });\n", | |
"\n", | |
" require([\"d3\"], function(d3) {\n", | |
" require([\"brunel\", \"brunelControls\"], function(brunel, brunelControls) {\n", | |
"\n", | |
" function BrunelVis(visId) {\n", | |
" \"use strict\"; // Strict Mode\n", | |
" var datasets = [], // Array of datasets for the original data\n", | |
" pre = function(d, i) { return d }, // Default pre-process does nothing\n", | |
" post = function(d, i) { return d }, // Default post-process does nothing\n", | |
" transitionTime = 200, // Transition time for animations\n", | |
" charts = [], // The charts in the system\n", | |
" hasData = function(d) {return d && (d.row != null || hasData(d.data))}, // Filters to data items\n", | |
" vis = d3.select('#' + visId).attr('class', 'brunel'); // the SVG container\n", | |
"\n", | |
" // Define chart #1 in the visualization //////////////////////////////////////////////////////////\n", | |
"\n", | |
" charts[0] = function(parentNode, filterRows) {\n", | |
" var geom = BrunelD3.geometry(parentNode || vis.node(), 0, 0, 1, 1, 5, 46, 39, 15),\n", | |
" elements = []; // Array of elements in this chart\n", | |
"\n", | |
" // Define groups for the chart parts ///////////////////////////////////////////////////////////\n", | |
"\n", | |
" var chart = vis.append('g').attr('class', 'chart1')\n", | |
" .attr('transform','translate(' + geom.chart_left + ',' + geom.chart_top + ')');\n", | |
" var overlay = chart.append('g').attr('class', 'element').attr('class', 'overlay');\n", | |
" var zoom = d3.zoom().scaleExtent([1/3,3]);\n", | |
" var zoomNode = overlay.append('rect').attr('class', 'overlay')\n", | |
" .attr('x', geom.inner_left).attr('y', geom.inner_top)\n", | |
" .attr('width', geom.inner_rawWidth).attr('height', geom.inner_rawHeight)\n", | |
" .style('cursor', 'move').call(zoom)\n", | |
" .node();\n", | |
" zoomNode.__zoom = d3.zoomIdentity;\n", | |
" chart.append('rect').attr('class', 'background').attr('width', geom.chart_right-geom.chart_left).attr('height', geom.chart_bottom-geom.chart_top);\n", | |
" var interior = chart.append('g').attr('class', 'interior zoomNone')\n", | |
" .attr('transform','translate(' + geom.inner_left + ',' + geom.inner_top + ')')\n", | |
" .attr('clip-path', 'url(#clip_visid9269771a-2433-4bf0-957b-d01448b3ec56_chart1_inner)');\n", | |
" interior.append('rect').attr('class', 'inner').attr('width', geom.inner_width).attr('height', geom.inner_height);\n", | |
" var gridGroup = interior.append('g').attr('class', 'grid');\n", | |
" var axes = chart.append('g').attr('class', 'axis')\n", | |
" .attr('transform','translate(' + geom.inner_left + ',' + geom.inner_top + ')');\n", | |
" vis.append('clipPath').attr('id', 'clip_visid9269771a-2433-4bf0-957b-d01448b3ec56_chart1_inner').append('rect')\n", | |
" .attr('x', 0).attr('y', 0)\n", | |
" .attr('width', geom.inner_rawWidth+1).attr('height', geom.inner_rawHeight+1);\n", | |
"\n", | |
" // Scales //////////////////////////////////////////////////////////////////////////////////////\n", | |
"\n", | |
" var scale_x = d3.scaleLinear().domain([-5, 35.000004])\n", | |
" .range([0, geom.inner_width]);\n", | |
" var scale_inner = d3.scaleLinear().domain([0,1])\n", | |
" .range([-0.5, 0.5]);\n", | |
" var scale_y = d3.scaleLinear().domain([0, 35.000003])\n", | |
" .range([geom.inner_height, 0]);\n", | |
" var base_scales = [scale_x, scale_y]; // Untransformed original scales\n", | |
"\n", | |
" // Axes ////////////////////////////////////////////////////////////////////////////////////////\n", | |
"\n", | |
" axes.append('g').attr('class', 'x axis')\n", | |
" .attr('transform','translate(0,' + geom.inner_rawHeight + ')')\n", | |
" .attr('clip-path', 'url(#clip_visid9269771a-2433-4bf0-957b-d01448b3ec56_chart1_haxis)');\n", | |
" vis.append('clipPath').attr('id', 'clip_visid9269771a-2433-4bf0-957b-d01448b3ec56_chart1_haxis').append('polyline')\n", | |
" .attr('points', '-1,-1000, -1,-1 -5,5, -1000,5, -100,1000, 10000,1000 10000,-1000');\n", | |
" axes.select('g.axis.x').append('text').attr('class', 'title').text('a').style('text-anchor', 'middle')\n", | |
" .attr('x',geom.inner_rawWidth/2)\n", | |
" .attr('y', geom.inner_bottom - 2.0).attr('dy','-0.27em');\n", | |
" axes.append('g').attr('class', 'y axis')\n", | |
" .attr('clip-path', 'url(#clip_visid9269771a-2433-4bf0-957b-d01448b3ec56_chart1_vaxis)');\n", | |
" vis.append('clipPath').attr('id', 'clip_visid9269771a-2433-4bf0-957b-d01448b3ec56_chart1_vaxis').append('polyline')\n", | |
" .attr('points', '-1000,-10000, 10000,-10000, 10000,' + (geom.inner_rawHeight+1) + ', -1,' + (geom.inner_rawHeight+1) + ', -1,' + (geom.inner_rawHeight+5) + ', -1000,' + (geom.inner_rawHeight+5) );\n", | |
" axes.select('g.axis.y').append('text').attr('class', 'title').text('b').style('text-anchor', 'middle')\n", | |
" .attr('x',-geom.inner_rawHeight/2)\n", | |
" .attr('y', 4-geom.inner_left).attr('dy', '0.7em').attr('transform', 'rotate(270)');\n", | |
"\n", | |
" var axis_bottom = d3.axisBottom(scale_x).tickSizeInner(3).tickPadding(3).tickSizeOuter(0)\n", | |
" .ticks(6);\n", | |
" var axis_left = d3.axisLeft(scale_y).tickSizeInner(3).tickPadding(3).tickSizeOuter(0);\n", | |
"\n", | |
" function buildAxes(time) {\n", | |
" var axis_x = axes.select('g.axis.x');\n", | |
" BrunelD3.transition(axis_x, time).call(axis_bottom.scale(scale_x));\n", | |
" var axis_y = axes.select('g.axis.y');\n", | |
" BrunelD3.transition(axis_y, time).call(axis_left.scale(scale_y));\n", | |
" }\n", | |
" zoom.on('zoom', function(t, time) {\n", | |
" t = t ||BrunelD3.restrictZoom(d3.event.transform, geom, this);\n", | |
" scale_x = t.rescaleX(base_scales[0]);\n", | |
" scale_y = t.rescaleY(base_scales[1]);\n", | |
" zoomNode.__zoom = t;\n", | |
" interior.attr('class', 'interior ' + BrunelD3.zoomLabel(t.k));;\n", | |
" build(time || -1);\n", | |
" });\n", | |
"\n", | |
" // Define element #1 ///////////////////////////////////////////////////////////////////////////\n", | |
"\n", | |
" elements[0] = function() {\n", | |
" var original, processed, // data sets passed in and then transformed\n", | |
" element, data, // Brunel element information and brunel data\n", | |
" selection, merged; // D3 selection and merged selection\n", | |
" var elementGroup = interior.append('g').attr('class', 'element1'),\n", | |
" main = elementGroup.append('g').attr('class', 'main'),\n", | |
" labels = BrunelD3.undoTransform(elementGroup.append('g').attr('class', 'labels').attr('aria-hidden', 'true'), elementGroup);\n", | |
"\n", | |
" function makeData() {\n", | |
" original = datasets[0];\n", | |
" if (filterRows) original = original.retainRows(filterRows);\n", | |
" processed = pre(original, 0);\n", | |
" processed = post(processed, 0);\n", | |
" var f0 = processed.field('a'),\n", | |
" f1 = processed.field('b'),\n", | |
" f2 = processed.field('#row'),\n", | |
" f3 = processed.field('#selection');\n", | |
" var keyFunc = function(d) { return f2.value(d) };\n", | |
" data = {\n", | |
" a: function(d) { return f0.value(d.row) },\n", | |
" b: function(d) { return f1.value(d.row) },\n", | |
" $row: function(d) { return f2.value(d.row) },\n", | |
" $selection: function(d) { return f3.value(d.row) },\n", | |
" a_f: function(d) { return f0.valueFormatted(d.row) },\n", | |
" b_f: function(d) { return f1.valueFormatted(d.row) },\n", | |
" $row_f: function(d) { return f2.valueFormatted(d.row) },\n", | |
" $selection_f: function(d) { return f3.valueFormatted(d.row) },\n", | |
" _split: function(d) { return 'ALL' },\n", | |
" _key: keyFunc,\n", | |
" _rows: BrunelD3.makeRowsWithKeys(keyFunc, processed.rowCount())\n", | |
" };\n", | |
" }\n", | |
"\n", | |
" // Build element from data ///////////////////////////////////////////////////////////////////\n", | |
"\n", | |
" function build(transitionMillis) {\n", | |
" element = elements[0];\n", | |
" var w = Math.abs( scale_x(scale_x.domain()[0] + 3.0) - scale_x.range()[0] );\n", | |
" var x = function(d) { return scale_x(data.a(d))};\n", | |
" var h = Math.abs( scale_y(scale_y.domain()[0] + 3.0) - scale_y.range()[0] );\n", | |
" var y1 = scale_y.range()[0];\n", | |
" var y2 = function(d) { return scale_y(data.b(d))};\n", | |
" selection = main.selectAll('.element').data(data._rows, function(d) { return d.key });\n", | |
" var added = selection.enter().append('rect')\n", | |
" .attr('class', 'element bar filled')\n", | |
" .style('pointer-events', 'none');\n", | |
"\n", | |
" merged = selection.merge(added);\n", | |
" merged.filter(hasData).classed('selected', function(d) { return data.$selection(d) == '✓' })\n", | |
" .filter(function(d) { return data.$selection(d) == '✓' }).raise();\n", | |
" BrunelD3.transition(merged, transitionMillis)\n", | |
" .each(function(d) {\n", | |
" var width = w, left = x(d) - width/2, \n", | |
" c = y1, d = y2(d), top = Math.min(c,d), height = Math.max(1e-6, Math.abs(c-d));\n", | |
" this.r = {x:left, y:top, w:width, h:height};\n", | |
" })\n", | |
" .attr('x', function(d) { return this.r.x })\n", | |
" .attr('y', function(d) { return this.r.y })\n", | |
" .attr('width', function(d) { return this.r.w })\n", | |
" .attr('height', function(d) { return this.r.h });\n", | |
"\n", | |
" BrunelD3.transition(selection.exit(), transitionMillis/3)\n", | |
" .style('opacity', 0.5).each( function() {\n", | |
" this.remove(); if (this.__label__) this.__label__.remove()\n", | |
" });\n", | |
" }\n", | |
"\n", | |
" return {\n", | |
" data: function() { return processed },\n", | |
" original: function() { return original },\n", | |
" internal: function() { return data },\n", | |
" selection: function() { return merged },\n", | |
" makeData: makeData,\n", | |
" build: build,\n", | |
" chart: function() { return charts[0] },\n", | |
" group: function() { return elementGroup },\n", | |
" fields: {\n", | |
" x: ['a'],\n", | |
" y: ['b'],\n", | |
" key: ['#row']\n", | |
" }\n", | |
" };\n", | |
" }();\n", | |
"\n", | |
" function build(time, noData) {\n", | |
" var first = elements[0].data() == null;\n", | |
" if (first) time = 0; // No transition for first call\n", | |
" buildAxes(time);\n", | |
" if ((first || time > -1) && !noData)elements[0].makeData();\n", | |
" elements[0].build(time);\n", | |
" }\n", | |
"\n", | |
" // Expose the following components of the chart\n", | |
" return {\n", | |
" elements : elements,\n", | |
" interior : interior,\n", | |
" scales: {x:scale_x, y:scale_y},\n", | |
" zoom: function(params, time) {\n", | |
" if (params) zoom.on('zoom').call(zoomNode, params, time);\n", | |
" return d3.zoomTransform(zoomNode);\n", | |
" },\n", | |
" build : build\n", | |
" };\n", | |
" }();\n", | |
"\n", | |
" function setData(rowData, i) { datasets[i||0] = BrunelD3.makeData(rowData) }\n", | |
" function updateAll(time) { charts.forEach(function(x) {x.build(time || 0)}) }\n", | |
" function buildAll() {\n", | |
" for (var i=0;i<arguments.length;i++) setData(arguments[i], i);\n", | |
" updateAll(transitionTime);\n", | |
" }\n", | |
"\n", | |
" return {\n", | |
" dataPreProcess: function(f) { if (f) pre = f; return pre },\n", | |
" dataPostProcess: function(f) { if (f) post = f; return post },\n", | |
" data: function(d,i) { if (d) setData(d,i); return datasets[i||0] },\n", | |
" visId: visId,\n", | |
" build: buildAll,\n", | |
" rebuild: updateAll,\n", | |
" charts: charts\n", | |
" }\n", | |
"}\n", | |
"\n", | |
"// Data Tables /////////////////////////////////////////////////////////////////////////////////////\n", | |
"\n", | |
"var table1 = {\n", | |
" names: ['a', 'b'], \n", | |
" options: ['numeric', 'numeric'], \n", | |
" rows: [[0, 0], [3, 3], [6, 6], [9, 9], [12, 12], [15, 15], [18, 18], [21, 21], [24, 24], [27, 27],\n", | |
" [30, 30]]\n", | |
"};\n", | |
"\n", | |
"// Call Code to Build the system ///////////////////////////////////////////////////////////////////\n", | |
"\n", | |
"var v = new BrunelVis('visid9269771a-2433-4bf0-957b-d01448b3ec56');\n", | |
"var eventHandler = BrunelEventHandlers( v);\n", | |
"eventHandler.make_filter_handler( {\"b\":{\"filter_type\":\"range\",\"datasetIndex\":0,\"filter\":{\"min\":2.0,\"max\":30.0}}});\n", | |
"v.build(table1);\n", | |
"\n", | |
"// Create and wire controls ////////////////////////////////////////////////////////////////////////\n", | |
"\n", | |
"$(function() {\n", | |
" $( '#controlsIdd37f3acc-6610-4de0-a0f7-617d2b9cd373').append( BrunelJQueryControlFactory .make_range_slider( 'visid9269771a-2433-4bf0-957b-d01448b3ec56', 0, 'b', 'b', 2, null, v .data(null, 0).field( 'b'), false, null, null));\n", | |
"\n", | |
"});\n", | |
"\n", | |
" \"\"\n", | |
" });\n", | |
" });\n", | |
" </script>" | |
] | |
}, | |
"execution_count": 41, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"%%brunel data('df') x(a) y(b) bar style(\"fill:red\") filter(b:2) :: width=300, height=300" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Apache Toree - Scala", | |
"language": "scala", | |
"name": "apache_toree_scala" | |
}, | |
"language_info": { | |
"file_extension": ".scala", | |
"name": "scala", | |
"version": "2.11.8" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment