A treemap recursively subdivides area into rectangles; the area of any node in the tree corresponds to its value. This example uses color to encode different packages of the Flare visualization toolkit. Treemap design invented by Ben Shneiderman. Squarified algorithm by Bruls, Huizing and van Wijk. Data courtesy Jeff Heer.
This file contains hidden or 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
| import org.apache.lucene.analysis.standard.StandardAnalyzer; | |
| import org.apache.lucene.document.Document; | |
| import org.apache.lucene.facet.index.CategoryDocumentBuilder; | |
| import org.apache.lucene.facet.index.params.DefaultFacetIndexingParams; | |
| import org.apache.lucene.facet.index.params.FacetIndexingParams; | |
| import org.apache.lucene.facet.search.DrillDown; | |
| import org.apache.lucene.facet.search.FacetsCollector; | |
| import org.apache.lucene.facet.search.params.CountFacetRequest; | |
| import org.apache.lucene.facet.search.params.FacetRequest; | |
| import org.apache.lucene.facet.search.params.FacetSearchParams; |
This file contains hidden or 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
| import com.twitter.scalding._ | |
| import scala.util.parsing.json._ | |
| class ParseJsonJob(args: Args) extends Job(args) { | |
| TextLine(args("input")) | |
| .map(('line) -> ('parseStatus, 'uri)) { | |
| line: String => { | |
| JSON.parseFull(line) match { | |
| case Some(data: Map[String, String]) => ("success", data("uri")) | |
| case None => ("failed", "") |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <style> | |
| .node { | |
| font: 10px sans-serif; | |
| } | |
| .link { | |
| stroke: steelblue; |
This file contains hidden or 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
| package com.bizo.hive.udtf; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import org.apache.hadoop.hive.ql.exec.UDFArgumentException; | |
| import org.apache.hadoop.hive.ql.exec.Description; | |
| import org.apache.hadoop.hive.ql.metadata.HiveException; | |
| import org.apache.hadoop.hive.ql.udf.generic.GenericUDTF; | |
| import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; |
This file contains hidden or 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
| # based on http://uberblo.gs/2011/06/high-performance-url-shortening-with-redis-backed-nginx | |
| # using code from http://stackoverflow.com/questions/3554315/lua-base-converter | |
| # "database scheme" | |
| # database 0: id ~> url | |
| # database 1: id ~> hits | |
| # database 2: id ~> [{referer|user_agent}] | |
| # database 3: id ~> hits (when id is not found) | |
| # database 4: id ~> [{referer|user_agent}] (when id is not found) | |
| # database 5: key "count" storing the number of shortened urls; the id is generated by (this number + 1) converted to base 62 |
Click on any arc to zoom in. Click on the center circle to zoom out.
A sunburst is similar to a treemap, except it uses a radial layout. The root node of the tree is at the center, with leaves on the circumference. The area (or angle, depending on implementation) of each arc corresponds to its value. Sunburst design by John Stasko. Data courtesy Jeff Heer.
This file contains hidden or 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
| //================================================================== | |
| // SPARK INSTRUMENTATION | |
| //================================================================== | |
| import com.codahale.metrics.{MetricRegistry, Meter, Gauge} | |
| import org.apache.spark.{SparkEnv, Accumulator} | |
| import org.apache.spark.metrics.source.Source | |
| import org.joda.time.DateTime | |
| import scala.collection.mutable |
OlderNewer