      1 'use strict';
      2
      3 import * as DygraphTickers from './dygraph-tickers';
      4 import DygraphInteraction from './dygraph-interaction-model';
      5 import DygraphCanvasRenderer from './dygraph-canvas';
      6 import * as utils from './dygraph-utils';
      7
      8 // Default attribute values.
      9 var DEFAULT_ATTRS = {
     10   highlightCircleSize: 3,
     11   highlightSeriesOpts: null,
     12   highlightSeriesBackgroundAlpha: 0.5,
     13   highlightSeriesBackgroundColor: 'rgb(255, 255, 255)',
     14
     15   labelsSeparateLines: false,
     16   labelsShowZeroValues: true,
     17   labelsKMB: false,
     18   labelsKMG2: false,
     19   showLabelsOnHighlight: true,
     20
     21   digitsAfterDecimal: 2,
     22   maxNumberWidth: 6,
     23   sigFigs: null,
     24
     25   strokeWidth: 1.0,
     26   strokeBorderWidth: 0,
     27   strokeBorderColor: "white",
     28
     29   axisTickSize: 3,
     30   axisLabelFontSize: 14,
     31   rightGap: 5,
     32
     33   showRoller: false,
     34   xValueParser: undefined,
     35
     36   delimiter: ',',
     37
     38   sigma: 2.0,
     39   errorBars: false,
     40   fractions: false,
     41   wilsonInterval: true,  // only relevant if fractions is true
     42   customBars: false,
     43   fillGraph: false,
     44   fillAlpha: 0.15,
     45   connectSeparatedPoints: false,
     46
     47   stackedGraph: false,
     48   stackedGraphNaNFill: 'all',
     49   hideOverlayOnMouseOut: true,
     50   resizable: 'no',
     51
     52   legend: 'onmouseover',
     53   legendFollowOffsetX: 50,
     54   legendFollowOffsetY: -50,
     55   stepPlot: false,
     56   xRangePad: 0,
     57   yRangePad: null,
     58   drawAxesAtZero: false,
     59
     60   // Sizes of the various chart labels.
     61   titleHeight: 28,
     62   xLabelHeight: 18,
     63   yLabelWidth: 18,
     64
     65   axisLineColor: "black",
     66   axisLineWidth: 0.3,
     67   gridLineWidth: 0.3,
     68   axisLabelWidth: 50,
     69   gridLineColor: "rgb(128,128,128)",
     70
     71   interactionModel: DygraphInteraction.defaultModel,
     72   animatedZooms: false,  // (for now)
     73   animateBackgroundFade: true,
     74
     75   // Range selector options
     76   showRangeSelector: false,
     77   rangeSelectorHeight: 40,
     78   rangeSelectorPlotStrokeColor: "#808FAB",
     79   rangeSelectorPlotFillGradientColor: "white",
     80   rangeSelectorPlotFillColor: "#A7B1C4",
     81   rangeSelectorBackgroundStrokeColor: "gray",
     82   rangeSelectorBackgroundLineWidth: 1,
     83   rangeSelectorPlotLineWidth:1.5,
     84   rangeSelectorForegroundStrokeColor: "black",
     85   rangeSelectorForegroundLineWidth: 1,
     86   rangeSelectorAlpha: 0.6,
     87   showInRangeSelector: null,
     88
     89   // The ordering here ensures that central lines always appear above any
     90   // fill bars/error bars.
     91   plotter: [
     92     DygraphCanvasRenderer._fillPlotter,
     93     DygraphCanvasRenderer._errorPlotter,
     94     DygraphCanvasRenderer._linePlotter
     95   ],
     96
     97   plugins: [ ],
     98
     99   // per-axis options
    100   axes: {
    101     x: {
    102       pixelsPerLabel: 70,
    103       axisLabelWidth: 60,
    104       axisLabelFormatter: utils.dateAxisLabelFormatter,
    105       valueFormatter: utils.dateValueFormatter,
    106       drawGrid: true,
    107       drawAxis: true,
    108       independentTicks: true,
    109       ticker: DygraphTickers.dateTicker
    110     },
    111     y: {
    112       axisLabelWidth: 50,
    113       pixelsPerLabel: 30,
    114       valueFormatter: utils.numberValueFormatter,
    115       axisLabelFormatter: utils.numberAxisLabelFormatter,
    116       drawGrid: true,
    117       drawAxis: true,
    118       independentTicks: true,
    119       ticker: DygraphTickers.numericTicks
    120     },
    121     y2: {
    122       axisLabelWidth: 50,
    123       pixelsPerLabel: 30,
    124       valueFormatter: utils.numberValueFormatter,
    125       axisLabelFormatter: utils.numberAxisLabelFormatter,
    126       drawAxis: true,  // only applies when there are two axes of data.
    127       drawGrid: false,
    128       independentTicks: false,
    129       ticker: DygraphTickers.numericTicks
    130     }
    131   }
    132 };
    133
    134 export default DEFAULT_ATTRS;
    135