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 
 51   legend: 'onmouseover',
 52   stepPlot: false,
 53   xRangePad: 0,
 54   yRangePad: null,
 55   drawAxesAtZero: false,
 56 
 57   // Sizes of the various chart labels.
 58   titleHeight: 28,
 59   xLabelHeight: 18,
 60   yLabelWidth: 18,
 61 
 62   axisLineColor: "black",
 63   axisLineWidth: 0.3,
 64   gridLineWidth: 0.3,
 65   axisLabelWidth: 50,
 66   gridLineColor: "rgb(128,128,128)",
 67 
 68   interactionModel: DygraphInteraction.defaultModel,
 69   animatedZooms: false,  // (for now)
 70 
 71   // Range selector options
 72   showRangeSelector: false,
 73   rangeSelectorHeight: 40,
 74   rangeSelectorPlotStrokeColor: "#808FAB",
 75   rangeSelectorPlotFillGradientColor: "white",
 76   rangeSelectorPlotFillColor: "#A7B1C4",
 77   rangeSelectorBackgroundStrokeColor: "gray",
 78   rangeSelectorBackgroundLineWidth: 1,
 79   rangeSelectorPlotLineWidth:1.5,
 80   rangeSelectorForegroundStrokeColor: "black",
 81   rangeSelectorForegroundLineWidth: 1,
 82   rangeSelectorAlpha: 0.6,
 83   showInRangeSelector: null,
 84 
 85   // The ordering here ensures that central lines always appear above any
 86   // fill bars/error bars.
 87   plotter: [
 88     DygraphCanvasRenderer._fillPlotter,
 89     DygraphCanvasRenderer._errorPlotter,
 90     DygraphCanvasRenderer._linePlotter
 91   ],
 92 
 93   plugins: [ ],
 94 
 95   // per-axis options
 96   axes: {
 97     x: {
 98       pixelsPerLabel: 70,
 99       axisLabelWidth: 60,
100       axisLabelFormatter: utils.dateAxisLabelFormatter,
101       valueFormatter: utils.dateValueFormatter,
102       drawGrid: true,
103       drawAxis: true,
104       independentTicks: true,
105       ticker: DygraphTickers.dateTicker
106     },
107     y: {
108       axisLabelWidth: 50,
109       pixelsPerLabel: 30,
110       valueFormatter: utils.numberValueFormatter,
111       axisLabelFormatter: utils.numberAxisLabelFormatter,
112       drawGrid: true,
113       drawAxis: true,
114       independentTicks: true,
115       ticker: DygraphTickers.numericTicks
116     },
117     y2: {
118       axisLabelWidth: 50,
119       pixelsPerLabel: 30,
120       valueFormatter: utils.numberValueFormatter,
121       axisLabelFormatter: utils.numberAxisLabelFormatter,
122       drawAxis: true,  // only applies when there are two axes of data.
123       drawGrid: false,
124       independentTicks: false,
125       ticker: DygraphTickers.numericTicks
126     }
127   }
128 };
129 
130 export default DEFAULT_ATTRS;
131