jbrowse-plugin-graphgenomeviewer 8.3.10 → 8.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jbrowse-plugin-graphgenomeviewer",
3
- "version": "8.3.10",
3
+ "version": "8.4.0",
4
4
  "description": "JBrowse 2 graph genome (pangenome) view: rGFA reference-anchored layouts, the Bandage force-directed engine, and haplotype lanes read from a gbz-base database",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "repository": {
@@ -1117,14 +1117,7 @@ test('each grammar setter writes the track config, and the pane reads it back',
1117
1117
  display.setWalkRowSamples(['HG1'])
1118
1118
  display.setWalkRowOrder('shared')
1119
1119
  display.setHover('off')
1120
- const slots = [
1121
- 'layoutMode',
1122
- 'encoding',
1123
- 'size',
1124
- 'layers',
1125
- 'facet',
1126
- 'rows',
1127
- ] as const
1120
+ const slots = ['layoutMode', 'encoding', 'size', 'layers', 'rows'] as const
1128
1121
  expect(
1129
1122
  Object.fromEntries(
1130
1123
  [...slots, 'hover' as const].map(s => [
@@ -1137,10 +1130,10 @@ test('each grammar setter writes the track config, and the pane reads it back',
1137
1130
  encoding: { color: { field: 'depth' } },
1138
1131
  size: { value: 6, links: 'walks' },
1139
1132
  layers: { bubbles: true },
1140
- facet: { field: 'walk', sort: [] },
1141
1133
  rows: { kept: ['HG1'], order: 'shared' },
1142
1134
  hover: 'off',
1143
1135
  })
1136
+ expect(readConfObject(display.configuration, ['facet', 'field'])).toBe('walk')
1144
1137
  expect([
1145
1138
  display.chosenLayoutMode,
1146
1139
  display.chosenColorScheme,
@@ -3,6 +3,7 @@ import { ConfigurationSchema } from '@jbrowse/core/configuration'
3
3
  import { trackHeightConfigSchemaFields } from '@jbrowse/display-kit/trackHeightConfigSchemaFields'
4
4
  import { types } from '@jbrowse/mobx-state-tree'
5
5
 
6
+ import { graphFacetConfigSchema } from './graphFacetConfigSchema'
6
7
  import { HOVER_HIGHLIGHT_VALUES } from '../GraphGenomeView/hoverHighlight'
7
8
  import { retiredGraphColor } from '../GraphGenomeView/retiredNodeColor'
8
9
 
@@ -76,11 +77,7 @@ export function configSchemaFactory() {
76
77
  * `walk` or `sample`, and walk rows stack into a section per value of
77
78
  * a sample table column. A bare field, or `{ field, sort, columns }`
78
79
  */
79
- facet: {
80
- type: 'frozen',
81
- defaultValue: {},
82
- plot: true,
83
- },
80
+ facet: graphFacetConfigSchema,
84
81
  /**
85
82
  * #slot
86
83
  * the rows walk rows draw: `{ kept: [...] }` names the samples shown
@@ -0,0 +1,13 @@
1
+ import { readConfObject } from '@jbrowse/core/configuration'
2
+
3
+ import { graphFacetConfigSchema } from './graphFacetConfigSchema'
4
+
5
+ test("bandage-core 11's domain loads as sort", () => {
6
+ const facet = graphFacetConfigSchema.create({
7
+ field: 'sample',
8
+ domain: ['HG1', 'HG2'],
9
+ columns: 2,
10
+ })
11
+ expect(readConfObject(facet, 'sort')).toEqual(['HG1', 'HG2'])
12
+ expect(readConfObject(facet, 'columns')).toBe(2)
13
+ })
@@ -0,0 +1,37 @@
1
+ import { ConfigurationSchema } from '@jbrowse/core/configuration'
2
+ import { facetConfigSchema } from '@jbrowse/display-kit/facetConfigSchema'
3
+
4
+ /**
5
+ * #config GraphFacet
6
+ * The graph display's `facet`: core's Facet, a `field` and the `sort` its
7
+ * sections lead with, and the `columns` a node layout's panels wrap at. A
8
+ * bare string is the field.
9
+ *
10
+ * #example
11
+ * ```js
12
+ * { type: 'LinearGraphDisplay', facet: { field: 'walk', columns: 3 } }
13
+ * ```
14
+ */
15
+ export const graphFacetConfigSchema = ConfigurationSchema(
16
+ 'GraphFacet',
17
+ {
18
+ /**
19
+ * #slot columns
20
+ * Panels per row of a node layout's grid; unset fits them to the track.
21
+ */
22
+ columns: {
23
+ type: 'maybeNumber',
24
+ description: "panels per row of a node layout's grid; unset fits them",
25
+ },
26
+ },
27
+ {
28
+ /**
29
+ * #baseConfiguration
30
+ */
31
+ baseConfiguration: facetConfigSchema,
32
+ // bandage-core's `domain` through 11.x, its `sort` since 12
33
+ retired: {
34
+ domain: (sort: unknown) => ({ sort }),
35
+ },
36
+ },
37
+ )
@@ -132,7 +132,11 @@ export function stateModelFactory(configSchema: LinearGraphDisplayConfigModel) {
132
132
  encoding: getConf(self, 'encoding'),
133
133
  size: getConf(self, 'size'),
134
134
  layers: getConf(self, 'layers') as GraphLayers,
135
- facet: getConf(self, 'facet'),
135
+ facet: {
136
+ field: getConf(self, ['facet', 'field']),
137
+ sort: getConf(self, ['facet', 'sort']),
138
+ columns: getConf(self, ['facet', 'columns']),
139
+ },
136
140
  rows: getConf(self, 'rows'),
137
141
  hover: getConf(self, 'hover'),
138
142
  }
@@ -91,6 +91,18 @@ function normalizeSnapshot(snap: Record<string, unknown>) {
91
91
  }
92
92
 
93
93
  const RgfaTabixCoarseTier = ConfigurationSchema('RgfaTabixCoarseTier', {
94
+ /**
95
+ * #slot
96
+ * The adapter's `uri` shorthand for this pair: the prefix `gfa-to-tabix
97
+ * fold` was given, from which the locations below resolve.
98
+ */
99
+ uri: { type: 'maybeString' },
100
+ /**
101
+ * #slot
102
+ * The adapter's `format` for this pair: `2` resolves format 2's one
103
+ * `<uri>.graph.bed.gz`.
104
+ */
105
+ format: { type: 'maybeNumber' },
94
106
  /**
95
107
  * #slot
96
108
  * The linear view's bp per px past which a graph following it cuts this
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '8.3.10'
1
+ export const version = '8.4.0'