Thanks, I will try vega-lite, but I suspect that there may be some issues, 
because I will be using the output from tensorflow data validation, which 
produces facets ready data. Not sure why ‘display(HTML(html))’ does not render 
when using the following import statement from IPython.core.display import 
display, HTML

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

Recently I added some tutorial notes for Zeppelin. Here's how to do 
visualization in Python and R which you might be interested in

https://github.com/apache/zeppelin/blob/master/notebook/Python%20Tutorial/IPython%20Visualization%20Tutorial_2F1S9ZY8Z.zpln
https://github.com/apache/zeppelin/blob/master/notebook/R%20Tutorial/R%20Basics_2BWJFTXKJ.zpln


<stephane.d...@orange.com<mailto:stephane.d...@orange.com>> 于2020年2月10日周一 
下午10:26写道:
By the way, I spent to some on evaluating some solutions to add more advanced 
charts to Zeppelin when it is needed (facet is a good example).
I tried

-          D3.js: probably  powerfull, but really complex to deal with as you 
have to deal with real low level details

-          Plotly: nice, but I prefer Vega

-          Vegas (Vega scala API): could be nice but lacks documentation, all 
Vega-lite is not implemented

-          Vegalite4s (another scala vega API) : doesn’t work for me

-          Vega-lite / Vega: just perfect for me for as soon as you understand 
how to shape your data. Vega-lite is good for a lot of visualizations, and if 
you want to go to more advanced ones Vega is there. No dependencies on 
Zeppelin, it’s just Javascript

Any feedback from somebody else here?

From: Jeff Zhang [mailto:zjf...@gmail.com<mailto:zjf...@gmail.com>]
Sent: Monday, February 10, 2020 15:15
To: users
Subject: Re: EXTERNAL: Re: Work with facets

Awesome, glad to hear that.

<stephane.d...@orange.com<mailto:stephane.d...@orange.com>> 于2020年2月10日周一 
下午10:07写道:
I don’t hit any error, this is just fantastic for me ☺


From: Jeff Zhang [mailto:zjf...@gmail.com<mailto:zjf...@gmail.com>]
Sent: Monday, February 10, 2020 15:05
To: users
Subject: Re: EXTERNAL: Re: Work with facets

I tried vega in master branch, it works although has some minor issues.

What kind of errors do you hit ?

<stephane.d...@orange.com<mailto:stephane.d...@orange.com>> 于2020年2月10日周一 
下午9:20写道:
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<mailto:raphael.math...@leidos.com>]
Sent: Monday, February 10, 2020 13:34
To: users@zeppelin.apache.org<mailto: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<mailto:zjf...@gmail.com>>
Sent: 10 February 2020 12:08
To: users <users@zeppelin.apache.org<mailto: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<mailto: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


--
Best Regards

Jeff Zhang


--
Best Regards

Jeff Zhang


--
Best Regards

Jeff Zhang

Reply via email to