@d3plus/core 3.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6219 -0
- package/es/index.js +4 -0
- package/es/src/charts/AreaPlot.js +86 -0
- package/es/src/charts/BarChart.js +93 -0
- package/es/src/charts/BoxWhisker.js +97 -0
- package/es/src/charts/BumpChart.js +148 -0
- package/es/src/charts/Donut.js +84 -0
- package/es/src/charts/Geomap.js +833 -0
- package/es/src/charts/LinePlot.js +84 -0
- package/es/src/charts/Matrix.js +358 -0
- package/es/src/charts/Network.js +787 -0
- package/es/src/charts/Pack.js +318 -0
- package/es/src/charts/Pie.js +242 -0
- package/es/src/charts/Plot.js +2212 -0
- package/es/src/charts/Priestley.js +312 -0
- package/es/src/charts/Radar.js +365 -0
- package/es/src/charts/RadialMatrix.js +393 -0
- package/es/src/charts/Rings.js +777 -0
- package/es/src/charts/Sankey.js +413 -0
- package/es/src/charts/StackedArea.js +80 -0
- package/es/src/charts/Tree.js +312 -0
- package/es/src/charts/Treemap.js +406 -0
- package/es/src/charts/Viz.js +2017 -0
- package/es/src/charts/drawSteps/drawAttribution.js +14 -0
- package/es/src/charts/drawSteps/drawBack.js +23 -0
- package/es/src/charts/drawSteps/drawColorScale.js +69 -0
- package/es/src/charts/drawSteps/drawLegend.js +120 -0
- package/es/src/charts/drawSteps/drawSubtitle.js +31 -0
- package/es/src/charts/drawSteps/drawTimeline.js +80 -0
- package/es/src/charts/drawSteps/drawTitle.js +31 -0
- package/es/src/charts/drawSteps/drawTotal.js +32 -0
- package/es/src/charts/drawSteps/zoomControls.js +254 -0
- package/es/src/charts/events/click.legend.js +76 -0
- package/es/src/charts/events/click.shape.js +26 -0
- package/es/src/charts/events/mouseenter.js +31 -0
- package/es/src/charts/events/mouseleave.js +21 -0
- package/es/src/charts/events/mousemove.legend.js +64 -0
- package/es/src/charts/events/mousemove.shape.js +42 -0
- package/es/src/charts/events/touchstart.body.js +7 -0
- package/es/src/charts/helpers/matrixData.js +104 -0
- package/es/src/charts/helpers/tileAttributions.js +34 -0
- package/es/src/charts/index.js +21 -0
- package/es/src/charts/plotBuffers/Bar.js +65 -0
- package/es/src/charts/plotBuffers/Box.js +60 -0
- package/es/src/charts/plotBuffers/Circle.js +39 -0
- package/es/src/charts/plotBuffers/Line.js +30 -0
- package/es/src/charts/plotBuffers/Rect.js +40 -0
- package/es/src/charts/plotBuffers/discreteBuffer.js +24 -0
- package/es/src/charts/plotBuffers/numericBuffer.js +111 -0
- package/es/src/components/Axis.js +1567 -0
- package/es/src/components/AxisBottom.js +77 -0
- package/es/src/components/AxisLeft.js +77 -0
- package/es/src/components/AxisRight.js +77 -0
- package/es/src/components/AxisTop.js +77 -0
- package/es/src/components/ColorScale.js +958 -0
- package/es/src/components/Legend.js +673 -0
- package/es/src/components/Message.js +95 -0
- package/es/src/components/TextBox.js +752 -0
- package/es/src/components/Timeline.js +760 -0
- package/es/src/components/Tooltip.js +726 -0
- package/es/src/components/index.js +11 -0
- package/es/src/shapes/Area.js +361 -0
- package/es/src/shapes/Bar.js +342 -0
- package/es/src/shapes/Box.js +482 -0
- package/es/src/shapes/Circle.js +201 -0
- package/es/src/shapes/Image.js +255 -0
- package/es/src/shapes/Line.js +289 -0
- package/es/src/shapes/Path.js +186 -0
- package/es/src/shapes/Rect.js +215 -0
- package/es/src/shapes/Shape.js +1156 -0
- package/es/src/shapes/Whisker.js +330 -0
- package/es/src/shapes/index.js +10 -0
- package/es/src/utils/BaseClass.js +204 -0
- package/es/src/utils/RESET.js +4 -0
- package/es/src/utils/accessor.js +19 -0
- package/es/src/utils/configPrep.js +76 -0
- package/es/src/utils/constant.js +15 -0
- package/es/src/utils/getProp.js +9 -0
- package/es/src/utils/index.js +7 -0
- package/es/src/utils/uuid.js +13 -0
- package/package.json +68 -0
- package/umd/d3plus-core.full.js +56459 -0
- package/umd/d3plus-core.full.js.map +1 -0
- package/umd/d3plus-core.full.min.js +7241 -0
- package/umd/d3plus-core.js +14422 -0
- package/umd/d3plus-core.js.map +1 -0
- package/umd/d3plus-core.min.js +4564 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
function _class_call_check(instance, Constructor) {
|
|
2
|
+
if (!(instance instanceof Constructor)) {
|
|
3
|
+
throw new TypeError("Cannot call a class as a function");
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
function _defineProperties(target, props) {
|
|
7
|
+
for(var i = 0; i < props.length; i++){
|
|
8
|
+
var descriptor = props[i];
|
|
9
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
10
|
+
descriptor.configurable = true;
|
|
11
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
12
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
16
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
17
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
18
|
+
return Constructor;
|
|
19
|
+
}
|
|
20
|
+
import { select } from "d3-selection";
|
|
21
|
+
import { stylize } from "@d3plus/dom";
|
|
22
|
+
var Message = /*#__PURE__*/ function() {
|
|
23
|
+
"use strict";
|
|
24
|
+
function Message() {
|
|
25
|
+
_class_call_check(this, Message);
|
|
26
|
+
this._isVisible = false;
|
|
27
|
+
}
|
|
28
|
+
_create_class(Message, [
|
|
29
|
+
{
|
|
30
|
+
/**
|
|
31
|
+
@memberof Message
|
|
32
|
+
@desc Removes the message from the page.
|
|
33
|
+
@chainable
|
|
34
|
+
*/ key: "exit",
|
|
35
|
+
value: function exit(elem, duration) {
|
|
36
|
+
elem.transition().duration(duration).style("opacity", 0).transition().remove();
|
|
37
|
+
this._isVisible = false;
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
/**
|
|
42
|
+
@memberof Message
|
|
43
|
+
@desc Removes the message from the page.
|
|
44
|
+
@chainable
|
|
45
|
+
*/ key: "hide",
|
|
46
|
+
value: function hide() {
|
|
47
|
+
var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref_duration = _ref.duration, duration = _ref_duration === void 0 ? 600 : _ref_duration, callback = _ref.callback;
|
|
48
|
+
this.mask.call(this.exit.bind(this), duration);
|
|
49
|
+
this.elem.call(this.exit.bind(this), duration);
|
|
50
|
+
if (callback) setTimeout(callback, duration + 100);
|
|
51
|
+
this._isVisible = false;
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
/**
|
|
57
|
+
@memberof Message
|
|
58
|
+
@desc Draws the message given the specified configuration.
|
|
59
|
+
@param {Object} [*config*]
|
|
60
|
+
@chainable
|
|
61
|
+
*/ key: "render",
|
|
62
|
+
value: function render() {
|
|
63
|
+
var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, callback = _ref.callback, _ref_container = _ref.container, container = _ref_container === void 0 ? "body" : _ref_container, _ref_duration = _ref.duration, duration = _ref_duration === void 0 ? 600 : _ref_duration, _ref_html = _ref.html, html = _ref_html === void 0 ? "Please Wait" : _ref_html, _ref_mask = _ref.mask, mask = _ref_mask === void 0 ? "rgba(0, 0, 0, 0.05)" : _ref_mask, _ref_style = _ref.style, style = _ref_style === void 0 ? {} : _ref_style;
|
|
64
|
+
var parent = select(container);
|
|
65
|
+
this.mask = parent.selectAll("div.d3plus-Mask").data(mask ? [
|
|
66
|
+
mask
|
|
67
|
+
] : []);
|
|
68
|
+
this.mask = this.mask.enter().append("div").attr("class", "d3plus-Mask").style("opacity", 1).merge(this.mask);
|
|
69
|
+
this.mask.exit().call(this.exit.bind(this), duration);
|
|
70
|
+
stylize(this.mask, {
|
|
71
|
+
"background-color": String,
|
|
72
|
+
"bottom": "0px",
|
|
73
|
+
"left": "0px",
|
|
74
|
+
"position": "absolute",
|
|
75
|
+
"right": "0px",
|
|
76
|
+
"top": "0px"
|
|
77
|
+
});
|
|
78
|
+
this.elem = parent.selectAll("div.d3plus-Message").data([
|
|
79
|
+
html
|
|
80
|
+
]);
|
|
81
|
+
this.elem = this.elem.enter().append("div").attr("class", "d3plus-Message").style("opacity", 1).merge(this.elem).html(String);
|
|
82
|
+
stylize(this.elem, style);
|
|
83
|
+
if (callback) setTimeout(callback, 100);
|
|
84
|
+
this._isVisible = true;
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
]);
|
|
89
|
+
return Message;
|
|
90
|
+
}();
|
|
91
|
+
/**
|
|
92
|
+
@class Message
|
|
93
|
+
@desc Displays a message using plain HTML.
|
|
94
|
+
@private
|
|
95
|
+
*/ export { Message as default };
|