Pass and process an array from JS to Spark in Zeppelin

余生颓废 提交于 2019-12-11 10:19:45

问题


I have to visualiase some map thingy in Zeppelin via spark and JS (angular interpreter in this case). Zeppelin has this binding feature but it gives a little knowledge about usage.

I would like to click on the button, evaluate some stuff, than send the id_selected_arr to the spark via binding.

In %angular window

<input type="button" value="Click me" ng-click="eval()" ng-model="id_selected_arr"/>

In %spark2 window

var result = z.angular("id_selected_arr")

I get: result: Object = id_selected_arr

So my questios are: Did i actually send the array via binding? And how can I process this returned object in spark, such as get elements in the passed array?

Edit: I had to use oldschool style of calling a click function :

<div id="map" style="height: 300px; width: 50%" ng-model="id_selected_arr"/>
<input type="button" value="Click me" onclick="eval()"/>

来源:https://stackoverflow.com/questions/58136609/pass-and-process-an-array-from-js-to-spark-in-zeppelin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!