0.0.5 • Published 7 years ago

zeppelin-highcharts-heatmap v0.0.5

Weekly downloads
14
License
SEE LICENSE IN <L...
Repository
github
Last release
7 years ago

zeppelin-highcharts-heatmap

Heatmap Charts for Apache Zeppelin using highcharts.js

Usage

  • xAxis: categorical
  • yAxis: categorical
  • colorAxis: number

Screenshots

npm.io

Example Paragraph for Testing

import org.apache.commons.io.IOUtils
import java.net.URL
import java.nio.charset.Charset

// Zeppelin creates and injects sc (SparkContext) and sqlContext (HiveContext or SqlContext)
// So you don't need create them manually

// load bank data
val bankText = sc.parallelize(
    IOUtils.toString(
        new URL("https://s3.amazonaws.com/apache-zeppelin/tutorial/bank/bank.csv"),
        Charset.forName("utf8")).split("\n"))

case class Bank(age: Integer, job: String, marital: String, education: String, balance: Integer)

val bank = bankText.map(s => s.split(";")).filter(s => s(0) != "\"age\"").map(
    s => Bank(s(0).toInt, 
            s(1).replaceAll("\"", ""),
            s(2).replaceAll("\"", ""),
            s(3).replaceAll("\"", ""),
            s(5).replaceAll("\"", "").toInt
        )
).toDF()
bank.registerTempTable("bank")
%sql 
select age, job, marital, education, avg(balance) as average
from bank
group by age, job, marital, education
limit 100

License

See https://shop.highsoft.com/faq

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago