@genome-spy/core 0.26.0 → 0.28.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.
package/dist/schema.json CHANGED
@@ -946,6 +946,19 @@
946
946
  },
947
947
  "type": "object"
948
948
  },
949
+ "ExprDef": {
950
+ "additionalProperties": false,
951
+ "properties": {
952
+ "expr": {
953
+ "description": "An expression. Properties of the data can be accessed through the `datum` object.",
954
+ "type": "string"
955
+ }
956
+ },
957
+ "required": [
958
+ "expr"
959
+ ],
960
+ "type": "object"
961
+ },
949
962
  "Field": {
950
963
  "description": "The name of the field or a JavaScript expression for accessing nested properties. Dots and brackets in the field name must be escaped.",
951
964
  "type": "string"
@@ -4570,6 +4583,9 @@
4570
4583
  },
4571
4584
  {
4572
4585
  "$ref": "#/definitions/StringDatumDef"
4586
+ },
4587
+ {
4588
+ "$ref": "#/definitions/ExprDef"
4573
4589
  }
4574
4590
  ]
4575
4591
  },
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "contributors": [],
9
9
  "license": "BSD-2-Clause",
10
- "version": "0.26.0",
10
+ "version": "0.28.0",
11
11
  "main": "dist/index.js",
12
12
  "module": "src/index.js",
13
13
  "exports": {
@@ -46,12 +46,11 @@
46
46
  "d3-format": "^3.0.1",
47
47
  "flatqueue": "^2.0.3",
48
48
  "internmap": "^2.0.3",
49
- "lit-html": "^2.0.2",
49
+ "lit-html": "^2.4.0",
50
50
  "twgl.js": "^4.19.1",
51
51
  "vega-expression": "^5.0.0",
52
52
  "vega-loader": "^4.4.0",
53
53
  "vega-scale": "^7.1.1",
54
54
  "vega-util": "^1.16.0"
55
- },
56
- "gitHead": "586a200b57b9d9ef12b2d28d7a843b2c7cc1b33a"
55
+ }
57
56
  }
@@ -293,7 +293,10 @@ export interface StringFieldDef<F extends Field>
293
293
  extends FieldDefWithoutScale<F>,
294
294
  FormatMixins {}
295
295
 
296
- export type TextDef<F extends Field> = StringFieldDef<F> | StringDatumDef;
296
+ export type TextDef<F extends Field> =
297
+ | StringFieldDef<F>
298
+ | StringDatumDef
299
+ | ExprDef;
297
300
 
298
301
  export type ChannelDef<F extends Field = string> =
299
302
  Encoding<F>[keyof Encoding<F>];
@@ -3,6 +3,7 @@ import {
3
3
  FlexDimensions,
4
4
  getLargestSize,
5
5
  mapToPixelCoords,
6
+ parseSizeDef,
6
7
  ZERO_SIZEDEF,
7
8
  } from "../utils/layout/flexLayout";
8
9
  import Grid from "../utils/layout/grid";
@@ -429,6 +430,13 @@ export default class GridView extends ContainerView {
429
430
  let grow = 0;
430
431
  let px = 0;
431
432
 
433
+ const explicitSize =
434
+ (direction == "row" && this.spec.height) ||
435
+ (direction == "column" && this.spec.width);
436
+ if (explicitSize !== undefined && explicitSize !== "") {
437
+ return parseSizeDef(explicitSize);
438
+ }
439
+
432
440
  const sizes = this.#getSizes(direction);
433
441
 
434
442
  for (const [i, size] of sizes.entries()) {
package/LICENSE DELETED
@@ -1,24 +0,0 @@
1
- BSD 2-Clause License
2
-
3
- Copyright (c) 2018-2022 Kari Lavikka
4
-
5
- Redistribution and use in source and binary forms, with or without
6
- modification, are permitted provided that the following conditions are met:
7
-
8
- 1. Redistributions of source code must retain the above copyright notice, this
9
- list of conditions and the following disclaimer.
10
-
11
- 2. Redistributions in binary form must reproduce the above copyright notice,
12
- this list of conditions and the following disclaimer in the documentation
13
- and/or other materials provided with the distribution.
14
-
15
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.