gosling.js 1.0.6 → 1.0.7
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/README.md
CHANGED
|
@@ -16,25 +16,9 @@ The Gosling's key features compared to existing visualization libraries and gram
|
|
|
16
16
|
|
|
17
17
|
- **Interactivity**: Gosling has intuitive and effective user interactions built in, including zooming and panning and [brushing and linking](https://infovis-wiki.net/wiki/Linking_and_Brushing). This enables flexible visualizations that cover a wide range of visual analysis scenarios, like overview + detail views with brushes or comparative views.
|
|
18
18
|
|
|
19
|
-
## Learn More About Gosling
|
|
20
|
-
|
|
21
|
-
- [Documentation](http://gosling-lang.org/)
|
|
22
|
-
- [Gosling.js Editor](https://gosling.js.org/)
|
|
23
|
-
- [Gallery Examples](https://gosling-lang.org/examples/)
|
|
24
|
-
- [How-to & Tutorials](https://gosling-lang.org/tutorials/)
|
|
25
|
-
- [v1 Announcement](https://gosling-lang.org/blog/v1-release)
|
|
26
|
-
|
|
27
|
-
## Contribute to Gosling.js
|
|
28
|
-
|
|
29
|
-
We welcome and greatly appreciate your contribution to this project! Please read [CONTRIBUTING.md](/CONTRIBUTING.md) to find guidelines.
|
|
30
|
-
|
|
31
|
-
## Contact
|
|
32
|
-
|
|
33
|
-
Open [Github Issues](https://github.com/gosling-lang/gosling.js/issues/) to ask questions or request features.
|
|
34
|
-
|
|
35
19
|
## Citation
|
|
36
20
|
|
|
37
|
-
[L'Yi et al.,
|
|
21
|
+
[L'Yi et al., 2022. “Gosling: A Grammar-based Toolkit for Scalable and Interactive Genomics Data Visualization.”](https://doi.org/10.1109/TVCG.2021.3114876)
|
|
38
22
|
|
|
39
23
|
```bib
|
|
40
24
|
@article{lyi2021gosling,
|
|
@@ -49,6 +33,22 @@ Open [Github Issues](https://github.com/gosling-lang/gosling.js/issues/) to ask
|
|
|
49
33
|
}
|
|
50
34
|
```
|
|
51
35
|
|
|
36
|
+
## Learn More About Gosling
|
|
37
|
+
|
|
38
|
+
- [Documentation](http://gosling-lang.org/)
|
|
39
|
+
- [Gosling.js Editor](https://gosling.js.org/)
|
|
40
|
+
- [Gallery Examples](https://gosling-lang.org/examples/)
|
|
41
|
+
- [How-to & Tutorials](https://gosling-lang.org/tutorials/)
|
|
42
|
+
- [v1 Announcement](https://gosling-lang.org/blog/v1-release)
|
|
43
|
+
|
|
44
|
+
## Contribute to Gosling.js
|
|
45
|
+
|
|
46
|
+
We welcome and greatly appreciate your contribution to this project! Please read [CONTRIBUTING.md](/CONTRIBUTING.md) to find guidelines.
|
|
47
|
+
|
|
48
|
+
## Contact
|
|
49
|
+
|
|
50
|
+
Open [Github Issues](https://github.com/gosling-lang/gosling.js/issues/) to ask questions or request features.
|
|
51
|
+
|
|
52
52
|
## License
|
|
53
53
|
|
|
54
54
|
This project is licensed under the terms of the [MIT license](https://github.com/gosling-lang/gosling.js/blob/main/LICENSE.md).
|
package/dist/gosling.js
CHANGED
|
@@ -36,7 +36,7 @@ import React, { forwardRef, useState, useEffect, useMemo, useRef, useImperativeH
|
|
|
36
36
|
import { HiGlassComponent } from "higlass";
|
|
37
37
|
import { ResizeSensor } from "css-element-queries";
|
|
38
38
|
const name = "gosling.js";
|
|
39
|
-
const version = "1.0.
|
|
39
|
+
const version = "1.0.7";
|
|
40
40
|
const $ref = "#/definitions/Theme";
|
|
41
41
|
const $schema = "http://json-schema.org/draft-07/schema#";
|
|
42
42
|
const definitions = { "AxisStyle": { "additionalProperties": false, "properties": { "baselineColor": { "type": "string" }, "gridColor": { "type": "string" }, "gridStrokeDash": { "items": { "type": "number" }, "maxItems": 2, "minItems": 2, "type": "array" }, "gridStrokeType": { "enum": ["solid", "dashed"], "type": "string" }, "gridStrokeWidth": { "type": "number" }, "labelColor": { "type": "string" }, "labelExcludeChrPrefix": { "description": "If `true`, labels of genomics axes excludes the chromosome prefix (e.g., `chr1` -> `1`).", "type": "boolean" }, "labelFontFamily": { "type": "string" }, "labelFontSize": { "type": "number" }, "labelFontWeight": { "enum": ["bold", "normal", "light"], "type": "string" }, "labelMargin": { "description": "The margin around labels for calculating visual overlaps between labels. This is mainly used for determining the visibility of axis labels. `0` if no margin to use. Negative values (`-1`) for showing all labels even if they overlap.", "type": "number" }, "tickColor": { "type": "string" } }, "type": "object" }, "LegendStyle": { "additionalProperties": false, "properties": { "background": { "type": "string" }, "backgroundOpacity": { "type": "number" }, "backgroundStroke": { "type": "string" }, "labelColor": { "type": "string" }, "labelFontFamily": { "type": "string" }, "labelFontSize": { "type": "number" }, "labelFontWeight": { "enum": ["bold", "normal", "light"], "type": "string" }, "position": { "enum": ["top", "right"], "type": "string" }, "tickColor": { "type": "string" } }, "type": "object" }, "MarkStyle": { "additionalProperties": false, "properties": { "color": { "type": "string" }, "nominalColorRange": { "items": { "type": "string" }, "type": "array" }, "opacity": { "type": "number" }, "quantitativeSizeRange": { "items": { "type": "number" }, "maxItems": 2, "minItems": 2, "type": "array" }, "size": { "type": "number" }, "stroke": { "type": "string" }, "strokeWidth": { "type": "number" } }, "type": "object" }, "RootStyle": { "additionalProperties": false, "properties": { "background": { "type": "string" }, "mousePositionColor": { "type": "string" }, "showMousePosition": { "type": "boolean" }, "subtitleAlign": { "enum": ["left", "middle", "right"], "type": "string" }, "subtitleBackgroundColor": { "type": "string" }, "subtitleColor": { "type": "string" }, "subtitleFontFamily": { "type": "string" }, "subtitleFontSize": { "type": "number" }, "subtitleFontWeight": { "enum": ["bold", "normal", "light"], "type": "string" }, "titleAlign": { "enum": ["left", "middle", "right"], "type": "string" }, "titleBackgroundColor": { "type": "string" }, "titleColor": { "type": "string" }, "titleFontFamily": { "type": "string" }, "titleFontSize": { "type": "number" }, "titleFontWeight": { "enum": ["bold", "normal", "light"], "type": "string" } }, "type": "object" }, "Theme": { "anyOf": [{ "$ref": "#/definitions/ThemeType" }, { "$ref": "#/definitions/ThemeDeep" }] }, "ThemeDeep": { "additionalProperties": false, "properties": { "area": { "$ref": "#/definitions/MarkStyle" }, "axis": { "$ref": "#/definitions/AxisStyle" }, "bar": { "$ref": "#/definitions/MarkStyle" }, "base": { "$ref": "#/definitions/ThemeType" }, "brush": { "$ref": "#/definitions/MarkStyle" }, "legend": { "$ref": "#/definitions/LegendStyle" }, "line": { "$ref": "#/definitions/MarkStyle" }, "link": { "$ref": "#/definitions/MarkStyle" }, "markCommon": { "$ref": "#/definitions/MarkStyle" }, "point": { "$ref": "#/definitions/MarkStyle" }, "rect": { "$ref": "#/definitions/MarkStyle" }, "root": { "$ref": "#/definitions/RootStyle" }, "rule": { "$ref": "#/definitions/MarkStyle" }, "text": { "additionalProperties": false, "properties": { "color": { "type": "string" }, "nominalColorRange": { "items": { "type": "string" }, "type": "array" }, "opacity": { "type": "number" }, "quantitativeSizeRange": { "items": { "type": "number" }, "maxItems": 2, "minItems": 2, "type": "array" }, "size": { "type": "number" }, "stroke": { "type": "string" }, "strokeWidth": { "type": "number" }, "textAnchor": { "enum": ["start", "middle", "end"], "type": "string" }, "textFontWeight": { "enum": ["bold", "normal"], "type": "string" } }, "type": "object" }, "track": { "$ref": "#/definitions/TrackStyle" }, "triangle": { "$ref": "#/definitions/MarkStyle" } }, "required": ["base"], "type": "object" }, "ThemeType": { "enum": ["light", "dark", "warm", "ggplot", "igv", "ensembl", "jbrowse", "ucsc", "washu", "excel", "google"], "type": "string" }, "TrackStyle": { "additionalProperties": false, "properties": { "alternatingBackground": { "type": "string" }, "background": { "type": "string" }, "outline": { "type": "string" }, "outlineWidth": { "type": "number" }, "titleAlign": { "enum": ["left", "middle", "right"], "type": "string" }, "titleBackground": { "type": "string" }, "titleColor": { "type": "string" }, "titleFontSize": { "type": "number" } }, "type": "object" } };
|
|
@@ -655,10 +655,12 @@ function BrushTrack(HGC, ...args) {
|
|
|
655
655
|
const [x, y] = this.position;
|
|
656
656
|
const [w, h] = this.dimensions;
|
|
657
657
|
const endEvent = event.sourceEvent;
|
|
658
|
-
const
|
|
659
|
-
const
|
|
660
|
-
const
|
|
661
|
-
const
|
|
658
|
+
const svg = this.gMain.node().ownerSVGElement || this.gMain.node().closest("svg");
|
|
659
|
+
const svgRect = svg.getBoundingClientRect();
|
|
660
|
+
const startX = this.startEvent.clientX - svgRect.left - x;
|
|
661
|
+
const startY = this.startEvent.clientY - svgRect.top - y;
|
|
662
|
+
const endX = endEvent.clientX - svgRect.left - x;
|
|
663
|
+
const endY = endEvent.clientY - svgRect.top - y;
|
|
662
664
|
const radDiff = (
|
|
663
665
|
// radian of the start position
|
|
664
666
|
Math.atan2(startX - w / 2, startY - h / 2) - // radian of the current position
|