1.0.8 • Published 6 years ago

floatingnodes v1.0.8

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

FloatingNodes

npm Travis Build License

Installation & Usage

npm install floatingnodes --save

Include the Component

import React from 'react'
import FloatingNodes from 'floatingnodes'

class Component extends React.Component {
  render() {
    return <FloatingNodes
      width={300}
      height={300}
    />
  }
}

This will produce something like this:
Example image

Props

keyprop type / notesexample
widthnumber (required)300
widthnumber (required)300
nodeParamsobjectsee #nodeParams
enableNodeDropbooltrue, false
nodeDropParamsobjectsee #nodeDropParams
enableInteractionbooltrue, false
interactiveNodeParamsobjectsee #nodeParams
initialNodeCountnumber25
movementUpdateTimenumber(every X seconds each nodes has a 50% chance to update their movement direction)0.7
enableOutOfBoundbool (out of bound nodes are getting a new random position)true, false
pauseAnimationbooltrue, false

#nodeParams

keyprop type / notesexample
colorarray (of numbers)[0,255,0,0.9]
speednumber (has no effect for interactiveNodeParams)0.1
radiusnumber (fixed radius)6
radiusRangeobject (random radius, has no effect if radius is defined, has no effect for interactiveNodeParams){min: 2, max: 8}
connectionSizenumber0.3
connectionColorarray (of numbers)[0,0,255]
connectionThresholdnumber120
connectionAlphaDivisornumber8
connectionStaticAlphabool/number (if not false connectionAlphaDivisor has no effect)false, 0.7

#nodeDropParams

keyprop type / notesexample
amountnumber (nodes per drop)3
limitnumber (removes nodes over limit, 0 means no limit)6
nodeDropParamsobjectsee #nodeParams
1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago