Coder Social home page Coder Social logo

react-test's Introduction

react-graph-gl

This component is implemented to render large graph with interactive speed. It's a statelful react component, which means it changes the visualization result according to the props you passed into.

Usage

    return r.div({},[
      r(GraphGL, {
        graphData: graphData,
        setting: renderSetting,
        width: 1000,
        height: 1000
      })
    ]);

See example/main.js for a full example

API

graphData: (object)

The graph data.

width: (number)

The width of the container.

height: (number)

The height of the container.

setting: (object)

The rendering setting of the graph. Including three parts:

// example: 
  setting: {
    uniformSetting: {
      nodeSize: 5,
      nodeColor: [43, 140, 190, 255],
      nodeShape: 'circle',
      nodeBorderColor: [143, 140, 190, 255],
      nodeShowLabel: true,
      edgeThickness: 2.0,
      edgeColor: [200, 200, 200, 255],
      edgePattern: 'solid',
      edgeRouting: 'line',
      edgeShowLabel: true
    },
    dataMapping: {
      nodeSizeProperty: 'none',
      nodeSizeRange: [1, 20],
      nodeColorProperty: 'none',
      nodeColorMap: [
        {offset: 0, color: [0, 0, 255, 255]},
	    {offset: 0.5, color: [128, 0, 128, 255]},
	    {offset: 1, color: [255, 0, 0, 255]}
      ],
      edgeThicknessProperty: 'none',
      edgeThicknessRange: [0.1, 5.0],
      edgeColorProperty: 'none',
      edgeColorMap: [
        {offset: 0, color: [0, 0, 255, 255]},
        {offset: 0.5, color: [128, 0, 128, 255]},
        {offset: 1, color: [255, 0, 0, 255]}
      ]
    },
    individualMapping: [
      {id: 0, nodes: [2,5,6], nodeSize: 15, nodeColor: [255, 0, 0, 255]}
    ]
  }

The rednering result will change according to this setting.

Callback

function onNodeSelected (selectedNodes)

More related work to read

  1. Andrew Thall's Extended-Precision Floating-Point Numbers for GPU Computation.
  2. Improving precision in your vertex transform
  3. Double Precision in OpenGL and WebGL
  4. Heavy computing with GLSL โ€“ Part 2: Emulated double precision

To install

npm install

To run

npm run start

This will start a budo server running on localhost:9966.

react-test's People

Contributors

javidhsueh avatar

Stargazers

 avatar

Watchers

 avatar

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.