diff --git a/.gitignore b/.gitignore index 3e119ffc..0779525b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ # distribution /dist -/powsybl-diagram-viewer-*.tgz +/powsybl-network-viewer-*.tgz # distrib for demo /output diff --git a/README.md b/README.md index 728c5c56..a8f53617 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,16 @@ -# powsybl-diagram-viewer +# powsybl-network-viewer -Typescript library to integrate a powsybl svg diagram in a javascript project. The library is built with the Vite bundler. +Typescript library to integrate network viewers in a javascript project. +This library contains three viewers: +- single-line-diagram-viewer, to integrate the SVG representing a graph of voltage levels within a network, the SVG and the corresponding metadata JSON file being generated by [powsybl-diagram](https://github.com/powsybl/powsybl-diagram) +- network-area-diagram-viewer, to integrate the SVG representing single-line diagrams, the SVG and the corresponding metadata JSON file being generated by [powsybl-diagram](https://github.com/powsybl/powsybl-diagram) +- network-map-viewer, to display the substations / voltage levels on a map + +The library is built with the Vite bundler. Node from v18+ is required to build with Vite. Installation using npm: -'npm install @powsybl/diagram-viewer' +'npm install @powsybl/network-viewer' #### For developers @@ -14,7 +20,7 @@ For development purpose, to install this library locally from an app, you should - npm pack Then in the app project : -- npm install {PATH_TO_LIBRARY}/powsybl-diagram-viewer-{LIBRARY_VERSION}.tgz +- npm install {PATH_TO_LIBRARY}/powsybl-network-viewer-{LIBRARY_VERSION}.tgz _Warning_ : with Create React App, we realised the library was not updating correctly if you try to install the library multiple times. To fix this, run this command from the app **after** running "npm install" @@ -22,13 +28,13 @@ To fix this, run this command from the app **after** running "npm install" #### For integrators -If you want to deploy a new version of powsybl-diagram-viewer in the [NPM package registry](https://www.npmjs.com/package/@powsybl/powsybl-diagram-viewer), +If you want to deploy a new version of powsybl-network-viewer in the [NPM package registry](https://www.npmjs.com/package/@powsybl/powsybl-network-viewer), you need to follow the steps below: -- Update to the new version in [package.json](https://github.com/powsybl/powsybl-diagram-viewer/blob/main/package.json) (example `0.6.0`) +- Update to the new version in [package.json](https://github.com/powsybl/powsybl-network-viewer/blob/main/package.json) (example `0.6.0`) - Update the package-lock.json: `npm install` - Commit the package.json and package-lock.json files, push to a branch, make a PR, have it reviewed and merged to main. -- [Make a release](https://github.com/powsybl/powsybl-diagram-viewer/releases/new) on GitHub by creating a new tag on the last commit. On the release creation page: +- [Make a release](https://github.com/powsybl/powsybl-network-viewer/releases/new) on GitHub by creating a new tag on the last commit. On the release creation page: - In "Choose a tag": type the tag you want to create (ex.: v0.6.0) and select "create new tag" - In "Target": click on "recent commit" tab and select your release commit - Click on "Generate release note" diff --git a/package-lock.json b/package-lock.json index a2da33ea..be1683f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "@powsybl/diagram-viewer", + "name": "@powsybl/network-viewer", "version": "0.5.6", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@powsybl/diagram-viewer", + "name": "@powsybl/network-viewer", "version": "0.5.6", "license": "MPL-2.0", "dependencies": { diff --git a/package.json b/package.json index 8842387b..815994a5 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@powsybl/diagram-viewer", + "name": "@powsybl/network-viewer", "version": "0.5.6", "description": "TypeScript library to integrate a PowSyBl SVG diagram in a JavaScript project.", "author": "PowSyBl team", @@ -7,16 +7,16 @@ "license": "MPL-2.0", "repository": { "type": "git", - "url": "git+https://github.com/powsybl/powsybl-diagram-viewer.git" + "url": "git+https://github.com/powsybl/powsybl-network-viewer.git" }, "type": "module", "types": "./dist/index.d.ts", - "main": "./dist/powsybl-diagram-viewer.umd.cjs", - "module": "./dist/powsybl-diagram-viewer.js", + "main": "./dist/powsybl-network-viewer.umd.cjs", + "module": "./dist/powsybl-network-viewer.js", "exports": { ".": { - "import": "./dist/powsybl-diagram-viewer.js", - "require": "./dist/powsybl-diagram-viewer.umd.cjs" + "import": "./dist/powsybl-network-viewer.js", + "require": "./dist/powsybl-network-viewer.umd.cjs" } }, "files": [ diff --git a/vite.config.ts b/vite.config.ts index 4e6948d7..42c2eb38 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -29,9 +29,9 @@ export default defineConfig((config) => ({ lib: { // Could also be a dictionary or array of multiple entry points entry: path.resolve(__dirname, 'src/index.ts'), - name: 'PowSyBl diagram viewer', + name: 'PowSyBl network viewer', // the proper extensions will be added - fileName: 'powsybl-diagram-viewer', + fileName: 'powsybl-network-viewer', }, rollupOptions: { //https://stackoverflow.com/questions/59134241/using-deck-gl-as-webpack-external