Commit 096bf593 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

js_api: very simple POC working :)

parent 430edf33
Loading
Loading
Loading
Loading
+0 −50
Original line number Diff line number Diff line
@@ -467,56 +467,6 @@ h1.head{ margin-top:70px; }
.gauge_viewport{ margin-top:30px; }


.rickshaw_graph .y_ticks path { stroke:#fff; }
.rickshaw_graph .y_grid .tick { stroke:rgba(0,0,0,.1); }

.rickshaw_graph .x_tick {
  border-left: none;
}

.rickshaw_graph .x_tick.glow .title, .rickshaw_graph .y_ticks.glow text{
  font-size:14px;
}

.rickshaw_legend {
font-family: "Gotham Narrow", Helvetica, sans-serif;
font-size: 12px;
color: #333;
background: none;
display: inline-block;
padding: 12px 5px;
border-radius: 2px;
position: relative;
}

.rickshaw_legend .ui-sortable {
  margin-left:-10px;
}

.rickshaw_legend li.line{
   float:left;
   clear:none;
   padding-right:0;
}

.rickshaw_legend a.action{
  margin-right:5px;
  display:none;
}


.rickshaw_legend li.line .label{
  font.size:14px;
  margin-left:5px;
  color:#333;
  position:relative;
  top:-1px;
}


.rickshaw_graph .y_grid .tick { stroke:rgba(0,0,0,.15); stroke-dasharray:0; }
.rickshaw_graph .y_ticks text { fill:#333333; }

.modal_backdrop {
  background-color: #000000;
  position: fixed;
+50 −0
Original line number Diff line number Diff line
.rickshaw_graph .y_ticks path { stroke:#fff; }
.rickshaw_graph .y_grid .tick { stroke:rgba(0,0,0,.1); }

.rickshaw_graph .x_tick {
  border-left: none;
}

.rickshaw_graph .x_tick.glow .title, .rickshaw_graph .y_ticks.glow text{
  font-size:14px;
}

.rickshaw_legend {
font-family: "Gotham Narrow", Helvetica, sans-serif;
font-size: 12px;
color: #333;
background: none;
display: inline-block;
padding: 12px 5px;
border-radius: 2px;
position: relative;
}

.rickshaw_legend .ui-sortable {
  margin-left:-10px;
}

.rickshaw_legend li.line{
   float:left;
   clear:none;
   padding-right:0;
}

.rickshaw_legend a.action{
  margin-right:5px;
  display:none;
}


.rickshaw_legend li.line .label{
  font.size:14px;
  margin-left:5px;
  color:#333;
  position:relative;
  top:-1px;
}


.rickshaw_graph .y_grid .tick { stroke:rgba(0,0,0,.15); stroke-dasharray:0; }
.rickshaw_graph .y_ticks text { fill:#333333; }
+1 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
    %script{:src => "/js/fnordmetric.session_view.js", :type => "text/javascript"}
    %link{:href => "/vendor/rickshaw.css", :rel => "stylesheet", :type => "text/css"}
    %link{:href => "/vendor/font-awesome/css/font-awesome.css", :rel => "stylesheet", :type => "text/css"}
    %link{:href => "/fnordmetric.rickshaw.css", :rel => "stylesheet", :type => "text/css"}
    %link{:href => "/fnordmetric.css", :rel => "stylesheet", :type => "text/css"}

  %body
+15 −1
Original line number Diff line number Diff line
@@ -6,22 +6,36 @@ var FnordMetric = (function(){
    '/js/fnordmetric.js',
    '/js/fnordmetric.util.js',
    '/js/fnordmetric.ui.js',
    '/js/fnordmetric.timeline_widget.js',
    '/js/fnordmetric.timeseries_widget.js',
    '/js/fnordmetric.js_api.js'
  ];

  var require_css = [
    '/vendor/rickshaw.css',
    '/fnordmetric.rickshaw.css'
  ];

  var setup = function(opts){
    if (typeof $ == 'undefined') {
      console.log("error: FnordMetric requires jQuery 1.6.2+");
      return;
    }

    if (typeof $.ui == 'undefined') {
      console.log("error: FnordMetric requires jQuery UI");
      return;
    }

    FnordMetric.currentNamespace = opts.namespace;
    FnordMetric.ws_addr = "ws://" + opts.address + "/stream";

    for (n=0; n < require.length; n++)
      document.write('<script type="text/javascript" src="' + (
        "http://" + opts.address + require[n]) + '"></script>');

    for (n=0; n < require_css.length; n++)
      document.write('<link type="text/css" rel="stylesheet" href="' + (
        "http://" + opts.address + require_css[n]) + '" />');
  }


+0 −1
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@ var FnordMetric = (function(pre_init){
    currentNamespace = pre_init.currentNamespace;
    ws_addr = pre_init.ws_addr;
    $(document).ready(function(){
      FnordMetric.js_api.init();
      js_api = FnordMetric.js_api;
      connect();
    });
Loading