X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=inline;f=experimental%2Fpalette%2Fpalette.js;h=514463f554c45d374cb8ec6497c0b672c9133a12;hb=e4ddb639e116ae48dba0ab9c130feae6390eafa3;hp=a91c6ef7fca6b924eca0a86af7d9b7dd711e6e76;hpb=44885208a48a23f1e1a9e3bb867efdc94f1e5933;p=dygraphs.git diff --git a/experimental/palette/palette.js b/experimental/palette/palette.js index a91c6ef..514463f 100644 --- a/experimental/palette/palette.js +++ b/experimental/palette/palette.js @@ -25,104 +25,109 @@ */ "use strict"; -function Palette() { +/** + * scope is either "global", "series", "x", "y" or "y2". + */ +function Palette(scope) { + // Contains pair of "input" (the input object) and "row" (the parent row) + // Also contains functionString. this.model = {}; + // This is meant to be overridden by a palette host. this.onchange = function() {}; - this.filterBar = null; + this.scope = scope; + this.root = null; } -Palette.createChild = function(type, parentElement) { - var element = document.createElement(type); - parentElement.appendChild(element); - return element; -}; - -Palette.prototype.create = function(document, parentElement) { +Palette.prototype.create = function(parentElement) { var palette = this; - var table = Palette.createChild("div", parentElement); - table.className = "palette"; - table.width="300px"; + var table = $("