billboard.js 4.0.3 → 4.1.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/README.md +82 -7
  2. package/dist/billboard.css +1 -1
  3. package/dist/billboard.js +1841 -491
  4. package/dist/billboard.min.css +1 -1
  5. package/dist/billboard.min.js +19 -24
  6. package/dist/billboard.pkgd.js +1837 -676
  7. package/dist/billboard.pkgd.min.js +24 -29
  8. package/dist/billboard.react.js +205 -0
  9. package/dist/billboard.react.min.js +9 -0
  10. package/dist/billboard.worker.js +10 -0
  11. package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  12. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-sparkline.js +3 -2
  14. package/dist/plugin/billboardjs-plugin-sparkline.min.js +3 -3
  15. package/dist/plugin/billboardjs-plugin-stanford.js +3 -2
  16. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  17. package/dist/plugin/billboardjs-plugin-tableview.js +57 -27
  18. package/dist/plugin/billboardjs-plugin-tableview.min.js +5 -5
  19. package/dist/plugin/billboardjs-plugin-textoverlap.js +72 -54
  20. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  21. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2 -2
  22. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
  23. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +3 -2
  24. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +3 -3
  25. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +3 -2
  26. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +2 -2
  27. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +57 -27
  28. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +11 -11
  29. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +65 -3556
  30. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +8 -8
  31. package/dist/theme/dark.css +1 -1
  32. package/dist/theme/dark.min.css +1 -1
  33. package/dist/theme/datalab.css +1 -1
  34. package/dist/theme/datalab.min.css +1 -1
  35. package/dist/theme/graph.css +1 -1
  36. package/dist/theme/graph.min.css +1 -1
  37. package/dist/theme/insight.css +1 -1
  38. package/dist/theme/insight.min.css +1 -1
  39. package/dist/theme/modern.css +1 -1
  40. package/dist/theme/modern.min.css +1 -1
  41. package/dist-esm/Chart/Chart.js +134 -152
  42. package/dist-esm/Chart/api/axis.js +217 -237
  43. package/dist-esm/Chart/api/category.js +54 -54
  44. package/dist-esm/Chart/api/chart.js +172 -215
  45. package/dist-esm/Chart/api/color.js +21 -21
  46. package/dist-esm/Chart/api/data.js +172 -173
  47. package/dist-esm/Chart/api/export.js +242 -262
  48. package/dist-esm/Chart/api/flow.js +198 -254
  49. package/dist-esm/Chart/api/focus.js +136 -143
  50. package/dist-esm/Chart/api/grid.js +191 -190
  51. package/dist-esm/Chart/api/group.js +31 -34
  52. package/dist-esm/Chart/api/legend.js +54 -63
  53. package/dist-esm/Chart/api/load.js +237 -257
  54. package/dist-esm/Chart/api/regions.js +148 -168
  55. package/dist-esm/Chart/api/selection.js +181 -139
  56. package/dist-esm/Chart/api/show.js +133 -147
  57. package/dist-esm/Chart/api/stubs.js +43 -42
  58. package/dist-esm/Chart/api/subchart.js +155 -172
  59. package/dist-esm/Chart/api/tooltip.js +132 -177
  60. package/dist-esm/Chart/api/x.js +67 -71
  61. package/dist-esm/Chart/api/zoom.js +183 -220
  62. package/dist-esm/ChartInternal/Axis/Axis.js +1059 -1266
  63. package/dist-esm/ChartInternal/Axis/AxisRenderer.js +408 -540
  64. package/dist-esm/ChartInternal/Axis/AxisRendererHelper.js +113 -149
  65. package/dist-esm/ChartInternal/ChartInternal.js +573 -749
  66. package/dist-esm/ChartInternal/data/convert.helper.js +133 -159
  67. package/dist-esm/ChartInternal/data/convert.js +200 -229
  68. package/dist-esm/ChartInternal/data/data.js +967 -1153
  69. package/dist-esm/ChartInternal/data/load.js +145 -197
  70. package/dist-esm/ChartInternal/interactions/drag.js +86 -122
  71. package/dist-esm/ChartInternal/interactions/eventrect.js +455 -621
  72. package/dist-esm/ChartInternal/interactions/flow.js +151 -215
  73. package/dist-esm/ChartInternal/interactions/interaction.js +214 -252
  74. package/dist-esm/ChartInternal/interactions/subchart.js +425 -300
  75. package/dist-esm/ChartInternal/interactions/zoom.js +321 -440
  76. package/dist-esm/ChartInternal/internals/category.js +18 -18
  77. package/dist-esm/ChartInternal/internals/class.js +89 -99
  78. package/dist-esm/ChartInternal/internals/clip.js +88 -119
  79. package/dist-esm/ChartInternal/internals/color.js +233 -288
  80. package/dist-esm/ChartInternal/internals/domain.js +452 -588
  81. package/dist-esm/ChartInternal/internals/format.js +64 -77
  82. package/dist-esm/ChartInternal/internals/grid.js +333 -457
  83. package/dist-esm/ChartInternal/internals/legend.js +675 -927
  84. package/dist-esm/ChartInternal/internals/redraw.js +200 -289
  85. package/dist-esm/ChartInternal/internals/region.js +106 -159
  86. package/dist-esm/ChartInternal/internals/scale.js +186 -215
  87. package/dist-esm/ChartInternal/internals/selection.js +132 -159
  88. package/dist-esm/ChartInternal/internals/size.axis.js +92 -139
  89. package/dist-esm/ChartInternal/internals/size.js +286 -394
  90. package/dist-esm/ChartInternal/internals/style.js +39 -41
  91. package/dist-esm/ChartInternal/internals/subchart.util.js +49 -0
  92. package/dist-esm/ChartInternal/internals/text.arc.js +155 -219
  93. package/dist-esm/ChartInternal/internals/text.js +368 -528
  94. package/dist-esm/ChartInternal/internals/text.util.js +179 -239
  95. package/dist-esm/ChartInternal/internals/title.js +96 -121
  96. package/dist-esm/ChartInternal/internals/tooltip.js +450 -586
  97. package/dist-esm/ChartInternal/internals/transform.js +79 -97
  98. package/dist-esm/ChartInternal/internals/type.js +285 -236
  99. package/dist-esm/ChartInternal/shape/arc.js +825 -1112
  100. package/dist-esm/ChartInternal/shape/area.js +73 -94
  101. package/dist-esm/ChartInternal/shape/bar.js +227 -288
  102. package/dist-esm/ChartInternal/shape/bubble.js +9 -8
  103. package/dist-esm/ChartInternal/shape/candlestick.js +110 -138
  104. package/dist-esm/ChartInternal/shape/core/barRadius.js +197 -133
  105. package/dist-esm/ChartInternal/shape/core/bubble.js +64 -73
  106. package/dist-esm/ChartInternal/shape/core/candlestick.js +93 -86
  107. package/dist-esm/ChartInternal/shape/core/dataRegion.js +68 -75
  108. package/dist-esm/ChartInternal/shape/core/geometry.js +112 -112
  109. package/dist-esm/ChartInternal/shape/core/path.js +142 -115
  110. package/dist-esm/ChartInternal/shape/core/point.js +105 -125
  111. package/dist-esm/ChartInternal/shape/core/treemap.js +83 -88
  112. package/dist-esm/ChartInternal/shape/funnel.js +310 -338
  113. package/dist-esm/ChartInternal/shape/gauge.js +71 -103
  114. package/dist-esm/ChartInternal/shape/line.js +208 -278
  115. package/dist-esm/ChartInternal/shape/point.js +310 -425
  116. package/dist-esm/ChartInternal/shape/polar.js +84 -109
  117. package/dist-esm/ChartInternal/shape/radar.js +228 -318
  118. package/dist-esm/ChartInternal/shape/shape.js +782 -843
  119. package/dist-esm/ChartInternal/shape/treemap.js +152 -190
  120. package/dist-esm/canvas/CanvasAxisRenderer.js +1180 -1328
  121. package/dist-esm/canvas/CanvasEngine.js +148 -166
  122. package/dist-esm/canvas/CanvasPainter.js +395 -411
  123. package/dist-esm/canvas/CanvasRenderer.js +1584 -1834
  124. package/dist-esm/canvas/CanvasTheme.js +899 -802
  125. package/dist-esm/canvas/HitDetector.js +394 -463
  126. package/dist-esm/canvas/axisTicks.js +672 -786
  127. package/dist-esm/canvas/classes.js +19 -17
  128. package/dist-esm/canvas/color.js +40 -59
  129. package/dist-esm/canvas/geometry.js +38 -38
  130. package/dist-esm/canvas/labels.js +318 -371
  131. package/dist-esm/canvas/pointPattern.js +578 -580
  132. package/dist-esm/canvas/util.js +242 -262
  133. package/dist-esm/config/Options/Options.js +29 -32
  134. package/dist-esm/config/Options/axis/axis.js +101 -101
  135. package/dist-esm/config/Options/axis/x.js +759 -755
  136. package/dist-esm/config/Options/axis/y.js +525 -522
  137. package/dist-esm/config/Options/axis/y2.js +501 -485
  138. package/dist-esm/config/Options/common/boost.js +93 -32
  139. package/dist-esm/config/Options/common/color.js +88 -87
  140. package/dist-esm/config/Options/common/grid.js +74 -73
  141. package/dist-esm/config/Options/common/legend.js +180 -179
  142. package/dist-esm/config/Options/common/main.js +474 -473
  143. package/dist-esm/config/Options/common/point.js +160 -159
  144. package/dist-esm/config/Options/common/title.js +47 -46
  145. package/dist-esm/config/Options/common/tooltip.js +253 -252
  146. package/dist-esm/config/Options/data/axis.js +173 -172
  147. package/dist-esm/config/Options/data/data.js +958 -957
  148. package/dist-esm/config/Options/data/selection.js +131 -130
  149. package/dist-esm/config/Options/interaction/interaction.js +53 -52
  150. package/dist-esm/config/Options/interaction/subchart.js +164 -73
  151. package/dist-esm/config/Options/interaction/zoom.js +86 -85
  152. package/dist-esm/config/Options/shape/arc.js +150 -149
  153. package/dist-esm/config/Options/shape/area.js +69 -68
  154. package/dist-esm/config/Options/shape/bar.js +147 -146
  155. package/dist-esm/config/Options/shape/bubble.js +35 -34
  156. package/dist-esm/config/Options/shape/candlestick.js +61 -60
  157. package/dist-esm/config/Options/shape/donut.js +181 -180
  158. package/dist-esm/config/Options/shape/funnel.js +49 -48
  159. package/dist-esm/config/Options/shape/gauge.js +237 -236
  160. package/dist-esm/config/Options/shape/line.js +58 -57
  161. package/dist-esm/config/Options/shape/pie.js +185 -184
  162. package/dist-esm/config/Options/shape/polar.js +167 -166
  163. package/dist-esm/config/Options/shape/radar.js +76 -75
  164. package/dist-esm/config/Options/shape/scatter.js +36 -36
  165. package/dist-esm/config/Options/shape/spline.js +46 -46
  166. package/dist-esm/config/Options/shape/treemap.js +80 -79
  167. package/dist-esm/config/Store/Element.js +64 -62
  168. package/dist-esm/config/Store/State.js +189 -200
  169. package/dist-esm/config/Store/Store.js +25 -26
  170. package/dist-esm/config/classes.js +157 -155
  171. package/dist-esm/config/config.js +26 -35
  172. package/dist-esm/config/const.js +120 -128
  173. package/dist-esm/config/resolver/axis.core.js +25 -25
  174. package/dist-esm/config/resolver/axis.js +26 -27
  175. package/dist-esm/config/resolver/canvas.js +2071 -2472
  176. package/dist-esm/config/resolver/canvasShape.js +201 -177
  177. package/dist-esm/config/resolver/category.js +26 -27
  178. package/dist-esm/config/resolver/export.js +24 -26
  179. package/dist-esm/config/resolver/flow.js +29 -31
  180. package/dist-esm/config/resolver/grid.js +34 -35
  181. package/dist-esm/config/resolver/interaction/selection.js +17 -17
  182. package/dist-esm/config/resolver/interaction/subchart.js +17 -17
  183. package/dist-esm/config/resolver/interaction/zoom.js +17 -17
  184. package/dist-esm/config/resolver/regions.js +30 -31
  185. package/dist-esm/config/resolver/shape/arc.helpers.js +19 -19
  186. package/dist-esm/config/resolver/shape/area.js +17 -17
  187. package/dist-esm/config/resolver/shape/axis.helpers.js +28 -25
  188. package/dist-esm/config/resolver/shape/bar.js +13 -13
  189. package/dist-esm/config/resolver/shape/bubble.js +18 -14
  190. package/dist-esm/config/resolver/shape/candlestick.js +13 -13
  191. package/dist-esm/config/resolver/shape/donut.js +11 -11
  192. package/dist-esm/config/resolver/shape/funnel.js +11 -11
  193. package/dist-esm/config/resolver/shape/gauge.js +12 -12
  194. package/dist-esm/config/resolver/shape/line.js +10 -10
  195. package/dist-esm/config/resolver/shape/pie.js +11 -11
  196. package/dist-esm/config/resolver/shape/polar.js +12 -12
  197. package/dist-esm/config/resolver/shape/radar.js +22 -14
  198. package/dist-esm/config/resolver/shape/scatter.js +13 -13
  199. package/dist-esm/config/resolver/shape/treemap.js +11 -11
  200. package/dist-esm/core.js +208 -211
  201. package/dist-esm/index.canvas.js +14 -13
  202. package/dist-esm/index.esm.js +25 -24
  203. package/dist-esm/module/Cache.js +117 -129
  204. package/dist-esm/module/browser.js +30 -35
  205. package/dist-esm/module/dsv.js +107 -127
  206. package/dist-esm/module/error.js +45 -52
  207. package/dist-esm/module/generator.js +75 -83
  208. package/dist-esm/module/sanitize.js +302 -399
  209. package/dist-esm/module/util/brush.js +27 -38
  210. package/dist-esm/module/util/dom.js +288 -348
  211. package/dist-esm/module/util/object.js +277 -341
  212. package/dist-esm/module/util/type-checks.js +21 -25
  213. package/dist-esm/module/worker.js +312 -130
  214. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +185 -198
  215. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +442 -450
  216. package/dist-esm/plugin/billboardjs-plugin-stanford.js +813 -950
  217. package/dist-esm/plugin/billboardjs-plugin-tableview.js +708 -788
  218. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +344 -301
  219. package/dist-esm/react/index.js +157 -0
  220. package/package.json +28 -8
  221. package/src/Chart/api/selection.ts +130 -5
  222. package/src/ChartInternal/Axis/Axis.ts +164 -65
  223. package/src/ChartInternal/Axis/AxisRenderer.ts +41 -8
  224. package/src/ChartInternal/Axis/AxisRendererHelper.ts +1 -1
  225. package/src/ChartInternal/ChartInternal.ts +1 -1
  226. package/src/ChartInternal/data/convert.ts +54 -4
  227. package/src/ChartInternal/data/data.ts +4 -1
  228. package/src/ChartInternal/interactions/eventrect.ts +6 -0
  229. package/src/ChartInternal/interactions/subchart.ts +437 -66
  230. package/src/ChartInternal/internals/color.ts +2 -2
  231. package/src/ChartInternal/internals/domain.ts +15 -3
  232. package/src/ChartInternal/internals/grid.ts +21 -1
  233. package/src/ChartInternal/internals/scale.ts +9 -2
  234. package/src/ChartInternal/internals/selection.ts +1 -1
  235. package/src/ChartInternal/internals/subchart.util.ts +55 -0
  236. package/src/ChartInternal/internals/text.arc.ts +3 -1
  237. package/src/ChartInternal/internals/text.ts +18 -5
  238. package/src/ChartInternal/internals/transform.ts +8 -2
  239. package/src/ChartInternal/internals/type.ts +105 -1
  240. package/src/ChartInternal/shape/IShape.ts +6 -3
  241. package/src/ChartInternal/shape/bar.ts +62 -31
  242. package/src/ChartInternal/shape/core/barRadius.ts +129 -0
  243. package/src/ChartInternal/shape/core/candlestick.ts +1 -1
  244. package/src/ChartInternal/shape/core/path.ts +76 -9
  245. package/src/ChartInternal/shape/funnel.ts +2 -3
  246. package/src/ChartInternal/shape/point.ts +2 -2
  247. package/src/ChartInternal/shape/shape.ts +149 -17
  248. package/src/Plugin/stanford/index.ts +0 -4
  249. package/src/Plugin/tableview/index.ts +85 -3
  250. package/src/Plugin/textoverlap/index.ts +9 -15
  251. package/src/canvas/CanvasAxisRenderer.ts +184 -36
  252. package/src/canvas/CanvasRenderer.ts +247 -160
  253. package/src/canvas/CanvasTheme.ts +212 -0
  254. package/src/canvas/axisTicks.ts +122 -40
  255. package/src/config/Options/axis/y2.ts +13 -0
  256. package/src/config/Options/common/boost.ts +64 -4
  257. package/src/config/Options/common/color.ts +2 -2
  258. package/src/config/Options/interaction/subchart.ts +98 -1
  259. package/src/config/Options/shape/gauge.ts +1 -1
  260. package/src/config/Options/shape/treemap.ts +2 -2
  261. package/src/config/Store/Element.ts +3 -1
  262. package/src/config/Store/State.ts +1 -0
  263. package/src/config/classes.ts +1 -0
  264. package/src/config/resolver/canvas.ts +92 -10
  265. package/src/module/voronoi.ts +119 -0
  266. package/src/module/worker.entry.ts +61 -0
  267. package/src/module/worker.ts +346 -63
  268. package/src/react/index.ts +193 -0
  269. package/types/options.d.ts +206 -3
  270. package/types/react/index.d.ts +27 -0
@@ -5,762 +5,766 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 4.0.3
8
+ * @version 4.1.0-next.1
9
9
  */
10
+ //#region src/config/Options/axis/x.ts
10
11
  /**
11
- * Copyright (c) 2017 ~ present NAVER Corp.
12
- * billboard.js project is licensed under the MIT license
13
- */
12
+ * Copyright (c) 2017 ~ present NAVER Corp.
13
+ * billboard.js project is licensed under the MIT license
14
+ */
14
15
  /**
15
- * x Axis config options
16
- */
17
- var x = {
18
- /**
19
- * Set clip-path attribute for x axis element
20
- * @name axis․x․clipPath
21
- * @memberof Options
22
- * @type {boolean}
23
- * @default true
24
- * @see [Demo]()
25
- * @example
26
- * // don't set 'clip-path' attribute
27
- * clipPath: false
28
- */
29
- axis_x_clipPath: true,
30
- /**
31
- * Show or hide x axis.
32
- * @name axis․x․show
33
- * @memberof Options
34
- * @type {boolean}
35
- * @default true
36
- * @example
37
- * axis: {
38
- * x: {
39
- * show: false
40
- * }
41
- * }
42
- */
43
- axis_x_show: true,
44
- /**
45
- * Force the x axis to interact as single rather than multiple x axes.
46
- * - **NOTE:** The tooltip event will be triggered nearing each data points(for multiple xs) rather than x axis based(as single x does) in below condition:
47
- * - for `bubble` & `scatter` type
48
- * - when `data.xs` is set
49
- * - when `tooltip.grouped=false` is set
50
- * - `tooltip.grouped` options will take precedence over `axis.forceSingleX` option.
51
- * @name axis․x․forceAsSingle
52
- * @memberof Options
53
- * @type {boolean}
54
- * @default false
55
- * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.ForceAsSingle)
56
- * @example
57
- * axis: {
58
- * x: {
59
- * // will work as single x axis
60
- * forceAsSingle: true
61
- * }
62
- * }
63
- */
64
- axis_x_forceAsSingle: false,
65
- /**
66
- * Set type of x axis.<br><br>
67
- * **Available Values:**
68
- * - category
69
- * - indexed
70
- * - log
71
- * - timeseries
72
- *
73
- * **NOTE:**<br>
74
- * - **log** type:
75
- * - the x values specified by [`data.x`](#.data%25E2%2580%25A4x)(or by any equivalent option), must be exclusively-positive.
76
- * - x axis min value should be >= 0.
77
- * - for 'category' type, `data.xs` option isn't supported.
78
- * @name axis․x․type
79
- * @memberof Options
80
- * @type {string}
81
- * @default indexed
82
- * @see [Demo: indexed](https://naver.github.io/billboard.js/demo/#Chart.AreaChart)
83
- * @see [Demo: timeseries](https://naver.github.io/billboard.js/demo/#Chart.TimeseriesChart)
84
- * @see [Demo: category](https://naver.github.io/billboard.js/demo/#Data.CategoryData)
85
- * @see [Demo: log](https://naver.github.io/billboard.js/demo/#Axis.LogScales)
86
- * @example
87
- * axis: {
88
- * x: {
89
- * type: "timeseries"
90
- * }
91
- * }
92
- */
93
- axis_x_type: "indexed",
94
- /**
95
- * Set how to treat the timezone of x values.<br>
96
- * If true, treat x value as localtime. If false, convert to UTC internally.
97
- * @name axis․x․localtime
98
- * @memberof Options
99
- * @type {boolean}
100
- * @default true
101
- * @example
102
- * axis: {
103
- * x: {
104
- * localtime: false
105
- * }
106
- * }
107
- */
108
- axis_x_localtime: true,
109
- /**
110
- * Set category names on category axis.
111
- * This must be an array that includes category names in string. If category names are included in the date by data.x option, this is not required.
112
- * @name axis․x․categories
113
- * @memberof Options
114
- * @type {Array}
115
- * @default []
116
- * @example
117
- * axis: {
118
- * x: {
119
- * categories: ["Category 1", "Category 2", ...]
120
- * }
121
- * }
122
- */
123
- axis_x_categories: [],
124
- /**
125
- * centerize ticks on category axis.
126
- * @name axis․x․tick․centered
127
- * @memberof Options
128
- * @type {boolean}
129
- * @default false
130
- * @example
131
- * axis: {
132
- * x: {
133
- * tick: {
134
- * centered: true
135
- * }
136
- * }
137
- * }
138
- */
139
- axis_x_tick_centered: false,
140
- /**
141
- * A function to format tick value. Format string is also available for timeseries data.
142
- * @name axis․x․tick․format
143
- * @memberof Options
144
- * @type {function|string}
145
- * @default undefined
146
- * @see [D3's time specifier](https://d3js.org/d3-time-format#locale_format)
147
- * @example
148
- * axis: {
149
- * x: {
150
- * tick: {
151
- * // for timeseries, a 'datetime' object is given as parameter
152
- * format: function(x) {
153
- * return x.getFullYear();
154
- * }
155
- *
156
- * // for category, index(Number) and categoryName(String) are given as parameter
157
- * format: function(index, categoryName) {
158
- * return categoryName.substr(0, 10);
159
- * },
160
- *
161
- * // for timeseries format specifier
162
- * format: "%Y-%m-%d %H:%M:%S"
163
- * }
164
- * }
165
- * }
166
- */
167
- axis_x_tick_format: undefined,
168
- /**
169
- * Setting for culling ticks.
170
- * - `true`: the ticks will be culled, then only limited tick text will be shown.<br>
171
- * This option does not hide the tick lines by default, if want to hide tick lines, set `axis.x.tick.culling.lines=false`.
172
- * - `false`: all of ticks will be shown.<br><br>
173
- * The number of ticks to be shown can be changed by `axis.x.tick.culling.max`.
174
- * @name axis․x․tick․culling
175
- * @memberof Options
176
- * @type {boolean}
177
- * @default
178
- * `true` for indexed axis and timeseries axis, `false` for category axis
179
- * @example
180
- * axis: {
181
- * x: {
182
- * tick: {
183
- * culling: false,
184
- * }
185
- * }
186
- * }
187
- */
188
- axis_x_tick_culling: {},
189
- /**
190
- * The number of tick texts will be adjusted to less than this value.
191
- * @name axis․x․tick․culling․max
192
- * @memberof Options
193
- * @type {number}
194
- * @default 10
195
- * @example
196
- * axis: {
197
- * x: {
198
- * tick: {
199
- * culling: {
200
- * max: 5
201
- * }
202
- * }
203
- * }
204
- * }
205
- */
206
- axis_x_tick_culling_max: 10,
207
- /**
208
- * Control visibility of tick lines within culling option, along with tick text.
209
- * @name axis․x․tick․culling․lines
210
- * @memberof Options
211
- * @type {boolean}
212
- * @default true
213
- * @example
214
- * axis: {
215
- * x: {
216
- * tick: {
217
- * culling: {
218
- * lines: false,
219
- * }
220
- * }
221
- * }
222
- * }
223
- */
224
- axis_x_tick_culling_lines: true,
225
- /**
226
- * Control culling start point to be reversed. If set to true, the culling will be started from the end to start.
227
- * - **NOTE:** This option is only available when `axis.x.tick.culling` is set to truthy value.
228
- * @name axis․x․tick․culling․reverse
229
- * @memberof Options
230
- * @type {boolean}
231
- * @default false
232
- * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickCulling)
233
- * @example
234
- * axis: {
235
- * x: {
236
- * tick: {
237
- * culling: {
238
- * reverse: true,
239
- * }
240
- * }
241
- * }
242
- * }
243
- */
244
- axis_x_tick_culling_reverse: false,
245
- /**
246
- * The number of x axis ticks to show.<br><br>
247
- * This option hides tick lines together with tick text. If this option is used on timeseries axis, the ticks position will be determined precisely and not nicely positioned (e.g. it will have rough second value).
248
- * @name axis․x․tick․count
249
- * @memberof Options
250
- * @type {number}
251
- * @default undefined
252
- * @example
253
- * axis: {
254
- * x: {
255
- * tick: {
256
- * count: 5
257
- * }
258
- * }
259
- * }
260
- */
261
- axis_x_tick_count: undefined,
262
- /**
263
- * Set the axis tick line to be positioned inside of the chart.
264
- * @name axis․x․tick․inner
265
- * @memberof Options
266
- * @type {boolean}
267
- * @default false
268
- * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.TickInner)
269
- * @example
270
- * axis: {
271
- * x: {
272
- * tick: {
273
- * inner: true
274
- * }
275
- * }
276
- * }
277
- */
278
- axis_x_tick_inner: false,
279
- /**
280
- * Show or hide x axis tick line.
281
- * @name axis․x․tick․show
282
- * @memberof Options
283
- * @type {boolean}
284
- * @default true
285
- * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.HideTickLineText)
286
- * @example
287
- * axis: {
288
- * x: {
289
- * tick: {
290
- * show: false
291
- * }
292
- * }
293
- * }
294
- */
295
- axis_x_tick_show: true,
296
- /**
297
- * Show or hide x axis tick text.
298
- * @name axis․x․tick․text․show
299
- * @memberof Options
300
- * @type {boolean}
301
- * @default true
302
- * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.HideTickLineText)
303
- * @example
304
- * axis: {
305
- * x: {
306
- * tick: {
307
- * text: {
308
- * show: false
309
- * }
310
- * }
311
- * }
312
- * }
313
- */
314
- axis_x_tick_text_show: true,
315
- /**
316
- * Set the first/last axis tick text to be positioned inside of the chart on non-rotated axis.
317
- * @name axis․x․tick․text․inner
318
- * @memberof Options
319
- * @type {boolean|object}
320
- * @default false
321
- * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickInner)
322
- * @example
323
- * axis: {
324
- * x: {
325
- * tick: {
326
- * text: {
327
- * inner: true,
328
- *
329
- * // or specify each position of the first and last tick text
330
- * inner: {
331
- * first: true,
332
- * last: true
333
- * }
334
- * }
335
- * }
336
- * }
337
- * }
338
- */
339
- axis_x_tick_text_inner: false,
340
- /**
341
- * Set the x Axis tick text's position relatively its original position
342
- * @name axis․x․tick․text․position
343
- * @memberof Options
344
- * @type {object}
345
- * @default {x: 0, y:0}
346
- * @example
347
- * axis: {
348
- * x: {
349
- * tick: {
350
- * text: {
351
- * position: {
352
- * x: 10,
353
- * y: 10
354
- * }
355
- * }
356
- * }
357
- * }
358
- * }
359
- */
360
- axis_x_tick_text_position: { x: 0, y: 0 },
361
- /**
362
- * Fit x axis ticks.
363
- * - **true**: ticks will be shown according to x value of the data points.
364
- * - **false**: ticks will be shown as to have same intervals.
365
- * @name axis․x․tick․fit
366
- * @memberof Options
367
- * @type {boolean}
368
- * @default true
369
- * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickFitting)
370
- * @see [Demo: for timeseries zoom](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickTimeseries)
371
- * @example
372
- * axis: {
373
- * x: {
374
- * tick: {
375
- * fit: false
376
- * }
377
- * }
378
- * }
379
- */
380
- axis_x_tick_fit: true,
381
- /**
382
- * Set the x values of ticks manually.<br><br>
383
- * If this option is provided, the position of the ticks will be determined based on those values.<br>
384
- * This option works with `timeseries` data and the x values will be parsed according to the type of the value and data.xFormat option.
385
- * @name axis․x․tick․values
386
- * @memberof Options
387
- * @type {Array|function}
388
- * @default null
389
- * @example
390
- * axis: {
391
- * x: {
392
- * tick: {
393
- * values: [1, 2, 4, 8, 16, 32, ...],
394
- *
395
- * // an Array value should be returned
396
- * values: function() {
397
- * return [ ... ];
398
- * }
399
- * }
400
- * }
401
- * }
402
- */
403
- axis_x_tick_values: null,
404
- /**
405
- * Rotate x axis tick text if there is not enough space for 'category' and 'timeseries' type axis.
406
- * - **NOTE:** The conditions where `autorotate` is enabled are:
407
- * - axis.x.type='category' or 'timeseries
408
- * - axis.x.tick.multiline=false
409
- * - axis.x.tick.culling=false
410
- * - axis.x.tick.fit=true
411
- * - **NOTE:** axis.x.tick.clippath=false is necessary for calculating the overflow padding between the end of x axis and the width of the SVG
412
- * @name axis․x․tick․autorotate
413
- * @memberof Options
414
- * @type {boolean}
415
- * @default false
416
- * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickAutorotate)
417
- * @example
418
- * axis: {
419
- * x: {
420
- * tick: {
421
- * rotate: 15,
422
- * autorotate: true,
423
- * multiline: false,
424
- * culling: false,
425
- * fit: true
426
- * },
427
- * clipPath: false
428
- * }
429
- * }
430
- */
431
- axis_x_tick_autorotate: false,
432
- /**
433
- * Rotate x axis tick text.
434
- * - If you set negative value, it will rotate to opposite direction.
435
- * - Applied when [`axis.rotated`](#.axis%25E2%2580%25A4rotated) option is `false`.
436
- * - As long as `axis_x_tick_fit` is set to `true` it will calculate an overflow for the y2 axis and add this value to the right padding.
437
- * @name axis․x․tick․rotate
438
- * @memberof Options
439
- * @type {number}
440
- * @default 0
441
- * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.RotateXAxisTickText)
442
- * @example
443
- * axis: {
444
- * x: {
445
- * tick: {
446
- * rotate: 60
447
- * }
448
- * }
449
- * }
450
- */
451
- axis_x_tick_rotate: 0,
452
- /**
453
- * Show x axis outer tick.
454
- * @name axis․x․tick․outer
455
- * @memberof Options
456
- * @type {boolean}
457
- * @default true
458
- * @example
459
- * axis: {
460
- * x: {
461
- * tick: {
462
- * outer: false
463
- * }
464
- * }
465
- * }
466
- */
467
- axis_x_tick_outer: true,
468
- /**
469
- * Set tick text to be multiline
470
- * - **NOTE:**
471
- * > When x tick text contains `\n`, it's used as line break and 'axis.x.tick.width' option is ignored.
472
- * @name axis․x․tick․multiline
473
- * @memberof Options
474
- * @type {boolean}
475
- * @default true
476
- * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickMultiline)
477
- * @example
478
- * axis: {
479
- * x: {
480
- * tick: {
481
- * multiline: false
482
- * }
483
- * }
484
- * }
485
- * @example
486
- * // example of line break with '\n'
487
- * // In this case, 'axis.x.tick.width' is ignored
488
- * data: {
489
- * x: "x",
490
- * columns: [
491
- * ["x", "long\ntext", "Another\nLong\nText"],
492
- * ...
493
- * ],
494
- * }
495
- */
496
- axis_x_tick_multiline: true,
497
- /**
498
- * Set tick width
499
- * - **NOTE:**
500
- * > When x tick text contains `\n`, this option is ignored.
501
- * @name axis․x․tick․width
502
- * @memberof Options
503
- * @type {number}
504
- * @default null
505
- * @example
506
- * axis: {
507
- * x: {
508
- * tick: {
509
- * width: 50
510
- * }
511
- * }
512
- * }
513
- */
514
- axis_x_tick_width: null,
515
- /**
516
- * Set to display system tooltip(via `<title>` element) for tick text
517
- * - **NOTE:** Only available for category axis type (`axis.x.type='category'`)
518
- * @name axis․x․tick․tooltip
519
- * @memberof Options
520
- * @type {boolean}
521
- * @default false
522
- * @example
523
- * axis: {
524
- * x: {
525
- * tick: {
526
- * tooltip: true
527
- * }
528
- * }
529
- * }
530
- */
531
- axis_x_tick_tooltip: false,
532
- /**
533
- * Set max value of x axis range.
534
- * @name axis․x․max
535
- * @memberof Options
536
- * @property {number} max Set the max value
537
- * @property {boolean} [max.fit=false] When specified `max.value` is greater than the bound data value, setting `true` will make x axis max to be fitted to the bound data max value.
538
- * - **NOTE:** If the bound data max value is greater than the `max.value`, the x axis max will be limited as the given `max.value`.
539
- * @property {number} [max.value] Set the max value
540
- * @example
541
- * axis: {
542
- * x: {
543
- * max: 100,
544
- *
545
- * max: {
546
- * // 'fit=true' will make x axis max to be limited as the bound data value max when 'max.value' is greater.
547
- * // - when bound data max is '10' and max.value: '100' ==> x axis max will be '10'
548
- * // - when bound data max is '1000' and max.value: '100' ==> x axis max will be '100'
549
- * fit: true,
550
- * value: 100
551
- * }
552
- * }
553
- * }
554
- */
555
- axis_x_max: undefined,
556
- /**
557
- * Set min value of x axis range.
558
- * @name axis․x․min
559
- * @memberof Options
560
- * @property {number} min Set the min value
561
- * @property {boolean} [min.fit=false] When specified `min.value` is lower than the bound data value, setting `true` will make x axis min to be fitted to the bound data min value.
562
- * - **NOTE:** If the bound data min value is lower than the `min.value`, the x axis min will be limited as the given `min.value`.
563
- * @property {number} [min.value] Set the min value
564
- * @example
565
- * axis: {
566
- * x: {
567
- * min: -100,
568
- *
569
- * min: {
570
- * // 'fit=true' will make x axis min to be limited as the bound data value min when 'min.value' is lower.
571
- * // - when bound data min is '-10' and min.value: '-100' ==> x axis min will be '-10'
572
- * // - when bound data min is '-1000' and min.value: '-100' ==> x axis min will be '-100'
573
- * fit: true,
574
- * value: -100
575
- * }
576
- * }
577
- * }
578
- */
579
- axis_x_min: undefined,
580
- /**
581
- * Change the direction of x axis.<br><br>
582
- * If true set, the direction will be `right -> left`.
583
- * @name axis․x․inverted
584
- * @memberof Options
585
- * @type {boolean}
586
- * @default false
587
- * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.InvertedAxis)
588
- * @example
589
- * axis: {
590
- * x: {
591
- * inverted: true
592
- * }
593
- * }
594
- */
595
- axis_x_inverted: false,
596
- /**
597
- * Set padding for x axis.<br><br>
598
- * If this option is set, the range of x axis will increase/decrease according to the values.
599
- * If no padding is needed in the rage of x axis, 0 should be set.
600
- * By default, left/right padding are set depending on x axis type or chart types.
601
- * - **NOTE:**
602
- * - The meaning of padding values, differs according axis types:<br>
603
- * - **category/indexed:** The unit of tick value
604
- * ex. the given value `1`, is same as the width of 1 tick width
605
- * - **timeseries:** Numeric time value
606
- * ex. the given value `1000*60*60*24`, which is numeric time equivalent of a day, is same as the width of 1 tick width
607
- * - If want values to be treated as pixels, specify `unit:"px"`.
608
- * - The pixel value will be converted based on the scale values. Hence can not reflect accurate padding result.
609
- * @name axis․x․padding
610
- * @memberof Options
611
- * @type {object|number}
612
- * @default {}
613
- * @example
614
- * axis: {
615
- * x: {
616
- * padding: {
617
- * // when axis type is 'category'
618
- * left: 1, // set left padding width of equivalent value of a tick's width
619
- * right: 0.5 // set right padding width as half of equivalent value of tick's width
620
- *
621
- * // when axis type is 'timeseries'
622
- * left: 1000*60*60*24, // set left padding width of equivalent value of a day tick's width
623
- * right: 1000*60*60*12 // set right padding width as half of equivalent value of a day tick's width
624
- * },
625
- *
626
- * // or set both values at once.
627
- * padding: 10,
628
- *
629
- * // or set padding values as pixel unit.
630
- * padding: {
631
- * left: 100,
632
- * right: 50,
633
- * unit: "px"
634
- * },
635
- * }
636
- * }
637
- */
638
- axis_x_padding: {},
639
- /**
640
- * Set height of x axis.<br><br>
641
- * The height of x axis can be set manually by this option. If you need more space for x axis, please use this option for that. The unit is pixel.
642
- * @name axis․x․height
643
- * @memberof Options
644
- * @type {number}
645
- * @default undefined
646
- * @example
647
- * axis: {
648
- * x: {
649
- * height: 20
650
- * }
651
- * }
652
- */
653
- axis_x_height: undefined,
654
- /**
655
- * Set extent for subchart and zoom(drag only). This can be an array or function that returns an array.
656
- * - **NOTE:** Specifying value, will limit the zoom scope selection within.
657
- * @name axis․x․extent
658
- * @memberof Options
659
- * @type {Array|function}
660
- * @default undefined
661
- * @example
662
- * axis: {
663
- * x: {
664
- * // extent range as a pixel value
665
- * extent: [0, 200],
666
- *
667
- * // when axis is 'timeseries', parsable datetime string
668
- * extent: ["2019-03-01", "2019-03-05"],
669
- *
670
- * // return extent value
671
- * extent: function(domain, scale) {
672
- * var extent = domain.map(function(v) {
673
- * return scale(v);
674
- * });
675
- *
676
- * // it should return a format of array
677
- * // ex) [0, 584]
678
- * return extent;
679
- * }
680
- * }
681
- * }
682
- */
683
- axis_x_extent: undefined,
684
- /**
685
- * Set label on x axis.<br><br>
686
- * You can set x axis label and change its position by this option.
687
- * `string` and `object` can be passed and we can change the poisiton by passing object that has position key.<br>
688
- * Available position differs according to the axis direction (vertical or horizontal).
689
- * If string set, the position will be the default.
690
- *
691
- * - **If it's horizontal axis:**
692
- * - inner-right [default]
693
- * - inner-center
694
- * - inner-left
695
- * - outer-right
696
- * - outer-center
697
- * - outer-left
698
- * - **If it's vertical axis:**
699
- * - inner-top [default]
700
- * - inner-middle
701
- * - inner-bottom
702
- * - outer-top
703
- * - outer-middle
704
- * - outer-bottom
705
- * @name axis․x․label
706
- * @memberof Options
707
- * @type {string|object}
708
- * @default undefined
709
- * @example
710
- * axis: {
711
- * x: {
712
- * label: "Your X Axis"
713
- * }
714
- * }
715
- *
716
- * axis: {
717
- * x: {
718
- * label: {
719
- * text: "Your X Axis",
720
- * position: "outer-center"
721
- * }
722
- * }
723
- * }
724
- */
725
- axis_x_label: {},
726
- /**
727
- * Set additional axes for x Axis.
728
- * - **NOTE:** Axis' scale is based on x Axis value if domain option isn't set.
729
- *
730
- * Each axis object should consist with following options:
731
- *
732
- * | Name | Type | Default | Description |
733
- * | --- | --- | --- | --- |
734
- * | domain | Array | - | Set the domain value |
735
- * | tick.outer | boolean | true | Show outer tick |
736
- * | tick.format | Function | - | Set formatter for tick text |
737
- * | tick.count | Number | - | Set the number of y axis ticks |
738
- * | tick.values | Array | - | Set tick values manually |
739
- * @name axis․x․axes
740
- * @memberof Options
741
- * @type {Array}
742
- * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.MultiAxes)
743
- * @see [Demo: Domain](https://naver.github.io/billboard.js/demo/#Axis.MultiAxesDomain)
744
- * @example
745
- * x: {
746
- * axes: [
747
- * {
748
- * // if set, will not be correlated with the main x Axis domain value
749
- * domain: [0, 1000],
750
- * tick: {
751
- * outer: false,
752
- * format: function(x) {
753
- * return x + "%";
754
- * },
755
- * count: 2,
756
- * values: [10, 20, 30]
757
- * }
758
- * },
759
- * ...
760
- * ]
761
- * }
762
- */
763
- axis_x_axes: []
16
+ * x Axis config options
17
+ */
18
+ var x_default = {
19
+ /**
20
+ * Set clip-path attribute for x axis element
21
+ * @name axis․x․clipPath
22
+ * @memberof Options
23
+ * @type {boolean}
24
+ * @default true
25
+ * @see [Demo]()
26
+ * @example
27
+ * // don't set 'clip-path' attribute
28
+ * clipPath: false
29
+ */
30
+ axis_x_clipPath: true,
31
+ /**
32
+ * Show or hide x axis.
33
+ * @name axis․x․show
34
+ * @memberof Options
35
+ * @type {boolean}
36
+ * @default true
37
+ * @example
38
+ * axis: {
39
+ * x: {
40
+ * show: false
41
+ * }
42
+ * }
43
+ */
44
+ axis_x_show: true,
45
+ /**
46
+ * Force the x axis to interact as single rather than multiple x axes.
47
+ * - **NOTE:** The tooltip event will be triggered nearing each data points(for multiple xs) rather than x axis based(as single x does) in below condition:
48
+ * - for `bubble` & `scatter` type
49
+ * - when `data.xs` is set
50
+ * - when `tooltip.grouped=false` is set
51
+ * - `tooltip.grouped` options will take precedence over `axis.forceSingleX` option.
52
+ * @name axis․x․forceAsSingle
53
+ * @memberof Options
54
+ * @type {boolean}
55
+ * @default false
56
+ * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.ForceAsSingle)
57
+ * @example
58
+ * axis: {
59
+ * x: {
60
+ * // will work as single x axis
61
+ * forceAsSingle: true
62
+ * }
63
+ * }
64
+ */
65
+ axis_x_forceAsSingle: false,
66
+ /**
67
+ * Set type of x axis.<br><br>
68
+ * **Available Values:**
69
+ * - category
70
+ * - indexed
71
+ * - log
72
+ * - timeseries
73
+ *
74
+ * **NOTE:**<br>
75
+ * - **log** type:
76
+ * - the x values specified by [`data.x`](#.data%25E2%2580%25A4x)(or by any equivalent option), must be exclusively-positive.
77
+ * - x axis min value should be >= 0.
78
+ * - for 'category' type, `data.xs` option isn't supported.
79
+ * @name axis․x․type
80
+ * @memberof Options
81
+ * @type {string}
82
+ * @default indexed
83
+ * @see [Demo: indexed](https://naver.github.io/billboard.js/demo/#Chart.AreaChart)
84
+ * @see [Demo: timeseries](https://naver.github.io/billboard.js/demo/#Chart.TimeseriesChart)
85
+ * @see [Demo: category](https://naver.github.io/billboard.js/demo/#Data.CategoryData)
86
+ * @see [Demo: log](https://naver.github.io/billboard.js/demo/#Axis.LogScales)
87
+ * @example
88
+ * axis: {
89
+ * x: {
90
+ * type: "timeseries"
91
+ * }
92
+ * }
93
+ */
94
+ axis_x_type: "indexed",
95
+ /**
96
+ * Set how to treat the timezone of x values.<br>
97
+ * If true, treat x value as localtime. If false, convert to UTC internally.
98
+ * @name axis․x․localtime
99
+ * @memberof Options
100
+ * @type {boolean}
101
+ * @default true
102
+ * @example
103
+ * axis: {
104
+ * x: {
105
+ * localtime: false
106
+ * }
107
+ * }
108
+ */
109
+ axis_x_localtime: true,
110
+ /**
111
+ * Set category names on category axis.
112
+ * This must be an array that includes category names in string. If category names are included in the date by data.x option, this is not required.
113
+ * @name axis․x․categories
114
+ * @memberof Options
115
+ * @type {Array}
116
+ * @default []
117
+ * @example
118
+ * axis: {
119
+ * x: {
120
+ * categories: ["Category 1", "Category 2", ...]
121
+ * }
122
+ * }
123
+ */
124
+ axis_x_categories: [],
125
+ /**
126
+ * centerize ticks on category axis.
127
+ * @name axis․x․tick․centered
128
+ * @memberof Options
129
+ * @type {boolean}
130
+ * @default false
131
+ * @example
132
+ * axis: {
133
+ * x: {
134
+ * tick: {
135
+ * centered: true
136
+ * }
137
+ * }
138
+ * }
139
+ */
140
+ axis_x_tick_centered: false,
141
+ /**
142
+ * A function to format tick value. Format string is also available for timeseries data.
143
+ * @name axis․x․tick․format
144
+ * @memberof Options
145
+ * @type {function|string}
146
+ * @default undefined
147
+ * @see [D3's time specifier](https://d3js.org/d3-time-format#locale_format)
148
+ * @example
149
+ * axis: {
150
+ * x: {
151
+ * tick: {
152
+ * // for timeseries, a 'datetime' object is given as parameter
153
+ * format: function(x) {
154
+ * return x.getFullYear();
155
+ * }
156
+ *
157
+ * // for category, index(Number) and categoryName(String) are given as parameter
158
+ * format: function(index, categoryName) {
159
+ * return categoryName.substr(0, 10);
160
+ * },
161
+ *
162
+ * // for timeseries format specifier
163
+ * format: "%Y-%m-%d %H:%M:%S"
164
+ * }
165
+ * }
166
+ * }
167
+ */
168
+ axis_x_tick_format: void 0,
169
+ /**
170
+ * Setting for culling ticks.
171
+ * - `true`: the ticks will be culled, then only limited tick text will be shown.<br>
172
+ * This option does not hide the tick lines by default, if want to hide tick lines, set `axis.x.tick.culling.lines=false`.
173
+ * - `false`: all of ticks will be shown.<br><br>
174
+ * The number of ticks to be shown can be changed by `axis.x.tick.culling.max`.
175
+ * @name axis․x․tick․culling
176
+ * @memberof Options
177
+ * @type {boolean}
178
+ * @default
179
+ * `true` for indexed axis and timeseries axis, `false` for category axis
180
+ * @example
181
+ * axis: {
182
+ * x: {
183
+ * tick: {
184
+ * culling: false,
185
+ * }
186
+ * }
187
+ * }
188
+ */
189
+ axis_x_tick_culling: {},
190
+ /**
191
+ * The number of tick texts will be adjusted to less than this value.
192
+ * @name axis․x․tick․culling․max
193
+ * @memberof Options
194
+ * @type {number}
195
+ * @default 10
196
+ * @example
197
+ * axis: {
198
+ * x: {
199
+ * tick: {
200
+ * culling: {
201
+ * max: 5
202
+ * }
203
+ * }
204
+ * }
205
+ * }
206
+ */
207
+ axis_x_tick_culling_max: 10,
208
+ /**
209
+ * Control visibility of tick lines within culling option, along with tick text.
210
+ * @name axis․x․tick․culling․lines
211
+ * @memberof Options
212
+ * @type {boolean}
213
+ * @default true
214
+ * @example
215
+ * axis: {
216
+ * x: {
217
+ * tick: {
218
+ * culling: {
219
+ * lines: false,
220
+ * }
221
+ * }
222
+ * }
223
+ * }
224
+ */
225
+ axis_x_tick_culling_lines: true,
226
+ /**
227
+ * Control culling start point to be reversed. If set to true, the culling will be started from the end to start.
228
+ * - **NOTE:** This option is only available when `axis.x.tick.culling` is set to truthy value.
229
+ * @name axis․x․tick․culling․reverse
230
+ * @memberof Options
231
+ * @type {boolean}
232
+ * @default false
233
+ * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickCulling)
234
+ * @example
235
+ * axis: {
236
+ * x: {
237
+ * tick: {
238
+ * culling: {
239
+ * reverse: true,
240
+ * }
241
+ * }
242
+ * }
243
+ * }
244
+ */
245
+ axis_x_tick_culling_reverse: false,
246
+ /**
247
+ * The number of x axis ticks to show.<br><br>
248
+ * This option hides tick lines together with tick text. If this option is used on timeseries axis, the ticks position will be determined precisely and not nicely positioned (e.g. it will have rough second value).
249
+ * @name axis․x․tick․count
250
+ * @memberof Options
251
+ * @type {number}
252
+ * @default undefined
253
+ * @example
254
+ * axis: {
255
+ * x: {
256
+ * tick: {
257
+ * count: 5
258
+ * }
259
+ * }
260
+ * }
261
+ */
262
+ axis_x_tick_count: void 0,
263
+ /**
264
+ * Set the axis tick line to be positioned inside of the chart.
265
+ * @name axis․x․tick․inner
266
+ * @memberof Options
267
+ * @type {boolean}
268
+ * @default false
269
+ * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.TickInner)
270
+ * @example
271
+ * axis: {
272
+ * x: {
273
+ * tick: {
274
+ * inner: true
275
+ * }
276
+ * }
277
+ * }
278
+ */
279
+ axis_x_tick_inner: false,
280
+ /**
281
+ * Show or hide x axis tick line.
282
+ * @name axis․x․tick․show
283
+ * @memberof Options
284
+ * @type {boolean}
285
+ * @default true
286
+ * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.HideTickLineText)
287
+ * @example
288
+ * axis: {
289
+ * x: {
290
+ * tick: {
291
+ * show: false
292
+ * }
293
+ * }
294
+ * }
295
+ */
296
+ axis_x_tick_show: true,
297
+ /**
298
+ * Show or hide x axis tick text.
299
+ * @name axis․x․tick․text․show
300
+ * @memberof Options
301
+ * @type {boolean}
302
+ * @default true
303
+ * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.HideTickLineText)
304
+ * @example
305
+ * axis: {
306
+ * x: {
307
+ * tick: {
308
+ * text: {
309
+ * show: false
310
+ * }
311
+ * }
312
+ * }
313
+ * }
314
+ */
315
+ axis_x_tick_text_show: true,
316
+ /**
317
+ * Set the first/last axis tick text to be positioned inside of the chart on non-rotated axis.
318
+ * @name axis․x․tick․text․inner
319
+ * @memberof Options
320
+ * @type {boolean|object}
321
+ * @default false
322
+ * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickInner)
323
+ * @example
324
+ * axis: {
325
+ * x: {
326
+ * tick: {
327
+ * text: {
328
+ * inner: true,
329
+ *
330
+ * // or specify each position of the first and last tick text
331
+ * inner: {
332
+ * first: true,
333
+ * last: true
334
+ * }
335
+ * }
336
+ * }
337
+ * }
338
+ * }
339
+ */
340
+ axis_x_tick_text_inner: false,
341
+ /**
342
+ * Set the x Axis tick text's position relatively its original position
343
+ * @name axis․x․tick․text․position
344
+ * @memberof Options
345
+ * @type {object}
346
+ * @default {x: 0, y:0}
347
+ * @example
348
+ * axis: {
349
+ * x: {
350
+ * tick: {
351
+ * text: {
352
+ * position: {
353
+ * x: 10,
354
+ * y: 10
355
+ * }
356
+ * }
357
+ * }
358
+ * }
359
+ * }
360
+ */
361
+ axis_x_tick_text_position: {
362
+ x: 0,
363
+ y: 0
364
+ },
365
+ /**
366
+ * Fit x axis ticks.
367
+ * - **true**: ticks will be shown according to x value of the data points.
368
+ * - **false**: ticks will be shown as to have same intervals.
369
+ * @name axis․x․tick․fit
370
+ * @memberof Options
371
+ * @type {boolean}
372
+ * @default true
373
+ * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickFitting)
374
+ * @see [Demo: for timeseries zoom](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickTimeseries)
375
+ * @example
376
+ * axis: {
377
+ * x: {
378
+ * tick: {
379
+ * fit: false
380
+ * }
381
+ * }
382
+ * }
383
+ */
384
+ axis_x_tick_fit: true,
385
+ /**
386
+ * Set the x values of ticks manually.<br><br>
387
+ * If this option is provided, the position of the ticks will be determined based on those values.<br>
388
+ * This option works with `timeseries` data and the x values will be parsed according to the type of the value and data.xFormat option.
389
+ * @name axis․x․tick․values
390
+ * @memberof Options
391
+ * @type {Array|function}
392
+ * @default null
393
+ * @example
394
+ * axis: {
395
+ * x: {
396
+ * tick: {
397
+ * values: [1, 2, 4, 8, 16, 32, ...],
398
+ *
399
+ * // an Array value should be returned
400
+ * values: function() {
401
+ * return [ ... ];
402
+ * }
403
+ * }
404
+ * }
405
+ * }
406
+ */
407
+ axis_x_tick_values: null,
408
+ /**
409
+ * Rotate x axis tick text if there is not enough space for 'category' and 'timeseries' type axis.
410
+ * - **NOTE:** The conditions where `autorotate` is enabled are:
411
+ * - axis.x.type='category' or 'timeseries
412
+ * - axis.x.tick.multiline=false
413
+ * - axis.x.tick.culling=false
414
+ * - axis.x.tick.fit=true
415
+ * - **NOTE:** axis.x.tick.clippath=false is necessary for calculating the overflow padding between the end of x axis and the width of the SVG
416
+ * @name axis․x․tick․autorotate
417
+ * @memberof Options
418
+ * @type {boolean}
419
+ * @default false
420
+ * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickAutorotate)
421
+ * @example
422
+ * axis: {
423
+ * x: {
424
+ * tick: {
425
+ * rotate: 15,
426
+ * autorotate: true,
427
+ * multiline: false,
428
+ * culling: false,
429
+ * fit: true
430
+ * },
431
+ * clipPath: false
432
+ * }
433
+ * }
434
+ */
435
+ axis_x_tick_autorotate: false,
436
+ /**
437
+ * Rotate x axis tick text.
438
+ * - If you set negative value, it will rotate to opposite direction.
439
+ * - Applied when [`axis.rotated`](#.axis%25E2%2580%25A4rotated) option is `false`.
440
+ * - As long as `axis_x_tick_fit` is set to `true` it will calculate an overflow for the y2 axis and add this value to the right padding.
441
+ * @name axis․x․tick․rotate
442
+ * @memberof Options
443
+ * @type {number}
444
+ * @default 0
445
+ * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.RotateXAxisTickText)
446
+ * @example
447
+ * axis: {
448
+ * x: {
449
+ * tick: {
450
+ * rotate: 60
451
+ * }
452
+ * }
453
+ * }
454
+ */
455
+ axis_x_tick_rotate: 0,
456
+ /**
457
+ * Show x axis outer tick.
458
+ * @name axis․x․tick․outer
459
+ * @memberof Options
460
+ * @type {boolean}
461
+ * @default true
462
+ * @example
463
+ * axis: {
464
+ * x: {
465
+ * tick: {
466
+ * outer: false
467
+ * }
468
+ * }
469
+ * }
470
+ */
471
+ axis_x_tick_outer: true,
472
+ /**
473
+ * Set tick text to be multiline
474
+ * - **NOTE:**
475
+ * > When x tick text contains `\n`, it's used as line break and 'axis.x.tick.width' option is ignored.
476
+ * @name axis․x․tick․multiline
477
+ * @memberof Options
478
+ * @type {boolean}
479
+ * @default true
480
+ * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickMultiline)
481
+ * @example
482
+ * axis: {
483
+ * x: {
484
+ * tick: {
485
+ * multiline: false
486
+ * }
487
+ * }
488
+ * }
489
+ * @example
490
+ * // example of line break with '\n'
491
+ * // In this case, 'axis.x.tick.width' is ignored
492
+ * data: {
493
+ * x: "x",
494
+ * columns: [
495
+ * ["x", "long\ntext", "Another\nLong\nText"],
496
+ * ...
497
+ * ],
498
+ * }
499
+ */
500
+ axis_x_tick_multiline: true,
501
+ /**
502
+ * Set tick width
503
+ * - **NOTE:**
504
+ * > When x tick text contains `\n`, this option is ignored.
505
+ * @name axis․x․tick․width
506
+ * @memberof Options
507
+ * @type {number}
508
+ * @default null
509
+ * @example
510
+ * axis: {
511
+ * x: {
512
+ * tick: {
513
+ * width: 50
514
+ * }
515
+ * }
516
+ * }
517
+ */
518
+ axis_x_tick_width: null,
519
+ /**
520
+ * Set to display system tooltip(via `<title>` element) for tick text
521
+ * - **NOTE:** Only available for category axis type (`axis.x.type='category'`)
522
+ * @name axis․x․tick․tooltip
523
+ * @memberof Options
524
+ * @type {boolean}
525
+ * @default false
526
+ * @example
527
+ * axis: {
528
+ * x: {
529
+ * tick: {
530
+ * tooltip: true
531
+ * }
532
+ * }
533
+ * }
534
+ */
535
+ axis_x_tick_tooltip: false,
536
+ /**
537
+ * Set max value of x axis range.
538
+ * @name axis․x․max
539
+ * @memberof Options
540
+ * @property {number} max Set the max value
541
+ * @property {boolean} [max.fit=false] When specified `max.value` is greater than the bound data value, setting `true` will make x axis max to be fitted to the bound data max value.
542
+ * - **NOTE:** If the bound data max value is greater than the `max.value`, the x axis max will be limited as the given `max.value`.
543
+ * @property {number} [max.value] Set the max value
544
+ * @example
545
+ * axis: {
546
+ * x: {
547
+ * max: 100,
548
+ *
549
+ * max: {
550
+ * // 'fit=true' will make x axis max to be limited as the bound data value max when 'max.value' is greater.
551
+ * // - when bound data max is '10' and max.value: '100' ==> x axis max will be '10'
552
+ * // - when bound data max is '1000' and max.value: '100' ==> x axis max will be '100'
553
+ * fit: true,
554
+ * value: 100
555
+ * }
556
+ * }
557
+ * }
558
+ */
559
+ axis_x_max: void 0,
560
+ /**
561
+ * Set min value of x axis range.
562
+ * @name axis․x․min
563
+ * @memberof Options
564
+ * @property {number} min Set the min value
565
+ * @property {boolean} [min.fit=false] When specified `min.value` is lower than the bound data value, setting `true` will make x axis min to be fitted to the bound data min value.
566
+ * - **NOTE:** If the bound data min value is lower than the `min.value`, the x axis min will be limited as the given `min.value`.
567
+ * @property {number} [min.value] Set the min value
568
+ * @example
569
+ * axis: {
570
+ * x: {
571
+ * min: -100,
572
+ *
573
+ * min: {
574
+ * // 'fit=true' will make x axis min to be limited as the bound data value min when 'min.value' is lower.
575
+ * // - when bound data min is '-10' and min.value: '-100' ==> x axis min will be '-10'
576
+ * // - when bound data min is '-1000' and min.value: '-100' ==> x axis min will be '-100'
577
+ * fit: true,
578
+ * value: -100
579
+ * }
580
+ * }
581
+ * }
582
+ */
583
+ axis_x_min: void 0,
584
+ /**
585
+ * Change the direction of x axis.<br><br>
586
+ * If true set, the direction will be `right -> left`.
587
+ * @name axis․x․inverted
588
+ * @memberof Options
589
+ * @type {boolean}
590
+ * @default false
591
+ * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.InvertedAxis)
592
+ * @example
593
+ * axis: {
594
+ * x: {
595
+ * inverted: true
596
+ * }
597
+ * }
598
+ */
599
+ axis_x_inverted: false,
600
+ /**
601
+ * Set padding for x axis.<br><br>
602
+ * If this option is set, the range of x axis will increase/decrease according to the values.
603
+ * If no padding is needed in the rage of x axis, 0 should be set.
604
+ * By default, left/right padding are set depending on x axis type or chart types.
605
+ * - **NOTE:**
606
+ * - The meaning of padding values, differs according axis types:<br>
607
+ * - **category/indexed:** The unit of tick value
608
+ * ex. the given value `1`, is same as the width of 1 tick width
609
+ * - **timeseries:** Numeric time value
610
+ * ex. the given value `1000*60*60*24`, which is numeric time equivalent of a day, is same as the width of 1 tick width
611
+ * - If want values to be treated as pixels, specify `unit:"px"`.
612
+ * - The pixel value will be converted based on the scale values. Hence can not reflect accurate padding result.
613
+ * @name axis․x․padding
614
+ * @memberof Options
615
+ * @type {object|number}
616
+ * @default {}
617
+ * @example
618
+ * axis: {
619
+ * x: {
620
+ * padding: {
621
+ * // when axis type is 'category'
622
+ * left: 1, // set left padding width of equivalent value of a tick's width
623
+ * right: 0.5 // set right padding width as half of equivalent value of tick's width
624
+ *
625
+ * // when axis type is 'timeseries'
626
+ * left: 1000*60*60*24, // set left padding width of equivalent value of a day tick's width
627
+ * right: 1000*60*60*12 // set right padding width as half of equivalent value of a day tick's width
628
+ * },
629
+ *
630
+ * // or set both values at once.
631
+ * padding: 10,
632
+ *
633
+ * // or set padding values as pixel unit.
634
+ * padding: {
635
+ * left: 100,
636
+ * right: 50,
637
+ * unit: "px"
638
+ * },
639
+ * }
640
+ * }
641
+ */
642
+ axis_x_padding: {},
643
+ /**
644
+ * Set height of x axis.<br><br>
645
+ * The height of x axis can be set manually by this option. If you need more space for x axis, please use this option for that. The unit is pixel.
646
+ * @name axis․x․height
647
+ * @memberof Options
648
+ * @type {number}
649
+ * @default undefined
650
+ * @example
651
+ * axis: {
652
+ * x: {
653
+ * height: 20
654
+ * }
655
+ * }
656
+ */
657
+ axis_x_height: void 0,
658
+ /**
659
+ * Set extent for subchart and zoom(drag only). This can be an array or function that returns an array.
660
+ * - **NOTE:** Specifying value, will limit the zoom scope selection within.
661
+ * @name axis․x․extent
662
+ * @memberof Options
663
+ * @type {Array|function}
664
+ * @default undefined
665
+ * @example
666
+ * axis: {
667
+ * x: {
668
+ * // extent range as a pixel value
669
+ * extent: [0, 200],
670
+ *
671
+ * // when axis is 'timeseries', parsable datetime string
672
+ * extent: ["2019-03-01", "2019-03-05"],
673
+ *
674
+ * // return extent value
675
+ * extent: function(domain, scale) {
676
+ * var extent = domain.map(function(v) {
677
+ * return scale(v);
678
+ * });
679
+ *
680
+ * // it should return a format of array
681
+ * // ex) [0, 584]
682
+ * return extent;
683
+ * }
684
+ * }
685
+ * }
686
+ */
687
+ axis_x_extent: void 0,
688
+ /**
689
+ * Set label on x axis.<br><br>
690
+ * You can set x axis label and change its position by this option.
691
+ * `string` and `object` can be passed and we can change the poisiton by passing object that has position key.<br>
692
+ * Available position differs according to the axis direction (vertical or horizontal).
693
+ * If string set, the position will be the default.
694
+ *
695
+ * - **If it's horizontal axis:**
696
+ * - inner-right [default]
697
+ * - inner-center
698
+ * - inner-left
699
+ * - outer-right
700
+ * - outer-center
701
+ * - outer-left
702
+ * - **If it's vertical axis:**
703
+ * - inner-top [default]
704
+ * - inner-middle
705
+ * - inner-bottom
706
+ * - outer-top
707
+ * - outer-middle
708
+ * - outer-bottom
709
+ * @name axis․x․label
710
+ * @memberof Options
711
+ * @type {string|object}
712
+ * @default undefined
713
+ * @example
714
+ * axis: {
715
+ * x: {
716
+ * label: "Your X Axis"
717
+ * }
718
+ * }
719
+ *
720
+ * axis: {
721
+ * x: {
722
+ * label: {
723
+ * text: "Your X Axis",
724
+ * position: "outer-center"
725
+ * }
726
+ * }
727
+ * }
728
+ */
729
+ axis_x_label: {},
730
+ /**
731
+ * Set additional axes for x Axis.
732
+ * - **NOTE:** Axis' scale is based on x Axis value if domain option isn't set.
733
+ *
734
+ * Each axis object should consist with following options:
735
+ *
736
+ * | Name | Type | Default | Description |
737
+ * | --- | --- | --- | --- |
738
+ * | domain | Array | - | Set the domain value |
739
+ * | tick.outer | boolean | true | Show outer tick |
740
+ * | tick.format | Function | - | Set formatter for tick text |
741
+ * | tick.count | Number | - | Set the number of y axis ticks |
742
+ * | tick.values | Array | - | Set tick values manually |
743
+ * @name axis․x․axes
744
+ * @memberof Options
745
+ * @type {Array}
746
+ * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.MultiAxes)
747
+ * @see [Demo: Domain](https://naver.github.io/billboard.js/demo/#Axis.MultiAxesDomain)
748
+ * @example
749
+ * x: {
750
+ * axes: [
751
+ * {
752
+ * // if set, will not be correlated with the main x Axis domain value
753
+ * domain: [0, 1000],
754
+ * tick: {
755
+ * outer: false,
756
+ * format: function(x) {
757
+ * return x + "%";
758
+ * },
759
+ * count: 2,
760
+ * values: [10, 20, 30]
761
+ * }
762
+ * },
763
+ * ...
764
+ * ]
765
+ * }
766
+ */
767
+ axis_x_axes: []
764
768
  };
765
-
766
- export { x as default };
769
+ //#endregion
770
+ export { x_default as default };