@carbon/charts 0.41.34 → 0.41.38
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.
- package/CHANGELOG.md +36 -1
- package/axis-chart.d.ts +1 -1
- package/axis-chart.js +5 -3
- package/axis-chart.js.map +1 -1
- package/build/demo/data/boxplot.d.ts +34 -0
- package/build/demo/data/combo.d.ts +4 -31
- package/build/demo/data/index.d.ts +6 -0
- package/build/src/axis-chart.d.ts +1 -1
- package/build/src/charts/boxplot.d.ts +8 -0
- package/build/src/charts/index.d.ts +1 -0
- package/build/src/components/axes/ruler-stacked.d.ts +0 -1
- package/build/src/components/axes/two-dimensional-axes.d.ts +0 -1
- package/build/src/components/component.d.ts +1 -1
- package/build/src/components/essentials/threshold.d.ts +3 -6
- package/build/src/components/graphs/area-stacked.d.ts +1 -1
- package/build/src/components/graphs/boxplot.d.ts +7 -0
- package/build/src/components/index.d.ts +1 -0
- package/build/src/configuration-non-customizable.d.ts +19 -0
- package/build/src/configuration.d.ts +2 -1
- package/build/src/interfaces/axis-scales.d.ts +6 -1
- package/build/src/interfaces/charts.d.ts +6 -1
- package/build/src/interfaces/enums.d.ts +7 -0
- package/build/src/interfaces/events.d.ts +13 -0
- package/build/src/model-boxplot.d.ts +12 -0
- package/build/src/model.d.ts +1 -1
- package/bundle.js +1 -1
- package/charts/boxplot.d.ts +8 -0
- package/charts/boxplot.js +55 -0
- package/charts/boxplot.js.map +1 -0
- package/charts/index.d.ts +1 -0
- package/charts/index.js +1 -0
- package/charts/index.js.map +1 -1
- package/components/axes/axis.js +34 -13
- package/components/axes/axis.js.map +1 -1
- package/components/axes/ruler-stacked.d.ts +0 -1
- package/components/axes/ruler-stacked.js +0 -8
- package/components/axes/ruler-stacked.js.map +1 -1
- package/components/axes/two-dimensional-axes.d.ts +0 -1
- package/components/axes/two-dimensional-axes.js +0 -29
- package/components/axes/two-dimensional-axes.js.map +1 -1
- package/components/component.d.ts +1 -1
- package/components/component.js.map +1 -1
- package/components/essentials/threshold.d.ts +3 -6
- package/components/essentials/threshold.js +158 -79
- package/components/essentials/threshold.js.map +1 -1
- package/components/graphs/area-stacked.d.ts +1 -1
- package/components/graphs/area-stacked.js +5 -3
- package/components/graphs/area-stacked.js.map +1 -1
- package/components/graphs/boxplot.d.ts +7 -0
- package/components/graphs/boxplot.js +420 -0
- package/components/graphs/boxplot.js.map +1 -0
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/components/index.js.map +1 -1
- package/configuration-non-customizable.d.ts +19 -0
- package/configuration-non-customizable.js +19 -0
- package/configuration-non-customizable.js.map +1 -1
- package/configuration.d.ts +2 -1
- package/configuration.js +5 -0
- package/configuration.js.map +1 -1
- package/demo/data/boxplot.d.ts +34 -0
- package/demo/data/boxplot.js +48 -0
- package/demo/data/boxplot.js.map +1 -0
- package/demo/data/bubble.js +4 -4
- package/demo/data/bubble.js.map +1 -1
- package/demo/data/bundle.js +1 -1
- package/demo/data/combo.d.ts +4 -31
- package/demo/data/combo.js +4 -42
- package/demo/data/combo.js.map +1 -1
- package/demo/data/index.d.ts +6 -0
- package/demo/data/index.js +22 -6
- package/demo/data/index.js.map +1 -1
- package/demo/styles.css +4 -4
- package/demo/styles.min.css +1 -1
- package/demo/tsconfig.tsbuildinfo +31 -17
- package/interfaces/axis-scales.d.ts +6 -1
- package/interfaces/axis-scales.js.map +1 -1
- package/interfaces/charts.d.ts +6 -1
- package/interfaces/charts.js.map +1 -1
- package/interfaces/enums.d.ts +7 -0
- package/interfaces/enums.js +8 -0
- package/interfaces/enums.js.map +1 -1
- package/interfaces/events.d.ts +13 -0
- package/interfaces/events.js +14 -0
- package/interfaces/events.js.map +1 -1
- package/model-boxplot.d.ts +12 -0
- package/model-boxplot.js +99 -0
- package/model-boxplot.js.map +1 -0
- package/model.d.ts +1 -1
- package/model.js +3 -2
- package/model.js.map +1 -1
- package/package.json +1 -1
- package/styles/components/_threshold.scss +1 -1
- package/styles-g10.css +1 -1
- package/styles-g10.min.css +1 -1
- package/styles-g100.css +1 -1
- package/styles-g100.min.css +1 -1
- package/styles-g90.css +1 -1
- package/styles-g90.min.css +1 -1
- package/styles.css +1 -1
- package/styles.min.css +1 -1
- package/tsconfig.tsbuildinfo +97 -31
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
extendStatics(d, b);
|
|
10
|
+
function __() { this.constructor = d; }
|
|
11
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
+
};
|
|
13
|
+
})();
|
|
14
|
+
// Internal Imports
|
|
15
|
+
import { Component } from '../component';
|
|
16
|
+
import { CartesianOrientations, ColorClassNameTypes, Events, Roles, } from '../../interfaces';
|
|
17
|
+
import { Tools } from '../../tools';
|
|
18
|
+
import * as Configuration from '../../configuration';
|
|
19
|
+
// D3 Imports
|
|
20
|
+
import { select } from 'd3-selection';
|
|
21
|
+
var Boxplot = /** @class */ (function (_super) {
|
|
22
|
+
__extends(Boxplot, _super);
|
|
23
|
+
function Boxplot() {
|
|
24
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
25
|
+
_this.type = 'boxplot';
|
|
26
|
+
return _this;
|
|
27
|
+
}
|
|
28
|
+
Boxplot.prototype.render = function (animate) {
|
|
29
|
+
var _this = this;
|
|
30
|
+
// Grab container SVG
|
|
31
|
+
var svg = this.getContainerSVG({ withinChartClip: true });
|
|
32
|
+
var options = this.getOptions();
|
|
33
|
+
var groupMapsTo = options.data.groupMapsTo;
|
|
34
|
+
var dataGroupNames = this.model.getDataGroupNames();
|
|
35
|
+
/*
|
|
36
|
+
* Get graphable dimensions
|
|
37
|
+
*/
|
|
38
|
+
var mainXScale = this.services.cartesianScales.getMainXScale();
|
|
39
|
+
var mainYScale = this.services.cartesianScales.getMainYScale();
|
|
40
|
+
var _a = mainXScale.range(), xScaleStart = _a[0], xScaleEnd = _a[1];
|
|
41
|
+
var _b = mainYScale.range(), yScaleEnd = _b[0], yScaleStart = _b[1];
|
|
42
|
+
var width = xScaleEnd - xScaleStart;
|
|
43
|
+
var height = yScaleEnd - yScaleStart;
|
|
44
|
+
if (width === 0) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
// Get orientation of the chart
|
|
48
|
+
var cartesianScales = this.services.cartesianScales;
|
|
49
|
+
var orientation = cartesianScales.getOrientation();
|
|
50
|
+
var isInVerticalOrientation = orientation === CartesianOrientations.VERTICAL;
|
|
51
|
+
var _c = Tools.flipDomainAndRangeBasedOnOrientation(function (d, i) { return _this.services.cartesianScales.getDomainValue(d, i); }, function (d, i) { return _this.services.cartesianScales.getRangeValue(d, i); }, orientation), getXValue = _c[0], getYValue = _c[1];
|
|
52
|
+
var gridSize = Math.floor((isInVerticalOrientation ? width : height) / dataGroupNames.length);
|
|
53
|
+
var boxWidth = Math.min(gridSize / 2, 16);
|
|
54
|
+
var boxplotData = this.model.getBoxplotData();
|
|
55
|
+
/*
|
|
56
|
+
* update or initialize all box groups
|
|
57
|
+
*/
|
|
58
|
+
var boxGroups = svg.selectAll('.box-group').data(boxplotData);
|
|
59
|
+
boxGroups.exit().remove();
|
|
60
|
+
var boxGroupsEnter = boxGroups
|
|
61
|
+
.enter()
|
|
62
|
+
.append('g')
|
|
63
|
+
.attr('class', 'box-group');
|
|
64
|
+
var allBoxGroups = boxGroups.merge(boxGroupsEnter);
|
|
65
|
+
/*
|
|
66
|
+
* draw the 2 range lines for each box
|
|
67
|
+
*/
|
|
68
|
+
// Start range line
|
|
69
|
+
boxGroupsEnter
|
|
70
|
+
.append('path')
|
|
71
|
+
.merge(boxGroups.select('path.vertical-line.start'))
|
|
72
|
+
.attr('class', function () {
|
|
73
|
+
return _this.model.getColorClassName({
|
|
74
|
+
classNameTypes: [ColorClassNameTypes.STROKE],
|
|
75
|
+
originalClassName: 'vertical-line start',
|
|
76
|
+
});
|
|
77
|
+
})
|
|
78
|
+
.attr('stroke-width', Configuration.boxplot.strokeWidth.default)
|
|
79
|
+
.attr('fill', 'none')
|
|
80
|
+
.transition(this.services.transitions.getTransition('boxplot-update-verticalstartline', animate))
|
|
81
|
+
.attr('d', function (d) {
|
|
82
|
+
var x0 = cartesianScales.getDomainValue(d[groupMapsTo]);
|
|
83
|
+
var x1 = x0;
|
|
84
|
+
var y0 = cartesianScales.getRangeValue(d.whiskers.min);
|
|
85
|
+
var y1 = cartesianScales.getRangeValue(d.quartiles.q_25);
|
|
86
|
+
return Tools.generateSVGPathString({ x0: x0, x1: x1, y0: y0, y1: y1 }, orientation);
|
|
87
|
+
});
|
|
88
|
+
// End range line
|
|
89
|
+
boxGroupsEnter
|
|
90
|
+
.append('path')
|
|
91
|
+
.merge(boxGroups.select('path.vertical-line.end'))
|
|
92
|
+
.attr('class', function () {
|
|
93
|
+
return _this.model.getColorClassName({
|
|
94
|
+
classNameTypes: [ColorClassNameTypes.STROKE],
|
|
95
|
+
originalClassName: 'vertical-line end',
|
|
96
|
+
});
|
|
97
|
+
})
|
|
98
|
+
.attr('stroke-width', Configuration.boxplot.strokeWidth.default)
|
|
99
|
+
.attr('fill', 'none')
|
|
100
|
+
.transition(this.services.transitions.getTransition('boxplot-update-verticalendline', animate))
|
|
101
|
+
.attr('d', function (d) {
|
|
102
|
+
var x0 = cartesianScales.getDomainValue(d[groupMapsTo]);
|
|
103
|
+
var x1 = x0;
|
|
104
|
+
var y0 = cartesianScales.getRangeValue(d.whiskers.max);
|
|
105
|
+
var y1 = cartesianScales.getRangeValue(d.quartiles.q_75);
|
|
106
|
+
return Tools.generateSVGPathString({ x0: x0, x1: x1, y0: y0, y1: y1 }, orientation);
|
|
107
|
+
});
|
|
108
|
+
/*
|
|
109
|
+
* Draw out and update the boxes
|
|
110
|
+
*/
|
|
111
|
+
boxGroupsEnter
|
|
112
|
+
.append('path')
|
|
113
|
+
.merge(boxGroups.select('path.box'))
|
|
114
|
+
.attr('class', function () {
|
|
115
|
+
return _this.model.getColorClassName({
|
|
116
|
+
classNameTypes: [
|
|
117
|
+
ColorClassNameTypes.FILL,
|
|
118
|
+
ColorClassNameTypes.STROKE,
|
|
119
|
+
],
|
|
120
|
+
originalClassName: 'box',
|
|
121
|
+
});
|
|
122
|
+
})
|
|
123
|
+
.attr('fill-opacity', Configuration.boxplot.box.opacity.default)
|
|
124
|
+
.attr('stroke-width', Configuration.boxplot.strokeWidth.default)
|
|
125
|
+
.attr('role', Roles.GRAPHICS_SYMBOL)
|
|
126
|
+
.attr('aria-roledescription', 'box')
|
|
127
|
+
.transition(this.services.transitions.getTransition('boxplot-update-quartiles', animate))
|
|
128
|
+
.attr('d', function (d) {
|
|
129
|
+
var x0 = cartesianScales.getDomainValue(d[groupMapsTo]) -
|
|
130
|
+
boxWidth / 2;
|
|
131
|
+
var x1 = x0 + boxWidth;
|
|
132
|
+
var y0 = cartesianScales.getRangeValue(Math[isInVerticalOrientation ? 'max' : 'min'](d.quartiles.q_75, d.quartiles.q_25));
|
|
133
|
+
var y1 = y0 +
|
|
134
|
+
Math.abs(cartesianScales.getRangeValue(d.quartiles.q_75) -
|
|
135
|
+
cartesianScales.getRangeValue(d.quartiles.q_25));
|
|
136
|
+
return Tools.generateSVGPathString({ x0: x0, x1: x1, y0: y0, y1: y1 }, orientation);
|
|
137
|
+
});
|
|
138
|
+
/*
|
|
139
|
+
* Draw out and update highlight areas
|
|
140
|
+
*/
|
|
141
|
+
boxGroupsEnter
|
|
142
|
+
.append('path')
|
|
143
|
+
.merge(boxGroups.select('path.highlight-area'))
|
|
144
|
+
.attr('class', 'highlight-area')
|
|
145
|
+
.attr('opacity', 0)
|
|
146
|
+
.attr('d', function (d) {
|
|
147
|
+
var x0 = cartesianScales.getDomainValue(d[groupMapsTo]) -
|
|
148
|
+
boxWidth / 2;
|
|
149
|
+
var x1 = x0 + boxWidth;
|
|
150
|
+
var y0 = cartesianScales.getRangeValue(d.whiskers.min);
|
|
151
|
+
var y1 = cartesianScales.getRangeValue(d.whiskers.max);
|
|
152
|
+
return Tools.generateSVGPathString({ x0: x0, x1: x1, y0: y0, y1: y1 }, orientation);
|
|
153
|
+
});
|
|
154
|
+
/*
|
|
155
|
+
* Draw out and update the starting whisker
|
|
156
|
+
*/
|
|
157
|
+
boxGroupsEnter
|
|
158
|
+
.append('path')
|
|
159
|
+
.merge(boxGroups.select('path.whisker.start'))
|
|
160
|
+
.attr('class', function () {
|
|
161
|
+
return _this.model.getColorClassName({
|
|
162
|
+
classNameTypes: [ColorClassNameTypes.STROKE],
|
|
163
|
+
originalClassName: 'whisker start',
|
|
164
|
+
});
|
|
165
|
+
})
|
|
166
|
+
.attr('stroke-width', Configuration.boxplot.strokeWidth.thicker)
|
|
167
|
+
.attr('fill', 'none')
|
|
168
|
+
.transition(this.services.transitions.getTransition('boxplot-update-startingwhisker', animate))
|
|
169
|
+
.attr('d', function (d) {
|
|
170
|
+
var x0 = cartesianScales.getDomainValue(d[groupMapsTo]) -
|
|
171
|
+
boxWidth / 4;
|
|
172
|
+
var x1 = x0 + boxWidth / 2;
|
|
173
|
+
var y0 = cartesianScales.getRangeValue(d.whiskers.min);
|
|
174
|
+
var y1 = cartesianScales.getRangeValue(d.whiskers.min);
|
|
175
|
+
return Tools.generateSVGPathString({ x0: x0, x1: x1, y0: y0, y1: y1 }, orientation);
|
|
176
|
+
});
|
|
177
|
+
/*
|
|
178
|
+
* Draw out and update the median line
|
|
179
|
+
*/
|
|
180
|
+
boxGroupsEnter
|
|
181
|
+
.append('path')
|
|
182
|
+
.merge(boxGroups.select('path.median'))
|
|
183
|
+
.attr('fill', 'none')
|
|
184
|
+
.attr('class', function () {
|
|
185
|
+
return _this.model.getColorClassName({
|
|
186
|
+
classNameTypes: [ColorClassNameTypes.STROKE],
|
|
187
|
+
originalClassName: 'median',
|
|
188
|
+
});
|
|
189
|
+
})
|
|
190
|
+
.attr('stroke-width', 2)
|
|
191
|
+
.transition(this.services.transitions.getTransition('boxplot-update-median', animate))
|
|
192
|
+
.attr('d', function (d) {
|
|
193
|
+
var x0 = cartesianScales.getDomainValue(d[groupMapsTo]) -
|
|
194
|
+
boxWidth / 2;
|
|
195
|
+
var x1 = x0 + boxWidth;
|
|
196
|
+
var y0 = cartesianScales.getRangeValue(d.quartiles.q_50);
|
|
197
|
+
var y1 = y0;
|
|
198
|
+
return Tools.generateSVGPathString({ x0: x0, x1: x1, y0: y0, y1: y1 }, orientation);
|
|
199
|
+
});
|
|
200
|
+
/*
|
|
201
|
+
* Draw out and update the ending whisker
|
|
202
|
+
*/
|
|
203
|
+
boxGroupsEnter
|
|
204
|
+
.append('path')
|
|
205
|
+
.merge(boxGroups.select('path.whisker.end'))
|
|
206
|
+
.attr('class', function () {
|
|
207
|
+
return _this.model.getColorClassName({
|
|
208
|
+
classNameTypes: [ColorClassNameTypes.STROKE],
|
|
209
|
+
originalClassName: 'whisker end',
|
|
210
|
+
});
|
|
211
|
+
})
|
|
212
|
+
.attr('stroke-width', Configuration.boxplot.strokeWidth.thicker)
|
|
213
|
+
.attr('fill', 'none')
|
|
214
|
+
.transition(this.services.transitions.getTransition('boxplot-update-endingwhisker', animate))
|
|
215
|
+
.attr('d', function (d) {
|
|
216
|
+
var x0 = cartesianScales.getDomainValue(d[groupMapsTo]) -
|
|
217
|
+
boxWidth / 4;
|
|
218
|
+
var x1 = x0 + boxWidth / 2;
|
|
219
|
+
var y0 = cartesianScales.getRangeValue(d.whiskers.max);
|
|
220
|
+
var y1 = cartesianScales.getRangeValue(d.whiskers.max);
|
|
221
|
+
return Tools.generateSVGPathString({ x0: x0, x1: x1, y0: y0, y1: y1 }, orientation);
|
|
222
|
+
});
|
|
223
|
+
/*
|
|
224
|
+
* Draw out and update the outlier circles
|
|
225
|
+
*/
|
|
226
|
+
var circles = allBoxGroups.selectAll('circle.outlier').data(function (d) {
|
|
227
|
+
return d.outliers.map(function (outlier) {
|
|
228
|
+
var _a;
|
|
229
|
+
return _a = {
|
|
230
|
+
min: d.whiskers.min,
|
|
231
|
+
max: d.whiskers.max
|
|
232
|
+
},
|
|
233
|
+
_a[groupMapsTo] = d[groupMapsTo],
|
|
234
|
+
_a.value = outlier,
|
|
235
|
+
_a;
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
circles.exit().remove();
|
|
239
|
+
var circlesEnter = circles.enter().append('circle');
|
|
240
|
+
circles
|
|
241
|
+
.merge(circlesEnter)
|
|
242
|
+
.attr('r', Configuration.boxplot.circle.radius)
|
|
243
|
+
.attr('class', function () {
|
|
244
|
+
return _this.model.getColorClassName({
|
|
245
|
+
classNameTypes: [
|
|
246
|
+
ColorClassNameTypes.FILL,
|
|
247
|
+
ColorClassNameTypes.STROKE,
|
|
248
|
+
],
|
|
249
|
+
originalClassName: 'outlier',
|
|
250
|
+
});
|
|
251
|
+
})
|
|
252
|
+
.attr('fill-opacity', Configuration.boxplot.circle.opacity.default)
|
|
253
|
+
.attr('cx', getXValue)
|
|
254
|
+
.transition(this.services.transitions.getTransition('boxplot-update-circles', animate))
|
|
255
|
+
.attr('cy', getYValue);
|
|
256
|
+
this.addBoxEventListeners();
|
|
257
|
+
this.addCircleEventListeners();
|
|
258
|
+
};
|
|
259
|
+
Boxplot.prototype.addBoxEventListeners = function () {
|
|
260
|
+
var self = this;
|
|
261
|
+
var options = this.getOptions();
|
|
262
|
+
var groupMapsTo = options.data.groupMapsTo;
|
|
263
|
+
this.parent
|
|
264
|
+
.selectAll('path.highlight-area')
|
|
265
|
+
.on('mouseover', function (datum) {
|
|
266
|
+
var hoveredElement = select(this);
|
|
267
|
+
var parentElement = select(this.parentNode);
|
|
268
|
+
parentElement
|
|
269
|
+
.select('path.box')
|
|
270
|
+
.classed('hovered', true)
|
|
271
|
+
.attr('fill-opacity', Configuration.boxplot.box.opacity.hovered);
|
|
272
|
+
// Show tooltip for single datapoint
|
|
273
|
+
self.services.events.dispatchEvent(Events.Tooltip.SHOW, {
|
|
274
|
+
hoveredElement: hoveredElement,
|
|
275
|
+
items: [
|
|
276
|
+
{
|
|
277
|
+
label: options.tooltip.groupLabel || 'Group',
|
|
278
|
+
value: datum[groupMapsTo],
|
|
279
|
+
class: self.model.getColorClassName({
|
|
280
|
+
classNameTypes: [ColorClassNameTypes.TOOLTIP],
|
|
281
|
+
}),
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
label: 'Minimum',
|
|
285
|
+
value: datum.whiskers.min,
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
label: 'Q1',
|
|
289
|
+
value: datum.quartiles.q_25,
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
label: 'Median',
|
|
293
|
+
value: datum.quartiles.q_50,
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
label: 'Q3',
|
|
297
|
+
value: datum.quartiles.q_75,
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
label: 'Maximum',
|
|
301
|
+
value: datum.whiskers.max,
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
label: 'IQR',
|
|
305
|
+
value: datum.quartiles.q_75 - datum.quartiles.q_25,
|
|
306
|
+
},
|
|
307
|
+
],
|
|
308
|
+
});
|
|
309
|
+
// Dispatch mouse event
|
|
310
|
+
self.services.events.dispatchEvent(Events.Boxplot.BOX_MOUSEOVER, {
|
|
311
|
+
element: hoveredElement,
|
|
312
|
+
datum: datum,
|
|
313
|
+
});
|
|
314
|
+
})
|
|
315
|
+
.on('mousemove', function (datum) {
|
|
316
|
+
var hoveredElement = select(this);
|
|
317
|
+
// Dispatch mouse event
|
|
318
|
+
self.services.events.dispatchEvent(Events.Boxplot.BOX_MOUSEMOVE, {
|
|
319
|
+
element: hoveredElement,
|
|
320
|
+
datum: datum,
|
|
321
|
+
});
|
|
322
|
+
self.services.events.dispatchEvent(Events.Tooltip.MOVE);
|
|
323
|
+
})
|
|
324
|
+
.on('click', function (datum) {
|
|
325
|
+
// Dispatch mouse event
|
|
326
|
+
self.services.events.dispatchEvent(Events.Boxplot.BOX_CLICK, {
|
|
327
|
+
element: select(this),
|
|
328
|
+
datum: datum,
|
|
329
|
+
});
|
|
330
|
+
})
|
|
331
|
+
.on('mouseout', function (datum) {
|
|
332
|
+
var hoveredElement = select(this);
|
|
333
|
+
var parentElement = select(this.parentNode);
|
|
334
|
+
parentElement
|
|
335
|
+
.select('path.box')
|
|
336
|
+
.classed('hovered', false)
|
|
337
|
+
.attr('fill-opacity', Configuration.boxplot.box.opacity.default);
|
|
338
|
+
// Dispatch mouse event
|
|
339
|
+
self.services.events.dispatchEvent(Events.Boxplot.BOX_MOUSEOUT, {
|
|
340
|
+
element: hoveredElement,
|
|
341
|
+
datum: datum,
|
|
342
|
+
});
|
|
343
|
+
// Hide tooltip
|
|
344
|
+
self.services.events.dispatchEvent(Events.Tooltip.HIDE, {
|
|
345
|
+
hoveredElement: hoveredElement,
|
|
346
|
+
});
|
|
347
|
+
});
|
|
348
|
+
};
|
|
349
|
+
Boxplot.prototype.addCircleEventListeners = function () {
|
|
350
|
+
var self = this;
|
|
351
|
+
var options = this.getOptions();
|
|
352
|
+
var groupMapsTo = options.data.groupMapsTo;
|
|
353
|
+
var rangeIdentifier = this.services.cartesianScales.getRangeIdentifier();
|
|
354
|
+
this.parent
|
|
355
|
+
.selectAll('circle')
|
|
356
|
+
.on('mouseover', function (datum) {
|
|
357
|
+
var hoveredElement = select(this);
|
|
358
|
+
hoveredElement
|
|
359
|
+
.classed('hovered', true)
|
|
360
|
+
.attr('fill-opacity', Configuration.boxplot.circle.opacity.hovered)
|
|
361
|
+
.classed('unfilled', false);
|
|
362
|
+
// Show tooltip for single datapoint
|
|
363
|
+
self.services.events.dispatchEvent(Events.Tooltip.SHOW, {
|
|
364
|
+
hoveredElement: hoveredElement,
|
|
365
|
+
items: [
|
|
366
|
+
{
|
|
367
|
+
label: options.tooltip.groupLabel || 'Group',
|
|
368
|
+
value: datum[groupMapsTo],
|
|
369
|
+
class: self.model.getColorClassName({
|
|
370
|
+
classNameTypes: [ColorClassNameTypes.TOOLTIP],
|
|
371
|
+
}),
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
label: 'Outlier',
|
|
375
|
+
value: datum[rangeIdentifier],
|
|
376
|
+
},
|
|
377
|
+
],
|
|
378
|
+
});
|
|
379
|
+
// Dispatch mouse event
|
|
380
|
+
self.services.events.dispatchEvent(Events.Boxplot.OUTLIER_MOUSEOVER, {
|
|
381
|
+
element: hoveredElement,
|
|
382
|
+
datum: datum,
|
|
383
|
+
});
|
|
384
|
+
})
|
|
385
|
+
.on('mousemove', function (datum) {
|
|
386
|
+
var hoveredElement = select(this);
|
|
387
|
+
// Dispatch mouse event
|
|
388
|
+
self.services.events.dispatchEvent(Events.Boxplot.OUTLIER_MOUSEMOVE, {
|
|
389
|
+
element: hoveredElement,
|
|
390
|
+
datum: datum,
|
|
391
|
+
});
|
|
392
|
+
self.services.events.dispatchEvent(Events.Tooltip.MOVE);
|
|
393
|
+
})
|
|
394
|
+
.on('click', function (datum) {
|
|
395
|
+
// Dispatch mouse event
|
|
396
|
+
self.services.events.dispatchEvent(Events.Boxplot.OUTLIER_CLICK, {
|
|
397
|
+
element: select(this),
|
|
398
|
+
datum: datum,
|
|
399
|
+
});
|
|
400
|
+
})
|
|
401
|
+
.on('mouseout', function (datum) {
|
|
402
|
+
var hoveredElement = select(this);
|
|
403
|
+
hoveredElement
|
|
404
|
+
.classed('hovered', false)
|
|
405
|
+
.attr('fill-opacity', Configuration.boxplot.circle.opacity.default);
|
|
406
|
+
// Dispatch mouse event
|
|
407
|
+
self.services.events.dispatchEvent(Events.Boxplot.OUTLIER_MOUSEOUT, {
|
|
408
|
+
element: hoveredElement,
|
|
409
|
+
datum: datum,
|
|
410
|
+
});
|
|
411
|
+
// Hide tooltip
|
|
412
|
+
self.services.events.dispatchEvent(Events.Tooltip.HIDE, {
|
|
413
|
+
hoveredElement: hoveredElement,
|
|
414
|
+
});
|
|
415
|
+
});
|
|
416
|
+
};
|
|
417
|
+
return Boxplot;
|
|
418
|
+
}(Component));
|
|
419
|
+
export { Boxplot };
|
|
420
|
+
//# sourceMappingURL=../../../src/components/graphs/boxplot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boxplot.js","sourceRoot":"","sources":["boxplot.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EACN,qBAAqB,EACrB,mBAAmB,EACnB,MAAM,EACN,KAAK,GACL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AAErD,aAAa;AACb,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC;IAA6B,2BAAS;IAAtC;QAAA,qEAyhBC;QAxhBA,UAAI,GAAG,SAAS,CAAC;;IAwhBlB,CAAC;IAthBA,wBAAM,GAAN,UAAO,OAAgB;QAAvB,iBA8UC;QA7UA,qBAAqB;QACrB,IAAM,GAAG,GAAG,IAAI,CAAC,eAAe,CAAC,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;QAE5D,IAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAC1B,IAAA,sCAAW,CAAkB;QAErC,IAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAEtD;;WAEG;QACH,IAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC;QACjE,IAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC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M,CAAC,IAAI,CAAC,CAAC;YACpC,cAAc;iBACZ,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC;iBACzB,IAAI,CAAC,cAAc,EAAE,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YAErE,uBAAuB;YACvB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CACjC,MAAM,CAAC,OAAO,CAAC,gBAAgB,EAC/B;gBACC,OAAO,EAAE,cAAc;gBACvB,KAAK,OAAA;aACL,CACD,CAAC;YAEF,eAAe;YACf,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE;gBACvD,cAAc,gBAAA;aACd,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IACF,cAAC;AAAD,CAAC,AAzhBD,CAA6B,SAAS,GAyhBrC","sourcesContent":["// Internal Imports\nimport { Component } from '../component';\nimport {\n\tCartesianOrientations,\n\tColorClassNameTypes,\n\tEvents,\n\tRoles,\n} from '../../interfaces';\nimport { Tools } from '../../tools';\nimport * as Configuration from '../../configuration';\n\n// D3 Imports\nimport { select } from 'd3-selection';\n\nexport class Boxplot extends Component {\n\ttype = 'boxplot';\n\n\trender(animate: boolean) {\n\t\t// Grab container SVG\n\t\tconst svg = this.getContainerSVG({ withinChartClip: true });\n\n\t\tconst options = this.getOptions();\n\t\tconst { groupMapsTo } = options.data;\n\n\t\tconst dataGroupNames = this.model.getDataGroupNames();\n\n\t\t/*\n\t\t * Get graphable dimensions\n\t\t */\n\t\tconst mainXScale = this.services.cartesianScales.getMainXScale();\n\t\tconst mainYScale = this.services.cartesianScales.getMainYScale();\n\t\tconst [xScaleStart, xScaleEnd] = mainXScale.range();\n\t\tconst [yScaleEnd, yScaleStart] = mainYScale.range();\n\t\tconst width = xScaleEnd - xScaleStart;\n\t\tconst height = yScaleEnd - yScaleStart;\n\t\tif (width === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get orientation of the chart\n\t\tconst { cartesianScales } = this.services;\n\t\tconst orientation = cartesianScales.getOrientation();\n\t\tconst isInVerticalOrientation =\n\t\t\torientation === CartesianOrientations.VERTICAL;\n\t\tconst [\n\t\t\tgetXValue,\n\t\t\tgetYValue,\n\t\t] = Tools.flipDomainAndRangeBasedOnOrientation(\n\t\t\t(d, i?) => this.services.cartesianScales.getDomainValue(d, i),\n\t\t\t(d, i?) => this.services.cartesianScales.getRangeValue(d, i),\n\t\t\torientation\n\t\t);\n\n\t\tconst gridSize = Math.floor(\n\t\t\t(isInVerticalOrientation ? width : height) / dataGroupNames.length\n\t\t);\n\t\tconst boxWidth = Math.min(gridSize / 2, 16);\n\n\t\tconst boxplotData = this.model.getBoxplotData();\n\n\t\t/*\n\t\t * update or initialize all box groups\n\t\t */\n\t\tconst boxGroups = svg.selectAll('.box-group').data(boxplotData);\n\t\tboxGroups.exit().remove();\n\n\t\tconst boxGroupsEnter = boxGroups\n\t\t\t.enter()\n\t\t\t.append('g')\n\t\t\t.attr('class', 'box-group');\n\n\t\tconst allBoxGroups = boxGroups.merge(boxGroupsEnter);\n\n\t\t/*\n\t\t * draw the 2 range lines for each box\n\t\t */\n\t\t// Start range line\n\t\tboxGroupsEnter\n\t\t\t.append('path')\n\t\t\t.merge(boxGroups.select('path.vertical-line.start'))\n\t\t\t.attr('class', () =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\toriginalClassName: 'vertical-line start',\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('stroke-width', Configuration.boxplot.strokeWidth.default)\n\t\t\t.attr('fill', 'none')\n\t\t\t.transition(\n\t\t\t\tthis.services.transitions.getTransition(\n\t\t\t\t\t'boxplot-update-verticalstartline',\n\t\t\t\t\tanimate\n\t\t\t\t)\n\t\t\t)\n\t\t\t.attr('d', d => {\n\t\t\t\tconst x0 = cartesianScales.getDomainValue(d[groupMapsTo]);\n\t\t\t\tconst x1 = x0;\n\t\t\t\tconst y0 = cartesianScales.getRangeValue(d.whiskers.min);\n\t\t\t\tconst y1 = cartesianScales.getRangeValue(d.quartiles.q_25);\n\n\t\t\t\treturn Tools.generateSVGPathString(\n\t\t\t\t\t{ x0, x1, y0, y1 },\n\t\t\t\t\torientation\n\t\t\t\t);\n\t\t\t});\n\n\t\t// End range line\n\t\tboxGroupsEnter\n\t\t\t.append('path')\n\t\t\t.merge(boxGroups.select('path.vertical-line.end'))\n\t\t\t.attr('class', () =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\toriginalClassName: 'vertical-line end',\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('stroke-width', Configuration.boxplot.strokeWidth.default)\n\t\t\t.attr('fill', 'none')\n\t\t\t.transition(\n\t\t\t\tthis.services.transitions.getTransition(\n\t\t\t\t\t'boxplot-update-verticalendline',\n\t\t\t\t\tanimate\n\t\t\t\t)\n\t\t\t)\n\t\t\t.attr('d', d => {\n\t\t\t\tconst x0 = cartesianScales.getDomainValue(d[groupMapsTo]);\n\t\t\t\tconst x1 = x0;\n\t\t\t\tconst y0 = cartesianScales.getRangeValue(d.whiskers.max);\n\t\t\t\tconst y1 = cartesianScales.getRangeValue(d.quartiles.q_75);\n\n\t\t\t\treturn Tools.generateSVGPathString(\n\t\t\t\t\t{ x0, x1, y0, y1 },\n\t\t\t\t\torientation\n\t\t\t\t);\n\t\t\t});\n\n\t\t/*\n\t\t * Draw out and update the boxes\n\t\t */\n\t\tboxGroupsEnter\n\t\t\t.append('path')\n\t\t\t.merge(boxGroups.select('path.box'))\n\t\t\t.attr('class', () =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [\n\t\t\t\t\t\tColorClassNameTypes.FILL,\n\t\t\t\t\t\tColorClassNameTypes.STROKE,\n\t\t\t\t\t],\n\t\t\t\t\toriginalClassName: 'box',\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('fill-opacity', Configuration.boxplot.box.opacity.default)\n\t\t\t.attr('stroke-width', Configuration.boxplot.strokeWidth.default)\n\t\t\t.attr('role', Roles.GRAPHICS_SYMBOL)\n\t\t\t.attr('aria-roledescription', 'box')\n\t\t\t.transition(\n\t\t\t\tthis.services.transitions.getTransition(\n\t\t\t\t\t'boxplot-update-quartiles',\n\t\t\t\t\tanimate\n\t\t\t\t)\n\t\t\t)\n\t\t\t.attr('d', d => {\n\t\t\t\tconst x0 =\n\t\t\t\t\tcartesianScales.getDomainValue(d[groupMapsTo]) -\n\t\t\t\t\tboxWidth / 2;\n\t\t\t\tconst x1 = x0 + boxWidth;\n\t\t\t\tconst y0 = cartesianScales.getRangeValue(\n\t\t\t\t\tMath[isInVerticalOrientation ? 'max' : 'min'](\n\t\t\t\t\t\td.quartiles.q_75,\n\t\t\t\t\t\td.quartiles.q_25\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tconst y1 =\n\t\t\t\t\ty0 +\n\t\t\t\t\tMath.abs(\n\t\t\t\t\t\tcartesianScales.getRangeValue(d.quartiles.q_75) -\n\t\t\t\t\t\t\tcartesianScales.getRangeValue(d.quartiles.q_25)\n\t\t\t\t\t);\n\n\t\t\t\treturn Tools.generateSVGPathString(\n\t\t\t\t\t{ x0, x1, y0, y1 },\n\t\t\t\t\torientation\n\t\t\t\t);\n\t\t\t});\n\n\t\t/*\n\t\t * Draw out and update highlight areas\n\t\t */\n\t\tboxGroupsEnter\n\t\t\t.append('path')\n\t\t\t.merge(boxGroups.select('path.highlight-area'))\n\t\t\t.attr('class', 'highlight-area')\n\t\t\t.attr('opacity', 0)\n\t\t\t.attr('d', d => {\n\t\t\t\tconst x0 =\n\t\t\t\t\tcartesianScales.getDomainValue(d[groupMapsTo]) -\n\t\t\t\t\tboxWidth / 2;\n\t\t\t\tconst x1 = x0 + boxWidth;\n\t\t\t\tconst y0 = cartesianScales.getRangeValue(d.whiskers.min);\n\t\t\t\tconst y1 = cartesianScales.getRangeValue(d.whiskers.max);\n\n\t\t\t\treturn Tools.generateSVGPathString(\n\t\t\t\t\t{ x0, x1, y0, y1 },\n\t\t\t\t\torientation\n\t\t\t\t);\n\t\t\t});\n\n\t\t/*\n\t\t * Draw out and update the starting whisker\n\t\t */\n\t\tboxGroupsEnter\n\t\t\t.append('path')\n\t\t\t.merge(boxGroups.select('path.whisker.start'))\n\t\t\t.attr('class', () =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\toriginalClassName: 'whisker start',\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('stroke-width', Configuration.boxplot.strokeWidth.thicker)\n\t\t\t.attr('fill', 'none')\n\t\t\t.transition(\n\t\t\t\tthis.services.transitions.getTransition(\n\t\t\t\t\t'boxplot-update-startingwhisker',\n\t\t\t\t\tanimate\n\t\t\t\t)\n\t\t\t)\n\t\t\t.attr('d', d => {\n\t\t\t\tconst x0 =\n\t\t\t\t\tcartesianScales.getDomainValue(d[groupMapsTo]) -\n\t\t\t\t\tboxWidth / 4;\n\t\t\t\tconst x1 = x0 + boxWidth / 2;\n\t\t\t\tconst y0 = cartesianScales.getRangeValue(d.whiskers.min);\n\t\t\t\tconst y1 = cartesianScales.getRangeValue(d.whiskers.min);\n\n\t\t\t\treturn Tools.generateSVGPathString(\n\t\t\t\t\t{ x0, x1, y0, y1 },\n\t\t\t\t\torientation\n\t\t\t\t);\n\t\t\t});\n\n\t\t/*\n\t\t * Draw out and update the median line\n\t\t */\n\t\tboxGroupsEnter\n\t\t\t.append('path')\n\t\t\t.merge(boxGroups.select('path.median'))\n\t\t\t.attr('fill', 'none')\n\t\t\t.attr('class', () =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\toriginalClassName: 'median',\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('stroke-width', 2)\n\t\t\t.transition(\n\t\t\t\tthis.services.transitions.getTransition(\n\t\t\t\t\t'boxplot-update-median',\n\t\t\t\t\tanimate\n\t\t\t\t)\n\t\t\t)\n\t\t\t.attr('d', d => {\n\t\t\t\tconst x0 =\n\t\t\t\t\tcartesianScales.getDomainValue(d[groupMapsTo]) -\n\t\t\t\t\tboxWidth / 2;\n\t\t\t\tconst x1 = x0 + boxWidth;\n\t\t\t\tconst y0 = cartesianScales.getRangeValue(d.quartiles.q_50);\n\t\t\t\tconst y1 = y0;\n\n\t\t\t\treturn Tools.generateSVGPathString(\n\t\t\t\t\t{ x0, x1, y0, y1 },\n\t\t\t\t\torientation\n\t\t\t\t);\n\t\t\t});\n\n\t\t/*\n\t\t * Draw out and update the ending whisker\n\t\t */\n\t\tboxGroupsEnter\n\t\t\t.append('path')\n\t\t\t.merge(boxGroups.select('path.whisker.end'))\n\t\t\t.attr('class', () =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.STROKE],\n\t\t\t\t\toriginalClassName: 'whisker end',\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('stroke-width', Configuration.boxplot.strokeWidth.thicker)\n\t\t\t.attr('fill', 'none')\n\t\t\t.transition(\n\t\t\t\tthis.services.transitions.getTransition(\n\t\t\t\t\t'boxplot-update-endingwhisker',\n\t\t\t\t\tanimate\n\t\t\t\t)\n\t\t\t)\n\t\t\t.attr('d', d => {\n\t\t\t\tconst x0 =\n\t\t\t\t\tcartesianScales.getDomainValue(d[groupMapsTo]) -\n\t\t\t\t\tboxWidth / 4;\n\t\t\t\tconst x1 = x0 + boxWidth / 2;\n\t\t\t\tconst y0 = cartesianScales.getRangeValue(d.whiskers.max);\n\t\t\t\tconst y1 = cartesianScales.getRangeValue(d.whiskers.max);\n\n\t\t\t\treturn Tools.generateSVGPathString(\n\t\t\t\t\t{ x0, x1, y0, y1 },\n\t\t\t\t\torientation\n\t\t\t\t);\n\t\t\t});\n\n\t\t/*\n\t\t * Draw out and update the outlier circles\n\t\t */\n\t\tconst circles = allBoxGroups.selectAll('circle.outlier').data((d) =>\n\t\t\td.outliers.map((outlier) => {\n\t\t\t\treturn {\n\t\t\t\t\tmin: d.whiskers.min,\n\t\t\t\t\tmax: d.whiskers.max,\n\t\t\t\t\t[groupMapsTo]: d[groupMapsTo],\n\t\t\t\t\tvalue: outlier,\n\t\t\t\t};\n\t\t\t})\n\t\t);\n\n\t\tcircles.exit().remove();\n\n\t\tconst circlesEnter = circles.enter().append('circle');\n\n\t\tcircles\n\t\t\t.merge(circlesEnter)\n\t\t\t.attr('r', Configuration.boxplot.circle.radius)\n\t\t\t.attr('class', () =>\n\t\t\t\tthis.model.getColorClassName({\n\t\t\t\t\tclassNameTypes: [\n\t\t\t\t\t\tColorClassNameTypes.FILL,\n\t\t\t\t\t\tColorClassNameTypes.STROKE,\n\t\t\t\t\t],\n\t\t\t\t\toriginalClassName: 'outlier',\n\t\t\t\t})\n\t\t\t)\n\t\t\t.attr('fill-opacity', Configuration.boxplot.circle.opacity.default)\n\t\t\t.attr('cx', getXValue)\n\t\t\t.transition(\n\t\t\t\tthis.services.transitions.getTransition(\n\t\t\t\t\t'boxplot-update-circles',\n\t\t\t\t\tanimate\n\t\t\t\t)\n\t\t\t)\n\t\t\t.attr('cy', getYValue);\n\n\t\tthis.addBoxEventListeners();\n\t\tthis.addCircleEventListeners();\n\t}\n\n\taddBoxEventListeners() {\n\t\tconst self = this;\n\n\t\tconst options = this.getOptions();\n\t\tconst { groupMapsTo } = options.data;\n\n\t\tthis.parent\n\t\t\t.selectAll('path.highlight-area')\n\t\t\t.on('mouseover', function (datum) {\n\t\t\t\tconst hoveredElement = select(this);\n\t\t\t\tconst parentElement = select(this.parentNode);\n\t\t\t\tparentElement\n\t\t\t\t\t.select('path.box')\n\t\t\t\t\t.classed('hovered', true)\n\t\t\t\t\t.attr('fill-opacity', Configuration.boxplot.box.opacity.hovered);\n\n\t\t\t\t// Show tooltip for single datapoint\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\thoveredElement,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: options.tooltip.groupLabel || 'Group',\n\t\t\t\t\t\t\tvalue: datum[groupMapsTo],\n\t\t\t\t\t\t\tclass: self.model.getColorClassName({\n\t\t\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.TOOLTIP],\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Minimum',\n\t\t\t\t\t\t\tvalue: datum.whiskers.min,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Q1',\n\t\t\t\t\t\t\tvalue: datum.quartiles.q_25,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Median',\n\t\t\t\t\t\t\tvalue: datum.quartiles.q_50,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Q3',\n\t\t\t\t\t\t\tvalue: datum.quartiles.q_75,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Maximum',\n\t\t\t\t\t\t\tvalue: datum.whiskers.max,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'IQR',\n\t\t\t\t\t\t\tvalue: datum.quartiles.q_75 - datum.quartiles.q_25,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t});\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(\n\t\t\t\t\tEvents.Boxplot.BOX_MOUSEOVER,\n\t\t\t\t\t{\n\t\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\t\tdatum,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t})\n\t\t\t.on('mousemove', function (datum) {\n\t\t\t\tconst hoveredElement = select(this);\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(\n\t\t\t\t\tEvents.Boxplot.BOX_MOUSEMOVE,\n\t\t\t\t\t{\n\t\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\t\tdatum,\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE);\n\t\t\t})\n\t\t\t.on('click', function (datum) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(Events.Boxplot.BOX_CLICK, {\n\t\t\t\t\telement: select(this),\n\t\t\t\t\tdatum,\n\t\t\t\t});\n\t\t\t})\n\t\t\t.on('mouseout', function (datum) {\n\t\t\t\tconst hoveredElement = select(this);\n\t\t\t\tconst parentElement = select(this.parentNode);\n\t\t\t\tparentElement\n\t\t\t\t\t.select('path.box')\n\t\t\t\t\t.classed('hovered', false)\n\t\t\t\t\t.attr('fill-opacity', Configuration.boxplot.box.opacity.default);\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(\n\t\t\t\t\tEvents.Boxplot.BOX_MOUSEOUT,\n\t\t\t\t\t{\n\t\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\t\tdatum,\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement,\n\t\t\t\t});\n\t\t\t});\n\t}\n\n\taddCircleEventListeners() {\n\t\tconst self = this;\n\n\t\tconst options = this.getOptions();\n\t\tconst { groupMapsTo } = options.data;\n\n\t\tconst rangeIdentifier = this.services.cartesianScales.getRangeIdentifier();\n\n\t\tthis.parent\n\t\t\t.selectAll('circle')\n\t\t\t.on('mouseover', function (datum) {\n\t\t\t\tconst hoveredElement = select(this);\n\n\t\t\t\thoveredElement\n\t\t\t\t\t.classed('hovered', true)\n\t\t\t\t\t.attr('fill-opacity', Configuration.boxplot.circle.opacity.hovered)\n\t\t\t\t\t.classed('unfilled', false);\n\n\t\t\t\t// Show tooltip for single datapoint\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.SHOW, {\n\t\t\t\t\thoveredElement,\n\t\t\t\t\titems: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: options.tooltip.groupLabel || 'Group',\n\t\t\t\t\t\t\tvalue: datum[groupMapsTo],\n\t\t\t\t\t\t\tclass: self.model.getColorClassName({\n\t\t\t\t\t\t\t\tclassNameTypes: [ColorClassNameTypes.TOOLTIP],\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'Outlier',\n\t\t\t\t\t\t\tvalue: datum[rangeIdentifier],\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t});\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(\n\t\t\t\t\tEvents.Boxplot.OUTLIER_MOUSEOVER,\n\t\t\t\t\t{\n\t\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\t\tdatum,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t})\n\t\t\t.on('mousemove', function (datum) {\n\t\t\t\tconst hoveredElement = select(this);\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(\n\t\t\t\t\tEvents.Boxplot.OUTLIER_MOUSEMOVE,\n\t\t\t\t\t{\n\t\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\t\tdatum,\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.MOVE);\n\t\t\t})\n\t\t\t.on('click', function (datum) {\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(\n\t\t\t\t\tEvents.Boxplot.OUTLIER_CLICK,\n\t\t\t\t\t{\n\t\t\t\t\t\telement: select(this),\n\t\t\t\t\t\tdatum,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t})\n\t\t\t.on('mouseout', function (datum) {\n\t\t\t\tconst hoveredElement = select(this);\n\t\t\t\thoveredElement\n\t\t\t\t\t.classed('hovered', false)\n\t\t\t\t\t.attr('fill-opacity', Configuration.boxplot.circle.opacity.default);\n\n\t\t\t\t// Dispatch mouse event\n\t\t\t\tself.services.events.dispatchEvent(\n\t\t\t\t\tEvents.Boxplot.OUTLIER_MOUSEOUT,\n\t\t\t\t\t{\n\t\t\t\t\t\telement: hoveredElement,\n\t\t\t\t\t\tdatum,\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\t// Hide tooltip\n\t\t\t\tself.services.events.dispatchEvent(Events.Tooltip.HIDE, {\n\t\t\t\t\thoveredElement,\n\t\t\t\t});\n\t\t\t});\n\t}\n}\n"]}
|
package/components/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './graphs/area-stacked';
|
|
|
10
10
|
export * from './graphs/bar-simple';
|
|
11
11
|
export * from './graphs/bar-grouped';
|
|
12
12
|
export * from './graphs/bar-stacked';
|
|
13
|
+
export * from './graphs/boxplot';
|
|
13
14
|
export * from './graphs/bubble';
|
|
14
15
|
export * from './graphs/line';
|
|
15
16
|
export * from './graphs/lollipop';
|
package/components/index.js
CHANGED
|
@@ -12,6 +12,7 @@ export * from './graphs/area-stacked';
|
|
|
12
12
|
export * from './graphs/bar-simple';
|
|
13
13
|
export * from './graphs/bar-grouped';
|
|
14
14
|
export * from './graphs/bar-stacked';
|
|
15
|
+
export * from './graphs/boxplot';
|
|
15
16
|
export * from './graphs/bubble';
|
|
16
17
|
export * from './graphs/line';
|
|
17
18
|
export * from './graphs/lollipop';
|
package/components/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAE5B,aAAa;AACb,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAE1C,SAAS;AACT,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAE/B,SAAS;AACT,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAEhC,OAAO;AACP,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC","sourcesContent":["export * from './component';\n\n// ESSENTIALS\nexport * from './essentials/legend';\nexport * from './essentials/threshold';\nexport * from './essentials/title';\nexport * from './essentials/title-meter';\nexport * from './essentials/tooltip';\nexport * from './essentials/tooltip-axis';\n\n// GRAPHS\nexport * from './graphs/area';\nexport * from './graphs/area-stacked';\nexport * from './graphs/bar-simple';\nexport * from './graphs/bar-grouped';\nexport * from './graphs/bar-stacked';\nexport * from './graphs/bubble';\nexport * from './graphs/line';\nexport * from './graphs/lollipop';\nexport * from './graphs/scatter';\nexport * from './graphs/scatter-stacked';\nexport * from './graphs/pie';\nexport * from './graphs/gauge';\nexport * from './graphs/donut';\nexport * from './graphs/skeleton';\nexport * from './graphs/skeleton-lines';\nexport * from './graphs/treemap';\nexport * from './graphs/radar';\n\n// Layout\nexport * from './layout/spacer';\nexport * from './layout/layout';\n\n// MISC\nexport * from './axes/two-dimensional-axes';\nexport * from './axes/axis';\nexport * from './axes/grid-brush';\nexport * from './axes/chart-clip';\nexport * from './axes/grid';\nexport * from './axes/ruler';\nexport * from './axes/ruler-stacked';\nexport * from './axes/toolbar';\nexport * from './axes/zero-line';\nexport * from './axes/zoom-bar';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAE5B,aAAa;AACb,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAE1C,SAAS;AACT,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAE/B,SAAS;AACT,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAEhC,OAAO;AACP,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC","sourcesContent":["export * from './component';\n\n// ESSENTIALS\nexport * from './essentials/legend';\nexport * from './essentials/threshold';\nexport * from './essentials/title';\nexport * from './essentials/title-meter';\nexport * from './essentials/tooltip';\nexport * from './essentials/tooltip-axis';\n\n// GRAPHS\nexport * from './graphs/area';\nexport * from './graphs/area-stacked';\nexport * from './graphs/bar-simple';\nexport * from './graphs/bar-grouped';\nexport * from './graphs/bar-stacked';\nexport * from './graphs/boxplot';\nexport * from './graphs/bubble';\nexport * from './graphs/line';\nexport * from './graphs/lollipop';\nexport * from './graphs/scatter';\nexport * from './graphs/scatter-stacked';\nexport * from './graphs/pie';\nexport * from './graphs/gauge';\nexport * from './graphs/donut';\nexport * from './graphs/skeleton';\nexport * from './graphs/skeleton-lines';\nexport * from './graphs/treemap';\nexport * from './graphs/radar';\n\n// Layout\nexport * from './layout/spacer';\nexport * from './layout/layout';\n\n// MISC\nexport * from './axes/two-dimensional-axes';\nexport * from './axes/axis';\nexport * from './axes/grid-brush';\nexport * from './axes/chart-clip';\nexport * from './axes/grid';\nexport * from './axes/ruler';\nexport * from './axes/ruler-stacked';\nexport * from './axes/toolbar';\nexport * from './axes/zero-line';\nexport * from './axes/zoom-bar';\n"]}
|
|
@@ -24,6 +24,25 @@ export declare const axis: {
|
|
|
24
24
|
};
|
|
25
25
|
paddingRatio: number;
|
|
26
26
|
};
|
|
27
|
+
export declare const boxplot: {
|
|
28
|
+
circle: {
|
|
29
|
+
radius: number;
|
|
30
|
+
opacity: {
|
|
31
|
+
hovered: number;
|
|
32
|
+
default: number;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
box: {
|
|
36
|
+
opacity: {
|
|
37
|
+
hovered: number;
|
|
38
|
+
default: number;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
strokeWidth: {
|
|
42
|
+
default: number;
|
|
43
|
+
thicker: number;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
27
46
|
export declare const legend: {
|
|
28
47
|
items: {
|
|
29
48
|
status: {
|
|
@@ -25,6 +25,25 @@ export var axis = {
|
|
|
25
25
|
},
|
|
26
26
|
paddingRatio: 0.1,
|
|
27
27
|
};
|
|
28
|
+
export var boxplot = {
|
|
29
|
+
circle: {
|
|
30
|
+
radius: 4,
|
|
31
|
+
opacity: {
|
|
32
|
+
hovered: 1,
|
|
33
|
+
default: 0.3,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
box: {
|
|
37
|
+
opacity: {
|
|
38
|
+
hovered: 0.5,
|
|
39
|
+
default: 0.3,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
strokeWidth: {
|
|
43
|
+
default: 1,
|
|
44
|
+
thicker: 2,
|
|
45
|
+
},
|
|
46
|
+
};
|
|
28
47
|
export var legend = {
|
|
29
48
|
items: {
|
|
30
49
|
status: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration-non-customizable.js","sourceRoot":"","sources":["configuration-non-customizable.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,CAAC,IAAM,KAAK,GAAG;IACpB,cAAc,EAAE;QACf,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,CAAC;QACZ,UAAU,EAAE,CAAC;KACb;CACD,CAAC;AAEF,MAAM,CAAC,IAAM,IAAI,GAAG;IACnB,OAAO,EA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pairingOptions: {\n\t\t'1-color': 4,\n\t\t'2-color': 5,\n\t\t'3-color': 5,\n\t\t'4-color': 3,\n\t\t'5-color': 2,\n\t\t'14-color': 1,\n\t},\n};\n\nexport const area = {\n\topacity: {\n\t\tunselected: 0,\n\t\tselected: 0.4,\n\t},\n};\n\nexport const axis = {\n\tticks: {\n\t\tnumber: 7,\n\t\trotateIfSmallerThan: 30,\n\t\tverticalSpaceRatio: 2.5,\n\t\thorizontalSpaceRatio: 3.5,\n\t},\n\tpaddingRatio: 0.1,\n};\n\nexport const legend = {\n\titems: {\n\t\tstatus: {\n\t\t\tACTIVE: 1,\n\t\t\tDISABLED: 0,\n\t\t},\n\t\thorizontalSpace: 12,\n\t\tverticalSpace: 24,\n\t\ttextYOffset: 8,\n\t},\n\tcheckbox: {\n\t\tradius: 6.5,\n\t\tspaceAfter: 4,\n\t},\n};\n\nexport const lines = {\n\topacity: {\n\t\tunselected: 0.3,\n\t\tselected: 1,\n\t},\n\tweight: {\n\t\tselected: 2,\n\t\tunselected: 1,\n\t},\n};\n\nexport const meter = {\n\tstatusBar: {\n\t\tpaddingRight: 5,\n\t},\n\tstatus: {\n\t\tindicatorSize: 16,\n\t\tpaddingLeft: 15,\n\t},\n};\n\nexport const pie = {\n\tradiusOffset: -15,\n\tinnerRadius: 2,\n\tpadAngle: 0.007,\n\thoverArc: {\n\t\touterRadiusOffset: 3,\n\t},\n\txOffset: 30,\n\tyOffset: 20,\n\tyOffsetCallout: 10,\n\tcallout: {\n\t\tminSliceDegree: 5,\n\t\toffsetX: 15,\n\t\toffsetY: 12,\n\t\thorizontalLineLength: 8,\n\t\ttextMargin: 2,\n\t},\n};\n\nexport const radar = {\n\topacity: {\n\t\tunselected: 0.1,\n\t\tselected: 0.3,\n\t},\n\txLabelPadding: 10,\n\tyLabelPadding: 8,\n\tyTicksNumber: 4,\n\tminRange: 10,\n\txAxisRectHeight: 50,\n\tdotsRadius: 5,\n};\n\nexport const spacers = {\n\tdefault: {\n\t\tsize: 24,\n\t},\n};\n\nexport const tooltips = {\n\thorizontalOffset: 10,\n};\n\n/**\n * Base transition configuration\n */\nexport const transitions = {\n\tdefault: {\n\t\tduration: 300,\n\t},\n\tpie_slice_mouseover: {\n\t\tduration: 100,\n\t},\n\tpie_chart_titles: {\n\t\tduration: 375,\n\t},\n\tgraph_element_mouseover_fill_update: {\n\t\tduration: 100,\n\t},\n\tgraph_element_mouseout_fill_update: {\n\t\tduration: 100,\n\t},\n};\n\nexport const toolbar = {\n\tbuttonSize: 32,\n\ticonSize: 20,\n\theight: 32,\n\tspacerHeight: 10,\n\ticonPadding: 6,\n};\n\nexport const zoomBar = {\n\theight: {\n\t\t[ZoomBarTypes.GRAPH_VIEW]: 32,\n\t\t[ZoomBarTypes.SLIDER_VIEW]: 10,\n\t},\n\tspacerHeight: 8,\n\thandleWidth: 5,\n\thandleBarWidth: 1,\n\thandleBarHeight: 12,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"configuration-non-customizable.js","sourceRoot":"","sources":["configuration-non-customizable.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,CAAC,IAAM,KAAK,GAAG;IACpB,cAAc,EAAE;QACf,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,CAAC;QACZ,UAAU,EAAE,CAAC;KACb;CACD,CAAC;AAEF,MAAM,CAAC,IAAM,IAAI,GAAG;IACnB,OAAO,EAAE;QACR,UAAU,EAAE,CAAC;QACb,QAAQ,EAAE,GAAG;KACb;CACD,CAAC;AAEF,MAAM,CAAC,IAAM,IAAI,GAAG;IACnB,KAAK,EAAE;QACN,MAAM,EAAE,CAAC;QACT,mBAAmB,EAAE,EAAE;QACvB,kBAAkB,EAAE,GAAG;QACvB,oBAAoB,EAAE,GAAG;KACzB;IACD,YAAY,EAAE,GAAG;CACjB,CAAC;A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nB,CAAC","sourcesContent":["import { ZoomBarTypes } from './interfaces';\n\nexport const color = {\n\tpairingOptions: {\n\t\t'1-color': 4,\n\t\t'2-color': 5,\n\t\t'3-color': 5,\n\t\t'4-color': 3,\n\t\t'5-color': 2,\n\t\t'14-color': 1,\n\t},\n};\n\nexport const area = {\n\topacity: {\n\t\tunselected: 0,\n\t\tselected: 0.4,\n\t},\n};\n\nexport const axis = {\n\tticks: {\n\t\tnumber: 7,\n\t\trotateIfSmallerThan: 30,\n\t\tverticalSpaceRatio: 2.5,\n\t\thorizontalSpaceRatio: 3.5,\n\t},\n\tpaddingRatio: 0.1,\n};\n\nexport const boxplot = {\n\tcircle: {\n\t\tradius: 4,\n\t\topacity: {\n\t\t\thovered: 1,\n\t\t\tdefault: 0.3,\n\t\t},\n\t},\n\tbox: {\n\t\topacity: {\n\t\t\thovered: 0.5,\n\t\t\tdefault: 0.3,\n\t\t},\n\t},\n\tstrokeWidth: {\n\t\tdefault: 1,\n\t\tthicker: 2,\n\t},\n};\n\nexport const legend = {\n\titems: {\n\t\tstatus: {\n\t\t\tACTIVE: 1,\n\t\t\tDISABLED: 0,\n\t\t},\n\t\thorizontalSpace: 12,\n\t\tverticalSpace: 24,\n\t\ttextYOffset: 8,\n\t},\n\tcheckbox: {\n\t\tradius: 6.5,\n\t\tspaceAfter: 4,\n\t},\n};\n\nexport const lines = {\n\topacity: {\n\t\tunselected: 0.3,\n\t\tselected: 1,\n\t},\n\tweight: {\n\t\tselected: 2,\n\t\tunselected: 1,\n\t},\n};\n\nexport const meter = {\n\tstatusBar: {\n\t\tpaddingRight: 5,\n\t},\n\tstatus: {\n\t\tindicatorSize: 16,\n\t\tpaddingLeft: 15,\n\t},\n};\n\nexport const pie = {\n\tradiusOffset: -15,\n\tinnerRadius: 2,\n\tpadAngle: 0.007,\n\thoverArc: {\n\t\touterRadiusOffset: 3,\n\t},\n\txOffset: 30,\n\tyOffset: 20,\n\tyOffsetCallout: 10,\n\tcallout: {\n\t\tminSliceDegree: 5,\n\t\toffsetX: 15,\n\t\toffsetY: 12,\n\t\thorizontalLineLength: 8,\n\t\ttextMargin: 2,\n\t},\n};\n\nexport const radar = {\n\topacity: {\n\t\tunselected: 0.1,\n\t\tselected: 0.3,\n\t},\n\txLabelPadding: 10,\n\tyLabelPadding: 8,\n\tyTicksNumber: 4,\n\tminRange: 10,\n\txAxisRectHeight: 50,\n\tdotsRadius: 5,\n};\n\nexport const spacers = {\n\tdefault: {\n\t\tsize: 24,\n\t},\n};\n\nexport const tooltips = {\n\thorizontalOffset: 10,\n};\n\n/**\n * Base transition configuration\n */\nexport const transitions = {\n\tdefault: {\n\t\tduration: 300,\n\t},\n\tpie_slice_mouseover: {\n\t\tduration: 100,\n\t},\n\tpie_chart_titles: {\n\t\tduration: 375,\n\t},\n\tgraph_element_mouseover_fill_update: {\n\t\tduration: 100,\n\t},\n\tgraph_element_mouseout_fill_update: {\n\t\tduration: 100,\n\t},\n};\n\nexport const toolbar = {\n\tbuttonSize: 32,\n\ticonSize: 20,\n\theight: 32,\n\tspacerHeight: 10,\n\ticonPadding: 6,\n};\n\nexport const zoomBar = {\n\theight: {\n\t\t[ZoomBarTypes.GRAPH_VIEW]: 32,\n\t\t[ZoomBarTypes.SLIDER_VIEW]: 10,\n\t},\n\tspacerHeight: 8,\n\thandleWidth: 5,\n\thandleBarWidth: 1,\n\thandleBarHeight: 12,\n};\n"]}
|
package/configuration.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseChartOptions, AxisChartOptions, ScatterChartOptions, LollipopChartOptions, LineChartOptions, BarChartOptions, StackedBarChartOptions, AreaChartOptions, PieChartOptions, GaugeChartOptions, DonutChartOptions, BubbleChartOptions, RadarChartOptions, ComboChartOptions, TreemapChartOptions, GridOptions, RulerOptions, TimeScaleOptions, TooltipOptions, MeterChartOptions } from './interfaces';
|
|
1
|
+
import { BaseChartOptions, AxisChartOptions, ScatterChartOptions, LollipopChartOptions, LineChartOptions, BarChartOptions, StackedBarChartOptions, BoxplotChartOptions, AreaChartOptions, PieChartOptions, GaugeChartOptions, DonutChartOptions, BubbleChartOptions, RadarChartOptions, ComboChartOptions, TreemapChartOptions, GridOptions, RulerOptions, TimeScaleOptions, TooltipOptions, MeterChartOptions } from './interfaces';
|
|
2
2
|
/**
|
|
3
3
|
* Grid options
|
|
4
4
|
*/
|
|
@@ -18,6 +18,7 @@ export declare const options: {
|
|
|
18
18
|
simpleBarChart: BarChartOptions;
|
|
19
19
|
groupedBarChart: BarChartOptions;
|
|
20
20
|
stackedBarChart: StackedBarChartOptions;
|
|
21
|
+
boxplotChart: BoxplotChartOptions;
|
|
21
22
|
bubbleChart: BubbleChartOptions;
|
|
22
23
|
lineChart: LineChartOptions;
|
|
23
24
|
areaChart: AreaChartOptions;
|
package/configuration.js
CHANGED
|
@@ -176,6 +176,10 @@ var stackedBarChart = Tools.merge({}, baseBarChart, {
|
|
|
176
176
|
dividerSize: 1.5,
|
|
177
177
|
}),
|
|
178
178
|
});
|
|
179
|
+
/**
|
|
180
|
+
* options specific to boxplot charts
|
|
181
|
+
*/
|
|
182
|
+
var boxplotChart = Tools.merge({}, baseBarChart, {});
|
|
179
183
|
/**
|
|
180
184
|
* options specific to scatter charts
|
|
181
185
|
*/
|
|
@@ -342,6 +346,7 @@ export var options = {
|
|
|
342
346
|
simpleBarChart: simpleBarChart,
|
|
343
347
|
groupedBarChart: groupedBarChart,
|
|
344
348
|
stackedBarChart: stackedBarChart,
|
|
349
|
+
boxplotChart: boxplotChart,
|
|
345
350
|
bubbleChart: bubbleChart,
|
|
346
351
|
lineChart: lineChart,
|
|
347
352
|
areaChart: areaChart,
|