program
comment "/*\n* Licensed to the Apache Software Foundation (ASF) under "...
comment "/*\n* A third-party license is embedded for some of the code "...
comment "// [About UTC and local time zone]:"
comment "// In most cases, `number.parseDate` will treat input data s"...
comment "// (except time zone is specified in time string). And `form"...
comment "// local time by default. option.useUTC is false by default."...
comment "// considered these common cases:"
comment "// (1) Time that is persistent in server is in UTC, but it i"...
comment "// in local time by default."
comment "// (2) By default, the input data string (e.g., '2011-01-02'"...
comment "// as its original time, without any time difference."
import_statement
import "import"
import_clause
namespace_import
* "*"
as "as"
identifier "numberUtil"
from "from"
string
' "'"
string_fragment "../util/number"
' "'"
; ";"
import_statement (+110 nodes collapsed)
import_statement
import "import"
import_clause
namespace_import
* "*"
as "as"
identifier "scaleHelper"
from "from"
string
' "'"
string_fragment "./helper"
' "'"
; ";"
import_statement
import "import"
import_clause
identifier "IntervalScale"
from "from"
string
' "'"
string_fragment "./Interval"
' "'"
; ";"
import_statement
import "import"
import_clause
identifier "Scale"
, ","
named_imports
{ "{"
import_specifier
identifier "ScaleGetTicksOpt"
} "}"
from "from"
string
' "'"
string_fragment "./Scale"
' "'"
; ";"
import_statement (+23 nodes collapsed)
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "TimeAxisLabelFormatterParsed"
} "}"
from "from"
string
' "'"
string_fragment "../coord/axisCommonTypes"
' "'"
; ";"
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "warn"
} "}"
from "from"
string
' "'"
string_fragment "../util/log"
' "'"
; ";"
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "LocaleOption"
} "}"
from "from"
string
' "'"
string_fragment "../core/locale"
' "'"
; ";"
import_statement
import "import"
import_clause
identifier "Model"
from "from"
string
' "'"
string_fragment "../model/Model"
' "'"
; ";"
import_statement (+26 nodes collapsed)
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "ScaleBreakContext"
, ","
import_specifier
identifier "getScaleBreakHelper"
} "}"
from "from"
string
' "'"
string_fragment "./break"
' "'"
; ";"
comment "// FIXME 公用?"
lexical_declaration (+127 nodes collapsed)
type_alias_declaration (+36 nodes collapsed)
class_declaration
class "class"
type_identifier "TimeScale"
class_heritage
extends_clause
extends "extends"
identifier "IntervalScale"
type_arguments
< "<"
type_identifier "TimeScaleSetting"
> ">"
class_body
{ "{"
public_field_definition
static "static"
property_identifier "type"
= "="
string
' "'"
string_fragment "time"
' "'"
; ";"
public_field_definition
readonly "readonly"
property_identifier "type"
= "="
string
' "'"
string_fragment "time"
' "'"
; ";"
public_field_definition
accessibility_modifier
private "private"
property_identifier "_approxInterval"
type_annotation
: ":"
predefined_type
number "number"
; ";"
public_field_definition
accessibility_modifier
private "private"
property_identifier "_minLevelUnit"
type_annotation
: ":"
type_identifier "TimeUnit"
; ";"
method_definition (+22 nodes collapsed)
comment "/**\n * Get label is mainly for other components like dat"...
method_definition (+87 nodes collapsed)
method_definition (+83 nodes collapsed)
comment "/**\n * @override\n */"
method_definition
property_identifier "getTicks"
formal_parameters
( "("
optional_parameter
identifier "opt"
? "?"
type_annotation
: ":"
type_identifier "ScaleGetTicksOpt"
) ")"
type_annotation
: ":"
array_type
type_identifier "TimeScaleTick"
[ "["
] "]"
statement_block
{ "{"
expression_statement
assignment_expression
identifier "opt"
= "="
binary_expression
identifier "opt"
|| "||"
object
{ "{"
} "}"
; ";"
lexical_declaration
const "const"
variable_declarator
identifier "interval"
= "="
member_expression
this "this"
. "."
property_identifier "_interval"
; ";"
lexical_declaration
const "const"
variable_declarator
identifier "extent"
= "="
member_expression
this "this"
. "."
property_identifier "_extent"
; ";"
lexical_declaration
const "const"
variable_declarator
identifier "scaleBreakHelper"
= "="
call_expression
identifier "getScaleBreakHelper"
arguments
( "("
) ")"
; ";"
lexical_declaration
let "let"
variable_declarator
identifier "ticks"
= "="
as_expression
array
[ "["
] "]"
as "as"
array_type
type_identifier "TimeScaleTick"
[ "["
] "]"
; ";"
comment "// If interval is 0, return [];"
if_statement
if "if"
parenthesized_expression
( "("
unary_expression
! "!"
identifier "interval"
) ")"
statement_block
{ "{"
return_statement
return "return"
identifier "ticks"
; ";"
} "}"
lexical_declaration
const "const"
variable_declarator
identifier "useUTC"
= "="
call_expression
member_expression
this "this"
. "."
property_identifier "getSetting"
arguments
( "("
string
' "'"
string_fragment "useUTC"
' "'"
) ")"
; ";"
if_statement (+55 nodes collapsed)
lexical_declaration
const "const"
variable_declarator
identifier "extent0Unit"
= "="
call_expression
identifier "getUnitFromValue"
arguments
( "("
subscript_expression
identifier "extent"
[ "["
number "1"
] "]"
, ","
identifier "useUTC"
) ")"
; ";"
expression_statement (+43 nodes collapsed)
lexical_declaration (+38 nodes collapsed)
expression_statement
assignment_expression
identifier "ticks"
= "="
call_expression
member_expression
identifier "ticks"
. "."
property_identifier "concat"
arguments
( "("
identifier "innerTicks"
) ")"
; ";"
lexical_declaration
const "const"
variable_declarator
identifier "extent1Unit"
= "="
call_expression
identifier "getUnitFromValue"
arguments
( "("
subscript_expression
identifier "extent"
[ "["
number "1"
] "]"
, ","
identifier "useUTC"
) ")"
; ";"
expression_statement (+43 nodes collapsed)
lexical_declaration
const "const"
variable_declarator
identifier "isUTC"
= "="
call_expression
member_expression
this "this"
. "."
property_identifier "getSetting"
arguments
( "("
string
' "'"
string_fragment "useUTC"
' "'"
) ")"
; ";"
lexical_declaration
let "let"
variable_declarator
identifier "upperUnitIndex"
= "="
binary_expression
member_expression
identifier "primaryTimeUnits"
. "."
property_identifier "length"
- "-"
number "1"
; ";"
lexical_declaration
let "let"
variable_declarator
identifier "maxLevel"
= "="
number "0"
; ";"
expression_statement
call_expression
identifier "each"
arguments
( "("
identifier "ticks"
, ","
arrow_function
identifier "tick"
=> "=>"
statement_block
{ "{"
expression_statement (+29 nodes collapsed)
expression_statement (+22 nodes collapsed)
} "}"
) ")"
; ";"
if_statement (+57 nodes collapsed)
if_statement (+247 nodes collapsed)
return_statement
return "return"
identifier "ticks"
; ";"
} "}"
method_definition (+261 nodes collapsed)
method_definition (+241 nodes collapsed)
method_definition (+50 nodes collapsed)
method_definition (+35 nodes collapsed)
method_definition (+38 nodes collapsed)
method_definition (+38 nodes collapsed)
} "}"
comment "/**\n * This implementation was originally copied from \"d3.js"...
lexical_declaration (+177 nodes collapsed)
function_declaration (+90 nodes collapsed)
comment "// function isUnitValueSame("
comment "// unit: PrimaryTimeUnit,"
comment "// valueA: number,"
comment "// valueB: number,"
comment "// isUTC: boolean"
comment "// ): boolean {"
comment "// const dateA = numberUtil.parseDate(valueA) as any;"
comment "// const dateB = numberUtil.parseDate(valueB) as any;"
comment "// const isSame = (unit: PrimaryTimeUnit) => {"
comment "// return getUnitValue(dateA, unit, isUTC)"
comment "// === getUnitValue(dateB, unit, isUTC);"
comment "// };"
comment "// const isSameYear = () => isSame('year');"
comment "// // const isSameHalfYear = () => isSameYear() && isSam"...
comment "// // const isSameQuater = () => isSameYear() && isSame("...
comment "// const isSameMonth = () => isSameYear() && isSame('mon"...
comment "// const isSameDay = () => isSameMonth() && isSame('day'"...
comment "// // const isSameHalfDay = () => isSameDay() && isSame("...
comment "// const isSameHour = () => isSameDay() && isSame('hour'"...
comment "// const isSameMinute = () => isSameHour() && isSame('mi"...
comment "// const isSameSecond = () => isSameMinute() && isSame('"...
comment "// const isSameMilliSecond = () => isSameSecond() && isS"...
comment "// switch (unit) {"
comment "// case 'year':"
comment "// return isSameYear();"
comment "// case 'month':"
comment "// return isSameMonth();"
comment "// case 'day':"
comment "// return isSameDay();"
comment "// case 'hour':"
comment "// return isSameHour();"
comment "// case 'minute':"
comment "// return isSameMinute();"
comment "// case 'second':"
comment "// return isSameSecond();"
comment "// case 'millisecond':"
comment "// return isSameMilliSecond();"
comment "// }"
comment "// }"
comment "// const primaryUnitGetters = {"
comment "// year: fullYearGetterName(),"
comment "// month: monthGetterName(),"
comment "// day: dateGetterName(),"
comment "// hour: hoursGetterName(),"
comment "// minute: minutesGetterName(),"
comment "// second: secondsGetterName(),"
comment "// millisecond: millisecondsGetterName()"
comment "// };"
comment "// const primaryUnitUTCGetters = {"
comment "// year: fullYearGetterName(true),"
comment "// month: monthGetterName(true),"
comment "// day: dateGetterName(true),"
comment "// hour: hoursGetterName(true),"
comment "// minute: minutesGetterName(true),"
comment "// second: secondsGetterName(true),"
comment "// millisecond: millisecondsGetterName(true)"
comment "// };"
comment "// function moveTick(date: Date, unitName: TimeUnit, step: n"...
comment "// step = step || 1;"
comment "// switch (getPrimaryTimeUnit(unitName)) {"
comment "// case 'year':"
comment "// date[fullYearSetterName(isUTC)](date[fullYear"...
comment "// break;"
comment "// case 'month':"
comment "// date[monthSetterName(isUTC)](date[monthGetter"...
comment "// break;"
comment "// case 'day':"
comment "// date[dateSetterName(isUTC)](date[dateGetterNa"...
comment "// break;"
comment "// case 'hour':"
comment "// date[hoursSetterName(isUTC)](date[hoursGetter"...
comment "// break;"
comment "// case 'minute':"
comment "// date[minutesSetterName(isUTC)](date[minutesGe"...
comment "// break;"
comment "// case 'second':"
comment "// date[secondsSetterName(isUTC)](date[secondsGe"...
comment "// break;"
comment "// case 'millisecond':"
comment "// date[millisecondsSetterName(isUTC)](date[mill"...
comment "// break;"
comment "// }"
comment "// return date.getTime();"
comment "// }"
comment "// const DATE_INTERVALS = [[8, 7.5], [4, 3.5], [2, 1.5]];"
comment "// const MONTH_INTERVALS = [[6, 5.5], [3, 2.5], [2, 1.5]];"
comment "// const MINUTES_SECONDS_INTERVALS = [[30, 30], [20, 20], [1"...
function_declaration (+66 nodes collapsed)
function_declaration (+59 nodes collapsed)
function_declaration (+57 nodes collapsed)
function_declaration (+86 nodes collapsed)
function_declaration (+29 nodes collapsed)
comment "// e.g., if the input unit is 'day', start calculate ticks f"...
comment "// that month to make ticks \"nice\"."
function_declaration (+85 nodes collapsed)
function_declaration (+150 nodes collapsed)
function_declaration (+2007 nodes collapsed)
expression_statement
call_expression
member_expression
identifier "Scale"
. "."
property_identifier "registerClass"
arguments
( "("
identifier "TimeScale"
) ")"
; ";"
export_statement
export "export"
default "default"
identifier "TimeScale"
; ";"