billboard.js 3.11.3 → 3.12.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -5
- package/dist/billboard.css +5 -1
- package/dist/billboard.js +19433 -24307
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +26 -3
- package/dist/billboard.pkgd.js +22302 -29071
- package/dist/billboard.pkgd.min.js +33 -3
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +77 -175
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -3
- package/dist/plugin/billboardjs-plugin-sparkline.js +423 -1134
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +4 -3
- package/dist/plugin/billboardjs-plugin-stanford.js +660 -1524
- package/dist/plugin/billboardjs-plugin-stanford.min.js +15 -3
- package/dist/plugin/billboardjs-plugin-tableview.js +503 -1175
- package/dist/plugin/billboardjs-plugin-tableview.min.js +30 -3
- package/dist/plugin/billboardjs-plugin-textoverlap.js +351 -1055
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +4 -3
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +339 -1324
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +5 -3
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +1701 -3424
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +7 -3
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2385 -4462
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +18 -3
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +1783 -3467
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +33 -3
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2031 -3979
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +7 -3
- package/dist/theme/dark.css +5 -1
- package/dist/theme/dark.min.css +2 -2
- package/dist/theme/datalab.css +5 -1
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +5 -1
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +5 -1
- package/dist/theme/insight.min.css +2 -2
- package/dist/theme/modern.css +5 -1
- package/dist/theme/modern.min.css +3 -4
- package/dist-esm/billboard.js +9035 -8651
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +19 -25
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +149 -148
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +295 -286
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +235 -234
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +40 -41
- package/package.json +24 -44
- package/src/Chart/api/axis.ts +6 -13
- package/src/Chart/api/chart.ts +12 -11
- package/src/Chart/api/data.ts +8 -7
- package/src/Chart/api/export.ts +28 -21
- package/src/Chart/api/flow.ts +4 -2
- package/src/Chart/api/grid.ts +1 -5
- package/src/Chart/api/load.ts +2 -2
- package/src/Chart/api/regions.ts +29 -5
- package/src/Chart/api/selection.ts +2 -2
- package/src/Chart/api/show.ts +2 -3
- package/src/Chart/api/subchart.ts +2 -2
- package/src/Chart/api/tooltip.ts +5 -7
- package/src/Chart/api/x.ts +2 -2
- package/src/Chart/api/zoom.ts +2 -2
- package/src/ChartInternal/Axis/Axis.ts +119 -44
- package/src/ChartInternal/Axis/AxisRenderer.ts +53 -38
- package/src/ChartInternal/Axis/AxisRendererHelper.ts +2 -2
- package/src/ChartInternal/ChartInternal.ts +79 -51
- package/src/ChartInternal/data/IData.ts +24 -31
- package/src/ChartInternal/data/convert.helper.ts +66 -68
- package/src/ChartInternal/data/convert.ts +11 -11
- package/src/ChartInternal/data/data.ts +40 -23
- package/src/ChartInternal/data/load.ts +7 -6
- package/src/ChartInternal/interactions/drag.ts +2 -1
- package/src/ChartInternal/interactions/eventrect.ts +54 -25
- package/src/ChartInternal/interactions/flow.ts +14 -4
- package/src/ChartInternal/interactions/interaction.ts +34 -12
- package/src/ChartInternal/interactions/subchart.ts +27 -25
- package/src/ChartInternal/interactions/zoom.ts +29 -18
- package/src/ChartInternal/internals/category.ts +1 -1
- package/src/ChartInternal/internals/class.ts +5 -5
- package/src/ChartInternal/internals/clip.ts +8 -4
- package/src/ChartInternal/internals/color.ts +70 -42
- package/src/ChartInternal/internals/domain.ts +59 -28
- package/src/ChartInternal/internals/format.ts +5 -5
- package/src/ChartInternal/internals/grid.ts +130 -47
- package/src/ChartInternal/internals/legend.ts +93 -61
- package/src/ChartInternal/internals/redraw.ts +3 -2
- package/src/ChartInternal/internals/region.ts +5 -3
- package/src/ChartInternal/internals/scale.ts +28 -15
- package/src/ChartInternal/internals/selection.ts +14 -13
- package/src/ChartInternal/internals/size.axis.ts +18 -10
- package/src/ChartInternal/internals/size.ts +97 -66
- package/src/ChartInternal/internals/style.ts +21 -19
- package/src/ChartInternal/internals/text.ts +64 -39
- package/src/ChartInternal/internals/title.ts +2 -2
- package/src/ChartInternal/internals/tooltip.ts +73 -28
- package/src/ChartInternal/internals/transform.ts +2 -2
- package/src/ChartInternal/internals/type.ts +12 -12
- package/src/ChartInternal/shape/arc.ts +78 -44
- package/src/ChartInternal/shape/area.ts +19 -22
- package/src/ChartInternal/shape/bar.ts +41 -31
- package/src/ChartInternal/shape/bubble.ts +5 -5
- package/src/ChartInternal/shape/candlestick.ts +15 -13
- package/src/ChartInternal/shape/gauge.ts +16 -9
- package/src/ChartInternal/shape/line.ts +62 -46
- package/src/ChartInternal/shape/point.common.ts +1 -4
- package/src/ChartInternal/shape/point.ts +52 -32
- package/src/ChartInternal/shape/polar.ts +4 -2
- package/src/ChartInternal/shape/radar.ts +40 -22
- package/src/ChartInternal/shape/shape.ts +84 -58
- package/src/ChartInternal/shape/treemap.ts +29 -20
- package/src/Plugin/bubblecompare/index.ts +1 -3
- package/src/Plugin/sparkline/index.ts +3 -4
- package/src/Plugin/stanford/ColorScale.ts +3 -2
- package/src/Plugin/stanford/Elements.ts +15 -6
- package/src/Plugin/stanford/Options.ts +5 -5
- package/src/Plugin/stanford/index.ts +13 -9
- package/src/Plugin/tableview/Options.ts +1 -1
- package/src/Plugin/tableview/const.ts +1 -4
- package/src/Plugin/tableview/index.ts +11 -9
- package/src/Plugin/textoverlap/index.ts +4 -6
- package/src/config/Options/Options.ts +3 -3
- package/src/config/Options/axis/axis.ts +36 -0
- package/src/config/Options/axis/x.ts +12 -13
- package/src/config/Options/axis/y.ts +13 -13
- package/src/config/Options/axis/y2.ts +23 -10
- package/src/config/Options/common/color.ts +4 -4
- package/src/config/Options/common/grid.ts +4 -4
- package/src/config/Options/common/legend.ts +12 -13
- package/src/config/Options/common/main.ts +23 -23
- package/src/config/Options/common/point.ts +17 -18
- package/src/config/Options/common/title.ts +2 -2
- package/src/config/Options/common/tooltip.ts +13 -11
- package/src/config/Options/data/axis.ts +2 -2
- package/src/config/Options/data/data.ts +45 -45
- package/src/config/Options/interaction/interaction.ts +1 -1
- package/src/config/Options/interaction/subchart.ts +2 -2
- package/src/config/Options/interaction/zoom.ts +9 -9
- package/src/config/Options/shape/arc.ts +10 -13
- package/src/config/Options/shape/area.ts +5 -7
- package/src/config/Options/shape/bar.ts +8 -10
- package/src/config/Options/shape/bubble.ts +1 -1
- package/src/config/Options/shape/candlestick.ts +2 -2
- package/src/config/Options/shape/donut.ts +4 -4
- package/src/config/Options/shape/gauge.ts +6 -6
- package/src/config/Options/shape/line.ts +3 -3
- package/src/config/Options/shape/pie.ts +5 -5
- package/src/config/Options/shape/polar.ts +3 -3
- package/src/config/Options/shape/radar.ts +2 -2
- package/src/config/Options/shape/scatter.ts +1 -1
- package/src/config/Options/shape/treemap.ts +1 -1
- package/src/config/Store/Element.ts +8 -5
- package/src/config/Store/State.ts +19 -13
- package/src/config/classes.ts +6 -4
- package/src/config/config.ts +1 -1
- package/src/config/resolver/axis.ts +4 -4
- package/src/config/resolver/interaction.ts +3 -7
- package/src/config/resolver/shape.ts +11 -12
- package/src/core.ts +2 -3
- package/src/index.esm.ts +2 -6
- package/src/index.ts +2 -2
- package/src/module/Cache.ts +2 -3
- package/src/module/browser.ts +15 -10
- package/src/module/error.ts +9 -8
- package/src/module/generator.ts +3 -5
- package/src/module/util.ts +60 -37
- package/src/module/worker.ts +14 -11
- package/src/scss/billboard.scss +6 -0
- package/src/scss/theme/dark.scss +6 -0
- package/src/scss/theme/datalab.scss +6 -0
- package/src/scss/theme/graph.scss +6 -0
- package/src/scss/theme/insight.scss +6 -0
- package/src/scss/theme/modern.scss +6 -0
- package/types/axis.d.ts +7 -0
- package/types/options.d.ts +7 -0
- package/types/options.shape.d.ts +7 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.12.0-next.1
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -83,224 +83,126 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
83
83
|
"default": function() { return /* binding */ BubbleCompare; }
|
|
84
84
|
});
|
|
85
85
|
|
|
86
|
-
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/newArrowCheck.js
|
|
87
|
-
function _newArrowCheck(innerThis, boundThis) {
|
|
88
|
-
if (innerThis !== boundThis) {
|
|
89
|
-
throw new TypeError("Cannot instantiate an arrow function");
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
|
|
93
|
-
function _assertThisInitialized(self) {
|
|
94
|
-
if (self === void 0) {
|
|
95
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
96
|
-
}
|
|
97
|
-
return self;
|
|
98
|
-
}
|
|
99
|
-
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
|
|
100
|
-
function _setPrototypeOf(o, p) {
|
|
101
|
-
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
102
|
-
o.__proto__ = p;
|
|
103
|
-
return o;
|
|
104
|
-
};
|
|
105
|
-
return _setPrototypeOf(o, p);
|
|
106
|
-
}
|
|
107
|
-
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
|
|
108
|
-
|
|
109
|
-
function _inheritsLoose(subClass, superClass) {
|
|
110
|
-
subClass.prototype = Object.create(superClass.prototype);
|
|
111
|
-
subClass.prototype.constructor = subClass;
|
|
112
|
-
_setPrototypeOf(subClass, superClass);
|
|
113
|
-
}
|
|
114
86
|
// EXTERNAL MODULE: external {"commonjs":"d3-selection","commonjs2":"d3-selection","amd":"d3-selection","root":"d3"}
|
|
115
87
|
var external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_ = __webpack_require__(1);
|
|
116
88
|
;// CONCATENATED MODULE: ./src/Plugin/Plugin.ts
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
* @class Plugin
|
|
125
|
-
*/
|
|
126
|
-
/**
|
|
127
|
-
* Version info string for plugin
|
|
128
|
-
* @name version
|
|
129
|
-
* @static
|
|
130
|
-
* @memberof Plugin
|
|
131
|
-
* @type {string}
|
|
132
|
-
* @example
|
|
133
|
-
* bb.plugin.stanford.version; // ex) 1.9.0
|
|
134
|
-
*/
|
|
135
|
-
let Plugin = /*#__PURE__*/function () {
|
|
89
|
+
var __defProp = Object.defineProperty;
|
|
90
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
91
|
+
var __publicField = (obj, key, value) => {
|
|
92
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
93
|
+
return value;
|
|
94
|
+
};
|
|
95
|
+
class Plugin {
|
|
136
96
|
/**
|
|
137
97
|
* Constructor
|
|
138
98
|
* @param {Any} options config option object
|
|
139
99
|
* @private
|
|
140
100
|
*/
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
this.$$ = void 0;
|
|
146
|
-
this.options = void 0;
|
|
101
|
+
constructor(options = {}) {
|
|
102
|
+
__publicField(this, "$$");
|
|
103
|
+
__publicField(this, "options");
|
|
147
104
|
this.options = options;
|
|
148
105
|
}
|
|
149
|
-
|
|
150
106
|
/**
|
|
151
107
|
* Lifecycle hook for 'beforeInit' phase.
|
|
152
108
|
* @private
|
|
153
109
|
*/
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
110
|
+
$beforeInit() {
|
|
111
|
+
}
|
|
157
112
|
/**
|
|
158
113
|
* Lifecycle hook for 'init' phase.
|
|
159
114
|
* @private
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
115
|
+
*/
|
|
116
|
+
$init() {
|
|
117
|
+
}
|
|
163
118
|
/**
|
|
164
119
|
* Lifecycle hook for 'afterInit' phase.
|
|
165
120
|
* @private
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
121
|
+
*/
|
|
122
|
+
$afterInit() {
|
|
123
|
+
}
|
|
169
124
|
/**
|
|
170
125
|
* Lifecycle hook for 'redraw' phase.
|
|
171
126
|
* @private
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
127
|
+
*/
|
|
128
|
+
$redraw() {
|
|
129
|
+
}
|
|
175
130
|
/**
|
|
176
131
|
* Lifecycle hook for 'willDestroy' phase.
|
|
177
132
|
* @private
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
Object.keys(this).forEach(function (key) {
|
|
182
|
-
_newArrowCheck(this, _this);
|
|
133
|
+
*/
|
|
134
|
+
$willDestroy() {
|
|
135
|
+
Object.keys(this).forEach((key) => {
|
|
183
136
|
this[key] = null;
|
|
184
137
|
delete this[key];
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
Plugin.version = "3.11.3";
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
__publicField(Plugin, "version", "3.12.0-next.1");
|
|
190
142
|
|
|
191
143
|
;// CONCATENATED MODULE: ./src/Plugin/bubblecompare/index.ts
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
* - [d3-selection](https://github.com/d3/d3-selection)
|
|
206
|
-
* @class plugin-bubblecompare
|
|
207
|
-
* @requires d3-selection
|
|
208
|
-
* @param {object} options bubble compare plugin options
|
|
209
|
-
* @augments Plugin
|
|
210
|
-
* @returns {BubbleCompare}
|
|
211
|
-
* @example
|
|
212
|
-
* // Plugin must be loaded before the use.
|
|
213
|
-
* <script src="$YOUR_PATH/plugin/billboardjs-plugin-bubblecompare.js"></script>
|
|
214
|
-
*
|
|
215
|
-
* var chart = bb.generate({
|
|
216
|
-
* data: {
|
|
217
|
-
* columns: [ ... ],
|
|
218
|
-
* type: "bubble"
|
|
219
|
-
* }
|
|
220
|
-
* ...
|
|
221
|
-
* plugins: [
|
|
222
|
-
* new bb.plugin.bubblecompare({
|
|
223
|
-
* minR: 11,
|
|
224
|
-
* maxR: 74,
|
|
225
|
-
* expandScale: 1.1
|
|
226
|
-
* }),
|
|
227
|
-
* ]
|
|
228
|
-
* });
|
|
229
|
-
* @example
|
|
230
|
-
* import {bb} from "billboard.js";
|
|
231
|
-
* import BubbleCompare from "billboard.js/dist/billboardjs-plugin-bubblecompare";
|
|
232
|
-
*
|
|
233
|
-
* bb.generate({
|
|
234
|
-
* plugins: [
|
|
235
|
-
* new BubbleCompare({ ... })
|
|
236
|
-
* ]
|
|
237
|
-
* })
|
|
238
|
-
*/
|
|
239
|
-
let BubbleCompare = /*#__PURE__*/function (_Plugin) {
|
|
240
|
-
_inheritsLoose(BubbleCompare, _Plugin);
|
|
241
|
-
function BubbleCompare(options) {
|
|
242
|
-
var _this = _Plugin.call(this, options) || this;
|
|
243
|
-
_this.$$ = void 0;
|
|
244
|
-
return _assertThisInitialized(_this) || _assertThisInitialized(_this);
|
|
144
|
+
var bubblecompare_defProp = Object.defineProperty;
|
|
145
|
+
var bubblecompare_defNormalProp = (obj, key, value) => key in obj ? bubblecompare_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
146
|
+
var bubblecompare_publicField = (obj, key, value) => {
|
|
147
|
+
bubblecompare_defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
148
|
+
return value;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
const _BubbleCompare = class _BubbleCompare extends Plugin {
|
|
153
|
+
constructor(options) {
|
|
154
|
+
super(options);
|
|
155
|
+
bubblecompare_publicField(this, "$$");
|
|
156
|
+
return this;
|
|
245
157
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
const $$ = this.$$;
|
|
158
|
+
$init() {
|
|
159
|
+
const { $$ } = this;
|
|
249
160
|
$$.findClosest = this.findClosest.bind(this);
|
|
250
161
|
$$.getBubbleR = this.getBubbleR.bind(this);
|
|
251
162
|
$$.pointExpandedR = this.pointExpandedR.bind(this);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
const baseR = this.getBubbleR(d)
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
BubbleCompare.raiseFocusedBubbleLayer(d);
|
|
163
|
+
}
|
|
164
|
+
pointExpandedR(d) {
|
|
165
|
+
const baseR = this.getBubbleR(d);
|
|
166
|
+
const { expandScale = 1 } = this.options;
|
|
167
|
+
_BubbleCompare.raiseFocusedBubbleLayer(d);
|
|
258
168
|
this.changeCursorPoint();
|
|
259
169
|
return baseR * expandScale;
|
|
260
|
-
}
|
|
261
|
-
|
|
170
|
+
}
|
|
171
|
+
static raiseFocusedBubbleLayer(d) {
|
|
262
172
|
d.raise && (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(d.node().parentNode.parentNode).raise();
|
|
263
|
-
}
|
|
264
|
-
|
|
173
|
+
}
|
|
174
|
+
changeCursorPoint() {
|
|
265
175
|
this.$$.$el.eventRect.style("cursor", "pointer");
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
return values.filter(function (v) {
|
|
271
|
-
_newArrowCheck(this, _this2);
|
|
272
|
-
return v && !$$.isBarType(v.id);
|
|
273
|
-
}.bind(this)).reduce(function (acc, cur) {
|
|
274
|
-
_newArrowCheck(this, _this2);
|
|
176
|
+
}
|
|
177
|
+
findClosest(values, pos) {
|
|
178
|
+
const { $$ } = this;
|
|
179
|
+
return values.filter((v) => v && !$$.isBarType(v.id)).reduce((acc, cur) => {
|
|
275
180
|
const d = $$.dist(cur, pos);
|
|
276
181
|
return d < this.getBubbleR(cur) ? cur : acc;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
const _this$$$$data$targets = this.$$.data.targets.reduce(function (_ref, cur) {
|
|
287
|
-
let accMin = _ref[0],
|
|
288
|
-
accMax = _ref[1];
|
|
289
|
-
_newArrowCheck(this, _this3);
|
|
182
|
+
}, 0);
|
|
183
|
+
}
|
|
184
|
+
getBubbleR(d) {
|
|
185
|
+
const { minR, maxR } = this.options;
|
|
186
|
+
const curVal = this.getZData(d);
|
|
187
|
+
if (!curVal)
|
|
188
|
+
return minR;
|
|
189
|
+
const [min, max] = this.$$.data.targets.reduce(
|
|
190
|
+
([accMin, accMax], cur) => {
|
|
290
191
|
const val = this.getZData(cur.values[0]);
|
|
291
192
|
return [Math.min(accMin, val), Math.max(accMax, val)];
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
193
|
+
},
|
|
194
|
+
[1e4, 0]
|
|
195
|
+
);
|
|
196
|
+
const size = min > 0 && max === min ? 0 : curVal / max;
|
|
296
197
|
return Math.abs(size) * (maxR - minR) + minR;
|
|
297
|
-
}
|
|
298
|
-
|
|
198
|
+
}
|
|
199
|
+
getZData(d) {
|
|
299
200
|
return this.$$.isBubbleZType(d) ? this.$$.getBubbleZData(d.value, "z") : d.value;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
BubbleCompare
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
bubblecompare_publicField(_BubbleCompare, "version", `0.0.1`);
|
|
204
|
+
let BubbleCompare = _BubbleCompare;
|
|
205
|
+
|
|
304
206
|
|
|
305
207
|
}();
|
|
306
208
|
__webpack_exports__ = __webpack_exports__["default"];
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.12.0-next.1
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
|
-
*/
|
|
12
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-selection")):"function"==typeof define&&define.amd?define("bb",["d3-selection"],e):"object"==typeof exports?exports.bb=e(require("d3-selection")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.bubblecompare=e(t.d3))}(this,(function(t){return function(){"use strict";var e={747:function(e){e.exports=t}},n={};function i(t){var o=n[t];if(void 0!==o)return o.exports;var r=n[t]={exports:{}};return e[t](r,r.exports,i),r.exports}i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var o={};return function(){function t(t,e){if(t!==e)throw new TypeError("Cannot instantiate an arrow function")}function e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function n(t,e){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},n(t,e)}i.d(o,{default:function(){return u}});var r=i(747);let s=function(){function e(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var n=e.prototype;return n.$beforeInit=function(){},n.$init=function(){},n.$afterInit=function(){},n.$redraw=function(){},n.$willDestroy=function(){var e=this;Object.keys(this).forEach(function(n){t(this,e),this[n]=null,delete this[n]}.bind(this))},e}();s.version="3.11.3";let u=function(i){var o,s;function u(t){var n=i.call(this,t)||this;return n.$$=void 0,e(n)||e(n)}s=i,(o=u).prototype=Object.create(s.prototype),o.prototype.constructor=o,n(o,s);var c=u.prototype;return c.$init=function(){const t=this.$$;t.findClosest=this.findClosest.bind(this),t.getBubbleR=this.getBubbleR.bind(this),t.pointExpandedR=this.pointExpandedR.bind(this)},c.pointExpandedR=function(t){const e=this.getBubbleR(t),n=this.options.expandScale,i=void 0===n?1:n;return u.raiseFocusedBubbleLayer(t),this.changeCursorPoint(),e*i},u.raiseFocusedBubbleLayer=function(t){t.raise&&(0,r.select)(t.node().parentNode.parentNode).raise()},c.changeCursorPoint=function(){this.$$.$el.eventRect.style("cursor","pointer")},c.findClosest=function(e,n){var i=this;const o=this.$$;return e.filter(function(e){return t(this,i),e&&!o.isBarType(e.id)}.bind(this)).reduce(function(e,r){t(this,i);return o.dist(r,n)<this.getBubbleR(r)?r:e}.bind(this),0)},c.getBubbleR=function(e){var n=this;const i=this.options,o=i.minR,r=i.maxR,s=this.getZData(e);if(!s)return o;const u=this.$$.data.targets.reduce(function(e,i){let o=e[0],r=e[1];t(this,n);const s=this.getZData(i.values[0]);return[Math.min(o,s),Math.max(r,s)]}.bind(this),[1e4,0]),c=u[0],a=u[1],f=c>0&&a===c?0:s/a;return Math.abs(f)*(r-o)+o},c.getZData=function(t){return this.$$.isBubbleZType(t)?this.$$.getBubbleZData(t.value,"z"):t.value},u}(s);u.version="0.0.1"}(),o=o.default}()}));
|
|
11
|
+
*/(function(o,a){typeof exports=="object"&&typeof module=="object"?module.exports=a(require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-selection"],a):typeof exports=="object"?exports.bb=a(require("d3-selection")):(o.bb=o.bb||{},o.bb.plugin=o.bb.plugin||{},o.bb.plugin.bubblecompare=a(o.d3))})(this,function(_){return function(){"use strict";var o={747:function(r){r.exports=_}},a={};function u(r){var i=a[r];if(i!==void 0)return i.exports;var s=a[r]={exports:{}};return o[r](s,s.exports,u),s.exports}(function(){u.d=function(r,i){for(var s in i)u.o(i,s)&&!u.o(r,s)&&Object.defineProperty(r,s,{enumerable:!0,get:i[s]})}})(),function(){u.o=function(r,i){return Object.prototype.hasOwnProperty.call(r,i)}}();var p={};return function(){u.d(p,{default:function(){return R}});var r=u(747),i=Object.defineProperty,s=(n,e,t)=>e in n?i(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,d=(n,e,t)=>(s(n,typeof e!="symbol"?e+"":e,t),t);class h{constructor(e={}){d(this,"$$"),d(this,"options"),this.options=e}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(e=>{this[e]=null,delete this[e]})}}d(h,"version","3.12.0-next.1");var v=Object.defineProperty,B=(n,e,t)=>e in n?v(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,m=(n,e,t)=>(B(n,typeof e!="symbol"?e+"":e,t),t);const $=class x extends h{constructor(e){return super(e),m(this,"$$"),this}$init(){const{$$:e}=this;e.findClosest=this.findClosest.bind(this),e.getBubbleR=this.getBubbleR.bind(this),e.pointExpandedR=this.pointExpandedR.bind(this)}pointExpandedR(e){const t=this.getBubbleR(e),{expandScale:c=1}=this.options;return x.raiseFocusedBubbleLayer(e),this.changeCursorPoint(),t*c}static raiseFocusedBubbleLayer(e){e.raise&&(0,r.select)(e.node().parentNode.parentNode).raise()}changeCursorPoint(){this.$$.$el.eventRect.style("cursor","pointer")}findClosest(e,t){const{$$:c}=this;return e.filter(b=>b&&!c.isBarType(b.id)).reduce((b,l)=>c.dist(l,t)<this.getBubbleR(l)?l:b,0)}getBubbleR(e){const{minR:t,maxR:c}=this.options,b=this.getZData(e);if(!b)return t;const[l,f]=this.$$.data.targets.reduce(([w,C],j)=>{const g=this.getZData(j.values[0]);return[Math.min(w,g),Math.max(C,g)]},[1e4,0]),P=l>0&&f===l?0:b/f;return Math.abs(P)*(c-t)+t}getZData(e){return this.$$.isBubbleZType(e)?this.$$.getBubbleZData(e.value,"z"):e.value}};m($,"version","0.0.1");let R=$}(),p=p.default,p}()});
|