You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@zeppelin.apache.org by ๏̯͡๏ <ÐΞ€ρ@Ҝ>, de...@gmail.com on 2015/08/05 00:58:07 UTC

Additional graphs?

I see that Zeppelin has 4 to 5 plot support out of the box (Zeppelin
tutorial).

1) What are other graphs (ex: Box plot) support ?
2) Where can i get more information and examples on how to use them ?



-- 
Deepak

Re: Additional graphs?

Posted by Randy Gelhausen <rg...@hortonworks.com>.
The below snippet reads from a table with earthquake events. It then uses println() statements to emit HTML for loading DataMap<http://datamaps.github.io/> visualizations from the query results. See the attached image for the Zeppelin output.

val gson = new com.google.gson.Gson()
val bubbles = sqlContext.sql(s"""select *, case when mag < 6 then 1.7 else ((mag - 6) * 3)+1.7 end as mag_adjusted,  case when depth <= 100 then cast(depth/10 as int) when depth <= 1000 then cast(depth/100 as int) *10  else 100 end  as depth_cat from eq where date >= "2005" and mag >3 """).map{r=>
Map(
"name" -> r(0).toString,
"radius" -> r(7).toString.toDouble,
"mag" -> r(5).toString.toDouble,
"date" -> r(1).toString,
"latitude" -> r(2).toString.toDouble,
"longitude" -> r(3).toString.toDouble,
"fillKey" -> r(8).toString,
"depth" -> r(4).toString
)
}.collect.map(s=>scala.collection.JavaConversions.mapAsJavaMap(s))
val bubblesJson = gson.toJson(bubbles)


println(s"""%html
<!-- script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.3/d3.min.js"></script -->
<script src="http://datamaps.github.io/scripts/topojson.js"></script<http://datamaps.github.io/scripts/topojson.js%22%3E%3C/script>>
<script src="http://datamaps.github.io/scripts/0.4.0/datamaps.all.js"></script<http://datamaps.github.io/scripts/0.4.0/datamaps.all.js%22%3E%3C/script>>
<div id="worldMap" style="position: relative; width: 1200px; height: 1000px;"></div>
<script>
setTimeout(function(){
var map = new Datamap({
element: document.getElementById('worldMap'),
geographyConfig: {
popupOnHover: false,
highlightOnHover: false
},
fills: {
defaultFill: '#ABDDA4',
'0': '#393b79',
'1': '#5254a3',
'2': '#6b6ecf',
'3': '#9c9ede',
'4': '#637939',
'5': '#8ca252',
'6': '#b5cf6b',
'7': '#cedb9c',
'8': '#8c6d31',
'9': '#bd9e39',
'10': '#e7ba52',
'20': '#e7cb94',
'30': '#843c39',
'40': '#ad494a',
'50': '#d6616b',
'60': '#e7969c',
'70': '#7b4173',
'80': '#a55194',
'90': '#ce6dbd',
'100': '#de9ed6'
},
bubblesConfig: {
borderWidth: 0,
fillOpacity: 0.75
}
});

map.bubbles(${bubblesJson}, {
popupTemplate: function(geo, data) {
return '<div class="hoverinfo">Magnitude: ' + data.mag + '<br/>  Exploded on: ' + data.date + ' <br/> Depth: ' + data.depth + '<br/> Depth Category: ' + data.fillKey +  '</div>'
}
});

}, 2000)
</script>
""")

From: "ÐΞ€ρ@Ҝ (๏̯͡๏)"
Reply-To: "users@zeppelin.incubator.apache.org<ma...@zeppelin.incubator.apache.org>"
Date: Tuesday, August 4, 2015 at 7:34 PM
To: "users@zeppelin.incubator.apache.org<ma...@zeppelin.incubator.apache.org>"
Subject: Re: Additional graphs?

I see %d3, do you have examples on how to emit & integrate d3 ?

I am new to UI world so examples help

On Tue, Aug 4, 2015 at 4:24 PM, Randy Gelhausen <rg...@hortonworks.com>> wrote:
Today Zeppelin includes the graphs you described out of the box.

More visualization support out of the box is in progress<https://github.com/apache/incubator-zeppelin/pull/152>. Today you can have your scripts emit HTML and JavaScript<https://zeppelin.incubator.apache.org/docs/display.html> for importing additional viz as desired.

From: "ÐΞ€ρ@Ҝ (๏̯͡๏)"
Reply-To: "users@zeppelin.incubator.apache.org<ma...@zeppelin.incubator.apache.org>"
Date: Tuesday, August 4, 2015 at 6:58 PM
To: "users@zeppelin.incubator.apache.org<ma...@zeppelin.incubator.apache.org>"
Subject: Additional graphs?

I see that Zeppelin has 4 to 5 plot support out of the box (Zeppelin tutorial).

1) What are other graphs (ex: Box plot) support ?
2) Where can i get more information and examples on how to use them ?



--
Deepak




--
Deepak


Re: Additional graphs?

Posted by ๏̯͡๏ <ÐΞ€ρ@Ҝ>, de...@gmail.com.
I see %d3, do you have examples on how to emit & integrate d3 ?

I am new to UI world so examples help

On Tue, Aug 4, 2015 at 4:24 PM, Randy Gelhausen <rg...@hortonworks.com>
wrote:

> Today Zeppelin includes the graphs you described out of the box.
>
> More visualization support out of the box is in progress
> <https://github.com/apache/incubator-zeppelin/pull/152>. Today you can
> have your scripts emit HTML and JavaScript
> <https://zeppelin.incubator.apache.org/docs/display.html> for importing
> additional viz as desired.
>
> From: "ÐΞ€ρ@Ҝ (๏̯͡๏)"
> Reply-To: "users@zeppelin.incubator.apache.org"
> Date: Tuesday, August 4, 2015 at 6:58 PM
> To: "users@zeppelin.incubator.apache.org"
> Subject: Additional graphs?
>
> I see that Zeppelin has 4 to 5 plot support out of the box (Zeppelin
> tutorial).
>
> 1) What are other graphs (ex: Box plot) support ?
> 2) Where can i get more information and examples on how to use them ?
>
>
>
> --
> Deepak
>
>


-- 
Deepak

Re: Additional graphs?

Posted by Randy Gelhausen <rg...@hortonworks.com>.
Today Zeppelin includes the graphs you described out of the box.

More visualization support out of the box is in progress<https://github.com/apache/incubator-zeppelin/pull/152>. Today you can have your scripts emit HTML and JavaScript<https://zeppelin.incubator.apache.org/docs/display.html> for importing additional viz as desired.

From: "ÐΞ€ρ@Ҝ (๏̯͡๏)"
Reply-To: "users@zeppelin.incubator.apache.org<ma...@zeppelin.incubator.apache.org>"
Date: Tuesday, August 4, 2015 at 6:58 PM
To: "users@zeppelin.incubator.apache.org<ma...@zeppelin.incubator.apache.org>"
Subject: Additional graphs?

I see that Zeppelin has 4 to 5 plot support out of the box (Zeppelin tutorial).

1) What are other graphs (ex: Box plot) support ?
2) Where can i get more information and examples on how to use them ?



--
Deepak