PAIR-code/facets

Embed facets-overview onto web

nehruperumalla opened this issue · 3 comments

Unable to embed facets-overview onto web. Unable to identify how to convert the data to protoInput before passing it to facet-overview tag. Help me embedding it onto web.

Thanks for reaching out. What format is your data in that you want to pass to facets-overview? You'll need to take your input data and run analysis on it to get the dataset statistics proto.

In our web demo (facets.dev), we create the proto from a dataset in javascript using our JS method (https://github.com/PAIR-code/facets/blob/gh-pages/index.html#L268).

For use in notebooks, we get the stats proto using a python function, serialize it to string and pass that to the frontend and set that stringified proto on the facets-overview (https://github.com/PAIR-code/facets/blob/master/facets_overview/Overview_demo.ipynb)

My data is in excel/CSV format. What to do after converting the data to dataset statistics proto, to embed that data onto web facets-overview.

You should be able to set the protoInput attribute on the facets-overview html element to the proto you have created, as shown in those two links above. The first link sets the protoInput attribute to the proto after it is created in javascript. The second link sets the protoInput attribute to the string of the serialized proto, after it was passed from python to the front-end. Either format for the proto that is set on the elements protoInput attribute should work.