@uwdata/mosaic-spec 0.12.0 → 0.12.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 +2 -0
- package/dist/mosaic-schema.json +7689 -2399
- package/dist/mosaic-spec.js +68 -26
- package/dist/mosaic-spec.min.js +16 -16
- package/dist/types/spec/PlotMark.d.ts +2 -1
- package/dist/types/spec/marks/Waffle.d.ts +58 -0
- package/package.json +5 -5
- package/src/spec/PlotMark.ts +3 -1
- package/src/spec/marks/Waffle.ts +61 -0
package/dist/mosaic-spec.js
CHANGED
|
@@ -7279,7 +7279,7 @@ function clausePoint(field3, value, {
|
|
|
7279
7279
|
source,
|
|
7280
7280
|
clients = source ? /* @__PURE__ */ new Set([source]) : void 0
|
|
7281
7281
|
}) {
|
|
7282
|
-
const predicate = value !== void 0 ?
|
|
7282
|
+
const predicate = value !== void 0 ? isIn(field3, [literal(value)]) : null;
|
|
7283
7283
|
return {
|
|
7284
7284
|
meta: { type: "point" },
|
|
7285
7285
|
source,
|
|
@@ -7733,6 +7733,8 @@ __export(api_exports, {
|
|
|
7733
7733
|
voronoi: () => voronoi2,
|
|
7734
7734
|
voronoiMesh: () => voronoiMesh2,
|
|
7735
7735
|
vspace: () => vspace,
|
|
7736
|
+
waffleX: () => waffleX2,
|
|
7737
|
+
waffleY: () => waffleY2,
|
|
7736
7738
|
width: () => width,
|
|
7737
7739
|
xAlign: () => xAlign,
|
|
7738
7740
|
xAriaDescription: () => xAriaDescription,
|
|
@@ -33471,13 +33473,16 @@ var HexbinMark = class extends Mark2 {
|
|
|
33471
33473
|
float642(x12),
|
|
33472
33474
|
div(add(mul(add(x3, mul(0.5, bitAnd(y3, 1))), dx), ox2), xr)
|
|
33473
33475
|
),
|
|
33474
|
-
[yc.as]: sub(
|
|
33476
|
+
[yc.as]: sub(
|
|
33477
|
+
float642(y22),
|
|
33478
|
+
div(add(mul(y3, dy), oy2), yr)
|
|
33479
|
+
),
|
|
33475
33480
|
...cols
|
|
33476
33481
|
}).groupby(x3, y3, ...dims).from(
|
|
33477
33482
|
// Subquery performs hex binning in screen space and also passes
|
|
33478
33483
|
// original columns through (the DB should optimize this).
|
|
33479
33484
|
Query.select({
|
|
33480
|
-
[py]: div(mul(yr, sub(
|
|
33485
|
+
[py]: div(sub(mul(yr, sub(y22, yc.field)), oy2), dy),
|
|
33481
33486
|
[pj]: int322(round(py)),
|
|
33482
33487
|
[px]: sub(
|
|
33483
33488
|
div(sub(mul(xr, sub(xc.field, x12)), ox2), dx),
|
|
@@ -35207,6 +35212,11 @@ var Menu = class extends MosaicClient {
|
|
|
35207
35212
|
this.selectedValue(value2);
|
|
35208
35213
|
}
|
|
35209
35214
|
});
|
|
35215
|
+
} else {
|
|
35216
|
+
this.select.addEventListener("pointerenter", (evt) => {
|
|
35217
|
+
if (!evt.buttons) this.activate();
|
|
35218
|
+
});
|
|
35219
|
+
this.select.addEventListener("focus", () => this.activate());
|
|
35210
35220
|
}
|
|
35211
35221
|
}
|
|
35212
35222
|
}
|
|
@@ -35226,6 +35236,9 @@ var Menu = class extends MosaicClient {
|
|
|
35226
35236
|
reset() {
|
|
35227
35237
|
this.select.selectedIndex = this.from ? 0 : -1;
|
|
35228
35238
|
}
|
|
35239
|
+
activate() {
|
|
35240
|
+
this.selection.activate(clausePoint(this.field, 0, { source: this }));
|
|
35241
|
+
}
|
|
35229
35242
|
publish(value) {
|
|
35230
35243
|
const { selection: selection2, field: field3 } = this;
|
|
35231
35244
|
if (isSelection(selection2)) {
|
|
@@ -35331,17 +35344,28 @@ var Search = class extends MosaicClient {
|
|
|
35331
35344
|
this.searchbox.value = value;
|
|
35332
35345
|
}
|
|
35333
35346
|
});
|
|
35347
|
+
} else {
|
|
35348
|
+
this.searchbox.addEventListener("pointerenter", (evt) => {
|
|
35349
|
+
if (!evt.buttons) this.activate();
|
|
35350
|
+
});
|
|
35351
|
+
this.searchbox.addEventListener("focus", () => this.activate());
|
|
35334
35352
|
}
|
|
35335
35353
|
}
|
|
35336
35354
|
}
|
|
35337
35355
|
reset() {
|
|
35338
35356
|
this.searchbox.value = "";
|
|
35339
35357
|
}
|
|
35358
|
+
clause(value) {
|
|
35359
|
+
const { field: field3, type: type2 } = this;
|
|
35360
|
+
return clauseMatch(field3, value, { source: this, method: type2 });
|
|
35361
|
+
}
|
|
35362
|
+
activate() {
|
|
35363
|
+
this.selection.activate(this.clause(""));
|
|
35364
|
+
}
|
|
35340
35365
|
publish(value) {
|
|
35341
|
-
const { selection: selection2
|
|
35366
|
+
const { selection: selection2 } = this;
|
|
35342
35367
|
if (isSelection(selection2)) {
|
|
35343
|
-
|
|
35344
|
-
selection2.update(clause);
|
|
35368
|
+
selection2.update(this.clause(value));
|
|
35345
35369
|
} else if (isParam(selection2)) {
|
|
35346
35370
|
selection2.update(value);
|
|
35347
35371
|
}
|
|
@@ -35460,13 +35484,20 @@ var Slider = class extends MosaicClient {
|
|
|
35460
35484
|
this.curval.innerText = value2;
|
|
35461
35485
|
if (this.selection) this.publish(+value2);
|
|
35462
35486
|
});
|
|
35463
|
-
if (this.selection
|
|
35464
|
-
this.selection
|
|
35465
|
-
|
|
35466
|
-
this.slider.value
|
|
35467
|
-
|
|
35468
|
-
|
|
35469
|
-
|
|
35487
|
+
if (this.selection) {
|
|
35488
|
+
if (!isSelection(this.selection)) {
|
|
35489
|
+
this.selection.addEventListener("value", (value2) => {
|
|
35490
|
+
if (value2 !== +this.slider.value) {
|
|
35491
|
+
this.slider.value = value2;
|
|
35492
|
+
this.curval.innerText = value2;
|
|
35493
|
+
}
|
|
35494
|
+
});
|
|
35495
|
+
} else {
|
|
35496
|
+
this.slider.addEventListener("pointerenter", (evt) => {
|
|
35497
|
+
if (!evt.buttons) this.activate();
|
|
35498
|
+
});
|
|
35499
|
+
this.slider.addEventListener("focus", () => this.activate());
|
|
35500
|
+
}
|
|
35470
35501
|
}
|
|
35471
35502
|
}
|
|
35472
35503
|
query(filter3 = []) {
|
|
@@ -35490,20 +35521,27 @@ var Slider = class extends MosaicClient {
|
|
|
35490
35521
|
}
|
|
35491
35522
|
return this;
|
|
35492
35523
|
}
|
|
35524
|
+
clause(value) {
|
|
35525
|
+
const { field: field3, selectionType } = this;
|
|
35526
|
+
if (selectionType === "interval") {
|
|
35527
|
+
const domain = [this.min ?? 0, value];
|
|
35528
|
+
return clauseInterval(field3, domain, {
|
|
35529
|
+
source: this,
|
|
35530
|
+
bin: "ceil",
|
|
35531
|
+
scale: { type: "identity", domain },
|
|
35532
|
+
pixelSize: this.step
|
|
35533
|
+
});
|
|
35534
|
+
} else {
|
|
35535
|
+
return clausePoint(field3, value, { source: this });
|
|
35536
|
+
}
|
|
35537
|
+
}
|
|
35538
|
+
activate() {
|
|
35539
|
+
this.selection.activate(this.clause(0));
|
|
35540
|
+
}
|
|
35493
35541
|
publish(value) {
|
|
35494
|
-
const {
|
|
35542
|
+
const { selection: selection2 } = this;
|
|
35495
35543
|
if (isSelection(selection2)) {
|
|
35496
|
-
|
|
35497
|
-
const domain = [this.min ?? 0, value];
|
|
35498
|
-
selection2.update(clauseInterval(field3, domain, {
|
|
35499
|
-
source: this,
|
|
35500
|
-
bin: "ceil",
|
|
35501
|
-
scale: { type: "identity", domain },
|
|
35502
|
-
pixelSize: this.step
|
|
35503
|
-
}));
|
|
35504
|
-
} else {
|
|
35505
|
-
selection2.update(clausePoint(field3, value, { source: this }));
|
|
35506
|
-
}
|
|
35544
|
+
selection2.update(this.clause(value));
|
|
35507
35545
|
} else if (isParam(this.selection)) {
|
|
35508
35546
|
selection2.update(value);
|
|
35509
35547
|
}
|
|
@@ -36406,7 +36444,9 @@ __export(marks_exports, {
|
|
|
36406
36444
|
vectorX: () => vectorX2,
|
|
36407
36445
|
vectorY: () => vectorY2,
|
|
36408
36446
|
voronoi: () => voronoi2,
|
|
36409
|
-
voronoiMesh: () => voronoiMesh2
|
|
36447
|
+
voronoiMesh: () => voronoiMesh2,
|
|
36448
|
+
waffleX: () => waffleX2,
|
|
36449
|
+
waffleY: () => waffleY2
|
|
36410
36450
|
});
|
|
36411
36451
|
var decorators = /* @__PURE__ */ new Set([
|
|
36412
36452
|
"frame",
|
|
@@ -36503,6 +36543,8 @@ var gridFy2 = (...args) => mark("gridFy", ...args);
|
|
|
36503
36543
|
var geo2 = (...args) => implicitType(GeoMark, ...args);
|
|
36504
36544
|
var sphere2 = (...args) => mark("sphere", ...args);
|
|
36505
36545
|
var graticule3 = (...args) => mark("graticule", ...args);
|
|
36546
|
+
var waffleX2 = (...args) => mark("waffleX", ...args);
|
|
36547
|
+
var waffleY2 = (...args) => mark("waffleY", ...args);
|
|
36506
36548
|
|
|
36507
36549
|
// ../vgplot/src/plot/interactors.js
|
|
36508
36550
|
var interactors_exports = {};
|