Be array<int> friendly.
[dygraphs.git] / experimental / palette / options.js
index 56d5156..7d15670 100644 (file)
 
 "use strict";
 
+/**
+ * Options availabile to the palette.
+ *
+ * Each entry is the name of the option, followed by:
+ * type: describes the type of option, which can be:
+ *   boolean|string|float|int|array<boolean>|array<int>|array<float>|array<Date>
+ *   or function(parameter list)
+ * scope: if empty, then available in global scope only. Otherwise,
+ * it's an array with possible values global|series|x|y|y2|highlight.
+ */
 var opts = {
+  // These two exist, but are not used by the palette at all.
+  series : { type : null, scope : [] },
+  axes : { type : null, scope : [] },
+
   animatedZooms : {
     type : "boolean"
   },
@@ -46,22 +60,32 @@ var opts = {
     type : "boolean"
   },
   axisLabelColor : {
-    type : "string"
+    type : "string",
+    // scope : [ "x", "y", "y2" ]
   },
   axisLabelFontSize : {
-    type : "int"
+    type : "int",
+    // scope : [ "x", "y", "y2" ]
+  },
+  axisLabelFormatter : {
+    type : "function(numberOrDate, granularity, opts, dygraph)",
+    scope : [ "x", "y", "y2" ]
   },
   axisLabelWidth : {
-    type : "int"
+    type : "int",
+    // scope : [ "x", "y", "y2" ]
   },
   axisLineColor : {
-    type : "string"
+    type : "string",
+    // scope : [ "x", "y", "y2" ]
   },
   axisLineWidth : {
-    type : "int"
+    type : "int",
+    // scope : [ "x", "y", "y2" ]
   },
   axisTickSize : {
-    type : "int"
+    type : "int",
+    // scope : [ "x", "y", "y2" ]
   },
   clickCallback : {
     type : "function(e, x, points)"
@@ -103,13 +127,16 @@ var opts = {
     type : "boolean"
   },
   drawHighlightPointCallback : {
-    type : "function(g, seriesName, canvasContext, cx, cy, color, pointSize)"
+    type : "function(g, seriesName, canvasContext, cx, cy, color, pointSize)",
+    scope : [ "global", "series", "y", "y2" ]
   },
   drawPoints : {
-    type : "boolean"
+    type : "boolean",
+    scope : [ "global", "series", "y", "y2" ]
   },
   drawPointCallback : {
-    type : "function(g, seriesName, canvasContext, cx, cy, color, pointSize)"
+    type : "function(g, seriesName, canvasContext, cx, cy, color, pointSize)",
+    scope : [ "global", "series", "y", "y2" ]
   },
   drawXAxis : {
     type : "boolean"
@@ -151,7 +178,8 @@ var opts = {
     type : "function(event, x, points,row)"
   },
   highlightCircleSize : {
-    type : "int"
+    type : "int",
+    scope : [ "global", "series", "y", "y2" ]
   },
   includeZero : {
     type : "boolean"
@@ -202,7 +230,8 @@ var opts = {
     type : "function(e, point)"
   },
   pointSize : {
-    type : "integer"
+    type : "integer",
+    scope : [ "global", "series", "y", "y2" ]
   },
   rangeSelectorHeight : {
     type : "int"
@@ -241,16 +270,20 @@ var opts = {
     type : "boolean"
   },
   strokeBorderColor : {
-    type : "string"
+    type : "string",
+    scope : [ "global", "series", "y", "y2" ]
   },
   strokeBorderWidth : {
-    type : "float"
+    type : "float",
+    scope : [ "global", "series", "y", "y2" ]
   },
   strokePattern : {
-    type : "array<integer>"
+    type : "array<int>",
+    scope : [ "global", "series", "y", "y2" ]
   },
   strokeWidth : {
-    type : "integer"
+    type : "float",
+    scope : [ "global", "series", "y", "y2" ]
   },
   timingName : {
     type : "string"
@@ -305,6 +338,6 @@ var opts = {
   },
   zoomCallback : {
     type : "function(minDate, maxDate, yRanges)"
-  },
+  }
 };