Skip to content

Commit

Permalink
Rename diagram-viewer into network-viewer
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
  • Loading branch information
flo-dup committed Nov 4, 2024
1 parent c51f089 commit 12ac822
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# distribution
/dist
/powsybl-diagram-viewer-*.tgz
/powsybl-network-viewer-*.tgz

# distrib for demo
/output
Expand Down
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -14,21 +20,21 @@ 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"
- rm -Rf node_modules/.cache

#### 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"
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"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",
"homepage": "https://www.powsybl.org/",
"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": [
Expand Down
4 changes: 2 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 12ac822

Please sign in to comment.