Hello,

 

In my opinion this is possible using vega / vega-lite 
(https://vega.github.io/vega-lite/) and angularbind capabilities. I let you go  
in Vega / Vega-lite documentation, it has all the facets / repeats features you 
probably want.

 

Here is a basic  example to create a vega chart in Zeppelin:

 

%spark

[ your code to create a dataframe]

z.angularBind(“data”,df.collect)

z.angularBind(“fields”, df.fields)

 

Next paragraph in angular:

 

%angular

 

<script src="https://cdn.jsdelivr.net/npm/vega@5";></script>

<script src="https://cdn.jsdelivr.net/npm/vega-lite@4";></script>

<script src="https://cdn.jsdelivr.net/npm/vega-embed@6";></script>

 

   <div id="vis"></div>

 

    <script type="text/javascript">

    var element = $('#vis');

    var scope = 
angular.element(element.parent('.ng-scope')).scope().compiledScope;

 

      // from here we recover data in the angular scope

    var data = scope.data;

    var fields = scope.fields;

    

 // this step is mandatory to transform the data from angularbind in something 
useable by Vega:    

    var df = scope.data.map(obj => {

        var row = {};

        var i = 0;

        fields.forEach(function(field){

            row[field] = obj.values[i];

            i++

        })

        return(row);

        

    })

 

// and now the chart description part

      var yourVlSpec = {

        $schema: 'https://vega.github.io/schema/vega-lite/v4.0.json',

[your vega-lite specs here]

 

};

vegaEmbed('#vis', yourVlSpec);

    </script>

 

This is just awesome what can be done with Vega  / Vega-lite, it’s a perfect 
companion for Zeppelin when you need more advanced charts in my opinion

 

 

From: Mathieu, Raphael [mailto:raphael.math...@leidos.com] 
Sent: Monday, February 10, 2020 13:34
To: users@zeppelin.apache.org
Subject: RE: EXTERNAL: Re: Work with facets

 

I want to use it in the pyton.ipython interpreter to render interactive html 
dataset 

Any ideas ?

 

From: Jeff Zhang <zjf...@gmail.com> 
Sent: 10 February 2020 12:08
To: users <users@zeppelin.apache.org>
Subject: EXTERNAL: Re: Work with facets

 

I don't know facets, just wondering in what interpreter do you want to use it 

 

Mathieu, Raphael <raphael.math...@leidos.com> 于2020年2月10日周一 下午6:31写道:

Hi, does anyone know how to enable facets in zeppelin notebook ?

https://pair-code.github.io/facets/

 

Thanks




 

-- 

Best Regards

Jeff Zhang

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to