Skip to content

Commit fc788e5

Browse files
authored
Merge pull request #155 from neo4j-contrib/feature/merge-configuration
Merge Vis config with default
2 parents 49fca02 + d185357 commit fc788e5

14 files changed

+1725
-2792
lines changed

.eslintrc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
parser: babel-eslint
1+
parser: "@babel/eslint-parser"
22
env:
33
browser: true
44
es6: true
@@ -10,7 +10,7 @@ globals:
1010
Atomics: readonly
1111
SharedArrayBuffer: readonly
1212
parserOptions:
13-
ecmaVersion: 2018
13+
ecmaVersion: 2020
1414
sourceType: module
1515
plugins:
1616
- jest

.github/workflows/CI.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
name: CI
2-
on: [push, pull_request]
2+
on:
3+
- push
4+
- pull_request
35
jobs:
46
build:
57
name: Lint Test and Build
68
runs-on: ubuntu-latest
79
steps:
810
- uses: actions/checkout@v2
9-
- uses: borales/actions-yarn@v2.0.0
11+
- name: Setup node
12+
uses: actions/setup-node@v2
1013
with:
11-
cmd: install
12-
- uses: borales/actions-yarn@v2.0.0
13-
with:
14-
cmd: eslint
15-
- uses: borales/actions-yarn@v2.0.0
16-
with:
17-
cmd: test
18-
- uses: borales/actions-yarn@v2.0.0
19-
with:
20-
cmd: build
14+
node-version: "14"
15+
- run: yarn install
16+
- run: yarn eslint
17+
- run: yarn test
18+
- run: yarn build

dist/neovis-without-dependencies.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/neovis-without-dependencies.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/neovis.js

Lines changed: 2 additions & 103 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/neovis.js.LICENSE.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*! *****************************************************************************
2+
Copyright (c) Microsoft Corporation.
3+
4+
Permission to use, copy, modify, and/or distribute this software for any
5+
purpose with or without fee is hereby granted.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13+
PERFORMANCE OF THIS SOFTWARE.
14+
***************************************************************************** */
15+
16+
/*! Hammer.JS - v2.0.17-rc - 2019-12-16
17+
* http://naver.github.io/egjs
18+
*
19+
* Forked By Naver egjs
20+
* Copyright (c) hammerjs
21+
* Licensed under the MIT license */
22+
23+
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */

dist/neovis.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/advanced-example.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@
3838
function draw() {
3939
var config = {
4040
container_id: 'viz',
41-
server_url: 'bolt://34.201.68.240:38312',
42-
server_user: 'neo4j',
43-
server_password: 'gland-presentation-worry',
41+
neo4j: {
42+
server_url: 'bolt://localhost:7687',
43+
server_user: 'neo4j',
44+
server_password: 'gland-presentation-worry',
45+
},
4446
labels: {
4547
//"Character": "name",
4648
'Character': {

index.d.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { DataSet } from "vis-data";
2-
import { Node as VisNode, Edge as VisEdge } from "vis-network";
3-
import { Node as Neo4jNode, Relationship as Neo4jRelationship } from "neo4j-driver";
1+
import {Node as VisNode, Edge as VisEdge, Options as visNetworkOptions, DataSet, Network} from "vis-network";
2+
import { Node as Neo4jNode, Relationship as Neo4jRelationship, Driver as Neo4jDriver } from "neo4j-driver";
43

54
export const NEOVIS_DEFAULT_CONFIG: unique symbol;
65
export const NEOVIS_ADVANCED_CONFIG: unique symbol;
@@ -31,10 +30,15 @@ export interface IRelationshipConfig extends RecursiveMapTo<VisEdge, string>{
3130

3231
export interface INeovisConfig {
3332
container_id: string;
34-
server_url: string;
35-
server_user: string;
3633
server_database: string;
37-
server_password: string;
34+
neo4j: Neo4jDriver | {
35+
server_url: string;
36+
server_user: string;
37+
server_password: string;
38+
encrypted?: "ENCRYPTION_OFF" | "ENCRYPTION_ON";
39+
trust?: "TRUST_ALL_CERTIFICATES" | "TRUST_SYSTEM_CA_SIGNED_CERTIFICATES";
40+
};
41+
visConfig: visNetworkOptions;
3842
labels?: {
3943
[label: string]: ILabelConfig,
4044
[NEOVIS_DEFAULT_CONFIG]?: IRelationshipConfig
@@ -43,13 +47,8 @@ export interface INeovisConfig {
4347
[relationship: string]: IRelationshipConfig,
4448
[NEOVIS_DEFAULT_CONFIG]?: IRelationshipConfig
4549
};
46-
arrows?: boolean;
47-
hierarchical?: boolean;
48-
hierarchical_sort_method?: "hubsize" | "directed";
4950
initial_cypher?: string;
5051
console_debug?: boolean;
51-
encrypted?: "ENCRYPTION_OFF" | "ENCRYPTION_ON";
52-
trust?: "TRUST_ALL_CERTIFICATES" | "TRUST_SYSTEM_CA_SIGNED_CERTIFICATES";
5352
}
5453

5554
export interface INode extends VisNode {
@@ -64,6 +63,7 @@ declare class Neovis {
6463
constructor(config: INeovisConfig);
6564
get nodes(): DataSet<INode>;
6665
get edges(): DataSet<IEdge>;
66+
get network(): Network;
6767
render(): void;
6868
clearNetwork(): void;
6969
registerOnEvent(eventType: string, handler: (event: any) => void): void;

package.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,32 +36,32 @@
3636
},
3737
"homepage": "https://github.com/neo4j-contrib/neovis.js#readme",
3838
"devDependencies": {
39-
"@babel/cli": "^7.8.4",
40-
"@babel/core": "^7.8.4",
41-
"@babel/plugin-proposal-class-properties": "^7.8.3",
42-
"@babel/plugin-transform-runtime": "^7.8.3",
43-
"@babel/preset-env": "^7.8.4",
44-
"babel-eslint": "^10.0.3",
45-
"babel-loader": "^8.0.6",
46-
"cross-env": "^7.0.0",
47-
"css-loader": "^3.4.2",
48-
"eslint": "^6.8.0",
49-
"eslint-plugin-jest": "^23.6.0",
50-
"file-loader": "^5.0.2",
51-
"jest": "^26.6.2",
52-
"jest-canvas-mock": "^2.2.0",
39+
"@babel/cli": "^7.12.13",
40+
"@babel/core": "^7.12.13",
41+
"@babel/eslint-parser": "^7.12.13",
42+
"@babel/plugin-proposal-class-properties": "^7.12.13",
43+
"@babel/plugin-transform-runtime": "^7.12.15",
44+
"@babel/preset-env": "^7.12.13",
45+
"babel-loader": "^8.2.2",
46+
"cross-env": "^7.0.3",
47+
"css-loader": "^5.0.1",
48+
"eslint": "^7.19.0",
49+
"eslint-plugin-jest": "^24.1.3",
50+
"file-loader": "^6.2.0",
51+
"jest": "^26.6.3",
52+
"jest-canvas-mock": "^2.3.1",
5353
"npm-run-all": "^4.1.5",
54-
"rimraf": "^3.0.1",
55-
"style-loader": "^1.1.3",
56-
"url-loader": "^3.0.0",
57-
"webpack": "^4.41.5",
58-
"webpack-cli": "^3.3.10"
54+
"rimraf": "^3.0.2",
55+
"style-loader": "^2.0.0",
56+
"url-loader": "^4.1.1",
57+
"webpack": "^5.21.2",
58+
"webpack-cli": "^4.5.0"
5959
},
6060
"dependencies": {
61-
"@babel/runtime-corejs3": "^7.8.4",
61+
"@babel/runtime-corejs3": "^7.12.13",
62+
"deepmerge": "^4.2.2",
6263
"neo4j-driver": "^4.1.0",
63-
"vis-data": "^7.0.0",
64-
"vis-network": "^7.3.5"
64+
"vis-network": "^9.0.2"
6565
},
6666
"jest": {
6767
"moduleNameMapper": {

0 commit comments

Comments
 (0)