github.com/sym3tri/etcd@v0.2.1-0.20140422215517-a563d82f95d6/mod/dashboard/app/ui/graph-config.js (about)

     1  'use strict';
     2  
     3  angular.module('etcd.ui').value('graphConfig', {
     4  
     5    'padding': {'top': 10, 'left': 5, 'bottom': 40, 'right': 10},
     6    'data': [
     7      {
     8        'name': 'stats'
     9      },
    10      {
    11        'name': 'thresholds',
    12        'values': [50, 100]
    13      }
    14    ],
    15    'scales': [
    16      {
    17        'name': 'y',
    18        'type': 'ordinal',
    19        'range': 'height',
    20        'domain': {'data': 'stats', 'field': 'index'}
    21      },
    22      {
    23        'name': 'x',
    24        'range': 'width',
    25        'domainMin': 0,
    26        'domainMax': 100,
    27        'nice': true,
    28        'zero': true,
    29        'domain': {'data': 'stats', 'field': 'data.latency.current'}
    30      },
    31      {
    32        'name': 'color',
    33        'type': 'linear',
    34        'domain': [10, 50, 100, 1000000000],
    35        'range': ['#00DB24', '#FFC000', '#c40022', '#c40022']
    36      }
    37    ],
    38    'axes': [
    39      {
    40        'type': 'x',
    41        'scale': 'x',
    42        'ticks': 6,
    43        'name': 'Latency (ms)'
    44      },
    45      {
    46        'type': 'y',
    47        'scale': 'y',
    48        'properties': {
    49          'ticks': {
    50            'stroke': {'value': 'transparent'}
    51          },
    52          'majorTicks': {
    53            'stroke': {'value': 'transparent'}
    54          },
    55          'labels': {
    56            'fill': {'value': 'transparent'}
    57          },
    58          'axis': {
    59            'stroke': {'value': '#333'},
    60            'strokeWidth': {'value': 1}
    61          }
    62        }
    63      }
    64    ],
    65    'marks': [
    66      {
    67        'type': 'rect',
    68        'from': {'data': 'stats'},
    69        'properties': {
    70          'enter': {
    71            'x': {'scale': 'x', 'value': 0},
    72            'x2': {'scale': 'x', 'field': 'data.latency.current'},
    73            'y': {'scale': 'y', 'field': 'index', 'offset': -1},
    74            'height': {'value': 3},
    75            'fill': {'scale':'color', 'field':'data.latency.current'}
    76          }
    77        }
    78      },
    79      {
    80          'type': 'symbol',
    81          'from': {'data': 'stats'},
    82          'properties': {
    83            'enter': {
    84              'x': {'scale': 'x', 'field': 'data.latency.current'},
    85              'y': {'scale': 'y', 'field': 'index'},
    86              'size': {'value': 50},
    87              'fill': {'value': '#000'}
    88            }
    89          }
    90        }
    91      ]
    92  
    93  });