Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fixed and responsive tracks #99

Merged
merged 3 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions docs/fixed-responsive.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: Responsive Visualizations
description: Make your visualization responsive to the screen size
---

Gosling visualizations can be responsive or fixed to the screen size.

## Responsive size
A Gosling visualization can be made responsive to the screen size by setting the `responsiveSize` property in the root of the Gosling specification. When the screen size changes, the visualization will automatically adjust its size to fit the screen.

Here is an example of a Gosling specification with responsive size enabled:

```javascript
{
// highlight-start
responsiveSize: { width: true },
// highlight-end
// ... rest of the Gosling spec
}
```

## Fixed size

A Gosling visualization can have a fixed size by setting the `width` and `height` properties. The tracks will have a fixed size regardless of the screen size.

When the `width` and `height` properties are set in the root of the spec, all tracks will have this height and width unless they are overridden in the track specification.

```javascript
{
// highlight-start
width: 800,
height: 200,
// highlight-end
// ... rest of the Gosling spec
}
```

1 change: 1 addition & 0 deletions sidebarDocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = {
'genome-builds',
'user-interaction',
'semantic-zoom',
'fixed-responsive',
],
},
{
Expand Down
Loading