Kanaries / pygwalker

PyGWalker: Turn your pandas dataframe into an interactive UI for visual analysis
https://kanaries.net/pygwalker
Apache License 2.0
13.45k stars 704 forks source link

v0.1.9.1 to_html bug #132

Closed longxiaofei closed 1 year ago

longxiaofei commented 1 year ago

Hi, I've tried to insert pygwalker into a Django div with mark_safe and file keeps loading forever. Looking at JavaScript console it throws this error twice: TypeError: t is undefined

This is my view:

from django.shortcuts import render
import pandas as pd
import pygwalker as pyg
from django.utils.safestring import mark_safe
def test(request):

    df = pd.read_csv("https://kanaries-app.s3.ap-northeast-1.amazonaws.com/public-datasets/bike_sharing_dc.csv",
                     parse_dates=['date'])
    div = mark_safe(pyg.to_html(df))
    return render(request, 'tests.html', {'div': div})

And in template I simply do {{ div }}

Could you help me with this? Thanks

Originally posted by @P3RI9 in https://github.com/Kanaries/pygwalker/issues/94#issuecomment-1597042897

longxiaofei commented 1 year ago

Hi, @P3RI9, I created an new issue to answer your question.

This is a bug in version 0.1.9.

You can try version 0.1.8 first to complete your code, this bug will be fixed in version 0.1.9.2.

pip install pygwalker==0.1.8

P3RI9 commented 1 year ago

Okay, thank you

longxiaofei commented 1 year ago

fixed in version 0.1.10.

longxiaofei commented 1 year ago

No feedback for too long, so temporarily closing this issue. If there are any problems, it can be reopened.