@genome-spy/core 0.24.0 → 0.24.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/index.js +1 -1
- package/package.json +2 -2
- package/src/marks/link.js +5 -1
package/dist/index.js
CHANGED
|
@@ -104,7 +104,7 @@ vec3 color=mix(getScaled_color(),getScaled_color2(),t);
|
|
|
104
104
|
#else
|
|
105
105
|
vec3 color=getScaled_color();
|
|
106
106
|
#endif
|
|
107
|
-
vColor=vec4(color*opacity,opacity);vSize=paddedSize;setupPicking();}`,yw="in lowp vec4 vColor;in float vSize;in float vNormalLengthInPixels;out lowp vec4 fragColor;void main(void){float dpr=uDevicePixelRatio;float distance=abs(vNormalLengthInPixels);float opacity=clamp(((vSize/2.0-distance)*dpr),0.0,1.0);fragColor=vColor*opacity;if(uPickingEnabled){fragColor=vPickingColor;}}";class bw extends Wr{constructor(e){super(e),Object.defineProperties(this.defaultProperties,Object.getOwnPropertyDescriptors({x:0,x2:void 0,y:0,y2:void 0,size:1,color:"black",opacity:1,segments:101,sagittaScaleFactor:1,minSagittaLength:1.5}))}getAttributes(){return["uniqueId","facetIndex","x","x2","y","y2","size","height","color","opacity"]}getSupportedChannels(){return[...super.getSupportedChannels(),"x2","y2","size"]}fixEncoding(e){return e.x||(e.x2=e.x),e.y2||(e.y2=e.y),e}async initializeGraphics(){await super.initializeGraphics(),this.createAndLinkShaders(xw,yw)}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const e=this.properties;Ee(this.programInfo,{uSagittaScaleFactor:e.sagittaScaleFactor,uMinSagittaLength:e.minSagittaLength})}updateGraphicsData(){const e=this.unitView.getCollector(),n=e.getItemCount(),r=new Vb({encoders:this.encoders,attributes:this.getAttributes(),numItems:n});r.addBatches(e.facetBatches);const i=r.toArrays();i.arrays.strip={data:ww(this.properties.segments),numComponents:2},this.rangeMap.migrateEntries(i.rangeMap),this.arrays=Object.fromEntries(Object.entries(i.arrays).map(([o,s])=>[o,{...s,data:void 0}])),this.updateBufferInfo(i)}render(e){const n=this.gl;return this.createRenderCallback((r,i)=>{this.gl.bindVertexArray(this.vertexArrayInfo.vertexArrayObject);for(const o of Object.entries(this.bufferInfo.attribs)){const[s,a]=o;a.buffer&&
|
|
107
|
+
vColor=vec4(color*opacity,opacity);vSize=paddedSize;setupPicking();}`,yw="in lowp vec4 vColor;in float vSize;in float vNormalLengthInPixels;out lowp vec4 fragColor;void main(void){float dpr=uDevicePixelRatio;float distance=abs(vNormalLengthInPixels);float opacity=clamp(((vSize/2.0-distance)*dpr),0.0,1.0);fragColor=vColor*opacity;if(uPickingEnabled){fragColor=vPickingColor;}}";class bw extends Wr{constructor(e){super(e),Object.defineProperties(this.defaultProperties,Object.getOwnPropertyDescriptors({x:0,x2:void 0,y:0,y2:void 0,size:1,color:"black",opacity:1,segments:101,sagittaScaleFactor:1,minSagittaLength:1.5}))}getAttributes(){return["uniqueId","facetIndex","x","x2","y","y2","size","height","color","opacity"]}getSupportedChannels(){return[...super.getSupportedChannels(),"x2","y2","size"]}fixEncoding(e){return e.x||(e.x2=e.x),e.y2||(e.y2=e.y),e}async initializeGraphics(){await super.initializeGraphics(),this.createAndLinkShaders(xw,yw)}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const e=this.properties;Ee(this.programInfo,{uSagittaScaleFactor:e.sagittaScaleFactor,uMinSagittaLength:e.minSagittaLength})}updateGraphicsData(){const e=this.unitView.getCollector(),n=e.getItemCount(),r=new Vb({encoders:this.encoders,attributes:this.getAttributes(),numItems:n});r.addBatches(e.facetBatches);const i=r.toArrays();i.arrays.strip={data:ww(this.properties.segments),numComponents:2},this.rangeMap.migrateEntries(i.rangeMap),this.arrays=Object.fromEntries(Object.entries(i.arrays).map(([o,s])=>[o,{...s,data:void 0}])),this.updateBufferInfo(i)}render(e){const n=this.gl;return this.createRenderCallback((r,i)=>{this.gl.bindVertexArray(this.vertexArrayInfo.vertexArrayObject);for(const o of Object.entries(this.bufferInfo.attribs)){const[s,a]=o;a.buffer&&a.numComponents&&a.divisor&&(a.offset=r*this.arrays[s].numComponents*4)}Ln(n,this.programInfo,this.bufferInfo),jr(n,this.bufferInfo,n.TRIANGLE_STRIP,(this.properties.segments+1)*2,0,i)},e)}}function ww(t){let e=0;const n=[];for(;e<=t;e++)n.push(e/t,.5),n.push(e/t,-.5);return n}const vw=`uniform float uSdfNumerator;uniform vec2 uD;in mediump vec2 vertexCoord;in lowp vec2 textureCoord;uniform vec4 uViewportEdgeFadeWidth;uniform vec4 uViewportEdgeFadeDistance;uniform bool uSqueeze;uniform bool uLogoLetter;in float width;uniform ivec2 uAlign;
|
|
108
108
|
#ifdef x2_DEFINED
|
|
109
109
|
uniform float uPaddingX;uniform bool uFlushX;
|
|
110
110
|
#endif
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"contributors": [],
|
|
9
9
|
"license": "BSD-2-Clause",
|
|
10
|
-
"version": "0.24.
|
|
10
|
+
"version": "0.24.2",
|
|
11
11
|
"main": "dist/index.js",
|
|
12
12
|
"module": "src/index.js",
|
|
13
13
|
"exports": {
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"vega-scale": "^7.1.1",
|
|
54
54
|
"vega-util": "^1.16.0"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "587ef91161457b17a039f82111d15df339e1e9f5"
|
|
57
57
|
}
|
package/src/marks/link.js
CHANGED
|
@@ -140,7 +140,11 @@ export default class LinkMark extends Mark {
|
|
|
140
140
|
this.bufferInfo.attribs
|
|
141
141
|
)) {
|
|
142
142
|
const [attribute, attribInfo] = attribInfoObject;
|
|
143
|
-
if (
|
|
143
|
+
if (
|
|
144
|
+
attribInfo.buffer &&
|
|
145
|
+
attribInfo.numComponents &&
|
|
146
|
+
attribInfo.divisor
|
|
147
|
+
) {
|
|
144
148
|
attribInfo.offset =
|
|
145
149
|
offset * this.arrays[attribute].numComponents * 4; // gl.FLOAT in bytes
|
|
146
150
|
}
|