diff --git a/.gitignore b/.gitignore index 2fe13aa..95ba3c6 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,7 @@ yarn-error.log* rfvis.egg-info dist build -client/**/*.css +*.css # misc .DS_Store diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 3c55bc2..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,4 +0,0 @@ -include README.md -include LICENSE -graft client/build -graft examples \ No newline at end of file diff --git a/README.md b/README.md index 8b315fe..9000b7c 100644 --- a/README.md +++ b/README.md @@ -169,7 +169,7 @@ actually see the application working on `http://localhost:8080`. To build the frontend you need Node.js installed. First install all dev-dependencies by running the following -from within the `./client` directory: +from within the `./rfvis/client` directory: ``` $ npm install diff --git a/rfvis/__init__.py b/rfvis/__init__.py index d3ec452..3ced358 100644 --- a/rfvis/__init__.py +++ b/rfvis/__init__.py @@ -1 +1 @@ -__version__ = "0.2.0" +__version__ = "0.2.1" diff --git a/rfvis/__main__.py b/rfvis/__main__.py index 64c274f..86c7e9c 100644 --- a/rfvis/__main__.py +++ b/rfvis/__main__.py @@ -63,8 +63,8 @@ def cli(forest_json, out, width, height, trunk_length, display_depth, branch_col }) try: - abs_path = os.path.normpath(os.path.join(__file__, "../../client/build/render_tree_script.js")) - process = subprocess.Popen(["node", abs_path, config, out], + script_path = os.path.join(os.path.dirname(__file__), "client", "build", "render_tree_script.js") + process = subprocess.Popen(["node", script_path, config, out], stdin=subprocess.PIPE, stdout=subprocess.PIPE) output = process.communicate(json.dumps(data).encode("utf8")) diff --git a/client/package.json b/rfvis/client/package.json similarity index 100% rename from client/package.json rename to rfvis/client/package.json diff --git a/client/public/favicon.png b/rfvis/client/public/favicon.png similarity index 100% rename from client/public/favicon.png rename to rfvis/client/public/favicon.png diff --git a/client/public/index.html b/rfvis/client/public/index.html similarity index 100% rename from client/public/index.html rename to rfvis/client/public/index.html diff --git a/client/rollup.config.js b/rfvis/client/rollup.config.js similarity index 100% rename from client/rollup.config.js rename to rfvis/client/rollup.config.js diff --git a/client/src/actions/index.js b/rfvis/client/src/actions/index.js similarity index 100% rename from client/src/actions/index.js rename to rfvis/client/src/actions/index.js diff --git a/client/src/components/DownloadButton.js b/rfvis/client/src/components/DownloadButton.js similarity index 100% rename from client/src/components/DownloadButton.js rename to rfvis/client/src/components/DownloadButton.js diff --git a/client/src/components/Menu.js b/rfvis/client/src/components/Menu.js similarity index 100% rename from client/src/components/Menu.js rename to rfvis/client/src/components/Menu.js diff --git a/client/src/components/NumberInput.js b/rfvis/client/src/components/NumberInput.js similarity index 100% rename from client/src/components/NumberInput.js rename to rfvis/client/src/components/NumberInput.js diff --git a/client/src/components/Select.js b/rfvis/client/src/components/Select.js similarity index 100% rename from client/src/components/Select.js rename to rfvis/client/src/components/Select.js diff --git a/client/src/components/Sidebar.js b/rfvis/client/src/components/Sidebar.js similarity index 100% rename from client/src/components/Sidebar.js rename to rfvis/client/src/components/Sidebar.js diff --git a/client/src/components/Tree.js b/rfvis/client/src/components/Tree.js similarity index 100% rename from client/src/components/Tree.js rename to rfvis/client/src/components/Tree.js diff --git a/client/src/components/pie/PieChart.js b/rfvis/client/src/components/pie/PieChart.js similarity index 100% rename from client/src/components/pie/PieChart.js rename to rfvis/client/src/components/pie/PieChart.js diff --git a/client/src/components/pie/PieChartPath.js b/rfvis/client/src/components/pie/PieChartPath.js similarity index 100% rename from client/src/components/pie/PieChartPath.js rename to rfvis/client/src/components/pie/PieChartPath.js diff --git a/client/src/constants.js b/rfvis/client/src/constants.js similarity index 100% rename from client/src/constants.js rename to rfvis/client/src/constants.js diff --git a/client/src/containers/App.js b/rfvis/client/src/containers/App.js similarity index 100% rename from client/src/containers/App.js rename to rfvis/client/src/containers/App.js diff --git a/client/src/containers/BranchColorSelect.js b/rfvis/client/src/containers/BranchColorSelect.js similarity index 100% rename from client/src/containers/BranchColorSelect.js rename to rfvis/client/src/containers/BranchColorSelect.js diff --git a/client/src/containers/ForestView.js b/rfvis/client/src/containers/ForestView.js similarity index 100% rename from client/src/containers/ForestView.js rename to rfvis/client/src/containers/ForestView.js diff --git a/client/src/containers/HoverArea.js b/rfvis/client/src/containers/HoverArea.js similarity index 100% rename from client/src/containers/HoverArea.js rename to rfvis/client/src/containers/HoverArea.js diff --git a/client/src/containers/LeafColorSelect.js b/rfvis/client/src/containers/LeafColorSelect.js similarity index 100% rename from client/src/containers/LeafColorSelect.js rename to rfvis/client/src/containers/LeafColorSelect.js diff --git a/client/src/containers/LeafPathSelect.js b/rfvis/client/src/containers/LeafPathSelect.js similarity index 100% rename from client/src/containers/LeafPathSelect.js rename to rfvis/client/src/containers/LeafPathSelect.js diff --git a/client/src/containers/MenuTabs.js b/rfvis/client/src/containers/MenuTabs.js similarity index 100% rename from client/src/containers/MenuTabs.js rename to rfvis/client/src/containers/MenuTabs.js diff --git a/client/src/containers/TreeDepthInput.js b/rfvis/client/src/containers/TreeDepthInput.js similarity index 100% rename from client/src/containers/TreeDepthInput.js rename to rfvis/client/src/containers/TreeDepthInput.js diff --git a/client/src/containers/TreeNavigation.js b/rfvis/client/src/containers/TreeNavigation.js similarity index 100% rename from client/src/containers/TreeNavigation.js rename to rfvis/client/src/containers/TreeNavigation.js diff --git a/client/src/containers/TreeView.js b/rfvis/client/src/containers/TreeView.js similarity index 100% rename from client/src/containers/TreeView.js rename to rfvis/client/src/containers/TreeView.js diff --git a/client/src/containers/TrunkLengthInput.js b/rfvis/client/src/containers/TrunkLengthInput.js similarity index 100% rename from client/src/containers/TrunkLengthInput.js rename to rfvis/client/src/containers/TrunkLengthInput.js diff --git a/client/src/index.js b/rfvis/client/src/index.js similarity index 100% rename from client/src/index.js rename to rfvis/client/src/index.js diff --git a/client/src/index.scss b/rfvis/client/src/index.scss similarity index 100% rename from client/src/index.scss rename to rfvis/client/src/index.scss diff --git a/client/src/reducers/index.js b/rfvis/client/src/reducers/index.js similarity index 100% rename from client/src/reducers/index.js rename to rfvis/client/src/reducers/index.js diff --git a/client/src/render_tree_script.js b/rfvis/client/src/render_tree_script.js similarity index 100% rename from client/src/render_tree_script.js rename to rfvis/client/src/render_tree_script.js diff --git a/client/src/selectors/index.js b/rfvis/client/src/selectors/index.js similarity index 100% rename from client/src/selectors/index.js rename to rfvis/client/src/selectors/index.js diff --git a/client/src/utils/TreeNode.js b/rfvis/client/src/utils/TreeNode.js similarity index 100% rename from client/src/utils/TreeNode.js rename to rfvis/client/src/utils/TreeNode.js diff --git a/client/src/utils/Vector.js b/rfvis/client/src/utils/Vector.js similarity index 100% rename from client/src/utils/Vector.js rename to rfvis/client/src/utils/Vector.js diff --git a/client/src/utils/compute_coordinates.js b/rfvis/client/src/utils/compute_coordinates.js similarity index 100% rename from client/src/utils/compute_coordinates.js rename to rfvis/client/src/utils/compute_coordinates.js diff --git a/client/src/utils/parser.js b/rfvis/client/src/utils/parser.js similarity index 100% rename from client/src/utils/parser.js rename to rfvis/client/src/utils/parser.js diff --git a/client/src/utils/tree_utils.js b/rfvis/client/src/utils/tree_utils.js similarity index 100% rename from client/src/utils/tree_utils.js rename to rfvis/client/src/utils/tree_utils.js diff --git a/rfvis/server.py b/rfvis/server.py index 9b05a3f..466603e 100644 --- a/rfvis/server.py +++ b/rfvis/server.py @@ -9,10 +9,11 @@ def start_server(data, port=8080, debug=False, use_reloader=False, **kwargs): @app.route('/', defaults={'path': ''}) @app.route('/') def serve_app(path): - if path != "" and os.path.exists("client/build/" + path): - return send_from_directory('../client/build', path) + build_path = os.path.join(os.path.dirname(__file__), "client", "build") + if path != "" and os.path.exists(os.path.join(build_path, path)): + return send_from_directory(build_path, path) else: - return send_from_directory('../client/build', 'index.html') + return send_from_directory(build_path, 'index.html') @app.route('/data') def serve_data(): diff --git a/setup.py b/setup.py index d62963e..a6ee834 100644 --- a/setup.py +++ b/setup.py @@ -28,6 +28,7 @@ "Bug Tracker": "https://github.com/birnbaum/rfvis/issues", }, packages=["rfvis"], + package_data={"rfvis": ["client/build/*", "client/build/static/**/*"]}, license="MIT", install_requires=[ "click",