[ { "__docId__": 1, "kind": "external", "name": "Infinity", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Infinity", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 2, "kind": "external", "name": "NaN", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~NaN", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 3, "kind": "external", "name": "undefined", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~undefined", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 4, "kind": "external", "name": "null", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~null", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 5, "kind": "external", "name": "Object", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Object", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 6, "kind": "external", "name": "object", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~object", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 7, "kind": "external", "name": "Function", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Function", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 8, "kind": "external", "name": "function", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~function", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 9, "kind": "external", "name": "Boolean", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Boolean", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 10, "kind": "external", "name": "boolean", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~boolean", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 11, "kind": "external", "name": "Symbol", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Symbol", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 12, "kind": "external", "name": "Error", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Error", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 13, "kind": "external", "name": "EvalError", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~EvalError", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 14, "kind": "external", "name": "InternalError", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/InternalError", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~InternalError", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 15, "kind": "external", "name": "RangeError", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~RangeError", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 16, "kind": "external", "name": "ReferenceError", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~ReferenceError", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 17, "kind": "external", "name": "SyntaxError", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~SyntaxError", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 18, "kind": "external", "name": "TypeError", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~TypeError", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 19, "kind": "external", "name": "URIError", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~URIError", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 20, "kind": "external", "name": "Number", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Number", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 21, "kind": "external", "name": "number", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~number", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 22, "kind": "external", "name": "Date", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Date", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 23, "kind": "external", "name": "String", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~String", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 24, "kind": "external", "name": "string", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~string", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 25, "kind": "external", "name": "RegExp", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~RegExp", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 26, "kind": "external", "name": "Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 27, "kind": "external", "name": "Int8Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Int8Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 28, "kind": "external", "name": "Uint8Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Uint8Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 29, "kind": "external", "name": "Uint8ClampedArray", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Uint8ClampedArray", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 30, "kind": "external", "name": "Int16Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Int16Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 31, "kind": "external", "name": "Uint16Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Uint16Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 32, "kind": "external", "name": "Int32Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Int32Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 33, "kind": "external", "name": "Uint32Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Uint32Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 34, "kind": "external", "name": "Float32Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Float32Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 35, "kind": "external", "name": "Float64Array", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Float64Array", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 36, "kind": "external", "name": "Map", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Map", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 37, "kind": "external", "name": "Set", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Set", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 38, "kind": "external", "name": "WeakMap", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~WeakMap", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 39, "kind": "external", "name": "WeakSet", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~WeakSet", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 40, "kind": "external", "name": "ArrayBuffer", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~ArrayBuffer", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 41, "kind": "external", "name": "DataView", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~DataView", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 42, "kind": "external", "name": "JSON", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~JSON", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 43, "kind": "external", "name": "Promise", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Promise", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 44, "kind": "external", "name": "Generator", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Generator", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 45, "kind": "external", "name": "GeneratorFunction", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~GeneratorFunction", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 46, "kind": "external", "name": "Reflect", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Reflect", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 47, "kind": "external", "name": "Proxy", "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy", "memberof": "src/.external-ecmascript.js", "static": true, "longname": "src/.external-ecmascript.js~Proxy", "access": "public", "description": "", "builtinExternal": true }, { "__docId__": 48, "kind": "file", "name": "src/timeline.esdoc.js", "content": "/*!\n * Typedef for jQuery Timeline's ESDoc\n * @version: 2.1.0\n */\n\n/** @type {string} [NAME=\"Timeline\"] */\n/** @type {string} VERSION */\n/** @type {string} DATA_KEY */\n/** @type {string} EVENT_KEY */\n/** @type {string} PREFIX */\n/** @type {number} MIN_POINTER_SIZE */\n/** @type {Object} JQUERY_NO_CONFLICT */\n\n/**\n * In principle, this option conforms to the specification of options in \"Date.prototype.toLocaleString()\".\n * However, there includes some extensions of this plugin original.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString\n * \n * @typedef {Object} LocaleOptions\n * @property {boolean} [hour12=false] - Whether to use 12-hour time (as opposed to 24-hour time). Possible values are true and false.\n * @property {string} [localeMatcher] - \n * @property {string} [timeZone] - \n * @property {string} [hourCycle] - \n * @property {string} [formatMatcher] - \n * @property {string} [weekday] - The representation of the weekday. Possible values are \"narrow\", \"short\", \"long\".\n * @property {string} [era] - The representation of the era. Possible values are \"narrow\", \"short\", \"long\".\n * @property {string} [year] - The representation of the year. Possible values are \"numeric\", \"2-digit\". Then an extended value by this plugin is \"zerofill\".\n * @property {string} [month] - The representation of the month. Possible values are \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\".\n * @property {string} [day] - The representation of the day. Possible values are \"numeric\", \"2-digit\". Then an extended value by this plugin is \"ordinal\".\n * @property {string} [hour] - The representation of the hour. Possible values are \"numeric\", \"2-digit\". Then an extended value by this plugin is \"fulltime\".\n * @property {string} [minute] - The representation of the minute. Possible values are \"numeric\", \"2-digit\". Then an extended value by this plugin is \"fulltime\".\n * @property {string} [second] - The representation of the second. Possible values are \"numeric\", \"2-digit\". Then an extended value by this plugin is \"fulltime\".\n * @property {string} [timeZoneName] - The representation of the time zone name. Possible values are \"short\", \"long\".\n */\n\n/**\n * \n * @typedef {Object} Headline\n * @property {boolean} [display=true] - Whether to display headline\n * @property {string} [title] - \n * @property {boolean} [range=true] - Hide if false\n * @property {string} [locale=\"en-US\"] - This value is an argument \"locales\" of `dateObj.toLocaleString([locales[, options]])`\n * @property {LocaleOptions} [format] - This value is an argument \"options\" of `dateObj.toLocaleString([locales[, options]])`\n * @since 2.0.0\n */\n\n/**\n * \n * @typedef {Object} Footer\n * @property {boolean} [display=true] - Whether to display headline\n * @property {string} [content] - \n * @property {boolean} [range=false] - Visible if true\n * @property {string} [locale=\"en-US\"] - This value is an argument \"locales\" of `dateObj.toLocaleString([locales[, options]])`\n * @property {LocaleOptions} [format] - This value is an argument \"options\" of `dateObj.toLocaleString([locales[, options]])`\n * @since 2.0.0\n */\n\n/**\n * \n * @typedef {Object} Sidebar\n * @property {boolean} [sticky=false] - Whether does sticky the sidebar by using \"display: sticky\" of CSS.\n * @property {boolean} [overlay=false] - \n * @property {array.} [list] - Define the contents of the row of the sidebar. Appropriate escaping is necessary when using HTML.\n * @since 2.0.0\n */\n\n/**\n * Can define the ruler position to top or bottom and both\n * \n * @typedef {Object} RulerOptions\n * @property {array.} [lines] - Multiple tick marks can be set, and array elements are set in order from the top. Set same scale of Default.scale if omitted this. c.g. [ 'year', 'month', 'day', 'weekday' ]\n * @property {number} [height=30] - The height of a row of rulers\n * @property {number} [fontSize=14] - \n * @property {string} [color=\"#777777\"] - \n * @property {string} [background=\"#FFFFFF\"] - \n * @property {string} [locale=\"en-US\"] - This value is an argument \"locales\" of `dateObj.toLocaleString([locales[, options]])`\n * @property {LocaleOptions} [format] - This value is an argument \"options\" of `dateObj.toLocaleString([locales[, options]])`\n * @since 2.0.0\n */\n\n/**\n * You can set the upper and lower ruler individually\n *\n * @typedef {Object} Ruler\n * @property {RulerOptions} [top] - The upper ruler configuration. The upper ruler is hidden if omitted.\n * @property {RulerOptions} [bottom] - The lower ruler configuration. The lower ruler is hidden if omitted.\n * @since 2.0.0\n */\n\n/**\n *\n *\n * @typedef {Object} EventMeta\n * @property {boolean} [display=false] - \n * @property {string} [scale=\"day\"] - \n * @property {string} [locale=\"en-US\"] - This value is an argument \"locales\" of `dateObj.toLocaleString([locales[, options]])`\n * @property {LocaleOptions} [format] - This value is an argument \"options\" of `dateObj.toLocaleString([locales[, options]])`\n * @property {string} [content] - This is value for if you want to show custom content on the meta\n * @since 2.0.0\n */\n\n/**\n * Various effect settings to the timeline object displayed in the DOM\n *\n * @typedef {Object} Effects\n * @property {boolean} [presentTime=false] - Whether to show marking a present time on the timeline container.\n * @property {boolean} [hoverEvent=true] - Whether to show the effect when individual events on the timeline container are mouse over.\n * @property {boolean} [stripedGridRow=true] - \n * @property {string} [horizontalGridStyle=\"solid\"] - The style of horizontal grid line on the Timeline container. possible values are \"solid\", \"dotted\", \"none\".\n * @property {string} [verticalGridStyle=\"solid\"] - The style of vertical grid line on the Timeline container. possible values are \"solid\", \"dotted\", \"none\".\n * @since 2.0.0\n */\n\n/**\n * Color scheme to overwrite defaults UI color of the event node\n *\n * @typedef {Object} EventColors\n * @property {string} [text=\"#343A40\"] - Defaults to text color of the event node\n * @property {string} [border=\"#6C757D\"] - Defaults to border color of the event node\n * @property {string} [background=\"#E7E7E7\"] - Defaults to background color of the event node\n * @since 2.0.0\n */\n\n/**\n * Color scheme to overwrite defaults UI color of the timeline instance\n *\n * @typedef {Object} ThemeColors\n * @property {string} [name=\"default\"] - \n * @property {string} [text=\"#343A40\"] - Defaults to basic text color\n * @property {string} [subtext=\"#707070\"] - \n * @property {string} [offtext=\"#BBBBBB\"] - \n * @property {string} [modesttext=\"#969696\"] - \n * @property {string} [line=\"#6C757D\"] - Defaults to basic border color\n * @property {string} [offline=\"#DDDDDD\"] - \n * @property {string} [activeline=\"#DC3545\"] - \n * @property {string} [background=\"#FFFFFF\"] - Defaults to background color\n * @property {string} [invertbg=\"#121212\"] - \n * @property {string} [striped1=\"#F7F7F7\"] - \n * @property {string} [striped2=\"#F0F0F0\"] - \n * @property {string} [active=\"#F73333\"] - \n * @property {string} [marker=\"#2C7CFF\"] - \n * @property {string} [gridbase=\"#333333\"] - \n * @since 2.1.0\n */\n\n/**\n * An option to overwrite defaults UI color of all event nodes\n *\n * @typedef {Object} ColorScheme\n * @property {ThemeColors} [theme] - Color scheme to overwrite defaults UI color of the timeline instance\n * @property {EventColors} [event] - Color scheme to overwrite defaults UI color of the event node\n * @property {function} [hookEventColors] - You can declare a function to set colors with referring the data each event node\n * @since 2.0.0\n */\n\n/**\n * Default options for generating the timeline by the jQuery.Timeline plugin.\n * Those defaults are overridden to undefined settings of the timeline configuration.\n *\n * @typedef {Object} Default\n * @property {string} [type=\"bar\"] - View type of timeline event is either \"bar\" or \"point\" or \"mixed\"\n * @property {string} [scale=\"day\"] - Timetable's minimum level scale is either \"year\", \"month\", \"week\", \"day\", \"hour\", \"minute\"\n * @property {string} [startDatetime=\"currently\"] - Beginning date time of timetable on the timeline. format is ( \"^d{4}(/|-)d{2}(/|-)d{2}\\sd{2}:d{2}:d{2}$\" ) or \"currently\"\n * @property {string} [endDatetime=\"auto\"] - Ending date time of timetable on the timeline. format is ( \"^d{4}(/|-)d{2}(/|-)d{2}\\sd{2}:d{2}:d{2}$\" ) or \"auto\"\n * @property {Headline} [headline] - Settings for the content customize in the headline\n * @property {Footer} [footer] - Settings for the content customize in the footer\n * @property {number|string} [range=3] - Override the scale range of the timeline to be rendered when endDatetime is undefined or \"auto\"\n * @property {Sidebar} [sidebar] - Settings for the content of the sidebar\n * @property {number|string} [rows=\"auto\"] - Rows of timeline event area\n * @property {number} [rowHeight=48] - Height of one row\n * @property {number|string} [width=\"auto\"] - Fixed width (pixel) of timeline view\n * @property {number|string} [height=\"auto\"] - Fixed height (pixel) of timeline view; Defaults to ( rows * rowHeight )\n * @property {number} [minGridSize=30] - Override value of minimum size (pixel) of timeline grid\n * @property {number} [marginHeight=2] - Margin (pixel) top and bottom of events on the timeline\n * @property {Ruler} [ruler] - Settings of the ruler\n * @property {number|string} [rangeAlign=\"latest\"] - Possible values are \"left\", \"center\", \"right\", \"current\", \"latest\" and specific event id\n * @property {string} [loader=\"default\"] - Custom loader definition, possible values are \"default\", false and selector of loader element\n * @property {boolean} [hideScrollbar=false] - Whether or not to display the scroll bar displayed when the width of the timeline overflows (even if it is set to non-display, it will not function depending on the browser)\n * @property {EventMeta} [eventMeta] - Display meta of range on event node when the timeline type is \"bar\"\n * @property {array.} [eventData] - You can declare the events with object format as default events you want to place\n * @property {Effects} [effects] - You can declare effective styles as view of the timeline object\n * @property {ColorScheme} [colorScheme] - Can overwrite defaults UI color of the event nodes\n * @property {string} [storage=\"session\"] - Specification of Web storage to cache event data, defaults to sessionStorage\n * @property {boolean} [reloadCacheKeep=true] - Whether to load cached events during reloading, the cache is discarded if false\n * @property {boolean} [zoom=false] - Whether to use the ability to zoom the scale of the timeline by double clicking on any scale on the ruler\n * @property {boolean} [wrapScale=true] - Whether wrapping new scale in the timeline container when zoom\n * @property {string} [engine=\"canvas\"] - Choose dependent module to core as rendering engine. It'll be \"canvas\" or \"d3.js\"; Maybe add in future version\n * @property {boolean} [debug=false] - Enable to debug mode if true then output logs for debugging to console; defaults to false\n * @since 2.0.0\n */\n\n/**\n * The limited grid number per scale of timeline\n *\n * @typedef {Object} LimitScaleGrids\n * @property {number} [millennium=100] - In other words it's 100000 years\n * @property {number} [century=500] - In other words it's 50000 years\n * @property {number} [decade=500] - In other words it's 5000 years\n * @property {number} [lustrum=500] - In other words it's 2500 years\n * @property {number} [year=500] - In other words it's 500 years\n * @property {number} [month=540] - In other words it's 45 years\n * @property {number} [week=530] - In other words it's 10 years\n * @property {number} [day=366] - In other words it's about 1 years\n * @property {number} [hour=720] - In other words it's 30 days\n * @property {number} [quarterHour=720] - In other words it's 7.5 days\n * @property {number} [halfHour=720] - In other words it's 15 days\n * @property {number} [minute=720] - In other words it's 12 hours\n * @property {number} [second=900] - In other words it's 15 minutes\n * @since 2.0.0\n */\n\n/**\n * \n *\n * @typedef {Object} RelationOption\n * @property {number} [before] - Set target eventID to connect the relation line to the event (leftward on the timeline) in chronological before from oneself event.\n * @property {number} [after] - Set target eventID to connect the relation line to the event (rightward on the timeline) in chronological after from oneself event.\n * @property {number} [linesize] - \n * @property {string} [linecolor] - \n * @property {number|string|boolean} [curve] - Whether the connection line is curved if the connection events are not on the same horizontal. If you specify a boolean value or a shorthand (0 or 1 only), it will be automatically curved. As with the previous version, it is also possible to specify the type of curve using defined preset values.\n */\n\n/**\n * The preset as default of event parameters on the timeline\n *\n * @typedef {Object} EventParams\n * @property {string} uid - An unique id of event data, this can not define because this value is automatically generate as data for cache only\n * @property {?number} [eventId] - It is an ID that identifies an event for you to manipulate event data via each method. If omitted, consecutive numbers are automatically assigned.\n * @property {number} x - Can not define because this value is automatically generate as data for cache only\n * @property {number} y - Can not define because this value is automatically generate as data for cache only\n * @property {number} width - Can not define because this value is automatically generate as data for cache only\n * @property {number} height - Can not define because this value is automatically generate as data for cache only\n * @property {string} start - Can not define because this value is automatically generate as data for cache only\n * @property {string} end - Can not define because this value is automatically generate as data for cache only\n * @property {number} row - Can not define because this value is automatically generate as data for cache only\n * @property {string} [bgColor=\"#E7E7E7\"] - \n * @property {string} [color=\"#343A40\"] - \n * @property {string} [bdColor=\"#6C757D\"] - \n * @property {string} [label] - \n * @property {string} [content] - \n * @property {string} [category] - \n * @property {string} [image] - \n * @property {number} [margin] - \n * @property {string} [rangeMeta] - \n * @property {number|string} [size=\"normal\"] - Define the diameter size of pointer when type of the timeline is \"point\". Possible values are \"large\", \"normal\", \"small\" and value of pixel.\n * @property {Object} [extend] - The specified key/value pair is replaced with the data attribute of the event element.\n * @property {boolean} [remote=false] - \n * @property {RelationOption} [relation] - Setting for connecting events by relation lines when the timeline type is \"point\".\n * @property {function} [callback] - Callback processing that binds to openEvent method when this event is clicked.\n * @since 2.0.0\n */\n\n/*\n * Binding Custom Events\n *\n * @typedef {Object} Event\n * @property {string} INITIALIZED\n * @property {string} HIDE\n * @property {string} SHOW\n * @property {string} CLICK_EVENT\n * @property {string} FOCUSIN_EVENT\n * @property {string} FOCUSOUT_EVENT\n * @property {string} TOUCHSTART_TIMELINE\n * @property {string} TOUCHMOVE_TIMELINE\n * @property {string} TOUCHEND_TIMELINE\n * @property {string} MOUSEENTER_POINTER\n * @property {string} MOUSELEAVE_POINTER\n * @property {string} ZOOMIN_SCALE\n * @since 2.0.0\n */\n\n/*\n * Class name of the timeline elements created by the plugin\n *\n * @typedef {Object} ClassName\n * @property {string} TIMELINE_CONTAINER\n * @property {string} TIMELINE_MAIN\n * @property {string} TIMELINE_HEADLINE\n * @property {string} TIMELINE_HEADLINE_WRAPPER\n * @property {string} HEADLINE_TITLE\n * @property {string} RANGE_META\n * @property {string} RANGE_SPAN\n * @property {string} TIMELINE_EVENT_CONTAINER\n * @property {string} TIMELINE_BACKGROUND_GRID\n * @property {string} TIMELINE_RELATION_LINES\n * @property {string} TIMELINE_EVENTS\n * @property {string} TIMELINE_EVENT_NODE\n * @property {string} TIMELINE_EVENT_LABEL\n * @property {string} TIMELINE_EVENT_THUMBNAIL\n * @property {string} TIMELINE_RULER_LINES\n * @property {string} TIMELINE_RULER_ITEM\n * @property {string} TIMELINE_SIDEBAR\n * @property {string} TIMELINE_SIDEBAR_MARGIN\n * @property {string} TIMELINE_SIDEBAR_ITEM\n * @property {string} TIMELINE_FOOTER\n * @property {string} TIMELINE_FOOTER_CONTENT\n * @property {string} VIEWER_EVENT_TITLE\n * @property {string} VIEWER_EVENT_CONTENT\n * @property {string} VIEWER_EVENT_META\n * @property {string} VIEWER_EVENT_IMAGE_WRAPPER\n * @property {string} VIEWER_EVENT_IMAGE\n * @property {string} VIEWER_EVENT_TYPE_POINTER\n * @property {string} HIDE_SCROLLBAR\n * @property {string} HIDE\n * @property {string} RULER_ITEM_ALIGN_LEFT\n * @property {string} STICKY_LEFT\n * @property {string} OVERLAY\n * @property {string} ALIGN_SELF_RIGHT\n * @property {string} PRESENT_TIME_MARKER\n * @property {string} LOADER_CONTAINER\n * @property {string} LOADER_ITEM\n * @since 2.0.0\n */\n\n/*\n * Selectors assigned on the timeline element\n *\n * @typedef {Object} Selector\n * @property {string} EVENT_NODE\n * @property {string} EVENT_VIEW\n * @property {string} RULER_TOP\n * @property {string} RULER_BOTTOM\n * @property {string} TIMELINE_CONTAINER\n * @property {string} TIMELINE_MAIN\n * @property {string} TIMELINE_RULER_TOP\n * @property {string} TIMELINE_EVENT_CONTAINER\n * @property {string} TIMELINE_RULER_BOTTOM\n * @property {string} TIMELINE_RULER_ITEM\n * @property {string} TIMELINE_RELATION_LINES\n * @property {string} TIMELINE_EVENTS\n * @property {string} TIMELINE_SIDEBAR\n * @property {string} TIMELINE_SIDEBAR_ITEM\n * @property {string} TIMELINE_EVENT_NODE\n * @property {string} VIEWER_EVENT_TYPE_POINTER\n * @property {string} LOADER\n * @property {string} DEFAULT_EVENTS\n * @since 2.0.0\n */\n\n/**\n * Pluin Core Class\n * @access public\n * @since 2.0.0\n */\nclass Timeline {\n constructor( element, config ) {\n /** @type {Object} */\n this._config = this._getConfig( config )\n /** @type {Object} */\n this._element = element\n /** @type {?string} */\n this._selector = null\n /** @type {boolean} */\n this._isInitialized = false\n /** @type {boolean} */\n this._isCached = false\n /** @type {boolean} */\n this._isCompleted = false\n /** @type {boolean} */\n this._isShown = false\n /** @type {Object} */\n this._instanceProps = {}\n /** @type {?Object} */\n this._observer = null\n }\n \n // Getters\n \n /** @type {string} */\n static get VERSION() {\n return VERSION\n }\n \n /** @type {Default} */\n static get Default() {\n return Default\n }\n \n // Private\n \n /**\n * Define the default options of this plugin\n * @private\n * @param {Object} config - Initial options\n * @return {Object} Config overrided initial options to default config\n */\n _getConfig( config ) {\n config = {\n ...Default,\n ...config\n }\n return config\n }\n \n /**\n * Filter the scale key name for LimitScaleGrids\n * @private\n * @param {string} key\n * @return {string} Filtered scale key name\n */\n _filterScaleKeyName( key ) {\n let filteredKey = null\n \n switch( true ) {\n case /^quarter-?(|hour)$/i.test( key ):\n filteredKey = 'quarterHour'\n break\n case /^half-?(|hour)$/i.test( key ):\n filteredKey = 'halfHour'\n break\n default:\n filteredKey = key\n }\n return filteredKey\n }\n \n /**\n * Initialize the plugin\n * @private\n */\n _init() {\n this._debug( '_init' )\n \n let _elem = this._element,\n _selector = `${_elem.tagName}${( _elem.id ? `#${_elem.id}` : '' )}${( _elem.className ? `.${_elem.className.replace(/\\s/g, '.')}` : '' )}`\n \n this._selector = _selector.toLowerCase()\n \n if ( this._isInitialized || this._isCompleted ) {\n return\n }\n \n this.showLoader()\n \n this._calcVars()\n \n if ( ! this._verifyMaxRenderableRange() ) {\n throw new RangeError( `Timeline display period exceeds maximum renderable range.` )\n }\n \n this.sleep( _sleep ).then(() => {\n \n if ( ! this._isInitialized ) {\n \n this._renderView()\n \n const afterInitEvent = $.Event( Event.INITIALIZED, { _elem } )\n \n $(_elem).trigger( afterInitEvent )\n \n $(_elem).off( Event.INITIALIZED )\n }\n \n if ( ! this._isCached ) {\n this._loadEvent()\n }\n \n if ( this._isCached ) {\n this._placeEvent()\n }\n \n // Assign events for the timeline\n $(document).on(\n Event.CLICK_EVENT,\n `${this._selector} ${Selector.EVENT_NODE}`,\n ( event ) => this.openEvent( event )\n )\n $(_elem).on(\n Event.FOCUSIN_EVENT,\n Selector.TIMELINE_EVENT_NODE,\n ( event ) => this._activeEvent( event )\n )\n $(_elem).on(\n Event.FOCUSOUT_EVENT,\n Selector.TIMELINE_EVENT_NODE,\n ( event ) => this._activeEvent( event )\n )\n if ( /^point(|er)$/i.test( this._config.type ) ) {\n $(_elem).on(\n Event.MOUSEENTER_POINTER,\n Selector.VIEWER_EVENT_TYPE_POINTER,\n ( event ) => this._hoverPointer( event )\n )\n $(_elem).on(\n Event.MOUSELEAVE_POINTER,\n Selector.VIEWER_EVENT_TYPE_POINTER,\n ( event ) => this._hoverPointer( event )\n )\n }\n if ( this._config.zoom ) {\n $(_elem).on(\n Event.ZOOMIN_SCALE,\n Selector.TIMELINE_RULER_ITEM,\n ( event ) => this.zoomScale( event )\n )\n \n }\n \n this._isCompleted = true\n \n this.alignment()\n \n })\n }\n \n /**\n * Calculate each properties of the timeline instance\n * @private\n */\n _calcVars() {\n let _opts = this._config,\n _props = {}\n \n _props.begin = this.supplement( null, this._getPluggableDatetime( _opts.startDatetime, 'first' ) )\n _props.end = this.supplement( null, this._getPluggableDatetime( _opts.endDatetime, 'last' ) )\n _props.scaleSize = this.supplement( null, _opts.minGridSize, this.validateNumeric )\n _props.rows = this._getPluggableRows()\n _props.rowSize = this.supplement( null, _opts.rowHeight, this.validateNumeric )\n _props.width = this.supplement( null, _opts.width, this.validateNumeric )\n _props.height = this.supplement( null, _opts.height, this.validateNumeric )\n \n this._instanceProps = _props // pre-cache\n \n if ( /^(year|month)s?$/i.test( _opts.scale ) ) {\n // For scales where the value of quantity per unit is variable length (:> 単位あたりの量の値が可変長であるスケールの場合\n let _temp = this._verifyScale( _opts.scale ),\n _values = Object.values( _temp ),\n _averageDays = this.numRound( _values.reduce( ( a, v ) => a + v, 0 ) / _values.length, 4 ), // Average days within the range\n _baseDaysOfScale = /^years?$/i.test( _opts.scale ) ? 365 : 30,\n _totalWidth = 0\n \n//console.log( '!', _opts.scale, _temp, _vals )\n _values.forEach( ( days ) => {\n _totalWidth += this.numRound( ( days * _props.scaleSize ) / _baseDaysOfScale, 2 )\n })\n \n _props.scale = _averageDays * ( 24 * 60 * 60 * 1000 )\n _props.grids = _values.length\n _props.variableScale = _temp\n _props.fullwidth = _totalWidth\n } else {\n // In case of fixed length scale (:> 固定長スケールの場合\n _props.scale = this._verifyScale( _opts.scale )\n _props.grids = Math.ceil( ( _props.end - _props.begin ) / _props.scale )\n _props.variableScale = null\n _props.fullwidth = _props.grids * _props.scaleSize\n }\n _props.fullheight = _props.rows * _props.rowSize\n // Define visible size according to full size of timeline (:> タイムラインのフルサイズに準じた可視サイズを定義\n _props.visibleWidth = _props.width > 0 ? `${( _props.width <= _props.fullwidth ? _props.width : _props.fullwidth )}px` : '100%'\n _props.visibleHeight = _props.height > 0 ? `${( _props.height <= _props.fullheight ? _props.height : _props.fullheight )}px` : 'auto'\n \n for ( let _prop in _props ) {\n if ( _prop === 'width' || _prop === 'height' || _prop === 'variableScale' ) {\n continue\n }\n if ( this.is_empty( _props[_prop] ) ) {\n throw new TypeError( `Property \"${_prop}\" cannot set because undefined or invalid variable.` )\n }\n }\n \n if ( _props.fullwidth < 2 || _props.fullheight < 2 ) {\n throw new TypeError( `The range of the timeline to be rendered is incorrect.` )\n }\n \n this._instanceProps = _props\n }\n \n /**\n * Retrieve the pluggable datetime as milliseconds from specified keyword\n * @private\n * @param {string} key - Any one of \"current\", \"auto\", or datetime string\n * @param {string} [round_type] - \n * @return {number} This value unit is milliseconds\n */\n _getPluggableDatetime( key, round_type = '' ) {\n let _opts = this._config,\n _date = null,\n getFirstDate = ( dateObj, scale ) => {\n let _tmpDate\n \n switch ( true ) {\n case /^millenniums?|millennia$/i.test( scale ):\n case /^century$/i.test( scale ):\n case /^dec(ade|ennium)$/i.test( scale ):\n case /^lustrum$/i.test( scale ):\n case /^years?$/i.test( scale ):\n _tmpDate = new Date( dateObj.getFullYear(), 0, 1 )\n break\n case /^months?$/i.test( scale ):\n _tmpDate = new Date( dateObj.getFullYear(), dateObj.getMonth(), 1 )\n break\n case /^(week|day)s?$/i.test( scale ):\n _tmpDate = new Date( dateObj.getFullYear(), dateObj.getMonth(), dateObj.getDate() )\n break\n case /^(|half|quarter)-?hours?$/i.test( scale ):\n _tmpDate = new Date( dateObj.getFullYear(), dateObj.getMonth(), dateObj.getDate(), dateObj.getHours() )\n break\n case /^minutes?$/i.test( scale ):\n _tmpDate = new Date( dateObj.getFullYear(), dateObj.getMonth(), dateObj.getDate(), dateObj.getHours(), dateObj.getMinutes() )\n break\n case /^seconds?$/i.test( scale ):\n _tmpDate = new Date( dateObj.getFullYear(), dateObj.getMonth(), dateObj.getDate(), dateObj.getHours(), dateObj.getMinutes(), dateObj.getSeconds() )\n break\n }\n return _tmpDate\n },\n getLastDate = ( dateObj, scale ) => {\n let _tmpDate\n \n switch ( true ) {\n case /^millenniums?|millennia$/i.test( scale ):\n case /^century$/i.test( scale ):\n case /^dec(ade|ennium)$/i.test( scale ):\n case /^lustrum$/i.test( scale ):\n case /^years?$/i.test( scale ):\n _tmpDate = new Date( dateObj.getFullYear() + 1, 0, 1 )\n break\n case /^months?$/i.test( scale ):\n _tmpDate = new Date( dateObj.getFullYear(), dateObj.getMonth() + 1, 1 )\n break\n case /^(week|day)s?$/i.test( scale ):\n _tmpDate = new Date( dateObj.getFullYear(), dateObj.getMonth(), dateObj.getDate() + 1 )\n break\n case /^(|half|quarter)-?hours?$/i.test( scale ):\n _tmpDate = new Date( dateObj.getFullYear(), dateObj.getMonth(), dateObj.getDate(), dateObj.getHours() + 1 )\n break\n case /^minutes?$/i.test( scale ):\n _tmpDate = new Date( dateObj.getFullYear(), dateObj.getMonth(), dateObj.getDate(), dateObj.getHours(), dateObj.getMinutes() + 1 )\n break\n case /^seconds?$/i.test( scale ):\n _tmpDate = new Date( dateObj.getFullYear(), dateObj.getMonth(), dateObj.getDate(), dateObj.getHours(), dateObj.getMinutes(), dateObj.getSeconds() + 1 )\n break\n }\n return new Date( _tmpDate.getTime() - 1 )\n },\n is_remapping = /^\\d{1,2}(|(-|\\/).+)$/.test( key.toString() )\n//console.log( '!_getPluggableDatetime:', key, round_type, is_remapping )\n \n switch ( true ) {\n case /^current(|ly)$/i.test( key ):\n _date = new Date()\n//console.log( '!_getPluggableDatetime::currently:', _opts.scale, this.getHigherScale( _opts.scale ), key, _date.getTime() )\n break\n case /^auto$/i.test( key ): {\n let _ms = null,\n _higherScale = this.getHigherScale( _opts.scale )\n \n if ( /^current(|ly)$/i.test( _opts.startDatetime ) ) {\n _date = new Date()\n //if ( /^(year|month)s?$/i.test( _opts.scale ) ) {\n _date = getFirstDate( _date, _opts.scale )\n //}\n } else {\n _date = this.getCorrectDatetime( _opts.startDatetime )\n }\n \n if ( _opts.range || _opts.range > 0 ) {\n if ( /^years?$/i.test( _higherScale ) ) {\n _ms = 365.25 * 24 * 60 * 60 * 1000\n } else\n if ( /^months?$/i.test( _higherScale ) ) {\n _ms = 30.44 * 24 * 60 * 60 * 1000\n } else {\n _ms = this._verifyScale( _higherScale )\n }\n _date.setTime( _date.getTime() + ( _ms * _opts.range ) )\n } else {\n if ( /^years?$/i.test( _opts.scale ) ) {\n _ms = 365.25 * 24 * 60 * 60 * 1000\n } else\n if ( /^months?$/i.test( _opts.scale ) ) {\n _ms = 30.44 * 24 * 60 * 60 * 1000\n } else {\n _ms = this._verifyScale( _opts.scale )\n }\n _date.setTime( _date.getTime() + ( _ms * LimitScaleGrids[this._filterScaleKeyName( _opts.scale )] ) )\n }\n// console.log( '!_getPluggableDatetime::auto:', _opts.scale, this.getHigherScale( _opts.scale ), key, _date.getTime() )\n break\n }\n default:\n _date = this.getCorrectDatetime( key )\n break\n }\n \n if ( ! is_remapping ) {\n is_remapping = _date.getFullYear() < 100\n }\n \n if ( ! this.is_empty( round_type ) ) {\n if ( 'first' === round_type ) {\n//console.log( '!_getPluggableDatetime::first:before:', key, _date, is_remapping )\n _date = getFirstDate( _date, _opts.scale )\n//console.log( '!_getPluggableDatetime::first:after:', key, _date, is_remapping )\n } else\n if ( 'last' === round_type ) {\n//console.log( '!_getPluggableDatetime::last:before:', key, _date, is_remapping )\n _date = getLastDate( _date, _opts.scale )\n//console.log( '!_getPluggableDatetime::last:after:', key, _date, is_remapping )\n }\n }\n \n if ( is_remapping ) {\n _date.setFullYear( String( _date.getFullYear() ).substr(-2) )\n }\n \n//console.log( '!_getPluggableDatetime::return:', _date )\n return _date.getTime()\n }\n \n /**\n * Retrieve the pluggable parameter as an object\n * @private\n * @param {string} str_like_params - Strings that can be parsed as javascript objects\n * @return {Object}\n */\n _getPluggableParams( str_like_params ) {\n let params = {}\n \n if ( typeof str_like_params === 'string' && str_like_params ) {\n try {\n params = JSON.parse( JSON.stringify( ( new Function( `return ${str_like_params}` ) )() ) )\n if ( params.hasOwnProperty( 'extend' ) ) {\n params.extend = JSON.parse( JSON.stringify( ( new Function( `return ${params.extend}` ) )() ) )\n }\n } catch( e ) {\n console.warn( 'Can not parse to object therefor invalid param.' )\n }\n }\n return params\n }\n \n /**\n * Retrieve the pluggable rows of the timeline\n * @private\n * @return {number}\n */\n _getPluggableRows() {\n let _opts = this._config,\n fixed_rows = this.supplement( 'auto', _opts.rows, this.validateNumeric )\n \n if ( fixed_rows === 'auto' ) {\n fixed_rows = _opts.sidebar.list.length\n }\n return fixed_rows > 0 ? fixed_rows : 1\n }\n \n /**\n * Verify the allowed scale, then retrieve that scale's millisecond if allowed\n * @private\n * @param {string} scale - \n * @return {number|boolean} Return false if specified an invalid scale\n */\n _verifyScale( scale ) {\n let _opts = this._config,\n _props = this._instanceProps,\n _ms = -1\n \n if ( typeof scale === 'undefined' || typeof scale !== 'string' ) {\n return false\n }\n switch ( true ) {\n case /^millisec(|ond)s?$/i.test( scale ):\n // Millisecond (:> ミリ秒\n _ms = 1\n break\n case /^seconds?$/i.test( scale ):\n // Second (:> 秒\n _ms = 1000\n break\n case /^minutes?$/i.test( scale ):\n // Minute (:> 分\n _ms = 60 * 1000\n break\n case /^quarter-?(|hour)$/i.test( scale ):\n // Quarter of an hour (:> 15分\n _ms = 15 * 60 * 1000\n break\n case /^half-?(|hour)$/i.test( scale ):\n // Half an hour (:> 30分\n _ms = 30 * 60 * 1000\n break\n case /^hours?$/i.test( scale ):\n // Hour (:> 時(時間)\n _ms = 60 * 60 * 1000\n break\n case /^days?$/i.test( scale ):\n // Day (:> 日\n _ms = 24 * 60 * 60 * 1000\n break\n case /^weeks?$/i.test( scale ):\n // Week (:> 週\n _ms = 7 * 24 * 60 * 60 * 1000\n break\n case /^months?$/i.test( scale ):\n // Month (is the variable length scale) (:> 月(可変長スケール)\n//console.log( '!_verifyScale::month:', this._instanceProps, _opts.scale )\n if ( /^(year|month)s?$/i.test( _opts.scale ) ) {\n return this._diffDate( _props.begin, _props.end, scale )\n } else {\n _ms = 30.44 * 24 * 60 * 60 * 1000\n break\n }\n case /^years?$/i.test( scale ):\n // Year (is the variable length scale) (:> 年(可変長スケール)\n if ( /^(year|month)s?$/i.test( _opts.scale ) ) {\n return this._diffDate( _props.begin, _props.end, scale )\n } else {\n _ms = 365.25 * 24 * 60 * 60 * 1000\n break\n }\n case /^lustrum$/i.test( scale ):\n // Lustrum (is the variable length scale, but currently does not support) (:> 五年紀 (可変長スケールだが現在サポートしてない)\n // 5y = 1826 or 1827; 1826 * 24 * 60 * 60 = 15766400, 1827 * 24 * 60 * 60 = 157852800 | avg.= 157788000\n //_ms = ( ( 3.1536 * Math.pow( 10, 8 ) ) / 2 ) * 1000 // <--- Useless by info of wikipedia\n _ms = 157788000 * 1000\n break\n case /^dec(ade|ennium)$/i.test( scale ):\n // Decade (is the variable length scale, but currently does not support) (:> 十年紀 (可変長スケールだが現在サポートしてない)\n // 10y = 3652 or 3653; 3652 * 24 * 60 * 60 = 315532800, 3653 * 24 * 60 * 60 = 157852800 | avg. = 315576000\n // _ms = ( 3.1536 * Math.pow( 10, 8 ) ) * 1000 // <--- Useless by info of wikipedia\n _ms = 315576000 * 1000\n break\n case /^century$/i.test( scale ):\n // Century (:> 世紀(百年紀)\n // 100y = 36525; 36525 * 24 * 60 * 60 = 3155760000\n _ms = 3155760000 * 1000\n break\n case /^millenniums?|millennia$/i.test( scale ):\n // Millennium (:> 千年紀\n // 100y = 365250\n //_ms = ( 3.1536 * Math.pow( 10, 10 ) ) * 1000\n _ms = 3155760000 * 10 * 1000\n break\n default:\n console.warn( 'Specified an invalid scale.' )\n _ms = -1\n }\n return _ms > 0 ? _ms : false\n }\n \n /**\n * Verify the display period of the timeline does not exceed the maximum renderable range\n * @private\n * @return {boolean}\n */\n _verifyMaxRenderableRange() {\n// console.log( this._instanceProps.grids, '/', LimitScaleGrids[this._filterScaleKeyName( this._config.scale )] )\n return this._instanceProps.grids <= LimitScaleGrids[this._filterScaleKeyName( this._config.scale )]\n }\n \n /**\n * Render the view of timeline container\n * @private\n */\n _renderView() {\n this._debug( '_renderView' )\n \n let _elem = this._element,\n _opts = this._config,\n _props = this._instanceProps,\n _tl_container = $('
', { class: ClassName.TIMELINE_CONTAINER, style: `width: ${_props.visibleWidth}; height: ${_props.visibleHeight};` }),\n _tl_main = $('
', { class: ClassName.TIMELINE_MAIN })\n \n//console.log( _elem, _opts, _props )\n if ( $(_elem).length == 0 ) {\n throw new TypeError( 'Does not exist the element to render a timeline container.' )\n }\n \n if ( _opts.debug ) {\n console.info( `Timeline:{ fullWidth: ${_props.fullwidth}px,`, `fullHeight: ${_props.fullheight}px,`, `viewWidth: ${_props.visibleWidth}`, `viewHeight: ${_props.visibleHeight} }` )\n }\n \n $(_elem).css( 'position', 'relative' ) // initialize; not .empty()\n if ( _opts.hideScrollbar ) {\n _tl_container.addClass( ClassName.HIDE_SCROLLBAR )\n }\n \n // Create the timeline headline (:> タイムラインの見出しを生成\n $(_elem).prepend( this._createHeadline() )\n \n // Create the timeline event container (:> タイムラインのイベントコンテナを生成\n _tl_main.append( this._createEventContainer() )\n \n // Create the timeline ruler (:> タイムラインの目盛を生成\n if ( ! this.is_empty( _opts.ruler.top ) ) {\n _tl_main.prepend( this._createRuler( 'top' ) )\n }\n if ( ! this.is_empty( _opts.ruler.bottom ) ) {\n _tl_main.append( this._createRuler( 'bottom' ) )\n }\n \n // Create the timeline side index (:> タイムラインのサイドインデックスを生成\n let margin = {\n top : parseInt( _tl_main.find( Selector.RULER_TOP ).height(), 10 ) - 1,\n bottom : parseInt( _tl_main.find( Selector.RULER_BOTTOM ).height(), 10 ) - 1\n }\n \n if ( _opts.sidebar.list.length > 0 ) {\n _tl_container.prepend( this._createSideIndex( margin ) )\n }\n \n // Append the timeline container in the timeline element (:> タイムライン要素にタイムラインコンテナを追加\n _tl_container.append( _tl_main )\n $(_elem).append( _tl_container )\n \n // Create the timeline footer (:> タイムラインのフッタを生成\n $(_elem).append( this._createFooter() )\n \n this._isShown = true\n }\n \n /**\n * Create the headline of the timeline\n * @private\n * @return {Object} Generated DOM element\n */\n _createHeadline() {\n let _opts = this._config,\n _props = this._instanceProps,\n _display = this.supplement( Default.headline.display, _opts.headline.display, this.validateBoolean ),\n _title = this.supplement( null, _opts.headline.title ),\n _range = this.supplement( Default.headline.range, _opts.headline.range, this.validateBoolean ),\n _locale = this.supplement( Default.headline.locale, _opts.headline.locale ),\n _format = this.supplement( Default.headline.format, _opts.headline.format ),\n _begin = this.supplement( null, _props.begin ),\n _end = this.supplement( null, _props.end ),\n _tl_headline = $('
', { class: ClassName.TIMELINE_HEADLINE }),\n _wrapper = $('
', { class: ClassName.TIMELINE_HEADLINE_WRAPPER })\n \n// console.log( '!_createHeadline:', _opts )\n if ( _title ) {\n _wrapper.append( `

${_opts.headline.title}

` )\n }\n if ( _range ) {\n if ( _begin && _end ) {\n let _meta = `${new Date( _begin ).toLocaleString( _locale, _format )}${new Date( _end ).toLocaleString( _locale, _format )}`\n //let _meta = this.getCorrectDatetime( _begin ).toLocaleString( _locale, _format ) +''+ this.getCorrectDatetime( _end ).toLocaleString( _locale, _format )\n \n _wrapper.append( `
${_meta}
` )\n }\n }\n if ( ! _display ) {\n _tl_headline.addClass( ClassName.HIDE )\n }\n return _tl_headline.append( _wrapper )\n }\n \n /**\n * Create the event container of the timeline\n * @private\n * @return {Object} Generated DOM element\n */\n _createEventContainer() {\n let _opts = this._config,\n _props = this._instanceProps,\n _actualHeight = _props.fullheight + Math.ceil( _props.rows / 2 ),\n _container = $('
', { class: ClassName.TIMELINE_EVENT_CONTAINER, style: `height:${_actualHeight}px;` }),\n _events_bg = $(``),\n _events_lines = $(``),\n _events_body = $('
', { class: ClassName.TIMELINE_EVENTS }),\n _cy = 0,\n ctx_grid = _events_bg[0].getContext('2d'),\n drawRowRect = ( pos_y, color ) => {\n color = this.supplement( '#FFFFFF', color )\n // console.log( 0, pos_y, _fullwidth, _size_row, color )\n ctx_grid.fillStyle = color\n ctx_grid.fillRect( 0, pos_y + 0.5, _props.fullwidth, _props.rowSize + 1.5 )\n ctx_grid.stroke()\n },\n drawHorizontalLine = ( pos_y, is_dotted ) => {\n is_dotted = this.supplement( false, is_dotted )\n // console.log( pos_y, is_dotted )\n ctx_grid.strokeStyle = 'rgba( 51, 51, 51, 0.1 )'\n ctx_grid.lineWidth = 1\n ctx_grid.filter = 'url(#crisp)'\n ctx_grid.beginPath()\n if ( is_dotted ) {\n ctx_grid.setLineDash([ 1, 2 ])\n } else {\n ctx_grid.setLineDash([])\n }\n ctx_grid.moveTo( 0, pos_y + 0.5 )\n ctx_grid.lineTo( _props.fullwidth, pos_y + 0.5 )\n ctx_grid.closePath()\n ctx_grid.stroke()\n },\n drawVerticalLine = ( pos_x, is_dotted ) => {\n is_dotted = this.supplement( false, is_dotted )\n // console.log( pos_x, is_dotted )\n ctx_grid.strokeStyle = 'rgba( 51, 51, 51, 0.025 )'\n ctx_grid.lineWidth = 1\n ctx_grid.filter = 'url(#crisp)'\n ctx_grid.beginPath()\n if ( is_dotted ) {\n ctx_grid.setLineDash([ 1, 2 ])\n } else {\n ctx_grid.setLineDash([])\n }\n ctx_grid.moveTo( pos_x - 0.5, 0 )\n ctx_grid.lineTo( pos_x - 0.5, _props.fullheight )\n ctx_grid.closePath()\n ctx_grid.stroke()\n }\n \n _cy = 0\n for ( let i = 0; i < _props.rows; i++ ) {\n _cy += i % 2 == 0 ? 1 : 0\n let _pos_y = ( i * _props.rowSize ) + _cy\n drawRowRect( _pos_y, i % 2 == 0 ? '#FEFEFE' : '#F8F8F8' )\n }\n _cy = 0\n for ( let i = 1; i < _props.rows; i++ ) {\n _cy += i % 2 == 0 ? 1 : 0\n let _pos_y = ( i * _props.rowSize ) + _cy\n drawHorizontalLine( _pos_y, true )\n }\n if ( /^(year|month)s?$/i.test( _opts.scale ) ) {\n // For scales where the value of quantity per unit is variable length (:> 単位あたりの量の値が可変長であるスケールの場合\n let _bc = /^years?$/i.test( _opts.scale ) ? 365 : 30,\n _sy = 0\n \n for ( let _key of Object.keys( _props.variableScale ) ) {\n _sy += this.numRound( ( _props.variableScale[_key] * _props.scaleSize ) / _bc, 2 )\n drawVerticalLine( _sy, false )\n }\n } else {\n // In case of fixed length scale (:> 固定長スケールの場合\n for ( let i = 1; i < _props.grids; i++ ) {\n drawVerticalLine( ( i * _props.scaleSize ), false )\n }\n }\n \n return _container.append( _events_bg ).append( _events_lines ).append( _events_body )\n }\n \n /**\n * Create the ruler of the timeline\n * @private\n * @param {string} position - Either \"top\" or \"bottom\" as the position of the ruler\n * @return {Object} Generated DOM element\n */\n _createRuler( position ) {\n let _opts = this._config,\n _props = this._instanceProps,\n ruler_line = this.supplement( [ _opts.scale ], _opts.ruler[position].lines, ( def, val ) => Array.isArray( val ) && val.length > 0 ? val : def ),\n line_height = this.supplement( Default.ruler.top.height, _opts.ruler[position].height ),\n font_size = this.supplement( Default.ruler.top.fontSize, _opts.ruler[position].fontSize ),\n text_color = this.supplement( Default.ruler.top.color, _opts.ruler[position].color ),\n background = this.supplement( Default.ruler.top.background, _opts.ruler[position].background ),\n locale = this.supplement( Default.ruler.top.locale, _opts.ruler[position].locale ),\n format = this.supplement( Default.ruler.top.format, _opts.ruler[position].format ),\n ruler_opts = { lines: ruler_line, height: line_height, fontSize: font_size, color: text_color, background, locale, format },\n _fullwidth = _props.fullwidth - 1,\n _fullheight = ruler_line.length * line_height,\n _ruler = $('
', { class: `${PREFIX}ruler-${position}`, style: `height:${_fullheight}px;` }),\n _ruler_bg = $(``),\n _ruler_body = $('
', { class: `${PREFIX}ruler-content-${position}` }),\n _finalLines = 0,\n ctx_ruler = _ruler_bg[0].getContext('2d')\n \n//console.log( grids, size_per_grid, scale, begin, min_scale, ruler, position, ruler_line, line_height, ctx_ruler.canvas.width, ctx_ruler.canvas.height )\n // Draw background of ruler\n ctx_ruler.fillStyle = background\n ctx_ruler.fillRect( 0, 0, ctx_ruler.canvas.width, ctx_ruler.canvas.height )\n \n // Draw stroke of ruler\n ctx_ruler.strokeStyle = 'rgba( 51, 51, 51, 0.1 )'\n ctx_ruler.lineWidth = 1\n ctx_ruler.filter = 'url(#crisp)'\n ruler_line.some( ( line_scale, idx ) => {\n if ( /^(quarter|half)-?(|hour)$/i.test( line_scale ) ) {\n return true // break\n }\n \n ctx_ruler.beginPath()\n \n // Draw rows\n //let _line_x = position === 'top' ? 0 : ctx_ruler.canvas.width,\n let _line_y = position === 'top' ? line_height * ( idx + 1 ) - 0.5 : line_height * idx + 0.5\n \n ctx_ruler.moveTo( 0, _line_y )\n ctx_ruler.lineTo( ctx_ruler.canvas.width, _line_y )\n \n // Draw cols\n let _line_grids = null,\n _grid_x = 0,\n _correction = -1.5\n \n if ( /^(year|month)s?$/i.test( _opts.scale ) ) {\n // For scales where the value of quantity per unit is variable length (:> 単位あたりの量の値が可変長であるスケールの場合\n _line_grids = this._filterVariableScale( line_scale )\n//console.log( '!_createRuler:', line_scale, _line_grids )\n \n for ( let _key of Object.keys( _line_grids ) ) {\n _grid_x += this.numRound( _line_grids[_key], 2 )\n \n ctx_ruler.moveTo( _grid_x + _correction, position === 'top' ? _line_y - line_height : _line_y )\n ctx_ruler.lineTo( _grid_x + _correction, position === 'top' ? _line_y : _line_y + line_height )\n }\n } else {\n // In case of fixed length scale (:> 固定長スケールの場合\n _line_grids = this._getGridsPerScale( line_scale )\n \n for ( let _val of _line_grids ) {\n if ( this.is_empty( _val ) || _val >= _props.grids ) {\n break\n }\n let _grid_width = _val * _props.scaleSize\n \n _grid_x += _grid_width\n if ( Math.ceil( _grid_x ) - _correction >= ctx_ruler.canvas.width ) {\n break\n }\n ctx_ruler.moveTo( _grid_x + _correction, position === 'top' ? _line_y - line_height : _line_y )\n ctx_ruler.lineTo( _grid_x + _correction, position === 'top' ? _line_y : _line_y + line_height )\n }\n }\n ctx_ruler.closePath()\n ctx_ruler.stroke()\n _ruler_body.append( this._createRulerContent( _line_grids, line_scale, ruler_opts ) )\n _finalLines++\n })\n \n if ( ruler_line.length != _finalLines ) {\n _ruler.css( 'height', `${_finalLines * line_height}px` )\n }\n \n return _ruler.append( _ruler_bg ).append( _ruler_body )\n }\n \n /**\n * Filter to aggregate the grid width of the variable length scale\n * @private\n * @param {string} target_scale - \n * @return {Object} \n */\n _filterVariableScale( target_scale ) {\n let _opts = this._config,\n _props = this._instanceProps,\n _bc = /^years?$/i.test( _opts.scale ) ? 365 : 30,\n scales = _props.variableScale,\n retObj = {}\n \n for ( let _dt of Object.keys( scales ) ) {\n let _days = scales[_dt],\n grid_size = this.numRound( ( _days * _props.scaleSize ) / _bc, 2 ),\n _newKey = null,\n _arr, _temp\n//console.log( '!_filterVariableScale:', _dt, this.getCorrectDatetime( _dt ).getFullYear(), _days )\n \n switch ( true ) {\n case /^millenniums?|millennia$/i.test( target_scale ):\n _newKey = Math.ceil( this.getCorrectDatetime( _dt ).getFullYear() / 1000 )\n \n if ( retObj.hasOwnProperty( _newKey ) ) {\n retObj[_newKey] += grid_size\n } else {\n retObj[_newKey] = grid_size\n }\n break\n case /^century$/i.test( target_scale ):\n _newKey = Math.ceil( this.getCorrectDatetime( _dt ).getFullYear() / 100 )\n \n if ( retObj.hasOwnProperty( _newKey ) ) {\n retObj[_newKey] += grid_size\n } else {\n retObj[_newKey] = grid_size\n }\n break\n case /^dec(ade|ennium)$/i.test( target_scale ):\n _newKey = Math.ceil( this.getCorrectDatetime( _dt ).getFullYear() / 10 )\n \n if ( retObj.hasOwnProperty( _newKey ) ) {\n retObj[_newKey] += grid_size\n } else {\n retObj[_newKey] = grid_size\n }\n break\n case /^lustrum$/i.test( target_scale ):\n _newKey = Math.ceil( this.getCorrectDatetime( _dt ).getFullYear() / 5 )\n \n if ( retObj.hasOwnProperty( _newKey ) ) {\n retObj[_newKey] += grid_size\n } else {\n retObj[_newKey] = grid_size\n }\n break\n case /^years?$/i.test( target_scale ):\n _newKey = `${this.getCorrectDatetime( _dt ).getFullYear()}`\n \n if ( retObj.hasOwnProperty( _newKey ) ) {\n retObj[_newKey] += grid_size\n } else {\n retObj[_newKey] = grid_size\n }\n break\n case /^months?$/i.test( target_scale ):\n retObj[`${this.getCorrectDatetime( _dt ).getFullYear()}/${this.getCorrectDatetime( _dt ).getMonth() + 1}`] = grid_size\n break\n case /^weeks?$/i.test( target_scale ):\n _arr = _dt.split(',')\n _temp = this.getWeek( _arr[0] )\n//console.log( '!_filterVariableScale::week:', _dt, _arr[0], _temp )\n retObj[`${this.getCorrectDatetime( _arr[0] ).getFullYear()},${_temp}`] = grid_size\n break\n case /^weekdays?$/i.test( target_scale ):\n _arr = _dt.split(',')\n _temp = this.getCorrectDatetime( _arr[0] ).getDay()\n retObj[`${this.getCorrectDatetime( _arr[0] ).getFullYear()}/${this.getCorrectDatetime( _arr[0] ).getMonth() + 1}/1,${_temp}`] = grid_size\n break\n case /^days?$/i.test( target_scale ):\n retObj[`${this.getCorrectDatetime( _dt ).getFullYear()}/${this.getCorrectDatetime( _dt ).getMonth() + 1}/1`] = grid_size\n break\n case /^hours?$/i.test( target_scale ):\n retObj[`${this.getCorrectDatetime( _dt ).getFullYear()}/${this.getCorrectDatetime( _dt ).getMonth() + 1}/1 0`] = grid_size\n break\n case /^minutes?$/i.test( target_scale ):\n retObj[`${this.getCorrectDatetime( _dt ).getFullYear()}/${this.getCorrectDatetime( _dt ).getMonth() + 1}/1 0:00`] = grid_size\n break\n case /^seconds?$/i.test( target_scale ):\n retObj[`${this.getCorrectDatetime( _dt ).getFullYear()}/${this.getCorrectDatetime( _dt ).getMonth() + 1}/1 0:00:00`] = grid_size\n break\n default:\n retObj[`${this.getCorrectDatetime( _dt ).getFullYear()}/${this.getCorrectDatetime( _dt ).getMonth() + 1}`] = grid_size\n break\n }\n }\n \n return retObj\n }\n \n /**\n * Get the grid number per scale (for fixed length scale)\n * @private\n * @param {string} target_scale - \n * @return {Object} \n */\n _getGridsPerScale( target_scale ) {\n //let _opts = this._config,\n let _props = this._instanceProps,\n _scopes = [],\n _scale_grids = {},\n _sep = '/'\n \n for ( let i = 0; i < _props.grids; i++ ) {\n let _tmp = new Date( _props.begin + ( i * _props.scale ) ),\n //let _tmp = this.getCorrectDatetime( _props.begin + ( i * _props.scale ) ),\n _y = _tmp.getFullYear(),\n _mil = Math.ceil( _y / 1000 ),\n _cen = Math.ceil( _y / 100 ),\n _dec = Math.ceil( _y / 10 ),\n _lus = Math.ceil( _y / 5 ),\n _m = _tmp.getMonth() + 1,\n _wd = _tmp.getDay(), // 0 = Sun, ... 6 = Sat\n _d = _tmp.getDate(),\n _w = this.getWeek( `${_y}/${_m}/${_d}` ),\n _h = _tmp.getHours(),\n _min = _tmp.getMinutes(),\n _s = _tmp.getSeconds()\n// console.log( '!!:', _tmp, `y: ${_y}`, `w: ${_w}`, /* `mil: ${_mil}`, `cen: ${_cen}`, `dec: ${_dec}`, `lus: ${_lus}` */ )\n \n _scopes.push({\n millennium : _mil,\n century : _cen,\n decade : _dec,\n lustrum : _lus,\n year : _y,\n month : `${_y}${_sep}${_m}${_sep}1`,\n week : `${_y},${_w}`,\n weekday : `${_y}${_sep}${_m}${_sep}${_d},${_wd}`,\n day : `${_y}${_sep}${_m}${_sep}${_d}`,\n hour : `${_y}${_sep}${_m}${_sep}${_d} ${_h}`,\n minute : `${_y}${_sep}${_m}${_sep}${_d} ${_h}:${_min}`,\n second : `${_y}${_sep}${_m}${_sep}${_d} ${_h}:${_min}:${_s}`,\n datetime : _tmp.toString()\n })\n }\n _scopes.forEach( ( _scope ) => {\n//console.log( _scope[target_scale], idx );\n if ( ! _scale_grids[_scope[target_scale]] ) {\n _scale_grids[_scope[target_scale]] = 1\n } else {\n _scale_grids[_scope[target_scale]]++\n }\n })\n//console.log( '!_getGridsPerScale:', target_scale, _scale_grids )\n \n return this.toIterableObject( _scale_grids )\n }\n \n /**\n * Create the content of ruler of the timeline\n * @private\n * @param {Object} _line_grids - \n * @param {string} line_scale - \n * @param {RulerOptions} ruler - \n * @return {Object} Generated DOM element\n */\n _createRulerContent( _line_grids, line_scale, ruler ) {\n let _opts = this._config,\n _props = this._instanceProps,\n line_height = this.supplement( Default.ruler.top.height, ruler.height ),\n font_size = this.supplement( Default.ruler.top.fontSize, ruler.fontSize ),\n text_color = this.supplement( Default.ruler.top.color, ruler.color ),\n locale = this.supplement( Default.ruler.top.locale, ruler.locale, this.validateString ),\n format = this.supplement( Default.ruler.top.format, ruler.format, this.validateObject ),\n _ruler_lines = $('
', { class: ClassName.TIMELINE_RULER_LINES, style: `width:100%;height:${line_height}px;` })\n \n for ( let _key of Object.keys( _line_grids ) ) {\n let _item_width = /^(year|month)s?$/i.test( _opts.scale ) ? _line_grids[_key] : _line_grids[_key] * _props.scaleSize,\n _line = $('
', { class: ClassName.TIMELINE_RULER_ITEM, style: `width:${_item_width}px;height:${line_height}px;line-height:${line_height}px;font-size:${font_size}px;color:${text_color};` }),\n _ruler_string = this.getLocaleString( _key, line_scale, locale, format ),\n _data_ruler_item = ''\n//console.log( '!_createRulerContent:', _key, _line_grids[_key], line_scale, locale, format, _item_width, _ruler_string )\n \n _data_ruler_item = `${line_scale}-${( _data_ruler_item === '' ? String( _key ) : _data_ruler_item )}`\n _line.attr( 'data-ruler-item', _data_ruler_item ).html( _ruler_string )\n \n if ( _item_width > this.strWidth( _ruler_string ) ) {\n // Adjust position of ruler item string\n//console.log( _item_width, _ruler_string, _ruler_string.length, this.strWidth( _ruler_string ), $(this._element).width() )\n if ( _item_width > $(this._element).width() ) {\n _line.addClass( ClassName.RULER_ITEM_ALIGN_LEFT )\n }\n }\n \n _ruler_lines.append( _line ).attr( 'data-ruler-scope', line_scale )\n }\n \n return _ruler_lines\n }\n \n /**\n * Create the side indexes of the timeline\n * @private\n * @param {Object} margin - \n * @param {number} margin.top - \n * @param {number} margin.bottom - \n * @return {Object} Generated DOM element\n */\n _createSideIndex( margin ) {\n let _opts = this._config,\n _props = this._instanceProps,\n _sticky = this.supplement( Default.sidebar.sticky, _opts.sidebar.sticky ),\n _overlay = this.supplement( Default.sidebar.overlay, _opts.sidebar.overlay ),\n _sbList = this.supplement( Default.sidebar.list, _opts.sidebar.list ),\n _wrapper = $('
', { class: ClassName.TIMELINE_SIDEBAR }),\n _margin = $('
', { class: ClassName.TIMELINE_SIDEBAR_MARGIN }),\n _list = $('
', { class: ClassName.TIMELINE_SIDEBAR_ITEM }),\n _c = 0.5\n \n if ( _sticky ) {\n _wrapper.addClass( ClassName.STICKY_LEFT )\n }\n \n if ( _overlay ) {\n _list.addClass( ClassName.OVERLAY )\n }\n \n //_wrapper.css( 'margin-top', margin.top + 'px' ).css( 'margin-bottom', margin.bottom + 'px' )\n if ( margin.top > 0 ) {\n _wrapper.prepend( _margin.clone().css( 'height', `${( margin.top + 1 )}px` ) )\n }\n \n for ( let i = 0; i < _props.rows; i++ ) {\n let _item = _list.clone().html( _sbList[i] )\n \n _wrapper.append( _item )\n }\n _wrapper.find( Selector.TIMELINE_SIDEBAR_ITEM ).css( 'height', `${( _props.rowSize + _c )}px` ).css( 'line-height', `${( _props.rowSize + _c )}px` )\n \n if ( margin.bottom > 0 ) {\n _wrapper.append( _margin.clone().css( 'height', `${( margin.bottom + 1 )}px` ) )\n }\n \n return _wrapper\n }\n \n /**\n * Create the footer of the timeline\n * @private\n * @return {Object} Generated DOM element\n */\n _createFooter() {\n let _opts = this._config,\n _props = this._instanceProps,\n _display = this.supplement( Default.footer.display, _opts.footer.display ),\n _content = this.supplement( null, _opts.footer.content ),\n _range = this.supplement( Default.footer.range, _opts.footer.range ),\n _scale = this.supplement( Default.footer.scale, _opts.footer.scale ),\n _locale = this.supplement( Default.footer.locale, _opts.footer.locale ),\n _format = this.supplement( Default.footer.format, _opts.footer.format ),\n _begin = this.supplement( null, _props.begin ),\n _end = this.supplement( null, _props.end ),\n _tl_footer = $('
', { class: ClassName.TIMELINE_FOOTER })\n \n if ( _range ) {\n if ( _begin && _end ) {\n let _meta = `${new Date( _begin ).toLocaleString( _locale, _format )}${new Date( _end ).toLocaleString( _locale, _format )}`\n //let _meta = this.getCorrectDatetime( _begin ).toLocaleString( _locale, _format ) +''+ this.getCorrectDatetime( _end ).toLocaleString( _locale, _format )\n \n _tl_footer.append( `
${_meta}
` )\n }\n }\n if ( _content ) {\n _tl_footer.append( `` )\n }\n if ( ! _display ) {\n _tl_footer.addClass( ClassName.HIDE )\n }\n \n return _tl_footer\n }\n \n /**\n * Acquire the difference between two dates with the specified scale value\n * @private\n * @param {number} date1 - Number that can be parsed as datetime\n * @param {number} date2 - Number that can be parsed as datetime\n * @param {string} [scale=\"millisecond\"] - \n * @param {boolean} [absval=false] - \n * @return {number|boolean}\n */\n _diffDate( date1, date2, scale = 'millisecond', absval = false ) {\n //let _opts = this._config,\n let _dt1 = this.supplement( null, date1 ),\n _dt2 = this.supplement( null, date2 ),\n diffMS = 0,\n retval = false,\n lastDayOfMonth = ( dateObj ) => {\n let _tmp = new Date( dateObj.getFullYear(), dateObj.getMonth() + 1, 1 )\n _tmp.setTime( _tmp.getTime() - 1 )\n return _tmp.getDate()\n },\n isLeapYear = ( dateObj ) => {\n let _tmp = new Date( dateObj.getFullYear(), 0, 1 ),\n sum = 0\n \n for ( let i = 0; i < 12; i++ ) {\n _tmp.setMonth(i)\n sum += lastDayOfMonth( _tmp )\n }\n return sum == 365 ? false : true\n }\n \n if ( ! _dt1 || ! _dt2 ) {\n console.warn( 'Cannot parse date because invalid format or undefined.' )\n return false\n }\n \n diffMS = _dt2 - _dt1\n \n if ( absval ) {\n diffMS = Math.abs( diffMS )\n }\n \n let _bd = new Date( _dt1 ),\n _ed = new Date( _dt2 ),\n _dy = _ed.getFullYear() - _bd.getFullYear(),\n _m = {}\n \n switch ( true ) {\n case /^years?$/i.test( scale ):\n if ( _dy > 0 ) {\n for ( let i = 0; i <= _dy; i++ ) {\n let _cd = new Date( _bd.getFullYear() + i, 0, 1 )\n _m[`${_bd.getFullYear() + i}`] = isLeapYear( _cd ) ? 366 : 365\n }\n } else {\n _m[`${_bd.getFullYear()}`] = isLeapYear( _bd ) ? 366 : 365\n }\n retval = _m\n break\n case /^months?$/i.test( scale ):\n if ( _dy > 0 ) {\n for ( let i = _bd.getMonth(); i < 12; i++ ) {\n let _cd = new Date( _bd.getFullYear(), i, 1 )\n _m[`${_bd.getFullYear()}/${i + 1}`] = lastDayOfMonth( _cd )\n }\n if ( _dy > 1 ) {\n for ( let y = 1; y < _dy; y++ ) {\n for ( let i = 0; i < 12; i++ ) {\n let _cd = new Date( _bd.getFullYear() + y, i, 1 )\n _m[`${_bd.getFullYear() + y}/${i + 1}`] = lastDayOfMonth( _cd )\n }\n }\n }\n for ( let i = 0; i <= _ed.getMonth(); i++ ) {\n let _cd = new Date( _ed.getFullYear(), i, 1 )\n _m[`${_ed.getFullYear()}/${i + 1}`] = lastDayOfMonth( _cd )\n }\n } else {\n for ( let i = _bd.getMonth(); i <= _ed.getMonth(); i++ ) {\n let _cd = new Date( _bd.getFullYear(), i, 1 )\n _m[`${_bd.getFullYear()}/${i + 1}`] = lastDayOfMonth( _cd )\n }\n }\n retval = _m\n break\n case /^weeks?$/i.test( scale ):\n retval = Math.ceil( diffMS / ( 7 * 24 * 60 * 60 * 1000 ) )\n break\n case /^(|week)days?$/i.test( scale ):\n retval = Math.ceil( diffMS / ( 24 * 60 * 60 * 1000 ) )\n break\n case /^hours?$/i.test( scale ):\n retval = Math.ceil( diffMS / ( 60 * 60 * 1000 ) )\n break\n case /^minutes?$/i.test( scale ):\n retval = Math.ceil( diffMS / ( 60 * 1000 ) )\n break\n case /^seconds?$/i.test( scale ):\n retval = Math.ceil( diffMS / 1000 )\n break\n default:\n retval = diffMS\n break\n }\n//console.log( '!_diffDate:', retval )\n \n return retval\n }\n \n /**\n * Load all enabled events markupped on target element to the timeline object\n * @private\n */\n _loadEvent() {\n this._debug( '_loadEvent' )\n \n let _that = this,\n _elem = this._element,\n _event_list = $(_elem).find( Selector.DEFAULT_EVENTS ),\n _cnt = 0,\n events = [],\n lastEventId = 0\n \n _event_list.children().each(function() {\n let _attr = $(this).attr( 'data-timeline-node' )\n \n if ( typeof _attr !== 'undefined' && _attr !== false ) {\n _cnt++\n }\n })\n \n if ( _event_list.length == 0 || _cnt == 0 ) {\n this._debug( 'Enable event does not exist.' )\n }\n \n // Register Event Data\n _event_list.children().each(function() {\n let _evt_params = _that._getPluggableParams( $(this).attr( 'data-timeline-node' ) ),\n _one_event = {}\n \n if ( ! _that.is_empty( _evt_params ) ) {\n _one_event = _that._registerEventData( this, _evt_params )\n events.push( _one_event )\n lastEventId = Math.max( lastEventId, parseInt( _one_event.eventId, 10 ) )\n }\n });\n // Set event id with auto increment (:> イベントIDを自動採番\n let cacheIds = [] // for checking duplication of id (:> IDの重複チェック用\n events.forEach( ( _evt, _i, _this ) => {\n let _chkId = parseInt( _this[_i].eventId, 10 )\n \n if ( _chkId == 0 || cacheIds.includes( _chkId ) ) {\n lastEventId++\n _this[_i].eventId = lastEventId\n } else {\n _this[_i].eventId = _chkId\n }\n cacheIds.push( _this[_i].eventId )\n });\n \n this._isCached = this._saveToCache( events )\n \n }\n \n /**\n * Register one event data as object\n * @private\n * @param {Object} event_element - \n * @param {Object} params - \n * @return {Object} Registered new event data\n */\n _registerEventData( event_element, params ) {\n let _opts = this._config,\n _props = this._instanceProps,\n new_event = {\n ...EventParams,\n ...{\n uid : this.generateUniqueID(),\n label : $(event_element).html()\n }\n },\n _relation = {},\n _x, _w, _c //, _pointSize\n//console.log( '!_registerEventData:', _opts, params )\n \n if ( params.hasOwnProperty( 'start' ) && ! this.is_empty( params.start ) ) {\n _x = this._getCoordinateX( params.start )\n new_event.x = this.numRound( _x, 2 )\n if ( params.hasOwnProperty( 'end' ) && ! this.is_empty( params.end ) ) {\n _x = this._getCoordinateX( params.end )\n _w = _x - new_event.x\n new_event.width = this.numRound( _w, 2 )\n \n if ( _opts.eventMeta.display ) {\n if ( this.is_empty( _opts.eventMeta.content ) && ! params.hasOwnProperty( 'rangeMeta' ) ) {\n//console.log( '!_registerEventData:', _opts.eventMeta.locale, _opts.eventMeta.format, _opts.scale, params )\n \n new_event.rangeMeta += this.getLocaleString( params.start, _opts.eventMeta.scale, _opts.eventMeta.locale, _opts.eventMeta.format )\n new_event.rangeMeta += ` - ${this.getLocaleString( params.end, _opts.eventMeta.scale, _opts.eventMeta.locale, _opts.eventMeta.format )}`\n } else {\n new_event.rangeMeta = _opts.eventMeta.content\n }\n }\n } else {\n new_event.width = 0\n }\n//console.log( 'getX:', _x, 'getW:', _w, event_element )\n if ( params.hasOwnProperty( 'row' ) ) {\n _c = Math.floor( params.row / 2 )\n new_event.y = ( params.row - 1 ) * _opts.rowHeight + new_event.margin + _c\n }\n \n Object.keys( new_event ).forEach( ( _prop ) => {\n switch( true ) {\n case /^eventId$/i.test( _prop ):\n if ( params.hasOwnProperty( 'id' ) && this.is_empty( new_event.eventId ) ) {\n new_event.eventId = parseInt( params.id, 10 )\n } else {\n new_event.eventId = parseInt( params[_prop], 10 ) || 0\n }\n break\n case /^(label|content)$/i.test( _prop ):\n if ( params.hasOwnProperty( _prop ) && ! this.is_empty( params[_prop] ) ) {\n new_event[_prop] = params[_prop]\n }\n // Override the children element to label or content setting\n if ( $(event_element).children(`.event-${_prop}`).length > 0 ) {\n new_event[_prop] = $(event_element).children(`.event-${_prop}`).html()\n }\n//console.log( '!_registerEventData:', _prop, params[_prop], new_event[_prop] )\n break\n case /^relation$/i.test( _prop ):\n // For drawing the relation line\n if ( /^point(|er)$/i.test( _opts.type ) ) {\n //let _pointSize = this._getPointerSize( new_event.size, new_event.margin )\n _relation.x = this.numRound( new_event.x, 2 )\n _relation.y = this.numRound( ( _props.rowSize * ( ( params.row || 1 ) - 1 ) ) + ( _props.rowSize / 2 ), 2 )\n \n//console.log( '!_registerEventData:', params, new_event.x, new_event.y, _pointSize, _relation )\n new_event[_prop] = {\n ...params[_prop],\n ..._relation\n }\n }\n break\n default:\n if ( params.hasOwnProperty( _prop ) && ! this.is_empty( params[_prop] ) ) {\n new_event[_prop] = params[_prop]\n }\n break\n }\n });\n }\n//console.log( '!_registerEventData:', new_event )\n return new_event\n }\n \n /**\n * Get the coordinate X on the timeline of any date\n * @private\n * @param {string} date - \n * @return {number} The pixel value as the coordinate X on timeline\n */\n _getCoordinateX( date ) {\n //let _opts = this._config,\n let _props = this._instanceProps,\n _date = this.supplement( null, this._getPluggableDatetime( date ) ),\n coordinate_x = 0\n \n if ( _date ) {\n if ( _date - _props.begin >= 0 && _props.end - _date >= 0 ) {\n // When the given date is within the range of timeline begin and end (:> 指定された日付がタイムラインの開始と終了の範囲内にある場合\n coordinate_x = ( Math.abs( _date - _props.begin ) / _props.scale ) * _props.scaleSize\n } else {\n // When the given date is out of timeline range (:> 指定された日付がタイムラインの範囲外にある場合\n coordinate_x = ( ( _date - _props.begin ) / _props.scale ) * _props.scaleSize\n }\n } else {\n console.warn( 'Cannot parse date because invalid format or undefined.' )\n }\n \n return coordinate_x\n }\n \n /**\n * Cache the event data to the web storage\n * @private\n * @param {Object} data - \n */\n _saveToCache( data ) {\n let strageEngine = /^local(|Storage)$/i.test( this._config.storage ) ? 'localStorage' : 'sessionStorage',\n is_available = ( strageEngine in window ) && ( ( strageEngine === 'localStorage' ? window.localStorage : window.sessionStorage ) !== null )\n \n if ( is_available ) {\n if ( strageEngine === 'localStorage' ) {\n localStorage.setItem( this._selector, JSON.stringify( data ) )\n } else {\n sessionStorage.setItem( this._selector, JSON.stringify( data ) )\n }\n return true\n } else {\n throw new TypeError( `The storage named \"${strageEngine}\" can not be available.` )\n }\n }\n \n /**\n * Load the cached event data from the web storage\n * @private\n * @return {Object}\n */\n _loadToCache() {\n let strageEngine = /^local(|Storage)$/i.test( this._config.storage ) ? 'localStorage' : 'sessionStorage',\n is_available = ( strageEngine in window ) && ( ( strageEngine === 'localStorage' ? window.localStorage : window.sessionStorage ) !== null ),\n data = null\n \n if ( is_available ) {\n if ( strageEngine === 'localStorage' ) {\n data = JSON.parse( localStorage.getItem( this._selector ) )\n } else {\n data = JSON.parse( sessionStorage.getItem( this._selector ) )\n }\n } else {\n throw new TypeError( `The storage named \"${strageEngine}\" can not be available.` )\n }\n return data\n }\n \n /**\n * Remove the cache data on the web storage\n * @private\n */\n _removeCache() {\n let strageEngine = /^local(|Storage)$/i.test( this._config.storage ) ? 'localStorage' : 'sessionStorage',\n is_available = ( strageEngine in window ) && ( ( strageEngine === 'localStorage' ? window.localStorage : window.sessionStorage ) !== null )\n \n if ( is_available ) {\n if ( strageEngine === 'localStorage' ) {\n localStorage.removeItem( this._selector )\n } else {\n sessionStorage.removeItem( this._selector )\n }\n } else {\n throw new TypeError( `The storage named \"${strageEngine}\" can not be available.` )\n }\n }\n \n /**\n * Controller method to place event data on timeline\n * @private: \n */\n _placeEvent() {\n this._debug( '_placeEvent' )\n \n if ( ! this._isCached ) {\n return\n }\n \n let _elem = this._element,\n _opts = this._config,\n _evt_container = $(_elem).find( Selector.TIMELINE_EVENTS ),\n _relation_lines = $(_elem).find( Selector.TIMELINE_RELATION_LINES ),\n events = this._loadToCache(),\n _sleep = _opts.debug ? DEBUG_SLEEP : 1\n \n if ( events.length > 0 ) {\n _evt_container.empty()\n events.forEach( ( _evt ) => {\n let _evt_elem = this._createEventNode( _evt )\n \n if ( _evt_elem ) {\n _evt_container.append( _evt_elem )\n }\n })\n }\n \n if ( /^point(|er)$/i.test( _opts.type ) ) {\n this._drawRelationLine( events )\n }\n \n// console.log( '!_placeEvent:', _opts )\n this.sleep( _sleep ).then(() => {\n this.hideLoader()\n _evt_container.fadeIn( 'fast', () => {\n _relation_lines.fadeIn( 'fast' )\n })\n })\n \n }\n \n /**\n * Create an event element on the timeline\n * @private\n * @param {Object} params - \n * @return {Object} Generated DOM element\n */\n _createEventNode( params ) {\n let _opts = this._config,\n _props = this._instanceProps,\n _evt_elem = $('
', {\n class : ClassName.TIMELINE_EVENT_NODE,\n id : `evt-${params.eventId}`,\n css : {\n left : `${params.x}px`,\n top : `${params.y}px`,\n width : `${params.width}px`,\n height : `${params.height}px`,\n color : this.hexToRgbA( params.color ),\n backgroundColor : this.hexToRgbA( params.bgColor ),\n },\n html : `
${params.label}
`\n })\n//console.log( '!_createEventNode:', params )\n \n // Whether this event is within the display range of the timeline (:> タイムライン表示範囲内のイベントかどうか\n // For events excluded, set the width to -1 (:> 除外イベントは幅を -1 に設定する\n if ( params.x >= 0 ) {\n // The event start datetime is over the start datetime of the timeline (:> イベント始点がタイムラインの始点以上\n if ( params.x <= _props.fullwidth ) {\n // The event start datetime is less than or equal to the timeline end datetime (:> イベントの始点がタイムラインの終点以下\n if ( params.x + params.width <= _props.fullwidth ) {\n // The event end datetime is less than before the timeline end datetime (regular event) (:> イベント終点がタイムラインの終点以下(通常イベント)\n // OK\n } else {\n // The event end datetime is after the timeline end datetime (event exceeded end datetime) (:> イベント終点がタイムラインの終点より後(終点超過イベント)\n params.width = _props.fullwidth - params.x\n }\n } else {\n // The event start datetime is after the timeline end datetime (exclude event) (:> イベント始点がタイムラインの終点より後(除外イベント)\n params.width = -1\n }\n } else {\n // The event start datetime is before the timeline start datetime (:> イベント始点がタイムラインの始点より前\n if ( /^point(|er)$/i.test( _opts.type ) ) {\n // In the case of \"point\" type, that is an exclude event (:> ポインター型の場合は除外イベント\n params.width = -1\n } else {\n // The case of \"bar\" type\n if ( params.x + params.width <= 0 ) {\n // The event end datetime is less than before the timeline start datetime (exclude event) (:> イベント終点がタイムラインの始点より前(除外イベント)\n params.width = -1\n } else {\n // The event end datetime is after the timeline start datetime (:> イベント終点がタイムラインの始点より後\n if ( params.x + params.width <= _props.fullwidth ) {\n // The event end datetime is less than or equal the timeline end datetime (event exceeded start datetime) (:> イベント終点がタイムラインの終点以下(始点超過イベント)\n params.width = Math.abs( params.x + params.width )\n params.x = 0\n } else {\n // The event end datetime is after the timeline end datetime (event exceeded both start and end datetime) (:> イベント終点がタイムラインの終点より後(始点・終点ともに超過イベント)\n params.width = _props.fullwidth\n params.x = 0\n }\n }\n }\n }\n//console.log( 'x:', params.x, 'w:', params.width, 'x-end:', Math.abs( params.x ) + params.width, 'fw:', _props.fullwidth, 'ps:', params.size )\n \n if ( /^point(|er)$/i.test( _opts.type ) ) {\n if ( params.width < 0 ) {\n return null\n }\n let _pointSize = this._getPointerSize( params.size, params.margin ),\n _shiftX = this.numRound( params.x - ( _pointSize / 2 ), 2 ),\n _shiftY = this.numRound( params.y + ( ( params.height - _pointSize ) / 2 ), 2 )\n \n//console.log( '!_createEventNode:', params, _pointSize, _shiftX, _shiftY )\n _evt_elem.addClass( ClassName.VIEWER_EVENT_TYPE_POINTER ).css( 'border-color', params.bdColor )\n .css( 'left', `${_shiftX}px` ).css( 'top', `${_shiftY}px` ).css( 'width', `${_pointSize}px` ).css( 'height', `${_pointSize}px` )\n .attr( 'data-base-size', _pointSize ).attr( 'data-base-left', _shiftX ).attr( 'data-base-top', _shiftY )\n } else {\n if ( params.width < 1 ) {\n return null\n }\n _evt_elem.css( 'left', `${params.x}px` ).css( 'width', `${params.width}px` )\n }\n \n _evt_elem.attr( 'data-uid', params.uid )\n \n if ( ! this.is_empty( params.image ) ) {\n if ( /^point(|er)$/i.test( _opts.type ) ) {\n _evt_elem.css( 'background-image', `url(${params.image})` )\n } else {\n let _imgSize = params.height - ( params.margin * 2 )\n _evt_elem.prepend( `` )\n }\n }\n \n if ( /^bar$/i.test( _opts.type ) && _opts.eventMeta.display ) {\n//console.log( '!_createEventNode:', params )\n params.extend.meta = params.rangeMeta\n }\n \n if ( ! this.is_empty( params.extend ) ) {\n for ( let _prop of Object.keys( params.extend ) ) {\n _evt_elem.attr( `data-${_prop}`, params.extend[_prop] )\n if ( _prop === 'toggle' && [ 'popover', 'tooltip' ].includes( params.extend[_prop] ) ) {\n // for bootstrap's popover or tooltip\n _evt_elem.attr( 'title', params.label )\n if ( ! params.extend.hasOwnProperty( 'content' ) ) {\n _evt_elem.attr( 'data-content', params.content )\n }\n }\n }\n }\n \n if ( ! this.is_empty( params.callback ) ) {\n _evt_elem.attr( 'data-callback', params.callback )\n }\n \n return _evt_elem\n }\n \n /**\n * Retrieve the diameter size (pixel) of pointer\n * @private\n * @param {number|string} key - \n * @param {number} margin\n * @return {number} \n */\n _getPointerSize( key, margin ) {\n //let _opts = this._config,\n let _props = this._instanceProps,\n _max = Math.min( _props.scaleSize, _props.rowSize ) - ( margin * 2 ),\n _size = null\n \n switch ( true ) {\n case /^large$/i.test( key ):\n _size = Math.max( this.numRound( _max * 0.8, 1 ), MIN_POINTER_SIZE )\n break\n case /^normal$/i.test( key ):\n _size = Math.max( this.numRound( _max / 2, 1 ), MIN_POINTER_SIZE )\n break\n case /^small$/i.test( key ):\n _size = Math.max( this.numRound( _max / 4, 1 ), MIN_POINTER_SIZE )\n break\n default:\n _size = Math.max( parseInt( key, 10 ), MIN_POINTER_SIZE )\n }\n \n//console.log( '!_getPointerSize:', _props, key, _max, _size )\n return _size\n }\n \n /**\n * Draw the relational lines\n * @private\n * @param {Object} events - \n */\n _drawRelationLine( events ) {\n let _opts = this._config,\n _props = this._instanceProps,\n _canvas = $(this._element).find( Selector.TIMELINE_RELATION_LINES ),\n ctx_relations = _canvas[0].getContext('2d'),\n drawLine = ( _sx, _sy, _ex, _ey, evt, _ba ) => {\n let _curveType = {},\n _radius = this.numRound( Math.min( _props.scaleSize, _props.rowSize ) / 2, 2 ),\n _subRadius = this.numRound( this._getPointerSize( evt.size, _opts.marginHeight ) / 2, 2 )\n \n // Defaults\n ctx_relations.strokeStyle = EventParams.bdColor\n ctx_relations.lineWidth = 2.5\n ctx_relations.filter = 'url(#crisp)'\n \n for ( let _key of Object.keys( evt.relation ) ) {\n switch ( true ) {\n case /^(|line)color$/i.test( _key ):\n ctx_relations.strokeStyle = evt.relation[_key]\n break\n case /^(|line)size$/i.test( _key ):\n ctx_relations.lineWidth = parseInt( evt.relation[_key], 10 ) || 2.5\n break\n case /^curve$/i.test( _key ):\n if ( /^(r|l)(t|b),?(r|l)?(t|b)?$/i.test( evt.relation[_key] ) ) {\n let _tmp = evt.relation[_key].split(',')\n if ( _tmp.length == 2 ) {\n _curveType.before = _tmp[0]\n _curveType.after = _tmp[1]\n } else {\n _curveType[_ba] = _tmp[0]\n }\n } else\n if ( ( typeof evt.relation[_key] === 'boolean' && evt.relation[_key] ) || ( typeof evt.relation[_key] === 'number' && Boolean( evt.relation[_key] ) ) ) {\n // Automatically set the necessary linearity type (:> 自動線形判定\n//console.log( _sx, _sy, _ex, _ey, _radius, _ba, _subRadius )\n if ( _ba === 'before' ) {\n // before: targetEvent[ _ex, _ey ] <---- selfEvent[ _sx, _sy ]\n if ( _sy > _ey ) {\n // 連結点が自分より上にある\n if ( _sx > _ex ) {\n // 連結点が自分より左にある \"(_ex,_ey)└(_sx,_sy)\" as \"lb\"\n _curveType[_ba] = 'lb'\n } else\n if ( _sx < _ex ) {\n // 連結点が自分より右にある \"⊂ ̄\" as \"lb+lt\"\n _curveType[_ba] = 'lb+lt'\n } else {\n // 連結点が自分の直上 \"│\" to top\n _curveType[_ba] = null\n }\n } else\n if ( _sy < _ey ) {\n // 連結点が自分より下にある\n if ( _sx > _ex ) {\n // 連結点が自分より左にある \"(_ex,_ey)┌(_sx,_sy)\" as \"lt\"\n _curveType[_ba] = 'lt'\n } else\n if ( _sx < _ex ) {\n // 連結点が自分より右にある \"⊂_\" as \"rt+rb\"\n _curveType[_ba] = 'lt+lb'\n } else {\n // 連結点が自分の直下 \"│\" to bottom\n _curveType[_ba] = null\n }\n } else {\n // 連結点が自分と同じ水平上にある(左右どちらか) _sy == _ey; \"─\" to left or right\n _curveType[_ba] = null\n }\n } else\n if ( _ba === 'after' ) {\n // after: selfEvent[ _sx, _sy ] ----> targetEvent[ _ex, _ey ]\n if ( _sy < _ey ) {\n // Relational endpoint is located \"under\" self (:> 連結点が自分の下にある\n if ( _sx < _ex ) {\n // Then relational endpoint is located \"right\" self (:> 連結点が自分の右にある \"(_sx,_sy)┐(_ex,_ey)\" as \"rt\"\n _curveType[_ba] = 'rt'\n } else\n if ( _sx > _ex ) {\n // Then relational endpoint is located \"left\" self (:> 連結点が自分より左にある \"_⊃\" as \"rt+rb\"\n _curveType[_ba] = 'rt+rb'\n } else {\n // Relational endpoint is located \"just under\" self (:> 連結点が自分の直下 \"│\" to bottom\n _curveType[_ba] = null\n }\n } else\n if ( _sy > _ey ) {\n // Relational endpoint is located \"above\" self (:> 連結点が自分より上にある\n if ( _sx < _ex ) {\n // Then relational endpoint is located \"right\" self (:> 連結点が自分の右にある \"┘\" as \"rb\"\n _curveType[_ba] = 'rb'\n } else\n if ( _sx > _ex ) {\n // Then relational endpoint is located \"left\" self (:> 連結点が自分より左にある \" ̄⊃\" as \"rb+rt\"\n _curveType[_ba] = 'rb+rt'\n } else {\n // Relational endpoint is located \"just under\" self (:> 連結点が自分の直上 \"│\" to top\n _curveType[_ba] = null\n }\n } else {\n // 連結点が自分と同じ水平上にある(左右どちらか) _sy == _ey; \"─\" to left or right\n _curveType[_ba] = null\n }\n }\n }\n break\n }\n }\n if ( Math.abs( _ey - _sy ) > _props.rowSize ) {\n _ey += Math.floor( Math.abs( _ey - _sy ) / _props.rowSize )\n }\n ctx_relations.beginPath()\n if ( ! this.is_empty( _curveType ) ) {\n// console.log( '!_drawLine:', _curveType, _sx, _sy, _ex, _ey, _radius )\n switch ( true ) {\n case /^lt$/i.test( _curveType[_ba] ): // \"(_ex,_ey)┌(_sx,_sy)\"\n ctx_relations.moveTo( _sx, _sy )\n if ( Math.abs( _sx - _ex ) > _radius ) {\n ctx_relations.lineTo( _ex - _radius, _sy ) // \"─\"\n }\n if ( Math.abs( _ey - _sy ) > _radius ) {\n ctx_relations.quadraticCurveTo( _ex, _sy, _ex, _sy + _radius ) // \"┌\"\n ctx_relations.lineTo( _ex, _ey ) // \"│\"\n } else {\n ctx_relations.quadraticCurveTo( _ex, _sy, _ex, _ey ) // \"┌\"\n }\n break\n case /^lb$/i.test( _curveType[_ba] ): // \"(_ex,_ey)└(_sx,_sy)\"\n ctx_relations.moveTo( _sx, _sy )\n if ( Math.abs( _sx - _ex ) > _radius ) {\n ctx_relations.lineTo( _ex + _radius, _sy ) // \"─\"\n }\n if ( Math.abs( _sy - _ey ) > _radius ) {\n ctx_relations.quadraticCurveTo( _ex, _sy, _ex, _sy - _radius ) // \"└\"\n ctx_relations.lineTo( _ex, _ey ) // \"│\"\n } else {\n ctx_relations.quadraticCurveTo( _ex, _sy, _ex, _ey ) // \"└\"\n }\n break\n case /^rt$/i.test( _curveType[_ba] ): // \"(_sx,_sy)┐(_ex,_ey)\"\n ctx_relations.moveTo( _sx, _sy )\n if ( Math.abs( _ex - _sx ) > _radius ) {\n ctx_relations.lineTo( _ex - _radius, _sy ) // \"─\"\n }\n if ( Math.abs( _ey - _sy ) > _radius ) {\n ctx_relations.quadraticCurveTo( _ex, _sy, _ex, _sy + _radius ) // \"┐\"\n ctx_relations.lineTo( _ex, _ey )\n } else {\n ctx_relations.quadraticCurveTo( _ex, _sy, _ex, _ey ) // \"┐\"\n }\n break\n case /^rb$/i.test( _curveType[_ba] ): // \"(_sx,_sy)┘(_ex,_ey)\"\n ctx_relations.moveTo( _sx, _sy )\n if ( Math.abs( _ex - _sx ) > _radius ) {\n ctx_relations.lineTo( _ex - _radius, _sy ) // \"─\"\n }\n if ( Math.abs( _sy - _ey ) > _radius ) {\n ctx_relations.quadraticCurveTo( _ex, _sy, _ex, _sy - _radius ) // \"┘\"\n ctx_relations.lineTo( _ex, _ey )\n } else {\n ctx_relations.quadraticCurveTo( _ex, _sy, _ex, _ey ) // \"┘\"\n }\n break\n case /^lt\\+lb$/i.test( _curveType[_ba] ): // \"⊂_\"\n case /^lb\\+lt$/i.test( _curveType[_ba] ): // \"⊂ ̄\"\n ctx_relations.moveTo( _sx, _sy )\n //ctx_relations.lineTo( _sx - _subRadius, _sy ) // \"─\"\n ctx_relations.lineTo( _sx - _radius, _sy ) // \"─\"\n //ctx_relations.bezierCurveTo( _sx - _subRadius - _radius, _sy, _sx - _subRadius - _radius, _ey, _sx - _subRadius, _ey ) // \"⊂\"\n ctx_relations.bezierCurveTo( _sx - _radius * 2, _sy, _sx - _radius * 2, _ey, _sx - _radius, _ey ) // \"⊂\"\n ctx_relations.lineTo( _ex, _ey ) // \"─\"\n break\n case /^rt\\+rb$/i.test( _curveType[_ba] ): // \"_⊃\"\n case /^rb\\+rt$/i.test( _curveType[_ba] ): // \" ̄⊃\"\n ctx_relations.moveTo( _sx, _sy )\n //ctx_relations.lineTo( _sx + _subRadius, _sy ) // \"─\"\n ctx_relations.lineTo( _sx + _radius, _sy ) // \"─\"\n //ctx_relations.bezierCurveTo( _sx + _subRadius + _radius, _sy, _sx + _subRadius + _radius, _ey, _sx + _subRadius, _ey ) // \"⊃\"\n ctx_relations.bezierCurveTo( _sx + _radius * 2, _sy, _sx + _radius * 2, _ey, _sx + _radius, _ey ) // \"⊃\"\n ctx_relations.lineTo( _ex, _ey ) // \"─\"\n break\n }\n } else {\n ctx_relations.moveTo( _sx, _sy )\n ctx_relations.lineTo( _ex, _ey )\n }\n //ctx_relations.closePath()\n ctx_relations.stroke()\n }\n \n ctx_relations.clearRect( 0, 0, _canvas[0].width, _canvas[0].height )\n//console.log( '!_drawRelationLine:', _props, events, _canvas )\n events.forEach( ( evt ) => {\n let _rel = evt.relation,\n _sx, _sy, _ex, _ey, \n _targetId, _targetEvent\n \n if ( _rel.hasOwnProperty( 'before' ) ) {\n // before: targetEvent[ _ex, _ey ] <---- selfEvent[ _sx, _sy ]\n // (:> before: 自分を起点( _sx, _sy )として左方向の連結点( _ex, _ey )へ向かう描画方式\n _sx = _rel.x\n _sy = _rel.y\n _targetId = parseInt( _rel.before, 10 )\n if ( _targetId < 0 ) {\n _ex = 0\n _ey = _sy\n } else {\n _targetEvent = events.find( ( _evt ) => parseInt( _evt.eventId, 10 ) == _targetId )\n if ( ! this.is_empty( _targetEvent ) && _targetEvent.relation ) {\n _ex = _targetEvent.relation.x < 0 ? 0 : _targetEvent.relation.x\n _ey = _targetEvent.relation.y\n }\n }\n if ( _sx >= 0 && _sy >= 0 && _ex >= 0 && _ey >= 0 ) {\n drawLine( _sx, _sy, _ex, _ey, evt, 'before' )\n }\n }\n if ( _rel.hasOwnProperty( 'after' ) ) {\n // after: selfEvent[ _sx, _sy ] ----> targetEvent[ _ex, _ey ]\n // (:> after: 自分を起点( _sx, _sy )として右方向の連結点( _ex, _ey )へ向かう描画方式\n _sx = _rel.x\n _sy = _rel.y\n _targetId = parseInt( _rel.after, 10 )\n if ( _targetId < 0 ) {\n _ex = _props.fullwidth\n _ey = _sy\n } else {\n _targetEvent = events.find( ( _evt ) => parseInt( _evt.eventId, 10 ) == _targetId )\n if ( ! this.is_empty( _targetEvent ) && _targetEvent.relation ) {\n _ex = _targetEvent.relation.x > _props.fullwidth ? _props.fullwidth : _targetEvent.relation.x\n _ey = _targetEvent.relation.y\n }\n }\n if ( _sx >= 0 && _sy >= 0 && _ex >= 0 && _ey >= 0 ) {\n drawLine( _sx, _sy, _ex, _ey, evt, 'after' )\n }\n }\n \n })\n \n }\n \n /**\n * Retrieve the mapping data that placed current events\n * @private\n * @return {number[]}\n */\n _mapPlacedEvents() {\n let _that = this,\n _tl_events = $(this._element).find( Selector.TIMELINE_EVENTS ).children(),\n _cache = this._loadToCache(),\n _events = []\n \n if ( ! this._isCached || this.is_empty( _cache ) ) {\n return _events\n }\n \n _tl_events.each(function() {\n let _uid = $(this).data( 'uid' ),\n _data = null\n \n if ( _cache ) {\n _data = _cache.find( ( _evt ) => _evt.uid === _uid ) || null\n } else {\n _data = $(this).data()\n }\n \n if ( ! _that.is_empty( _data ) ) {\n _events.push( _data )\n }\n })\n//console.log( '!_mapPlacedEvents:', _events )\n \n return _events\n }\n \n /**\n * Event when focus or blur\n * @private\n * @param {Object} event - \n */\n _activeEvent( event ) {\n// console.log( '!_activeEvent:', event )\n let _elem = event.target\n \n if ( 'focusin' === event.type ) {\n $( Selector.TIMELINE_EVENT_NODE ).removeClass( 'active' )\n $(_elem).addClass( 'active' )\n } else\n if ( 'focusout' === event.type ) {\n $(_elem).removeClass( 'active' )\n }\n }\n \n /**\n * Event when hover on the pointer type event\n * @private\n * @param {Object} event - \n */\n _hoverPointer( event ) {\n let _props = this._instanceProps,\n _elem = event.target,\n _base = {\n left : $(_elem).data( 'baseLeft' ),\n top : $(_elem).data( 'baseTop' ),\n width : $(_elem).data( 'baseSize' )\n },\n _x = _base.left,\n _y = _base.top,\n _w = _base.width,\n _z = 5\n \n//console.log( '!_hoverPointer:', _props )\n if ( 'mouseenter' === event.type ) {\n _w = Math.max( this.numRound( _w * 1.2, 'ceil' ), Math.min( _props.rowSize, _props.scaleSize ) )\n _x = this.numRound( _x - ( ( _w - _base.width ) / 2 ), 2 )\n _y = this.numRound( _y - ( ( _w - _base.width ) / 2 ), 2 )\n _z = 9\n $(_elem).trigger( Event.FOCUSIN_EVENT )\n } else {\n $(_elem).trigger( Event.FOCUSOUT_EVENT )\n }\n $(_elem).css( 'left', `${_x}px` ).css( 'top', `${_y}px` ).css( 'width', `${_w}px` ).css( 'height', `${_w}px` ).css( 'z-index', _z )\n }\n\n /**\n * Logger of errors when the method execution\n * @private\n * @param {!string} message - \n * @param {string} [type='error'] - \n */\n _error( message, type = 'error' ) {\n if ( message && window.console ) {\n type = window.console[type] ? type : 'error'\n console[type]( message )\n }\n }\n\n /**\n * Echo the log of plugin for debugging\n * @private\n * @param {string} message - \n * @param {string} [throwType=\"Notice\"] - \n */\n _debug( message, throwType = 'Notice' ) {\n if ( ! this._config.debug ) {\n return\n }\n message = this.supplement( null, message )\n if ( message ) {\n let _msg = typeof $(this._element).data( DATA_KEY )[message] !== 'undefined' ? `Called method \"${message}\".` : message,\n _sty = /^Called method \"/.test(_msg) ? 'font-weight:600;color:blue;' : '',\n _rst = ''\n \n if ( window.console && window.console.log ) {\n if ( throwType === 'Notice' ) {\n window.console.log( '%c%s%c', _sty, _msg, _rst )\n } else {\n throw new Error( `${_msg}` )\n }\n }\n }\n }\n \n // Public\n \n /**\n * This method is able to call only once after completed an initializing of the plugin\n * @public\n * @param {?Function()} callback - Custom callback fired after calling this method\n * @param {?(number|string|Object)} userdata - Data as object of referable in that callback\n */\n initialized( ...args ) {\n let _message = this._isInitialized ? 'Skipped because method \"initialized\" already has been called once' : 'initialized'\n this._debug( _message )\n \n let _elem = this._element,\n _opts = this._config,\n _args = args[0],\n callback = _args.length > 0 && typeof _args[0] === 'function' ? _args[0] : null,\n userdata = _args.length > 1 ? _args.slice(1) : null\n \n// console.log( '!initialized:', callback, userdata )\n if ( callback && ! this._isInitialized ) {\n this._debug( 'Fired your callback function after initializing this plugin.' )\n \n callback( _elem, _opts, userdata )\n }\n \n this._isInitialized = true\n \n }\n \n /**\n * Destroy the object to which the plugin is applied\n * @public\n */\n destroy() {\n this._debug( 'destroy' )\n \n $.removeData( this._element, DATA_KEY )\n \n $(window, document, this._element).off( EVENT_KEY )\n \n $(this._element).remove()\n \n this._removeCache()\n \n for ( let _prop of Object.keys( this ) ) {\n this[_prop] = null\n delete this[_prop]\n }\n }\n \n /**\n * @deprecated This method has been deprecated since version 2.0.0\n */\n render() {\n throw new ReferenceError( 'This method named \"render\" has been deprecated since version 2.0.0' )\n }\n \n /**\n * Show hidden timeline\n * @public\n */\n show() {\n this._debug( 'show' )\n \n let _elem = this._element\n \n if ( ! this._isShown ) {\n $(_elem).removeClass( ClassName.HIDE )\n \n this._isShown = true\n }\n }\n \n /**\n * Hide shown timeline\n * @public\n */\n hide() {\n this._debug( 'hide' )\n \n let _elem = this._element\n \n if ( this._isShown ) {\n $(_elem).addClass( ClassName.HIDE )\n \n this._isShown = false\n }\n }\n \n /**\n * Move shift or expand the range of timeline container as to past direction (to left)\n * @public\n * @param {?Object} options - Options for moving as dateback on the timeline container\n * @param {?Function()} callback - Custom callback fired after calling this method\n * @param {?(number|string|Object)} userdata - Data as object of referable in that callback\n */\n dateback( ...args ) {\n this._debug( 'dateback' )\n \n let _args = args[0],\n _opts = this._config,\n moveOpts = this.supplement( null, _args[0], this.validateObject ),\n callback = _args.length > 1 && typeof _args[1] === 'function' ? _args[1] : null,\n userdata = _args.length > 2 ? _args.slice(2) : null,\n newOpts = {},\n begin_date, end_date, _tmpDate\n \n if ( this.is_empty( moveOpts ) ) {\n moveOpts = { scale: _opts.scale, range: _opts.range, shift: true }\n } else {\n if ( ! moveOpts.hasOwnProperty('shift') || moveOpts.shift !== false ) {\n moveOpts.shift = true\n }\n if ( ! moveOpts.hasOwnProperty('scale') || ! this._verifyScale( moveOpts.scale ) ) {\n moveOpts.scale = _opts.scale\n }\n if ( ! moveOpts.hasOwnProperty('range') || parseInt( moveOpts.range, 10 ) > LimitScaleGrids[moveOpts.scale] ) {\n moveOpts.range = _opts.range\n }\n }\n _tmpDate = new Date( _opts.startDatetime )\n begin_date = new Date( _tmpDate.getTime() - ( this._verifyScale( moveOpts.scale ) * parseInt( moveOpts.range, 10 ) ) )\n newOpts.startDatetime = begin_date.toString()\n if ( moveOpts.shift ) {\n _tmpDate = new Date( _opts.endDatetime )\n end_date = new Date( _tmpDate.getTime() - ( this._verifyScale( moveOpts.scale ) * parseInt( moveOpts.range, 10 ) ) )\n newOpts.endDatetime = end_date.toString()\n }\n \n this.reload( [newOpts] )\n \n if ( callback ) {\n this._debug( 'Fired your callback function after datebacking.' )\n \n callback( this._element, _opts, userdata )\n }\n }\n \n /**\n * Move shift or expand the range of timeline container as to futrue direction (to right)\n * @public\n * @param {?Object} options - Options for moving as dateforth on the timeline container\n * @param {?Function()} callback - Custom callback fired after calling this method\n * @param {?(number|string|Object)} userdata - Data as object of referable in that callback\n */\n dateforth( ...args ) {\n this._debug( 'dateforth' )\n \n let _args = args[0],\n _opts = this._config,\n moveOpts = this.supplement( null, _args[0], this.validateObject ),\n callback = _args.length > 1 && typeof _args[1] === 'function' ? _args[1] : null,\n userdata = _args.length > 2 ? _args.slice(2) : null,\n newOpts = {},\n begin_date, end_date, _tmpDate\n \n if ( this.is_empty( moveOpts ) ) {\n moveOpts = { scale: _opts.scale, range: _opts.range, shift: true }\n } else {\n if ( ! moveOpts.hasOwnProperty('shift') || moveOpts.shift !== false ) {\n moveOpts.shift = true\n }\n if ( ! moveOpts.hasOwnProperty('scale') || ! this._verifyScale( moveOpts.scale ) ) {\n moveOpts.scale = _opts.scale\n }\n if ( ! moveOpts.hasOwnProperty('range') || parseInt( moveOpts.range, 10 ) > LimitScaleGrids[moveOpts.scale] ) {\n moveOpts.range = _opts.range\n }\n }\n _tmpDate = new Date( _opts.endDatetime )\n end_date = new Date( _tmpDate.getTime() + ( this._verifyScale( moveOpts.scale ) * parseInt( moveOpts.range, 10 ) ) )\n newOpts.endDatetime = end_date.toString()\n if ( moveOpts.shift ) {\n _tmpDate = new Date( _opts.startDatetime )\n begin_date = new Date( _tmpDate.getTime() + ( this._verifyScale( moveOpts.scale ) * parseInt( moveOpts.range, 10 ) ) )\n newOpts.startDatetime = begin_date.toString()\n }\n \n this.reload( [newOpts] )\n \n if ( callback ) {\n this._debug( 'Fired your callback function after dateforthing.' )\n \n callback( this._element, this._config, userdata )\n }\n }\n \n /**\n * Move the display position of the timeline container to the specified position\n * @public\n * @param {?string} position - The preset string of position on timeline you want to align. Allowed values are \"left\", \"begin\", \"center\", \"right\", \"end\", \"latest\", \"current\", \"currently\" or number of event id\n * @param {?(number|string)} duration - The duration of alignment animation. Allowed values are \"fast\", \"normal\", \"slow\" or number of milliseconds\n */\n alignment( ...args ) {\n this._debug( 'alignment' )\n \n let _opts = this._config,\n _props = this._instanceProps,\n _elem = this._element,\n _tl_container = $(_elem).find( Selector.TIMELINE_CONTAINER ),\n _movX = 0,\n _args = ! this.is_empty( args ) ? args[0] : [],\n position = _args.length > 0 && typeof _args[0] === 'string' ? _args[0] : _opts.rangeAlign,\n duration = _args.length > 1 && /^(\\d{1,}|fast|normal|slow)$/i.test( _args[1] ) ? _args[1] : 0\n \n//console.log( args, _args, position, duration )\n if ( _props.fullwidth <= _elem.scrollWidth ) {\n return\n }\n \n switch ( true ) {\n case /^(left|begin)$/i.test( position ):\n _movX = 0\n break\n case /^center$/i.test( position ):\n _movX = ( _tl_container[0].scrollWidth - _elem.scrollWidth ) / 2 + 1\n break\n case /^(right|end)$/i.test( position ):\n _movX = _tl_container[0].scrollWidth - _elem.scrollWidth + 1\n break\n case /^latest$/i.test( position ): {\n let events = this._mapPlacedEvents().sort( this.compareValues( 'x' ) ),\n lastEvent = events[events.length - 1]\n \n _movX = ! this.is_empty( lastEvent ) ? lastEvent.x : 0\n \n// console.log( events, lastEvent, _movX, _elem.scrollWidth / 2 )\n // Centering\n if ( _elem.scrollWidth / 2 < _movX ) {\n _movX -= Math.ceil( _elem.scrollWidth / 2 )\n } else {\n _movX = 0\n }\n \n // Focus target event\n if ( ! this.is_empty( lastEvent ) ) {\n $(`${Selector.TIMELINE_EVENT_NODE}[data-uid=\"${lastEvent.uid}\"]`).trigger( Event.FOCUSIN_EVENT )\n }\n break\n }\n case /^\\d{1,}$/.test( position ): {\n let events = this._mapPlacedEvents(),\n targetEvent = {}\n \n if ( events.length > 0 ) {\n targetEvent = events.find( ( evt ) => evt.eventId == parseInt( position, 10 ) )\n }\n _movX = ! this.is_empty( targetEvent ) ? targetEvent.x : 0\n \n // Centering\n if ( Math.ceil( _elem.scrollWidth / 2 ) < _movX ) {\n _movX -= Math.ceil( _elem.scrollWidth / 2 )\n } else {\n _movX = 0\n }\n \n // Focus target event\n if ( ! this.is_empty( targetEvent ) ) {\n $(`${Selector.TIMELINE_EVENT_NODE}[data-uid=\"${targetEvent.uid}\"]`).trigger( Event.FOCUSIN_EVENT )\n }\n break\n }\n case /^current(|ly)|now$/i.test( position ):\n default: {\n let _now = new Date().toString(),\n _nowX = this.numRound( this._getCoordinateX( _now ), 2 )\n \n if ( _nowX >= 0 ) {\n if ( _tl_container[0].scrollWidth - _elem.scrollWidth + 1 < _nowX ) {\n _movX = _tl_container[0].scrollWidth - _elem.scrollWidth + 1\n } else {\n _movX = _nowX\n }\n } else {\n _movX = 0\n }\n break\n }\n }\n//console.log( `!alignment::${position}:`, _props.fullwidth, _props.visibleWidth, _tl_container[0].scrollWidth, _tl_container[0].scrollLeft, _movX )\n if ( duration === '0' ) {\n _tl_container.scrollLeft( _movX )\n } else {\n _tl_container.animate({ scrollLeft: _movX }, duration )\n }\n }\n \n /**\n * @deprecated This method has been deprecated since version 2.0.0\n */\n getOptions() {\n throw new ReferenceError( 'This method named \"getOptions\" has been deprecated since version 2.0.0' )\n }\n \n /**\n * Add new events to the rendered timeline object\n * @public\n * @param {?Function()} callback - Custom callback fired after calling this method\n * @param {?(number|string|Object)} userdata - Data as object of referable in that callback\n */\n addEvent( ...args ) {\n this._debug( 'addEvent' )\n \n let _args = args[0],\n events = this.supplement( null, _args[0], this.validateArray ),\n callback = _args.length > 1 && typeof _args[1] === 'function' ? _args[1] : null,\n userdata = _args.length > 2 ? _args.slice(2) : null,\n _cacheEvents = this._loadToCache(),\n lastEventId = 0,\n add_done = false\n \n if ( this.is_empty( events ) || ! this._isCompleted ) {\n return\n }\n \n if ( ! this.is_empty( _cacheEvents ) ) {\n _cacheEvents.sort( this.compareValues( 'eventId' ) )\n lastEventId = parseInt( _cacheEvents[_cacheEvents.length - 1].eventId, 10 )\n }\n//console.log( '!addEvent::before:', _cacheEvents, lastEventId, callback, userdata )\n \n events.forEach( ( evt ) => {\n let _one_event = this._registerEventData( '
', evt )\n \n if ( ! this.is_empty( _one_event ) ) {\n _one_event.eventId = Math.max( lastEventId + 1, parseInt( _one_event.eventId, 10 ) )\n _cacheEvents.push( _one_event )\n lastEventId = parseInt( _one_event.eventId, 10 )\n add_done = true\n }\n })\n//console.log( '!addEvent::after:', _cacheEvents, lastEventId, callback, userdata )\n if ( ! add_done ) {\n return\n }\n \n this._saveToCache( _cacheEvents )\n \n this._placeEvent()\n \n if ( callback ) {\n this._debug( 'Fired your callback function after replacing events.' )\n \n callback( this._element, this._config, userdata )\n }\n }\n \n /**\n * Remove events from the currently timeline object\n * @public\n * @param {?Function()} callback - Custom callback fired after calling this method\n * @param {?(number|string|Object)} userdata - Data as object of referable in that callback\n */\n removeEvent( ...args ) {\n this._debug( 'removeEvent' )\n \n let _args = args[0],\n targets = this.supplement( null, _args[0], this.validateArray ),\n callback = _args.length > 1 && typeof _args[1] === 'function' ? _args[1] : null,\n userdata = _args.length > 2 ? _args.slice(2) : null,\n _cacheEvents = this._loadToCache(),\n condition = {},\n remainEvents = [],\n remove_done = false\n \n if ( this.is_empty( targets ) || ! this._isCompleted || this.is_empty( _cacheEvents ) ) {\n return\n }\n \n targets.forEach( ( cond ) => {\n switch ( true ) {\n case /^\\d{1,}$/.test( cond ):\n // By matching event ID\n condition.type = 'eventId'\n condition.value = parseInt( cond, 10 )\n break\n case /^(|\\d{1,}(-|\\/)\\d{1,2}(-|\\/)\\d{1,2}(|\\s\\d{1,2}:\\d{1,2}(|:\\d{1,2})))(|,\\d{1,}(-|\\/)\\d{1,2}(-|\\/)\\d{1,2}(|\\s\\d{1,2}:\\d{1,2}(|:\\d{1,2})))$/.test( cond ): {\n // By matching range of datetime\n let _tmp = cond.split(',')\n \n condition.type = 'daterange'\n condition.value = {}\n condition.value['from'] = this.is_empty( _tmp[0] ) ? null : new Date( _tmp[0] )\n condition.value['to'] = this.is_empty( _tmp[1] ) ? null : new Date( _tmp[1] )\n break\n }\n default:\n // By matching regex string\n condition.type = 'regex'\n condition.value = new RegExp( cond )\n break\n }\n _cacheEvents.forEach( ( evt, _idx ) => {\n let is_remove = false\n \n switch ( condition.type ) {\n case 'eventId': {\n if ( parseInt( evt.eventId, 10 ) == condition.value ) {\n is_remove = true\n }\n break\n }\n case 'daterange': {\n let _fromX = condition.value.from ? Math.ceil( this._getCoordinateX( condition.value.from.toString() ) ) : 0,\n _toX = condition.value.to ? Math.floor( this._getCoordinateX( condition.value.to.toString() ) ) : _fromX\n \n if ( _fromX <= evt.x && evt.x <= _toX ) {\n is_remove = true\n }\n break\n }\n case 'regex': {\n if ( condition.value.test( JSON.stringify( evt ) ) ) {\n is_remove = true\n }\n break\n }\n }\n if ( ! is_remove ) {\n remainEvents.push( evt )\n }\n })\n })\n remove_done = remainEvents.length !== _cacheEvents.length\n if ( ! remove_done ) {\n return\n }\n \n this._saveToCache( remainEvents )\n \n this._placeEvent()\n \n if ( callback ) {\n this._debug( 'Fired your callback function after placing additional events.' )\n \n callback( this._element, this._config, userdata )\n }\n }\n \n /**\n * Update events on the currently timeline object\n * @public\n * @param {?Function()} callback - Custom callback fired after calling this method\n * @param {?(number|string|Object)} userdata - Data as object of referable in that callback\n */\n updateEvent( ...args ) {\n this._debug( 'updateEvent' )\n \n let _args = args[0],\n events = this.supplement( null, _args[0], this.validateArray ),\n callback = _args.length > 1 && typeof _args[1] === 'function' ? _args[1] : null,\n userdata = _args.length > 2 ? _args.slice(2) : null,\n _cacheEvents = this._loadToCache(),\n update_done = false\n \n if ( this.is_empty( events ) || ! this._isCompleted || this.is_empty( _cacheEvents ) ) {\n return\n }\n \n events.forEach( ( evt ) => {\n let _upc_event = this._registerEventData( '
', evt ), // Update Candidate\n _old_index = null,\n _old_event = _cacheEvents.find( ( _evt, _idx ) => {\n _old_index = _idx\n return _evt.eventId == _upc_event.eventId\n }),\n _new_event = {}\n \n if ( ! this.is_empty( _old_event ) && ! this.is_empty( _upc_event ) ) {\n if ( _upc_event.hasOwnProperty( 'uid' ) ) {\n delete _upc_event.uid\n }\n _new_event = Object.assign( _new_event, _old_event, _upc_event )\n//console.log( _new_event, _old_event, _upc_event, _old_index )\n _cacheEvents[_old_index] = _new_event\n update_done = true\n }\n })\n \n if ( ! update_done ) {\n return\n }\n \n this._saveToCache( _cacheEvents )\n \n this._placeEvent()\n \n if ( callback ) {\n this._debug( 'Fired your callback function after updating events.' )\n \n callback( this._element, this._config, userdata )\n }\n }\n \n /**\n * Reload the timeline with overridable any options\n * @public\n * @param {?Function()} callback - Custom callback fired after calling this method\n * @param {?(number|string|Object)} userdata - Data as object of referable in that callback\n */\n reload( ...args ) {\n this._debug( 'reload' )\n \n let _args = args[0],\n _upc_options = this.supplement( null, _args[0], this.validateObject ),\n callback = _args.length > 1 && typeof _args[1] === 'function' ? _args[1] : null,\n userdata = _args.length > 2 ? _args.slice(2) : null,\n _elem = this._element,\n $default_evt = $(_elem).find( Selector.DEFAULT_EVENTS ),\n _old_options = this._config,\n _new_options = {}\n \n if ( ! this.is_empty( _upc_options ) ) {\n // _new_options = Object.assign( _new_options, _old_options, _upc_options )\n _new_options = this.mergeDeep( _old_options, _upc_options )\n this._config = _new_options\n }\n \n this._isInitialized = false\n this._isCached = false\n this._isCompleted = false\n this._instanceProps = {}\n \n $(_elem).empty().append( $default_evt )\n \n this._calcVars()\n \n if ( ! this._verifyMaxRenderableRange() ) {\n throw new RangeError( `Timeline display period exceeds maximum renderable range.` )\n }\n \n if ( ! this._isInitialized ) {\n this._renderView()\n this._isInitialized = true\n }\n \n if ( this._config.reloadCacheKeep ) {\n let _cacheEvents = this._loadToCache(),\n _renewEvents = []\n \n if ( ! this.is_empty( _cacheEvents ) ) {\n _cacheEvents.forEach( ( evt ) => {\n delete evt.uid\n delete evt.x\n delete evt.Y\n delete evt.width\n delete evt.height\n delete evt.relation.x\n delete evt.relation.y\n _renewEvents.push( this._registerEventData( '
', evt ) )\n })\n }\n this._isCached = this._saveToCache( _renewEvents )\n } else {\n this._loadEvent()\n }\n \n this._placeEvent()\n \n this._isCompleted = true\n \n if ( callback ) {\n this._debug( 'Fired your callback function after reloading timeline.' )\n \n callback( this._element, this._config, userdata )\n }\n }\n \n /**\n * The method that fires when an event on the timeline is clicked\n * Note: You can hook the custom processing with the callback specified in the event parameter\n * @public\n * @param {Object} event - \n */\n openEvent( event ) {\n this._debug( 'openEvent' )\n \n let _that = this,\n _self = event.target,\n $viewer = $(document).find( Selector.EVENT_VIEW ),\n //eventId = parseInt( $(_self).attr( 'id' ).replace( 'evt-', '' ), 10 ),\n uid = $(_self).data( 'uid' ),\n //meta = this.supplement( null, $(_self).data( 'meta' ) ),\n callback = this.supplement( null, $(_self).data( 'callback' ) )\n//console.log( '!openEvent:', _self, $viewer, eventId, uid, meta, callback )\n \n if ( $viewer.length > 0 ) {\n $viewer.each(function() {\n let _cacheEvents = _that._loadToCache(),\n _eventData = _cacheEvents.find( ( event ) => event.uid === uid ),\n _label = $('
', { class: ClassName.VIEWER_EVENT_TITLE }),\n _content = $('
', { class: ClassName.VIEWER_EVENT_CONTENT }),\n _meta = $('
', { class: ClassName.VIEWER_EVENT_META }),\n _image = $('
', { class: ClassName.VIEWER_EVENT_IMAGE_WRAPPER })\n \n//console.log( '!openEvent:', $(this), $(_self).html(), _eventData.label )\n \n $(this).empty() // Initialize Viewer\n if ( ! _that.is_empty( _eventData.image ) ) {\n _image.append( `` )\n $(this).append( _image )\n }\n if ( ! _that.is_empty( _eventData.label ) ) {\n _label.html( _eventData.label )\n $(this).append( _label )\n }\n if ( ! _that.is_empty( _eventData.content ) ) {\n _content.html( _eventData.content )\n $(this).append( _content )\n }\n if ( ! _that.is_empty( _eventData.rangeMeta ) ) {\n _meta.html( _eventData.rangeMeta )\n $(this).append( _meta )\n }\n \n })\n }\n \n if ( callback ) {\n this._debug( `The callback \"${callback}\" was called by the \"openEvent\" method.` )\n \n try {\n Function.call( null, `return ${callback}` )()\n } catch ( e ) {\n throw new TypeError( e )\n }\n }\n }\n \n /**\n * Be zoomed in scale of the timeline that fires when any scales on the ruler is double clicked\n * @public\n * @param {Object} event - \n */\n zoomScale( event ) {\n this._debug( 'zoomScale' )\n \n let _elem = event.target,\n ruler_item = $(_elem).data( 'ruler-item' ),\n scaleMap = {\n millennium : { years: 1000, lower: 'century', minGrids: 10 },\n century : { years: 100, lower: 'decade', minGrids: 10 },\n decade : { years: 10, lower: 'lustrum', minGrids: 2 },\n lustrum : { years: 5, lower: 'year', minGrids: 5 },\n year : { years: 1, lower: 'month', minGrids: 12 },\n month : { lower: 'day', minGrids: 28 },\n week : { lower: 'day', minGrids: 7 },\n day : { lower: 'hour', minGrids: 24 },\n weekday : { lower: 'hour', minGrids: 24 },\n hour : { lower: 'minute', minGrids: 60 },\n minute : { lower: 'second', minGrids: 60 },\n second : { lower: null, minGrids: 60 }\n },\n getZoomScale = ( ruler_item ) => {\n let [ scale, date_seed ] = ruler_item.split('-'),\n min_grids = scaleMap[scale].minGrids,\n begin_date, end_date, base_year, base_month, week_num, base_day, is_remapping, _tmpDate\n \n switch ( true ) {\n case /^millennium$/i.test( scale ):\n case /^century$/i.test( scale ):\n case /^decade$/i.test( scale ):\n case /^lustrum$/i.test( scale ):\n begin_date = `${( ( date_seed - 1 ) * scaleMap[scale].years ) + 1}/1/1`\n _tmpDate = new Date( begin_date, 0, 1 ).setFullYear( date_seed * scaleMap[scale].years + 1 )\n _tmpDate = new Date( _tmpDate - 1 )\n end_date = `${_tmpDate.getFullYear()}/${_tmpDate.getMonth()+1}/${_tmpDate.getDate()} 23:59:59`\n break\n case /^year$/i.test( scale ):\n begin_date = `${date_seed}/1/1`\n _tmpDate = new Date( date_seed, 0, 1 ).setFullYear( parseInt( date_seed, 10 ) + 1 )\n _tmpDate = new Date( _tmpDate - 1 )\n end_date = `${_tmpDate.getFullYear()}/${_tmpDate.getMonth()+1}/${_tmpDate.getDate()} 23:59:59`\n break\n case /^month$/i.test( scale ):\n [ base_year, base_month ] = date_seed.split('/')\n is_remapping = parseInt( base_year, 10 ) < 100\n begin_date = new Date( base_year, parseInt( base_month, 10 ) - 1, 1 )\n if ( begin_date.getMonth() == 11 ) {\n _tmpDate = new Date( begin_date.getFullYear() + 1, 0, 1 ).setFullYear( parseInt( base_year, 10 ) + 1 )\n } else {\n _tmpDate = new Date( begin_date.getFullYear(), begin_date.getMonth() + 1, 1 ).setFullYear( parseInt( base_year, 10 ) )\n }\n begin_date = begin_date.toString()\n end_date = new Date( _tmpDate - 1 ).toString()\n break\n case /^week$/i.test( scale ):\n [ base_year, week_num ] = date_seed.split(',')\n is_remapping = parseInt( base_year, 10 ) < 100\n _tmpDate = new Date( base_year, 0, 1 )\n if ( is_remapping ) {\n _tmpDate.setFullYear( base_year )\n }\n begin_date = new Date( _tmpDate.getTime() + ( week_num * 7 * 24 * 60 * 60 * 1000 ) ).toString()\n end_date = new Date( new Date( begin_date ).getTime() + ( 7 * 24 * 60 * 60 * 1000 ) - 1 ).toString()\n break\n case /^day$/i.test( scale ):\n case /^weekday$/i.test( scale ):\n if ( 'weekday' === scale ) {\n let _tmp = date_seed.split(',')\n date_seed = _tmp[0]\n }\n [ base_year, base_month, base_day ] = date_seed.split('/')\n is_remapping = parseInt( base_year, 10 ) < 100\n _tmpDate = new Date( base_year, parseInt( base_month, 10 ) - 1, base_day )\n begin_date = _tmpDate.toString()\n end_date = new Date( _tmpDate.getTime() + ( 24 * 60 * 60 * 1000 ) - 1 ).toString()\n//console.log( date_seed, base_year, week_num, begin_date, _tmpDate, new Date( _tmpDate ), new Date( _tmpDate - 1 ) )\n break\n case /^hour$/i.test( scale ):\n case /^minute$/i.test( scale ):\n begin_date = `${date_seed}:00`\n end_date = `${date_seed}:59`\n break\n default:\n begin_date = null\n end_date = null\n break\n }\n \n scale = scaleMap.hasOwnProperty( scale ) ? scaleMap[scale].lower : scale\n return [ scale, begin_date, end_date, min_grids ]\n },\n [ to_scale, begin_date, end_date, min_grids ] = getZoomScale( ruler_item ),\n zoom_options = {\n startDatetime : begin_date,\n endDatetime : end_date,\n scale : to_scale,\n }\n \n if ( this.is_empty( zoom_options.scale ) ) {\n return\n }\n if ( this._config.wrapScale ) {\n let _wrap = Math.ceil( ( $(this._element).find(Selector.TIMELINE_CONTAINER).width() - $(this._element).find(Selector.TIMELINE_SIDEBAR).width() ) / min_grids ),\n _originMinGridSize\n \n if ( ! this._config.hasOwnProperty( 'originMinGridSize' ) ) {\n // Keep an original minGridSize as cache\n this._config.originMinGridSize = this._config.minGridSize\n }\n _originMinGridSize = this._config.originMinGridSize\n zoom_options.minGridSize = Math.max( _wrap, _originMinGridSize )\n }\n// console.log( ruler_item, zoom_options, this._config.wrapScale, this._config.minGridSize )\n \n this.reload( [zoom_options] )\n \n }\n \n /**\n * Show the loader\n * @public\n */\n showLoader() {\n this._debug( 'showLoader' )\n \n let _elem = this._element,\n _opts = this._config,\n _container = $(_elem).find( Selector.TIMELINE_CONTAINER ),\n width = _container.length > 0 ? _container.width() : $(_elem).width(),\n height = ( _container.length > 0 ? _container.height() : $(_elem).height() ) || 120,\n _loader = $('
', { id: 'jqtl-loader', style: `width:${width}px;height:${height}px;` })\n \n//console.log( '!showLoader:', width, height, _container.length )\n if ( _opts.loader === false ) {\n return\n }\n \n if ( $(_opts.loader).length == 0 ) {\n let _loading_text = LOADING_MESSAGE.match(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\s\\S]|^$/g).filter( Boolean )\n \n _loading_text.forEach( ( str, idx ) => {\n let _fountain_text = $('
', { id: `jqtl-loading_${( idx + 1 )}`, class: ClassName.LOADER_ITEM }).text( str )\n _loader.append( _fountain_text )\n })\n } else {\n let _custom_loader = $(_opts.loader).clone().prop( 'hidden', false ).css( 'display', 'block' )\n _loader.append( _custom_loader )\n }\n \n if ( $(_elem).find( Selector.LOADER ).length == 0 ) {\n if ( _container.length > 0 ) {\n _container.append( _loader )\n } else {\n $(_elem).css( 'position', 'relative' ).css( 'min-height', `${height}px` ).append( _loader )\n }\n }\n }\n \n /**\n * Hide the loader\n * @public\n */\n hideLoader() {\n this._debug( 'hideLoader' )\n \n $(this._element).find( Selector.LOADER ).remove()\n }\n \n \n /* ----------------------------------------------------------------------------------------------------------------\n * Utility Api\n * ----------------------------------------------------------------------------------------------------------------\n */\n \n /**\n * Determine empty that like PHP\n * @param {!(number|string|Object|number[]|boolean)} value - Variable you want to check\n * @return {boolean}\n */\n is_empty( value ) {\n if ( value == null ) {\n // typeof null -> object : for hack a bug of ECMAScript\n // Refer: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Operators/typeof\n return true\n }\n switch ( typeof value ) {\n case 'object':\n if ( Array.isArray( value ) ) {\n // When object is array:\n return ( value.length === 0 )\n } else {\n // When object is not array:\n if ( Object.keys( value ).length > 0 || Object.getOwnPropertySymbols( value ).length > 0 ) {\n return false\n } else\n if ( value.valueOf().length !== undefined ) {\n return ( value.valueOf().length === 0 )\n } else\n if ( typeof value.valueOf() !== 'object' ) {\n return this.is_empty( value.valueOf() )\n } else {\n return true\n }\n }\n case 'string':\n return ( value === '' )\n case 'number':\n return ( value == 0 )\n case 'boolean':\n return ! value\n case 'undefined':\n case 'null':\n return true\n case 'symbol': // Since ECMAScript6\n case 'function':\n default:\n return false\n }\n }\n \n /**\n * Determine whether variable is an Object\n * @param {!(number|string|Object|boolean)} item - Variable you want to check\n * @return {boolean}\n */\n is_Object( item ) {\n return (item && typeof item === 'object' && ! Array.isArray( item ))\n }\n \n /**\n * Merge two objects deeply as polyfill for instead \"$.extend(true,target,source)\"\n * @param {!Object} target - \n * @param {!Object} source - \n * @return {Object}\n */\n mergeDeep( target, source ) {\n let output = Object.assign( {}, target )\n \n if ( this.is_Object( target ) && this.is_Object( source ) ) {\n for ( const key of Object.keys( source ) ) {\n if ( this.is_Object( source[key] ) ) {\n if ( ! ( key in target ) ) {\n Object.assign( output, { [key]: source[key] } )\n } else {\n output[key] = this.mergeDeep( target[key], source[key] )\n }\n } else {\n Object.assign( output, { [key]: source[key] } )\n }\n }\n }\n return output\n }\n \n /**\n * Determine whether the object is iterable\n * @param {!Object} obj - \n * @return {boolean}\n */\n is_iterable( obj ) {\n return obj && typeof obj[Symbol.iterator] === 'function'\n }\n \n /**\n * Add an @@iterator method to non-iterable object\n * @param {!Object} obj - \n * @return {Object}\n */\n toIterableObject( obj ) {\n if ( this.is_iterable( obj ) ) {\n return obj\n }\n \n obj[Symbol.iterator] = () => {\n let index = 0\n \n return {\n next() {\n if ( obj.length <= index ) {\n return { done: true }\n } else {\n return { value: obj[index++] }\n }\n }\n }\n }\n \n return obj\n }\n \n /**\n * Await until next process at specific millisec\n * @param {number} [msec=1] - Millisecond\n */\n sleep( msec = 1 ) {\n return new Promise( ( resolve ) => {\n setTimeout( resolve, msec )\n })\n }\n \n /**\n * Supplemental method for validating arguments in local scope\n * @param {!(number|string|Object|boolean)} default_value - \n * @param {?(number|string|Object|boolean)} opt_arg - \n * @param {?(number|string|Object|boolean)} opt_callback - function or string of function to call\n * @return {number|string|Object|boolean}\n */\n supplement( default_value, opt_arg, opt_callback ) {\n if ( opt_arg === undefined ) {\n return default_value\n }\n if ( opt_callback === undefined ) {\n return opt_arg\n }\n return opt_callback( default_value, opt_arg )\n }\n \n /**\n * Generate the pluggable unique id\n * @param {number} [digit=1000] - \n * @return {string}\n */\n generateUniqueID( digit = 1000 ) {\n return new Date().getTime().toString(16) + Math.floor( digit * Math.random() ).toString(16)\n }\n \n /**\n * Round a number with specific digit\n * @param {!number} number - \n * @param {?number} digit - Defaults to 0\n * @param {string} [round_type=\"round\"] - \n * @return {number}\n */\n numRound( number, digit, round_type = 'round' ) {\n digit = this.supplement( 0, digit, this.validateNumeric )\n let _pow = Math.pow( 10, digit )\n \n switch ( true ) {\n case /^ceil$/i.test( round_type ):\n return Math.ceil( number * _pow ) / _pow\n case /^floor$/i.test( round_type ):\n return Math.floor( number * _pow ) / _pow\n case /^round$/i.test( round_type ):\n default:\n return Math.round( number * _pow ) / _pow\n }\n }\n \n /**\n * Convert hex of color code to rgba\n * @param {!string} hex - \n * @param {number} [alpha=1] - \n * @return {string}\n */\n hexToRgbA( hex, alpha = 1 ) {\n let _c\n \n if ( /^#([A-Fa-f0-9]{3}){1,2}$/.test( hex ) ) {\n _c = hex.substring(1).split('')\n if ( _c.length == 3 ) {\n _c= [ _c[0], _c[0], _c[1], _c[1], _c[2], _c[2] ]\n }\n _c = `0x${_c.join('')}`\n return `rgba(${[ (_c >> 16) & 255, (_c >> 8) & 255, _c & 255 ].join(',')},${alpha})`\n }\n // throw new Error( 'Bad Hex' )\n return hex\n }\n \n /**\n * Get the correct datetime with remapping to that if the year is 0 - 99\n * @param {!string} datetime_str - \n * @return {?Object} - Date Object, or null if failed\n */\n getCorrectDatetime( datetime_str ) {\n let normalizeDate = ( dateString ) => {\n // For Safari, IE\n let _d = dateString.replace(/-/g, '/')\n return /^\\d{1,4}\\/\\d{1,2}$/.test( _d ) ? `${_d}/1` : _d\n },\n getDateObject = ( datetime_str ) => {\n let _chk_str = normalizeDate( datetime_str ),\n _ymd, _his, _parts, _date\n \n switch ( true ) {\n case /^\\d{1,2}(|\\/\\d{1,2}(|\\/\\d{1,2}))(| \\d{1,2}(|:\\d{1,2}(|:\\d{1,2})))$/i.test( _chk_str ): {\n [ _ymd, _his ] = _chk_str.split(' ')\n _parts = _ymd.split('/')\n if ( _parts[1] ) {\n _parts[1] = parseInt( _parts[1], 10 ) - 1 // to month index\n }\n if ( _his ) {\n _parts.push( ..._his.split(':') )\n }\n _date = new Date( new Date( ..._parts ).setFullYear( parseInt( _parts[0], 10 ) ) )\n break\n }\n case /^\\d+$/.test( _chk_str ):\n _date = new Date( 1, 0, 1 ).setFullYear( parseInt( _chk_str, 10 ) )\n break\n default:\n _date = new Date( _chk_str.toString() )\n break\n } \n return _date\n },\n _checkDate = getDateObject( datetime_str )\n \n if ( isNaN( _checkDate ) || this.is_empty( _checkDate ) ) {\n console.warn( `\"${datetime_str}\" Cannot parse date because invalid format.` )\n return null\n }\n /*\n let _tempDate = new Date( normalizeDate( datetime_str ) ),\n _chk_date = datetime_str.split( /-|\\// )\n \n if ( parseInt( _chk_date[0], 10 ) < 100 ) {\n // Remapping if year is 0-99\n _tempDate.setFullYear( parseInt( _chk_date[0], 10 ) )\n }\n \n return _tempDate\n */\n if ( typeof _checkDate !== 'object' ) {\n _checkDate = new Date( _checkDate )\n }\n return _checkDate\n }\n \n /**\n * Method to get week number as extension of Date object\n * @param {!string} date_str - \n * @return {number}\n */\n getWeek( date_str ) {\n let targetDate, _str, _onejan,\n _millisecInDay = 24 * 60 * 60 * 1000\n \n if ( /^\\d{1,4}(|\\/\\d{1,2}(|\\/\\d{1,2}))$/.test( date_str ) ) {\n _str = date_str.split('/')\n if ( ! this.is_empty( _str[1] ) ) {\n _str[1] = parseInt( _str[1], 10 ) - 1 // To month index\n }\n targetDate = new Date( ..._str )\n } else {\n targetDate = new Date( date_str )\n }\n _onejan = new Date( targetDate.getFullYear(), 0, 1 )\n return Math.ceil( ( ( ( targetDate - _onejan ) / _millisecInDay ) + _onejan.getDay() + 1 ) / 7 )\n }\n \n /**\n * Retrieve a first day of the week from week number (Note: added support for daylight savings time but needs improvement as performance has dropped)\n * @param {!number} week_number - \n * @param {!number} year - defaults to current year\n * @return {object|boolean}\n */\n getFirstDayOfWeek( week_number, year ) {\n if ( this.is_empty( week_number ) ) {\n return false\n }\n year = this.is_empty( year ) ? new Date().getFullYear() : parseInt( year, 10 )\n let firstDayIndex = this._config.firstDayOfWeek,\n firstDayOfYear = this.getCorrectDatetime( `${year}/1/1` ),\n _weekday = firstDayOfYear.getDay(),\n _keyDayOfWeek = firstDayOfYear,\n _offset = _weekday > firstDayIndex ? _weekday - firstDayIndex : 0,\n _weekNumber = _offset <= 0 ? 0 : 1,\n hitDate\n if ( _weekNumber == week_number && _weekday == firstDayIndex ) {\n hitDate = firstDayOfYear\n } else {\n for ( let i = _offset; i < _offset + 7; i++ ) {\n if ( i > _offset ) {\n _keyDayOfWeek = this.modifyDate( firstDayOfYear, i, 'day' )\n }\n if ( _keyDayOfWeek.getDay() == firstDayIndex ) {\n _weekNumber++\n break\n }\n }\n if ( _weekNumber == week_number ) {\n hitDate = _keyDayOfWeek\n } else {\n hitDate = this.modifyDate( _keyDayOfWeek, (week_number - _weekNumber) * 7, 'day' )\n }\n }\n return hitDate\n }\n\n /**\n * Get the datetime shifted from the specified datetime by any fluctuation value\n * @param {!object} datetime - to be date object filtered by getCorrectDatetime method\n * @param {!number} fluctuation - an interval value to shift from given base datetime\n * @param {!string} scale - the scale of an interval value\n * @return {object|boolean}\n */\n modifyDate( datetime, fluctuation, scale ) {\n if ( this.is_empty( datetime ) || this.is_empty( fluctuation ) || this.is_empty( scale ) || ! this.verifyScale( scale ) ) {\n return false\n }\n let baseDate = this.getCorrectDatetime( datetime ),\n flct = this.validateNumeric( 0, fluctuation ),\n dateElms = [\n baseDate.getFullYear(), // 0: year\n baseDate.getMonth(), // 1: month (index)\n baseDate.getDate(), // 2: day\n baseDate.getHours(), // 3: hour\n baseDate.getMinutes(), // 4: minute\n baseDate.getSeconds(), // 5: second\n baseDate.getMilliseconds() // 6: millisec\n ],\n tmpDate = new Date( new Date( ...dateElms ).setFullYear( dateElms[0] ) ),\n isAdjust = false,\n newDate\n\n switch ( true ) {\n case /^millenniums?|millennia$/i.test( scale ):\n newDate = new Date( tmpDate.setFullYear( tmpDate.getFullYear() + (flct * 1000) ) )\n break\n case /^century$/i.test( scale ):\n newDate = new Date( tmpDate.setFullYear( tmpDate.getFullYear() + (flct * 100) ) )\n break\n case /^dec(ade|ennium)$/i.test( scale ):\n newDate = new Date( tmpDate.setFullYear( tmpDate.getFullYear() + (flct * 10) ) )\n break\n case /^lustrum$/i.test( scale ):\n newDate = new Date( tmpDate.setFullYear( tmpDate.getFullYear() + (flct * 5) ) )\n break\n case /^years?$/i.test( scale ):\n newDate = new Date( tmpDate.setFullYear( tmpDate.getFullYear() + flct ) )\n break\n case /^months?$/i.test( scale ):\n newDate = new Date( tmpDate.setMonth( tmpDate.getMonth() + flct ) )\n break\n case /^weeks?$/i.test( scale ):\n newDate = new Date( tmpDate.setDate( tmpDate.getDate() + (flct * 7) ) )\n newDate.setHours( dateElms[3] )\n newDate.setMinutes( dateElms[4] )\n newDate.setSeconds( dateElms[5] )\n newDate.setMilliseconds( dateElms[6] )\n break\n case /^(|week)days?$/i.test( scale ):\n newDate = new Date( tmpDate.setDate( tmpDate.getDate() + flct ) )\n newDate.setHours( dateElms[3] )\n newDate.setMinutes( dateElms[4] )\n newDate.setSeconds( dateElms[5] )\n newDate.setMilliseconds( dateElms[6] )\n break\n case /^hours?$/i.test( scale ):\n newDate = new Date( tmpDate.setTime( tmpDate.getTime() + ( flct * 60 * 60 * 1000 ) ) )\n newDate.setMinutes( dateElms[4] )\n newDate.setSeconds( dateElms[5] )\n newDate.setMilliseconds( dateElms[6] )\n break\n case /^minutes?$/i.test( scale ):\n newDate = new Date( tmpDate.setTime( tmpDate.getTime() + ( flct * 60 * 1000 ) ) )\n newDate.setSeconds( dateElms[5] )\n newDate.setMilliseconds( dateElms[6] )\n break\n case /^seconds?$/i.test( scale ):\n newDate = new Date( tmpDate.setTime( tmpDate.getTime() + ( flct * 1000 ) ) )\n newDate.setMilliseconds( dateElms[6] )\n break\n default:\n newDate = new Date( tmpDate.setTime( tmpDate.getTime() + flct ) )\n break\n }\n\n if ( isAdjust ) {\n // Why different time of 1 min 15 sec on 12/01/1847, 0:00:00? (GMT+0001)\n let divide = this.getCorrectDatetime( '1847/12/1 0:01:15' )\n\n if ( baseDate.getTime() < divide.getTime() && newDate.getTime() >= divide.getTime() ) {\n newDate = new Date( newDate.setTime( newDate.getTime() - (60 * 1000) ) )\n } else\n if ( baseDate.getTime() > divide.getTime() && newDate.getTime() <= divide.getTime() ) {\n newDate = new Date( newDate.setTime( newDate.getTime() - (75 * 1000) ) )\n }\n }\n return newDate\n }\n\n /**\n * Acquire the difference between two dates with the specified scale value\n * @param {!(number|object)} date1 - integer as milliseconds or object instanceof Date)\n * @param {!(number|object)} date2 - integer as milliseconds or object instanceof Date)\n * @param {string} [scale='millisecond'] - defaults to 'millisecond'\n * @param {boolean} [absval=false] - defaults to false\n * @return {object|boolean}\n */\n diffDate( date1, date2, scale = 'millisecond', absval = false ) {\n let _dt1 = date1 === undefined ? null : date1,\n _dt2 = date2 === undefined ? null : date2,\n diffMS = 0,\n retval = false,\n lastDayOfMonth = ( dateObj ) => {\n let _tmp = new Date( dateObj.getFullYear(), dateObj.getMonth() + 1, 1 )\n _tmp.setTime( _tmp.getTime() - 1 )\n return _tmp.getDate()\n },\n isLeapYear = ( dateObj ) => {\n let _tmp = new Date( dateObj.getFullYear(), 0, 1 ),\n sum = 0\n\n for ( let i = 0; i < 12; i++ ) {\n _tmp.setMonth(i)\n sum += lastDayOfMonth( _tmp )\n }\n return sum == 365 ? false : true\n }\n\n if ( ! _dt1 || ! _dt2 ) {\n //console.warn( 'Cannot parse date to get difference because undefined.' )\n this._error( 'Cannot parse date to get difference because undefined.', 'warn' )\n return false\n }\n\n diffMS = _dt2 - _dt1\n\n if ( isNaN( diffMS ) ) {\n //console.warn( 'Cannot parse date to get difference because invalid format.' )\n this._error( 'Cannot parse date to get difference because invalid format.', 'warn' )\n return false\n }\n if ( absval ) {\n diffMS = Math.abs( diffMS )\n }\n\n let _bd = _dt1 instanceof Date ? _dt1 : new Date( _dt1 ),\n _ed = _dt2 instanceof Date ? _dt2 : new Date( _dt2 ),\n _dy = _ed.getFullYear() - _bd.getFullYear(),\n _m = {}\n\n switch ( true ) {\n case /^millenniums?|millennia$/i.test( scale ): {\n // return { \"millennium-number\": years,... }\n let _by = _bd.getFullYear(),\n _ey = _ed.getFullYear(),\n _bm = Math.ceil( (_by == 0 ? 1 : _by) / 1000 ), // millennium of first ordinal\n _em = Math.ceil( (_ey == 0 ? 1 : _ey) / 1000 ),\n _cm = _bm\n\n _m[_bm] = _em - _bm > 0 ? (_bm * 1000) - _by : _ey - _by\n _cm++\n while ( _cm <= _em ) {\n _m[_cm] = _em - _cm > 0 ? 1000 : _ey - ((_cm - 1) * 1000)\n _cm++\n }\n retval = _m\n // return number of milliseconds\n // retval = diffMS\n break\n }\n case /^century$/i.test( scale ): {\n // return { \"century-number\": years,... }\n let _by = _bd.getFullYear(),\n _ey = _ed.getFullYear(),\n _bc = Math.ceil( (_by == 0 ? 1 : _by) / 100 ), // century of first ordinal\n _ec = Math.ceil( (_ey == 0 ? 1 : _ey) / 100 ),\n _cc = _bc\n\n _m[_bc] = _ec - _bc > 0 ? (_bc * 100) - _by : _ey - _by\n _cc++\n while ( _cc <= _ec ) {\n _m[_cc] = _ec - _cc > 0 ? 100 : _ey - ((_cc - 1) * 100)\n _cc++\n }\n retval = _m\n // return number of milliseconds\n // retval = diffMS\n break\n }\n case /^dec(ade|ennium)$/i.test( scale ): {\n // return { \"decade-number\": days,... }\n let _by = _bd.getFullYear(),\n _ey = _ed.getFullYear(),\n _cy = _by == 0 ? 1 : _by,\n _cd, _days\n\n while ( _cy <= _ey ) {\n _days = isLeapYear( new Date( _cy, 0, 1 ) ) ? 366 : 365\n _cd = Math.ceil( _cy / 10 ) // decade of first ordinal\n if ( Object.hasOwnProperty.call( _m, _cd ) ) {\n _m[_cd] += _days\n } else {\n _m[_cd] = _days\n }\n _cy++\n }\n retval = _m\n // return number of milliseconds\n // retval = diffMS\n break\n }\n case /^lustrum$/i.test( scale ): {\n // return { \"lustrum-number\": days,... }\n let _by = _bd.getFullYear(),\n _ey = _ed.getFullYear(),\n _cy = _by == 0 ? 1 : _by,\n _cl, _days\n\n while ( _cy <= _ey ) {\n _days = isLeapYear( new Date( _cy, 0, 1 ) ) ? 366 : 365\n _cl = Math.ceil( _cy / 5 ) // lustrum of first ordinal\n if ( Object.hasOwnProperty.call( _m, _cl ) ) {\n _m[_cl] += _days\n } else {\n _m[_cl] = _days\n }\n _cy++\n }\n retval = _m\n // return number of milliseconds\n // retval = diffMS\n break\n }\n case /^years?$/i.test( scale ):\n // return { \"year\": days,... }\n if ( _dy > 0 ) {\n for ( let i = 0; i <= _dy; i++ ) {\n let _cd = new Date( _bd.getFullYear() + i, 0, 1 )\n _m[`${_bd.getFullYear() + i}`] = isLeapYear( _cd ) ? 366 : 365\n }\n } else {\n _m[`${_bd.getFullYear()}`] = isLeapYear( _bd ) ? 366 : 365\n }\n retval = _m\n break\n case /^months?$/i.test( scale ):\n // return { \"year/month\": days,... }\n if ( _dy > 0 ) {\n for ( let i = _bd.getMonth(); i < 12; i++ ) {\n let _cd = new Date( _bd.getFullYear(), i, 1 )\n _m[`${_bd.getFullYear()}/${i + 1}`] = lastDayOfMonth( _cd )\n }\n if ( _dy > 1 ) {\n for ( let y = 1; y < _dy; y++ ) {\n for ( let i = 0; i < 12; i++ ) {\n let _cd = new Date( _bd.getFullYear() + y, i, 1 )\n _m[`${_bd.getFullYear() + y}/${i + 1}`] = lastDayOfMonth( _cd )\n }\n }\n }\n for ( let i = 0; i <= _ed.getMonth(); i++ ) {\n let _cd = new Date( _ed.getFullYear(), i, 1 )\n _m[`${_ed.getFullYear()}/${i + 1}`] = lastDayOfMonth( _cd )\n }\n } else {\n for ( let i = _bd.getMonth(); i <= _ed.getMonth(); i++ ) {\n let _cd = new Date( _bd.getFullYear(), i, 1 )\n _m[`${_bd.getFullYear()}/${i + 1}`] = lastDayOfMonth( _cd )\n }\n }\n retval = _m\n break\n case /^weeks?$/i.test( scale ): {\n // return { \"year,week\": hours,... }\n let _cd = new Date( _bd.getFullYear(), _bd.getMonth(), _bd.getDate() ),\n _cw = this.getWeek( _cd ),\n _nd = new Date( _cd ),\n _pd = new Date( _cd ),\n _newWeek = `${_cd.getFullYear()},${_cw}`\n\n _nd.setDate( _nd.getDate() + 1 )\n _pd.setDate( _pd.getDate() - 1 )\n _m[_newWeek] = ( _cd - _pd ) / ( 60 * 60 * 1000 ) // hours of first day\n while ( _nd.getTime() <= _ed.getTime() ) {\n _nd.setDate( _nd.getDate() + 1 )\n _cd.setDate( _cd.getDate() + 1 )\n _cw = this.getWeek( _cd )\n let _newWeekKey = `${_cd.getFullYear()},${_cw}`\n\n if ( Object.hasOwnProperty.call( _m, _newWeekKey ) ) {\n _m[_newWeekKey] += ( _nd - _cd ) / ( 60 * 60 * 1000 )\n } else {\n _m[_newWeekKey] = ( _nd - _cd ) / ( 60 * 60 * 1000 )\n }\n }\n retval = _m\n break\n }\n case /^(|week)days?$/i.test( scale ): {\n // return { \"year/month/day\": hours,... }\n let _cd = new Date( _bd.getFullYear(), _bd.getMonth(), _bd.getDate() ),\n _nd = new Date( _cd ),\n _pd = new Date( _cd )\n\n _nd.setDate( _nd.getDate() + 1 )\n _pd.setDate( _pd.getDate() - 1 )\n _m[`${_cd.getFullYear()}/${(_cd.getMonth() + 1)}/${_cd.getDate()}`] = ( _cd - _pd ) / ( 60 * 60 * 1000 )\n while ( _nd.getTime() <= _ed.getTime() ) {\n _nd.setDate( _nd.getDate() + 1 )\n _cd.setDate( _cd.getDate() + 1 )\n _m[`${_cd.getFullYear()}/${(_cd.getMonth() + 1)}/${_cd.getDate()}`] = ( _nd - _cd ) / ( 60 * 60 * 1000 )\n }\n retval = _m\n break\n }\n case /^hours?$/i.test( scale ): {\n // return { \"year/month/day hour\": minutes,... }\n let _cd = new Date( _bd.getFullYear(), _bd.getMonth(), _bd.getDate(), _bd.getHours() ),\n _nd = new Date( _cd ),\n _pd = new Date( _cd )\n\n _nd.setHours( _nd.getHours() + 1 )\n _pd.setHours( _pd.getHours() - 1 )\n _m[`${_cd.getFullYear()}/${(_cd.getMonth() + 1)}/${_cd.getDate()} ${_cd.getHours()}`] = ( _cd - _pd ) / ( 60 * 1000 )\n while ( _nd.getTime() <= _ed.getTime() ) {\n _nd.setHours( _nd.getHours() + 1 )\n _cd.setHours( _cd.getHours() + 1 )\n _m[`${_cd.getFullYear()}/${(_cd.getMonth() + 1)}/${_cd.getDate()} ${_cd.getHours()}`] = ( _nd - _cd ) / ( 60 * 1000 )\n }\n retval = _m\n break\n }\n case /^minutes?$/i.test( scale ): {\n // return { \"year/month/day hour:minute\": seconds,... }\n let _cd = new Date( _bd.getFullYear(), _bd.getMonth(), _bd.getDate(), _bd.getHours(), _bd.getMinutes() ),\n _nd = new Date( _cd ),\n _pd = new Date( _cd )\n\n _nd.setMinutes( _nd.getMinutes() + 1 )\n _pd.setMinutes( _pd.getMinutes() - 1 )\n _m[`${_cd.getFullYear()}/${(_cd.getMonth() + 1)}/${_cd.getDate()} ${_cd.getHours()}:${_cd.getMinutes()}`] = ( _cd - _pd ) / 1000\n while ( _nd.getTime() <= _ed.getTime() ) {\n _nd.setMinutes( _nd.getMinutes() + 1 )\n _cd.setMinutes( _cd.getMinutes() + 1 )\n _m[`${_cd.getFullYear()}/${(_cd.getMonth() + 1)}/${_cd.getDate()} ${_cd.getHours()}:${_cd.getMinutes()}`] = ( _nd - _cd ) / 1000\n }\n retval = _m\n break\n }\n case /^seconds?$/i.test( scale ): {\n // return { \"year/month/day hour:minute:second\": milliseconds,... }\n let _cd = new Date( _bd.getFullYear(), _bd.getMonth(), _bd.getDate(), _bd.getHours(), _bd.getMinutes(), _bd.getSeconds() ),\n _nd = new Date( _cd ),\n _pd = new Date( _cd )\n\n _nd.setSeconds( _nd.getSeconds() + 1 )\n _pd.setSeconds( _pd.getSeconds() - 1 )\n _m[`${_cd.getFullYear()}/${(_cd.getMonth() + 1)}/${_cd.getDate()} ${_cd.getHours()}:${_cd.getMinutes()}:${_cd.getSeconds()}`] = _cd - _pd\n while ( _nd.getTime() <= _ed.getTime() ) {\n _nd.setSeconds( _nd.getSeconds() + 1 )\n _cd.setSeconds( _cd.getSeconds() + 1 )\n _m[`${_cd.getFullYear()}/${(_cd.getMonth() + 1)}/${_cd.getDate()} ${_cd.getHours()}:${_cd.getMinutes()}:${_cd.getSeconds()}`] = _nd - _cd\n }\n retval = _m\n break\n }\n default:\n // return number of milliseconds\n retval = diffMS\n break\n }\n\n return retval\n }\n\n /**\n * Verify whether is allowed scale in the plugin. Then retrieves that values of intervals on the scale if the scale is available and given arguments of date range. And return the base millisecond of scale if it is not the variable length scale (isVLS to false)\n * @param {!string} scale - \n * @param {number} [begin=null] - begin of range as unit millisecs that got by `Date.getTime()`\n * @param {number} [end=null] - end of range as unit millisecs that got by `Date.getTime()`\n * @param {boolean} [isVLS=false] - whether is variable length scale, defaults to false\n * @return {object|boolean} boolean if no arguments are given after the first argument\n */\n verifyScale( scale, begin = null, end = null, isVLS = false ) {\n let _ms = -1,\n isBool = this.is_empty( begin ) || this.is_empty( end ),\n retval = isVLS ? this.diffDate( begin, end, scale ) : false\n\n if ( typeof scale === 'undefined' || typeof scale !== 'string' ) {\n return false\n }\n switch ( true ) {\n case /^millisec(|ond)s?$/i.test( scale ):\n // Millisecond (:> ミリ秒\n _ms = 1\n break\n case /^seconds?$/i.test( scale ):\n // Second (:> 秒\n _ms = 1000\n break\n case /^minutes?$/i.test( scale ):\n // Minute (:> 分\n _ms = 60 * 1000\n break\n case /^quarter-?(|hour)$/i.test( scale ):\n // Quarter of an hour (:> 15分\n _ms = 15 * 60 * 1000\n break\n case /^half-?(|hour)$/i.test( scale ):\n // Half an hour (:> 30分\n _ms = 30 * 60 * 1000\n break\n case /^hours?$/i.test( scale ):\n // Hour (:> 時(時間)\n _ms = 60 * 60 * 1000\n break\n case /^(|week)days?$/i.test( scale ):\n // Day (is the variable length scale by DST) (:> 日 (サマータイムによる可変長スケール)\n _ms = 24 * 60 * 60 * 1000\n break\n case /^weeks?$/i.test( scale ):\n // Week (is the variable length scale by DST) (:> 週 (サマータイムによる可変長スケール)\n _ms = 7 * 24 * 60 * 60 * 1000\n break\n case /^months?$/i.test( scale ):\n // Month (is the variable length scale) (:> 月(可変長スケール)\n _ms = 30.44 * 24 * 60 * 60 * 1000\n break\n case /^years?$/i.test( scale ):\n // Year (is the variable length scale) (:> 年(可変長スケール)\n _ms = 365.25 * 24 * 60 * 60 * 1000\n break\n case /^lustrum$/i.test( scale ):\n // Lustrum (is the variable length scale, but currently does not support) (:> 五年紀 (可変長スケールだが現在サポートしてない)\n // 5y = 1826 or 1827; 1826 * 24 * 60 * 60 = 15766400, 1827 * 24 * 60 * 60 = 157852800 | avg.= 157788000\n //_ms = ( ( 3.1536 * Math.pow( 10, 8 ) ) / 2 ) * 1000 // <--- Useless by info of wikipedia\n _ms = 157788000 * 1000\n break\n case /^dec(ade|ennium)$/i.test( scale ):\n // Decade (is the variable length scale, but currently does not support) (:> 十年紀 (可変長スケールだが現在サポートしてない)\n // 10y = 3652 or 3653; 3652 * 24 * 60 * 60 = 315532800, 3653 * 24 * 60 * 60 = 157852800 | avg. = 315576000\n // _ms = ( 3.1536 * Math.pow( 10, 8 ) ) * 1000 // <--- Useless by info of wikipedia\n _ms = 315576000 * 1000\n break\n case /^century$/i.test( scale ):\n // Century (:> 世紀(百年紀)\n // 100y = 36525; 36525 * 24 * 60 * 60 = 3155760000\n _ms = 3155760000 * 1000\n break\n case /^millenniums?|millennia$/i.test( scale ):\n // Millennium (:> 千年紀\n // 100y = 365250\n //_ms = ( 3.1536 * Math.pow( 10, 10 ) ) * 1000\n _ms = 3155760000 * 10 * 1000\n break\n default:\n //console.warn( `Specified an invalid \"${scale}\" scale.` )\n this._error( `Specified an invalid \"${scale}\" scale.`, 'warn' )\n _ms = -1\n }\n if ( isBool ) {\n return _ms > 0\n } else {\n return isVLS ? retval : _ms\n }\n }\n\n /**\n * Retrieve one higher scale\n * @param {!string} scale - \n * @return {string} String of higher scale\n */\n getHigherScale( scale ) {\n return this.findScale( scale, 'higher' )\n }\n\n /**\n * Retrieve one lower scale\n * @param {!string} scale - \n * @return {string} String of lower scale\n */\n getLowerScale( scale ) {\n return this.findScale( scale, 'lower' )\n }\n\n /**\n * Find scale matched the specified condition\n * @param {!string} base_scale - \n * @param {!string} condition - \n * @return {string|object} matched scale(s)\n */\n findScale( base_scale, condition ) {\n let scalePatternMap = [\n [ 'millisecond', '^millisec(|ond)s?$' ],\n [ 'second', '^seconds?$' ],\n [ 'minute', '^minutes?$' ],\n [ 'hour', '^(|half|quarter)-?(|hour)s?$' ],\n [ 'day', '^(|week)days?$' ],\n [ 'week', '^weeks?$' ],\n [ 'month', '^months?$' ],\n [ 'year', '^years?$' ],\n [ 'lustrum', '^lustrum$' ],\n [ 'decade', '^dec(ade|ennium)$' ],\n [ 'century', '^century$' ],\n [ 'millennium', '^millenniums?|millennia$' ],\n ],\n _idx = scalePatternMap.findIndex( ( elm ) => new RegExp( `${elm[1]}`, 'i' ).test( base_scale ) ),\n _narrows\n\n switch ( true ) {\n case /^higher$/i.test( condition ):\n _idx = scalePatternMap[(_idx + 1)] ? _idx + 1 : _idx\n return scalePatternMap[_idx][0]\n case /^higher\\s?all$/i.test( condition ):\n _narrows = scalePatternMap.slice( _idx + 1 )\n _narrows = _narrows.reduce( ( acc, cur ) => acc.concat( cur[0] ), [] )\n if ( _narrows.includes( 'day' ) ) {\n _narrows.push( 'weekday' )\n }\n return _narrows\n case /^lower$/i.test( condition ):\n _idx = scalePatternMap[(_idx - 1)] ? _idx - 1 : _idx\n return scalePatternMap[_idx][0]\n case /^lower\\s?all$/i.test( condition ):\n _narrows = scalePatternMap.slice( 0, _idx )\n _narrows = _narrows.reduce( ( acc, cur ) => acc.concat( cur[0] ), [] )\n if ( _narrows.includes( 'day' ) ) {\n _narrows.push( 'weekday' )\n }\n return _narrows\n default:\n return scalePatternMap[_idx][0]\n }\n }\n\n /**\n * Retrieve the date string of specified locale\n * @param {!string} date_seed - \n * @param {string} [scale=\"\"] - \n * @param {string} [locales=\"en-US\"] - \n * @param {Object} [options={}] - \n * @return {string} Locale string\n */\n getLocaleString( date_seed, scale = '', locales = 'en-US', options = {} ) {\n function toLocaleStringSupportsLocales() {\n try {\n new Date().toLocaleString( 'i' )\n } catch ( e ) {\n return e.name === \"RangeError\";\n }\n return false;\n }\n let is_toLocalString = toLocaleStringSupportsLocales(),\n locale_string = '',\n _options = {},\n getOrdinal = ( n ) => {\n let s = [ 'th', 'st', 'nd', 'rd' ], v = n % 100\n return n + ( s[(v - 20)%10] || s[v] || s[0] )\n },\n getZerofill = ( num, digit = 4 ) => {\n let strDuplicate = ( n, str ) => Array( n + 1 ).join( str ),\n zero = strDuplicate( digit - num.length, '0' )\n \n return String( num ).length == digit ? String( num ) : ( zero + num ).substr( num * -1 )\n },\n parseDatetime = ( date_str ) => {\n let [ _ymd, _his ] = date_str.split(' '),\n _parts = []\n \n if ( /^\\d{1,4}\\/\\d{1,2}\\/\\d{1,2}$/.test( _ymd ) ) {\n _str = _ymd.split('/')\n _parts.push( ..._str )\n }\n if ( /^\\d{1,2}(|:\\d{1,2}(|:\\d{1,2}))$/.test( _his ) ) {\n _str = _his.split(':')\n _parts.push( ..._str )\n }\n if ( _parts.length > 0 ) {\n return new Date( ..._parts )\n } else {\n return new Date( date_str )\n }\n },\n _prop, _temp, _str, _num\n \n for ( _prop in options ) {\n if ( _prop === 'timeZone' || _prop === 'hour12' ) {\n _options[_prop] = options[_prop]\n }\n }\n \n switch ( true ) {\n case /^millenniums?|millennia$/i.test( scale ):\n case /^century$/i.test( scale ):\n case /^dec(ade|ennium)$/i.test( scale ):\n case /^lustrum$/i.test( scale ):\n if ( options.hasOwnProperty( scale ) && options[scale] === 'ordinal' ) {\n locale_string = getOrdinal( date_seed )\n } else {\n locale_string = date_seed\n }\n break\n case /^years?$/i.test( scale ):\n if ( is_toLocalString && options.hasOwnProperty( scale ) ) {\n if ( [ 'numeric', '2-digit' ].includes( options[scale] ) ) {\n _options.year = options[scale]\n locale_string = this.getCorrectDatetime( date_seed ).toLocaleString( locales, _options )\n } else\n if ( 'zerofill' === options[scale] ) {\n locale_string = getZerofill( date_seed )\n }\n }\n locale_string = this.is_empty( locale_string ) ? this.getCorrectDatetime( date_seed ).getFullYear() : locale_string\n break\n case /^months?$/i.test( scale ):\n if ( is_toLocalString && options.hasOwnProperty( scale ) ) {\n if ( [ 'numeric', '2-digit', 'narrow', 'short', 'long' ].includes( options[scale] ) ) {\n _options.month = options[scale]\n locale_string = this.getCorrectDatetime( date_seed ).toLocaleString( locales, _options )\n //locale_string = this.getCorrectDatetime( date_seed ).toLocaleString( locales, _options )\n }\n }\n if ( this.is_empty( locale_string ) || isNaN( locale_string ) ) {\n if ( /^\\d{1,2}\\/\\d{1,2}(|\\/\\d{1,2})$/.test( date_seed ) ) {\n _str = date_seed.split('/')\n _temp = new Date( _str[0], parseInt( _str[1] - 1 ), 1 )\n locale_string = _temp.toLocaleString( locales, _options )\n }\n }\n break\n case /^weeks?$/i.test( scale ):\n [ _str, _num ] = date_seed.split(',')\n if ( options.hasOwnProperty( scale ) && options[scale] === 'ordinal' ) {\n locale_string = getOrdinal( parseInt( _num, 10 ) )\n } else {\n locale_string = _num\n }\n break\n case /^weekdays?$/i.test( scale ):\n [ _str, _num ] = date_seed.split(',')\n if ( /^\\d{1,2}(|\\/\\d{1,2}(|\\/\\d{1,2}))$/.test( _str ) ) {\n _str = _str.split('/')\n _temp = new Date( ..._str )\n } else {\n _temp = new Date( _str )\n }\n if ( is_toLocalString ) {\n _options.weekday = options.hasOwnProperty('weekday') ? options.weekday : 'narrow'\n locale_string = _temp.toLocaleString( locales, _options )\n //locale_string = this.getCorrectDatetime( _temp[0] ).toLocaleString( locales, _options )\n } else {\n let _weekday = [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ]\n locale_string = _weekday[parseInt( _num, 10 )]\n }\n break\n case /^days?$/i.test( scale ):\n if ( /^\\d{1,2}(|\\/\\d{1,2}(|\\/\\d{1,2}))$/.test( date_seed ) ) {\n _str = date_seed.split('/')\n _temp = new Date( ..._str )\n } else {\n _temp = new Date( date_seed )\n }\n if ( is_toLocalString ) {\n _options.day = options.hasOwnProperty('day') ? options.day : 'numeric'\n locales = options.hasOwnProperty('day') ? locales : 'en-US'\n locale_string = _temp.toLocaleString( locales, _options )\n //locale_string = this.getCorrectDatetime( date_seed ).toLocaleString( locales, _options )\n } else {\n locale_string = _temp.getDate()\n //locale_string = this.getCorrectDatetime( date_seed ).getDate()\n }\n break\n case /^hours?$/i.test( scale ):\n case /^(half|quarter)-?hours?$/i.test( scale ):\n _temp = typeof date_seed === 'string' ? parseDatetime( date_seed ) : new Date( date_seed )\n if ( is_toLocalString ) {\n _options.hour = options.hasOwnProperty('hour') ? options.hour : 'numeric'\n if ( options.hasOwnProperty('minute') ) {\n _options.minute = options.hasOwnProperty('minute') ? options.minute : 'numeric'\n }\n locale_string = _temp.toLocaleString( locales, _options )\n //locale_string = this.getCorrectDatetime( date_seed ).toLocaleString( locales, _options )\n } else {\n locale_string = _temp.getHours()\n //locale_string = this.getCorrectDatetime( date_seed ).getHours()\n }\n break\n case /^minutes?$/i.test( scale ):\n _temp = typeof date_seed === 'string' ? parseDatetime( date_seed ) : new Date( date_seed )\n if ( is_toLocalString ) {\n _options.minute = options.hasOwnProperty('minute') ? options.minute : 'numeric'\n if ( options.hasOwnProperty('hour') ) {\n _options.hour = options.hasOwnProperty('hour') ? options.hour : 'numeric'\n }\n locale_string = _temp.toLocaleString( locales, _options )\n //locale_string = this.getCorrectDatetime( date_seed ).toLocaleString( locales, _options )\n } else {\n locale_string = _temp.getMinutes()\n //locale_string = this.getCorrectDatetime( date_seed ).getMinutes()\n }\n break\n case /^seconds?$/i.test( scale ):\n _temp = typeof date_seed === 'string' ? parseDatetime( date_seed ) : new Date( date_seed )\n if ( is_toLocalString ) {\n _options.second = options.hasOwnProperty('second') ? options.second : 'numeric'\n if ( options.hasOwnProperty('hour') ) {\n _options.hour = options.hasOwnProperty('hour') ? options.hour : 'numeric'\n }\n if ( options.hasOwnProperty('minute') ) {\n _options.minute = options.hasOwnProperty('minute') ? options.minute : 'numeric'\n }\n locale_string = _temp.toLocaleString( locales, _options )\n //locale_string = this.getCorrectDatetime( date_seed ).toLocaleString( locales, _options )\n } else {\n locale_string = _temp.getSeconds()\n //locale_string = this.getCorrectDatetime( date_seed ).getSeconds()\n }\n break\n case /^millisec(|ond)s?$/i.test( scale ):\n default:\n _temp = typeof date_seed === 'string' ? parseDatetime( date_seed ) : new Date( date_seed )\n locale_string = _temp.toString()\n //locale_string = this.getCorrectDatetime( date_seed )\n break\n }\n return locale_string\n }\n\n /**\n * Convert the date-time to custom formatting strings, as like ruby\n * @param {!(number|object)} baseDate - should be a Date object\n * @param {string} [format=''] - \n * @param {string} [locales='en-US'] - \n * @return {string}\n */\n datetimeFormat( baseDate, format = '', locales = 'en-US' ) {\n // let _baseDt = Object.prototype.toString.call( baseDate ) === '[object Date]' ? baseDate : this.getCorrectDatetime( baseDate ),\n let _baseDt = baseDate instanceof Date ? baseDate : this.getCorrectDatetime( baseDate ),\n _fmt = format.toString().split(''),\n _ptn = 'YyZmBbdwWAaIHMSj'.split(''),\n _cnvStr = '',\n lastDayOfMonth = ( dateObj ) => {\n let _tmp = new Date( dateObj.getFullYear(), dateObj.getMonth() + 1, 1 )\n\n _tmp.setTime( _tmp.getTime() - 1 )\n return _tmp.getDate()\n }\n\n if ( this.is_empty( _fmt ) ) {\n return _baseDt.toString()\n }\n _fmt.forEach( ( _str, _i, _orig ) => {\n let _match = false,\n _repStr = ''\n\n if ( _ptn.includes( _str ) && ! this.is_empty( _orig[_i - 1] ) && _orig[_i - 1] === '%' ) {\n _match = this.is_empty( _orig[_i - 2] ) || _orig[_i - 2] !== '\\\\'\n }\n if ( _match ) {\n switch ( _str ) {\n case 'Y':\n case 'y':\n case 'Z': {\n // year\n let _year = _baseDt.getFullYear()\n\n if ( _str === 'Z' ) {\n _repStr = _year < 10 ? `000${_year}` : _year < 100 ? `00${_year}` : _year < 1000 ? `0${_year}` : _year\n } else {\n _repStr = _str === 'Y' ? _year : _year.toString().slice(-2)\n }\n break\n }\n case 'm':\n case 'B':\n case 'b': {\n // month\n if ( _str === 'm' ) {\n let _month = _baseDt.getMonth() + 1\n\n _repStr = _month < 10 ? `0${_month}` : _month\n } else {\n let _opts = { month: _str === 'B' ? 'long' : 'short' }\n\n _repStr = _baseDt.toLocaleDateString( locales, _opts )\n }\n break\n }\n case 'd': {\n // day\n let _day = _baseDt.getDate()\n\n _repStr = _day < 10 ? `0${_day}` : _day\n break\n }\n case 'w':\n case 'A':\n case 'a': {\n // weekday\n if ( _str === 'w' ) {\n let _wday = _baseDt.getDay()\n\n _repStr = _wday\n } else {\n let _opts = { weekday: _str === 'A' ? 'long' : 'short' }\n\n _repStr = _baseDt.toLocaleDateString( locales, _opts )\n }\n break\n }\n case 'W': {\n // week\n _repStr = this.getWeek( _baseDt )\n break\n }\n case 'I':\n case 'H': {\n // hour\n let _opts = { hour12: _str === 'I', hour: 'numeric' }\n\n _repStr = _baseDt.toLocaleTimeString( locales, _opts )\n break\n }\n case 'M': {\n // minute\n _repStr = _baseDt.toLocaleTimeString( locales, { minute: 'numeric' } )\n break\n }\n case 'S': {\n // second\n _repStr = _baseDt.toLocaleTimeString( locales, { second: 'numeric' } )\n break\n }\n case 'j': {\n // day of year\n let _fdy = new Date( _baseDt.getFullYear(), 0, 1 ),\n _month = _baseDt.getMonth(),\n _days = 0, _m\n\n for ( _m = 0; _m < _month; _m++ ) {\n _fdy.setMonth( _m )\n _days += lastDayOfMonth( _fdy )\n }\n _repStr = _days + _baseDt.getDate()\n _repStr = _repStr < 10 ? `00${_repStr}` : _repStr < 100 ? `0${_repStr}` : _repStr\n break\n }\n }\n _cnvStr = _cnvStr.substring(0, _cnvStr.length - 1) + _repStr.toString()\n } else {\n _cnvStr += _str\n }\n }, _cnvStr )\n _cnvStr = _cnvStr.toString().replace( /\\\\/g, '' )\n return _cnvStr\n }\n\n /**\n * Get the rendering width of the given string\n * @param {!string} str - \n * @return {number}\n */\n strWidth( str ) {\n let _str_ruler = $( '' ),\n _width = 0\n if ( $('#jqtl-str-ruler').length == 0 ) {\n $('body').append( _str_ruler )\n }\n _width = $('#jqtl-str-ruler').text( str ).get(0).offsetWidth\n $('#jqtl-str-ruler').empty()\n return _width\n }\n \n /**\n * Sort an array by value of specific property (Note: destructive method)\n * @example\n * Object.sort( this.compareValues( property, order ) )\n *\n * @param {!string} property - To compare a property of object\n * @param {string} [order=\"asc\"] - Order to sort\n * @return {number} Comparison index\n */\n compareValues( property, order = 'asc' ) {\n return ( a, b ) => {\n if ( ! a.hasOwnProperty( property ) || ! b.hasOwnProperty( property ) ) {\n return 0\n }\n \n const varA = typeof a[property] === 'string' ? a[property].toUpperCase() : a[property]\n const varB = typeof b[property] === 'string' ? b[property].toUpperCase() : b[property]\n \n let comparison = 0\n \n if ( varA > varB ) {\n comparison = 1\n } else\n if ( varA < varB ) {\n comparison = -1\n }\n return order === 'desc' ? comparison * -1 : comparison\n }\n }\n\n /**\n * Getter argument as user data\n * @since v2.1.0\n * @param {!object} userdata - \n * @return {object}\n */\n getUserArg( userdata ) {\n //console.log( '!_getUserArg:', userdata, typeof userdata, typeof userdata[0], this.is_Object( userdata[0] ) )\n switch( typeof userdata[0] ) {\n case 'string':\n case 'number':\n userdata = [ userdata[0] ]\n break\n case 'object':\n if ( this.is_Object( userdata[0] ) ) {\n // Object\n if ( this.is_empty( userdata[0] ) ) {\n userdata = {}\n } else {\n userdata = this.mergeDeep( {}, userdata[0] )\n }\n } else {\n // Array\n if ( this.is_empty( userdata[0] ) ) {\n userdata = []\n } else {\n userdata = userdata[0]\n }\n }\n break\n default:\n userdata = userdata[0]\n break\n }\n return userdata\n }\n\n /**\n * Apply custom theme styles\n * @since v2.1.0\n * @return {void}\n */\n applyThemeStyle() {\n let theme = this._config.colorScheme.theme,\n selector = this._selector,\n styleId = `${PREFIX}-theme-${selector.replace(/[.#_]/g, '-')}`,\n styleTag = $('', { id: styleId }),\n _is = {},\n _os = {},\n cssText = ''\n \n if ( $(`style#${styleId}`).length > 0 ) {\n $(`style#${styleId}`).remove()\n }\n if ( 'default' === theme.name ) {\n return\n }\n\n _is[Selector.TIMELINE_CONTAINER] = `border:solid 1px ${theme.offline}; background:${theme.background}`\n _is[Selector.HEADLINE_TITLE] = `color:${theme.text}`\n _is[Selector.RANGE_META] = `color:${theme.subtext}`\n _is[Selector.TIMELINE_RULER_TOP] = `outline:solid 1px ${theme.offline}`\n _is[Selector.TIMELINE_RULER_BOTTOM] = `outline:solid 1px ${theme.offline}`\n _is[`${Selector.TIMELINE_RULER_LINES}:nth-child(even)`] = `background-color:${this.hexToRgbA(theme.striped1, 0.25)}`\n _is[Selector.TIMELINE_RULER_ITEM] = `color:${theme.subtext}`\n _is[`${Selector.TIMELINE_RULER_ITEM}:nth-child(even)`] = `background-color:${this.hexToRgbA(theme.striped2, 0.25)}`\n _is[Selector.TIMELINE_EVENT_CONTAINER] = `outline:solid 1px ${theme.offline}`\n _is[`${Selector.TIMELINE_EVENT_NODE}:not(.jqtl-event-type-pointer).active`] = `color:${theme.background};background-color:${theme.active}`\n _is[`${Selector.TIMELINE_EVENT_NODE}:hover`] = `color:${theme.background};background-color:${theme.active}`\n _is[`${Selector.TIMELINE_EVENT_NODE}:hover::after`] = `background-color:${this.hexToRgbA(theme.invertbg, 0.1)}`\n _is[`${Selector.TIMELINE_EVENT_NODE}::before`] = `color:${theme.modesttext}`\n _is[`${Selector.TIMELINE_EVENT_NODE}${Selector.VIEWER_EVENT_TYPE_POINTER}`] = `border:solid 3px ${theme.line}`\n _is[`${Selector.TIMELINE_EVENT_NODE}${Selector.VIEWER_EVENT_TYPE_POINTER}.active`] = `border-color:${theme.activeline}`\n _is[`${Selector.TIMELINE_EVENT_NODE}${Selector.VIEWER_EVENT_TYPE_POINTER}:hover`] = `border-color:${theme.activeline}`\n _is[Selector.TIMELINE_SIDEBAR] = `outline:solid 1px ${theme.offline}`\n _is[`${Selector.TIMELINE_SIDEBAR}> [class^=\"jqtl-side-index-\"]`] = `border-bottom:dotted 1px ${theme.offline};background-color:${theme.background};color:${theme.text}`\n _is[`${Selector.TIMELINE_SIDEBAR} ${Selector.TIMELINE_SIDEBAR_ITEM}:nth-child(odd)`] = `background-color:${theme.striped1}`\n _is[`${Selector.TIMELINE_SIDEBAR} ${Selector.TIMELINE_SIDEBAR_ITEM}:first-child`] = `border-top:solid 1px ${theme.offline}`\n _is[Selector.TIMELINE_SIDEBAR_MARGIN] = `outline:solid 1px ${theme.offline}`\n _is[`${Selector.TIMELINE_SIDEBAR_MARGIN}:first-child`] = `border-bottom:solid 1px ${theme.offline}`\n _is[`${Selector.TIMELINE_SIDEBAR_MARGIN}:last-child`] = `border-top:solid 1px ${theme.offline}`\n _is[Selector.OVERLAY] = `background-color:${this.hexToRgbA(theme.background, 0.65)} !important`\n _is[`${Selector.OVERLAY}:nth-child(odd)`] = `background-color:${this.hexToRgbA(theme.striped1, 0.45)} !important`\n _os[`${Selector.VIEWER_EVENT_TITLE},${Selector.VIEWER_EVENT_CONTENT}`] = `color:${theme.text}`\n _os[`${Selector.VIEWER_EVENT_TITLE}> .event-content`] = `color:${theme.offtext}`\n _os[Selector.VIEWER_EVENT_META] = `color:${theme.offtext}`\n _is[Selector.PRESENT_TIME_MARKER] = `border-left:dotted 1px ${theme.marker}`\n _is[`${Selector.PRESENT_TIME_MARKER}::before,${Selector.PRESENT_TIME_MARKER}::after`] = `background-color:${theme.marker}`\n _is[`${Selector.LOADER_ITEM} span`] = `background:${this.hexToRgbA(theme.text, 0.15)}`\n _os['@keyframes loader'] = `0%{background:${this.hexToRgbA(theme.text, 0.15)}}25%{background:${this.hexToRgbA(theme.text, 0.15)}}50%{background:${this.hexToRgbA(theme.text, 0.15)}}100%{background:${this.hexToRgbA(theme.text, 0.15)}}`\n\n for ( let _prop of Object.keys( _is ) ) {\n cssText += `${selector} ${_prop}{${_is[_prop]}}`\n }\n for ( let _prop of Object.keys( _os ) ) {\n cssText += `${_prop}{${_os[_prop]}}`\n }\n $('head').append( styleTag.text( cssText ) )\n }\n\n /**\n * Validator for string\n * @param {!(number|string|Object|boolean)} def - Define instead this value as default if validation failure\n * @param {!(number|string|Object|boolean)} val - Value to validate\n * @return {number|string|Object|boolean}\n */\n validateString( def, val ) {\n return typeof val === 'string' && val !== '' ? val : def\n }\n /**\n * Validator for numeric\n * @param {!(number|string|Object|boolean)} def - Define instead this value as default if validation failure\n * @param {!(number|string|Object|boolean)} val - Value to validate\n * @return {number|string|Object|boolean}\n */\n validateNumeric( def, val ) {\n return typeof val === 'number' ? Number( val ) : def\n }\n /**\n * Validator for boolean\n * @param {!(number|string|Object|boolean)} def - Define instead this value as default if validation failure\n * @param {!(number|string|Object|boolean)} val - Value to validate\n * @return {number|string|Object|boolean}\n */\n validateBoolean( def, val ) {\n return typeof val === 'boolean' || ( typeof val === 'object' && val !== null && typeof val.valueOf() === 'boolean' ) ? val : def\n }\n /**\n * Validator for object\n * @param {!(number|string|Object|boolean)} def - Define instead this value as default if validation failure\n * @param {!(number|string|Object|boolean)} val - Value to validate\n * @return {number|string|Object|boolean}\n */\n validateObject( def, val ) {\n return typeof val === 'object' ? val : def\n }\n /**\n * Validator for array\n * @param {!(number|string|Object|boolean)} def - Define instead this value as default if validation failure\n * @param {!(number|string|Object|boolean)} val - Value to validate\n * @return {number|string|Object|boolean}\n */\n validateArray( def, val ) {\n return Object.prototype.toString.call( val ) === '[object Array]' ? val : def\n }\n \n \n // Static\n \n /**\n * Interface for jQuery\n * @interface\n * @param {?(string|Object)} config - The object of plugin options or string of public method\n * @param {?(...string|...Function())} args - Arguments for public method\n */\n static _jQueryInterface( config, ...args ) {\n return this.each(function () {\n let data = $(this).data( DATA_KEY )\n const _config = {\n ...Default,\n ...$(this).data(),\n ...typeof config === 'object' && config ? config : {}\n }\n \n if ( ! data ) {\n // Apply the plugin and store the instance in data\n data = new Timeline( this, _config )\n $(this).data( DATA_KEY, data )\n }\n \n if ( typeof config === 'string' && config.charAt(0) != '_' ) {\n if ( typeof data[config] === 'undefined' ) {\n // Call no method\n throw new ReferenceError( `No method named \"${config}\"` )\n }\n // Call public method\n data[config]( args )\n } else {\n if ( ! data._isInitialized ) {\n data._init()\n }\n }\n })\n }\n \n} // class end\n\n\n/* ----------------------------------------------------------------------------------------------------------------\n * For jQuery\n * ----------------------------------------------------------------------------------------------------------------\n */\n$.fn[NAME] = Timeline._jQueryInterface\n$.fn[NAME].Constructor = Timeline\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Timeline._jQueryInterface\n}\n\n/* ----------------------------------------------------------------------------------------------------------------\n * For ESDoc\n * ----------------------------------------------------------------------------------------------------------------\n */\nexport {\n /*\n NAME,\n VERSION,\n DATA_KEY,\n EVENT_KEY,\n PREFIX,\n LOADING_MESSAGE,\n MIN_POINTER_SIZE,\n JQUERY_NO_CONFLICT,\n */\n Default,\n LimitScaleGrids,\n EventParams,\n /*\n Event,\n ClassName,\n Selector,\n */\n Timeline\n}\n", "static": true, "longname": "c:/xampp/htdocs/dev2.ka2.org/jquery.timeline/src/timeline.esdoc.js", "access": "public", "description": null, "lineNumber": 1 }, { "__docId__": 49, "kind": "typedef", "name": "LocaleOptions", "memberof": "src/timeline.esdoc.js", "static": true, "longname": "src/timeline.esdoc.js~LocaleOptions", "access": "public", "description": "In principle, this option conforms to the specification of options in \"Date.prototype.toLocaleString()\".\nHowever, there includes some extensions of this plugin original.", "see": [ "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString" ], "properties": [ { "nullable": null, "types": [ "boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "hour12", "description": "Whether to use 12-hour time (as opposed to 24-hour time). Possible values are true and false." }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "localeMatcher", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "timeZone", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "hourCycle", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "formatMatcher", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "weekday", "description": "The representation of the weekday. Possible values are \"narrow\", \"short\", \"long\"." }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "era", "description": "The representation of the era. Possible values are \"narrow\", \"short\", \"long\"." }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "year", "description": "The representation of the year. Possible values are \"numeric\", \"2-digit\". Then an extended value by this plugin is \"zerofill\"." }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "month", "description": "The representation of the month. Possible values are \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"." }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "day", "description": "The representation of the day. Possible values are \"numeric\", \"2-digit\". Then an extended value by this plugin is \"ordinal\"." }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "hour", "description": "The representation of the hour. Possible values are \"numeric\", \"2-digit\". Then an extended value by this plugin is \"fulltime\"." }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "minute", "description": "The representation of the minute. Possible values are \"numeric\", \"2-digit\". Then an extended value by this plugin is \"fulltime\"." }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "second", "description": "The representation of the second. Possible values are \"numeric\", \"2-digit\". Then an extended value by this plugin is \"fulltime\"." }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "timeZoneName", "description": "The representation of the time zone name. Possible values are \"short\", \"long\"." } ], "type": { "types": [ "Object" ], "optional": false, "name": "LocaleOptions" } }, { "__docId__": 50, "kind": "typedef", "name": "Headline", "memberof": "src/timeline.esdoc.js", "static": true, "longname": "src/timeline.esdoc.js~Headline", "access": "public", "description": "", "since": "2.0.0", "properties": [ { "nullable": null, "types": [ "boolean" ], "spread": false, "optional": true, "defaultValue": "true", "defaultRaw": true, "name": "display", "description": "Whether to display headline" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "title", "description": "" }, { "nullable": null, "types": [ "boolean" ], "spread": false, "optional": true, "defaultValue": "true", "defaultRaw": true, "name": "range", "description": "Hide if false" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"en-US\"", "defaultRaw": "en-US", "name": "locale", "description": "This value is an argument \"locales\" of `dateObj.toLocaleString([locales[, options]])`" }, { "nullable": null, "types": [ "LocaleOptions" ], "spread": false, "optional": true, "name": "format", "description": "This value is an argument \"options\" of `dateObj.toLocaleString([locales[, options]])`" } ], "type": { "types": [ "Object" ], "optional": false, "name": "Headline" } }, { "__docId__": 51, "kind": "typedef", "name": "Footer", "memberof": "src/timeline.esdoc.js", "static": true, "longname": "src/timeline.esdoc.js~Footer", "access": "public", "description": "", "since": "2.0.0", "properties": [ { "nullable": null, "types": [ "boolean" ], "spread": false, "optional": true, "defaultValue": "true", "defaultRaw": true, "name": "display", "description": "Whether to display headline" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "content", "description": "" }, { "nullable": null, "types": [ "boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "range", "description": "Visible if true" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"en-US\"", "defaultRaw": "en-US", "name": "locale", "description": "This value is an argument \"locales\" of `dateObj.toLocaleString([locales[, options]])`" }, { "nullable": null, "types": [ "LocaleOptions" ], "spread": false, "optional": true, "name": "format", "description": "This value is an argument \"options\" of `dateObj.toLocaleString([locales[, options]])`" } ], "type": { "types": [ "Object" ], "optional": false, "name": "Footer" } }, { "__docId__": 52, "kind": "typedef", "name": "Sidebar", "memberof": "src/timeline.esdoc.js", "static": true, "longname": "src/timeline.esdoc.js~Sidebar", "access": "public", "description": "", "since": "2.0.0", "properties": [ { "nullable": null, "types": [ "boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "sticky", "description": "Whether does sticky the sidebar by using \"display: sticky\" of CSS." }, { "nullable": null, "types": [ "boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "overlay", "description": "" }, { "nullable": null, "types": [ "array." ], "spread": false, "optional": true, "name": "list", "description": "Define the contents of the row of the sidebar. Appropriate escaping is necessary when using HTML." } ], "type": { "types": [ "Object" ], "optional": false, "name": "Sidebar" } }, { "__docId__": 53, "kind": "typedef", "name": "RulerOptions", "memberof": "src/timeline.esdoc.js", "static": true, "longname": "src/timeline.esdoc.js~RulerOptions", "access": "public", "description": "Can define the ruler position to top or bottom and both", "since": "2.0.0", "properties": [ { "nullable": null, "types": [ "array." ], "spread": false, "optional": true, "name": "lines", "description": "Multiple tick marks can be set, and array elements are set in order from the top. Set same scale of Default.scale if omitted this. c.g. [ 'year', 'month', 'day', 'weekday' ]" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "30", "defaultRaw": 30, "name": "height", "description": "The height of a row of rulers" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "14", "defaultRaw": 14, "name": "fontSize", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"#777777\"", "defaultRaw": "#777777", "name": "color", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"#FFFFFF\"", "defaultRaw": "#FFFFFF", "name": "background", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"en-US\"", "defaultRaw": "en-US", "name": "locale", "description": "This value is an argument \"locales\" of `dateObj.toLocaleString([locales[, options]])`" }, { "nullable": null, "types": [ "LocaleOptions" ], "spread": false, "optional": true, "name": "format", "description": "This value is an argument \"options\" of `dateObj.toLocaleString([locales[, options]])`" } ], "type": { "types": [ "Object" ], "optional": false, "name": "RulerOptions" } }, { "__docId__": 54, "kind": "typedef", "name": "Ruler", "memberof": "src/timeline.esdoc.js", "static": true, "longname": "src/timeline.esdoc.js~Ruler", "access": "public", "description": "You can set the upper and lower ruler individually", "since": "2.0.0", "properties": [ { "nullable": null, "types": [ "RulerOptions" ], "spread": false, "optional": true, "name": "top", "description": "The upper ruler configuration. The upper ruler is hidden if omitted." }, { "nullable": null, "types": [ "RulerOptions" ], "spread": false, "optional": true, "name": "bottom", "description": "The lower ruler configuration. The lower ruler is hidden if omitted." } ], "type": { "types": [ "Object" ], "optional": false, "name": "Ruler" } }, { "__docId__": 55, "kind": "typedef", "name": "EventMeta", "memberof": "src/timeline.esdoc.js", "static": true, "longname": "src/timeline.esdoc.js~EventMeta", "access": "public", "description": "", "since": "2.0.0", "properties": [ { "nullable": null, "types": [ "boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "display", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"day\"", "defaultRaw": "day", "name": "scale", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"en-US\"", "defaultRaw": "en-US", "name": "locale", "description": "This value is an argument \"locales\" of `dateObj.toLocaleString([locales[, options]])`" }, { "nullable": null, "types": [ "LocaleOptions" ], "spread": false, "optional": true, "name": "format", "description": "This value is an argument \"options\" of `dateObj.toLocaleString([locales[, options]])`" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "content", "description": "This is value for if you want to show custom content on the meta" } ], "type": { "types": [ "Object" ], "optional": false, "name": "EventMeta" } }, { "__docId__": 56, "kind": "typedef", "name": "Effects", "memberof": "src/timeline.esdoc.js", "static": true, "longname": "src/timeline.esdoc.js~Effects", "access": "public", "description": "Various effect settings to the timeline object displayed in the DOM", "since": "2.0.0", "properties": [ { "nullable": null, "types": [ "boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "presentTime", "description": "Whether to show marking a present time on the timeline container." }, { "nullable": null, "types": [ "boolean" ], "spread": false, "optional": true, "defaultValue": "true", "defaultRaw": true, "name": "hoverEvent", "description": "Whether to show the effect when individual events on the timeline container are mouse over." }, { "nullable": null, "types": [ "boolean" ], "spread": false, "optional": true, "defaultValue": "true", "defaultRaw": true, "name": "stripedGridRow", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"solid\"", "defaultRaw": "solid", "name": "horizontalGridStyle", "description": "The style of horizontal grid line on the Timeline container. possible values are \"solid\", \"dotted\", \"none\"." }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"solid\"", "defaultRaw": "solid", "name": "verticalGridStyle", "description": "The style of vertical grid line on the Timeline container. possible values are \"solid\", \"dotted\", \"none\"." } ], "type": { "types": [ "Object" ], "optional": false, "name": "Effects" } }, { "__docId__": 57, "kind": "typedef", "name": "EventColors", "memberof": "src/timeline.esdoc.js", "static": true, "longname": "src/timeline.esdoc.js~EventColors", "access": "public", "description": "Color scheme to overwrite defaults UI color of the event node", "since": "2.0.0", "properties": [ { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"#343A40\"", "defaultRaw": "#343A40", "name": "text", "description": "Defaults to text color of the event node" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"#6C757D\"", "defaultRaw": "#6C757D", "name": "border", "description": "Defaults to border color of the event node" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"#E7E7E7\"", "defaultRaw": "#E7E7E7", "name": "background", "description": "Defaults to background color of the event node" } ], "type": { "types": [ "Object" ], "optional": false, "name": "EventColors" } }, { "__docId__": 58, "kind": "typedef", "name": "ThemeColors", "memberof": "src/timeline.esdoc.js", "static": true, "longname": "src/timeline.esdoc.js~ThemeColors", "access": "public", "description": "Color scheme to overwrite defaults UI color of the timeline instance", "since": "2.1.0", "properties": [ { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"default\"", "defaultRaw": "default", "name": "name", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"#343A40\"", "defaultRaw": "#343A40", "name": "text", "description": "Defaults to basic text color" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"#707070\"", "defaultRaw": "#707070", "name": "subtext", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"#BBBBBB\"", "defaultRaw": "#BBBBBB", "name": "offtext", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"#969696\"", "defaultRaw": "#969696", "name": "modesttext", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"#6C757D\"", "defaultRaw": "#6C757D", "name": "line", "description": "Defaults to basic border color" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"#DDDDDD\"", "defaultRaw": "#DDDDDD", "name": "offline", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"#DC3545\"", "defaultRaw": "#DC3545", "name": "activeline", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"#FFFFFF\"", "defaultRaw": "#FFFFFF", "name": "background", "description": "Defaults to background color" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"#121212\"", "defaultRaw": "#121212", "name": "invertbg", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"#F7F7F7\"", "defaultRaw": "#F7F7F7", "name": "striped1", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"#F0F0F0\"", "defaultRaw": "#F0F0F0", "name": "striped2", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"#F73333\"", "defaultRaw": "#F73333", "name": "active", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"#2C7CFF\"", "defaultRaw": "#2C7CFF", "name": "marker", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"#333333\"", "defaultRaw": "#333333", "name": "gridbase", "description": "" } ], "type": { "types": [ "Object" ], "optional": false, "name": "ThemeColors" } }, { "__docId__": 59, "kind": "typedef", "name": "ColorScheme", "memberof": "src/timeline.esdoc.js", "static": true, "longname": "src/timeline.esdoc.js~ColorScheme", "access": "public", "description": "An option to overwrite defaults UI color of all event nodes", "since": "2.0.0", "properties": [ { "nullable": null, "types": [ "ThemeColors" ], "spread": false, "optional": true, "name": "theme", "description": "Color scheme to overwrite defaults UI color of the timeline instance" }, { "nullable": null, "types": [ "EventColors" ], "spread": false, "optional": true, "name": "event", "description": "Color scheme to overwrite defaults UI color of the event node" }, { "nullable": null, "types": [ "function" ], "spread": false, "optional": true, "name": "hookEventColors", "description": "You can declare a function to set colors with referring the data each event node" } ], "type": { "types": [ "Object" ], "optional": false, "name": "ColorScheme" } }, { "__docId__": 60, "kind": "typedef", "name": "Default", "memberof": "src/timeline.esdoc.js", "static": true, "longname": "src/timeline.esdoc.js~Default", "access": "public", "description": "Default options for generating the timeline by the jQuery.Timeline plugin.\nThose defaults are overridden to undefined settings of the timeline configuration.", "since": "2.0.0", "properties": [ { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"bar\"", "defaultRaw": "bar", "name": "type", "description": "View type of timeline event is either \"bar\" or \"point\" or \"mixed\"" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"day\"", "defaultRaw": "day", "name": "scale", "description": "Timetable's minimum level scale is either \"year\", \"month\", \"week\", \"day\", \"hour\", \"minute\"" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"currently\"", "defaultRaw": "currently", "name": "startDatetime", "description": "Beginning date time of timetable on the timeline. format is ( \"^d{4}(/|-)d{2}(/|-)d{2}\\sd{2}:d{2}:d{2}$\" ) or \"currently\"" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"auto\"", "defaultRaw": "auto", "name": "endDatetime", "description": "Ending date time of timetable on the timeline. format is ( \"^d{4}(/|-)d{2}(/|-)d{2}\\sd{2}:d{2}:d{2}$\" ) or \"auto\"" }, { "nullable": null, "types": [ "Headline" ], "spread": false, "optional": true, "name": "headline", "description": "Settings for the content customize in the headline" }, { "nullable": null, "types": [ "Footer" ], "spread": false, "optional": true, "name": "footer", "description": "Settings for the content customize in the footer" }, { "nullable": null, "types": [ "number", "string" ], "spread": false, "optional": true, "defaultValue": "3", "defaultRaw": 3, "name": "range", "description": "Override the scale range of the timeline to be rendered when endDatetime is undefined or \"auto\"" }, { "nullable": null, "types": [ "Sidebar" ], "spread": false, "optional": true, "name": "sidebar", "description": "Settings for the content of the sidebar" }, { "nullable": null, "types": [ "number", "string" ], "spread": false, "optional": true, "defaultValue": "\"auto\"", "defaultRaw": "auto", "name": "rows", "description": "Rows of timeline event area" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "48", "defaultRaw": 48, "name": "rowHeight", "description": "Height of one row" }, { "nullable": null, "types": [ "number", "string" ], "spread": false, "optional": true, "defaultValue": "\"auto\"", "defaultRaw": "auto", "name": "width", "description": "Fixed width (pixel) of timeline view" }, { "nullable": null, "types": [ "number", "string" ], "spread": false, "optional": true, "defaultValue": "\"auto\"", "defaultRaw": "auto", "name": "height", "description": "Fixed height (pixel) of timeline view; Defaults to ( rows * rowHeight )" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "30", "defaultRaw": 30, "name": "minGridSize", "description": "Override value of minimum size (pixel) of timeline grid" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "2", "defaultRaw": 2, "name": "marginHeight", "description": "Margin (pixel) top and bottom of events on the timeline" }, { "nullable": null, "types": [ "Ruler" ], "spread": false, "optional": true, "name": "ruler", "description": "Settings of the ruler" }, { "nullable": null, "types": [ "number", "string" ], "spread": false, "optional": true, "defaultValue": "\"latest\"", "defaultRaw": "latest", "name": "rangeAlign", "description": "Possible values are \"left\", \"center\", \"right\", \"current\", \"latest\" and specific event id" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"default\"", "defaultRaw": "default", "name": "loader", "description": "Custom loader definition, possible values are \"default\", false and selector of loader element" }, { "nullable": null, "types": [ "boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "hideScrollbar", "description": "Whether or not to display the scroll bar displayed when the width of the timeline overflows (even if it is set to non-display, it will not function depending on the browser)" }, { "nullable": null, "types": [ "EventMeta" ], "spread": false, "optional": true, "name": "eventMeta", "description": "Display meta of range on event node when the timeline type is \"bar\"" }, { "nullable": null, "types": [ "array." ], "spread": false, "optional": true, "name": "eventData", "description": "You can declare the events with object format as default events you want to place" }, { "nullable": null, "types": [ "Effects" ], "spread": false, "optional": true, "name": "effects", "description": "You can declare effective styles as view of the timeline object" }, { "nullable": null, "types": [ "ColorScheme" ], "spread": false, "optional": true, "name": "colorScheme", "description": "Can overwrite defaults UI color of the event nodes" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"session\"", "defaultRaw": "session", "name": "storage", "description": "Specification of Web storage to cache event data, defaults to sessionStorage" }, { "nullable": null, "types": [ "boolean" ], "spread": false, "optional": true, "defaultValue": "true", "defaultRaw": true, "name": "reloadCacheKeep", "description": "Whether to load cached events during reloading, the cache is discarded if false" }, { "nullable": null, "types": [ "boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "zoom", "description": "Whether to use the ability to zoom the scale of the timeline by double clicking on any scale on the ruler" }, { "nullable": null, "types": [ "boolean" ], "spread": false, "optional": true, "defaultValue": "true", "defaultRaw": true, "name": "wrapScale", "description": "Whether wrapping new scale in the timeline container when zoom" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"canvas\"", "defaultRaw": "canvas", "name": "engine", "description": "Choose dependent module to core as rendering engine. It'll be \"canvas\" or \"d3.js\"; Maybe add in future version" }, { "nullable": null, "types": [ "boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "debug", "description": "Enable to debug mode if true then output logs for debugging to console; defaults to false" } ], "type": { "types": [ "Object" ], "optional": false, "name": "Default" } }, { "__docId__": 61, "kind": "typedef", "name": "LimitScaleGrids", "memberof": "src/timeline.esdoc.js", "static": true, "longname": "src/timeline.esdoc.js~LimitScaleGrids", "access": "public", "description": "The limited grid number per scale of timeline", "since": "2.0.0", "properties": [ { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "100", "defaultRaw": 100, "name": "millennium", "description": "In other words it's 100000 years" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "500", "defaultRaw": 500, "name": "century", "description": "In other words it's 50000 years" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "500", "defaultRaw": 500, "name": "decade", "description": "In other words it's 5000 years" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "500", "defaultRaw": 500, "name": "lustrum", "description": "In other words it's 2500 years" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "500", "defaultRaw": 500, "name": "year", "description": "In other words it's 500 years" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "540", "defaultRaw": 540, "name": "month", "description": "In other words it's 45 years" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "530", "defaultRaw": 530, "name": "week", "description": "In other words it's 10 years" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "366", "defaultRaw": 366, "name": "day", "description": "In other words it's about 1 years" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "720", "defaultRaw": 720, "name": "hour", "description": "In other words it's 30 days" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "720", "defaultRaw": 720, "name": "quarterHour", "description": "In other words it's 7.5 days" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "720", "defaultRaw": 720, "name": "halfHour", "description": "In other words it's 15 days" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "720", "defaultRaw": 720, "name": "minute", "description": "In other words it's 12 hours" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "900", "defaultRaw": 900, "name": "second", "description": "In other words it's 15 minutes" } ], "type": { "types": [ "Object" ], "optional": false, "name": "LimitScaleGrids" } }, { "__docId__": 62, "kind": "typedef", "name": "RelationOption", "memberof": "src/timeline.esdoc.js", "static": true, "longname": "src/timeline.esdoc.js~RelationOption", "access": "public", "description": "", "properties": [ { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "name": "before", "description": "Set target eventID to connect the relation line to the event (leftward on the timeline) in chronological before from oneself event." }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "name": "after", "description": "Set target eventID to connect the relation line to the event (rightward on the timeline) in chronological after from oneself event." }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "name": "linesize", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "linecolor", "description": "" }, { "nullable": null, "types": [ "number", "string", "boolean" ], "spread": false, "optional": true, "name": "curve", "description": "Whether the connection line is curved if the connection events are not on the same horizontal. If you specify a boolean value or a shorthand (0 or 1 only), it will be automatically curved. As with the previous version, it is also possible to specify the type of curve using defined preset values." } ], "type": { "types": [ "Object" ], "optional": false, "name": "RelationOption" } }, { "__docId__": 63, "kind": "typedef", "name": "EventParams", "memberof": "src/timeline.esdoc.js", "static": true, "longname": "src/timeline.esdoc.js~EventParams", "access": "public", "description": "The preset as default of event parameters on the timeline", "since": "2.0.0", "properties": [ { "nullable": null, "types": [ "string" ], "spread": false, "optional": false, "name": "uid", "description": "An unique id of event data, this can not define because this value is automatically generate as data for cache only" }, { "nullable": true, "types": [ "number" ], "spread": false, "optional": true, "name": "eventId", "description": "It is an ID that identifies an event for you to manipulate event data via each method. If omitted, consecutive numbers are automatically assigned." }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": false, "name": "x", "description": "Can not define because this value is automatically generate as data for cache only" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": false, "name": "y", "description": "Can not define because this value is automatically generate as data for cache only" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": false, "name": "width", "description": "Can not define because this value is automatically generate as data for cache only" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": false, "name": "height", "description": "Can not define because this value is automatically generate as data for cache only" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": false, "name": "start", "description": "Can not define because this value is automatically generate as data for cache only" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": false, "name": "end", "description": "Can not define because this value is automatically generate as data for cache only" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": false, "name": "row", "description": "Can not define because this value is automatically generate as data for cache only" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"#E7E7E7\"", "defaultRaw": "#E7E7E7", "name": "bgColor", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"#343A40\"", "defaultRaw": "#343A40", "name": "color", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"#6C757D\"", "defaultRaw": "#6C757D", "name": "bdColor", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "label", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "content", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "category", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "image", "description": "" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "name": "margin", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "rangeMeta", "description": "" }, { "nullable": null, "types": [ "number", "string" ], "spread": false, "optional": true, "defaultValue": "\"normal\"", "defaultRaw": "normal", "name": "size", "description": "Define the diameter size of pointer when type of the timeline is \"point\". Possible values are \"large\", \"normal\", \"small\" and value of pixel." }, { "nullable": null, "types": [ "Object" ], "spread": false, "optional": true, "name": "extend", "description": "The specified key/value pair is replaced with the data attribute of the event element." }, { "nullable": null, "types": [ "boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "remote", "description": "" }, { "nullable": null, "types": [ "RelationOption" ], "spread": false, "optional": true, "name": "relation", "description": "Setting for connecting events by relation lines when the timeline type is \"point\"." }, { "nullable": null, "types": [ "function" ], "spread": false, "optional": true, "name": "callback", "description": "Callback processing that binds to openEvent method when this event is clicked." } ], "type": { "types": [ "Object" ], "optional": false, "name": "EventParams" } }, { "__docId__": 64, "kind": "class", "name": "Timeline", "memberof": "src/timeline.esdoc.js", "static": true, "longname": "src/timeline.esdoc.js~Timeline", "access": "public", "export": true, "importPath": "jquery-timeline/src/timeline.esdoc.js", "importStyle": "{Timeline}", "description": "Pluin Core Class", "lineNumber": 346, "since": "2.0.0", "interface": false }, { "__docId__": 65, "kind": "constructor", "name": "constructor", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#constructor", "access": "public", "description": null, "lineNumber": 347, "undocument": true, "ignore": true }, { "__docId__": 66, "kind": "member", "name": "_config", "memberof": "src/timeline.esdoc.js~Timeline", "static": false, "longname": "src/timeline.esdoc.js~Timeline#_config", "access": "private", "description": null, "lineNumber": 349, "type": { "nullable": null, "types": [ "Object" ], "spread": false, "description": null } }, { "__docId__": 67, "kind": "member", "name": "_element", "memberof": "src/timeline.esdoc.js~Timeline", "static": false, "longname": "src/timeline.esdoc.js~Timeline#_element", "access": "private", "description": null, "lineNumber": 351, "type": { "nullable": null, "types": [ "Object" ], "spread": false, "description": null } }, { "__docId__": 68, "kind": "member", "name": "_selector", "memberof": "src/timeline.esdoc.js~Timeline", "static": false, "longname": "src/timeline.esdoc.js~Timeline#_selector", "access": "private", "description": null, "lineNumber": 353, "type": { "nullable": true, "types": [ "string" ], "spread": false, "description": null } }, { "__docId__": 69, "kind": "member", "name": "_isInitialized", "memberof": "src/timeline.esdoc.js~Timeline", "static": false, "longname": "src/timeline.esdoc.js~Timeline#_isInitialized", "access": "private", "description": null, "lineNumber": 355, "type": { "nullable": null, "types": [ "boolean" ], "spread": false, "description": null } }, { "__docId__": 70, "kind": "member", "name": "_isCached", "memberof": "src/timeline.esdoc.js~Timeline", "static": false, "longname": "src/timeline.esdoc.js~Timeline#_isCached", "access": "private", "description": null, "lineNumber": 357, "type": { "nullable": null, "types": [ "boolean" ], "spread": false, "description": null } }, { "__docId__": 71, "kind": "member", "name": "_isCompleted", "memberof": "src/timeline.esdoc.js~Timeline", "static": false, "longname": "src/timeline.esdoc.js~Timeline#_isCompleted", "access": "private", "description": null, "lineNumber": 359, "type": { "nullable": null, "types": [ "boolean" ], "spread": false, "description": null } }, { "__docId__": 72, "kind": "member", "name": "_isShown", "memberof": "src/timeline.esdoc.js~Timeline", "static": false, "longname": "src/timeline.esdoc.js~Timeline#_isShown", "access": "private", "description": null, "lineNumber": 361, "type": { "nullable": null, "types": [ "boolean" ], "spread": false, "description": null } }, { "__docId__": 73, "kind": "member", "name": "_instanceProps", "memberof": "src/timeline.esdoc.js~Timeline", "static": false, "longname": "src/timeline.esdoc.js~Timeline#_instanceProps", "access": "private", "description": null, "lineNumber": 363, "type": { "nullable": null, "types": [ "Object" ], "spread": false, "description": null } }, { "__docId__": 74, "kind": "member", "name": "_observer", "memberof": "src/timeline.esdoc.js~Timeline", "static": false, "longname": "src/timeline.esdoc.js~Timeline#_observer", "access": "private", "description": null, "lineNumber": 365, "type": { "nullable": true, "types": [ "Object" ], "spread": false, "description": null } }, { "__docId__": 75, "kind": "get", "name": "VERSION", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": true, "longname": "src/timeline.esdoc.js~Timeline.VERSION", "access": "public", "description": null, "lineNumber": 371, "type": { "nullable": null, "types": [ "string" ], "spread": false, "description": null } }, { "__docId__": 76, "kind": "get", "name": "Default", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": true, "longname": "src/timeline.esdoc.js~Timeline.Default", "access": "public", "description": null, "lineNumber": 376, "type": { "nullable": null, "types": [ "Default" ], "spread": false, "description": null } }, { "__docId__": 77, "kind": "method", "name": "_getConfig", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_getConfig", "access": "private", "description": "Define the default options of this plugin", "lineNumber": 388, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "config", "description": "Initial options" } ], "return": { "nullable": null, "types": [ "Object" ], "spread": false, "description": "Config overrided initial options to default config" } }, { "__docId__": 78, "kind": "method", "name": "_filterScaleKeyName", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_filterScaleKeyName", "access": "private", "description": "Filter the scale key name for LimitScaleGrids", "lineNumber": 402, "params": [ { "nullable": null, "types": [ "string" ], "spread": false, "optional": false, "name": "key", "description": "" } ], "return": { "nullable": null, "types": [ "string" ], "spread": false, "description": "Filtered scale key name" } }, { "__docId__": 79, "kind": "method", "name": "_init", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_init", "access": "private", "description": "Initialize the plugin", "lineNumber": 422, "params": [], "return": null }, { "__docId__": 82, "kind": "method", "name": "_calcVars", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_calcVars", "access": "private", "description": "Calculate each properties of the timeline instance", "lineNumber": 511, "params": [], "return": null }, { "__docId__": 85, "kind": "method", "name": "_getPluggableDatetime", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_getPluggableDatetime", "access": "private", "description": "Retrieve the pluggable datetime as milliseconds from specified keyword", "lineNumber": 577, "params": [ { "nullable": null, "types": [ "string" ], "spread": false, "optional": false, "name": "key", "description": "Any one of \"current\", \"auto\", or datetime string" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "name": "round_type", "description": "" } ], "return": { "nullable": null, "types": [ "number" ], "spread": false, "description": "This value unit is milliseconds" } }, { "__docId__": 86, "kind": "method", "name": "_getPluggableParams", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_getPluggableParams", "access": "private", "description": "Retrieve the pluggable parameter as an object", "lineNumber": 719, "params": [ { "nullable": null, "types": [ "string" ], "spread": false, "optional": false, "name": "str_like_params", "description": "Strings that can be parsed as javascript objects" } ], "return": { "nullable": null, "types": [ "Object" ], "spread": false, "description": "" } }, { "__docId__": 87, "kind": "method", "name": "_getPluggableRows", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_getPluggableRows", "access": "private", "description": "Retrieve the pluggable rows of the timeline", "lineNumber": 740, "return": { "nullable": null, "types": [ "number" ], "spread": false, "description": "" }, "params": [] }, { "__docId__": 88, "kind": "method", "name": "_verifyScale", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_verifyScale", "access": "private", "description": "Verify the allowed scale, then retrieve that scale's millisecond if allowed", "lineNumber": 756, "params": [ { "nullable": null, "types": [ "string" ], "spread": false, "optional": false, "name": "scale", "description": "" } ], "return": { "nullable": null, "types": [ "number", "boolean" ], "spread": false, "description": "Return false if specified an invalid scale" } }, { "__docId__": 89, "kind": "method", "name": "_verifyMaxRenderableRange", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_verifyMaxRenderableRange", "access": "private", "description": "Verify the display period of the timeline does not exceed the maximum renderable range", "lineNumber": 849, "return": { "nullable": null, "types": [ "boolean" ], "spread": false, "description": "" }, "params": [] }, { "__docId__": 90, "kind": "method", "name": "_renderView", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_renderView", "access": "private", "description": "Render the view of timeline container", "lineNumber": 858, "params": [], "return": null }, { "__docId__": 92, "kind": "method", "name": "_createHeadline", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_createHeadline", "access": "private", "description": "Create the headline of the timeline", "lineNumber": 920, "return": { "nullable": null, "types": [ "Object" ], "spread": false, "description": "Generated DOM element" }, "params": [] }, { "__docId__": 93, "kind": "method", "name": "_createEventContainer", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_createEventContainer", "access": "private", "description": "Create the event container of the timeline", "lineNumber": 956, "return": { "nullable": null, "types": [ "Object" ], "spread": false, "description": "Generated DOM element" }, "params": [] }, { "__docId__": 94, "kind": "method", "name": "_createRuler", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_createRuler", "access": "private", "description": "Create the ruler of the timeline", "lineNumber": 1045, "params": [ { "nullable": null, "types": [ "string" ], "spread": false, "optional": false, "name": "position", "description": "Either \"top\" or \"bottom\" as the position of the ruler" } ], "return": { "nullable": null, "types": [ "Object" ], "spread": false, "description": "Generated DOM element" } }, { "__docId__": 95, "kind": "method", "name": "_filterVariableScale", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_filterVariableScale", "access": "private", "description": "Filter to aggregate the grid width of the variable length scale", "lineNumber": 1140, "params": [ { "nullable": null, "types": [ "string" ], "spread": false, "optional": false, "name": "target_scale", "description": "" } ], "return": { "nullable": null, "types": [ "Object" ], "spread": false, "description": "" } }, { "__docId__": 96, "kind": "method", "name": "_getGridsPerScale", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_getGridsPerScale", "access": "private", "description": "Get the grid number per scale (for fixed length scale)", "lineNumber": 1241, "params": [ { "nullable": null, "types": [ "string" ], "spread": false, "optional": false, "name": "target_scale", "description": "" } ], "return": { "nullable": null, "types": [ "Object" ], "spread": false, "description": "" } }, { "__docId__": 97, "kind": "method", "name": "_createRulerContent", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_createRulerContent", "access": "private", "description": "Create the content of ruler of the timeline", "lineNumber": 1302, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "_line_grids", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": false, "name": "line_scale", "description": "" }, { "nullable": null, "types": [ "RulerOptions" ], "spread": false, "optional": false, "name": "ruler", "description": "" } ], "return": { "nullable": null, "types": [ "Object" ], "spread": false, "description": "Generated DOM element" } }, { "__docId__": 98, "kind": "method", "name": "_createSideIndex", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_createSideIndex", "access": "private", "description": "Create the side indexes of the timeline", "lineNumber": 1344, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "margin", "description": "" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": false, "name": "margin.top", "description": "" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": false, "name": "margin.bottom", "description": "" } ], "return": { "nullable": null, "types": [ "Object" ], "spread": false, "description": "Generated DOM element" } }, { "__docId__": 99, "kind": "method", "name": "_createFooter", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_createFooter", "access": "private", "description": "Create the footer of the timeline", "lineNumber": 1387, "return": { "nullable": null, "types": [ "Object" ], "spread": false, "description": "Generated DOM element" }, "params": [] }, { "__docId__": 100, "kind": "method", "name": "_diffDate", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_diffDate", "access": "private", "description": "Acquire the difference between two dates with the specified scale value", "lineNumber": 1427, "params": [ { "nullable": null, "types": [ "number" ], "spread": false, "optional": false, "name": "date1", "description": "Number that can be parsed as datetime" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": false, "name": "date2", "description": "Number that can be parsed as datetime" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"millisecond\"", "defaultRaw": "millisecond", "name": "scale", "description": "" }, { "nullable": null, "types": [ "boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "absval", "description": "" } ], "return": { "nullable": null, "types": [ "number", "boolean" ], "spread": false, "description": "" } }, { "__docId__": 101, "kind": "method", "name": "_loadEvent", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_loadEvent", "access": "private", "description": "Load all enabled events markupped on target element to the timeline object", "lineNumber": 1531, "params": [], "return": null }, { "__docId__": 103, "kind": "method", "name": "_registerEventData", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_registerEventData", "access": "private", "description": "Register one event data as object", "lineNumber": 1589, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "event_element", "description": "" }, { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "params", "description": "" } ], "return": { "nullable": null, "types": [ "Object" ], "spread": false, "description": "Registered new event data" } }, { "__docId__": 104, "kind": "method", "name": "_getCoordinateX", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_getCoordinateX", "access": "private", "description": "Get the coordinate X on the timeline of any date", "lineNumber": 1681, "params": [ { "nullable": null, "types": [ "string" ], "spread": false, "optional": false, "name": "date", "description": "" } ], "return": { "nullable": null, "types": [ "number" ], "spread": false, "description": "The pixel value as the coordinate X on timeline" } }, { "__docId__": 105, "kind": "method", "name": "_saveToCache", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_saveToCache", "access": "private", "description": "Cache the event data to the web storage", "lineNumber": 1707, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "data", "description": "" } ], "return": { "types": [ "boolean" ] } }, { "__docId__": 106, "kind": "method", "name": "_loadToCache", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_loadToCache", "access": "private", "description": "Load the cached event data from the web storage", "lineNumber": 1728, "return": { "nullable": null, "types": [ "Object" ], "spread": false, "description": "" }, "params": [] }, { "__docId__": 107, "kind": "method", "name": "_removeCache", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_removeCache", "access": "private", "description": "Remove the cache data on the web storage", "lineNumber": 1749, "params": [], "return": null }, { "__docId__": 108, "kind": "method", "name": "_placeEvent", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_placeEvent", "access": "private", "description": "Controller method to place event data on timeline\n@private: ", "lineNumber": 1768, "params": [], "return": null }, { "__docId__": 109, "kind": "method", "name": "_createEventNode", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_createEventNode", "access": "private", "description": "Create an event element on the timeline", "lineNumber": 1813, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "params", "description": "" } ], "return": { "nullable": null, "types": [ "Object" ], "spread": false, "description": "Generated DOM element" } }, { "__docId__": 110, "kind": "method", "name": "_getPointerSize", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_getPointerSize", "access": "private", "description": "Retrieve the diameter size (pixel) of pointer", "lineNumber": 1936, "params": [ { "nullable": null, "types": [ "number", "string" ], "spread": false, "optional": false, "name": "key", "description": "" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": false, "name": "margin", "description": "" } ], "return": { "nullable": null, "types": [ "number" ], "spread": false, "description": "" } }, { "__docId__": 111, "kind": "method", "name": "_drawRelationLine", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_drawRelationLine", "access": "private", "description": "Draw the relational lines", "lineNumber": 1965, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "events", "description": "" } ], "return": null }, { "__docId__": 112, "kind": "method", "name": "_mapPlacedEvents", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_mapPlacedEvents", "access": "private", "description": "Retrieve the mapping data that placed current events", "lineNumber": 2212, "return": { "nullable": null, "types": [ "number[]" ], "spread": false, "description": "" }, "params": [] }, { "__docId__": 113, "kind": "method", "name": "_activeEvent", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_activeEvent", "access": "private", "description": "Event when focus or blur", "lineNumber": 2246, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "event", "description": "" } ], "return": null }, { "__docId__": 114, "kind": "method", "name": "_hoverPointer", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_hoverPointer", "access": "private", "description": "Event when hover on the pointer type event", "lineNumber": 2264, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "event", "description": "" } ], "return": null }, { "__docId__": 115, "kind": "method", "name": "_error", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_error", "access": "private", "description": "Logger of errors when the method execution", "lineNumber": 2296, "params": [ { "nullable": false, "types": [ "string" ], "spread": false, "optional": false, "name": "message", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "'error'", "defaultRaw": "'error'", "name": "type", "description": "" } ], "return": null }, { "__docId__": 116, "kind": "method", "name": "_debug", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#_debug", "access": "private", "description": "Echo the log of plugin for debugging", "lineNumber": 2309, "params": [ { "nullable": null, "types": [ "string" ], "spread": false, "optional": false, "name": "message", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"Notice\"", "defaultRaw": "Notice", "name": "throwType", "description": "" } ], "return": null }, { "__docId__": 117, "kind": "method", "name": "initialized", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#initialized", "access": "public", "description": "This method is able to call only once after completed an initializing of the plugin", "lineNumber": 2337, "params": [ { "nullable": true, "types": [ "Function()" ], "spread": false, "optional": false, "name": "callback", "description": "Custom callback fired after calling this method" }, { "nullable": true, "types": [ "number", "string", "Object" ], "spread": false, "optional": false, "name": "userdata", "description": "Data as object of referable in that callback" } ], "return": null }, { "__docId__": 119, "kind": "method", "name": "destroy", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#destroy", "access": "public", "description": "Destroy the object to which the plugin is applied", "lineNumber": 2362, "params": [], "return": null }, { "__docId__": 120, "kind": "member", "name": "[_prop]", "memberof": "src/timeline.esdoc.js~Timeline", "static": false, "longname": "src/timeline.esdoc.js~Timeline#[_prop]", "access": "public", "description": null, "lineNumber": 2374, "undocument": true, "type": { "types": [ "*" ] }, "ignore": true }, { "__docId__": 121, "kind": "method", "name": "render", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#render", "access": "public", "description": "", "lineNumber": 2382, "deprecated": "This method has been deprecated since version 2.0.0", "params": [], "return": null }, { "__docId__": 122, "kind": "method", "name": "show", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#show", "access": "public", "description": "Show hidden timeline", "lineNumber": 2390, "params": [], "return": null }, { "__docId__": 124, "kind": "method", "name": "hide", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#hide", "access": "public", "description": "Hide shown timeline", "lineNumber": 2406, "params": [], "return": null }, { "__docId__": 126, "kind": "method", "name": "dateback", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#dateback", "access": "public", "description": "Move shift or expand the range of timeline container as to past direction (to left)", "lineNumber": 2425, "params": [ { "nullable": true, "types": [ "Object" ], "spread": false, "optional": false, "name": "options", "description": "Options for moving as dateback on the timeline container" }, { "nullable": true, "types": [ "Function()" ], "spread": false, "optional": false, "name": "callback", "description": "Custom callback fired after calling this method" }, { "nullable": true, "types": [ "number", "string", "Object" ], "spread": false, "optional": false, "name": "userdata", "description": "Data as object of referable in that callback" } ], "return": null }, { "__docId__": 127, "kind": "method", "name": "dateforth", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#dateforth", "access": "public", "description": "Move shift or expand the range of timeline container as to futrue direction (to right)", "lineNumber": 2474, "params": [ { "nullable": true, "types": [ "Object" ], "spread": false, "optional": false, "name": "options", "description": "Options for moving as dateforth on the timeline container" }, { "nullable": true, "types": [ "Function()" ], "spread": false, "optional": false, "name": "callback", "description": "Custom callback fired after calling this method" }, { "nullable": true, "types": [ "number", "string", "Object" ], "spread": false, "optional": false, "name": "userdata", "description": "Data as object of referable in that callback" } ], "return": null }, { "__docId__": 128, "kind": "method", "name": "alignment", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#alignment", "access": "public", "description": "Move the display position of the timeline container to the specified position", "lineNumber": 2522, "params": [ { "nullable": true, "types": [ "string" ], "spread": false, "optional": false, "name": "position", "description": "The preset string of position on timeline you want to align. Allowed values are \"left\", \"begin\", \"center\", \"right\", \"end\", \"latest\", \"current\", \"currently\" or number of event id" }, { "nullable": true, "types": [ "number", "string" ], "spread": false, "optional": false, "name": "duration", "description": "The duration of alignment animation. Allowed values are \"fast\", \"normal\", \"slow\" or number of milliseconds" } ], "return": null }, { "__docId__": 129, "kind": "method", "name": "getOptions", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#getOptions", "access": "public", "description": "", "lineNumber": 2619, "deprecated": "This method has been deprecated since version 2.0.0", "params": [], "return": null }, { "__docId__": 130, "kind": "method", "name": "addEvent", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#addEvent", "access": "public", "description": "Add new events to the rendered timeline object", "lineNumber": 2629, "params": [ { "nullable": true, "types": [ "Function()" ], "spread": false, "optional": false, "name": "callback", "description": "Custom callback fired after calling this method" }, { "nullable": true, "types": [ "number", "string", "Object" ], "spread": false, "optional": false, "name": "userdata", "description": "Data as object of referable in that callback" } ], "return": null }, { "__docId__": 131, "kind": "method", "name": "removeEvent", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#removeEvent", "access": "public", "description": "Remove events from the currently timeline object", "lineNumber": 2682, "params": [ { "nullable": true, "types": [ "Function()" ], "spread": false, "optional": false, "name": "callback", "description": "Custom callback fired after calling this method" }, { "nullable": true, "types": [ "number", "string", "Object" ], "spread": false, "optional": false, "name": "userdata", "description": "Data as object of referable in that callback" } ], "return": null }, { "__docId__": 132, "kind": "method", "name": "updateEvent", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#updateEvent", "access": "public", "description": "Update events on the currently timeline object", "lineNumber": 2774, "params": [ { "nullable": true, "types": [ "Function()" ], "spread": false, "optional": false, "name": "callback", "description": "Custom callback fired after calling this method" }, { "nullable": true, "types": [ "number", "string", "Object" ], "spread": false, "optional": false, "name": "userdata", "description": "Data as object of referable in that callback" } ], "return": null }, { "__docId__": 133, "kind": "method", "name": "reload", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#reload", "access": "public", "description": "Reload the timeline with overridable any options", "lineNumber": 2829, "params": [ { "nullable": true, "types": [ "Function()" ], "spread": false, "optional": false, "name": "callback", "description": "Custom callback fired after calling this method" }, { "nullable": true, "types": [ "number", "string", "Object" ], "spread": false, "optional": false, "name": "userdata", "description": "Data as object of referable in that callback" } ], "return": null }, { "__docId__": 142, "kind": "method", "name": "openEvent", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#openEvent", "access": "public", "description": "The method that fires when an event on the timeline is clicked\nNote: You can hook the custom processing with the callback specified in the event parameter", "lineNumber": 2903, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "event", "description": "" } ], "return": null }, { "__docId__": 143, "kind": "method", "name": "zoomScale", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#zoomScale", "access": "public", "description": "Be zoomed in scale of the timeline that fires when any scales on the ruler is double clicked", "lineNumber": 2963, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "event", "description": "" } ], "return": null }, { "__docId__": 144, "kind": "method", "name": "showLoader", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#showLoader", "access": "public", "description": "Show the loader", "lineNumber": 3083, "params": [], "return": null }, { "__docId__": 145, "kind": "method", "name": "hideLoader", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#hideLoader", "access": "public", "description": "Hide the loader", "lineNumber": 3123, "params": [], "return": null }, { "__docId__": 146, "kind": "method", "name": "is_empty", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#is_empty", "access": "public", "description": "Determine empty that like PHP", "lineNumber": 3140, "params": [ { "nullable": false, "types": [ "number", "string", "Object", "number[]", "boolean" ], "spread": false, "optional": false, "name": "value", "description": "Variable you want to check" } ], "return": { "nullable": null, "types": [ "boolean" ], "spread": false, "description": "" } }, { "__docId__": 147, "kind": "method", "name": "is_Object", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#is_Object", "access": "public", "description": "Determine whether variable is an Object", "lineNumber": 3186, "params": [ { "nullable": false, "types": [ "number", "string", "Object", "boolean" ], "spread": false, "optional": false, "name": "item", "description": "Variable you want to check" } ], "return": { "nullable": null, "types": [ "boolean" ], "spread": false, "description": "" } }, { "__docId__": 148, "kind": "method", "name": "mergeDeep", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#mergeDeep", "access": "public", "description": "Merge two objects deeply as polyfill for instead \"$.extend(true,target,source)\"", "lineNumber": 3196, "params": [ { "nullable": false, "types": [ "Object" ], "spread": false, "optional": false, "name": "target", "description": "" }, { "nullable": false, "types": [ "Object" ], "spread": false, "optional": false, "name": "source", "description": "" } ], "return": { "nullable": null, "types": [ "Object" ], "spread": false, "description": "" } }, { "__docId__": 149, "kind": "method", "name": "is_iterable", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#is_iterable", "access": "public", "description": "Determine whether the object is iterable", "lineNumber": 3220, "params": [ { "nullable": false, "types": [ "Object" ], "spread": false, "optional": false, "name": "obj", "description": "" } ], "return": { "nullable": null, "types": [ "boolean" ], "spread": false, "description": "" } }, { "__docId__": 150, "kind": "method", "name": "toIterableObject", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#toIterableObject", "access": "public", "description": "Add an @@iterator method to non-iterable object", "lineNumber": 3229, "params": [ { "nullable": false, "types": [ "Object" ], "spread": false, "optional": false, "name": "obj", "description": "" } ], "return": { "nullable": null, "types": [ "Object" ], "spread": false, "description": "" } }, { "__docId__": 151, "kind": "method", "name": "sleep", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#sleep", "access": "public", "description": "Await until next process at specific millisec", "lineNumber": 3255, "params": [ { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "1", "defaultRaw": 1, "name": "msec", "description": "Millisecond" } ], "return": { "types": [ "*" ] } }, { "__docId__": 152, "kind": "method", "name": "supplement", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#supplement", "access": "public", "description": "Supplemental method for validating arguments in local scope", "lineNumber": 3268, "params": [ { "nullable": false, "types": [ "number", "string", "Object", "boolean" ], "spread": false, "optional": false, "name": "default_value", "description": "" }, { "nullable": true, "types": [ "number", "string", "Object", "boolean" ], "spread": false, "optional": false, "name": "opt_arg", "description": "" }, { "nullable": true, "types": [ "number", "string", "Object", "boolean" ], "spread": false, "optional": false, "name": "opt_callback", "description": "function or string of function to call" } ], "return": { "nullable": null, "types": [ "number", "string", "Object", "boolean" ], "spread": false, "description": "" } }, { "__docId__": 153, "kind": "method", "name": "generateUniqueID", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#generateUniqueID", "access": "public", "description": "Generate the pluggable unique id", "lineNumber": 3283, "params": [ { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "1000", "defaultRaw": 1000, "name": "digit", "description": "" } ], "return": { "nullable": null, "types": [ "string" ], "spread": false, "description": "" } }, { "__docId__": 154, "kind": "method", "name": "numRound", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#numRound", "access": "public", "description": "Round a number with specific digit", "lineNumber": 3294, "params": [ { "nullable": false, "types": [ "number" ], "spread": false, "optional": false, "name": "number", "description": "" }, { "nullable": true, "types": [ "number" ], "spread": false, "optional": false, "name": "digit", "description": "Defaults to 0" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"round\"", "defaultRaw": "round", "name": "round_type", "description": "" } ], "return": { "nullable": null, "types": [ "number" ], "spread": false, "description": "" } }, { "__docId__": 155, "kind": "method", "name": "hexToRgbA", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#hexToRgbA", "access": "public", "description": "Convert hex of color code to rgba", "lineNumber": 3315, "params": [ { "nullable": false, "types": [ "string" ], "spread": false, "optional": false, "name": "hex", "description": "" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "1", "defaultRaw": 1, "name": "alpha", "description": "" } ], "return": { "nullable": null, "types": [ "string" ], "spread": false, "description": "" } }, { "__docId__": 156, "kind": "method", "name": "getCorrectDatetime", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#getCorrectDatetime", "access": "public", "description": "Get the correct datetime with remapping to that if the year is 0 - 99", "lineNumber": 3335, "params": [ { "nullable": false, "types": [ "string" ], "spread": false, "optional": false, "name": "datetime_str", "description": "" } ], "return": { "nullable": true, "types": [ "Object" ], "spread": false, "description": "Date Object, or null if failed" } }, { "__docId__": 157, "kind": "method", "name": "getWeek", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#getWeek", "access": "public", "description": "Method to get week number as extension of Date object", "lineNumber": 3395, "params": [ { "nullable": false, "types": [ "string" ], "spread": false, "optional": false, "name": "date_str", "description": "" } ], "return": { "nullable": null, "types": [ "number" ], "spread": false, "description": "" } }, { "__docId__": 158, "kind": "method", "name": "getFirstDayOfWeek", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#getFirstDayOfWeek", "access": "public", "description": "Retrieve a first day of the week from week number (Note: added support for daylight savings time but needs improvement as performance has dropped)", "lineNumber": 3418, "params": [ { "nullable": false, "types": [ "number" ], "spread": false, "optional": false, "name": "week_number", "description": "" }, { "nullable": false, "types": [ "number" ], "spread": false, "optional": false, "name": "year", "description": "defaults to current year" } ], "return": { "nullable": null, "types": [ "object", "boolean" ], "spread": false, "description": "" } }, { "__docId__": 159, "kind": "method", "name": "modifyDate", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#modifyDate", "access": "public", "description": "Get the datetime shifted from the specified datetime by any fluctuation value", "lineNumber": 3458, "params": [ { "nullable": false, "types": [ "object" ], "spread": false, "optional": false, "name": "datetime", "description": "to be date object filtered by getCorrectDatetime method" }, { "nullable": false, "types": [ "number" ], "spread": false, "optional": false, "name": "fluctuation", "description": "an interval value to shift from given base datetime" }, { "nullable": false, "types": [ "string" ], "spread": false, "optional": false, "name": "scale", "description": "the scale of an interval value" } ], "return": { "nullable": null, "types": [ "object", "boolean" ], "spread": false, "description": "" } }, { "__docId__": 160, "kind": "method", "name": "diffDate", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#diffDate", "access": "public", "description": "Acquire the difference between two dates with the specified scale value", "lineNumber": 3552, "params": [ { "nullable": false, "types": [ "number", "object" ], "spread": false, "optional": false, "name": "date1", "description": "integer as milliseconds or object instanceof Date)" }, { "nullable": false, "types": [ "number", "object" ], "spread": false, "optional": false, "name": "date2", "description": "integer as milliseconds or object instanceof Date)" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "'millisecond'", "defaultRaw": "'millisecond'", "name": "scale", "description": "defaults to 'millisecond'" }, { "nullable": null, "types": [ "boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "absval", "description": "defaults to false" } ], "return": { "nullable": null, "types": [ "object", "boolean" ], "spread": false, "description": "" } }, { "__docId__": 161, "kind": "method", "name": "verifyScale", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#verifyScale", "access": "public", "description": "Verify whether is allowed scale in the plugin. Then retrieves that values of intervals on the scale if the scale is available and given arguments of date range. And return the base millisecond of scale if it is not the variable length scale (isVLS to false)", "lineNumber": 3828, "params": [ { "nullable": false, "types": [ "string" ], "spread": false, "optional": false, "name": "scale", "description": "" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "null", "defaultRaw": null, "name": "begin", "description": "begin of range as unit millisecs that got by `Date.getTime()`" }, { "nullable": null, "types": [ "number" ], "spread": false, "optional": true, "defaultValue": "null", "defaultRaw": null, "name": "end", "description": "end of range as unit millisecs that got by `Date.getTime()`" }, { "nullable": null, "types": [ "boolean" ], "spread": false, "optional": true, "defaultValue": "false", "defaultRaw": false, "name": "isVLS", "description": "whether is variable length scale, defaults to false" } ], "return": { "nullable": null, "types": [ "object", "boolean" ], "spread": false, "description": "boolean if no arguments are given after the first argument" } }, { "__docId__": 162, "kind": "method", "name": "getHigherScale", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#getHigherScale", "access": "public", "description": "Retrieve one higher scale", "lineNumber": 3917, "params": [ { "nullable": false, "types": [ "string" ], "spread": false, "optional": false, "name": "scale", "description": "" } ], "return": { "nullable": null, "types": [ "string" ], "spread": false, "description": "String of higher scale" } }, { "__docId__": 163, "kind": "method", "name": "getLowerScale", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#getLowerScale", "access": "public", "description": "Retrieve one lower scale", "lineNumber": 3926, "params": [ { "nullable": false, "types": [ "string" ], "spread": false, "optional": false, "name": "scale", "description": "" } ], "return": { "nullable": null, "types": [ "string" ], "spread": false, "description": "String of lower scale" } }, { "__docId__": 164, "kind": "method", "name": "findScale", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#findScale", "access": "public", "description": "Find scale matched the specified condition", "lineNumber": 3936, "params": [ { "nullable": false, "types": [ "string" ], "spread": false, "optional": false, "name": "base_scale", "description": "" }, { "nullable": false, "types": [ "string" ], "spread": false, "optional": false, "name": "condition", "description": "" } ], "return": { "nullable": null, "types": [ "string", "object" ], "spread": false, "description": "matched scale(s)" } }, { "__docId__": 165, "kind": "method", "name": "getLocaleString", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#getLocaleString", "access": "public", "description": "Retrieve the date string of specified locale", "lineNumber": 3988, "params": [ { "nullable": false, "types": [ "string" ], "spread": false, "optional": false, "name": "date_seed", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"\"", "defaultRaw": "", "name": "scale", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"en-US\"", "defaultRaw": "en-US", "name": "locales", "description": "" }, { "nullable": null, "types": [ "Object" ], "spread": false, "optional": true, "defaultValue": "{}", "defaultRaw": {}, "name": "options", "description": "" } ], "return": { "nullable": null, "types": [ "string" ], "spread": false, "description": "Locale string" } }, { "__docId__": 166, "kind": "method", "name": "datetimeFormat", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#datetimeFormat", "access": "public", "description": "Convert the date-time to custom formatting strings, as like ruby", "lineNumber": 4180, "params": [ { "nullable": false, "types": [ "number", "object" ], "spread": false, "optional": false, "name": "baseDate", "description": "should be a Date object" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "''", "defaultRaw": "''", "name": "format", "description": "" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "'en-US'", "defaultRaw": "'en-US'", "name": "locales", "description": "" } ], "return": { "nullable": null, "types": [ "string" ], "spread": false, "description": "" } }, { "__docId__": 167, "kind": "method", "name": "strWidth", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#strWidth", "access": "public", "description": "Get the rendering width of the given string", "lineNumber": 4307, "params": [ { "nullable": false, "types": [ "string" ], "spread": false, "optional": false, "name": "str", "description": "" } ], "return": { "nullable": null, "types": [ "number" ], "spread": false, "description": "" } }, { "__docId__": 168, "kind": "method", "name": "compareValues", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#compareValues", "access": "public", "description": "Sort an array by value of specific property (Note: destructive method)", "examples": [ "Object.sort( this.compareValues( property, order ) )" ], "lineNumber": 4327, "params": [ { "nullable": false, "types": [ "string" ], "spread": false, "optional": false, "name": "property", "description": "To compare a property of object" }, { "nullable": null, "types": [ "string" ], "spread": false, "optional": true, "defaultValue": "\"asc\"", "defaultRaw": "asc", "name": "order", "description": "Order to sort" } ], "return": { "nullable": null, "types": [ "number" ], "spread": false, "description": "Comparison index" } }, { "__docId__": 169, "kind": "method", "name": "getUserArg", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#getUserArg", "access": "public", "description": "Getter argument as user data", "lineNumber": 4354, "since": "v2.1.0", "params": [ { "nullable": false, "types": [ "object" ], "spread": false, "optional": false, "name": "userdata", "description": "" } ], "return": { "nullable": null, "types": [ "object" ], "spread": false, "description": "" } }, { "__docId__": 170, "kind": "method", "name": "applyThemeStyle", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#applyThemeStyle", "access": "public", "description": "Apply custom theme styles", "lineNumber": 4390, "since": "v2.1.0", "return": { "nullable": null, "types": [ "void" ], "spread": false, "description": "" }, "params": [] }, { "__docId__": 171, "kind": "method", "name": "validateString", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#validateString", "access": "public", "description": "Validator for string", "lineNumber": 4454, "params": [ { "nullable": false, "types": [ "number", "string", "Object", "boolean" ], "spread": false, "optional": false, "name": "def", "description": "Define instead this value as default if validation failure" }, { "nullable": false, "types": [ "number", "string", "Object", "boolean" ], "spread": false, "optional": false, "name": "val", "description": "Value to validate" } ], "return": { "nullable": null, "types": [ "number", "string", "Object", "boolean" ], "spread": false, "description": "" } }, { "__docId__": 172, "kind": "method", "name": "validateNumeric", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#validateNumeric", "access": "public", "description": "Validator for numeric", "lineNumber": 4463, "params": [ { "nullable": false, "types": [ "number", "string", "Object", "boolean" ], "spread": false, "optional": false, "name": "def", "description": "Define instead this value as default if validation failure" }, { "nullable": false, "types": [ "number", "string", "Object", "boolean" ], "spread": false, "optional": false, "name": "val", "description": "Value to validate" } ], "return": { "nullable": null, "types": [ "number", "string", "Object", "boolean" ], "spread": false, "description": "" } }, { "__docId__": 173, "kind": "method", "name": "validateBoolean", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#validateBoolean", "access": "public", "description": "Validator for boolean", "lineNumber": 4472, "params": [ { "nullable": false, "types": [ "number", "string", "Object", "boolean" ], "spread": false, "optional": false, "name": "def", "description": "Define instead this value as default if validation failure" }, { "nullable": false, "types": [ "number", "string", "Object", "boolean" ], "spread": false, "optional": false, "name": "val", "description": "Value to validate" } ], "return": { "nullable": null, "types": [ "number", "string", "Object", "boolean" ], "spread": false, "description": "" } }, { "__docId__": 174, "kind": "method", "name": "validateObject", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#validateObject", "access": "public", "description": "Validator for object", "lineNumber": 4481, "params": [ { "nullable": false, "types": [ "number", "string", "Object", "boolean" ], "spread": false, "optional": false, "name": "def", "description": "Define instead this value as default if validation failure" }, { "nullable": false, "types": [ "number", "string", "Object", "boolean" ], "spread": false, "optional": false, "name": "val", "description": "Value to validate" } ], "return": { "nullable": null, "types": [ "number", "string", "Object", "boolean" ], "spread": false, "description": "" } }, { "__docId__": 175, "kind": "method", "name": "validateArray", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": false, "longname": "src/timeline.esdoc.js~Timeline#validateArray", "access": "public", "description": "Validator for array", "lineNumber": 4490, "params": [ { "nullable": false, "types": [ "number", "string", "Object", "boolean" ], "spread": false, "optional": false, "name": "def", "description": "Define instead this value as default if validation failure" }, { "nullable": false, "types": [ "number", "string", "Object", "boolean" ], "spread": false, "optional": false, "name": "val", "description": "Value to validate" } ], "return": { "nullable": null, "types": [ "number", "string", "Object", "boolean" ], "spread": false, "description": "" } }, { "__docId__": 176, "kind": "method", "name": "_jQueryInterface", "memberof": "src/timeline.esdoc.js~Timeline", "generator": false, "async": false, "static": true, "longname": "src/timeline.esdoc.js~Timeline._jQueryInterface", "access": "private", "description": "Interface for jQuery", "lineNumber": 4503, "unknown": [ { "tagName": "@interface", "tagValue": "" } ], "params": [ { "nullable": true, "types": [ "string", "Object" ], "spread": false, "optional": false, "name": "config", "description": "The object of plugin options or string of public method" }, { "nullable": true, "types": [ "...string", "...Function()" ], "spread": true, "optional": false, "name": "args", "description": "Arguments for public method" } ], "return": { "types": [ "*" ] } }, { "kind": "index", "content": "

\n

jQuery.Timeline V2

\n\n \n \n \n \n \n \n
\"Bar\"Point\"Mixed
\n\n

\n You are able to easily create two types of horizontal timeline with this jQuery plugin.\n
\n
\n Report bug\n ·\n Request feature\n ·\n Blog\n

\n

\n\n[![Build Status](https://travis-ci.org/ka215/jquery.timeline.svg?branch=master)](https://travis-ci.org/ka215/jquery.timeline)\n![David](https://img.shields.io/david/ka215/jquery.timeline.svg)\n![GitHub release](https://img.shields.io/github/release/ka215/jquery.timeline.svg)\n![GitHub All Releases](https://img.shields.io/github/downloads/ka215/jquery.timeline/total.svg)\n[![Packagist](https://img.shields.io/packagist/l/doctrine/orm.svg)](https://raw.githubusercontent.com/ka215/jquery.timeline/master/LICENSE)\n\n
\n\n## Table of Contents\n\n- [Quick start](#quick-start)\n- [What's included](#whats-included)\n- [Usage](#usage)\n- [Supported browsers](#supported-browsers)\n- [Tutorials](#tutorials)\n- [Documentation](#documentation)\n- [Example as demonstration](#example-as-demonstration)\n- [Contributions](#contributions)\n- [Creators](#creators)\n- [Copyright and license](#copyright-and-license)\n\n## Quick start\n\nSeveral quick start options are available:\n\n\n\n\n- [Download the latest release](https://github.com/ka215/jquery.timeline/releases/latest/).\n- Clone the repository: `git clone https://github.com/ka215/jquery.timeline.git`\n- Load via CDN:\n```HTML\n\n\n```\n\n## What's included\n\nWithin the download you'll find the following directories and files, logically grouping common assets and providing compiled and minified variations. You'll see something like this:\n\n```\njquery.timeline/\n└── dist/\n ├── jquery.timeline.min.css\n └── jquery.timeline.min.js\n```\n\nWe provide compiled and minified CSS and JS (`jquery.timeline.min.*`).\nWhen deployed by using task for develop, generated source maps (`jquery.timeline.*.map`) are available for use with certain browsers' developer tools.\n\n\n## Usage\n\nInclude the installed files into your html:\n\n```HTML\n\n\n\n```\n\nNote: You should include the jquery core script before including this plugin javascript file. Also we recommend that would like to add `defer` attribute into script tag.\n\nBind this plugin in the scope had imported the jQuery:\n\n```JavaScript\n$('#myTimeline').Timeline()\n```\n\n\n## Supported browsers\n\njQuery.Timeline version 2.x supports the following browsers:\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
PCMobile
\"Chrome\"\"Firefox\"\"Safari\"\"IE\"\"Edge\"\"Opera\"\"Android\"\"iOS
OkOkOkNon-compliantOkOkOkOk
\n\nUnfortunately as for the Internet Explorer etc., several methods of this plugin does not work because JavaScript implementation of browser is too immature. Please note that we are not go to support for these legacy browsers in the future.\n\n\n## Tutorials\n\nThe tutorial as a detailed usage of jQuery.Timeline is released [here](https://ka2.org/jquery-timeline/).\n\n\n## Documentation\n\njQuery.Timeline's documentation, included in this repository in the root directory, is built with [ESDoc](https://esdoc.org/) and publicly hosted on GitHub Pages at . The docs may also be run locally.\n\n\n### Documentation for previous releases\n\n- For v2.0.x: \n- For v2.0.x(ESDoc): \n- For v1.0.x: \n- For v1.0.x (Japanese): \n\n## Example as demonstration\n\n- [jQuery.Timeline Tester](https://ka2.org/jqtl-v2/)\n- [Version 2.x Point Type Timeline DEMO](https://ka2.org/jqtl-v2/demo1.php)\n- [Version 1.x demo](https://ka2.org/jqtl-v1/)\n\n## Contributions\n\nYour donations for plugin development will help us.\n\nDonate URL: \n\n\n## Creators\n\n**ka2 (Katsuhiko Maeno)**\n\n- \n\n## Contributors\n\n- Guillaume Bonnaire [www.gbonnaire.fr](https://www.gbonnaire.fr/)\n\n\n\n## Copyright and license\n\nCode and documentation copyright 2011-2019 the [ka2](https://ka2.org/). Code released under the [MIT License](https://raw.githubusercontent.com/ka215/jquery.timeline/master/LICENSE).\n", "longname": "c:\\xampp\\htdocs\\dev2.ka2.org\\jquery.timeline\\README.md", "name": "./README.md", "static": true, "access": "public" }, { "kind": "packageJSON", "content": "{\n \"name\": \"jquery-timeline\",\n \"description\": \"jQuery plugin for the horizontal timeline creation\",\n \"version\": \"2.0.0b5\",\n \"version_short\": \"2.0\",\n \"keywords\": [\n \"javascript\",\n \"jquery-plugin\",\n \"horizontal\",\n \"timeline\",\n \"mobile\",\n \"web\",\n \"es7\"\n ],\n \"homepage\": \"https://ka215.github.io/jquery.timeline/\",\n \"author\": {\n \"name\": \"ka2 (Katsuhiko Maeno)\",\n \"email\": \"ka2@ka2.org\",\n \"url\": \"https://ka2.org/\"\n },\n \"contributors\": [],\n \"scripts\": {\n \"gulp\": \"./node_modules/.bin/gulp --max_old_space_size=8192\",\n \"watch\": \"./node_modules/.bin/gulp --max_old_space_size=8192 dev\",\n \"build-dev\": \"webpack --mode development --config webpack.config.development.js\",\n \"build-prod\": \"webpack --mode production --config webpack.config.production.js\",\n \"build4test\": \"webpack --mode development --config webpack.config.tester.js\",\n \"esdoc\": \"./node_modules/.bin/esdoc; open ./docs/index.html\",\n \"test\": \"mocha ./test/timeline-spec.js\"\n },\n \"browser\": \"dist/jquery.timeline.min.js\",\n \"style\": \"dist/jquery.timeline.min.css\",\n \"sass\": \"src/timeline.scss\",\n \"main\": \"src/timeline.js\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/ka215/jquery.timeline.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/ka215/jquery.timeline/issues\"\n },\n \"license\": \"MIT\",\n \"dependencies\": {\n \"core-js\": \"^3.1.4\",\n \"jquery\": \"^3.3.1\",\n \"regenerator-runtime\": \"^0.13.2\"\n },\n \"peerDependencies\": {\n \"jquery\": \"1.9.1 - 3\"\n },\n \"devDependencies\": {\n \"@babel/core\": \"^7.5.0\",\n \"@babel/plugin-transform-runtime\": \"^7.5.0\",\n \"@babel/preset-env\": \"^7.5.2\",\n \"@babel/register\": \"^7.4.4\",\n \"babel-loader\": \"^8.0.6\",\n \"chai\": \"^4.2.0\",\n \"esdoc\": \"^1.1.0\",\n \"esdoc-ecmascript-proposal-plugin\": \"^1.0.0\",\n \"esdoc-standard-plugin\": \"^1.0.0\",\n \"gulp\": \"^4.0.1\",\n \"gulp-autoprefixer\": \"^6.1.0\",\n \"gulp-eslint\": \"^6.0.0\",\n \"gulp-rename\": \"^1.4.0\",\n \"gulp-sass\": \"^4.0.2\",\n \"gulp-sourcemaps\": \"^2.6.5\",\n \"jsdom\": \"^15.1.1\",\n \"mocha\": \"^6.1.4\",\n \"sinon\": \"^7.3.2\",\n \"webpack\": \"^4.37.0\",\n \"webpack-cli\": \"^3.3.6\",\n \"webpack-stream\": \"^5.2.1\"\n },\n \"engines\": {\n \"node\": \">=7\"\n },\n \"files\": [\n \"dist/\",\n \"src/\"\n ]\n}\n", "longname": "c:\\xampp\\htdocs\\dev2.ka2.org\\jquery.timeline\\package.json", "name": "package.json", "static": true, "access": "public" } ]