mascot-vis 3.0.0 → 3.0.2

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 (156) hide show
  1. package/dist/mascot-esm.js +186 -0
  2. package/package.json +3 -6
  3. package/dist/mascot-es.js +0 -27745
  4. package/dist/mascot-min.js +0 -186
  5. package/dist/mascot-umd.js +0 -27781
  6. package/js/depGraphVis.js +0 -66
  7. package/src-new-ts/action/createElement.ts +0 -91
  8. package/src-new-ts/action/encode.js +0 -20
  9. package/src-new-ts/action/repeat.js +0 -128
  10. package/src-new-ts/action/traverseScene.js +0 -41
  11. package/src-new-ts/data/Network.js +0 -2
  12. package/src-new-ts/data/Scope.js +0 -135
  13. package/src-new-ts/data/Table.js +0 -263
  14. package/src-new-ts/data/Tree.js +0 -3
  15. package/src-new-ts/data/field.ts +0 -115
  16. package/src-new-ts/data/import.ts +0 -96
  17. package/src-new-ts/data/predicate.ts +0 -82
  18. package/src-new-ts/depgraph/DepGraph.js +0 -178
  19. package/src-new-ts/depgraph/Edge.js +0 -9
  20. package/src-new-ts/depgraph/SceneGraph2DepGraph.js +0 -110
  21. package/src-new-ts/depgraph/Signal.js +0 -12
  22. package/src-new-ts/depgraph/operator/BoundsEvaluator.js +0 -30
  23. package/src-new-ts/depgraph/operator/Dataflow.js +0 -41
  24. package/src-new-ts/depgraph/operator/DomainBuilder.js +0 -50
  25. package/src-new-ts/depgraph/updateDepGraph.js +0 -45
  26. package/src-new-ts/depgraph/variable/BoundsVar.js +0 -81
  27. package/src-new-ts/depgraph/variable/ChannelVar.js +0 -17
  28. package/src-new-ts/depgraph/variable/DataScopeVar.js +0 -12
  29. package/src-new-ts/depgraph/variable/DomainVar.js +0 -15
  30. package/src-new-ts/depgraph/variable/FieldVar.js +0 -17
  31. package/src-new-ts/depgraph/variable/LayoutParameter.js +0 -8
  32. package/src-new-ts/depgraph/variable/ScaleVar.js +0 -13
  33. package/src-new-ts/depgraph/variable/Variable.js +0 -39
  34. package/src-new-ts/element/gradient/LinearGradient.js +0 -37
  35. package/src-new-ts/element/group/Collection.js +0 -109
  36. package/src-new-ts/element/group/Group.js +0 -307
  37. package/src-new-ts/element/group/Scene.js +0 -98
  38. package/src-new-ts/element/mark/CircleMark.ts +0 -85
  39. package/src-new-ts/element/mark/Mark.ts +0 -233
  40. package/src-new-ts/element/mark/PathMark.js +0 -483
  41. package/src-new-ts/element/mark/Segment.js +0 -29
  42. package/src-new-ts/element/mark/Vertex.js +0 -118
  43. package/src-new-ts/encode/Scale.ts +0 -115
  44. package/src-new-ts/index.ts +0 -19
  45. package/src-new-ts/layout/Layout.ts +0 -3
  46. package/src-new-ts/render/CanvasRenderer.ts +0 -24
  47. package/src-new-ts/render/SVGRenderer.js +0 -316
  48. package/src-new-ts/util.ts +0 -3
  49. package/src-old/action/Classify.js +0 -53
  50. package/src-old/action/Densify.js +0 -199
  51. package/src-old/action/Partition.js +0 -531
  52. package/src-old/action/Repeat.js +0 -106
  53. package/src-old/action/Repopulate.js +0 -44
  54. package/src-old/action/Stratify.js +0 -156
  55. package/src-old/basic/Gradient.js +0 -37
  56. package/src-old/basic/Point.js +0 -51
  57. package/src-old/basic/Rectangle.js +0 -63
  58. package/src-old/bind/bindToAngle.js +0 -56
  59. package/src-old/bind/bindToAreaMark.js +0 -360
  60. package/src-old/bind/bindToColor.js +0 -114
  61. package/src-old/bind/bindToLink.js +0 -81
  62. package/src-old/bind/bindToPosition.js +0 -283
  63. package/src-old/bind/bindToRadialDistance.js +0 -62
  64. package/src-old/bind/bindToSize.js +0 -235
  65. package/src-old/bind/bindToText.js +0 -60
  66. package/src-old/bind/bindToThickness.js +0 -100
  67. package/src-old/constraint/AffixConstraint.js +0 -129
  68. package/src-old/constraint/AlignConstraint.js +0 -58
  69. package/src-old/core/Encoding.js +0 -336
  70. package/src-old/core/Scale.js +0 -322
  71. package/src-old/core/SceneLoader.js +0 -290
  72. package/src-old/core/SceneValidator.js +0 -232
  73. package/src-old/core/SpecExecutor.js +0 -113
  74. package/src-old/core/SpecGenerator.js +0 -350
  75. package/src-old/data/DataImporter.js +0 -64
  76. package/src-old/data/DataScope.js +0 -124
  77. package/src-old/data/DataTable.js +0 -338
  78. package/src-old/data/Network.js +0 -106
  79. package/src-old/data/Tree.js +0 -251
  80. package/src-old/data/transform/Bin.js +0 -46
  81. package/src-old/data/transform/Filter.js +0 -48
  82. package/src-old/data/transform/Groupby.js +0 -18
  83. package/src-old/data/transform/KDE.js +0 -58
  84. package/src-old/data/transform/Sort.js +0 -14
  85. package/src-old/data/transform/Split.js +0 -5
  86. package/src-old/data/transform/partition.js +0 -46
  87. package/src-old/history/UndoRedoStack +0 -0
  88. package/src-old/index.js +0 -271
  89. package/src-old/indexSVG.js +0 -259
  90. package/src-old/interaction/Interaction.js +0 -91
  91. package/src-old/interaction/MouseEvent.js +0 -8
  92. package/src-old/interaction/Selection.js +0 -9
  93. package/src-old/interaction/brush.js +0 -362
  94. package/src-old/item/Segment.js +0 -29
  95. package/src-old/item/Vertex.js +0 -118
  96. package/src-old/item/composite/Collection.js +0 -106
  97. package/src-old/item/composite/Glyph.js +0 -19
  98. package/src-old/item/composite/Group.js +0 -310
  99. package/src-old/item/composite/Scene.js +0 -1251
  100. package/src-old/item/mark/ArcPath.js +0 -181
  101. package/src-old/item/mark/AreaPath.js +0 -78
  102. package/src-old/item/mark/CirclePath.js +0 -102
  103. package/src-old/item/mark/EllipsePath.js +0 -5
  104. package/src-old/item/mark/Image.js +0 -101
  105. package/src-old/item/mark/LinkPath.js +0 -118
  106. package/src-old/item/mark/Mark.js +0 -163
  107. package/src-old/item/mark/Path.js +0 -494
  108. package/src-old/item/mark/PointText.js +0 -201
  109. package/src-old/item/mark/PolygonPath.js +0 -64
  110. package/src-old/item/mark/RectPath.js +0 -88
  111. package/src-old/item/mark/RingPath.js +0 -92
  112. package/src-old/item/refs/Axis.js +0 -362
  113. package/src-old/item/refs/EncodingAxis.js +0 -515
  114. package/src-old/item/refs/Gridlines.js +0 -144
  115. package/src-old/item/refs/LayoutAxis.js +0 -316
  116. package/src-old/item/refs/Legend.js +0 -273
  117. package/src-old/layout/Circular.js +0 -95
  118. package/src-old/layout/Force.js +0 -52
  119. package/src-old/layout/Grid.js +0 -423
  120. package/src-old/layout/Layout.js +0 -13
  121. package/src-old/layout/Packing.js +0 -56
  122. package/src-old/layout/Stack.js +0 -264
  123. package/src-old/layout/Strata.js +0 -88
  124. package/src-old/layout/Sugiyama.js +0 -59
  125. package/src-old/layout/TidyTree.js +0 -105
  126. package/src-old/layout/Treemap.js +0 -87
  127. package/src-old/renderer/SVGInteractionHandler.js +0 -241
  128. package/src-old/renderer/SVGRenderer.js +0 -325
  129. package/src-old/renderer/WebGLRenderer.js +0 -1097
  130. package/src-old/renderer/WebGLRenderer2.js +0 -249
  131. package/src-old/renderer/threejs/Line2.js +0 -18
  132. package/src-old/renderer/threejs/LineGeometry.js +0 -77
  133. package/src-old/renderer/threejs/LineMaterial.js +0 -605
  134. package/src-old/renderer/threejs/LineSegments2.js +0 -281
  135. package/src-old/renderer/threejs/LineSegmentsGeometry.js +0 -226
  136. package/src-old/renderer/threejs/Wireframe.js +0 -51
  137. package/src-old/renderer/threejs/WireframeGeometry2.js +0 -16
  138. package/src-old/scale/areaSize.js +0 -0
  139. package/src-old/scale/domain.js +0 -38
  140. package/src-old/util/Constants.js +0 -180
  141. package/src-old/util/DataUtil.js +0 -35
  142. package/src-old/util/ItemUtil.js +0 -586
  143. package/src-old/util/Numerical.js +0 -33
  144. package/tests/demo-tests/README.md +0 -80
  145. package/tests/demo-tests/SVG2PNG.js +0 -56
  146. package/tests/demo-tests/demos2CanvasPNGs.js +0 -69
  147. package/tests/demo-tests/demos2ScenesSVGs.js +0 -100
  148. package/tests/demo-tests/pathElementWorker.js +0 -91
  149. package/tests/demo-tests/pixelTest.js +0 -62
  150. package/tests/demo-tests/renderDemos.html +0 -132
  151. package/tests/demo-tests/serializationTest.js +0 -36
  152. package/tests/demo-tests/serializeDemos.html +0 -134
  153. package/tests/unit-tests/README.md +0 -4
  154. package/tests/unit-tests/jasmine-browser.json +0 -21
  155. package/tests/unit-tests/jasmine.json +0 -14
  156. package/tests/unit-tests/testSpec.js +0 -274
@@ -1,201 +0,0 @@
1
- import Mark from "./Mark";
2
- import Rectangle from "../../basic/Rectangle";
3
- import {ItemType} from "../../util/Constants";
4
- import { getTextSize } from "../../util/ItemUtil";
5
-
6
- export default class PointText extends Mark {
7
-
8
- constructor(args) {
9
- super(args);
10
- this.type = ItemType.PointText;
11
- this.attrs["x"] = 0;
12
- this.attrs["y"] = 0;
13
- if (!("fontSize" in this.styles))
14
- this.styles["fontSize"] = "12px";
15
- if (!("fontFamily" in this.styles))
16
- this.styles["fontFamily"] = "Arial, sans-serif";
17
- if (!("fontWeight" in this.styles))
18
- this.styles["fontWeight"] = "normal";
19
- if (!("fillColor" in this.styles))
20
- this.styles["fillColor"] = "black";
21
-
22
- if (args !== undefined) {
23
- if ("x" in args) {
24
- this.attrs["x"] = args["x"];
25
- }
26
-
27
- if ("y" in args) {
28
- this.attrs["y"] = args["y"];
29
- }
30
-
31
- if ("text" in args) {
32
- this.attrs["text"] = args["text"];
33
- } else {
34
- this.attrs["text"] = "";
35
- }
36
-
37
- if ("anchor" in args) {
38
- this.attrs["anchor"] = args["anchor"];
39
- } else {
40
- this.attrs["anchor"] = ["center", "middle"];
41
- }
42
- }
43
- this._updateBounds();
44
- }
45
-
46
- copyPropertiesTo(target) {
47
- target.styles = Object.assign({}, this.styles);
48
- if (this._dataScope)
49
- target._dataScope = this._dataScope.clone();
50
- target.x = this.attrs["x"];
51
- target.y = this.attrs["y"];
52
- target.text = this.text;
53
- target.anchor = [this.anchor[0], this.anchor[1]];
54
- }
55
-
56
- get bounds() {
57
- if (!this._bounds)
58
- this._updateBounds();
59
- return this._bounds;
60
- }
61
-
62
- get refBounds() {
63
- return this.bounds;
64
- }
65
-
66
- set text(text) {
67
- this.attrs["text"] = text;
68
- this._updateBounds();
69
- }
70
-
71
- get text() {
72
- return this.attrs["text"];
73
- }
74
-
75
- _doTranslate(dx, dy) {
76
- this.attrs["x"] += dx;
77
- this.attrs["y"] += dy;
78
- this._updateBounds();
79
- }
80
-
81
- _updateBounds() {
82
- let size = getTextSize(this.attrs["text"], [this.fontWeight, this.styles["fontSize"], this.fontFamily].join(" "), parseFloat(this.fontSize));
83
- let wd = size.width, ht = size.height;
84
- let left;
85
- switch (this.attrs["anchor"][0]){
86
- case "left":
87
- left = this.attrs["x"];
88
- break;
89
- case "right":
90
- left = this.attrs["x"] - wd;
91
- break;
92
- case "center":
93
- left = this.attrs["x"] - wd/2;
94
- break;
95
- default:
96
- left = this.attrs["x"];
97
- break;
98
- }
99
- let top;
100
- switch (this.attrs["anchor"][1]){
101
- case "top":
102
- top = this.attrs["y"];
103
- break;
104
- case "bottom":
105
- top = this.attrs["y"] - ht;
106
- break;
107
- case "middle":
108
- top = this.attrs["y"] - ht/2;
109
- break;
110
- }
111
- this._bounds = new Rectangle(left, top, wd, ht);
112
- }
113
-
114
- get center() {
115
- return {x: this.bounds.left + this.bounds.width/2, y: this.bounds.top + this.bounds.height/2};
116
- }
117
-
118
- get x() {
119
- return this.attrs["x"];
120
- }
121
-
122
- set x(v){
123
- this.attrs["x"] = v;
124
- this._updateBounds();
125
- }
126
-
127
- get y() {
128
- return this.attrs["y"];
129
- }
130
-
131
- set y(v){
132
- this.attrs["y"] = v;
133
- this._updateBounds();
134
- }
135
-
136
- get anchor() {
137
- return this.attrs["anchor"];
138
- }
139
-
140
- set anchor(a) {
141
- this.attrs["anchor"] = a;
142
- this._updateBounds();
143
- }
144
-
145
- get horzAnchor() {
146
- return this.attrs["anchor"][0];
147
- }
148
-
149
- get vertAnchor() {
150
- return this.attrs["anchor"][1];
151
- }
152
-
153
- set horzAnchor(a) {
154
- this.attrs["anchor"][0] = a;
155
- this._updateBounds();
156
- }
157
-
158
- set vertAnchor(a) {
159
- this.attrs["anchor"][1] = a;
160
- this._updateBounds();
161
- }
162
-
163
- //return integer
164
- get fontSize() {
165
- return parseFloat(this.styles["fontSize"]);
166
- }
167
-
168
- set fontSize(f) {
169
- if (typeof f === "number")
170
- this.styles["fontSize"] = f + "px";
171
- else
172
- this.styles["fontSize"] = f;
173
- this._updateBounds();
174
- }
175
-
176
- get fontWeight() {
177
- return this.styles["fontWeight"];
178
- }
179
-
180
- set fontWeight(w) {
181
- this.styles["fontWeight"] = w;
182
- this._updateBounds();
183
- }
184
-
185
- get fontFamily() {
186
- return this.styles["fontFamily"];
187
- }
188
-
189
- set fontFamily(f) {
190
- this.styles["fontFamily"] = f;
191
- this._updateBounds();
192
- }
193
-
194
- get fillColor() {
195
- return this.styles["fillColor"];
196
- }
197
-
198
- set fillColor(c) {
199
- this.styles["fillColor"] = c;
200
- }
201
- }
@@ -1,64 +0,0 @@
1
- import Path from "./Path";
2
- import {ItemType} from "../../util/Constants";
3
- import Point from "../../basic/Point";
4
-
5
- export default class PolygonPath extends Path {
6
-
7
- constructor(args) {
8
- super(args);
9
- this.type = ItemType.Polygon;
10
- this.closed = true;
11
-
12
- if ("x" in args)
13
- this._x = args.x;
14
- if ("y" in args)
15
- this._y = args.y;
16
- if ("radius" in args)
17
- this._radius = args.radius;
18
- }
19
-
20
- get radius() {
21
- return this._radius;
22
- }
23
-
24
- get x() {
25
- return this._x;
26
- }
27
-
28
- get y() {
29
- return this._y;
30
- }
31
-
32
- get center() {
33
- return new Point(this._x, this._y);
34
- }
35
-
36
- set x(v) {
37
- this._x = v;
38
- this._updateBounds();
39
- }
40
-
41
- set y(v) {
42
- this._y = v;
43
- this._updateBounds();
44
- }
45
-
46
- set radius(r) {
47
- this._radius = r;
48
- this._updateBounds();
49
- }
50
-
51
- copyPropertiesTo(target) {
52
- super.copyPropertiesTo(target);
53
- target._x = this._x;
54
- target._y = this._y;
55
- target._radius = this._radius;
56
- }
57
-
58
- _doTranslate(dx, dy) {
59
- this._x += dx;
60
- this._y += dy;
61
- super._doTranslate(dx, dy);
62
- }
63
-
64
- }
@@ -1,88 +0,0 @@
1
- import Path from "./Path";
2
- import Segment from "../Segment";
3
- import {ItemType} from "../../util/Constants"
4
-
5
- export default class RectPath extends Path {
6
-
7
- constructor(args) {
8
- super(args);
9
- // this.type = ItemType.Rect;
10
- // this.closed = true;
11
-
12
- //add last segment to close the path
13
- // if (args && "vertices" in args)
14
- // this.segments.push(new Segment(this.vertices[3], this.vertices[0], this, this.segmentCounter++));
15
- }
16
-
17
- get width() {
18
- return this.vertices[1].x - this.vertices[0].x;
19
- }
20
-
21
- get height() {
22
- return this.vertices[2].y - this.vertices[1].y;
23
- }
24
-
25
- set height(ht) {
26
- this.resize(this.width, ht);
27
- }
28
-
29
- set width(wd) {
30
- this.resize(wd, this.height);
31
- }
32
-
33
- get left() {
34
- return this.vertices[0].x;
35
- }
36
-
37
- get top() {
38
- return this.vertices[0].y;
39
- }
40
-
41
- get right() {
42
- return this.vertices[1].x;
43
- }
44
-
45
- get bottom() {
46
- return this.vertices[2].y;
47
- }
48
-
49
- get area() {
50
- return this.width * this.height;
51
- }
52
-
53
- //override path's resize method, by default, keep the left and top segments intact
54
- resize(wd, ht, xRef, yRef) {
55
- if (xRef === "right") {
56
- this.vertices[0].x = this.vertices[1].x - wd;
57
- this.vertices[3].x = this.vertices[0].x;
58
- } else {
59
- this.vertices[1].x = this.vertices[0].x + wd;
60
- this.vertices[2].x = this.vertices[1].x;
61
- }
62
- if (yRef === "top") {
63
- this.vertices[3].y = this.vertices[0].y + ht;
64
- this.vertices[2].y = this.vertices[3].y;
65
- } else {
66
- this.vertices[0].y = this.vertices[3].y - ht;
67
- this.vertices[1].y = this.vertices[0].y;
68
- }
69
-
70
- this._updateBounds();
71
- }
72
-
73
- get leftSegment() {
74
- return this.segments[3];
75
- }
76
-
77
- get rightSegment() {
78
- return this.segments[1];
79
- }
80
-
81
- get topSegment() {
82
- return this.segments[0];
83
- }
84
-
85
- get bottomSegment() {
86
- return this.segments[2];
87
- }
88
- }
@@ -1,92 +0,0 @@
1
- import Path from "./Path";
2
- import {ItemType} from "../../util/Constants";
3
- import Rectangle from "../../basic/Rectangle";
4
- import Point from "../../basic/Point";
5
-
6
- export default class RingPath extends Path {
7
-
8
- constructor(args) {
9
- super(args);
10
- this.type = ItemType.Ring;
11
- this.closed = true;
12
- this._x = ("x" in args) ? args.x : 0;
13
- this._y = ("y" in args) ? args.y : 0;
14
- this._innerRadius = ("innerRadius" in args) ? args.innerRadius : 100;
15
- this._outerRadius = ("outerRadius" in args) ? args.outerRadius : 200;
16
- }
17
-
18
- get innerRadius() {
19
- return this._innerRadius;
20
- }
21
-
22
- set innerRadius(r) {
23
- this._innerRadius = r;
24
- }
25
-
26
- get outerRadius() {
27
- return this._outerRadius;
28
- }
29
-
30
- set outerRadius(r) {
31
- this._outerRadius = r;
32
- this._updateBounds();
33
- }
34
-
35
- get x() {
36
- return this._x;
37
- }
38
-
39
- get y() {
40
- return this._y;
41
- }
42
-
43
- get center() {
44
- return new Point(this._x, this._y);
45
- }
46
-
47
- set x(v) {
48
- this._x = v;
49
- this._updateBounds();
50
- }
51
-
52
- set y(v) {
53
- this._y = v;
54
- this._updateBounds();
55
- }
56
-
57
- get thickness() {
58
- return this._outerRadius - this._innerRadius;
59
- }
60
-
61
- _doTranslate(dx, dy) {
62
- this._x += dx;
63
- this._y += dy;
64
- this._updateBounds();
65
- }
66
-
67
- _updateBounds() {
68
- this._bounds = new Rectangle(this._x - this._outerRadius, this._y - this._outerRadius, this._outerRadius * 2, this._outerRadius * 2);
69
- }
70
-
71
- copyPropertiesTo(target) {
72
- super.copyPropertiesTo(target);
73
- target._x = this._x;
74
- target._y = this._y;
75
- target._innerRadius = this._innerRadius;
76
- target._outerRadius = this._outerRadius;
77
- }
78
-
79
- getSVGPathData() {
80
- let cmds = [
81
- "M " + this._x + " " + this._y, // Move to center of ring
82
- "m 0, -" + this._outerRadius, // Move to top of ring
83
- "a " + this._outerRadius + "," + this._outerRadius + ", 0, 1, 0, 1, 0", // Draw outer arc, but don't close it
84
- "Z", // default fill-rule:even-odd will help create the empty innards
85
- "m 0 " + (this._outerRadius-this._innerRadius), // Move to top point of inner radius
86
- "a " + this._innerRadius + ", " + this._innerRadius + ", 0, 1, 1, -1, 0", // Draw inner arc, but don't close it
87
- "Z" // Close the inner ring. Actually will still work without, but inner ring will have one unit missing in stroke
88
- ];
89
- return cmds.join(" ");
90
- }
91
-
92
- }