Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental fixes #145

Merged
merged 6 commits into from
Jun 10, 2022

Conversation

EgorPichkur
Copy link

This PR contains 2 fixes and 1 possible feature:

  1. lib directory was not copied to the installation destination while running pip install pyvis, that's why I've added its inclusion into the list of packages in MANIFEST.in
  2. Disabled strict mode in vis-network.min.js to resolve CSP related issues. The issues appearance might be related to the comment
  3. Added the Tom Select package to make searchable the dropdown with the list of nodes

Thanks to @AlexanderGolub for the help with the point 2

@BerserkerGaruk BerserkerGaruk self-requested a review June 1, 2022 17:33
…ere were other issues in how the templating, and remote resourcing was being handled that this commit fixes.

Updated template directory for the pyvis package to import the template directory as a jinja template environment instead of by file. Previous was imported by filename and didn't allow for include statements as well as not being a template directory.
Sources were added without integrety hashes. Updated to import using said integrity checks.
Added new argument to Network declration to change how resources are packaged into the end product. This adds remote, in_line, and local as options for building the template. In-line takes raw js files from the lib directory and injects them as inline javascript and can be used for local non-internet access situations, as well when remote files don't wish to be trusted. Remote pulls said sources from remote with integrety checks handled. local will pull the resources from the local lib directory as was being performed before.
in_line and remote fixes an issue with pyvis in jupyter-notebook on chrome and safari that caused graphics to error with a blank object due to jupyter denying access due to a CORBS policy due to chrome and safari removing referer on requests to same origin cdns.
<meta charset='utf-8'> is a fix for the tom-select pacakge as there is non utf-8 characters implimented.
Wrapped tom_select template initialization to check if select_menu is ture as they were being initialized and thus causing errors when this option was set to false.
Updated jupyter-notebook to contain options, and examples of the node selection to be able to test changes.
@BerserkerGaruk
Copy link
Member

Checked through pull request created by @EgorPichkur at direction of @jhunpingco. Worked through bugs that arose due to the inclusion of tom-select as well as updating the templating structure to use the jinja template environment. (This change shouldn't be non-breaking, but might want to look into the provided template options to make sure they don't break.)

This update also provides options for different remote resources [in_line, remote, local] that provides options for different deployments as well as fixes a bug between chrome and jupyter-notebook with removing the referer from file requests (set in_line or remote allows graphics in jupyter-notebook on chrome. Previous fix was to use a different browser.)

@jhunpingco jhunpingco merged commit 94c9555 into WestHealth:experimental Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants