PAIR-code/facets

Can not show column name in jupyter notebook.

h2222 opened this issue · 3 comments

h2222 commented

issue1

hi, I just use jupyter notebook to load my csv file, the process is the same as Dive_demo.py, but it shows that it can not show the column name for this dataset, so what should I do to fix that? thanks.

What does your data frame look like if you print it out? And your jsonstr. Will be helpful in debugging the issue. Thanks.

What version of Jupyter as well? Have you tried the same notebook in colab, and if so, did it have the same issue?

h2222 commented

thanks for your replay, i have already fix the problem, the method is sample:
simply changing the
HTML_TEMPLATE = """ <script src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/1.3.3/webcomponents-lite.js"></script> <link rel="import" href="/nbextensions/facets-dist/facets-jupyter.html"> <facets-dive sprite-image-width="{sprite_size}" sprite-image-height="{sprite_size}" id="elem" height="600"></facets-dive> <script> document.querySelector("#elem").data = {jsonstr}; </script>"""

to

HTML_TEMPLATE = """ <script src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/1.3.3/webcomponents-lite.js"></script> <link rel="import" href="https://raw.githubusercontent.com/PAIR-code/facets/1.0.0/facets-dist/facets-jupyter.html"> <facets-dive sprite-image-width="{sprite_size}" sprite-image-height="{sprite_size}" id="elem" height="600"></facets-dive> <script> document.querySelector("#elem").data = {jsonstr}; </script>"""

and then the column name can be showed in pattern.

Great, glad to hear it!