billboard.js 3.3.0 → 3.3.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 (72) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +424 -374
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +2284 -2200
  6. package/dist/billboard.pkgd.min.js +2 -2
  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 +137 -92
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-stanford.js +138 -93
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-tableview.js +3 -119
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +3 -119
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +1862 -1828
  18. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +1998 -1919
  19. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +2000 -1921
  20. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +1866 -1948
  21. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +1866 -1948
  22. package/dist/theme/datalab.css +1 -1
  23. package/dist/theme/datalab.min.css +2 -2
  24. package/dist/theme/graph.css +1 -1
  25. package/dist/theme/graph.min.css +2 -2
  26. package/dist/theme/insight.css +1 -1
  27. package/dist/theme/insight.min.css +2 -2
  28. package/dist-esm/billboard.js +426 -383
  29. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -4
  30. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +129 -77
  31. package/dist-esm/plugin/billboardjs-plugin-stanford.js +135 -80
  32. package/dist-esm/plugin/billboardjs-plugin-tableview.js +4 -8
  33. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +4 -7
  34. package/package.json +15 -15
  35. package/src/Chart/api/focus.ts +8 -8
  36. package/src/Chart/api/regions.ts +3 -3
  37. package/src/Chart/api/selection.ts +15 -15
  38. package/src/Chart/api/subchart.ts +3 -3
  39. package/src/ChartInternal/Axis/Axis.ts +13 -12
  40. package/src/ChartInternal/ChartInternal.ts +5 -6
  41. package/src/ChartInternal/data/data.ts +3 -3
  42. package/src/ChartInternal/data/load.ts +2 -2
  43. package/src/ChartInternal/interactions/drag.ts +15 -15
  44. package/src/ChartInternal/interactions/eventrect.ts +18 -18
  45. package/src/ChartInternal/interactions/interaction.ts +10 -10
  46. package/src/ChartInternal/interactions/zoom.ts +4 -4
  47. package/src/ChartInternal/internals/color.ts +4 -4
  48. package/src/ChartInternal/internals/domain.ts +1 -1
  49. package/src/ChartInternal/internals/grid.ts +32 -32
  50. package/src/ChartInternal/internals/legend.ts +27 -27
  51. package/src/ChartInternal/internals/redraw.ts +3 -3
  52. package/src/ChartInternal/internals/region.ts +3 -3
  53. package/src/ChartInternal/internals/selection.ts +16 -15
  54. package/src/ChartInternal/internals/size.ts +3 -3
  55. package/src/ChartInternal/internals/text.ts +8 -8
  56. package/src/ChartInternal/internals/title.ts +4 -4
  57. package/src/ChartInternal/internals/tooltip.ts +5 -5
  58. package/src/ChartInternal/internals/transform.ts +5 -5
  59. package/src/ChartInternal/shape/arc.ts +22 -22
  60. package/src/ChartInternal/shape/area.ts +4 -4
  61. package/src/ChartInternal/shape/bar.ts +7 -7
  62. package/src/ChartInternal/shape/candlestick.ts +8 -8
  63. package/src/ChartInternal/shape/gauge.ts +8 -8
  64. package/src/ChartInternal/shape/line.ts +7 -7
  65. package/src/ChartInternal/shape/point.ts +18 -18
  66. package/src/ChartInternal/shape/radar.ts +10 -10
  67. package/src/ChartInternal/shape/shape.ts +4 -2
  68. package/src/Plugin/sparkline/index.ts +2 -2
  69. package/src/Plugin/stanford/index.ts +3 -3
  70. package/src/Plugin/stanford/util.ts +0 -1
  71. package/src/config/classes.ts +154 -66
  72. package/src/module/util.ts +1 -2
@@ -4,15 +4,15 @@
4
4
  */
5
5
  import {line as d3Line} from "d3-shape";
6
6
  import {getScale} from "../internals/scale";
7
- import CLASS from "../../config/classes";
7
+ import {$COMMON, $LINE} from "../../config/classes";
8
8
  import {getPointer, getRandom, isArray, isDefined, isUndefined, isValue, parseDate} from "../../module/util";
9
9
 
10
10
  export default {
11
11
  initLine(): void {
12
12
  const {$el} = this;
13
13
 
14
- $el.line = $el.main.select(`.${CLASS.chart}`).append("g")
15
- .attr("class", CLASS.chartLines);
14
+ $el.line = $el.main.select(`.${$COMMON.chart}`).append("g")
15
+ .attr("class", $LINE.chartLines);
16
16
  },
17
17
 
18
18
  updateTargetsForLine(t): void {
@@ -28,8 +28,8 @@ export default {
28
28
 
29
29
  const targets = t.filter(d => !($$.isScatterType(d) || $$.isBubbleType(d)));
30
30
 
31
- const mainLineUpdate = main.select(`.${CLASS.chartLines}`)
32
- .selectAll(`.${CLASS.chartLine}`)
31
+ const mainLineUpdate = main.select(`.${$LINE.chartLines}`)
32
+ .selectAll(`.${$LINE.chartLine}`)
33
33
  .data(targets)
34
34
  .attr("class", d => classChartLine(d) + classFocus(d));
35
35
 
@@ -62,8 +62,8 @@ export default {
62
62
  const $root = isSub ? $el.subchart : $el;
63
63
 
64
64
  const line = $root.main
65
- .selectAll(`.${CLASS.lines}`)
66
- .selectAll(`.${CLASS.line}`)
65
+ .selectAll(`.${$LINE.lines}`)
66
+ .selectAll(`.${$LINE.line}`)
67
67
  .data($$.lineData.bind($$));
68
68
 
69
69
  $T(line.exit(), withTransition)
@@ -7,7 +7,7 @@ import {
7
7
  select as d3Select
8
8
  } from "d3-selection";
9
9
  import {d3Selection} from "../../../types/types";
10
- import CLASS from "../../config/classes";
10
+ import {$CIRCLE, $COMMON, $SELECT} from "../../config/classes";
11
11
  import {document} from "../../module/browser";
12
12
  import {getBoundingRect, getPointer, getRandom, isFunction, isObject, isObjectType, isUndefined, isValue, toArray, notEmpty} from "../../module/util";
13
13
 
@@ -58,10 +58,10 @@ export default {
58
58
 
59
59
  $$.point = $$.generatePoint();
60
60
 
61
- if (($$.hasType("bubble") || $$.hasType("scatter")) && main.select(`.${CLASS.chartCircles}`).empty()) {
62
- main.select(`.${CLASS.chart}`)
61
+ if (($$.hasType("bubble") || $$.hasType("scatter")) && main.select(`.${$CIRCLE.chartCircles}`).empty()) {
62
+ main.select(`.${$COMMON.chart}`)
63
63
  .append("g")
64
- .attr("class", CLASS.chartCircles);
64
+ .attr("class", $CIRCLE.chartCircles);
65
65
  }
66
66
  },
67
67
 
@@ -86,9 +86,9 @@ export default {
86
86
  targets = (data.targets)
87
87
  .filter(d => this.isScatterType(d) || this.isBubbleType(d));
88
88
 
89
- const mainCircle = $el.main.select(`.${CLASS.chartCircles}`)
89
+ const mainCircle = $el.main.select(`.${$CIRCLE.chartCircles}`)
90
90
  .style("pointer-events", "none")
91
- .selectAll(`.${CLASS.circles}`)
91
+ .selectAll(`.${$CIRCLE.circles}`)
92
92
  .data(targets)
93
93
  .attr("class", classCircles);
94
94
 
@@ -98,7 +98,7 @@ export default {
98
98
 
99
99
  // Circles for each data point on lines
100
100
  selectionEnabled && enterNode.append("g")
101
- .attr("class", d => $$.generateClass(CLASS.selectedCircles, d.id));
101
+ .attr("class", d => $$.generateClass($SELECT.selectedCircles, d.id));
102
102
 
103
103
  enterNode.append("g")
104
104
  .attr("class", classCircles)
@@ -106,8 +106,8 @@ export default {
106
106
 
107
107
  // Update date for selected circles
108
108
  selectionEnabled && targets.forEach(t => {
109
- $el.main.selectAll(`.${CLASS.selectedCircles}${$$.getTargetSelectorSuffix(t.id)}`)
110
- .selectAll(`${CLASS.selectedCircle}`)
109
+ $el.main.selectAll(`.${$SELECT.selectedCircles}${$$.getTargetSelectorSuffix(t.id)}`)
110
+ .selectAll(`${$SELECT.selectedCircle}`)
111
111
  .each(d => {
112
112
  d.value = t.values[d.index].value;
113
113
  });
@@ -121,8 +121,8 @@ export default {
121
121
  const $root = isSub ? $el.subchart : $el;
122
122
 
123
123
  if (config.point_show && !state.toggling) {
124
- const circles = $root.main.selectAll(`.${CLASS.circles}`)
125
- .selectAll(`.${CLASS.circle}`)
124
+ const circles = $root.main.selectAll(`.${$CIRCLE.circles}`)
125
+ .selectAll(`.${$CIRCLE.circle}`)
126
126
  .data(d => (
127
127
  ($$.isLineType(d) && $$.shouldDrawPointsForLine(d)) ||
128
128
  $$.isBubbleType(d) || $$.isRadarType(d) || $$.isScatterType(d) ?
@@ -135,7 +135,7 @@ export default {
135
135
  .filter(Boolean)
136
136
  .append($$.point("create", this, $$.pointR.bind($$), $$.color));
137
137
 
138
- $root.circle = $root.main.selectAll(`.${CLASS.circles} .${CLASS.circle}`)
138
+ $root.circle = $root.main.selectAll(`.${$CIRCLE.circles} .${$CIRCLE.circle}`)
139
139
  .style("stroke", $$.color)
140
140
  .style("opacity", $$.initialOpacityForCircle.bind($$));
141
141
  }
@@ -145,7 +145,7 @@ export default {
145
145
  const $$ = this;
146
146
  const {state: {rendered}, $el, $T} = $$;
147
147
  const $root = isSub ? $el.subchart : $el;
148
- const selectedCircles = $root.main.selectAll(`.${CLASS.selectedCircle}`);
148
+ const selectedCircles = $root.main.selectAll(`.${$SELECT.selectedCircle}`);
149
149
 
150
150
  if (!$$.config.point_show) {
151
151
  return [];
@@ -256,7 +256,7 @@ export default {
256
256
 
257
257
  reset && $$.unexpandCircles();
258
258
 
259
- const circles = $$.getShapeByIndex("circle", i, id).classed(CLASS.EXPANDED, true);
259
+ const circles = $$.getShapeByIndex("circle", i, id).classed($COMMON.EXPANDED, true);
260
260
  const scale = r(circles) / $$.config.point_r;
261
261
  const ratio = 1 - scale;
262
262
 
@@ -286,9 +286,9 @@ export default {
286
286
 
287
287
  const circles = $$.getShapeByIndex("circle", i)
288
288
  .filter(function() {
289
- return d3Select(this).classed(CLASS.EXPANDED);
289
+ return d3Select(this).classed($COMMON.EXPANDED);
290
290
  })
291
- .classed(CLASS.EXPANDED, false);
291
+ .classed($COMMON.EXPANDED, false);
292
292
 
293
293
  circles.attr("r", r);
294
294
 
@@ -398,8 +398,8 @@ export default {
398
398
  circle.each(function(d) {
399
399
  let className = $$.getClass("circle", true)(d);
400
400
 
401
- if (this.getAttribute("class").indexOf(CLASS.EXPANDED) > -1) {
402
- className += ` ${CLASS.EXPANDED}`;
401
+ if (this.getAttribute("class").indexOf($COMMON.EXPANDED) > -1) {
402
+ className += ` ${$COMMON.EXPANDED}`;
403
403
  }
404
404
 
405
405
  this.setAttribute("class", className);
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import {select as d3Select} from "d3-selection";
6
6
  import {KEY} from "../../module/Cache";
7
- import CLASS from "../../config/classes";
7
+ import {$AXIS, $COMMON, $RADAR, $SHAPE, $TEXT} from "../../config/classes";
8
8
  import {getMinMax, getRange, isDefined, isEmpty, isNumber, isUndefined, setTextValue, toArray} from "../../module/util";
9
9
 
10
10
  /**
@@ -35,20 +35,20 @@ export default {
35
35
  const {config, state: {current}, $el} = $$;
36
36
 
37
37
  if ($$.hasType("radar")) {
38
- $el.radar = $el.main.select(`.${CLASS.chart}`).append("g")
39
- .attr("class", CLASS.chartRadars);
38
+ $el.radar = $el.main.select(`.${$COMMON.chart}`).append("g")
39
+ .attr("class", $RADAR.chartRadars);
40
40
 
41
41
  // level
42
42
  $el.radar.levels = $el.radar.append("g")
43
- .attr("class", CLASS.levels);
43
+ .attr("class", $RADAR.levels);
44
44
 
45
45
  // axis
46
46
  $el.radar.axes = $el.radar.append("g")
47
- .attr("class", CLASS.axis);
47
+ .attr("class", $AXIS.axis);
48
48
 
49
49
  // shapes
50
50
  $el.radar.shapes = $el.radar.append("g")
51
- .attr("class", CLASS.shapes);
51
+ .attr("class", $SHAPE.shapes);
52
52
 
53
53
  current.dataMax = config.radar_axis_max || $$.getMinMaxData().max[0].value;
54
54
  }
@@ -126,7 +126,7 @@ export default {
126
126
  // Adjust radar, circles and texts' position
127
127
  if (translate) {
128
128
  radar.attr("transform", translate);
129
- main.select(`.${CLASS.chartTexts}`).attr("transform", translate);
129
+ main.select(`.${$TEXT.chartTexts}`).attr("transform", translate);
130
130
 
131
131
  $$.generateRadarPoints();
132
132
  $$.updateRadarLevel();
@@ -176,13 +176,13 @@ export default {
176
176
  });
177
177
 
178
178
  const level = radarLevels
179
- .selectAll(`.${CLASS.level}`)
179
+ .selectAll(`.${$RADAR.level}`)
180
180
  .data(levelData);
181
181
 
182
182
  level.exit().remove();
183
183
 
184
184
  const levelEnter = level.enter().append("g")
185
- .attr("class", (d, i) => `${CLASS.level} ${CLASS.level}-${i}`);
185
+ .attr("class", (d, i) => `${$RADAR.level} ${$RADAR.level}-${i}`);
186
186
 
187
187
  levelEnter.append("polygon")
188
188
  .style("visibility", config.radar_level_show ? null : "hidden");
@@ -231,7 +231,7 @@ export default {
231
231
  axis.exit().remove();
232
232
 
233
233
  const axisEnter = axis.enter().append("g")
234
- .attr("class", (d, i) => `${CLASS.axis}-${i}`);
234
+ .attr("class", (d, i) => `${$AXIS.axis}-${i}`);
235
235
 
236
236
  config.radar_axis_line_show && axisEnter.append("line");
237
237
  config.radar_axis_text_show && axisEnter.append("text");
@@ -251,10 +251,12 @@ export default {
251
251
  */
252
252
  getShapeYMin(id: string): number {
253
253
  const $$ = this;
254
- const scale = $$.scale[$$.axis.getId(id)];
254
+ const axisId = $$.axis.getId(id);
255
+ const scale = $$.scale[axisId];
255
256
  const [yMin] = scale.domain();
257
+ const inverted = $$.config[`axis_${axisId}_inverted`];
256
258
 
257
- return !$$.isGrouped(id) && yMin > 0 ? yMin : 0;
259
+ return !$$.isGrouped(id) && !inverted && yMin > 0 ? yMin : 0;
258
260
  },
259
261
 
260
262
  /**
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2021 ~ present NAVER Corp.
3
3
  * billboard.js project is licensed under the MIT license
4
4
  */
5
- import CLASS from "../../config/classes";
5
+ import {$COMMON} from "../../config/classes";
6
6
  import Plugin from "../Plugin";
7
7
  import Options from "./Options";
8
8
  import {IData} from "../../ChartInternal/data/IData";
@@ -244,7 +244,7 @@ export default class Sparkline extends Plugin {
244
244
 
245
245
  data.map(v => v.id)
246
246
  .forEach((id, i) => {
247
- const selector = `.${CLASS.target}-${id}`;
247
+ const selector = `.${$COMMON.target}-${id}`;
248
248
  const shape = $el.main.selectAll(selector);
249
249
  let svg = el[i].querySelector("svg");
250
250
 
@@ -6,7 +6,7 @@
6
6
  import {interpolateHslLong as d3InterpolateHslLong} from "d3-interpolate";
7
7
  import {hsl as d3Hsl} from "d3-color";
8
8
  import {scaleSequentialLog as d3ScaleSequentialLog} from "d3-scale";
9
- import CLASS from "../../config/classes";
9
+ import {$TOOLTIP} from "../../config/classes";
10
10
  import {loadConfig} from "../../config/config";
11
11
  import Plugin from "../Plugin";
12
12
  import Options from "./Options";
@@ -228,7 +228,7 @@ export default class Stanford extends Plugin {
228
228
 
229
229
  if (isEmpty(config.tooltip_contents)) {
230
230
  config.tooltip_contents = function(d, defaultTitleFormat, defaultValueFormat, color) {
231
- let html = `<table class="${CLASS.tooltip}"><tbody>`;
231
+ let html = `<table class="${$TOOLTIP.tooltip}"><tbody>`;
232
232
 
233
233
  d.forEach(v => {
234
234
  html += `<tr>
@@ -239,7 +239,7 @@ export default class Stanford extends Plugin {
239
239
  <th>${defaultTitleFormat(v.id)}</th>
240
240
  <th class="value">${defaultValueFormat(v.value)}</th>
241
241
  </tr>
242
- <tr class="${CLASS.tooltipName}-${v.id}">
242
+ <tr class="${$TOOLTIP.tooltipName}-${v.id}">
243
243
  <td class="name"><span style="background-color:${color(v)}"></span>${defaultTitleFormat("Epochs")}</td>
244
244
  <td class="value">${defaultValueFormat(v.epochs)}</td>
245
245
  </tr>`;
@@ -3,7 +3,6 @@
3
3
  * billboard.js project is licensed under the MIT license
4
4
  * @ignore
5
5
  */
6
-
7
6
  import {getRange, isEmpty, isFunction, isString, parseDate} from "../../module/util";
8
7
 
9
8
  /**
@@ -6,108 +6,196 @@
6
6
  * CSS class names definition
7
7
  * @private
8
8
  */
9
- export default {
9
+ export const $COMMON = {
10
+ button: "bb-button",
11
+ chart: "bb-chart",
12
+ empty: "bb-empty",
13
+ main: "bb-main",
14
+ target: "bb-target",
15
+ EXPANDED: "_expanded_"
16
+ };
17
+
18
+ export const $ARC = {
10
19
  arc: "bb-arc",
11
20
  arcLabelLine: "bb-arc-label-line",
12
21
  arcs: "bb-arcs",
22
+ chartArc: "bb-chart-arc",
23
+ chartArcs: "bb-chart-arcs",
24
+ chartArcsBackground: "bb-chart-arcs-background",
25
+ chartArcsTitle: "bb-chart-arcs-title"
26
+ };
27
+
28
+ export const $AREA = {
13
29
  area: "bb-area",
14
- areas: "bb-areas",
30
+ areas: "bb-areas"
31
+ };
32
+
33
+ export const $AXIS = {
15
34
  axis: "bb-axis",
16
35
  axisX: "bb-axis-x",
17
36
  axisXLabel: "bb-axis-x-label",
18
37
  axisY: "bb-axis-y",
19
38
  axisY2: "bb-axis-y2",
20
39
  axisY2Label: "bb-axis-y2-label",
21
- axisYLabel: "bb-axis-y-label",
40
+ axisYLabel: "bb-axis-y-label"
41
+ };
42
+
43
+ export const $BAR = {
22
44
  bar: "bb-bar",
23
45
  bars: "bb-bars",
24
- brush: "bb-brush",
25
- button: "bb-button",
26
- buttonZoomReset: "bb-zoom-reset",
46
+ chartBar: "bb-chart-bar",
47
+ chartBars: "bb-chart-bars"
48
+ };
49
+
50
+ export const $CANDLESTICK = {
27
51
  candlestick: "bb-candlestick",
28
52
  candlesticks: "bb-candlesticks",
29
- chart: "bb-chart",
30
- chartArc: "bb-chart-arc",
31
- chartArcs: "bb-chart-arcs",
32
- chartArcsBackground: "bb-chart-arcs-background",
33
- chartArcsGaugeMax: "bb-chart-arcs-gauge-max",
34
- chartArcsGaugeMin: "bb-chart-arcs-gauge-min",
35
- chartArcsGaugeUnit: "bb-chart-arcs-gauge-unit",
36
- chartArcsTitle: "bb-chart-arcs-title",
37
- chartArcsGaugeTitle: "bb-chart-arcs-gauge-title",
38
- chartBar: "bb-chart-bar",
39
- chartBars: "bb-chart-bars",
40
53
  chartCandlestick: "bb-chart-candlestick",
41
54
  chartCandlesticks: "bb-chart-candlesticks",
55
+ valueDown: "bb-value-down",
56
+ valueUp: "bb-value-up"
57
+ };
58
+
59
+ export const $CIRCLE = {
42
60
  chartCircles: "bb-chart-circles",
43
- chartLine: "bb-chart-line",
44
- chartLines: "bb-chart-lines",
45
- chartRadar: "bb-chart-radar",
46
- chartRadars: "bb-chart-radars",
47
- chartText: "bb-chart-text",
48
- chartTexts: "bb-chart-texts",
49
61
  circle: "bb-circle",
50
- circles: "bb-circles",
62
+ circles: "bb-circles"
63
+ };
64
+
65
+ export const $COLOR = {
51
66
  colorPattern: "bb-color-pattern",
52
- colorScale: "bb-colorscale",
53
- defocused: "bb-defocused",
67
+ colorScale: "bb-colorscale"
68
+ };
69
+
70
+ export const $DRAG = {
54
71
  dragarea: "bb-dragarea",
55
- empty: "bb-empty",
72
+ INCLUDED: "_included_"
73
+ };
74
+
75
+ export const $GAUGE = {
76
+ chartArcsGaugeMax: "bb-chart-arcs-gauge-max",
77
+ chartArcsGaugeMin: "bb-chart-arcs-gauge-min",
78
+ chartArcsGaugeUnit: "bb-chart-arcs-gauge-unit",
79
+ chartArcsGaugeTitle: "bb-chart-arcs-gauge-title",
80
+ gaugeValue: "bb-gauge-value"
81
+ };
82
+
83
+ export const $LEGEND = {
84
+ legend: "bb-legend",
85
+ legendBackground: "bb-legend-background",
86
+ legendItem: "bb-legend-item",
87
+ legendItemEvent: "bb-legend-item-event",
88
+ legendItemHidden: "bb-legend-item-hidden",
89
+ legendItemPoint: "bb-legend-item-point",
90
+ legendItemTile: "bb-legend-item-tile"
91
+ };
92
+
93
+ export const $LINE = {
94
+ chartLine: "bb-chart-line",
95
+ chartLines: "bb-chart-lines",
96
+ line: "bb-line",
97
+ lines: "bb-lines"
98
+ };
99
+
100
+ export const $EVENT = {
56
101
  eventRect: "bb-event-rect",
57
102
  eventRects: "bb-event-rects",
58
103
  eventRectsMultiple: "bb-event-rects-multiple",
59
104
  eventRectsSingle: "bb-event-rects-single",
105
+
106
+ };
107
+
108
+ export const $FOCUS = {
60
109
  focused: "bb-focused",
61
- gaugeValue: "bb-gauge-value",
110
+ defocused: "bb-defocused",
111
+ legendItemFocused: "bb-legend-item-focused",
112
+ xgridFocus: "bb-xgrid-focus",
113
+ ygridFocus: "bb-ygrid-focus"
114
+ };
115
+
116
+ export const $GRID = {
62
117
  grid: "bb-grid",
63
118
  gridLines: "bb-grid-lines",
64
- legend: "bb-legend",
65
- legendBackground: "bb-legend-background",
66
- legendItem: "bb-legend-item",
67
- legendItemEvent: "bb-legend-item-event",
68
- legendItemFocused: "bb-legend-item-focused",
69
- legendItemHidden: "bb-legend-item-hidden",
70
- legendItemPoint: "bb-legend-item-point",
71
- legendItemTile: "bb-legend-item-tile",
119
+ xgrid: "bb-xgrid",
120
+ xgridLine: "bb-xgrid-line",
121
+ xgridLines: "bb-xgrid-lines",
122
+ xgrids: "bb-xgrids",
123
+ ygrid: "bb-ygrid",
124
+ ygridLine: "bb-ygrid-line",
125
+ ygridLines: "bb-ygrid-lines",
126
+ ygrids: "bb-ygrids"
127
+ };
128
+
129
+ export const $RADAR = {
130
+ chartRadar: "bb-chart-radar",
131
+ chartRadars: "bb-chart-radars",
72
132
  level: "bb-level",
73
- levels: "bb-levels",
74
- line: "bb-line",
75
- lines: "bb-lines",
76
- main: "bb-main",
133
+ levels: "bb-levels"
134
+ };
135
+
136
+ export const $REGION = {
77
137
  region: "bb-region",
78
- regions: "bb-regions",
138
+ regions: "bb-regions"
139
+ };
140
+
141
+ export const $SELECT = {
79
142
  selectedCircle: "bb-selected-circle",
80
143
  selectedCircles: "bb-selected-circles",
144
+ SELECTED: "_selected_"
145
+ };
146
+
147
+ export const $SHAPE = {
81
148
  shape: "bb-shape",
82
149
  shapes: "bb-shapes",
83
- stanfordElements: "bb-stanford-elements",
84
- stanfordLine: "bb-stanford-line",
85
- stanfordLines: "bb-stanford-lines",
86
- stanfordRegion: "bb-stanford-region",
87
- stanfordRegions: "bb-stanford-regions",
88
- subchart: "bb-subchart",
89
- target: "bb-target",
150
+ };
151
+
152
+ export const $SUBCHART = {
153
+ brush: "bb-brush",
154
+ subchart: "bb-subchart"
155
+ };
156
+
157
+ export const $TEXT = {
158
+ chartText: "bb-chart-text",
159
+ chartTexts: "bb-chart-texts",
90
160
  text: "bb-text",
91
161
  texts: "bb-texts",
92
162
  title: "bb-title",
163
+ TextOverlapping: "text-overlapping"
164
+ };
165
+
166
+ export const $TOOLTIP = {
93
167
  tooltip: "bb-tooltip",
94
168
  tooltipContainer: "bb-tooltip-container",
95
- tooltipName: "bb-tooltip-name",
96
- valueDown: "bb-value-down",
97
- valueUp: "bb-value-up",
98
- xgrid: "bb-xgrid",
99
- xgridFocus: "bb-xgrid-focus",
100
- xgridLine: "bb-xgrid-line",
101
- xgridLines: "bb-xgrid-lines",
102
- xgrids: "bb-xgrids",
103
- ygrid: "bb-ygrid",
104
- ygridFocus: "bb-ygrid-focus",
105
- ygridLine: "bb-ygrid-line",
106
- ygridLines: "bb-ygrid-lines",
107
- ygrids: "bb-ygrids",
108
- zoomBrush: "bb-zoom-brush",
109
- EXPANDED: "_expanded_",
110
- SELECTED: "_selected_",
111
- INCLUDED: "_included_",
112
- TextOverlapping: "text-overlapping"
169
+ tooltipName: "bb-tooltip-name"
170
+ };
171
+
172
+ export const $ZOOM = {
173
+ buttonZoomReset: "bb-zoom-reset",
174
+ zoomBrush: "bb-zoom-brush"
175
+ };
176
+
177
+ export default {
178
+ ...$COMMON,
179
+ ...$ARC,
180
+ ...$AREA,
181
+ ...$AXIS,
182
+ ...$BAR,
183
+ ...$CANDLESTICK,
184
+ ...$CIRCLE,
185
+ ...$COLOR,
186
+ ...$DRAG,
187
+ ...$GAUGE,
188
+ ...$LEGEND,
189
+ ...$LINE,
190
+ ...$EVENT,
191
+ ...$FOCUS,
192
+ ...$GRID,
193
+ ...$RADAR,
194
+ ...$REGION,
195
+ ...$SELECT,
196
+ ...$SHAPE,
197
+ ...$SUBCHART,
198
+ ...$TEXT,
199
+ ...$TOOLTIP,
200
+ ...$ZOOM
113
201
  };
@@ -7,7 +7,6 @@ import {pointer as d3Pointer} from "d3-selection";
7
7
  import {brushSelection as d3BrushSelection} from "d3-brush";
8
8
  import {d3Selection} from "../../types/types";
9
9
  import {document, window} from "./browser";
10
- import CLASS from "../config/classes";
11
10
 
12
11
  export {
13
12
  asHalfPixel,
@@ -284,7 +283,7 @@ function getBrushSelection(ctx) {
284
283
  if (event && event.type === "brush") {
285
284
  selection = event.selection;
286
285
  // check from brush area selection
287
- } else if (main && (selection = main.select(`.${CLASS.brush}`).node())) {
286
+ } else if (main && (selection = main.select(".bb-brush").node())) {
288
287
  selection = d3BrushSelection(selection);
289
288
  }
290
289