Skip to content

Commit

Permalink
Merge pull request #105 from gosling-lang/sehilyi/update
Browse files Browse the repository at this point in the history
chore: typos and small edits
  • Loading branch information
sehilyi authored Jun 27, 2024
2 parents b1ab56f + 5ca1f4f commit 1150c13
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 38 deletions.
8 changes: 3 additions & 5 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
title: Frequently Asked Questions
---

A list of frequently asked questions about Gosling.js.

## How to debug gosling specs?

To check whether your gosling spec is valid, you can either
- copy-and-paste your spec on the [online Editor](http://gosling.js.org) to see if there is any warning message.
- call a validation function `console.log(gosling.validateGoslingSpec(yourSpec));`
To check whether your gosling spec is valid, you can use either option.
- Copy and paste your spec on the [online Editor](http://gosling.js.org) to see if there is any warning message.
- Aall a validation function `console.log(gosling.validateGoslingSpec(yourSpec));`.

## How to show Gosling Tooltips that are hidden under other components?
You can modify the z-index of the tooltip components to address this issue.
Expand Down
10 changes: 5 additions & 5 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ slug: /

Gosling.js is a declarative grammar for interactive (epi)genomics visualization on the Web.

To get started with Gosling, we recommend going through the [Create Single Track Visualization Tutorial](/tutorials). Then, you can explore examples in the [online editor](https://gosling.js.org), go through the [grammar guide](category/grammar-guide), and start building your own Gosling visualizations using the the [grammar reference](reference) and [Javascript API](js-api) documentation.
To get started with Gosling, we recommend going through the [Create Single Track Visualization Tutorial](/tutorials). Then, you can explore examples in the [online editor](https://gosling.js.org), go through the [grammar guide](category/grammar-guide), and start building your own Gosling visualizations using the the [grammar reference](reference) and [JavaScript API](js-api) documentation.

Please see [usage guide](usage) to learn about all the contexts in which Gosling can be used.

## What is a grammar for data visualization?
Words are combined together into sentences based on their parts of speech and grammar rules. In a similar way, visual components (such as a coordinate axis, plot markers, and legend) have specific roles and are combined according to certain rules. You probably know these rules without realizing it! These roles and rules have been made explicit such as in the [Grammar of Graphics](https://link.springer.com/book/10.1007/0-387-28695-0).
Words are combined together into sentences based on their parts of speech and grammar rules. In a similar way, visual components (e.g., a coordinate axis, plot markers, and legends) have specific roles and are combined according to certain rules. You probably know these rules without realizing it! These roles and rules have been made explicit, such as in the [Grammar of Graphics](https://link.springer.com/book/10.1007/0-387-28695-0).

Similarly, *genomic* data visualizations can be understood as being made up of components which follow a set of rules. The **Gosling grammar** formalizes these rules for genomic data visualizations.

How is the Gosling grammar used in practice? A Gosling visualization is defined using a **Gosling specification**, which is a JSON object. The structure and values within this JSON object are determined by the Gosling grammar. See the example below to see how parts of a Gosling specification corresponds to its visualization.
How is the Gosling grammar used in practice? A Gosling visualization is defined using a **Gosling specification**, which is a [JSON object](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON). The structure and values within this JSON object are determined by the Gosling grammar. See the example below to see how parts of a Gosling specification corresponds to its visualization.

<img src='/img/spec-vis.png'/>

## Javascript API
## JavaScript API

**Gosling.js** takes the Gosling specification as an input and creates the visualization defined by it. You can programmatically interact with this visualization using **Javascript API functions**.
**Gosling.js** takes the Gosling specification as an input and creates the visualization defined by it. You can programmatically interact with this visualization using [**JavaScript API functions**](js-api).

For example, you can use an API function to make the visualization zoom to a particular genomic position, or you can subscribe to click events in the visualization. This is useful to building your own interactive visualizations with Gosling!
10 changes: 7 additions & 3 deletions docs/non-gos-vis.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,22 @@ title: Integrating non-Gosling visualizations
import {TableWrapper} from '@site/react-components/DocComponments/table'
import GoslingSchema from './assets/gosling.schema.json'

# Integrating non-Gosling visualizations
# Integrating Non-Gosling Visualizations

You may want to visualize a non-Gosling visualization within a Gosling visualization, such as showing a lineage tree along with multiple sequences.
You may want to visualize a non-Gosling visualization **within** a Gosling visualization, such as showing a lineage tree along with multiple sequences.

In Gosling, you can do this by using `DummyTrack` as a placeholder to create space for your non-Gosling visualization.
Your non-Gosling visualization can then be overlaid on top of the `DummyTrack` using [JS API functions](./js-api) to
Your non-Gosling visualization can then be overlaid on top of the `DummyTrack` using [JS API functions](js-api) to
get the position of the placeholder.

:::caution
`DummyTrack` can only be used with a linear `layout` at the moment.
:::

:::
You can also find another example of using Gosling with [Vega-Lite](https://vega.github.io/vega-lite/) at https://github.com/gosling-lang/gosling-react-example
:::

[DummyTrack demo in the Editor](https://gosling-lang.github.io/gosling.js/?example=doc_dummy_track)

Here's a `DummyTrack` specification example
Expand Down
26 changes: 17 additions & 9 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,32 @@ title: Usage
Gosling can be used and deployed in a variety of contexts.

- In the [online editor](#online-editor)
- In Python using [Gos](https://gosling-lang.github.io/gos/)
- In Python using the [Gos](https://gosling-lang.github.io/gos/) package
- In a [HTML page](#html)
- In a [React application](#react)

## Online Editor

You can visit the [online editor](https://gosling.js.org) to start trying Gosling immediately.

### Load a Gosling Spec From Your Github Gist
### Loading/Sharing Your Gosling Visualization

If you want to share your Gosling visualization using the online editor with your fiends and collaborators, you use [GitHub Gist](https://gist.github.com/).

1. To load a spec you first have to create a gist with a file named gosling.js\* that specifies the spec.
1. You can additionally specify a `readme.md` file to describe your spec.
1. Also be sure to give your gist a fabulous title. It'll be shown in the gosling editor.
You can then open your visualization at <a>http://<editor_url>/?gist=<github_username>/<gist_id></a>.
<!-- For example, https://gosling.js.org/?gist=flekschas/e6e388332814886d4d714efd0e88093b -->
For example, https://gosling.js.org/?gist=wangqianwen0418/1cc79f00990806f07b379ae6a7c7b7b3
1. You can additionally specify a `readme.md` file to describe your spec. This will be shown as a side panel on the online editor.
1. Also, be sure to give your gist a fabulous title. It'll be shown in the gosling editor.
1. You can then open your visualization at <a>http://<editor_url>/?gist=<github_username>/<gist_id></a>.

:::
Example:
- Demo: https://gosling.js.org/?gist=wangqianwen0418/1cc79f00990806f07b379ae6a7c7b7b3
- Gist: https://gist.github.com/wangqianwen0418/1cc79f00990806f07b379ae6a7c7b7b3
:::

## HTML

Gosling can be embedded directly into your HTML page by adding gosling.js and several other dependencies in script tags.
Gosling can be embedded directly into your HTML file by adding gosling.js and several other dependencies in script tags.

```html
<!DOCTYPE html>
Expand Down Expand Up @@ -75,8 +81,10 @@ Gosling can be embedded directly into your HTML page by adding gosling.js and se

## React

:::
Beginning with version 0.9.30, Gosling now supports React v18 (You can still use React v16 or v17).
If you are using a Gosling version prior to 0.9.30, please continue to use React v16.
:::

Install `gosling.js` and its dependent libraries:

Expand Down Expand Up @@ -104,4 +112,4 @@ function App() {
}
```

Please visit [gosling-react](https://github.com/gosling-lang/gosling-react) to find detailed instruction on using React.
Please visit [gosling-react](https://github.com/gosling-lang/gosling-react-example) to find detailed instruction on using React.
2 changes: 0 additions & 2 deletions docs/user-interaction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {TableWrapper} from '@site/react-components/DocComponments/table'
import GoslingSchema from './assets/gosling.schema.json'

## Zooming and Panning
<!-- [:link: source code](https://github.com/gosling-lang/gosling.js/blob/43626eaf21417bf36128a405dceeaa6ee00d0851/src/core/gosling.schema.ts#L7) -->

Each visualization in Gosling supports the Zooming and Panning interaction.
Users can zoom in/out a visualization using the scrolling up/down actions.
Expand All @@ -32,7 +31,6 @@ Users can set the `static` property of all tracks at the root level or specify i
```

## Linking Views
<!-- [:link: source code](https://github.com/gosling-lang/gosling.js/blob/43626eaf21417bf36128a405dceeaa6ee00d0851/src/core/Gosling.schema.ts#L328) -->

When views/tracks are linked, the zooming and panning performed in one view/track will be automatically applied to the linked views/tracks.

Expand Down
18 changes: 4 additions & 14 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ const features = [
),
},
{
title: 'Interactivity',
title: 'User Interaction',
imageUrl: 'img/undraw_docusaurus_react.svg',
description: (
<>
Gosling has intuitive and effective user interactions built in, including zooming and panning and brushing and linking.
This enables flexible visualizations that cover a wide range of visual analysis scenarios, like overview + detail views with brushes or comparative views.
Gosling has intuitive and effective user interactions built in, including zooming, panning, brushing, and linking.
This enables the creation of flexible visualizations that cover a wide range of visual analysis scenarios, like overview + detail views with brushes or comparative views.
</>
),
},
Expand All @@ -57,20 +57,10 @@ function Feature({ imageUrl, title, description }) {
);
}

const dummyGosling = <BrowserOnly>
{() => {
const { GoslingComponent } = require("gosling.js");
return <div className='dummyGosling'><GoslingComponent /></div>
}}
</BrowserOnly>


const floatingWindow = <div className={styles.floatingNews}>
<h3 style={{ textAlign: 'center' }}>News</h3>
<ul>
<li>The HIDIVE Lab is looking for remote interview participants who create and use genome-mapped data visualizations (such as Gosling, IGV or Circos). Join a 1-hour online interview and receive a $25 Amazon gift card. Interested? <a href='https://forms.gle/v8QZ5kRjFpurfKiN8' class='primary-color' target='_blank'>Sign up via this form</a>. More info is shared on the <a href='https://hidivelab.org/news/2023-10-12-guisling-user-study/' class='primary-color' target='_blank'>HIDIVE Lab website</a>.
</li>
<li>We release documentations for Gosling <a href='https://github.com/gosling-lang/gosling.js/releases/tag/v0.10.0' class='primary-color'>v0.10.0</a>,
<li>We release documentations for Gosling <a href='https://github.com/gosling-lang/gosling.js/releases/tag/v0.10.0' class='primary-color'>v0.10.0</a>,
which adds support for <a href='/docs/data#gff3-no-higlass-server' class='primary-color'>GFF files</a>, a <a href='docs/js-api#getviewids' class='primary-color'>Javscript API to get the ID of views</a>, and a <a href='/docs/non-gos-vis' class='primary-color'> placeholder track</a> for non-Gosling visualizations.
</li>
<li>We release documentations for Gosling <a href='https://github.com/gosling-lang/gosling.js/releases/tag/v0.9.30' class='primary-color'>v0.9.30</a>,
Expand Down

0 comments on commit 1150c13

Please sign in to comment.