{"id":32561655,"url":"https://github.com/pfh/langevitour","last_synced_at":"2025-10-29T01:55:21.718Z","repository":{"id":37481411,"uuid":"460377769","full_name":"pfh/langevitour","owner":"pfh","description":"Langevin dynamics based tours of data, in Javascript with R wrapper.","archived":false,"fork":false,"pushed_at":"2025-05-24T02:18:39.000Z","size":2393,"stargazers_count":27,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-11T16:57:45.307Z","etag":null,"topics":["javascript-applications","langevin-dynamics","r-package","tour","visualization"],"latest_commit_sha":null,"homepage":"https://logarithmic.net/langevitour/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pfh.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-17T10:02:54.000Z","updated_at":"2025-07-07T04:42:57.000Z","dependencies_parsed_at":"2022-08-08T20:30:33.529Z","dependency_job_id":"8504dfa8-f792-47f0-bc25-5186f2041ae9","html_url":"https://github.com/pfh/langevitour","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/pfh/langevitour","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfh%2Flangevitour","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfh%2Flangevitour/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfh%2Flangevitour/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfh%2Flangevitour/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pfh","download_url":"https://codeload.github.com/pfh/langevitour/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfh%2Flangevitour/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281544193,"owners_count":26519554,"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","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["javascript-applications","langevin-dynamics","r-package","tour","visualization"],"created_at":"2025-10-29T01:55:14.024Z","updated_at":"2025-10-29T01:55:21.712Z","avatar_url":"https://github.com/pfh.png","language":"TypeScript","funding_links":[],"categories":["Visualization"],"sub_categories":["Scatterplot"],"readme":"# langevitour\n\nlangevitour is an HTML widget that randomly tours projections of a high-dimensional dataset with an animated scatter-plot. The user can manipulate the plot to use specified axes, or turn on Guided Tour mode to perform [projection pursuit](https://en.wikipedia.org/wiki/Projection_pursuit), finding an informative projection of the data. Groups within the data can be hidden or shown, as can particular axes. Known projections of interest can be added as \"extra axes\" and also manipulated. The widget can be used from within R or Python, or included in a self-contained Rmarkdown document, or a Shiny app, or used directly from Javascript.\n\nlangevitour is a twist on the \"tour\" concept from software such as [XGobi](https://lib.stat.cmu.edu/general/XGobi/), [GGobi](http://ggobi.org/), [tourr](http://ggobi.github.io/tourr/), [ferrn](https://huizezhang-sherry.github.io/ferrn/), [liminal](https://sa-lee.github.io/liminal/), [detourr](https://casperhart.github.io/detourr/index.html), [spinifex](https://nspyrison.github.io/spinifex/), and [loon.tour](https://great-northern-diver.github.io/loon.tourr/). The new element in langevitour is the use of [Langevin Dynamics](https://en.wikipedia.org/wiki/Langevin_dynamics) to generate the sequence of projections.\n\nlangevitour is described in:\n\n\u003e Harrison, Paul. 2023. \"langevitour: Smooth Interactive Touring of High Dimensions, Demonstrated with scRNA-Seq Data.\" *The R Journal* 15 (2): 206–219. [https://doi.org/10.32614/RJ-2023-046](https://doi.org/10.32614/RJ-2023-046).\n\n\u003ca href=\"https://logarithmic.net/langevitour/2022-abacbs/\" style=\"display: block; margin: 5px; border: 1px solid #000; float: right\"\u003e\n\u003cimg src=\"https://logarithmic.net/langevitour/2022-abacbs/abacbs-langevitour-poster-2022-small.png\" width=300\u003e\n\u003c/a\u003e\n\nFurther material:\n\n* ABACBS Conference 2022 [poster (large image)](https://logarithmic.net/langevitour/2022-abacbs/abacbs-langevitour-poster-2022.png) and [demo](https://logarithmic.net/langevitour/2022-abacbs/)\n\n* ABACBS Seminar 2022 [slides](https://logarithmic.net/langevitour/2022-09-abacbs/)\n\n* useR! 2022 conference [slides](https://logarithmic.net/langevitour/2022-useR/) and [video (extended edition)](https://www.youtube.com/watch?v=vKv9P13UACw)\n\n* IASC-ARS 2023 [slides](https://logarithmic.net/langevitour/2023-iasc-ars/) and [short video](https://www.youtube.com/watch?v=gwqU9OoFwjQ) for *Visualising high-dimensional genomics data: what Non-Linear Dimension Reduction hides and misrepresents.* Demonstrates some advanced tricks setting the state of the widget using buttons in a Quarto presentation.\n\n* [R examples](https://logarithmic.net/langevitour/articles/examples.html)\n\n* [Python example](https://colab.research.google.com/github/pfh/langevitour/blob/main/py/examples/langevitour.ipynb)\n\n* [Javascript example](https://pfh.github.io/langevitour/example.html)\n\n* [Observable Notebook example](https://observablehq.com/d/56b34c363af4dbca)\n\n\u003cbr\u003e\n\n## R installation\n\nRelease version:\n\n```r\ninstall.packages(\"langevitour\")\n```\n\nDevelopment version:\n\n```r\nremotes::install_github(\"pfh/langevitour\")\n```\n\nTo build the documentation site:\n\n```r\ninstall.packages(c(\"devtools\", \"pkgdown\", \"BiocManager\"))\ndevtools::install_dev_deps()\nBiocManager::install(c(\"airway\", \"org.Hs.eg.db\", \"edgeR\", \"limma\"))\n\npkgdown::build_site()\n```\n\n## R usage\n\nExample:\n\n```r\nlibrary(langevitour)\n\ndata(zeiselPC)\nlangevitour(zeiselPC[,-1], zeiselPC$type)\n```\n\n* [R documentation.](https://logarithmic.net/langevitour/reference/)\n\n\u003cbr\u003e\n\n## JavaScript usage\n\n* Get started by viewing source on [this example](https://pfh.github.io/langevitour/example.html).\n* [JavaScript documentation.](https://logarithmic.net/langevitour/jsdoc/)\n\nThe minified and bundled version can be found in `inst/htmlwidgets/lib/langevitour-pack.js`.\n\n### ESM module with npm\n\nIf using [node](https://nodejs.org/) and `npm` for development, langevitour can be added with:\n\n```bash\nnpm install langevitour\n```\n\nThis provides the widget as a modern ESM module. In your HTML page you can import it with:\n\n```\n\u003cscript type=\"module\"\u003e\n\nimport { Langevitour } from \"langevitour\";\n\n// ...\n\u003c/script\u003e\n```\n\nYou'll need to use a packager such as [parcel](https://parceljs.org/) or [webpack](https://webpack.js.org/) to use this. Please tell me if you run into any problems, I am fairly new to Javascript development. \n\n### ESM module without npm\n\nTo avoid using npm, you could use [skypack.dev](https://www.skypack.dev/). You will still need to serve your page with some sort of web-server, such as `python3 -m http.server`.\n\n```\n\u003cscript type=\"module\"\u003e\n\nimport { Langevitour } from \"https://cdn.skypack.dev/langevitour\";\n\n// ...\n\u003c/script\u003e\n```\n\n[Here](https://observablehq.com/d/56b34c363af4dbca) is an example using skypack in an Observable Notebook.\n\n### JavaScript development\n\nlangevitour is written in TypeScript, which is compiled to JavaScipt, and then Webpack is used to produce a minified and bundled version. To make changes to the JavaScript side of langevitour, you will need to install [node](https://nodejs.org/), which includes the `npm` package manager. `npm` can then install the necessary build tools and dependencies. Build scripts are defined in `package.json` and used as below.\n\n```bash\ngit clone https://github.com/pfh/langevitour.git\ncd langevitour\n\n# Install required packages\nnpm install\n\n# ... edit source in src/ directory ...\n\n# Compile TypeScript modules in src/ to JavaScript modules in lib/.\n# Produce minified bundle inst/htmlwidgets/lib/langevitour.js\nnpm run js-build\n\n# Complete Javascript+R build and documentation process.\nnpm run build\n```\n\nFor example, to define a new guide you would:\n\n* Add a new gradient function in `ts/guides.ts`. \n* Add it to the `gradTable` in `ts/guides.ts`.\n* Add it to the `guideSelect` select box in `ts/langevitour.ts`.\n* Run `npm run js-build` and the new guide should appear when you load `example.html`.\n\n\u003cbr\u003e\n\n## Python installation\n\n```bash\npip install langevitour\n```\n\n## Python usage \n\n```python\nimport numpy as np\n\nfrom langevitour import Langevitour\n\n# Generate a sample dataset\nX = []\ngroup = []\nn = 20000\n\ndef r():\n    return np.random.normal(0, 0.02)\n\nfor i in range(n):\n    a = i/n * np.pi * 2\n    X.append([\n        10 + np.sin(a)/3 + r(),\n        20 + np.sin(a*2)/3 + r(),\n        30 + np.sin(a*3)/3,\n        40 + np.sin(a*4)/3,\n        50 + np.sin(a*5)/3\n    ])\n    group.append(int(i*4/n))\n\n# Extra axes (specified as columns of a matrix)\nextra_axes = [[1], [2], [0], [0], [0]]\nextra_axes_names = [\"V1+2*V2\"]\n\ntour = Langevitour(\n    X,\n    group=group,\n    extra_axes=extra_axes,\n    extra_axes_names=extra_axes_names,\n    point_size=1,\n)\ntour.write_html(\"langevitour_plot.html\")\n```\n\nlangevitour also works in [jupyter notebooks](https://colab.research.google.com/github/pfh/langevitour/blob/main/py/examples/langevitour.ipynb).\n\n## Authors\n\nThe Javascript and R package are written by Paul Harrison. The Python package was kindly contributed by Wytamma Wirth.\n\n## Copyright\n\nLangevitour is free software made available under the [MIT license](https://github.com/pfh/langevitour/blob/main/LICENSE.md). Included libraries [jStat](https://github.com/jstat/jstat) and [SVD-JS](https://github.com/danilosalvati/svd-js) are also provided under the MIT license. Included library [D3](https://github.com/d3/d3) is provided under the [ISC license](https://github.com/d3/d3/blob/main/LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfh%2Flangevitour","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpfh%2Flangevitour","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfh%2Flangevitour/lists"}