https://github.com/ngfelixl/nodeplotlib
NodeJS plotting library for JavaScript and TypeScript. On top of plotly.js. Inspired by matplotlib.
https://github.com/ngfelixl/nodeplotlib
charts javascript matplotlib nodejs plot plotly typescript
Last synced: 2 months ago
JSON representation
NodeJS plotting library for JavaScript and TypeScript. On top of plotly.js. Inspired by matplotlib.
- Host: GitHub
- URL: https://github.com/ngfelixl/nodeplotlib
- Owner: ngfelixl
- License: mit
- Created: 2018-09-19T06:26:02.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2023-10-18T01:52:16.000Z (about 2 years ago)
- Last Synced: 2025-03-28T16:06:27.944Z (9 months ago)
- Topics: charts, javascript, matplotlib, nodejs, plot, plotly, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/nodeplotlib
- Size: 6.95 MB
- Stars: 202
- Watchers: 3
- Forks: 25
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
#
NodePlotLib
[](https://github.com/ngfelixl/nodeplotlib/actions?query=workflow%3A%22Node.js+CI%22)
[](https://npmjs.com/package/nodeplotlib)
[](https://npmjs.com/package/nodeplotlib)
[](https://github.com/prettier/prettier)
[](https://raw.githubusercontent.com/ngfelixl/nodeplotlib/master/img/animation-next.gif)
This readme contains all the necessary information for the development.
## [Go to the user docs](./libs/nodeplotlib/README.md)
## Installation
### Npmjs
```sh
npm install nodeplotlib
# or
yarn add nodeplotlib
```
### Repository
Create a fork of this repository. Then clone it
```
git clone https://github.com/{{USERNAME}}/nodeplotlib
cd nodeplotlib
npm i
```
## Serving the app for development
Serving in development mode prevents the app to open a new browser window on changes.
You can open the app at the specified port, e.g. `http://localhost:4201`.
```
npx nx run web:build -- --watch
NODEPLOTLIB_PORT=4201 npx nx run dev-server:serve
// or on Windows cmd
set "NODEPLOTLIB_PORT=4201" && npx nx run dev-server:serve
// or on Windows Powershell
$env:NODEPLOTLIB_PORT = "4201" ; npx nx run dev-server:serve
```
## Build for production
To build for production three steps are necessary. Build the web app, build
the library, and finally copy the web app files to the libraries dist folder.
All steps are bundled in the following script:
```
npm run build:prod
```
All dist files are located in **/dist/libs/nodeplotlib**
## Release Guide
This is a note for maintainers only. There are several steps to follow before you
can publish the new version to npm.
1. Bump the version number using semver. Use "rc" for release candidates as the _preid_, e.g.
`1.0.0-rc1`. Update the version number in the root [package.json](./package.json)
and in the libs [package.json](./libs/nodeplotlib/package.json).
2. If everything is committed and in place on "master" for non-release candidates,
or on "release/..." for release candidates. Create a tag with that version number,
e.g. `v1.0.0-rc1` or `v1.0.1`, and push it to the repository.
3. Run `npm run build:prod`
4. Navigate to **/dist/libs/nodeplotlib**
5. Run `npm pack`
6. Make sure to be logged in to npmjs. Then run
- `npm publish {{filename}}.tgz` or
- `npm publish {{filename}}.tgz --tag test` for release candidates.
7. Create a release on Github for non-release cadidate versions.
## Behind the scenes
The lib launches a webserver and opens new tabs for every plot located at
`http://localhost:{{PORT}}`, where `PORT` is a free port determined by the express
server itself. At this address the Angular application will be served temporarily.
The server and the app set up a connection via socket.io. This way a realtime
transmission is possible.
## Contributing
Contributions in all forms are welcome.
## Contributors