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.
- package/dist/mascot-esm.js +186 -0
- package/package.json +3 -6
- package/dist/mascot-es.js +0 -27745
- package/dist/mascot-min.js +0 -186
- package/dist/mascot-umd.js +0 -27781
- package/js/depGraphVis.js +0 -66
- package/src-new-ts/action/createElement.ts +0 -91
- package/src-new-ts/action/encode.js +0 -20
- package/src-new-ts/action/repeat.js +0 -128
- package/src-new-ts/action/traverseScene.js +0 -41
- package/src-new-ts/data/Network.js +0 -2
- package/src-new-ts/data/Scope.js +0 -135
- package/src-new-ts/data/Table.js +0 -263
- package/src-new-ts/data/Tree.js +0 -3
- package/src-new-ts/data/field.ts +0 -115
- package/src-new-ts/data/import.ts +0 -96
- package/src-new-ts/data/predicate.ts +0 -82
- package/src-new-ts/depgraph/DepGraph.js +0 -178
- package/src-new-ts/depgraph/Edge.js +0 -9
- package/src-new-ts/depgraph/SceneGraph2DepGraph.js +0 -110
- package/src-new-ts/depgraph/Signal.js +0 -12
- package/src-new-ts/depgraph/operator/BoundsEvaluator.js +0 -30
- package/src-new-ts/depgraph/operator/Dataflow.js +0 -41
- package/src-new-ts/depgraph/operator/DomainBuilder.js +0 -50
- package/src-new-ts/depgraph/updateDepGraph.js +0 -45
- package/src-new-ts/depgraph/variable/BoundsVar.js +0 -81
- package/src-new-ts/depgraph/variable/ChannelVar.js +0 -17
- package/src-new-ts/depgraph/variable/DataScopeVar.js +0 -12
- package/src-new-ts/depgraph/variable/DomainVar.js +0 -15
- package/src-new-ts/depgraph/variable/FieldVar.js +0 -17
- package/src-new-ts/depgraph/variable/LayoutParameter.js +0 -8
- package/src-new-ts/depgraph/variable/ScaleVar.js +0 -13
- package/src-new-ts/depgraph/variable/Variable.js +0 -39
- package/src-new-ts/element/gradient/LinearGradient.js +0 -37
- package/src-new-ts/element/group/Collection.js +0 -109
- package/src-new-ts/element/group/Group.js +0 -307
- package/src-new-ts/element/group/Scene.js +0 -98
- package/src-new-ts/element/mark/CircleMark.ts +0 -85
- package/src-new-ts/element/mark/Mark.ts +0 -233
- package/src-new-ts/element/mark/PathMark.js +0 -483
- package/src-new-ts/element/mark/Segment.js +0 -29
- package/src-new-ts/element/mark/Vertex.js +0 -118
- package/src-new-ts/encode/Scale.ts +0 -115
- package/src-new-ts/index.ts +0 -19
- package/src-new-ts/layout/Layout.ts +0 -3
- package/src-new-ts/render/CanvasRenderer.ts +0 -24
- package/src-new-ts/render/SVGRenderer.js +0 -316
- package/src-new-ts/util.ts +0 -3
- package/src-old/action/Classify.js +0 -53
- package/src-old/action/Densify.js +0 -199
- package/src-old/action/Partition.js +0 -531
- package/src-old/action/Repeat.js +0 -106
- package/src-old/action/Repopulate.js +0 -44
- package/src-old/action/Stratify.js +0 -156
- package/src-old/basic/Gradient.js +0 -37
- package/src-old/basic/Point.js +0 -51
- package/src-old/basic/Rectangle.js +0 -63
- package/src-old/bind/bindToAngle.js +0 -56
- package/src-old/bind/bindToAreaMark.js +0 -360
- package/src-old/bind/bindToColor.js +0 -114
- package/src-old/bind/bindToLink.js +0 -81
- package/src-old/bind/bindToPosition.js +0 -283
- package/src-old/bind/bindToRadialDistance.js +0 -62
- package/src-old/bind/bindToSize.js +0 -235
- package/src-old/bind/bindToText.js +0 -60
- package/src-old/bind/bindToThickness.js +0 -100
- package/src-old/constraint/AffixConstraint.js +0 -129
- package/src-old/constraint/AlignConstraint.js +0 -58
- package/src-old/core/Encoding.js +0 -336
- package/src-old/core/Scale.js +0 -322
- package/src-old/core/SceneLoader.js +0 -290
- package/src-old/core/SceneValidator.js +0 -232
- package/src-old/core/SpecExecutor.js +0 -113
- package/src-old/core/SpecGenerator.js +0 -350
- package/src-old/data/DataImporter.js +0 -64
- package/src-old/data/DataScope.js +0 -124
- package/src-old/data/DataTable.js +0 -338
- package/src-old/data/Network.js +0 -106
- package/src-old/data/Tree.js +0 -251
- package/src-old/data/transform/Bin.js +0 -46
- package/src-old/data/transform/Filter.js +0 -48
- package/src-old/data/transform/Groupby.js +0 -18
- package/src-old/data/transform/KDE.js +0 -58
- package/src-old/data/transform/Sort.js +0 -14
- package/src-old/data/transform/Split.js +0 -5
- package/src-old/data/transform/partition.js +0 -46
- package/src-old/history/UndoRedoStack +0 -0
- package/src-old/index.js +0 -271
- package/src-old/indexSVG.js +0 -259
- package/src-old/interaction/Interaction.js +0 -91
- package/src-old/interaction/MouseEvent.js +0 -8
- package/src-old/interaction/Selection.js +0 -9
- package/src-old/interaction/brush.js +0 -362
- package/src-old/item/Segment.js +0 -29
- package/src-old/item/Vertex.js +0 -118
- package/src-old/item/composite/Collection.js +0 -106
- package/src-old/item/composite/Glyph.js +0 -19
- package/src-old/item/composite/Group.js +0 -310
- package/src-old/item/composite/Scene.js +0 -1251
- package/src-old/item/mark/ArcPath.js +0 -181
- package/src-old/item/mark/AreaPath.js +0 -78
- package/src-old/item/mark/CirclePath.js +0 -102
- package/src-old/item/mark/EllipsePath.js +0 -5
- package/src-old/item/mark/Image.js +0 -101
- package/src-old/item/mark/LinkPath.js +0 -118
- package/src-old/item/mark/Mark.js +0 -163
- package/src-old/item/mark/Path.js +0 -494
- package/src-old/item/mark/PointText.js +0 -201
- package/src-old/item/mark/PolygonPath.js +0 -64
- package/src-old/item/mark/RectPath.js +0 -88
- package/src-old/item/mark/RingPath.js +0 -92
- package/src-old/item/refs/Axis.js +0 -362
- package/src-old/item/refs/EncodingAxis.js +0 -515
- package/src-old/item/refs/Gridlines.js +0 -144
- package/src-old/item/refs/LayoutAxis.js +0 -316
- package/src-old/item/refs/Legend.js +0 -273
- package/src-old/layout/Circular.js +0 -95
- package/src-old/layout/Force.js +0 -52
- package/src-old/layout/Grid.js +0 -423
- package/src-old/layout/Layout.js +0 -13
- package/src-old/layout/Packing.js +0 -56
- package/src-old/layout/Stack.js +0 -264
- package/src-old/layout/Strata.js +0 -88
- package/src-old/layout/Sugiyama.js +0 -59
- package/src-old/layout/TidyTree.js +0 -105
- package/src-old/layout/Treemap.js +0 -87
- package/src-old/renderer/SVGInteractionHandler.js +0 -241
- package/src-old/renderer/SVGRenderer.js +0 -325
- package/src-old/renderer/WebGLRenderer.js +0 -1097
- package/src-old/renderer/WebGLRenderer2.js +0 -249
- package/src-old/renderer/threejs/Line2.js +0 -18
- package/src-old/renderer/threejs/LineGeometry.js +0 -77
- package/src-old/renderer/threejs/LineMaterial.js +0 -605
- package/src-old/renderer/threejs/LineSegments2.js +0 -281
- package/src-old/renderer/threejs/LineSegmentsGeometry.js +0 -226
- package/src-old/renderer/threejs/Wireframe.js +0 -51
- package/src-old/renderer/threejs/WireframeGeometry2.js +0 -16
- package/src-old/scale/areaSize.js +0 -0
- package/src-old/scale/domain.js +0 -38
- package/src-old/util/Constants.js +0 -180
- package/src-old/util/DataUtil.js +0 -35
- package/src-old/util/ItemUtil.js +0 -586
- package/src-old/util/Numerical.js +0 -33
- package/tests/demo-tests/README.md +0 -80
- package/tests/demo-tests/SVG2PNG.js +0 -56
- package/tests/demo-tests/demos2CanvasPNGs.js +0 -69
- package/tests/demo-tests/demos2ScenesSVGs.js +0 -100
- package/tests/demo-tests/pathElementWorker.js +0 -91
- package/tests/demo-tests/pixelTest.js +0 -62
- package/tests/demo-tests/renderDemos.html +0 -132
- package/tests/demo-tests/serializationTest.js +0 -36
- package/tests/demo-tests/serializeDemos.html +0 -134
- package/tests/unit-tests/README.md +0 -4
- package/tests/unit-tests/jasmine-browser.json +0 -21
- package/tests/unit-tests/jasmine.json +0 -14
- package/tests/unit-tests/testSpec.js +0 -274
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
export const nodeId = "id";
|
|
2
|
-
|
|
3
|
-
export const atlas_rowId = "atlas_rowId";
|
|
4
|
-
|
|
5
|
-
export const ScaleType = ["linear", "power", "log", "sqrt", "symlog", "identity", "time", "ordinal", "band", "point", "ordinalColor", "sequentialColor", "divergingColor"];
|
|
6
|
-
|
|
7
|
-
export const CurveMode = {
|
|
8
|
-
Natural: "natural",
|
|
9
|
-
Basis: "basis",
|
|
10
|
-
BumpX: "bumpX",
|
|
11
|
-
BumpY: "bumpY",
|
|
12
|
-
Linear: "linear",
|
|
13
|
-
Step: "step",
|
|
14
|
-
CatmullRom: "CatmullRom",
|
|
15
|
-
Cardinal: "cardinal"
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const LayoutType = {
|
|
19
|
-
Grid: "grid",
|
|
20
|
-
Circular: "circular",
|
|
21
|
-
Stack: "stack",
|
|
22
|
-
Treemap: "treemap",
|
|
23
|
-
Packing: "packing",
|
|
24
|
-
Force: "force",
|
|
25
|
-
TidyTree: "tidytree",
|
|
26
|
-
Sugiyama: "sugiyama",
|
|
27
|
-
Strata: "strata"
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export const Orientation = {
|
|
31
|
-
Vertical: "vertical",
|
|
32
|
-
Horizontal: "horizontal",
|
|
33
|
-
Angular: "angular",
|
|
34
|
-
Radial: "radial"
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export const Direction = {
|
|
38
|
-
Up: "up",
|
|
39
|
-
Down: "down",
|
|
40
|
-
Left: "left",
|
|
41
|
-
Right: "right",
|
|
42
|
-
Inward: "inward",
|
|
43
|
-
Outward: "outward",
|
|
44
|
-
Clockwise: "clockwise",
|
|
45
|
-
Anticlockwise: "anticlockwise"
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export const Alignment = {
|
|
49
|
-
Top: "top",
|
|
50
|
-
Left: "left",
|
|
51
|
-
Bottom: "bottom",
|
|
52
|
-
Right: "right",
|
|
53
|
-
Center: "center",
|
|
54
|
-
Middle: "middle"
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export const ConstraintType = {
|
|
58
|
-
Align: "alignment",
|
|
59
|
-
Distribute: "distribution",
|
|
60
|
-
Affix: "affixation"
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// export const RotationDirection = {
|
|
64
|
-
// Clockwise: "clockwise",
|
|
65
|
-
// Anticlockwise: "anticlockwise"
|
|
66
|
-
// }
|
|
67
|
-
|
|
68
|
-
export const ItemType = {
|
|
69
|
-
Area: "area",
|
|
70
|
-
Rect: "rect",
|
|
71
|
-
Ellipse: "ellipse",
|
|
72
|
-
Circle: "circle",
|
|
73
|
-
Pie: "pie",
|
|
74
|
-
Ring: "ring",
|
|
75
|
-
Arc: "arc",
|
|
76
|
-
Line: "line",
|
|
77
|
-
Path: "path",
|
|
78
|
-
Image: "image",
|
|
79
|
-
PointText: "pointText",
|
|
80
|
-
Collection: "collection",
|
|
81
|
-
Group: "group",
|
|
82
|
-
Scene: "scene",
|
|
83
|
-
Axis: "axis",
|
|
84
|
-
Glyph: "glyph",
|
|
85
|
-
Legend: "legend",
|
|
86
|
-
Polygon: "polygon",
|
|
87
|
-
Gridlines: "gridlines",
|
|
88
|
-
LinearGradient: "LinearGradient",
|
|
89
|
-
Link: "link",
|
|
90
|
-
DataTable: "datatable",
|
|
91
|
-
Layout: "layout"
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export const DataType = {
|
|
95
|
-
Boolean: "boolean",
|
|
96
|
-
Integer: "integer",
|
|
97
|
-
Number: "number",
|
|
98
|
-
Date: "date",
|
|
99
|
-
String: "string"
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export const Aggregator = {
|
|
103
|
-
Max: "max",
|
|
104
|
-
Min: "min",
|
|
105
|
-
Avg: "avg",
|
|
106
|
-
Median: "median",
|
|
107
|
-
Sum: "sum",
|
|
108
|
-
Count: "count",
|
|
109
|
-
Mean: "mean",
|
|
110
|
-
Percentile25: "percentile 25",
|
|
111
|
-
Percentile75: "percentile 75"
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
export const Style2SVG = {
|
|
116
|
-
"fillColor": "fill",
|
|
117
|
-
"strokeColor": "stroke",
|
|
118
|
-
"strokeWidth": "stroke-width",
|
|
119
|
-
"fillOpacity": "fill-opacity",
|
|
120
|
-
"strokeOpacity": "stroke-opacity",
|
|
121
|
-
"strokeDash": "stroke-dasharray",
|
|
122
|
-
"opacity": "opacity",
|
|
123
|
-
"fontSize": "font-size",
|
|
124
|
-
"fontFamily": "font-family",
|
|
125
|
-
"fontWeight": "font-weight",
|
|
126
|
-
"visibility": "visibility"
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export const Warnings = {
|
|
130
|
-
INCORRECT_AXIS_INFO: "Cannot find relevant information to create an axis for ",
|
|
131
|
-
INCORRECT_LEGEND_INFO: "Cannot find relevant information to create a legend for ",
|
|
132
|
-
UNSUPPORTED_SCALE_TYPE_CHANGE: "Cannot change scale type to "
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export const Errors = {
|
|
136
|
-
FIELD_NONEXISTENT : "Data field does not exist in the data table",
|
|
137
|
-
INCOMPLETE_REPEAT_INFO : "Incomplete information to do repeat. You must specify an item, a categorical data field and a data table",
|
|
138
|
-
REPEAT_BY_NONCAT: "Repeat only works on a string or date field",
|
|
139
|
-
PARTITION_BY_NONCAT: "Divide only works on a string or date field",
|
|
140
|
-
DENSIFY_BY_NONCAT: "Densify only works on a string or date field",
|
|
141
|
-
INCOMPLETE_REPOPULATE_INFO : "Incomplete information to re-populate. You must specify an item, a categorical data field and a data table",
|
|
142
|
-
REPOPULATE_BY_NONCAT: "Repopulate only works on a string or date field",
|
|
143
|
-
REPOPULATE_DT_MISMATCH: "Cannot repopulate with a data table that is different from the item's parent's data table",
|
|
144
|
-
COMPNT_NON_REPEATABLE: "Item not repeatable",
|
|
145
|
-
REPEAT_NODE_LINK: "To repeat with a tree or a network, you need to provide two marks, one for node and one for link",
|
|
146
|
-
INCOMPLETE_PARTITION_INFO : "Incomplete information to divide. You must specify an item, a categorical data field and a data table",
|
|
147
|
-
COMPNT_NON_PARTITIONABLE: "Item cannot be divided",
|
|
148
|
-
INCOMPLETE_DENSIFY_INFO : "Incomplete information to densify. You must specify an item, a categorical data field and a data table",
|
|
149
|
-
COMPNT_NON_DENSIFIABLE: "Item cannot be densified",
|
|
150
|
-
STRATIFY_WITHOUT_TREE: "Stratify only works on a tree dataset",
|
|
151
|
-
STRATIFY_WRONG_ITEM: "Stratify only works on a circle or a rectangle",
|
|
152
|
-
BIND_WITHOUT_DATASCOPE: "Item must be repeated or divided by data first before applyng binding",
|
|
153
|
-
UNKNOWN_ALIGNMENT: "Unkown alignment",
|
|
154
|
-
UNKNOWN_Orientation: "Unkown orientation",
|
|
155
|
-
UNKNOWN_DIRECTION: "Unkown direction",
|
|
156
|
-
UNKOWNN_SCALE_TYPE: "Unknown scale type",
|
|
157
|
-
UNKNOWN_ANCHOR: "Unknown anchor",
|
|
158
|
-
INCOMPLETE_BINDING_INFO: "Incomplete binding information. You must specify an item, a data field and a visual channel",
|
|
159
|
-
MULTIPLE_VALUES_PER_FIELD: "Multiple distinct field values exist",
|
|
160
|
-
DIFFERENT_SCALE_TYPE: "Cannot merge different types of scale",
|
|
161
|
-
INSUFFICIENT_DATA_SCOPES: "Insufficient data to divide or densify a mark",
|
|
162
|
-
INCORRECT_CONSTRAINT_INFO: "Constrain information is incorreclty passed",
|
|
163
|
-
FEATURE_NOT_IMPLEMENTED: "This feature has not been implemented yet",
|
|
164
|
-
LAYOUT_WITHOUT_TREE: "The layout can only be applied to a tree",
|
|
165
|
-
UNSUPPORTED_FIELDTYPE: "Unsupported field type for encoding ",
|
|
166
|
-
CANNOT_CLASSIFY: "Cannot classify items in ",
|
|
167
|
-
CANNOT_CREATE_GLYPH: "Cannot create glyph. A glyph must consist of only paths or only texts, not a mixture of paths and texts"
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export const categoricalColorSchemes = [
|
|
171
|
-
"schemeCategory10", "schemeAccent", "schemeDark2", "schemePaired", "schemePastel1", "schemePastel2", "schemeSet1", "schemeSet2", "schemeSet3", "schemeTableau10"
|
|
172
|
-
]
|
|
173
|
-
|
|
174
|
-
export const divergingColorSchemes = [
|
|
175
|
-
"schemeBrBG", "schemePRGn", "schemePiYG", "schemePuOr", "schemeRdBu", "schemeRdGy", "schemeRdYlBu", "schemeRdYlGn", "schemeSpectral"
|
|
176
|
-
]
|
|
177
|
-
|
|
178
|
-
export const sequentialColorSchemes = [
|
|
179
|
-
"schemeBlues", "schemeGreens", "schemeGreys", "schemeOranges", "schemePurples", "schemeReds", "schemeBuGn", "schemeBuPu", "schemeGnBu", "schemeOrRd", "schemePuBuGn", "schemePuBu", "schemePuRd", "schemeRdPu", "schemeYlGnBu", "schemeYlGn", "schemeYlOrBr", "schemeYlOrRd"
|
|
180
|
-
]
|
package/src-old/util/DataUtil.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import {Errors} from "./Constants";
|
|
2
|
-
|
|
3
|
-
export function generateUniqueID() {
|
|
4
|
-
return Date.now().toString(36) + "_" + Math.random().toString(36).slice(2);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export function uniqueStrings(strings) {
|
|
8
|
-
return [...new Set(strings)];
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function uniqueNumbers(numbers) {
|
|
12
|
-
return [...new Set(numbers)];
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function uniqueDates(dates) {
|
|
16
|
-
return [...new Set(dates.map(item => item.getTime()))];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function validateField(field, datatable) {
|
|
20
|
-
if (datatable.hasField(field))
|
|
21
|
-
return true;
|
|
22
|
-
else if (datatable.tree && datatable.tree.nodeTable.hasField(field.split(".")[1]))
|
|
23
|
-
return true;
|
|
24
|
-
else
|
|
25
|
-
throw new Error(Errors.FIELD_NONEXISTENT + ", field: " + field + ", data table: " + datatable.name);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function normalizeAngle(a) {
|
|
29
|
-
if (a < 0)
|
|
30
|
-
return a + 360;
|
|
31
|
-
else if (a > 360)
|
|
32
|
-
return a - 360;
|
|
33
|
-
else
|
|
34
|
-
return a;
|
|
35
|
-
}
|