Coder Social home page Coder Social logo

archsaber / mg-line-brushing Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dandehavilland/mg-line-brushing

0.0 5.0 0.0 252 KB

A stepwise brushing extension for line charts in metrics-graphics.

License: MIT License

JavaScript 71.00% HTML 19.14% CSS 9.87%

mg-line-brushing's Introduction

mg-line-brushing

A extension to metrics-graphics which adds step-wise brushing support to line charts.

Requires metrics-graphics >= v2.5

Caveats

This addon currently only supports the aggregated rollover. When including this addon, args.aggregate_rollover will automatically be set to true.

While it does work with the voronoi setup, d3 raises a few errors in the console, so additional work is required for that. (A PR is more than welcome!)

Usage

Install using bower:

  • bower install mg-line-brushing --save

Include dist/mg_line_brushing.js in your build, or include it in your HTML:

  • <script src="bower_components/mg-line-brushing/dist/mg_line_brushing.js"></script>

Import the default styles from dist/mg_line_brushing.css, or create your own:

  • <link rel="stylesheet" href="bower_components/mg-line-brushing/dist/mg_line_brushing.css" type="text/css" />

Options

Option Default Notes
brushing true Enable this addon.
brushing_history true Enables the stepwise zoom-out. This introduces an element of statefulness into the chart, which can be unhelpful in certain cirumstances. If you are managing state manually, set this to false.
after_brushing null An optional callback which is triggered after brushing. E.g. args.after_brushing = function(step) { console.log(step); }. The sole paramter passed to the callback is step, an object consisting of the new bounds for the chart: {min_x: ..., max_x: ..., min_y: ..., max_y: ...}
brushing_manual_redraw false If true, this will prevent the chart being redrawn. Useful if you want to defer the update until you're ready. Simply call MG.data_graphic(args); to trigger a redraw.

Requirements

Contributing

Found a bug or have an idea for a new feature? File an issue or, better still, submit a PR :

  1. Code your fix / feature.
  2. Write some tests.
  3. Submit a PR.

mg-line-brushing's People

Contributors

dandehavilland avatar

Watchers

James Cloos avatar  avatar opavader avatar Arpit Jain avatar  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.