Code Monkey home page Code Monkey logo

grafar's Introduction

Grafar 4

Psst! Check out the official docs

Grafar is a javascript library for reactive, 3D mathematical visualization (data visualization capabilities coming sometime). Built on top of WebGL (via Three.js). If you've ever struggled with displaying lots of stuff with conventional charting libraries (such as d3), grafar would be good for you. Another great features include:

  • Reactive data flow to easily build dynamic graphs.
  • Full, beautiful 3D.
  • High-level building blocks for math: with a single line of code you can create sets, ranges and sequences, and apply continuous maps to these. Currently limited to basic math primitives, fun stuff like statistics, DSP, and coming someday!
  • Advanced topology detection: get a surface by mapping a [0, 1] x [0, 1] or a set of curves from [0, 1] x {0, 1, 2}.
  • Ability to plug in any low-level buffer transform to do some crazy stuff.

MIT License

Installation

Use yarn add grafar or npm install grafar.

Links

Building from source

  1. Checkout latest stable release: git clone [email protected]:thoughtspile/Grafar.git.
  2. Install dependencies with npm install
  3. Have fun with my poor selection of npm scripts (npm run <script name>), ignore the warnings:
  • dev: build into /build/grafar.js and watch. No server.
  • build: build into /build/grafar.js. All the methods produce a UMD module.
  1. No automatic tests yet.

grafar's People

Contributors

thoughtspile avatar vkui-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grafar's Issues

Show error message when WebGL is not supported

Currently, grafar (threejs, to be precise) explodes in runtime when a browser does not support WebGL. Even though WebGL is well supported, an error message should be shown to the user. We should also allow custom error messages via a global setting.

Reanimate examples

The /examples folder has a ton of examples, but some are plain broken, some import grafar from the wrong place, and some are written for an older version. Moreover, some examples so similar there is no value in having both of them around. Once the examples are cleaned, we could turn them into a gallery a la d3 or threejs

This is a great place to start if you want to play with grafar and help the library move forward.

Touch-friendly panel controls

The orbit controls on 3d panels interfere with scrolling on mobile, as noted in the comments of the introductory hn post. It would be great to use some less invasive orbit gesture on touch devices, like a 2-finger pan.

Tree-shake lodash

We rely on lodash object (import * as _ from 'lodash'), which brings a lot of unneeded code to the project. It would be nice to either use native equivalents, eg _.extend -> Object.assign, or import get from 'lodash/get'. import { get } from 'lodash' would not cut it yet, since we don't have a es-module build.

Here's a list of 10 files currently using lodash

Update three.js

Three.js is currently at r128, while we're stuck with r81. It would be nice to upgrade for better performance and bugfixes. However, since three has probably had many breaking changes in the last 5 years, it might be best to go slow and upgrade gradually. Also see three's releases.

No hurry though, as the current version still works.

Add test infrastructure

I've been neglecting unit tests for far too long, and now it's time to fix this. It would be cool to add plain jest tests!

Support different cameras for rendering

Grafar uses THREE.PerspectiveCamera for rendering, and there is no way to override it. For some cases OrthographicCamera might work better.

Proposal: accept { camera: THREE.Camera } option in grafar.panel, defaulting to PerspectiveCamera

related: #2

Middle button pan?

This project looks amazing.

Enabling a middle button click to pan would feel super intuitive for those who regularly use popular 3d software.

Pan-by-default controls on 2D panels

2D panels use the same OrbitControl as 3D ones, but with fixed angle โ€” this means that they can only be scaled, not moved around. Panning would make much more sense as the default behavior

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.