-
Notifications
You must be signed in to change notification settings - Fork 890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to load and view your data? #15
Comments
Here you go for facets dive:
|
Is there a similar example on how to download, build and view via a web browser? I was able to install bazel and rebuild for Jupyter, but not seeing a path to build and run in a browser. Any help appreciated, this looks useful to me and others I know. Thanks. |
Right now the best examples of how to embed the visualizations into a website are the demo pages (https://pair-code.github.io/facets/index.html and https://pair-code.github.io/facets/quickdraw.html). The code for those pages can be found in this project's gh-pages branch (https://github.com/PAIR-code/facets/tree/gh-pages) The basic idea is that you can build facets.html with "bazel build facets:facets" from the top-level directory. Then that facets.html can be imported into another page (such as the index.html and quickdraw.html from the gh-pages branch) and the and polymer elements can then be used in that page. In the future, we can create some documentation clarifying this. |
These are not examples but a showcase of facets visualization features. I understand examples as instructions on how to use the toolkit locally. Right now there is too much work to get it up and running tbo and it is easier (for me at least) to shove my data into prewritten R script and plot it. Unless I have a very high need to analyze the dataset samples in the very detail. |
@jameswex i was puzzled by that i had build facets.html,and index.html also imports it, but not only the examples of the index.html did not display but the function of upload csv files didn't work, i'm curious what should i do to make the index.html work smoothly on my computer locally. |
@jameswex , I have python implementation of facets, but sometime graph are not visible with the same, but if I try from https://pair-code.github.io/facets/, it works fine and load faster for any size of dataset. could you please let me know, how we can solve the problem. |
@rahulkhul Do you have an example dataset that it is failing with, along with an ipython notebook that shows the issue? Which facets visualization are you seeing this problem with? Are there are errors in the browser debugging console? |
Hello James,
I have followed documentation provided on facets github repository, and
build custom function which works on django server.
Main dataset preparation thing in python :
from facets_overview.generic_feature_statistics_generator import
GenericFeatureStatisticsGenerator
import pandas as pd
import base64
data = pd.read_csv(csv_file_path)
facets_dive_data = data.transpose().to_dict().values()
df = pd.DataFrame(facets_dive_data)
proto = GenericFeatureStatisticsGenerator().ProtoFromDataFrames([{'name':
'test', 'table': df}])
protostr = base64.b64encode(proto.SerializeToString()).decode("utf-8")
HTML_TEMPLATE = """{protostr}"""
facets_overview = HTML_TEMPLATE.format(protostr=protostr)
HTML page:
I have imported facets_jupyter.html and importing the function into
main index.html
<link rel="import" href="{% static 'facets-jupyter.html' %} " rel="stylesheet">
Used two div for separate data visualisation for dive and overview as below:
<div class="tab-pane active" id="test">
<facets-overview id="elem"></facets-overview>
</div>
<div class="tab-pane active" id="test">
<facets-dive></facets-dive>
</div>
And passing dataset values from javascript as below :
<script>
const vis = document.querySelector('facets-dive');
vis.data = [{% for item in facets_dive_data %} {%for k, v in
item.items%} { '{{k}}' : '{{v}}' }, {%endfor%} {%endfor%}]
document.querySelector("#elem").protoInput ="{{facets_overview}}";
</script>
This is working for all dataset( data from csv is converted into
required format with pandas.) but for few dataset, its not working. If
i try to upload the same csv from https://pair-code.github.io/facets/
, its working fine. I am not able to debug the problem.
Hope you got my concern. Please let me know if my implementation is wrong and provide me some guidelines.
Thanks.
Rahul khul.
…On Wed, Oct 11, 2017 at 11:37 PM, James Wexler ***@***.***> wrote:
@rahulkhul <https://github.com/rahulkhul> Do you have an example dataset
that it is failing with, along with an ipython notebook that shows the
issue? Which facets visualization are you seeing this problem with?
Are there are errors in the browser debugging console?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AECP0Sva1jTfqZYfXFBbmVJKW69qcs-aks5srQPFgaJpZM4OcbBo>
.
|
Would you be willing to share a csv on which this works and one on which it doesn't work? That would help me debug your issue. Let me know. Thanks! |
Yes sure.PFA.
Sometimes python implementation gives error for boolean values too. And the
input csv will gives correct result if I upload it on
https://pair-code.github.io/facets/. but it is not giving result (blank
graph) if ran through python implementation. My implemented code seems to
be good as it gives correct result same as
https://pair-code.github.io/facets/, but sometimes blank result for some
dataset.
Can we have same implementation as https://pair-code.github.io/facets/ in python ?
Please let me know, If I am wrong.
Thanks.
Rahul Khul.
…On Thu, Oct 12, 2017 at 8:41 PM, James Wexler ***@***.***> wrote:
Would you be willing to share a csv on which this works and one on which
it doesn't work? That would help me debug your issue. Let me know. Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AECP0eoE-batUHEWkW3if1UfFMqi8RCiks5sriwbgaJpZM4OcbBo>
.
|
I don't see the attached files in the issue. Can you email the csvs to james.[my last name]@gmail.com? Thanks. |
@romulomadu What is the question exactly? For Facets Overview comparing the two datasets in your screenshot, the code to do that is in the example ipynb notebook file in the facets_overview directory. |
@jameswex > In the future, we can create some documentation clarifying this. |
same here @mg1075 ! |
Facets is great to quickly visualize data except... only the most advance user will manage to get it installed/working. I wish it would be made available the same way tensorboard is. With tensorboard, it's as simple as typing a single command. The only easy alternative to get quickly going in Facet is to directly use the example demo at https://pair-code.github.io/facets/ |
Check out the new section on using Facets in Google Colaboratory (a free jupyter-based notebook environment): https://github.com/PAIR-code/facets#usage-in-google-colabratoryjupyter-notebooks and the sample notebook here: https://colab.research.google.com/drive/1QrcuNHJnL3TBzcFV-0yw6y3wWmSWv_gM You can use facets dive and overview on csv or pandas dataframes with no need for any installations. Just a few commands in the notebook. |
Hi, Many thanks! |
The image data can't be added to the CSV, but with Facets Dive you can add an atlas image which contains thumbnail images for line in the csv, which is what we did for the draw data. PR #137 is about to merge in a tool to help create this atlas image for any dataset you have, and then the atlas image can be provided to dive as the atlasUrl parameter as seen here: https://github.com/PAIR-code/facets/tree/master/facets_dive#sprite-properties |
After reading through all the interesting technicalities on what the facets is I decided to try it on one of my datasets and realized that I still don't know how to load and view the data? Is there a normal tutorial that basically says: if you have a dataset D, do a, b and c, voilà ?
The text was updated successfully, but these errors were encountered: