shahinrostami / plotapi

Engaging visualisations, made easy.
https://plotapi.com
MIT License
268 stars 17 forks source link

Chord will not work if HTTP proxy is needed (typical when in a company network) or when offline #20

Closed jkolom closed 3 years ago

jkolom commented 3 years ago

Since the template is downloaded via a HTTP request (here), if one is behind a proxy, the HTTP request will not work.

For non-Pro Chord: would it be possible to just include the template with the distribution or to allow an offline mode to avoid using the HTTP request? No Internet else means "no plots" (e.g. while on the road)

For Pro Chord: as it is API-based, there is no other solution than adding a proxy (any idea?), I guess. Example:

session = requests.Session()
session.proxies = {
    'http':  proxy_url_for_http,
    'https': proxy_url_for_https
}

Thanks for the good work with the Chord visualization! Happy to support it :)

shahinrostami commented 3 years ago

Hello @jkolom

Many thanks for raising this. I'll have a look at it when I can and try to come to a solution!

jkolom commented 3 years ago

PS: I assume that no offline use and that Chord Pro sends the data to your API server to generate the plot may be a specific that some may find important to have clearly documented while assessing usage of Chord Pro. I don't think that many companies would approve of certain data being sent to a 3rd party API. Worst case you may end up with legal issues, so I would recommend to have it at least clearly documented ;)

shahinrostami commented 3 years ago

PS: I assume that no offline use and that Chord Pro sends the data to your API server to generate the plot may be a specific that some may find important to have clearly documented while assessing usage of Chord Pro. I don't think that many companies would approve of certain data being sent to a 3rd party API. Worst case you may end up with legal issues, so I would recommend to have it at least clearly documented ;)

Hi @jkolom, thanks for raising this. To add clarity around these facts I've added a section to the README.md https://github.com/shahinrostami/chord/blob/master/README.md#data-and-templates

This will be mirrored on PyPi and the Chord PRO manual!

shahinrostami commented 3 years ago

Hi @jkolom I'm going to create some kind of feature roadmap for things like this and move them there soon! If you come up witth a solution in the meantime please let me know.

cozyscripts commented 3 years ago

Hi, I also had issues being on a corp network. The work-around for me was:

#template_url = "https://datacrayon.com/assets/chord/chord_0_0_12.tmpl" <- commented this out just to have the original link template = open('chord_0_0_12.tmpl', 'r').read()

Hope this helps anyone looking for a dirty work-around.

shahinrostami commented 3 years ago

Hi, I also had issues being on a corp network. The work-around for me was:

  • manually downloading the .tmpl file from the link in the init.py file
  • saved it in an easily accessible location
  • changed two lines of source code in init.py to:

#template_url = "https://datacrayon.com/assets/chord/chord_0_0_12.tmpl" <- commented this out just to have the original link template = open('chord_0_0_12.tmpl', 'r').read()

Hope this helps anyone looking for a dirty work-around.

Thank you for sharing your workaround @cozyscripts! I'm in the process of creating an FAQ so I'll be sure to add that to the list. I still need to find a solution for chord pro, eventually! Feel free to drop by our discord (https://discord.com/invite/nsezsyb) if you want to share your creations 👍

shahinrostami commented 3 years ago

I've just added verify_ssl=False to Chord!

pip uninstall chord and then pip install chord to update to 1.0.2!