Git Product home page Git Product logo

cubism-es's Introduction

cubism-es

cubism-es is an ES6 module of cubism, based on D3V5.

IMPORTANT Version 1.1.0 contains api breaks. Please see below for details

Usage:

  1. ES6 Usage
npm install cubism-es --save
import { context } from 'cubism-es';

Please note adding cubism-es will automatically add d3 as a dependency into your project. From version 1.1.2, there's no need to declare d3 as globals in your project with the webpack ProvidePlugin

  1. Standalone Usage
<script src="lib/d3.v5.min.js" charset="utf-8" type="application/javascript"></script>
<script src="lib/cubism-es.standalone.js" charset="utf-8" type="application/javascript"></script>

API Breaks (v1.1.0)

function cubism cubism-es
Context.axis d3.select(...).call(context.axis) context.axis().render(d3.select(...))
Context.rule d3.select(...).call(context.rule) context.rule().render(d3.select(...))
Context.horizon d3.select(...).call(context.horizon) context.horizon().render(d3.select(...))

API Breaks (v1.0.0 and previous)

function cubism cubism-es
Context d3.select(...).call(cubism.context) const context = cubism.context(d3.select(...)).height(30)
Context.axis d3.select(...).call(context.axis) context.axis(d3.select(...))
Context.rule d3.select(...).call(context.rule) context.rule(d3.select(...))
Context.horizon d3.select(...).call(context.horizon) context.horizon(d3.select(...))

Demo

the following samples work, you can try them by downloading this project and running npm install and npm run dev:

Development

  1. Clone repository
  2. Run commands
npm install         // install dependencies
npm run dev         // view demos in web browser at localhost:3004
npm run build       // build
npm run test        // run tests only
npm run test:cover  // run tests and view coverage report

Documentation

For more information, please visit square/cubism's home page and wiki

Limitation

Graphite, Cube and GangliaWeb have not been verified yet.

Credits

Contributors of the original cubism.

License

This project is licensed under the MIT License - see the LICENSE file for details

cubism-es's People

Contributors

bigfatdog 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

Watchers

 avatar  avatar  avatar

cubism-es's Issues

Is zooming possible?

Thanks a lot for your great work in keeping cubism alive!

I was wondering if it is realistically possible to implement interactive zooming in and out of the timeline on top of cubism? Ideally it would switch to higher resolution time buckets as you zoom in, and lower resolution as you zoom out, according to predefined thresholds.

I know this is not a built-in feature, but maybe it's possible in combination with d3-zoom or something like that.

horizon.height is broken

Expected Behavior

horizon.height([pixels]) should set the horizon height when passed a value.

Current Behavior

The height remains 30px.

Steps to Reproduce

  1. Open one of the demos of the repository, like stock.html or simple.html
  2. Change the height of a horizon chart:
    context.horizon(d3.selectAll(".horizon")).height(120)

NPM install errors and vulnerabilities

Current Behavior

When cloning the repo and running npm install, the following errors are thrown:

node-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.2/fse-v1.1.2-node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Tried to download(undefined): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.2/fse-v1.1.2-node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI) (falling back to source compile with node-gyp)

and

found 511 vulnerabilities (486 low, 17 moderate, 7 high, 1 critical)

Steps to Reproduce

  1. Clone the repo;
  2. Run npm install.

Context (Environment)

I'm on MacOS Mojave 10.14.1.

Upgrading to D3V6

The latest version of cubism-es is incompatible with the latest D3 library version realised last September, namely one of the issues is the API change around d3-selection new event manager (d3.mouse -> d3.pointer).

Is there a plan to upgrade?
If wanted, I can submit a pull request with the changes necessary to both the library and demos.

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.