All Projects → kitten → Rxjs Diagrams

kitten / Rxjs Diagrams

Licence: cc0-1.0
React Components for visualising RxJS observables and operators

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Rxjs Diagrams

Bloc.js
A predictable state management library that helps implement the BLoC design pattern in JavaScript
Stars: ✭ 111 (-11.9%)
Mutual labels:  rxjs, react-components
Angular Rpg
RPG game built with Typescript, Angular, ngrx/store and rxjs
Stars: ✭ 120 (-4.76%)
Mutual labels:  rxjs
React Native Firebase Chat
React Native chat application using firebase.
Stars: ✭ 113 (-10.32%)
Mutual labels:  react-components
Rxjs In Action
Code sample repository
Stars: ✭ 117 (-7.14%)
Mutual labels:  rxjs
Types First Ui
An opinionated framework for building long-lived, maintainable UI codebases
Stars: ✭ 114 (-9.52%)
Mutual labels:  rxjs
React Lazy
Universal lazy loader components using IntersectionObserver for React
Stars: ✭ 118 (-6.35%)
Mutual labels:  react-components
React Native Image Slider Box
A simple and fully customizable React Native component that implements an Image Slider UI.
Stars: ✭ 113 (-10.32%)
Mutual labels:  react-components
Reactivetradercloud
Real-time FX trading showcase by Adaptive.
Stars: ✭ 1,664 (+1220.63%)
Mutual labels:  rxjs
React Structured Data
React Structured Data provides an easy way to add structured data to your React apps
Stars: ✭ 120 (-4.76%)
Mutual labels:  react-components
Cyclejs
A functional and reactive JavaScript framework for predictable code
Stars: ✭ 9,996 (+7833.33%)
Mutual labels:  rxjs
Component Docs
📝 Simple documentation for your React components
Stars: ✭ 116 (-7.94%)
Mutual labels:  react-components
Batcave
Batcave client is chat app built with Electron and Angular2, Socket.io with RxJS.
Stars: ✭ 114 (-9.52%)
Mutual labels:  rxjs
Rxios
A RxJS wrapper for axios
Stars: ✭ 119 (-5.56%)
Mutual labels:  rxjs
Rough Charts
📈 A responsive, composable react charting library with a hand-drawn style.
Stars: ✭ 1,485 (+1078.57%)
Mutual labels:  react-components
React Rainbow
🌈 React Rainbow Components. Build your web application in a snap.
Stars: ✭ 1,662 (+1219.05%)
Mutual labels:  react-components
Gatsby Docs Kit
📃Easy to Maintain Markdown/React Documentation Static Websites
Stars: ✭ 117 (-7.14%)
Mutual labels:  react-components
React Workshop
⚒ 🚧 This is a workshop for learning how to build React Applications
Stars: ✭ 114 (-9.52%)
Mutual labels:  react-components
Orama
Plug and play React charts
Stars: ✭ 125 (-0.79%)
Mutual labels:  react-components
React Eva
Effects+View+Actions(React distributed state management solution with rxjs.)
Stars: ✭ 121 (-3.97%)
Mutual labels:  rxjs
Gakki
🌼🌸 A React Native App for Mastodon. 一个由React Native编写的长毛象客户端App🦋
Stars: ✭ 120 (-4.76%)
Mutual labels:  react-components

RxJS Diagrams

React Components for visualising RxJS observables and operators

RxJS Diagrams provides React Components for interactively visualising RxJS observables and operators. It is a rewrite (and redesign) of the amazing RxMarbles. The goal is to provide simple and reusable components for quickly explaining how RxJS works.

npm install --save rxjs-diagrams

Don't forget to install its peer dependencies, react and rxjs.

Usage

One input stream

This renders an SVG showing the input values and the result. The input values are converted to an observables and then transformed to an output using the transform prop.

import 'rxjs' // This imports all observables, operators, etc
import OperatorDiagram from 'rxjs-diagrams'

// Somewhere in your components...
<OperatorDiagram
  label=".distinctUntilChanged()"
  transform={obs => obs.distinctUntilChanged()}
  emissions={[
    { x: 5, d: 1 },
    { x: 35, d: 1 },
    { x: 70, d: 3 }
  ]}
  end={80}
  completion={80}
/>

Two input streams

Having multiple input streams is as simple as passing multiple value arrays and accepting them in your transform function.

import { Observable } from 'rxjs'
import OperatorDiagram from 'rxjs-diagrams'

// Somewhere in your components...
<OperatorDiagram
  label=".combineLatest((x, y) => '' + x + y)"
  transform={(a, b) => Observable.combineLatest(a, b, (x, y) => '' + x + y)}
  emissions={[
    [
      { x: 5, d: 1 },
      { x: 35, d: 2 },
      { x: 70, d: 3 }
    ], [
      { x: 10, d: 'A' },
      { x: 45, d: 'B' },
      { x: 80, d: 'C' }
    ]
  ]}
  end={80}
  completion={80}
/>

API

Exports:

  • transformEmissions
  • EmissionsView (Docs TODO)
  • TransitionEmissionsView (Docs TODO)
  • DraggableEmissionsView (Docs TODO)
  • ChainDiagram (Docs TODO)
  • OperatorDiagram (also the default export)

Emissions, End & Completion

The common three values that describe your input are: emissions, end, and completion. This is enough for this library to generate an input observable.

Emissions are an array of objects, which have a time value x and a label d. The value x must be a number. (Example: { x: 5, d: 'A' })

Completion is the time value when your observable completes. It is a number and usually you'll want it to be larger than all x values of your emissions.

End is where the component stops to draw your observable. It basically defines how long in time the diagram is. So if your end is 20 and an emission's x is 10, then the emission will be drawn right in the center.

OperatorDiagram

Props

  • label?: string: Some text that describes your transformation.

  • transform: (...input, scheduler): A function that transforms the input observables and produces an output. It receives the input observables as the first arguments and the scheduler last. You will need the scheduler to transform the virtual observable's time. For example for delay. More information on Schedulers here

  • emissions: Emission[] | Emission[][]: Here you can pass an array of emissions (described above) or an array of an array of emissions, in case you want multiple input observables.

  • end: number: Described above.

  • completion: number: Described above.

  • width: number: The width of the resulting SVG.

  • height: number: The height of the resulting SVG component.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].