Giter Site home page Giter Site logo

poloclub / wizmap Goto Github PK

View Code? Open in Web Editor NEW
367.0 367.0 26.0 76.32 MB

Explore and interpret large embeddings in your browser with interactive visualization! 📍

Home Page: https://poloclub.github.io/wizmap/

License: MIT License

JavaScript 0.55% Svelte 9.77% SCSS 16.78% HTML 0.12% CSS 3.74% TypeScript 58.62% GLSL 0.64% Python 9.77%
embeddings interactive-visualizations machine-learning visualization webgl

wizmap's People

Contributors

fredhohman avatar xiaohk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

wizmap's Issues

Local package build: wizmap.js not found

I am trying to add an option for customized stopwords (#6), but struggling to install a local version of the Python widget.

Here is how I try (after changing wizmap.py):

$ python -m pip install -U -e ../wizmap/notebook-widget
[...]
Successfully built wizmap
Installing collected packages: wizmap
  Attempting uninstall: wizmap
    Found existing installation: wizmap 0.1.2
    Uninstalling wizmap-0.1.2:
      Successfully uninstalled wizmap-0.1.2
Successfully installed wizmap-0.1.2

However, when I try to import wizmap in Python, I get this error:

import wizmap

wizmap.visualize(data_url, grid_url)

File [.../wizmap/notebook-widget/wizmap/wizmap.py:847](.../wizmap/notebook-widget/wizmap/wizmap.py:847), in visualize(data_url, grid_url, height)
    834 def visualize(data_url, grid_url, height=700):
    835     """
    836     Render WizMap in the output cell.
    837 
   (...)
    845         HTML code with deferred JS code in base64 format
    846     """
--> 847     html_str = _make_html(data_url, grid_url)
    849     # Randomly generate an ID for the iframe to avoid collision
    850     iframe_id = "wizmap-iframe-" + str(int(random.random() * 1e8))

File [.../wizmap/notebook-widget/wizmap/wizmap.py:797](.../wizmap/notebook-widget/wizmap/wizmap.py:797), in _make_html(data_url, grid_url)
    794 html_bottom = """</head><body><div id="app"></div></body></html>"""
    796 # Read the bundled JS file
--> 797 js_b = pkgutil.get_data(__name__, "wizmap.js")
    799 # Read local JS file (for development only)
    800 # with open("./wizmap.js", "r") as fp:
    801 #     js_string = fp.read()
    802 # js_b = bytes(js_string, encoding="utf-8")
    803 
    804 # Encode the JS & CSS with base 64
    805 js_base64 = base64.b64encode(js_b).decode("utf-8")

File [/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pkgutil.py:640](https://file+.vscode-resource.vscode-cdn.net/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pkgutil.py:640), in get_data(package, resource)
    638 parts.insert(0, os.path.dirname(mod.__file__))
    639 resource_name = os.path.join(*parts)
--> 640 return loader.get_data(resource_name)

File :1130, in get_data(self, path)

FileNotFoundError: [Errno 2] No such file or directory: '.../wizmap/notebook-widget/wizmap/wizmap.js'

Note: I have replaced the full path to my local wizmap repository by ... in the output above for brevity.

This works fine with the wizmap version 0.1.2 installed with pip install wizmap.
Is there anything else I need to run for building the Python package locally?

Example with localhost URLs

Hello!

I have a small request: could you please give an example of accessing files via localhost-URLs? I have a notebook running on localhost:8888, from within the "wizmap" folder. I have tried to use the following URLs for my data:

http://localhost:8888/view/example/smaller_data.ndjson
file:///Users/alexsend57/Documents/wizmap/example/smaller_data.ndjson

However, in both cases the visualisation does not work (points are not appearing). I have checked that there is no problem with the data itself by uploading it on GitHub and running the visualisation with public URLs -- it worked perfectly.

No points are displayed

I am running locally WizMap but only contours are visible, see below showing the DiffusionDB example. I am running WizMap in the command line:

❯ npm run dev


> [email protected] dev
> vite --port 3000


  VITE v3.2.7  ready in 182 ms

  ➜  Local:   http://localhost:3000/
  ➜  Network: use --host to expose
10:50:36 AM [vite-plugin-svelte] /src/components/mapview/MapView.svelte:70:0 Unused CSS selector ".main-app-container.hidden"
10:50:36 AM [vite-plugin-svelte] /src/components/footer/Footer.svelte:250:0 Unused CSS selector "dialog[open] .row-block .row-name"
image

Where to find wizmap.js?

Hello! Thank you for a useful tool!

I have a problem while running the example notebook "imdb.ipynb". When I run the last cell with "wizmap.visualize", I receive this error:

FileNotFoundError: [Errno 2] No such file or directory: '../notebook-widget/wizmap/wizmap.js'

Indeed, there is no such file. What actions should I perform in order to obtain it?

0 Data points

I am trying to use my own embeddings with texts, but i keep getting empty graph. I tried wizmap.visualize() and online visualization - no use.
What can cause such behavior?

How to load the visualisation in an iframe on our website?

We created a visualisation and have a link. We want to showcase the visualisation in our website and tried to use iframe for the same but the visualisation is not loading.

Is there a way we can load the visualisations on our own website?

How can I display images?

I would like to display an image for each data point, can you please provide an example code how to do that? Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.