billboard.js 3.7.0-next.2 → 3.7.0

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 (38) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +78 -73
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +127 -81
  6. package/dist/billboard.pkgd.min.js +4 -4
  7. package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-sparkline.js +2 -2
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-stanford.js +3 -3
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-tableview.js +2 -2
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -2
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +49 -8
  18. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +49 -8
  19. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +50 -9
  20. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +49 -8
  21. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +49 -8
  22. package/dist/theme/datalab.css +1 -1
  23. package/dist/theme/datalab.min.css +1 -1
  24. package/dist/theme/graph.css +1 -1
  25. package/dist/theme/graph.min.css +1 -1
  26. package/dist/theme/insight.css +1 -1
  27. package/dist/theme/insight.min.css +1 -1
  28. package/dist-esm/billboard.js +60 -64
  29. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  30. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
  31. package/dist-esm/plugin/billboardjs-plugin-stanford.js +4 -4
  32. package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
  33. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
  34. package/package.json +17 -17
  35. package/src/Chart/api/selection.ts +54 -56
  36. package/src/ChartInternal/interactions/interaction.ts +2 -3
  37. package/src/ChartInternal/internals/selection.ts +8 -8
  38. package/src/Plugin/stanford/ColorScale.ts +2 -2
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.7.0-next.2
8
+ * @version 3.7.0
9
9
  */
10
10
  import { timeParse, utcParse, timeFormat, utcFormat } from 'd3-time-format';
11
11
  import { pointer, select, namespaces, selectAll } from 'd3-selection';
@@ -4621,7 +4621,7 @@ var interaction = {
4621
4621
  selectRectForSingle: function (context, eventRect, index) {
4622
4622
  var _a, _b;
4623
4623
  var $$ = this;
4624
- var config = $$.config, main = $$.$el.main;
4624
+ var config = $$.config, _c = $$.$el, main = _c.main, circle = _c.circle;
4625
4625
  var isSelectionEnabled = config.data_selection_enabled;
4626
4626
  var isSelectionGrouped = config.data_selection_grouped;
4627
4627
  var isSelectable = config.data_selection_isselectable;
@@ -4635,8 +4635,7 @@ var interaction = {
4635
4635
  }
4636
4636
  }
4637
4637
  // remove possible previous focused state
4638
- main.selectAll(".".concat($COMMON.EXPANDED, ":not(.").concat($SHAPE.shape, "-").concat(index, ")"))
4639
- .classed($COMMON.EXPANDED, false);
4638
+ !circle && main.selectAll(".".concat($COMMON.EXPANDED, ":not(.").concat($SHAPE.shape, "-").concat(index, ")")).classed($COMMON.EXPANDED, false);
4640
4639
  var shapeAtIndex = main.selectAll(".".concat($SHAPE.shape, "-").concat(index))
4641
4640
  .classed($COMMON.EXPANDED, true)
4642
4641
  .style("cursor", isSelectable ? "pointer" : null)
@@ -20473,6 +20472,51 @@ var treemap = function () { return (extendAxis([shapeTreemap], [optTreemap]), (t
20473
20472
  * Copyright (c) 2017 ~ present NAVER Corp.
20474
20473
  * billboard.js project is licensed under the MIT license
20475
20474
  */
20475
+ /**
20476
+ * Toggler function to select or unselect
20477
+ * @param {boolean} isSelection Weather select or unselect
20478
+ * @param {Array} ids Target ids
20479
+ * @param {Array} indices Indices number
20480
+ * @param {boolean} resetOther Weather reset other selected points (only for selection)
20481
+ * @private
20482
+ */
20483
+ function setSelection(isSelection, ids, indices, resetOther) {
20484
+ if (isSelection === void 0) { isSelection = false; }
20485
+ var $$ = this;
20486
+ var config = $$.config, main = $$.$el.main;
20487
+ var selectionGrouped = config.data_selection_grouped;
20488
+ var isSelectable = config.data_selection_isselectable.bind($$.api);
20489
+ if (!config.data_selection_enabled) {
20490
+ return;
20491
+ }
20492
+ main.selectAll(".".concat($SHAPE.shapes))
20493
+ .selectAll(".".concat($SHAPE.shape))
20494
+ .each(function (d) {
20495
+ var shape = select(this);
20496
+ var _a = d.data ? d.data : d, id = _a.id, index = _a.index;
20497
+ var toggle = $$.getToggle(this, d).bind($$);
20498
+ var isTargetId = selectionGrouped || !ids || ids.indexOf(id) >= 0;
20499
+ var isTargetIndex = !indices || indices.indexOf(index) >= 0;
20500
+ var isSelected = shape.classed($SELECT.SELECTED);
20501
+ // line/area selection not supported yet
20502
+ if (shape.classed($LINE.line) || shape.classed($AREA.area)) {
20503
+ return;
20504
+ }
20505
+ if (isSelection) {
20506
+ if (isTargetId && isTargetIndex && isSelectable(d) && !isSelected) {
20507
+ toggle(true, shape.classed($SELECT.SELECTED, true), d, index);
20508
+ }
20509
+ else if (isDefined(resetOther) && resetOther && isSelected) {
20510
+ toggle(false, shape.classed($SELECT.SELECTED, false), d, index);
20511
+ }
20512
+ }
20513
+ else {
20514
+ if (isTargetId && isTargetIndex && isSelectable(d) && isSelected) {
20515
+ toggle(false, shape.classed($SELECT.SELECTED, false), d, index);
20516
+ }
20517
+ }
20518
+ });
20519
+ }
20476
20520
  var apiSelection = {
20477
20521
  /**
20478
20522
  * Get selected data points.<br><br>
@@ -20527,32 +20571,7 @@ var apiSelection = {
20527
20571
  */
20528
20572
  select: function (ids, indices, resetOther) {
20529
20573
  var $$ = this.internal;
20530
- var config = $$.config, $el = $$.$el;
20531
- if (!config.data_selection_enabled) {
20532
- return;
20533
- }
20534
- $el.main.selectAll(".".concat($SHAPE.shapes))
20535
- .selectAll(".".concat($SHAPE.shape))
20536
- .each(function (d, i) {
20537
- var shape = select(this);
20538
- var id = d.data ? d.data.id : d.id;
20539
- var toggle = $$.getToggle(this, d).bind($$);
20540
- var isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0;
20541
- var isTargetIndex = !indices || indices.indexOf(i) >= 0;
20542
- var isSelected = shape.classed($SELECT.SELECTED);
20543
- // line/area selection not supported yet
20544
- if (shape.classed($LINE.line) || shape.classed($AREA.area)) {
20545
- return;
20546
- }
20547
- if (isTargetId && isTargetIndex) {
20548
- if (config.data_selection_isselectable.bind($$.api)(d) && !isSelected) {
20549
- toggle(true, shape.classed($SELECT.SELECTED, true), d, i);
20550
- }
20551
- }
20552
- else if (isDefined(resetOther) && resetOther && isSelected) {
20553
- toggle(false, shape.classed($SELECT.SELECTED, false), d, i);
20554
- }
20555
- });
20574
+ setSelection.bind($$)(true, ids, indices, resetOther);
20556
20575
  },
20557
20576
  /**
20558
20577
  * Set data points to be un-selected.
@@ -20573,30 +20592,7 @@ var apiSelection = {
20573
20592
  */
20574
20593
  unselect: function (ids, indices) {
20575
20594
  var $$ = this.internal;
20576
- var config = $$.config, $el = $$.$el;
20577
- if (!config.data_selection_enabled) {
20578
- return;
20579
- }
20580
- $el.main.selectAll(".".concat($SHAPE.shapes))
20581
- .selectAll(".".concat($SHAPE.shape))
20582
- .each(function (d, i) {
20583
- var shape = select(this);
20584
- var id = d.data ? d.data.id : d.id;
20585
- var toggle = $$.getToggle(this, d).bind($$);
20586
- var isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0;
20587
- var isTargetIndex = !indices || indices.indexOf(i) >= 0;
20588
- var isSelected = shape.classed($SELECT.SELECTED);
20589
- // line/area selection not supported yet
20590
- if (shape.classed($LINE.line) || shape.classed($AREA.area)) {
20591
- return;
20592
- }
20593
- if (isTargetId &&
20594
- isTargetIndex &&
20595
- config.data_selection_isselectable.bind($$.api)(d) &&
20596
- isSelected) {
20597
- toggle(false, shape.classed($SELECT.SELECTED, false), d, i);
20598
- }
20599
- });
20595
+ setSelection.bind($$)(false, ids, indices);
20600
20596
  }
20601
20597
  };
20602
20598
 
@@ -21046,7 +21042,7 @@ var selection = _assign(_assign({}, drag), {
21046
21042
  unselectPoint: function (target, d, i) {
21047
21043
  var $$ = this;
21048
21044
  var config = $$.config, main = $$.$el.main, $T = $$.$T;
21049
- callFn(config.data_onunselected, $$.api, d, target.node());
21045
+ callFn(config.data_onunselected, $$.api, d, target === null || target === void 0 ? void 0 : target.node());
21050
21046
  // remove selected-circle from low layer g
21051
21047
  $T(main.select(".".concat($SELECT.selectedCircles).concat($$.getTargetSelectorSuffix(d.id)))
21052
21048
  .selectAll(".".concat($SELECT.selectedCircle, "-").concat(i)))
@@ -21134,18 +21130,18 @@ var selection = _assign(_assign({}, drag), {
21134
21130
  var toggle_1 = $$.getToggle(that, d).bind($$);
21135
21131
  var toggledShape_1;
21136
21132
  if (!config.data_selection_multiple) {
21137
- var selector = ".".concat($SHAPE.shapes);
21133
+ var focusOnly = config.point_focus_only;
21134
+ var selector = ".".concat(focusOnly ? $SELECT.selectedCircles : $SHAPE.shapes);
21138
21135
  if (config.data_selection_grouped) {
21139
21136
  selector += $$.getTargetSelectorSuffix(d.id);
21140
21137
  }
21141
21138
  main.selectAll(selector)
21142
- .selectAll(".".concat($SHAPE.shape))
21143
- .each(function (d, i) {
21139
+ .selectAll(focusOnly ? ".".concat($SELECT.selectedCircle) : ".".concat($SHAPE.shape, ".").concat($SELECT.SELECTED))
21140
+ .classed($SELECT.SELECTED, false)
21141
+ .each(function (d) {
21144
21142
  var shape = select(this);
21145
- if (shape.classed($SELECT.SELECTED)) {
21146
- toggledShape_1 = shape;
21147
- toggle_1(false, shape.classed($SELECT.SELECTED, false), d, i);
21148
- }
21143
+ toggledShape_1 = shape;
21144
+ toggle_1(false, shape, d, d.index);
21149
21145
  });
21150
21146
  }
21151
21147
  if (!toggledShape_1 || toggledShape_1.node() !== shape.node()) {
@@ -22106,7 +22102,7 @@ var zoomModule = function () {
22106
22102
  var defaults = {};
22107
22103
  /**
22108
22104
  * @namespace bb
22109
- * @version 3.7.0-next.2
22105
+ * @version 3.7.0
22110
22106
  */
22111
22107
  var bb = {
22112
22108
  /**
@@ -22116,7 +22112,7 @@ var bb = {
22116
22112
  * bb.version; // "1.0.0"
22117
22113
  * @memberof bb
22118
22114
  */
22119
- version: "3.7.0-next.2",
22115
+ version: "3.7.0",
22120
22116
  /**
22121
22117
  * Generate chart
22122
22118
  * - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.7.0-next.2
8
+ * @version 3.7.0
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -104,7 +104,7 @@ var Plugin = /** @class */ (function () {
104
104
  delete _this[key];
105
105
  });
106
106
  };
107
- Plugin.version = "3.7.0-next.2";
107
+ Plugin.version = "3.7.0";
108
108
  return Plugin;
109
109
  }());
110
110
  var Plugin$1 = Plugin;
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.7.0-next.2
8
+ * @version 3.7.0
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -278,7 +278,7 @@ var Plugin = /** @class */ (function () {
278
278
  delete _this[key];
279
279
  });
280
280
  };
281
- Plugin.version = "3.7.0-next.2";
281
+ Plugin.version = "3.7.0";
282
282
  return Plugin;
283
283
  }());
284
284
  var Plugin$1 = Plugin;
@@ -5,13 +5,13 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.7.0-next.2
8
+ * @version 3.7.0
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
12
12
  import { interpolateHslLong } from 'd3-interpolate';
13
13
  import { hsl } from 'd3-color';
14
- import { scaleSequential, scaleLog, scaleSequentialLog } from 'd3-scale';
14
+ import { scaleSequential, scaleSymlog, scaleSequentialLog } from 'd3-scale';
15
15
  import { axisRight } from 'd3-axis';
16
16
  import { format } from 'd3-format';
17
17
 
@@ -486,7 +486,7 @@ var Plugin = /** @class */ (function () {
486
486
  delete _this[key];
487
487
  });
488
488
  };
489
- Plugin.version = "3.7.0-next.2";
489
+ Plugin.version = "3.7.0";
490
490
  return Plugin;
491
491
  }());
492
492
  var Plugin$1 = Plugin;
@@ -920,7 +920,7 @@ var ColorScale = /** @class */ (function () {
920
920
  .attr("height", barHeight)
921
921
  .attr("fill", function (d) { return inverseScale(d); });
922
922
  // Legend Axis
923
- var axisScale = scaleLog()
923
+ var axisScale = scaleSymlog()
924
924
  .domain([target.minEpochs, target.maxEpochs])
925
925
  .range([
926
926
  points[0] + config.padding_top + points[points.length - 1] + barHeight - 1,
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.7.0-next.2
8
+ * @version 3.7.0
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -121,7 +121,7 @@ var Plugin = /** @class */ (function () {
121
121
  delete _this[key];
122
122
  });
123
123
  };
124
- Plugin.version = "3.7.0-next.2";
124
+ Plugin.version = "3.7.0";
125
125
  return Plugin;
126
126
  }());
127
127
  var Plugin$1 = Plugin;
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.7.0-next.2
8
+ * @version 3.7.0
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -263,7 +263,7 @@ var Plugin = /** @class */ (function () {
263
263
  delete _this[key];
264
264
  });
265
265
  };
266
- Plugin.version = "3.7.0-next.2";
266
+ Plugin.version = "3.7.0";
267
267
  return Plugin;
268
268
  }());
269
269
  var Plugin$1 = Plugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "billboard.js",
3
- "version": "3.7.0-next.2",
3
+ "version": "3.7.0",
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",
@@ -84,8 +84,8 @@
84
84
  "license": "MIT",
85
85
  "readmeFilename": "README.md",
86
86
  "dependencies": {
87
- "@types/d3-selection": "^3.0.3",
88
- "@types/d3-transition": "^3.0.2",
87
+ "@types/d3-selection": "^3.0.4",
88
+ "@types/d3-transition": "^3.0.3",
89
89
  "d3-axis": "^3.0.0",
90
90
  "d3-brush": "^3.0.0",
91
91
  "d3-drag": "^3.0.0",
@@ -101,7 +101,7 @@
101
101
  "d3-zoom": "^3.0.0"
102
102
  },
103
103
  "devDependencies": {
104
- "@babel/core": "^7.20.7",
104
+ "@babel/core": "^7.20.12",
105
105
  "@babel/eslint-parser": "^7.19.1",
106
106
  "@babel/plugin-proposal-class-properties": "^7.18.6",
107
107
  "@babel/plugin-proposal-object-rest-spread": "^7.20.7",
@@ -109,12 +109,12 @@
109
109
  "@babel/preset-env": "^7.20.2",
110
110
  "@babel/preset-typescript": "^7.18.6",
111
111
  "@babel/runtime": "^7.20.7",
112
- "@commitlint/cli": "17.3.0",
113
- "@commitlint/config-conventional": "^17.3.0",
112
+ "@commitlint/cli": "17.4.1",
113
+ "@commitlint/config-conventional": "^17.4.0",
114
114
  "@rollup/plugin-babel": "^6.0.3",
115
115
  "@rollup/plugin-node-resolve": "^15.0.0",
116
116
  "@rollup/plugin-replace": "^5.0.2",
117
- "@rollup/plugin-typescript": "^10.0.1",
117
+ "@rollup/plugin-typescript": "^11.0.0",
118
118
  "@semantic-release/changelog": "^6.0.2",
119
119
  "@semantic-release/commit-analyzer": "^9.0.2",
120
120
  "@semantic-release/exec": "^6.0.3",
@@ -125,10 +125,10 @@
125
125
  "@types/d3": "^7.4.0",
126
126
  "@types/mocha": "^10.0.1",
127
127
  "@types/sinon": "^10.0.13",
128
- "@typescript-eslint/eslint-plugin": "^5.47.1",
129
- "@typescript-eslint/parser": "^5.47.1",
128
+ "@typescript-eslint/eslint-plugin": "^5.48.1",
129
+ "@typescript-eslint/parser": "^5.48.1",
130
130
  "babel-helper-modules": "^6.0.0",
131
- "babel-loader": "^9.1.0",
131
+ "babel-loader": "^9.1.2",
132
132
  "babel-plugin-add-module-exports": "^1.0.4",
133
133
  "babel-plugin-minify-constant-folding": "^0.5.0",
134
134
  "babel-plugin-minify-dead-code-elimination": "^0.5.2",
@@ -141,8 +141,8 @@
141
141
  "better-docs": "^2.7.2",
142
142
  "chai": "^4.3.7",
143
143
  "clean-webpack-plugin": "^4.0.0",
144
- "cloc": "^2.10.0",
145
- "core-js": "^3.27.0",
144
+ "cloc": "^2.11.0",
145
+ "core-js": "^3.27.1",
146
146
  "coveralls": "^3.1.1",
147
147
  "cross-env": "^7.0.3",
148
148
  "css-loader": "^6.7.3",
@@ -151,16 +151,16 @@
151
151
  "d3-delaunay": "^6.0.2",
152
152
  "d3-format": "^3.1.0",
153
153
  "d3-polygon": "^3.0.1",
154
- "docdash": "^2.0.0",
154
+ "docdash": "^2.0.1",
155
155
  "dtslint": "^4.2.1",
156
- "eslint": "^8.30.0",
156
+ "eslint": "^8.31.0",
157
157
  "eslint-config-naver": "^2.1.0",
158
158
  "eslint-plugin-import": "^2.26.0",
159
159
  "eslint-plugin-jsdoc": "^39.6.4",
160
160
  "eslint-webpack-plugin": "^3.2.0",
161
161
  "exports-loader": "^4.0.0",
162
162
  "hammer-simulator": "0.0.1",
163
- "husky": "^8.0.2",
163
+ "husky": "^8.0.3",
164
164
  "istanbul-instrumenter-loader": "^3.0.1",
165
165
  "istanbul-lib-instrument": "^5.2.1",
166
166
  "jsdoc": "^4.0.0",
@@ -180,10 +180,10 @@
180
180
  "mocha": "^10.2.0",
181
181
  "node-sass": "^8.0.0",
182
182
  "regenerator-runtime": "^0.13.11",
183
- "rollup": "^3.9.0",
183
+ "rollup": "^3.9.1",
184
184
  "rollup-plugin-delete": "^2.0.0",
185
185
  "sass-loader": "^13.2.0",
186
- "semantic-release": "^19.0.5",
186
+ "semantic-release": "^20.0.2",
187
187
  "simulant": "^0.2.2",
188
188
  "sinon": "^15.0.1",
189
189
  "string-replace-loader": "^3.1.0",
@@ -7,6 +7,58 @@ import {isDefined} from "../../module/util";
7
7
  import {$AREA, $LINE, $SELECT, $SHAPE} from "../../config/classes";
8
8
  import type {DataItem} from "../../../types/types";
9
9
 
10
+ /**
11
+ * Toggler function to select or unselect
12
+ * @param {boolean} isSelection Weather select or unselect
13
+ * @param {Array} ids Target ids
14
+ * @param {Array} indices Indices number
15
+ * @param {boolean} resetOther Weather reset other selected points (only for selection)
16
+ * @private
17
+ */
18
+ function setSelection(
19
+ isSelection = false,
20
+ ids?: string | string[],
21
+ indices?: number[],
22
+ resetOther?: boolean
23
+ ): void {
24
+ const $$ = this;
25
+ const {config, $el: {main}} = $$;
26
+ const selectionGrouped = config.data_selection_grouped;
27
+ const isSelectable = config.data_selection_isselectable.bind($$.api);
28
+
29
+ if (!config.data_selection_enabled) {
30
+ return;
31
+ }
32
+
33
+ main.selectAll(`.${$SHAPE.shapes}`)
34
+ .selectAll(`.${$SHAPE.shape}`)
35
+ .each(function(d) {
36
+ const shape = d3Select(this);
37
+ const {id, index} = d.data ? d.data : d;
38
+ const toggle = $$.getToggle(this, d).bind($$);
39
+ const isTargetId = selectionGrouped || !ids || ids.indexOf(id) >= 0;
40
+ const isTargetIndex = !indices || indices.indexOf(index) >= 0;
41
+ const isSelected = shape.classed($SELECT.SELECTED);
42
+
43
+ // line/area selection not supported yet
44
+ if (shape.classed($LINE.line) || shape.classed($AREA.area)) {
45
+ return;
46
+ }
47
+
48
+ if (isSelection) {
49
+ if (isTargetId && isTargetIndex && isSelectable(d) && !isSelected) {
50
+ toggle(true, shape.classed($SELECT.SELECTED, true), d, index);
51
+ } else if (isDefined(resetOther) && resetOther && isSelected) {
52
+ toggle(false, shape.classed($SELECT.SELECTED, false), d, index);
53
+ }
54
+ } else {
55
+ if (isTargetId && isTargetIndex && isSelectable(d) && isSelected) {
56
+ toggle(false, shape.classed($SELECT.SELECTED, false), d, index);
57
+ }
58
+ }
59
+ });
60
+ }
61
+
10
62
  export default {
11
63
  /**
12
64
  * Get selected data points.<br><br>
@@ -64,35 +116,8 @@ export default {
64
116
  */
65
117
  select(ids?: string[] | string, indices?: number[], resetOther?: boolean): void {
66
118
  const $$ = this.internal;
67
- const {config, $el} = $$;
68
-
69
- if (!config.data_selection_enabled) {
70
- return;
71
- }
72
119
 
73
- $el.main.selectAll(`.${$SHAPE.shapes}`)
74
- .selectAll(`.${$SHAPE.shape}`)
75
- .each(function(d, i) {
76
- const shape = d3Select(this);
77
- const id = d.data ? d.data.id : d.id;
78
- const toggle = $$.getToggle(this, d).bind($$);
79
- const isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0;
80
- const isTargetIndex = !indices || indices.indexOf(i) >= 0;
81
- const isSelected = shape.classed($SELECT.SELECTED);
82
-
83
- // line/area selection not supported yet
84
- if (shape.classed($LINE.line) || shape.classed($AREA.area)) {
85
- return;
86
- }
87
-
88
- if (isTargetId && isTargetIndex) {
89
- if (config.data_selection_isselectable.bind($$.api)(d) && !isSelected) {
90
- toggle(true, shape.classed($SELECT.SELECTED, true), d, i);
91
- }
92
- } else if (isDefined(resetOther) && resetOther && isSelected) {
93
- toggle(false, shape.classed($SELECT.SELECTED, false), d, i);
94
- }
95
- });
120
+ setSelection.bind($$)(true, ids, indices, resetOther);
96
121
  },
97
122
 
98
123
  /**
@@ -114,34 +139,7 @@ export default {
114
139
  */
115
140
  unselect(ids?: string | string[], indices?: number[]): void {
116
141
  const $$ = this.internal;
117
- const {config, $el} = $$;
118
142
 
119
- if (!config.data_selection_enabled) {
120
- return;
121
- }
122
-
123
- $el.main.selectAll(`.${$SHAPE.shapes}`)
124
- .selectAll(`.${$SHAPE.shape}`)
125
- .each(function(d, i) {
126
- const shape = d3Select(this);
127
- const id = d.data ? d.data.id : d.id;
128
- const toggle = $$.getToggle(this, d).bind($$);
129
- const isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0;
130
- const isTargetIndex = !indices || indices.indexOf(i) >= 0;
131
- const isSelected = shape.classed($SELECT.SELECTED);
132
-
133
- // line/area selection not supported yet
134
- if (shape.classed($LINE.line) || shape.classed($AREA.area)) {
135
- return;
136
- }
137
-
138
- if (isTargetId &&
139
- isTargetIndex &&
140
- config.data_selection_isselectable.bind($$.api)(d) &&
141
- isSelected
142
- ) {
143
- toggle(false, shape.classed($SELECT.SELECTED, false), d, i);
144
- }
145
- });
143
+ setSelection.bind($$)(false, ids, indices);
146
144
  }
147
145
  };
@@ -12,7 +12,7 @@ import type {IArcDataRow} from "../data/IData";
12
12
  export default {
13
13
  selectRectForSingle(context, eventRect, index: number): void {
14
14
  const $$ = this;
15
- const {config, $el: {main}} = $$;
15
+ const {config, $el: {main, circle}} = $$;
16
16
  const isSelectionEnabled = config.data_selection_enabled;
17
17
  const isSelectionGrouped = config.data_selection_grouped;
18
18
  const isSelectable = config.data_selection_isselectable;
@@ -29,8 +29,7 @@ export default {
29
29
  }
30
30
 
31
31
  // remove possible previous focused state
32
- main.selectAll(`.${$COMMON.EXPANDED}:not(.${$SHAPE.shape}-${index})`)
33
- .classed($COMMON.EXPANDED, false);
32
+ !circle && main.selectAll(`.${$COMMON.EXPANDED}:not(.${$SHAPE.shape}-${index})`).classed($COMMON.EXPANDED, false);
34
33
 
35
34
  const shapeAtIndex = main.selectAll(`.${$SHAPE.shape}-${index}`)
36
35
  .classed($COMMON.EXPANDED, true)
@@ -52,7 +52,7 @@ export default {
52
52
  const $$ = this;
53
53
  const {config, $el: {main}, $T} = $$;
54
54
 
55
- callFn(config.data_onunselected, $$.api, d, target.node());
55
+ callFn(config.data_onunselected, $$.api, d, target?.node());
56
56
 
57
57
  // remove selected-circle from low layer g
58
58
  $T(main.select(`.${$SELECT.selectedCircles}${$$.getTargetSelectorSuffix(d.id)}`)
@@ -160,21 +160,21 @@ export default {
160
160
  let toggledShape;
161
161
 
162
162
  if (!config.data_selection_multiple) {
163
- let selector = `.${$SHAPE.shapes}`;
163
+ const focusOnly = config.point_focus_only;
164
+ let selector = `.${focusOnly ? $SELECT.selectedCircles : $SHAPE.shapes}`;
164
165
 
165
166
  if (config.data_selection_grouped) {
166
167
  selector += $$.getTargetSelectorSuffix(d.id);
167
168
  }
168
169
 
169
170
  main.selectAll(selector)
170
- .selectAll(`.${$SHAPE.shape}`)
171
- .each(function(d, i) {
171
+ .selectAll(focusOnly ? `.${$SELECT.selectedCircle}` : `.${$SHAPE.shape}.${$SELECT.SELECTED}`)
172
+ .classed($SELECT.SELECTED, false)
173
+ .each(function(d) {
172
174
  const shape = d3Select(this);
173
175
 
174
- if (shape.classed($SELECT.SELECTED)) {
175
- toggledShape = shape;
176
- toggle(false, shape.classed($SELECT.SELECTED, false), d, i);
177
- }
176
+ toggledShape = shape;
177
+ toggle(false, shape, d, d.index);
178
178
  });
179
179
  }
180
180
 
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import {axisRight as d3AxisRight} from "d3-axis";
6
6
  import {format as d3Format} from "d3-format";
7
- import {scaleSequential as d3ScaleSequential, scaleLog as d3ScaleLog} from "d3-scale";
7
+ import {scaleSequential as d3ScaleSequential, scaleSymlog as d3ScaleSymlog} from "d3-scale";
8
8
  import CLASS from "./classes";
9
9
  import {isFunction, getRange} from "./util";
10
10
 
@@ -55,7 +55,7 @@ export default class ColorScale {
55
55
  .attr("fill", d => inverseScale(d));
56
56
 
57
57
  // Legend Axis
58
- const axisScale = d3ScaleLog()
58
+ const axisScale = d3ScaleSymlog()
59
59
  .domain([target.minEpochs, target.maxEpochs])
60
60
  .range([
61
61
  points[0] + config.padding_top + points[points.length - 1] + barHeight - 1,