Git Product home page Git Product logo

hawkular-charts's Introduction

Hawkular Charting Directives

This project provides AngularJS directives for displaying visual representations of time series data as charts. It uses D3 as its charting toolkit and tries to simply creating metrics visualizations by using Angular.js.

About

The parent project that spurred this project is Hawkular - A Metrics engine based on Cassandra (there is also an embedded version of hawkular metrics). The console in Hawkular uses these charting components and will further push the development of these charting components into the future.

Charts

Charts

Don’t like the charts we have? Take one of the existing charts and modify (coming soon!)

How to Get

bower install hawkular-charts --save

Or

Download: hawkular-charts.js

Using the Charting Directives

Bind to a javascript array of metrics:

 <hawkular-chart
     data="{{vm.getChartDataFor(selectedMetric)}}"
     chart-type="{{vm.selectedChart.chartType}}"
     chart-height="250">
 </hawkular-chart>

The nice part of about using angular in the charting framework is that whenever the underlying data changes, watchers automatically load and re-render the chart (as well as any of the properties that may have changed like chart-type). This results in less code and more productivity.

Prerequisite setup:
  1. Add the hawkular-charts.css to the main index.html page

  2. Add the charting module to the application module: app.module('myApp', ['hawkularCharts']);

All that’s left to do now is select the chart type and bind the data attribute on the <hawkular-chart> directive.

Stand Alone Live Updating Tag Example

Want to add some dynamically updating charts to your own pages?

The stand alone version of the tag allows for linking to hawkular-metrics servers (or any supplier of formatted metric data) without any dependencies except for a few js libs and 2 lines of script to setup an Angular app.

<hawkular-chart
        chart-type="bar"
        metric-id="server2.cpu.user"
        metric-url="http://127.0.0.1:8080/hawkular/metrics"
        time-range-in-seconds="86400002"
        refresh-interval-in-seconds="30"
        chart-height="250" >
</hawkular-chart>

This allows plain html web pages to be sprinkled with tags and a couple js libs and you can have dynamic live updating metrics. Great for NOCs or dashboards. These pages can even be emailed around and then thrown behind an http server for viewing.

Sample Stand Alone Example Page: stand-alone-chart-sample.html This allows dashboard templates to be emailed around (although they need to be rendered behind a http server of your choice).

Stand Alone Charting Explained

Stand alone charting explained

Chart Customization

This project is built around customization. There are several forms of customization:
  • Most cosmetic issues are controlled via standard css through the hawkular-charts.css.

  • Custom Chart types: Soon!

  • Custom Indicators: Soon!

Building the Project

You have to install required software before you’re able to use grunt to build:
  • Install Node.js - Find more information on Node.js

    • Install npm - If npm is not already installed with Node.js, you have to install it manually. Find more information on npm

  • Install Gulp and Bower globally: npm install -g bower gulp

  • Install npm dependencies with: npm install

  • Install bower dependencies with: bower install

The environment is now ready to be built.

The hawkular Charts directives can be built with: gulp. Only the one command is needed as building is so fast that a watcher task is not necessary.

The resulting javascript file is placed in the root directory as hawkular-charts.js

Contributing

We’re always interested in contributions from the community.

Please ensure that your Pull Request provides the following:
  • Detailed description of the proposed changes

  • Rebased onto the latest master commit

  • This is a Typescript project, so please submit the typescript source (not the javascript source)

hawkular-charts's People

Contributors

ammendonca avatar mtho11 avatar pilhuhn avatar

Watchers

 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.