带有 zeppelin notebook 的动态交互式仪表板 [英] dynamic interactive dashboard with zeppelin notebook
问题描述
我想要一个更具交互性的仪表板.就像从数据库读取数据,给它选择框,选择框的onchange发送值并运行查询.
我想在选定的值上使用 zeppelin bcz 来实现这一点,我必须显示分析.
实现这一目标的方法是什么,这是否可以通过 zeppelin 实现.
我尝试使用选择框,但无法保存所选值并将其发送到下一个查询并执行该值.类似的东西
选择年龄,计数(1)值从银行where marital="${marital=single,single|离婚|已婚}"按年龄分组按年龄排序
我不知道如何存储此参数并将选定的参数从一个段落发送到另一个段落
或类似从 UI 处理所有这些事情的东西,让我们说 javascript html 并将所选值作为参数发送到 zeppelin?就像是这同时使用网址
<iframe src="http://myipaddress:8080/#/notebook/2BWCNP7V8/paragraph/20160831-115204_1774035770?asIframe¶m1=value1¶m2=value2" width="500" height="300"滚动=无"frameBorder=0"id=iframe1"样式=文本对齐:中心;">浏览器不兼容.</iframe>
并在我的 zeppelin 段落中使用这些 param1=value1¶m2=value2?技术上可行与否我不明白.请帮助我如何实现这一目标?提前致谢:)
我们可以通过以下代码获得所有的婚姻
val maritals = bank.select("marital").distinct.collect.map(_.getString(0))
并转换为想要的 seq ZeppelinContext
val seq = mairitals.zipWithIndex.map{case (x,y) =>(y.toString, x)}.toSeq
那么我们就可以这样选择了
val index = z.select("marital", "1", seq)val marital = seq(index.toString.toInt)._2
并且marital
可以用于进一步处理.喜欢.
val sql = s"""从银行选择不同的工作,其中 marital=="$marital""""sqlContext.sql(sql).show
或者当我使用 spark-highcharts 时.在这种情况下,我想绘制特定婚姻状况随年龄变化的平均平衡.
highcharts(bank.filter(col("marital") === marital).series("x" -> "age", "y" -> avg(col("balance"))).orderBy(col("age"))).plot()
<块引用>
注意:只有带有select
的段落会在值改变时自动执行.
I want to have a more interactive dashboard. like reading the data from database , giving it to select box, onchange of select box send the value and run the query.
i want to achieve this using zeppelin bcz on selected value i have to display the analytics.
what would be the way to achieve this and is this possible to achieve through zeppelin.
i tried with select box, but i couldnot save the selected value and send it to next query and execute that. something like
select age, count(1) value
from bank
where marital="${marital=single,single|divorced|married}"
group by age
order by age
i didnt get how to store this parameter and send selected parameters from one paragraph to another
or something like handling all these things from UI, lets say javascript html and sending that selected value as parameter to the zeppelin? something like this while using the url
<iframe src="http://myipaddress:8080/#/notebook/2BWCNP7V8/paragraph/20160831-115204_1774035770?asIframe¶m1=value1¶m2=value2" width="500" height="300" scrolling="no" frameBorder="0" id="iframe1" style="text-align:center;" >Browser not compatible.</iframe>
and using these param1=value1¶m2=value2 in my zeppelin paragraph? technically doable or not i dont understand. please help me how to achieve this? thanks in advance :)
We can get all the maritals with following code
val maritals = bank.select("marital").distinct.collect.map(_.getString(0))
And convert to seq ZeppelinContext wanted
val seq = mairitals.zipWithIndex.map{case (x,y) => (y.toString, x)}.toSeq
Then we can select it like this
val index = z.select("marital", "1", seq)
val marital = seq(index.toString.toInt)._2
And the marital
can use be used for further processing. like.
val sql = s"""select distinct job from bank where marital=="$marital""""
sqlContext.sql(sql).show
Or like when I use spark-highcharts. In this case I wanna plot average balance over age for certain marital status.
highcharts(bank.filter(col("marital") === marital)
.series("x" -> "age", "y" -> avg(col("balance")))
.orderBy(col("age"))).plot()
NOTE: Only the paragraph with the
select
will be executed automatically when value changed.
这篇关于带有 zeppelin notebook 的动态交互式仪表板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!