• Stars
    star
    2,881
  • Rank 15,750 (Top 0.4 %)
  • Language
    CSS
  • Created almost 13 years ago
  • Updated almost 11 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Graphene is a realtime dashboard & graphing toolkit based on D3 and Backbone.

Graphene

Graphene is a realtime dashboard & graphing toolkit based on D3 and Backbone.

It was made to offer a very aesthetic realtime dashboard that lives on top of Graphite (but could be tailored to any back end, eventually).

Combining D3's immense capabilities of managing live data, and Backbone's ease of development, Graphene provides a solution capable of displaying thousands upon thousands of datapoints in your dashboard, as well as presenting a very hackable project to build on and customize.

Getting Started

Currently, Graphene loves Graphite's data model (through its API).

To start,

$ git clone git://github.com/jondot/graphene.git
$ cd graphene

Running the Example

Use the /example dashboard to build on.

You should serve that folder off some kind of a helper webserver. For Ruby:

$ gem install serve
$ serve .

And open up your browser at http://localhost:4000/example/dashboard.html. You should see the dashboard alive, rigged with a demo data provider.

Setting up a Dev Env

This is a no brainer. You gotta have Ruby though; back to your root Graphene folder,

$ bundle install
$ bundle exec guard start

This gives you an autogenerated build when you modify stuff in app/css and app/js. Take note that dashboard.html points to the build folder where your assets are automatically built to.

Building a Dashboard

You are probably wondering how do you disconnect the demo data provider and plug the Graphite data source. Don't worry - more about it after this.

As of now, you can place 3 types of data-enabled widgets on your dashboard: TimeSeries, GaugeLabel, and a GaugeGadget
You can have as many of these as you want, and you can also hook up several widgets to the same data source.

To build a new dashboard, you can/should use the builder:

var g = new Graphene;
g.demo(); // hook up demo provider, override all urls.
g.build(description);

Where description will be the hardest thing you'll have to do here. It is a hash structure, note that urls (since we use demo provider) do nothing. Here:

description = {
  "Total Notifications": {
    source: "http://localhost:4567/",
    GaugeLabel: {
      parent: "#hero-one",
      title: "Notifications Served",
      type: "max"
    }
  },
  "Poll Time": {
    source: "http://localhost:4567/",
    GaugeGadget: {
      parent: "#hero-one",
      title: "P1"
    }
  },
  "<just an informative label>": {
    source: "<graphite graph url, add &format=json to querystring>",
    "<widget type>": {
      parent: "<which will be placed in this element>",
      title: "<title>"
      // ... many other view opts ...
    }
  }
}

That's it basically. Advise the example for how your page should be structured.

Using Real Data

Lets see how to hook up a Graphite data source. You should first have an idea of how your dashboard looks like in "standard" graphite dashboard.

This means you can go ahead and build (or use) your dash with the "standard" dashboard tool that Graphite provides.

Cross-Domain

In any case, if you don't have your dashboard on the Graphite domain, you might have a cross-domain issue. In this case please set up your Chrome browser with google-chrome --disable-web-security.

Graphite Data API

Then, given that you saved your Graphite dashboard named resources, fetch this URL:

http://<graphite>/dashboard/load/resources

You should see a JSON structure which contain these:

/render?from=-2hours&until=now&width=400&height=250&target=some.metric&title=my_metric

Use that query. Append &format=json to it and you've got a Graphene-ready URL!

http://<graphite>/render?from=-2hours&until=now&width=400&height=250&target=some.metric&title=my_metric&format=json

Autodiscovery

If all you really want is to migrate your Graphite "old" dash, a good starting point would be with discover(), which will take all of your timeseries and convert to a dashboard running Graphene TimeSeries:

var g = new Graphene;
g.discover('http://my.graphite.host.com', 'dev-pollers', function(i, url){ return "#dashboard"; }, function(description){
  g.build(description);
  console.log(description);
});

You should specify graphite host, dashboard name, a parent specifier which is responsible to spit out the next graph parent, and a result callback.

You can also use the description result as a starting point for building a more elaborate dashboard.

Check out an example at /examples/dashboard-autodiscover.html

I Want More!

Since Graphene is really a Backbone application (View, and Model, no Controller here), you should be aware that your data is fetched to a Model, munged on, and 'broadcasted' to interested parties (such as widgets).

This means you can take a look at the Model, and be able to configure it to your own needs. One example is specifying a refresh_interval.

It wouldn't make sense to poll on your Graphite backend frequently, if the data is updated slowly; turn refresh_interval up a notch.

Extra View options

You can drop any of the below options in the builder's dashboard description.

GaugeLabel

  • unit - unit to display, example "km", or "req/s"
  • title - the gauge title
  • type - how should data get aggregated?
    • max picks the largest value in the set of datapoints,
    • min picks the smallest value in the set of datapoints,
    • current picks the newest value in the set of datapoints,
    • null or no setting picks the first value in the set.
  • value_format - you can specify a value formatter (see d3)

GaugeGadget

  • title - again, gauge title
  • type - same as GaugeLabel
  • value_format - value format
  • from - start value of the gauge
  • to - end value of the gauge

TimeSeries

  • line_height - visuals, default 16
  • animate_ms - new data animation in
  • num_labels - max labels to display at the bottom
  • sort_labels - order labels will be sorted
  • display_verticals - display vertical ticks (eww!)
  • width - box width
  • height - box height
  • padding - the kind of padding you need
  • title - box title
  • label_formatter - and a formatter, as before.
  • ymax - the max value for the Y axis. If not specified and the URL has a yMax parameter, the value will be taken from the URL. Otherwise, this option will have precedence.
  • ymin - the min value for the Y axis.

Visuals

Good news, other than problems with managing TONS of data points, I avoided using common graphing libraries because it's kinda hard to fit to how they see the world in terms of styling.

Here you'll be able to just style with CSS. Most graph elements are SVG, and you already have a good example of a high-contrast styling that I use.

Futher SVG is vector graphics. Try stretching up your dashboard, and you'll find the quality of render isn't affected.

Applying just common CSS rules should give you everything that you need.

Colors

A good thing to think about is colors in your graph. In a time series, you'd want each graph to appear distinct from the other, but still keep a general notion of style (relate to the previous one).
To do that, I've generated colors based on HSL, taking the next color on the wheel serially, and keeping a good distance for a good contrast.
For more detail, see /tools

Roadmap

These significant features will happen in the following weeks:

  • Visual hints. Lower/upper threshold options for TimeSeries. Once a value passes above/below these, the Graph will give a visual cue (flashing, heartbeat)
  • RSS widget. Include a stream of events using an RSS feed; provide regex rules which cause RSS entries to be included, or be classified as various levels of alerts. The goal is to be able to incorporate source control history (GitHub events), and alert feeds from other systems.

Thanks!

I'd like to thank (chronological order):

  • Mike Bostock - for D3 itself, its awesome!. I found myself experimenting hours upon hours with it, but not caring about the time flying by at all.
  • Tomer Doron (tomerd) - for the awesome D3 gauge gadget example which I've customized and included here.
  • Chris Mytton (hecticjeff) - contributions
  • Michael Garski (mgarski) - contributions
  • dcartoon - JSONP cross domain support
  • Sean Kilgore (logikal) - contributions
  • arctanb - contributions
  • Dennis van der Vliet (dennisvdvliet) - bar graphs and other contributions
  • cognusion - contributions
  • David Fisher (tibbon) - README fixes
  • Jean-Louis Giordano (Jell) - contributions
  • Michael Lavrisha (vrish88)- "current" gauge type
  • EButlerIV - contributions
  • David CHAU (davidchau) - contributions
  • Phil Cohen (phlipper) - contributions

Contributing

Fork, implement, add tests, pull request, get my everlasting thanks and a respectable place here :).

Copyright

Copyright (c) 2012 Dotan Nahum @jondot. See MIT-LICENSE for further details.

More Repositories

1

awesome-react-native

Awesome React Native components, news, tools, and learning material!
JavaScript
33,342
star
2

hygen

The simple, fast, and scalable code generator that lives in your project.
JavaScript
5,610
star
3

react-flight

The best way to build animation compositions for React.
JavaScript
2,825
star
4

awesome-devenv

A curated list of awesome tools, resources and workflow tips making an awesome development environment.
2,622
star
5

sneakers

A fast background processing framework for Ruby and RabbitMQ
Ruby
2,246
star
6

goweight

A tool to analyze and troubleshoot a Go binary size.
Go
1,687
star
7

rust-how-do-i-start

Hand curated advice and pointers for getting started with Rust
1,055
star
8

ReactNativeKatas

This is a project that lets you participate in a fully-immersive, hands-on, and fun learning experience for React Native.
JavaScript
947
star
9

awesome-weekly

An "awesome" type curated list of quality weekly subscription newsletters from the software world
890
star
10

blade

Better asset workflow for iOS developers. Generate Xcode image catalogs for iOS / OSX app icons, universal images, and more.
Go
818
star
11

groundcontrol

Manage and monitor your Raspberry Pi with ease
Go
769
star
12

rn-snoopy

Snoopy is a profiling tool for React Native, that lets you snoop on the React Native Bridge.
JavaScript
523
star
13

react-native-slowlog

A high-performance timer based profiler for React Native that helps you track big performance problems.
JavaScript
374
star
14

awesome-rust-llm

🦀 A curated list of Rust tools, libraries, and frameworks for working with LLMs, GPT, AI
220
star
15

crunch

A fast to develop, fast to run, Go based toolkit for ETL and feature extraction on Hadoop.
Go
210
star
16

moxy

The programmable mock proxy
Ruby
120
star
17

webnull

web/null eats your HTTP
CoffeeScript
104
star
18

padrino-warden

A Padrino module that provides authentication for your Padrino application through Warden
Ruby
100
star
19

tauri-tray-app

A Tauri tray app starter 🦀
TypeScript
94
star
20

roundtrip

Simple tracking and metrics for your business processes in real-time
Ruby
89
star
21

awesome-aha

Awesome list for "Aha!" moments related to programming and computer science. Accelerate your learning.
82
star
22

nina

The friendly web microframework that performs!. Nina is a feature complete web microframework for the .Net platform, inspired by Sinatra
C#
70
star
23

frenzy_bunnies

RabbitMQ JRuby based worker framework on top of march_hare (hot_bunnies)
Ruby
70
star
24

redux-stack

Redux Stack is a library that helps you build modular, structured, and cleaner redux apps
JavaScript
67
star
25

storybook-cartesian

Automatically generate stories for all of your component variants
TypeScript
63
star
26

vitals

Flexible StatsD instrumentation for Rails, Rack, Grape and more
Ruby
51
star
27

version_bumper

Bump your versions
Ruby
47
star
28

logbook

Log your memories onto virtual logbooks made of Gists
Ruby
43
star
29

mediumize

Automatically post (and cross-post) your markdown style blog posts to your Medium account from Jekyll, Middleman, Hugo and others.
Ruby
40
star
30

nchurn

.Net based churn analyzer for your build
C#
37
star
31

awesome-designops

Awesome DesignOps is an awesome style list that curates the best design ops news, tools, tutorials, articles and more.
JavaScript
37
star
32

scatter

Ruby
35
star
33

benchmark-ipsa

An iterations per second enhancement to Benchmark that includes memory allocations
Ruby
32
star
34

go-cli-starter

A Go based command line interface starter app (CLI)
Go
32
star
35

fattyproject

Go
32
star
36

react-native-network-boot

An alternative way of bootstrapping development network bundling for React Native
JavaScript
31
star
37

awesome-beginners

A list that curates resources to help you teach your kids, wives, husbands, family or friends how to code
29
star
38

gulpjs-phaser

CSS
29
star
39

xtaskops

Goodies for working with the xtask concept in Rust
Rust
29
star
40

PrimerApp

JavaScript
25
star
41

groundcontrol-ui

JavaScript
25
star
42

attrs-serde

A serialization addon for attrs.
Python
24
star
43

passage

Personal, tiny, flexible, OpenID provider
Ruby
22
star
44

pgpipeline

A Scrapy pipeline module to persist items to a postgres table automatically.
Python
21
star
45

hygen-CRA

Perl 6
21
star
46

redux-duet

Redux action and handlers together, alleviate boilerplate.
JavaScript
20
star
47

langchain-llm-katas

This is a an open-source project designed to help you improve your skills with AI engineering using LLMs and the langchain library
Python
18
star
48

vscode-hygen

This extension bundles Hygen into VSCode and offers seamless code generator functionality right into your editor.
TypeScript
18
star
49

pcwr

Pragmatic Concurrency With Ruby
Ruby
17
star
50

castbox

A chromecast 1.0 emulator
Go
17
star
51

formation

A generic functional middleware infrastructure for Python.
Python
17
star
52

elb-dash

A self-updating ELB status board / dashboard built with React, Coffeescript and Node.js.
CoffeeScript
16
star
53

make-vscode-more-like-vim

Make VSCode more like vim
15
star
54

qtools

qtools are a set of tools to greatly ease your MSMQ operations, monitoring and deployment
C#
15
star
55

hygen-add

hygen-add is one of the tools in the Hygen toolbelt which allows you to add pre-made generator packages to your project.
JavaScript
14
star
56

deep-learning-parameters-cheatsheet

14
star
57

elasticsearch-balance

Visualize the data distribution of your Elastic Search cluster using a Treemap
JavaScript
13
star
58

darkness

JRuby with Swing WriteRoom/Darkroom-like editor.
Java
13
star
59

heatmapdotnet

Heatmap generator for .Net
C#
13
star
60

blade-sample

Swift
13
star
61

rawsort

A simple but powerful RAW photo import tool built to have amazing performance and integrate with photography workflows.
Rust
13
star
62

hypermatch

A fast, sandboxed micro matching engine with serializable rules.
JavaScript
12
star
63

cottonballs

Your own mock, fluffy version of GCM for testing purposes
CoffeeScript
12
star
64

packs

An open-source BoxJS/CSS/Etc clone, suitable for hosting at Heroku
JavaScript
12
star
65

rrgen

Rust
11
star
66

10bisbar

A bitbar plugin that helps you do the math for your 10bis account
Go
11
star
67

primer-bind

Go
11
star
68

dg

Check a folder for dirty git repositories, forgotten branches and commits
Rust
11
star
69

lidar

A take on ThoughtWorks' Radar. You can use this tool and system to make your very own technological Radar.
JavaScript
11
star
70

statsd-stack

A statsd Sprinkle stack
Ruby
11
star
71

react-rust-chrome-starter

Chrome extension template with Rust 🦀 and React using Vite and tailwind
TypeScript
11
star
72

celeste

An all-in-one tool for the repository maintainer.
JavaScript
10
star
73

statsd-cli

Simple Statsd command line interface
Ruby
10
star
74

jill

Jill is your README.md assistant
Ruby
10
star
75

dazzling

Dazzling is a project website generator based on Gatsby and React that's simple, quick, and extensible.
JavaScript
10
star
76

logolang.org

Retro LOGO with a modern twist. Built with Rust+WASM 🦀
TypeScript
10
star
77

firebase-simple-storage

An unofficial Go based client for Firebase storage that preserves security (goes through Firebase and not Google Cloud Storage).
Go
10
star
78

signup

Easy and lightweight signup service
Go
9
star
79

keymaps

Shell
9
star
80

gravy

Sweet sauce for your Gravatars: realtime gravatar manipulation with Node.JS
9
star
81

autobrew

Automate homebrew formula publishing for your CLI tools, regardless of programming language.
Go
9
star
82

webogram

Snap your web pages through Instagram inspired filters. You can use this to generate wallpapers for phone and desktop, icons, and book covers
JavaScript
9
star
83

goddamn-javascript-babel

A zero config package that gives you a bleeding edge Javascript, with the latest proposals including pipe operator foo |> bar, optional chaining foo?.bar, null coalescing foo ?? bar and more.
JavaScript
9
star
84

arper

A network utility and library for discovering network device via ARP scans, including vendor names.
Go
8
star
85

react-native-fs-walker

A React Native file system walker and file tree debugging tool
JavaScript
8
star
86

hypercontroller

A more civilized controller abstraction for TypeScript and Node.js. Hosts libraries for controllers built using hypergen
TypeScript
8
star
87

es-diag

Elastic Search health checks and problem discovery toolkit
Ruby
8
star
88

pocket-emails

A compact tool that sends digest emails from your Pocket account with Mailgun.
JavaScript
8
star
89

dash

Communicate to the mass with Dash on your TV/LCD/Plasma
JavaScript
8
star
90

armor

WIP - a pragmatic Go microservice framwork
Go
8
star
91

react-native-bundles

Hand-picked bundles of React Native libraries and components that go well together for any kind of app
8
star
92

react-redux-classconnect

JavaScript
7
star
93

react-native-group-image

A <GroupImage /> component for React Native. A group image will be responsive towards the amount of images it needs to display
JavaScript
7
star
94

serverless-zen

A serverless starter project focusing on uncompromising local development experience without serverless fatigue.
TypeScript
7
star
95

dotlinker

Use dotrunner and dotlinker to build a fantastically aesthetic macOS dotfiles set up.
Python
7
star
96

dotfiles

configuration files.
Vim Script
7
star
97

outpostapp

Flexible file upload app
JavaScript
7
star
98

appium-solo

Appium simplified: Run E2E tests with a dedicated appium instance per device.
JavaScript
6
star
99

stylomatic

Zero configuration for typescript, react, and more
JavaScript
6
star
100

mongomon

A Python mongodb monitor and profiler for development.
Python
6
star