billboard.js 3.3.0-next.1 → 3.3.0-next.2

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 (61) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +139 -29
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +1600 -1391
  6. package/dist/billboard.pkgd.min.js +2 -2
  7. package/dist/plugin/billboardjs-plugin-bubblecompare.d.ts +7 -0
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  10. package/dist/plugin/billboardjs-plugin-sparkline.d.ts +7 -0
  11. package/dist/plugin/billboardjs-plugin-sparkline.js +4 -4
  12. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-stanford.d.ts +7 -0
  14. package/dist/plugin/billboardjs-plugin-stanford.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  16. package/dist/plugin/billboardjs-plugin-tableview.d.ts +7 -0
  17. package/dist/plugin/billboardjs-plugin-tableview.js +2 -2
  18. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  19. package/dist/plugin/billboardjs-plugin-textoverlap.d.ts +7 -0
  20. package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -2
  21. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  22. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +1463 -1364
  23. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +1466 -1367
  24. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +1465 -1366
  25. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +1466 -1367
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +1466 -1367
  27. package/dist/theme/datalab.css +1 -1
  28. package/dist/theme/datalab.min.css +1 -1
  29. package/dist/theme/graph.css +1 -1
  30. package/dist/theme/graph.min.css +1 -1
  31. package/dist/theme/insight.css +1 -1
  32. package/dist/theme/insight.min.css +1 -1
  33. package/dist-esm/billboard.js +131 -29
  34. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.d.ts +7 -0
  35. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  36. package/dist-esm/plugin/billboardjs-plugin-sparkline.d.ts +7 -0
  37. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +4 -4
  38. package/dist-esm/plugin/billboardjs-plugin-stanford.d.ts +7 -0
  39. package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
  40. package/dist-esm/plugin/billboardjs-plugin-tableview.d.ts +7 -0
  41. package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
  42. package/dist-esm/plugin/billboardjs-plugin-textoverlap.d.ts +7 -0
  43. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
  44. package/package.json +17 -16
  45. package/src/Chart/api/data.ts +3 -4
  46. package/src/ChartInternal/Axis/Axis.ts +13 -7
  47. package/src/ChartInternal/data/IData.ts +9 -0
  48. package/src/ChartInternal/data/data.ts +1 -1
  49. package/src/ChartInternal/shape/arc.ts +2 -0
  50. package/src/ChartInternal/shape/bar.ts +4 -2
  51. package/src/ChartInternal/shape/radar.ts +2 -0
  52. package/src/ChartInternal/shape/shape.ts +39 -9
  53. package/src/Plugin/sparkline/index.ts +2 -2
  54. package/src/config/Options/axis/x.ts +25 -5
  55. package/src/config/Options/axis/y.ts +24 -3
  56. package/src/config/Options/axis/y2.ts +24 -3
  57. package/src/config/Options/shape/bar.ts +8 -0
  58. package/types/axis.d.ts +18 -4
  59. package/types/options.d.ts +32 -32
  60. package/types/plugin/tableview/index.d.ts +3 -3
  61. package/types/plugin/tableview/options.d.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "billboard.js",
3
- "version": "3.3.0-next.1",
3
+ "version": "3.3.0-next.2",
4
4
  "description": "Re-usable easy interface JavaScript chart library, based on D3 v4+",
5
5
  "homepage": "https://naver.github.io/billboard.js/",
6
6
  "main": "dist/billboard.js",
@@ -21,7 +21,7 @@
21
21
  "scripts": {
22
22
  "start": "webpack serve --open",
23
23
  "start:plugin": "cross-env PLUGIN=true webpack-dev-server --open",
24
- "build": "npm run build:production && npm run build:packaged && npm run build:theme && npm run build:plugin && npm run build:esm && npm run build:cjs",
24
+ "build": "npm run build:production && npm run build:packaged && npm run build:theme && npm run build:plugin && npm run build:esm && npm run build:cjs && npm run build:plugin:types",
25
25
  "build:cjs": "node ./config/cjs.js",
26
26
  "build:esm": "rollup -c ./config/rollup/esm.js",
27
27
  "build:production": "cross-env NODE_ENV=production webpack",
@@ -30,7 +30,8 @@
30
30
  "build:theme": "cross-env NODE_ENV=theme webpack",
31
31
  "build:production:analyzer": "cross-env ANALYZER=true npm run build:production",
32
32
  "build:packaged:analyzer": "cross-env ANALYZER=true npm run build:packaged",
33
- "build:plugin": "cross-env NODE_ENV=plugin webpack && cross-env NODE_ENV=plugin MODE=min webpack && cross-env NODE_ENV=plugin MODE=pkgd webpack",
33
+ "build:plugin": "cross-env NODE_ENV=plugin webpack && cross-env NODE_ENV=plugin MODE=min webpack && cross-env NODE_ENV=plugin MODE=pkgd webpack",
34
+ "build:plugin:types": "node ./config/type.d-plugin.js",
34
35
  "release": "semantic-release",
35
36
  "lint": "npm run lint:types && eslint src --ext .ts",
36
37
  "lint:types": "dtslint --onlyTestTsNext types",
@@ -103,14 +104,14 @@
103
104
  "@babel/preset-typescript": "^7.16.5",
104
105
  "@babel/runtime": "^7.16.5",
105
106
  "@commitlint/cli": "^15.0.0",
106
- "@commitlint/config-conventional": "^15.0.0",
107
+ "@commitlint/config-conventional": "^16.0.0",
107
108
  "@rollup/plugin-babel": "^5.3.0",
108
109
  "@rollup/plugin-node-resolve": "^13.1.1",
109
- "@rollup/plugin-replace": "^3.0.0",
110
+ "@rollup/plugin-replace": "^3.0.1",
110
111
  "@rollup/plugin-typescript": "^8.3.0",
111
112
  "@semantic-release/changelog": "^6.0.1",
112
113
  "@semantic-release/commit-analyzer": "^9.0.2",
113
- "@semantic-release/exec": "^6.0.2",
114
+ "@semantic-release/exec": "^6.0.3",
114
115
  "@semantic-release/git": "^10.0.1",
115
116
  "@semantic-release/npm": "^8.0.3",
116
117
  "@semantic-release/release-notes-generator": "^10.0.3",
@@ -118,8 +119,8 @@
118
119
  "@types/d3": "^7.1.0",
119
120
  "@types/mocha": "^9.0.0",
120
121
  "@types/sinon": "^10.0.6",
121
- "@typescript-eslint/eslint-plugin": "^5.7.0",
122
- "@typescript-eslint/parser": "^5.7.0",
122
+ "@typescript-eslint/eslint-plugin": "^5.8.1",
123
+ "@typescript-eslint/parser": "^5.8.1",
123
124
  "babel-helper-modules": "^6.0.0",
124
125
  "babel-loader": "^8.2.3",
125
126
  "babel-plugin-add-module-exports": "^1.0.4",
@@ -135,21 +136,21 @@
135
136
  "chai": "^4.3.4",
136
137
  "clean-webpack-plugin": "^4.0.0",
137
138
  "cloc": "^2.9.0",
138
- "core-js": "^3.19.3",
139
+ "core-js": "^3.20.1",
139
140
  "coveralls": "^3.1.1",
140
141
  "cross-env": "^7.0.3",
141
142
  "css-loader": "^6.5.1",
142
- "css-minimizer-webpack-plugin": "^3.2.0",
143
+ "css-minimizer-webpack-plugin": "^3.3.1",
143
144
  "d3-color": "^3.0.1",
144
145
  "d3-delaunay": "^6.0.2",
145
146
  "d3-format": "^3.1.0",
146
147
  "d3-polygon": "^3.0.1",
147
148
  "docdash": "^1.2.0",
148
149
  "dtslint": "^4.2.1",
149
- "eslint": "^8.4.1",
150
+ "eslint": "^8.5.0",
150
151
  "eslint-config-naver": "^2.1.0",
151
152
  "eslint-plugin-import": "^2.25.3",
152
- "eslint-plugin-jsdoc": "^37.2.0",
153
+ "eslint-plugin-jsdoc": "^37.4.2",
153
154
  "eslint-webpack-plugin": "^3.1.1",
154
155
  "exports-loader": "^3.1.0",
155
156
  "hammer-simulator": "0.0.1",
@@ -170,9 +171,9 @@
170
171
  "lite-fixture": "^1.0.2",
171
172
  "mini-css-extract-plugin": "^2.4.5",
172
173
  "mocha": "^9.1.3",
173
- "node-sass": "^6.0.1",
174
+ "node-sass": "^7.0.1",
174
175
  "regenerator-runtime": "^0.13.7",
175
- "rollup": "^2.61.1",
176
+ "rollup": "^2.62.0",
176
177
  "rollup-plugin-delete": "^2.0.0",
177
178
  "sass-loader": "^12.4.0",
178
179
  "semantic-release": "^18.0.1",
@@ -180,7 +181,7 @@
180
181
  "sinon": "^12.0.1",
181
182
  "string-replace-loader": "^3.1.0",
182
183
  "style-loader": "^3.3.1",
183
- "terser-webpack-plugin": "^5.2.5",
184
+ "terser-webpack-plugin": "^5.3.0",
184
185
  "tslib": "^2.3.1",
185
186
  "typescript": "^4.5.4",
186
187
  "webpack": "^5.65.0",
@@ -188,7 +189,7 @@
188
189
  "webpack-clean": "^1.2.5",
189
190
  "webpack-cli": "^4.9.1",
190
191
  "webpack-common-shake": "^2.1.0",
191
- "webpack-dev-server": "^4.6.0",
192
+ "webpack-dev-server": "^4.7.2",
192
193
  "webpack-merge": "^5.8.0",
193
194
  "webpackbar": "^5.0.2",
194
195
  "write-file-webpack-plugin": "^4.5.1"
@@ -4,8 +4,7 @@
4
4
  */
5
5
  import {DataItem} from "../../../types/types";
6
6
  import {extend, isUndefined, isArray} from "../../module/util";
7
-
8
- type DataParam = {x: number, value: number, id: string, index: number}[];
7
+ import {IDataRow} from "../../ChartInternal/data/IData";
9
8
 
10
9
  /**
11
10
  * Get data loaded in the chart.
@@ -173,7 +172,7 @@ extend(data, {
173
172
  * chart.data.min();
174
173
  * // --> [{x: 0, value: 30, id: "data1", index: 0}, ...]
175
174
  */
176
- min: function(): DataParam {
175
+ min: function(): IDataRow[] {
177
176
  return this.internal.getMinMaxData().min;
178
177
  },
179
178
 
@@ -188,7 +187,7 @@ extend(data, {
188
187
  * chart.data.max();
189
188
  * // --> [{x: 3, value: 400, id: "data1", index: 3}, ...]
190
189
  */
191
- max: function(): DataParam {
190
+ max: function(): IDataRow[] {
192
191
  return this.internal.getMinMaxData().max;
193
192
  }
194
193
  });
@@ -945,13 +945,16 @@ class Axis {
945
945
 
946
946
  // subchart x axis should be aligned with x axis culling
947
947
  const id = type === "subX" ? "x" : type;
948
- const toCull = config[`axis_${id}_tick_culling`];
948
+
949
+ const cullingOptionPrefix = `axis_${id}_tick_culling`;
950
+ const toCull = config[cullingOptionPrefix];
949
951
 
950
952
  if (axis && toCull) {
951
- const tickText = axis.selectAll(".tick text");
952
- const tickValues = sortValue(tickText.data());
953
+ const tickNodes = axis.selectAll(".tick");
954
+ const tickValues = sortValue(tickNodes.data());
953
955
  const tickSize = tickValues.length;
954
- const cullingMax = config[`axis_${id}_tick_culling_max`];
956
+ const cullingMax = config[`${cullingOptionPrefix}_max`];
957
+ const lines = config[`${cullingOptionPrefix}_lines`];
955
958
  let intervalForCulling;
956
959
 
957
960
  if (tickSize) {
@@ -962,11 +965,14 @@ class Axis {
962
965
  }
963
966
  }
964
967
 
965
- tickText.each(function(d) {
966
- this.style.display = tickValues.indexOf(d) % intervalForCulling ? "none" : null;
968
+ tickNodes.each(function(d) {
969
+ if (tickValues.indexOf(d) % intervalForCulling) {
970
+ (lines ? this.querySelector("text") : this)
971
+ .style.display = "none";
972
+ }
967
973
  });
968
974
  } else {
969
- tickText.style("display", null);
975
+ tickNodes.style("display", null);
970
976
  }
971
977
 
972
978
  // set/unset x_axis_tick_clippath
@@ -30,3 +30,12 @@ export interface IGridData {
30
30
  text: string;
31
31
  value: number;
32
32
  }
33
+
34
+ export interface IDataIndice {
35
+ [key: string]: number;
36
+ __max__: number;
37
+ }
38
+
39
+ export type TIndices = {} | {
40
+ [key:string]: IDataIndice
41
+ };
@@ -154,7 +154,7 @@ export default {
154
154
  .map(t => $$.addName($$.getValueOnIndex(t.values, index)));
155
155
 
156
156
  if (filterNull) {
157
- value = value.filter(v => isValue(v.value));
157
+ value = value.filter(v => v && "value" in v && isValue(v.value));
158
158
  }
159
159
 
160
160
  return value;
@@ -795,6 +795,8 @@ export default {
795
795
  return;
796
796
  }
797
797
 
798
+ state.event = event;
799
+
798
800
  const eventArc = getEventArc(event);
799
801
  const datum: any = eventArc.datum();
800
802
  const updated = (datum?.data && datum.data.id) ? $$.updateAngle(datum) : null;
@@ -153,9 +153,11 @@ export default {
153
153
  const pathRadius = ["", ""];
154
154
  let radius = 0;
155
155
 
156
- const isRadiusData = $$.isGrouped(d.id) ? $$.isStackingRadiusData(d) : false;
156
+ const isGrouped = $$.isGrouped(d.id);
157
+ const hasRadius = d.value !== 0 && getRadius;
158
+ const isRadiusData = hasRadius && isGrouped ? $$.isStackingRadiusData(d) : false;
157
159
 
158
- if ((d.value !== 0 && getRadius) && (!$$.isGrouped(d.id) || isRadiusData)) {
160
+ if (hasRadius && (!isGrouped || isRadiusData)) {
159
161
  const index = isRotated ? indexY : indexX;
160
162
  const barW = points[2][index] - points[0][index];
161
163
 
@@ -314,6 +314,8 @@ export default {
314
314
  return d && Object.keys(d).length === 1 ? d.index : undefined;
315
315
  };
316
316
  const hide = event => {
317
+ state.event = event;
318
+
317
319
  const index = getIndex(event);
318
320
  const noIndex = isUndefined(index);
319
321
 
@@ -26,6 +26,7 @@ import {select as d3Select} from "d3-selection";
26
26
  import {d3Selection} from "../../../types/types";
27
27
  import CLASS from "../../config/classes";
28
28
  import {capitalize, getPointer, getRectSegList, getUnique, isObjectType, isNumber, isValue, isUndefined, notEmpty} from "../../module/util";
29
+ import {IDataRow, IDataIndice, TIndices} from "../data/IData";
29
30
 
30
31
  export default {
31
32
  /**
@@ -75,12 +76,25 @@ export default {
75
76
  return shape;
76
77
  },
77
78
 
78
- getShapeIndices(typeFilter): {[key: string]: number} {
79
+ /**
80
+ * Get shape's indices according it's position
81
+ *
82
+ * From the below example, indices will be:
83
+ * ==> {data1: 0, data2: 0, data3: 1, data4: 1, __max__: 1}
84
+ *
85
+ * data1 data3 data1 data3
86
+ * data2 data4 data2 data4
87
+ * -------------------------
88
+ * 0 1
89
+ * @param {Function} typeFilter Chart type filter function
90
+ * @returns {object} Indices object with its position
91
+ */
92
+ getShapeIndices(typeFilter): TIndices {
79
93
  const $$ = this;
80
94
  const {config} = $$;
81
95
  const xs = config.data_xs;
82
96
  const hasXs = notEmpty(xs);
83
- const indices = {};
97
+ const indices: TIndices = {};
84
98
  let i: any = hasXs ? {} : 0;
85
99
 
86
100
  if (hasXs) {
@@ -121,12 +135,28 @@ export default {
121
135
  /**
122
136
  * Get indices value based on data ID value
123
137
  * @param {object} indices Indices object
124
- * @param {string} id Data id value
138
+ * @param {object} d Data row
139
+ * @param {string} caller Caller function name (Used only for 'sparkline' plugin)
125
140
  * @returns {object} Indices object
126
141
  * @private
127
142
  */
128
- getIndices(indices, id: string) {
129
- const xs = this.config.data_xs;
143
+ getIndices(indices: TIndices, d: IDataRow, caller?: string): IDataIndice { // eslint-disable-line
144
+ const $$ = this;
145
+ const {data_xs: xs, bar_indices_removeNull: removeNull} = $$.config;
146
+ const {id, index} = d;
147
+
148
+ if ($$.isBarType(id) && removeNull) {
149
+ const ind = {} as IDataIndice;
150
+
151
+ // redefine bar indices order
152
+ $$.getAllValuesOnIndex(index, true)
153
+ .forEach((v, i) => {
154
+ ind[v.id] = i;
155
+ ind.__max__ = i;
156
+ });
157
+
158
+ return ind;
159
+ }
130
160
 
131
161
  return notEmpty(xs) ?
132
162
  indices[xs[id]] : indices;
@@ -138,12 +168,12 @@ export default {
138
168
  * @returns {number} Max number
139
169
  * @private
140
170
  */
141
- getIndicesMax(indices): number {
171
+ getIndicesMax(indices: TIndices | IDataIndice): number {
142
172
  return notEmpty(this.config.data_xs) ?
143
173
  // if is multiple xs, return total sum of xs' __max__ value
144
174
  Object.keys(indices)
145
175
  .map(v => indices[v].__max__ || 0)
146
- .reduce((acc, curr) => acc + curr) : indices.__max__;
176
+ .reduce((acc, curr) => acc + curr) : (indices as IDataIndice).__max__;
147
177
  },
148
178
 
149
179
  getShapeX(offset, indices, isSub?: boolean): (d) => number {
@@ -157,7 +187,7 @@ export default {
157
187
  );
158
188
 
159
189
  return d => {
160
- const ind = $$.getIndices(indices, d.id, "getShapeX");
190
+ const ind = $$.getIndices(indices, d, "getShapeX");
161
191
  const index = d.id in ind ? ind[d.id] : 0;
162
192
  const targetsNum = (ind.__max__ || 0) + 1;
163
193
  let x = 0;
@@ -276,7 +306,7 @@ export default {
276
306
 
277
307
  return (d, idx) => {
278
308
  const {id, value, x} = d;
279
- const ind = $$.getIndices(indices, id);
309
+ const ind = $$.getIndices(indices, d);
280
310
  const scale = $$.getYScaleById(id, isSub);
281
311
 
282
312
  if ($$.isBarRangeType(d)) {
@@ -105,8 +105,8 @@ export default class Sparkline extends Plugin {
105
105
  const {getBarW, getIndices} = $$;
106
106
 
107
107
  // override internal methods to positioning bars
108
- $$.getIndices = function(indices, id, caller) {
109
- return caller === "getShapeX" ? {} : getIndices.call(this, indices, id);
108
+ $$.getIndices = function(indices, d, caller) {
109
+ return caller === "getShapeX" ? {} : getIndices.call(this, indices, d);
110
110
  };
111
111
 
112
112
  $$.getBarW = function(type, axis) {
@@ -143,15 +143,16 @@ export default {
143
143
  axis_x_tick_format: <Function|string|undefined> undefined,
144
144
 
145
145
  /**
146
- * Setting for culling ticks.<br><br>
147
- * If true is set, the ticks will be culled, then only limitted tick text will be shown. This option does not hide the tick lines. If false is set, all of ticks will be shown.<br><br>
148
- * We can change the number of ticks to be shown by axis.x.tick.culling.max.
146
+ * Setting for culling ticks.
147
+ * - `true`: the ticks will be culled, then only limited tick text will be shown.<br>
148
+ * This option does not hide the tick lines by default, if want to hide tick lines, set `axis.x.tick.culling.lines=false`.
149
+ * - `false`: all of ticks will be shown.<br><br>
150
+ * The number of ticks to be shown can be chaned by `axis.x.tick.culling.max`.
149
151
  * @name axis․x․tick․culling
150
152
  * @memberof Options
151
153
  * @type {boolean}
152
154
  * @default
153
- * - true for indexed axis and timeseries axis
154
- * - false for category axis
155
+ * `true` for indexed axis and timeseries axis, `false` for category axis
155
156
  * @example
156
157
  * axis: {
157
158
  * x: {
@@ -182,6 +183,25 @@ export default {
182
183
  */
183
184
  axis_x_tick_culling_max: 10,
184
185
 
186
+ /**
187
+ * Control visibility of tick lines within culling option, along with tick text.
188
+ * @name axis․x․tick․culling․lines
189
+ * @memberof Options
190
+ * @type {boolean}
191
+ * @default true
192
+ * @example
193
+ * axis: {
194
+ * x: {
195
+ * tick: {
196
+ * culling: {
197
+ * lines: false,
198
+ * }
199
+ * }
200
+ * }
201
+ * }
202
+ */
203
+ axis_x_tick_culling_lines: true,
204
+
185
205
  /**
186
206
  * The number of x axis ticks to show.<br><br>
187
207
  * 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).
@@ -187,9 +187,11 @@ export default {
187
187
  axis_y_tick_format: <Function|undefined> undefined,
188
188
 
189
189
  /**
190
- * Setting for culling ticks.<br><br>
191
- * If true is set, the ticks will be culled, then only limitted tick text will be shown. This option does not hide the tick lines. If false is set, all of ticks will be shown.<br><br>
192
- * We can change the number of ticks to be shown by axis.y.tick.culling.max.
190
+ * Setting for culling ticks.
191
+ * - `true`: the ticks will be culled, then only limited tick text will be shown.<br>
192
+ * This option does not hide the tick lines by default, if want to hide tick lines, set `axis.y.tick.culling.lines=false`.
193
+ * - `false`: all of ticks will be shown.<br><br>
194
+ * The number of ticks to be shown can be chaned by `axis.y.tick.culling.max`.
193
195
  * @name axis․y․tick․culling
194
196
  * @memberof Options
195
197
  * @type {boolean}
@@ -224,6 +226,25 @@ export default {
224
226
  */
225
227
  axis_y_tick_culling_max: 5,
226
228
 
229
+ /**
230
+ * Control visibility of tick lines within culling option, along with tick text.
231
+ * @name axis․y․tick․culling․lines
232
+ * @memberof Options
233
+ * @type {boolean}
234
+ * @default true
235
+ * @example
236
+ * axis: {
237
+ * y: {
238
+ * tick: {
239
+ * culling: {
240
+ * lines: false,
241
+ * }
242
+ * }
243
+ * }
244
+ * }
245
+ */
246
+ axis_y_tick_culling_lines: true,
247
+
227
248
  /**
228
249
  * Show y axis outer tick.
229
250
  * @name axis․y․tick․outer
@@ -173,9 +173,11 @@ export default {
173
173
  axis_y2_tick_format: <Function|undefined> undefined,
174
174
 
175
175
  /**
176
- * Setting for culling ticks.<br><br>
177
- * If true is set, the ticks will be culled, then only limitted tick text will be shown. This option does not hide the tick lines. If false is set, all of ticks will be shown.<br><br>
178
- * We can change the number of ticks to be shown by axis.y.tick.culling.max.
176
+ * Setting for culling ticks.
177
+ * - `true`: the ticks will be culled, then only limited tick text will be shown.<br>
178
+ * This option does not hide the tick lines by default, if want to hide tick lines, set `axis.y2.tick.culling.lines=false`.
179
+ * - `false`: all of ticks will be shown.<br><br>
180
+ * The number of ticks to be shown can be chaned by `axis.y2.tick.culling.max`.
179
181
  * @name axis․y2․tick․culling
180
182
  * @memberof Options
181
183
  * @type {boolean}
@@ -210,6 +212,25 @@ export default {
210
212
  */
211
213
  axis_y2_tick_culling_max: 5,
212
214
 
215
+ /**
216
+ * Control visibility of tick lines within culling option, along with tick text.
217
+ * @name axis․y2․tick․culling․lines
218
+ * @memberof Options
219
+ * @type {boolean}
220
+ * @default true
221
+ * @example
222
+ * axis: {
223
+ * y2: {
224
+ * tick: {
225
+ * culling: {
226
+ * lines: false,
227
+ * }
228
+ * }
229
+ * }
230
+ * }
231
+ */
232
+ axis_y2_tick_culling_lines: true,
233
+
213
234
  /**
214
235
  * Show or hide y2 axis outer tick.
215
236
  * @name axis․y2․tick․outer
@@ -12,6 +12,7 @@ export default {
12
12
  * @memberof Options
13
13
  * @type {object}
14
14
  * @property {object} bar Bar object
15
+ * @property {number} [bar.indices.removeNull=false] Remove nullish data on bar indices positions.
15
16
  * @property {number} [bar.label.threshold=0] Set threshold ratio to show/hide labels.
16
17
  * @property {number} [bar.padding=0] The padding pixel value between each bar.
17
18
  * @property {number} [bar.radius] Set the radius of bar edge in pixel.
@@ -27,12 +28,18 @@ export default {
27
28
  * @property {number} [bar.width.dataname.ratio=0.6] Change the width of bar chart by ratio.
28
29
  * @property {number} [bar.width.dataname.max] The maximum width value for ratio.
29
30
  * @property {boolean} [bar.zerobased=true] Set if min or max value will be 0 on bar chart.
31
+ * @see [Demo: bar indices](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarIndices)
30
32
  * @see [Demo: bar padding](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarPadding)
31
33
  * @see [Demo: bar radius](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarRadius)
32
34
  * @see [Demo: bar width](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarWidth)
33
35
  * @see [Demo: bar width variant](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarWidthVariant)
34
36
  * @example
35
37
  * bar: {
38
+ * // remove nullish data on bar indices postions
39
+ * indices: {
40
+ * removeNull: true
41
+ * },
42
+ *
36
43
  * padding: 1,
37
44
  *
38
45
  * // bar radius
@@ -72,6 +79,7 @@ export default {
72
79
  * }
73
80
  */
74
81
  bar_label_threshold: 0,
82
+ bar_indices_removeNull: false,
75
83
  bar_padding: 0,
76
84
  bar_radius: <number|{ratio: number}|undefined> undefined,
77
85
  bar_radius_ratio: <number|undefined> undefined,
package/types/axis.d.ts CHANGED
@@ -197,14 +197,21 @@ export interface XTickConfiguration {
197
197
 
198
198
  /**
199
199
  * Setting for culling ticks.
200
- * If true is set, the ticks will be culled, then only limitted tick text will be shown.
201
- * This option does not hide the tick lines. If false is set, all of ticks will be shown.
200
+ * - `true`: the ticks will be culled, then only limited tick text will be shown.
201
+ * This option does not hide the tick lines by default, if want to hide tick lines, set `axis.x.tick.culling.lines=false`.
202
+ * - `false`: all of ticks will be shown.
203
+ * The number of ticks to be shown can be chaned by `axis.x.tick.culling.max`.
202
204
  */
203
205
  culling?: boolean | {
204
206
  /**
205
207
  * The number of tick texts will be adjusted to less than this value.
206
208
  */
207
209
  max?: number;
210
+
211
+ /**
212
+ * Control visibility of tick lines within culling option, along with tick text.
213
+ */
214
+ lines?: boolean;
208
215
  };
209
216
 
210
217
  /**
@@ -334,14 +341,21 @@ export interface YTickConfiguration {
334
341
 
335
342
  /**
336
343
  * Setting for culling ticks.
337
- * If true is set, the ticks will be culled, then only limitted tick text will be shown.
338
- * This option does not hide the tick lines. If false is set, all of ticks will be shown.
344
+ * - `true`: the ticks will be culled, then only limited tick text will be shown.
345
+ * This option does not hide the tick lines by default, if want to hide tick lines, set `axis.[y|y2].tick.culling.lines=false`.
346
+ * - `false`: all of ticks will be shown.
347
+ * The number of ticks to be shown can be chaned by `axis.[y|y2].tick.culling.max`.
339
348
  */
340
349
  culling?: boolean | {
341
350
  /**
342
351
  * The number of tick texts will be adjusted to less than this value.
343
352
  */
344
353
  max?: number;
354
+
355
+ /**
356
+ * Control visibility of tick lines within culling option, along with tick text.
357
+ */
358
+ lines?: boolean;
345
359
  };
346
360
 
347
361
  /**
@@ -275,31 +275,6 @@ export interface ChartOptions {
275
275
  };
276
276
 
277
277
  bar?: {
278
- /**
279
- * Change the width of bar chart. If ratio is specified, change the width of bar chart by ratio.
280
- */
281
- width?: number | {
282
- /**
283
- * Set the width of each bar by ratio
284
- */
285
- ratio: number;
286
-
287
- /**
288
- * Set max width of each bar
289
- */
290
- max?: number;
291
- } | {
292
- /**
293
- * Set the width option for specific dataset
294
- */
295
- [key: string]: number | {
296
- ratio: number;
297
- max: number;
298
- }
299
- };
300
-
301
- headers?: Array<{ [key: string]: string; }>;
302
-
303
278
  /**
304
279
  * Set threshold ratio to show/hide labels.
305
280
  */
@@ -308,14 +283,11 @@ export interface ChartOptions {
308
283
  }
309
284
 
310
285
  /**
311
- * Set if min or max value will be 0 on bar chart.
312
- */
313
- zerobased?: boolean;
314
-
315
- /**
316
- * Set space between bars in bar charts
286
+ * Remove nullish data on bar indices positions.
317
287
  */
318
- space?: number;
288
+ indices?: {
289
+ removeNull?: boolean;
290
+ }
319
291
 
320
292
  /**
321
293
  * The padding pixel value between each bar.
@@ -337,6 +309,34 @@ export interface ChartOptions {
337
309
  * The senstivity offset value for interaction boundary.
338
310
  */
339
311
  sensitivity?: number;
312
+
313
+ /**
314
+ * Change the width of bar chart. If ratio is specified, change the width of bar chart by ratio.
315
+ */
316
+ width?: number | {
317
+ /**
318
+ * Set the width of each bar by ratio
319
+ */
320
+ ratio: number;
321
+
322
+ /**
323
+ * Set max width of each bar
324
+ */
325
+ max?: number;
326
+ } | {
327
+ /**
328
+ * Set the width option for specific dataset
329
+ */
330
+ [key: string]: number | {
331
+ ratio: number;
332
+ max: number;
333
+ }
334
+ };
335
+
336
+ /**
337
+ * Set if min or max value will be 0 on bar chart.
338
+ */
339
+ zerobased?: boolean;
340
340
  };
341
341
 
342
342
  bubble?: {
@@ -3,11 +3,11 @@
3
3
  * billboard.js project is licensed under the MIT license
4
4
  */
5
5
  import {Plugin} from "../plugin";
6
- import {TabieViewOptions} from "./options";
6
+ import {TableViewOptions} from "./options";
7
7
 
8
- export default class TabieView extends Plugin {
8
+ export default class TableView extends Plugin {
9
9
  /**
10
10
  * Generate stanford diagram
11
11
  */
12
- constructor(options?: TabieViewOptions);
12
+ constructor(options?: TableViewOptions);
13
13
  }
@@ -1,4 +1,4 @@
1
- export interface TabieViewOptions {
1
+ export interface TableViewOptions {
2
2
  /**
3
3
  * Set tableview holder selector.
4
4
  * - **NOTE:** If not set, will append new holder element dynamically.