Coder Social home page Coder Social logo

happi-graph's Introduction

happi-graph

Generic graph rendering solution.

props

  • actions (type: any, required, default: <></>)
    A collection of action buttons that can be implemented outside of the component.
  • algorithm (string, default: ELK)
    There are two algorithm used: ELK and VISJS. These are used to draw separately horizontal and/or vertical graphs.
  • debug (boolean, default: false)
    Flag used to log different information for debugging.
  • graphDirection (string, default: HORIZONTAL)
    Type of graph, horizontal or vertical. It determines the direction of the graph.
  • nodeCountLimit (number, default: 0)
    Property used to determine the zoom level.
  • nodeDistanceX (number, default: 350)
    Distance measured on X axis between nodes. Measured in pixels.
  • nodeDistanceY (number, default: 350)
    Distance measured on Y axis between nodes. Measured in pixels.
  • onGraphRender (Function, default: empty function)
    Handler used to execute a callback after the initial render of the graph.
  • onNodeClick (Function, default: empty function)
    Callback function used to handle click events on nodes.
  • printMode (boolean, default: false)
    Flag that prepares the component to be printed.
  • rawData (any, required, value: { nodes: [], edges: [] })
    Actual nodes and links data that will be displayed.
  • selectedNodeId (string, required, value: id)
    Id of the main node around which the graph is constructed.

Print mode for lineage

This mode enables to display only the lineage graph, without the action buttons and legend.

It can be activated by setting printMode, by default it is false.

Example

<HappiGraph rawData={{...rawData}}
            algorithm={""}
            debug={false}
            printMode={true}
            graphDirection={"VERTICAL"}
            selectedNodeId={"term@68e36496-7167-4af7-abdd-a0cd36e24084:6662c0f2.e1b1ec6c.66k78i6du.uchsna1.rn2epa.rfn2fjqf7h4qvmt5lflm8"}
            actions={<HappiGraphActions rawData={{...rawData}}/>}
            onNodeClick={(d: any) => console.log(d)}
            onGraphRender={() => { console.log('Graph rendered');}} />/>

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.