tysonwu / dash-tradingview

Tradingview Lightweight Charts wrapper for Plotly Dash apps
MIT License
130 stars 22 forks source link

Trying to make it work with django-plotly-dash #12

Open notgonnamakeit opened 10 months ago

notgonnamakeit commented 10 months ago

I've run into an issue where I use dash-tradingview with django-plotly-dash:

https://github.com/GibbsConsulting/django-plotly-dash/issues/477#issue-1964356841

The requested JS file isn't available on unpkg.com, and I found references to that in the dash-tradingview's init.py file:

_js_dist.extend(
    [
        {
            'relative_package_path': 'dash_tvlwc.min.js',
    'external_url': 'https://unpkg.com/{0}@{2}/{1}/{1}.min.js'.format(
                package_name, __name__, __version__),
            'namespace': package_name
        },
        {
            'relative_package_path': 'dash_tvlwc.min.js.map',
    'external_url': 'https://unpkg.com/{0}@{2}/{1}/{1}.min.js.map'.format(
                package_name, __name__, __version__),
            'namespace': package_name,
            'dynamic': True
        }
    ]
)

When I run the app outside the django-plotly-dash wrapper, it does seem to serve the JS file locally instead of getting it from unpkg.com where it's not available.

Any ideas on how to fix that?