Skip to content

Commit

Permalink
[docs] Provide upgrade path to new version #138
Browse files Browse the repository at this point in the history
Closes #138

Co-authored-by: Federico Capoano <f.capoano@openwisp.io>
  • Loading branch information
totallynotvaishnav and nemesifier committed Oct 18, 2022
1 parent 9845945 commit 732b44a
Showing 1 changed file with 52 additions and 3 deletions.
55 changes: 52 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ Leverage the power of [EchartsJS](https://github.com/apache/incubator-echarts) a

Build powerful and interoperable visualizations without losing flexibility!

**This library is still in early stages, feedback and contributions are very welcome**.

### Install and run demo examples

```
Expand Down Expand Up @@ -661,7 +659,7 @@ yarn start
</html>
```

### Different Demos
### Example Demos

The demo shows default `graph` render.
[Basic graph demo](https://openwisp.github.io/netjsongraph.js/examples/netjsongraph.html)
Expand Down Expand Up @@ -734,6 +732,57 @@ Using array files to append data step by step at start.
Similiar to the first method, but easier.
[ Append data using arrays demo](https://openwisp.github.io/netjsongraph.js/examples/netjsonmap-appendData2.html)

### Upgrading from 0.1.x versions to 0.2.x

We advise all users of netjsongraph.js who are using the 0.1.x version to
upgrade to the latest version.

The following steps explain how to upgrade.

1. Download the latest version of netjsongraph.js
2. Replace the old version of netjsongraph.min.js with the new version
3. Replace the old version of netjsongraph-theme.css with the new version
4. Replace the old version of netjsongraph.css with the new version
5. Replace the deprecated options with the equivalent new options. See the **Arguments** section for more details.

The following list shows the deprecated options:

- `defaultStyle`
- `scaleExtent`
- `charge`
- `linkDistance`
- `linkStrength`
- `friction`
- `gravity`
- `theta`
- `chargeDistance`
- `nodeClassProperty`
- `linkClassProperty`
- `circleRadius`
- `labelDx`
- `labelDy`
- `onEnd`
- `linkDistanceFunc`
- `redraw`
- `onClickNode`
- `onClickLink`

The function definition for `onInit` and `onLoad` has been changed:
passing any additional arguments to these functions is not needed anymore.

The option `linkDistance` has been renamed to `edgeLength`.
Options like `edgeLength`, `friction`, `gravity` are now passed as an object
named `force` in `series` property of `graphConfig`.
Learn more about `graphConfig` by looking at the [Arguments section](#arguments). Refer to the [Echarts documentation](https://echarts.apache.org/en/option.html#series-graph.force) for more details.

Use `label` instead of `labelDx` and `labelDy` in the `series` property of `graphConfig`.
Refer to the [Arguments section](#arguments) for more details.
You can learn more about `label` in the
[Echarts documentation](https://echarts.apache.org/en/option.html#series-graph.label).

Use `onClickElement` instead of `onClickNode` and `onClickLink`.
Refer to the [Arguments section](#arguments) section for more details.

### Contributing

1. Fork it!
Expand Down

0 comments on commit 732b44a

Please sign in to comment.