{"id":19312829,"url":"https://github.com/hswick/jutsu","last_synced_at":"2025-09-09T06:16:29.176Z","repository":{"id":62432927,"uuid":"92623359","full_name":"hswick/jutsu","owner":"hswick","description":"Graphing tool for Clojure built with the web and interactivity in mind","archived":false,"fork":false,"pushed_at":"2018-12-28T23:29:44.000Z","size":205,"stargazers_count":59,"open_issues_count":3,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-09-16T18:57:12.668Z","etag":null,"topics":["clojure","data","plotlyjs","visualization"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hswick.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-27T20:49:07.000Z","updated_at":"2024-05-31T07:52:11.000Z","dependencies_parsed_at":"2022-11-01T20:47:18.743Z","dependency_job_id":null,"html_url":"https://github.com/hswick/jutsu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hswick%2Fjutsu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hswick%2Fjutsu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hswick%2Fjutsu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hswick%2Fjutsu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hswick","download_url":"https://codeload.github.com/hswick/jutsu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223900327,"owners_count":17222028,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clojure","data","plotlyjs","visualization"],"created_at":"2024-11-10T00:36:17.797Z","updated_at":"2024-11-10T00:36:18.675Z","avatar_url":"https://github.com/hswick.png","language":"Clojure","readme":"# DEPRECATED\n\nThis project is no longer being maintained, as its dependencies have drifted it seems the clojurescript parts don't work the same way as they used to. Running the tests everything works fine, but when using it normally the plots don't seem to work.\n\nThis is the main issue, so if you happen to come across this and fix it, knock yourself out, I'll be more than happy to merge the PR. However, at this point I am no longer going to continue working on this. Best of luck fellow clojurians!\n\n# jutsu 術\n\n![alt text](https://sites.google.com/site/narutonarutoshippudenmanga/_/rsrc/1338580006294/handsigns/Handsigns.png)\n\njutsu translation: technique, way\n\nDo you want fast data visualization that looks professional without a lot of hassle?\n\nTired of having to come up with your own ad hoc solution to visualize data remotely?\n\nThen this tool is meant for you! \n\n(I promise the graphs look a lot better than on this README. Image quality is being reduced for compression reasons I believe.)\n\nThe current api is functionally a light wrapper around [plotly.js](https://plot.ly/javascript/).\nThis way you can follow their conventions for plotting while getting to use EDN instead of JSON. \n\nThe power of jutsu is that it works by sending data to a client just like a website. This has a couple of advantages.\n\nThe first is that jutsu works remotely by default, same api for cloud and localhost.\n\nThe second is that plotly graphs use javascript for animations and interactivity. This is increasingly becoming the norm for professional data visualization.\n\nTradeoff:\nEvery call in this api is a side effect. This is denoted in the naming conventions for the api.\n\n## Getting Started\n\nIf you are new to Clojure then follow these instructions, otherwise skip to usage.\n\nMake sure you have java installed\n\n`java -version` if you don't, then install a java SDK such as OpenJDK. \n\nThen install [boot](https://github.com/boot-clj/boot).\nBoot is a build tool for clojure which allows you to run tasks from the command line.\n\nTo make sure everything is working run `boot repl` in your command line.\n\nIn order to use jutsu you will need to create a build.boot file to add jutsu as a dependency. \nYou can follow the instructions on boot's [homepage](https://github.com/boot-clj/boot) to guide you.\n\n## Usage\n\nAdd jutsu to your dependencies\n\n```clojure\n[hswick/jutsu \"0.1.3\"]\n```\n\n*note* If you are using nightlight you must place nightlight after jutsu in the list of dependencies. This is currently a known bug.\n\nThen include jutsu into your current namespace.\n\nIf working in a repl:\n\n```clojure\n\n(require '[jutsu.core :as j])\n\n```\nOr if working in a source file:\n\n```clojure\n(:require [jutsu.core :as j])\n```\n\nThen start using jutsu! \n```clojure\n;;This will start up a httpkit server and open the jutsu client in your default browser.\n(j/start-jutsu!)\n;;If you are running this in a script as opposed to the repl \n;;delay for a bit to let the websocket connect.\n;;(Thread/sleep 3000)\n\n```\n\nEach call to jutsu follows a similar function signature [id data]\n```clojure\n;;Adds a graph to the jutsu client\n(j/graph!\n  \"foo\"\n  [{:x [1 2 3 4]\n    :y [1 2 3 4]\n    :mode \"markers\"\n    :type \"scatter\"}])\n```\n![alt text](img/graph.png)\n\n```clojure  \n;;To do realtime updates of a graph\n(j/update-graph!  \n  \"foo\"\n  {:data {:y [[4]] :x [[5]]} \n   :traces [0]}))\n   \n```\n![alt text](img/updateplot.png)\n\n```clojure\n;;You can even view matrix like datasets\n(j/dataset! \"dataset-foo\" \n   [[1 2 3 4] \n    [1 2 3 4] \n    [1 2 3 4] \n    [1 2 3 4]])\n```\n![alt text](img/dataset.png)\n\n```clojure\n(j/graph! \"Line Chart\"\n  [{:x [1 2 3 5]\n    :y [6 7 8 9]\n    :type \"scatter\"}])\n```\n![alt text](img/linechart.png)\n\n```clojure\n\n  (j/graph! \"Bar Chart\"\n    [{:x [\"foo\" \"bar\" \"foobar\"]\n      :y [20 30 40]\n      :type \"bar\"}])\n```\n![alt text](img/barchart.png)\n\n```clojure\n  (j/graph! \"Pie Chart\"\n    [{:values [19 26 55]\n      :labels [\"Residential\" \"Non Residential\" \"Utility\"]\n      :type \"pie\"}])\n```\n![alt text](img/piechart.png)\n\n```clojure\n  (j/graph! \"3D Scatter\"\n    [{:x (take 100 (repeatedly #(rand)))\n      :y (take 100 (repeatedly #(rand)))\n      :z (take 100 (repeatedly #(rand)))\n      :type \"scatter3d\"\n      :mode \"markers\"}]\n    {:width 600\n     :height 600})\n```\n![alt text](img/threedscatter.png)\n\nPlease check out plotly's homepage for a [full set of documented options.](https://plot.ly/javascript/)\n\n## Remote\n\nThe nice thing about jutsu being run like a web app is that it works on remote environments by default.\n\nSSH into your remote machine like so:\n\nssh -L 9002:localhost:4002 USER@IP_ADDRESS\n\nThen in your code (I personally like to use jutsu in the repl) initialize jutsu:\n\n```clojure\n(j/start-jutsu! 4002 false)\n```\n\n4002 is the port number that jutsu will be serving locally on your remote machine\nThe third argument we set to false because we don't want it to try to open up the graph\nin a web browser automatically.\n\nIn your browser on your computer type localhost:9000 as the url.\n\nYou should see the jutsu start page if it is all working.\n\nThen when you are ready you can send graphs to this web page and see them immediately. \n\n## Dev\n\nRun all three commands in separate tabs for optimal dev experience.\n\n`boot night` to edit\n\n`boot dev` to run\n\n`boot repl-client` to connect to repl server started with `boot dev`\n\nPull requests are very welcome!\n\n## Testing\n\n`boot test-code` to run tests (will reload on resource file changes)\n\nThis has the unfortunate side effect of constantly reopening a tab in your browser and can be annoying at times.\nWould love advice on how to test this better. \n\n## Web Socket\nSente receives event via chsk/receive and jutsu uses pattern matching to route the events appropriately.\n\nDynamically adding more event routes is a possibility, however the coupling between clj(s) makes testing very difficult.\nServer side router currently only sends events to the client-side-router. However, functionality for receiving events is planned.\n\n\n## More\n[What jutsu started as](https://github.com/danielsz/sente-boot)\n\n[plotly cheat sheet](https://images.plot.ly/plotly-documentation/images/plotly_js_cheat_sheet.pdf)\n\n[plotly full reference](https://plot.ly/javascript/reference/)\n\n## MIT LICENSE\nCopyright 2017 Harley Swick\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhswick%2Fjutsu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhswick%2Fjutsu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhswick%2Fjutsu/lists"}