Skip to content
This repository was archived by the owner on Jul 27, 2024. It is now read-only.

How to save the tool outside the jupyter notebook so that the images appear on the display? #239

@wesnasimone

Description

@wesnasimone

Hello,

I have doubts if it is possible to save the tool outside the jupyter notebook so that the images appear on the display. I can save in html format, but the images do not appear only the colored circles that are standard of the tool. Is it possible to resolve this for an image database? Below is an excerpt from my code that saves the display:

#Displaythe Dive visualization for this data
from IPython.core.display import display, HTML


sprite_size = 32

# Create Facets template
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" atlas-url="sprite_atlas.png"></facets-dive>
        <script>
          document.querySelector("#elem").data = {jsonstr};
        </script>"""

html = HTML_TEMPLATE.format(jsonstr=jsonstr, sprite_size=sprite_size)


# Display the template
display(HTML(html))
#save as html
OUTPUT_PATH = './ISIC_2019_4.html'
with open(OUTPUT_PATH,'w') as fo:
        fo.write(html)

In general, I'm trying to host an instance of Facets Dive outside of a notebook to shared with other people that wanted to work with tool.

I'm annexed the examples of display on jupyter and when it saved in html format

Display on jupyter:

Jupyter notebook

Display save in html format:

save_html

Why don't the images appear?
Has anyone had this problem or could you help me?
Thanks :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions