Skip to content

Commit

Permalink
Create jupyter-server-proxy entrypoint
Browse files Browse the repository at this point in the history
Signed-off-by: Antony Milne <antony.milne@quantumblack.com>
  • Loading branch information
antonymilne committed Jun 23, 2022
1 parent c81167e commit 8d3ba79
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
12 changes: 12 additions & 0 deletions package/kedro_viz/launchers/jupyter.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,15 @@ def run_viz(port: int = None, line=None, local_ns=None) -> None:
port
)
display(HTML(wrapper))


def jupyter_server_proxy():
return {
"command": ["kedro", "viz", "--port", "{port}"],
"timeout": 20,
# absolute_url=True was worse
"launcher_entry": {
"icon_path": "/Users/antony_milne/kedro_stuff/kedro-viz/kedro-icon-color.svg",
"title": "Kedro-Viz",
},
}
4 changes: 4 additions & 0 deletions package/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
package_data={"kedro_viz": list(files)},
zip_safe=False,
entry_points={
"jupyter_serverproxy_servers": [
# name = packagename:function_name
"kedro_viz = kedro_viz.launchers.jupyter:jupyter_server_proxy",
],
"kedro.global_commands": ["kedro-viz = kedro_viz.launchers.cli:commands"],
"kedro.line_magic": ["line_magic = kedro_viz.launchers.jupyter:run_viz"],
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/icons/logo.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

const LogoIcon = ({ className }) => (
<svg className={className} viewBox="24 25 32 30">
<svg viewBox="24 25 32 30">
<path
d="M40 25.414 54.586 40 40 54.586 25.414 40 40 25.414z"
fill="none"
Expand Down

0 comments on commit 8d3ba79

Please sign in to comment.