@genome-spy/core 0.28.3 → 0.30.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.
@@ -220,6 +220,12 @@ export default class ScaleResolution {
220
220
  props.domain = domain;
221
221
  } else if (isDiscrete(props.type)) {
222
222
  props.domain = new NominalDomain();
223
+ } else if (props.scheme) {
224
+ // An initial domain is required when using a scheme.
225
+ // Otherwise configureScale() does something weird when the domain is set later,
226
+ // resulting in an interpolator between just two colors.
227
+ // TODO: Fix configureScale().
228
+ props.domain = [0, 1];
223
229
  }
224
230
 
225
231
  if (!props.domain && props.domainMid !== undefined) {
@@ -18,7 +18,7 @@ import { rollup } from "d3-array";
18
18
  * @typedef {import("../spec/view").ViewSpec} ViewSpec
19
19
  * @typedef {import("../spec/view").LayerSpec} LayerSpec
20
20
  * @typedef {import("../spec/view").FacetSpec} FacetSpec
21
- * @typedef {import("../spec/view").SampleSpec} SampleSpec
21
+ * @typedef {import("../spec/sampleView").SampleSpec} SampleSpec
22
22
  * @typedef {import("../spec/view").UnitSpec} UnitSpec
23
23
  * @typedef {import("../spec/view").VConcatSpec} VConcatSpec
24
24
  * @typedef {import("../spec/view").HConcatSpec} HConcatSpec
package/src/view/zoom.js CHANGED
@@ -30,10 +30,10 @@ export default function interactionToZoom(event, coords, handleZoom, hover) {
30
30
 
31
31
  if (hover) {
32
32
  const e = hover.mark.encoders;
33
- if (e.x && !e.x2) {
33
+ if (e.x && !e.x2 && !e.x.constantValue) {
34
34
  x = +e.x(hover.datum) * coords.width + coords.x;
35
35
  }
36
- if (e.y && !e.y2) {
36
+ if (e.y && !e.y2 && !e.y.constantValue) {
37
37
  y = (1 - +e.y(hover.datum)) * coords.height + coords.y;
38
38
  }
39
39
  }