@genome-spy/core 0.42.0 → 0.42.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 (53) hide show
  1. package/dist/bundle/index.es.js +2575 -2567
  2. package/dist/bundle/index.js +75 -74
  3. package/dist/src/encoder/encoder.d.ts +6 -1
  4. package/dist/src/encoder/encoder.d.ts.map +1 -1
  5. package/dist/src/encoder/encoder.js +10 -0
  6. package/dist/src/gl/arrayBuilder.js +1 -1
  7. package/dist/src/gl/colorUtils.d.ts.map +1 -0
  8. package/dist/src/{scale → gl}/colorUtils.js +1 -1
  9. package/dist/src/gl/dataToVertices.d.ts +1 -9
  10. package/dist/src/gl/dataToVertices.d.ts.map +1 -1
  11. package/dist/src/gl/dataToVertices.js +33 -73
  12. package/dist/src/{scale → gl}/glslScaleGenerator.d.ts +23 -1
  13. package/dist/src/gl/glslScaleGenerator.d.ts.map +1 -0
  14. package/dist/src/{scale → gl}/glslScaleGenerator.js +61 -8
  15. package/dist/src/gl/webGLHelper.js +1 -1
  16. package/dist/src/marks/link.js +2 -2
  17. package/dist/src/marks/mark.d.ts +2 -1
  18. package/dist/src/marks/mark.d.ts.map +1 -1
  19. package/dist/src/marks/mark.js +30 -2
  20. package/dist/src/marks/{pointMark.d.ts → point.d.ts} +1 -1
  21. package/dist/src/marks/point.d.ts.map +1 -0
  22. package/dist/src/marks/{pointMark.js → point.js} +3 -3
  23. package/dist/src/marks/{rectMark.d.ts → rect.d.ts} +1 -1
  24. package/dist/src/marks/rect.d.ts.map +1 -0
  25. package/dist/src/marks/{rectMark.js → rect.js} +2 -3
  26. package/dist/src/marks/rect.vertex.glsl.js +2 -0
  27. package/dist/src/marks/rule.js +3 -3
  28. package/dist/src/marks/text.js +3 -3
  29. package/dist/src/utils/indexer.d.ts.map +1 -1
  30. package/dist/src/utils/indexer.js +10 -1
  31. package/dist/src/utils/indexer.test.js +2 -0
  32. package/dist/src/view/unitView.d.ts +1 -1
  33. package/dist/src/view/unitView.js +2 -2
  34. package/dist/src/view/view.test.js +1 -1
  35. package/package.json +2 -2
  36. package/dist/src/gl/rect.vertex.glsl.js +0 -2
  37. package/dist/src/marks/pointMark.d.ts.map +0 -1
  38. package/dist/src/marks/rectMark.d.ts.map +0 -1
  39. package/dist/src/scale/colorUtils.d.ts.map +0 -1
  40. package/dist/src/scale/glslScaleGenerator.d.ts.map +0 -1
  41. /package/dist/src/{scale → gl}/colorUtils.d.ts +0 -0
  42. /package/dist/src/{gl → marks}/link.fragment.glsl.js +0 -0
  43. /package/dist/src/{gl → marks}/link.vertex.glsl.js +0 -0
  44. /package/dist/src/{gl → marks}/point.common.glsl.js +0 -0
  45. /package/dist/src/{gl → marks}/point.fragment.glsl.js +0 -0
  46. /package/dist/src/{gl → marks}/point.vertex.glsl.js +0 -0
  47. /package/dist/src/{gl → marks}/rect.fragment.glsl.js +0 -0
  48. /package/dist/src/{gl → marks}/rule.common.glsl.js +0 -0
  49. /package/dist/src/{gl → marks}/rule.fragment.glsl.js +0 -0
  50. /package/dist/src/{gl → marks}/rule.vertex.glsl.js +0 -0
  51. /package/dist/src/{gl → marks}/text.common.glsl.js +0 -0
  52. /package/dist/src/{gl → marks}/text.fragment.glsl.js +0 -0
  53. /package/dist/src/{gl → marks}/text.vertex.glsl.js +0 -0
@@ -6,9 +6,9 @@ import {
6
6
  setBuffersAndAttributes,
7
7
  setUniforms,
8
8
  } from "twgl.js";
9
- import VERTEX_SHADER from "../gl/text.vertex.glsl.js";
10
- import FRAGMENT_SHADER from "../gl/text.fragment.glsl.js";
11
- import COMMON_SHADER from "../gl/text.common.glsl.js";
9
+ import VERTEX_SHADER from "./text.vertex.glsl.js";
10
+ import FRAGMENT_SHADER from "./text.fragment.glsl.js";
11
+ import COMMON_SHADER from "./text.common.glsl.js";
12
12
  import { TextVertexBuilder } from "../gl/dataToVertices.js";
13
13
 
14
14
  import Mark from "./mark.js";
@@ -1 +1 @@
1
- {"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../../../src/utils/indexer.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH;;IAgBI,oCAAoC;;IAOpC,4BAA4B;kBAAhB,MAAM;;EAYrB"}
1
+ {"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../../../src/utils/indexer.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH;;IAyBI,oCAAoC;;IAOpC,4BAA4B;kBAAhB,MAAM;;EAYrB"}
@@ -8,16 +8,25 @@
8
8
  export default function createIndexer() {
9
9
  let counter = 0;
10
10
 
11
+ /** @type {any} */
12
+ let previousValue;
13
+ let index = 0;
14
+
11
15
  /** @type {Map<T, number>} */
12
16
  const values = new Map();
13
17
 
14
18
  /** @param {T} value */
15
19
  const indexer = (value) => {
16
- let index = values.get(value);
20
+ if (value === previousValue) {
21
+ return index;
22
+ }
23
+
24
+ index = values.get(value);
17
25
  if (index === undefined) {
18
26
  index = counter++;
19
27
  values.set(value, index);
20
28
  }
29
+ previousValue = value;
21
30
  return index;
22
31
  };
23
32
 
@@ -8,6 +8,8 @@ test("Index values one by one", () => {
8
8
  expect(indexer("b")).toEqual(1);
9
9
  expect(indexer("c")).toEqual(2);
10
10
  expect(indexer("a")).toEqual(0);
11
+ expect(indexer("a")).toEqual(0);
12
+ expect(indexer("c")).toEqual(2);
11
13
  expect(indexer("c")).toEqual(2);
12
14
  });
13
15
 
@@ -54,7 +54,7 @@ export default class UnitView extends ContainerView {
54
54
  /**
55
55
  * @param {Channel} channel A primary channel
56
56
  */
57
- _validateDomainQuery(channel: import("../spec/channel.js").Channel): import("../spec/channel.js").ChromPosDef | import("../spec/channel.js").PositionDatumDef | import("../spec/channel.js").MarkPropExprDef<import("../spec/channel.js").Type> | import("../spec/channel.js").MarkPropDatumDef<import("../spec/channel.js").Type> | import("../spec/channel.js").MarkPropDatumDef<import("../spec/channel.js").TypeForShape> | import("../spec/channel.js").PositionFieldDef<string> | import("../spec/channel.js").MarkPropFieldDef<string, import("../spec/channel.js").Type> | import("../spec/channel.js").MarkPropFieldDef<string, import("../spec/channel.js").TypeForShape>;
57
+ _validateDomainQuery(channel: import("../spec/channel.js").Channel): import("../spec/channel.js").MarkPropExprDef<import("../spec/channel.js").Type> | import("../spec/channel.js").MarkPropDatumDef<import("../spec/channel.js").Type> | import("../spec/channel.js").ChromPosDef | import("../spec/channel.js").PositionDatumDef | import("../spec/channel.js").MarkPropDatumDef<import("../spec/channel.js").TypeForShape> | import("../spec/channel.js").MarkPropFieldDef<string, import("../spec/channel.js").Type> | import("../spec/channel.js").PositionFieldDef<string> | import("../spec/channel.js").MarkPropFieldDef<string, import("../spec/channel.js").TypeForShape>;
58
58
  /**
59
59
  * Returns the domain of the specified channel of this domain/mark.
60
60
  *
@@ -1,5 +1,5 @@
1
- import RectMark from "../marks/rectMark.js";
2
- import PointMark from "../marks/pointMark.js";
1
+ import RectMark from "../marks/rect.js";
2
+ import PointMark from "../marks/point.js";
3
3
  import RuleMark from "../marks/rule.js";
4
4
  import LinkMark from "../marks/link.js";
5
5
  import TextMark from "../marks/text.js";
@@ -4,7 +4,7 @@ import UnitView from "./unitView.js";
4
4
  import { create, createAndInitialize } from "./testUtils.js";
5
5
  import { toRegularArray as r } from "../utils/domainArray.js";
6
6
  import ConcatView from "./concatView.js";
7
- import PointMark from "../marks/pointMark.js";
7
+ import PointMark from "../marks/point.js";
8
8
  import View from "./view.js";
9
9
  import LayerView from "./layerView.js";
10
10
 
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "contributors": [],
9
9
  "license": "MIT",
10
- "version": "0.42.0",
10
+ "version": "0.42.2",
11
11
  "jsdelivr": "dist/bundle/index.js",
12
12
  "unpkg": "dist/bundle/index.js",
13
13
  "browser": "dist/bundle/index.js",
@@ -65,5 +65,5 @@
65
65
  "vega-scale": "^7.1.1",
66
66
  "vega-util": "^1.16.0"
67
67
  },
68
- "gitHead": "59a4384ba903ee1b81212593e872ea61accc729d"
68
+ "gitHead": "dfeb11779563fcc77e9e82f6f536c6512136b550"
69
69
  }
@@ -1,2 +0,0 @@
1
- const shader = "uniform Mark{uniform float uMinWidth;uniform float uMinHeight;uniform float uMinOpacity;uniform float uCornerRadiusTopRight;uniform float uCornerRadiusBottomRight;uniform float uCornerRadiusTopLeft;uniform float uCornerRadiusBottomLeft;};/***The vertex position wrt the rectangle specified by(x,x2,y,y2).*[0,0]=[x,y],[1,1]=[x2,y2].*The x or y component may contain fractional values if the rectangle*have been tessellated.*/in vec2 frac;out lowp vec4 vFillColor;out lowp vec4 vStrokeColor;out float vHalfStrokeWidth;out vec4 vCornerRadii;\n#if defined(ROUNDED_CORNERS) || defined(STROKED)\nout vec2 vPosInPixels;\n#endif\nout vec2 vHalfSizeInPixels;/***Clamps the minimumSize and returns an opacity that reflects the amount of clamping.*/float clampMinSize(inout float pos,float frac,float size,float minSize){if(minSize>0.0&&abs(size)<minSize){pos+=(frac-0.5)*(minSize*sign(size)-size);return abs(size)/minSize;}return 1.0;}void sort(inout float a,inout float b){if(a>b){float tmp=b;b=a;a=tmp;}}void main(void){vec2 normalizedMinSize=vec2(uMinWidth,uMinHeight)/uViewportSize;vec4 cornerRadii=vec4(uCornerRadiusTopRight,uCornerRadiusBottomRight,uCornerRadiusBottomLeft,uCornerRadiusTopLeft);float x=getScaled_x();float x2=getScaled_x2();float y=getScaled_y();float y2=getScaled_y2();sort(x,x2);sort(y,y2);float clampMargin=1.0;vec2 pos1=vec2(clamp(x,0.0-clampMargin,1.0+clampMargin),y);vec2 pos2=vec2(clamp(x2,0.0-clampMargin,1.0+clampMargin),y2);vec2 size=pos2-pos1;if(size.x<=0.0||size.y<=0.0){gl_Position=vec4(0.0,0.0,0.0,1.0);return;}vec2 pos=pos1+frac*size;size.y*=getSampleFacetHeight(pos);float opaFactor=uViewOpacity*max(uMinOpacity,clampMinSize(pos.x,frac.x,size.x,normalizedMinSize.x)*clampMinSize(pos.y,frac.y,size.y,normalizedMinSize.y));pos=applySampleFacet(pos);\n#if defined(ROUNDED_CORNERS) || defined(STROKED)\nfloat aaPadding=1.0/uDevicePixelRatio;float strokeWidth=getScaled_strokeWidth();float strokeOpacity=getScaled_strokeOpacity()*opaFactor;vec2 centeredFrac=frac-0.5;vec2 expand=centeredFrac*(strokeWidth+aaPadding)/uViewportSize;pos+=expand;vec2 sizeInPixels=size*uViewportSize;vPosInPixels=(centeredFrac+expand/size)*sizeInPixels;vHalfSizeInPixels=sizeInPixels/2.0;vCornerRadii=min(cornerRadii,min(vHalfSizeInPixels.x,vHalfSizeInPixels.y));vHalfStrokeWidth=strokeWidth/2.0;vStrokeColor=vec4(getScaled_stroke()*strokeOpacity,strokeOpacity);\n#endif\ngl_Position=unitToNdc(pos);float fillOpacity=getScaled_fillOpacity()*opaFactor;vFillColor=vec4(getScaled_fill()*fillOpacity,fillOpacity);setupPicking();}";
2
- export default shader;
@@ -1 +0,0 @@
1
- {"version":3,"file":"pointMark.d.ts","sourceRoot":"","sources":["../../../src/marks/pointMark.js"],"names":[],"mappings":"AAkBA;IAsGY,oCAMC;IA2CT,mCAQC;IAED;;OAEG;IACH,wDASC;IAED,+BAoBC;CAiDJ;iBA3PgB,WAAW"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"rectMark.d.ts","sourceRoot":"","sources":["../../../src/marks/rectMark.js"],"names":[],"mappings":"AAYA;IA2NI;;;;;;;;;;OAUG;IACH,8BALW,GAAG,KACH,OAAO,oBAAoB,EAAE,MAAM,GACjC,GAAG,CAyBf;;CACJ;iBApQgB,WAAW"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"colorUtils.d.ts","sourceRoot":"","sources":["../../../src/scale/colorUtils.js"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,kDALW,MAAM,GAAG,OAAO,kBAAkB,EAAE,YAAY,MAChD,sBAAsB,UACtB,MAAM,oBACN,YAAY,gBAqCtB;AAED;;;;;GAKG;AACH,uDALW,MAAM,EAAE,qBACR,OAAO,kBAAkB,EAAE,gBAAgB,GAAG,OAAO,kBAAkB,EAAE,sBAAsB,MAC/F,sBAAsB,oBACtB,YAAY,gBA6BtB;AAED;;;;;;;;GAQG;AACH,6CALW,MAAM,EAAE,MACR,sBAAsB,UACtB,MAAM,oBACN,YAAY,gBAqBtB;AAED;;;;;;;GAOG;AACH,mDALW,MAAM,EAAE,MACR,sBAAsB,UACtB,MAAM,oBACN,YAAY,gBActB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"glslScaleGenerator.d.ts","sourceRoot":"","sources":["../../../src/scale/glslScaleGenerator.js"],"names":[],"mappings":"AAiDA;;;;GAIG;AACH,2CAHW,OAAO,SACP,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,OAAO,UAsC9C;AAED;;;;;GAKG;AAEH,2CALW,OAAO,SACP,GAAG,cACH,OAAO,oBAAoB,EAAE,UAAU;;;EA8QjD;AA+FD;;;GAGG;AACH,2CAFW,MAAM,WAIhB;AAOD;;;GAGG;AACH,sCAHW,MAAM,QACN,MAAM,EAAE,YAYlB;AAYD;;GAEG;AACH,qDAFW,MAAM,EAAE,YAIlB;AAteD,uCAAwC;AACxC,uCAAwC;AACxC,oCAAqC;AACrC,6CAA8C;AAC9C,kDAAmD;AACnD,oDAAqD;sBAMxC,OAAO,oBAAoB,EAAE,OAAO;;;;8BAgXpC,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes