@genome-spy/core 0.55.0 → 0.56.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/dist/bundle/index.es.js +3653 -3545
- package/dist/bundle/index.js +90 -83
- package/dist/schema.json +4 -0
- package/dist/src/gl/glslScaleGenerator.d.ts +1 -0
- package/dist/src/gl/glslScaleGenerator.d.ts.map +1 -1
- package/dist/src/gl/glslScaleGenerator.js +3 -10
- package/dist/src/gl/includes/common.glsl.js +1 -1
- package/dist/src/gl/webGLHelper.d.ts +8 -0
- package/dist/src/gl/webGLHelper.d.ts.map +1 -1
- package/dist/src/gl/webGLHelper.js +40 -0
- package/dist/src/marks/mark.d.ts +8 -0
- package/dist/src/marks/mark.d.ts.map +1 -1
- package/dist/src/marks/mark.js +86 -19
- package/dist/src/marks/rule.d.ts.map +1 -1
- package/dist/src/marks/rule.js +23 -22
- package/dist/src/selection/selection.d.ts +24 -0
- package/dist/src/selection/selection.d.ts.map +1 -1
- package/dist/src/selection/selection.js +78 -2
- package/dist/src/spec/parameter.d.ts +6 -2
- package/dist/src/types/selectionTypes.d.ts +2 -2
- package/dist/src/view/paramMediator.d.ts.map +1 -1
- package/dist/src/view/paramMediator.js +14 -8
- package/dist/src/view/unitView.d.ts.map +1 -1
- package/dist/src/view/unitView.js +56 -20
- package/package.json +2 -2
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { isString } from "vega-util";
|
|
2
2
|
import createFunction from "../utils/expression.js";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
asSelectionConfig,
|
|
5
|
+
createMultiPointSelection,
|
|
6
|
+
createSinglePointSelection,
|
|
7
|
+
isPointSelectionConfig,
|
|
8
|
+
} from "../selection/selection.js";
|
|
4
9
|
|
|
5
10
|
/**
|
|
6
11
|
* A class that manages parameters and expressions.
|
|
@@ -100,13 +105,14 @@ export default class ParamMediator {
|
|
|
100
105
|
}
|
|
101
106
|
|
|
102
107
|
if ("select" in param) {
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
const select = asSelectionConfig(param.select);
|
|
109
|
+
if (isPointSelectionConfig(select)) {
|
|
110
|
+
// Set initial value so that production rules in shaders can be generated, etc.
|
|
111
|
+
setter(
|
|
112
|
+
select.toggle
|
|
113
|
+
? createMultiPointSelection()
|
|
114
|
+
: createSinglePointSelection(null)
|
|
115
|
+
);
|
|
110
116
|
}
|
|
111
117
|
}
|
|
112
118
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unitView.d.ts","sourceRoot":"","sources":["../../../src/view/unitView.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"unitView.d.ts","sourceRoot":"","sources":["../../../src/view/unitView.js"],"names":[],"mappings":"AA2BA;;;;GAIG;AACH,wBAHU,OAAO,OAAO,iBAAiB,EAAE,QAAQ,EAAE,cAAc,kBAAkB,EAAE,OAAO,CAAC,CAc7F;AAEF;IAeI;;;;;;;;OAQG;IACH,kBAPW,OAAO,iBAAiB,EAAE,QAAQ,WAClC,OAAO,yBAAyB,EAAE,OAAO,gBACzC,OAAO,oBAAoB,EAAE,OAAO,cACpC,OAAO,WAAW,EAAE,OAAO,QAC3B,MAAM,YACN,OAAO,WAAW,EAAE,WAAW,EAiCzC;IA5BG,yCAAgB;IAIZ,iDAAiD;IACjD,MADW,OAAO,kBAAkB,EAAE,OAAO,CACnB;IAqHlC,2DAIC;IAED;;;;;OAKG;IAEH,iEA+FC;IAED;;;;;OAKG;IACH,4IAEC;IAkBD;;OAEG;IACH,uDAEC;IAED;;;;;;;;;;;;;OAaG;IACH,uEAHW,OAAO,oBAAoB,EAAE,IAAI,iDAqB3C;IAED,uBAQC;IAgBD;;;;OAIG;IACH,8BAJW,MAAM,+DAEJ,OAAO,iBAAiB,EAAE,kBAAkB,CAKxD;;CACJ;iBAnYgB,WAAW"}
|
|
@@ -16,8 +16,13 @@ import {
|
|
|
16
16
|
import createDomain from "../utils/domainArray.js";
|
|
17
17
|
import AxisResolution from "./axisResolution.js";
|
|
18
18
|
import View from "./view.js";
|
|
19
|
-
import {
|
|
20
|
-
|
|
19
|
+
import {
|
|
20
|
+
asSelectionConfig,
|
|
21
|
+
createMultiPointSelection,
|
|
22
|
+
createSinglePointSelection,
|
|
23
|
+
isPointSelectionConfig,
|
|
24
|
+
updateMultiPointSelection,
|
|
25
|
+
} from "../selection/selection.js";
|
|
21
26
|
import { UNIQUE_ID_KEY } from "../data/transforms/identifier.js";
|
|
22
27
|
|
|
23
28
|
/**
|
|
@@ -101,12 +106,12 @@ export default class UnitView extends View {
|
|
|
101
106
|
continue;
|
|
102
107
|
}
|
|
103
108
|
|
|
104
|
-
const select = param.select;
|
|
105
|
-
|
|
106
|
-
if (
|
|
109
|
+
const select = asSelectionConfig(param.select);
|
|
110
|
+
|
|
111
|
+
if (isPointSelectionConfig(select)) {
|
|
107
112
|
// Handle projection-free point selections
|
|
108
113
|
|
|
109
|
-
const none =
|
|
114
|
+
const none = 0;
|
|
110
115
|
let lastId = none;
|
|
111
116
|
|
|
112
117
|
const setter = this.paramMediator.getSetter(name);
|
|
@@ -116,24 +121,55 @@ export default class UnitView extends View {
|
|
|
116
121
|
return h?.mark?.unitView === this ? h.datum : null;
|
|
117
122
|
};
|
|
118
123
|
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
124
|
+
const listener = (
|
|
125
|
+
/** @type {any} */ _,
|
|
126
|
+
/** @type {import("../utils/interactionEvent.js").default} */ event
|
|
127
|
+
) => {
|
|
128
|
+
const mouseEvent = /** @type {MouseEvent} */ (
|
|
129
|
+
event.uiEvent
|
|
130
|
+
);
|
|
131
|
+
const datum = getHoveredDatum();
|
|
132
|
+
const id = datum ? datum[UNIQUE_ID_KEY] : none;
|
|
133
|
+
|
|
134
|
+
/** @type {any} */
|
|
135
|
+
let selection;
|
|
136
|
+
|
|
137
|
+
if (select.toggle) {
|
|
138
|
+
const toggle = mouseEvent.shiftKey;
|
|
139
|
+
|
|
140
|
+
if (toggle) {
|
|
141
|
+
if (datum) {
|
|
142
|
+
const previousSelection =
|
|
143
|
+
this.paramMediator.getValue(name);
|
|
144
|
+
selection = updateMultiPointSelection(
|
|
145
|
+
previousSelection,
|
|
146
|
+
{
|
|
147
|
+
toggle: [datum],
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
} else {
|
|
152
|
+
selection = createMultiPointSelection(
|
|
153
|
+
datum ? [datum] : null
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
} else {
|
|
129
157
|
if (id != lastId) {
|
|
130
158
|
lastId = id;
|
|
131
|
-
|
|
132
|
-
getHoveredDatum()
|
|
133
|
-
);
|
|
134
|
-
setter(selection);
|
|
159
|
+
selection = createSinglePointSelection(datum);
|
|
135
160
|
}
|
|
136
161
|
}
|
|
162
|
+
|
|
163
|
+
if (selection !== undefined) {
|
|
164
|
+
setter(selection);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
this.addInteractionEventListener(
|
|
169
|
+
["mouseover", "pointerover"].includes(select.on)
|
|
170
|
+
? "mousemove"
|
|
171
|
+
: "click",
|
|
172
|
+
listener
|
|
137
173
|
);
|
|
138
174
|
}
|
|
139
175
|
}
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"contributors": [],
|
|
9
9
|
"license": "MIT",
|
|
10
|
-
"version": "0.
|
|
10
|
+
"version": "0.56.1",
|
|
11
11
|
"jsdelivr": "dist/bundle/index.js",
|
|
12
12
|
"unpkg": "dist/bundle/index.js",
|
|
13
13
|
"browser": "dist/bundle/index.js",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/long": "^4.0.1"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "453d25739c7996fc60fe5fa125784c8532b40e4f"
|
|
71
71
|
}
|