Skip to content

Commit e8f1ca3

Browse files
committed
Merge branch 'release/0.13.0-beta.4'
2 parents dfac174 + 7066d01 commit e8f1ca3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+775
-731
lines changed

assets/docs/layout_tutorial.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,23 @@ are defined. Consider the `standard_association` plot:
7070
LocusZoom.Layouts.add('plot', 'standard_association', {
7171
state: {},
7272
width: 800,
73-
height: 450,
74-
responsive_resize: 'width_only',
73+
responsive_resize: true,
7574
min_region_scale: 20000,
7675
max_region_scale: 1000000,
7776
dashboard: LocusZoom.Layouts.get('dashboard', 'standard_plot', { unnamespaced: true }),
7877
panels: [
79-
LocusZoom.Layouts.get('panel', 'association', { unnamespaced: true, proportional_height: 0.5 }),
80-
LocusZoom.Layouts.get('panel', 'genes', { unnamespaced: true, proportional_height: 0.5 })
78+
LocusZoom.Layouts.get('panel', 'association', { unnamespaced: true, height: 225 }),
79+
LocusZoom.Layouts.get('panel', 'genes', { unnamespaced: true, height: 225 })
8180
]
8281
});
8382
```
8483

8584
In this view, we have abstracted away all the details of what is plotted, and we can just see the basic pieces: this
8685
plot has two panels (association data and genes data) that are displayed separately on the same screen. At the plot level,
87-
we control how the total space is allocated between two panels (`proportional_height`). The actual details of what to
88-
render are defined as nested layouts (association and genes panels), and the registry also contains predefined options
89-
for this piece- `LocusZoom.Layouts.get(...)` returns a JSON object.
86+
each panel is 225px high, so the total plot height will be the sum of panels (450 px); if more panels are added,
87+
the plot height will increase to match. The actual details of what to render are defined as nested layouts
88+
(association and genes panels), and the registry also contains predefined options for this piece-
89+
`LocusZoom.Layouts.get(...)` returns a JSON object.
9090

9191
Although the layout could be defined as a single giant object (top-down view of everything at once), defining it in
9292
terms of reusable building blocks (bottom up) makes it much easier to read and see boundaries.
@@ -309,23 +309,22 @@ data_sources
309309
// This outer call to Layouts.get() will ensure that namespaces are applied, and the returned result is a concrete
310310
// layout ready for use in drawing a plot with specific data sets.
311311
const plot_layout = LocusZoom.Layouts.get('plot', 'standard_association', { // Override select fields of a pre-made layout
312-
height: 1200, // The default plot was sized for two panels. Make sure to allocate enough room for the extra panel.
313-
responsive_resize: 'width_only', // This makes height calculations more reliable. Will become the default in the future.
312+
responsive_resize: true,
314313
panels: [
315314
LocusZoom.Layouts.get('panel', 'association', {
316315
namespace: { assoc: 'assoc_study1' }, // This is the key piece. It says "for this panel, and its child data layers, look for the association data in a datasource called "assoc_study1".
317-
proportional_height: 0.33,
316+
height: 400,
318317
id: 'assoc_study1', // Give each panel a unique ID
319318
title: { text: 'Study 1' },
320319
}),
321320
LocusZoom.Layouts.get('panel', 'association', {
322321
namespace: { assoc: 'assoc_study2' },
323-
proportional_height: 0.33, // Modifies the default so that all three panels get enough space
322+
height: 400,
324323
id: 'assoc_study2',
325324
title: { text: 'Study 2' },
326325
}),
327326
// Even though genes are part of the original "standard association plot" layout, overriding the panels array means replacing *all* of the panels.
328-
LocusZoom.Layouts.get('panel', 'genes', { unnamespaced: true, proportional_height: 0.33 }) // "unnamespaced" when using as a generic building block
327+
LocusZoom.Layouts.get('panel', 'genes', { unnamespaced: true, height: 400 }) // "unnamespaced" when using as a generic building block
329328
]
330329
});
331330
```
@@ -347,8 +346,7 @@ Object.keys(layer_data[0]); // See the field names used by the data for a single
347346
### Adding panels
348347
The above example demonstrates how to add multiple studies at the time of plot creation. However, sites like the T2D
349348
Portal have many datasets, and it can be helpful to let the user interactively choose which other panels to show after
350-
first render. New panels can be added dynamically! When doing so, the plot will grow to accommodate the new panel;
351-
dynamic panels do not require specifying `proportional_height` etc.
349+
first render. New panels can be added dynamically! When doing so, the plot will grow to accommodate the new panel.
352350

353351
```js
354352
// This creates a new configuration object

dist/ext/lz-aggregation-tests.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ext/lz-aggregation-tests.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ext/lz-credible-sets.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ext/lz-credible-sets.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ext/lz-dynamic-urls.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ext/lz-forest-track.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)