Git Product home page Git Product logo

ngx-graphexp's Introduction

ngx-graphexp

GraphExp plugin for Angular
Inspired by GraphExp

Installation

yarn -

yarn add @savantly/ngx-graphexp

npm -

npm install @savantly/ngx-graphexp  

Demo app

Demo

Usage

Import the required modules into your application

import { GraphexpModule, GraphexpService } from '@savantly/ngx-graphexp';
import { GremlinClientOptions } from '@savantly/gremlin-js';  

Create an instance of the GraphexpService, passing in a configuration object -

export const graphexpService = new GraphexpService(new GremlinClientOptions());  

Use the component in your application, passing in custom options -

import { GraphConfig, GraphexpService } from '@savantly/ngx-graphexp';
import { Component } from '@angular/core';

@Component({
  selector: 'sv-root',
  template: '<sv-graphexp [graphexpService]="service" [graphConfig]="graphConfig"></sv-graphexp>',
  styleUrls: ['./app.component.css']
})
export class AppComponent {

  graphConfig: GraphConfig = new GraphConfig();

  constructor (public service: GraphexpService) {
    this.graphConfig.nodeLabels = ['god', 'titan', 'demigod', 'human', 'monster', 'location'];
    this.graphConfig.linkLabels = ['is_father_of', 'has_pet', 'lives_in'];
  }

}

Default GraphConfig options

graphConfig.ts

Default GremlinClientOptions

gremlin.client.options.ts

Screenshots

example

menu

Select a label and add properties to the node
create node

shift-drag to create a new connection between nodes
drag link

Select the label and add properties to the link
create link

Build/Development

To build the library - use yarn or npm
yarn build:lib

To build the example app -
yarn build

Files are output to ./dist

ngx-graphexp's People

Contributors

caitlin-finn avatar jdbranham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ngx-graphexp's Issues

Build issues

I'm getting a lot of build errors. What are the required dependency versions (e.g. node, etc.)?

Not compatible after Angular 6

'mat-input-container' is deprecated

'mat-input-container' is not a known element:

  1. If 'mat-input-container' is an Angular component, then verify that it is part of this module.
  2. If 'mat-input-container' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("


    [ERROR ->]
    <input matInput name="searchValue" [(ngModel)]="searchValue" placeholder=""): ng:///GraphexpModule/GraphexpComponent.html@44:4

Data is not iterable

When I run the project using ng serve, I get this message and error when I try to create a new node in the graph:

extracted string from buffer: {"requestId":"2fee20d5-1336-8297-7d24-318bc4b2375b","status":{"message":"","code":200,"attributes":{"@type":"g:Map","@value":["host","/127.0.0.1:52485"]}},"result":{"data":{"@type":"g:List","@value":[{"@type":"g:Vertex","@value":{"id":{"@type":"g:Int64","@value":15},"label":"human","properties":{"tse":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"g:Int64","@value":16},"value":"13","label":"tse"}}]}}}]},"meta":{"@type":"g:Map","@value":[]}}}

gremlin.web.socket.js:88 preparing to excecute callback for request

core.js:1449 ERROR TypeError: data is not iterable
    at GremlinQuery.addResults (gremlin.query.js:14)
    at GremlinQuery.onMessage (gremlin.query.js:23)
    at GremlinWebSocket.onMessage (gremlin.web.socket.js:98)
    at WebSocket._ws.onmessage [as __zone_symbol__ON_PROPERTYmessage] (gremlin.web.socket.js:194)
    at WebSocket.wrapFn (zone.js:1332)
    at ZoneDelegate.invokeTask (zone.js:423)
    at Object.onInvokeTask (core.js:4751)
    at ZoneDelegate.invokeTask (zone.js:422)
    at Zone.runTask (zone.js:195)
    at ZoneTask.invokeTask [as invoke] (zone.js:498)

Why would this be?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.