@jbrowse/plugin-linear-genome-view 2.7.0 → 2.7.2
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/dist/BaseLinearDisplay/components/LinearBlocks.js +1 -1
- package/dist/BaseLinearDisplay/components/Tooltip.js +4 -2
- package/dist/LinearGenomeView/components/LinearGenomeView.js +29 -7
- package/dist/LinearGenomeView/components/OverviewRubberband.js +5 -2
- package/dist/LinearGenomeView/components/TrackLabel.js +2 -18
- package/dist/LinearGenomeView/components/TrackLabelContainer.js +2 -2
- package/dist/LinearGenomeView/components/TrackLabelDragHandle.d.ts +9 -0
- package/dist/LinearGenomeView/components/TrackLabelDragHandle.js +32 -0
- package/dist/LinearGenomeView/index.d.ts +1 -2
- package/dist/LinearGenomeView/index.js +3 -2
- package/dist/LinearGenomeView/model.d.ts +7 -1
- package/dist/LinearGenomeView/model.js +30 -19
- package/dist/LinearGenomeView/svgcomponents/SVGTrackLabel.js +3 -1
- package/dist/index.d.ts +52 -15
- package/dist/index.js +19 -0
- package/esm/BaseLinearDisplay/components/LinearBlocks.js +1 -1
- package/esm/BaseLinearDisplay/components/Tooltip.js +4 -2
- package/esm/LinearGenomeView/components/LinearGenomeView.js +29 -7
- package/esm/LinearGenomeView/components/OverviewRubberband.js +5 -2
- package/esm/LinearGenomeView/components/TrackLabel.js +2 -18
- package/esm/LinearGenomeView/components/TrackLabelContainer.js +2 -2
- package/esm/LinearGenomeView/components/TrackLabelDragHandle.d.ts +9 -0
- package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +27 -0
- package/esm/LinearGenomeView/index.d.ts +1 -2
- package/esm/LinearGenomeView/index.js +2 -2
- package/esm/LinearGenomeView/model.d.ts +7 -1
- package/esm/LinearGenomeView/model.js +30 -19
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +3 -1
- package/esm/index.d.ts +52 -15
- package/esm/index.js +19 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -198,7 +198,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
198
198
|
resizeHeight(distance: number): number;
|
|
199
199
|
} & {
|
|
200
200
|
featureDensityStatsP: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats> | undefined;
|
|
201
|
-
featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined;
|
|
201
|
+
featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined; /**
|
|
202
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
203
|
+
*/
|
|
202
204
|
currStatsBpPerPx: number;
|
|
203
205
|
} & {
|
|
204
206
|
readonly currentBytesRequested: number;
|
|
@@ -401,7 +403,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
401
403
|
resizeHeight(distance: number): number;
|
|
402
404
|
} & {
|
|
403
405
|
featureDensityStatsP: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats> | undefined;
|
|
404
|
-
featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined;
|
|
406
|
+
featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined; /**
|
|
407
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
408
|
+
*/
|
|
405
409
|
currStatsBpPerPx: number;
|
|
406
410
|
} & {
|
|
407
411
|
readonly currentBytesRequested: number;
|
|
@@ -694,7 +698,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
694
698
|
resizeHeight(distance: number): number;
|
|
695
699
|
} & {
|
|
696
700
|
featureDensityStatsP: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats> | undefined;
|
|
697
|
-
featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined;
|
|
701
|
+
featureDensityStats: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined; /**
|
|
702
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
703
|
+
*/
|
|
698
704
|
currStatsBpPerPx: number;
|
|
699
705
|
} & {
|
|
700
706
|
readonly currentBytesRequested: number;
|
|
@@ -894,9 +900,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
894
900
|
hideHeaderOverview: boolean;
|
|
895
901
|
hideNoTracksActive: boolean;
|
|
896
902
|
trackSelectorType: string;
|
|
897
|
-
trackLabels: string;
|
|
898
903
|
showCenterLine: boolean;
|
|
899
904
|
showCytobandsSetting: boolean;
|
|
905
|
+
trackLabels: string;
|
|
900
906
|
showGridlines: boolean;
|
|
901
907
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
902
908
|
width: number;
|
|
@@ -905,7 +911,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
905
911
|
} & {
|
|
906
912
|
setDisplayName(name: string): void;
|
|
907
913
|
setWidth(newWidth: number): void;
|
|
908
|
-
setMinimized(flag: boolean): void;
|
|
914
|
+
setMinimized(flag: boolean): void; /**
|
|
915
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
916
|
+
*/
|
|
909
917
|
} & {
|
|
910
918
|
volatileWidth: number | undefined;
|
|
911
919
|
minimumBlockWidth: number;
|
|
@@ -919,6 +927,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
919
927
|
leftOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
920
928
|
rightOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
921
929
|
} & {
|
|
930
|
+
readonly trackLabelsSetting: any;
|
|
922
931
|
readonly width: number;
|
|
923
932
|
readonly interRegionPaddingWidth: number;
|
|
924
933
|
readonly assemblyNames: string[];
|
|
@@ -1082,9 +1091,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1082
1091
|
hideHeaderOverview: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1083
1092
|
hideNoTracksActive: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1084
1093
|
trackSelectorType: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1085
|
-
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1086
1094
|
showCenterLine: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
1087
1095
|
showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
1096
|
+
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1088
1097
|
showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1089
1098
|
}, {
|
|
1090
1099
|
width: number;
|
|
@@ -1093,7 +1102,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1093
1102
|
} & {
|
|
1094
1103
|
setDisplayName(name: string): void;
|
|
1095
1104
|
setWidth(newWidth: number): void;
|
|
1096
|
-
setMinimized(flag: boolean): void;
|
|
1105
|
+
setMinimized(flag: boolean): void; /**
|
|
1106
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
1107
|
+
*/
|
|
1097
1108
|
} & {
|
|
1098
1109
|
volatileWidth: number | undefined;
|
|
1099
1110
|
minimumBlockWidth: number;
|
|
@@ -1107,6 +1118,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1107
1118
|
leftOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1108
1119
|
rightOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1109
1120
|
} & {
|
|
1121
|
+
readonly trackLabelsSetting: any;
|
|
1110
1122
|
readonly width: number;
|
|
1111
1123
|
readonly interRegionPaddingWidth: number;
|
|
1112
1124
|
readonly assemblyNames: string[];
|
|
@@ -1280,9 +1292,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1280
1292
|
hideHeaderOverview: boolean;
|
|
1281
1293
|
hideNoTracksActive: boolean;
|
|
1282
1294
|
trackSelectorType: string;
|
|
1283
|
-
trackLabels: string;
|
|
1284
1295
|
showCenterLine: boolean;
|
|
1285
1296
|
showCytobandsSetting: boolean;
|
|
1297
|
+
trackLabels: string;
|
|
1286
1298
|
showGridlines: boolean;
|
|
1287
1299
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
1288
1300
|
width: number;
|
|
@@ -1291,7 +1303,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1291
1303
|
} & {
|
|
1292
1304
|
setDisplayName(name: string): void;
|
|
1293
1305
|
setWidth(newWidth: number): void;
|
|
1294
|
-
setMinimized(flag: boolean): void;
|
|
1306
|
+
setMinimized(flag: boolean): void; /**
|
|
1307
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
1308
|
+
*/
|
|
1295
1309
|
} & {
|
|
1296
1310
|
volatileWidth: number | undefined;
|
|
1297
1311
|
minimumBlockWidth: number;
|
|
@@ -1305,6 +1319,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1305
1319
|
leftOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1306
1320
|
rightOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1307
1321
|
} & {
|
|
1322
|
+
readonly trackLabelsSetting: any;
|
|
1308
1323
|
readonly width: number;
|
|
1309
1324
|
readonly interRegionPaddingWidth: number;
|
|
1310
1325
|
readonly assemblyNames: string[];
|
|
@@ -1468,9 +1483,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1468
1483
|
hideHeaderOverview: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1469
1484
|
hideNoTracksActive: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1470
1485
|
trackSelectorType: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1471
|
-
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1472
1486
|
showCenterLine: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
1473
1487
|
showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
1488
|
+
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1474
1489
|
showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1475
1490
|
}, {
|
|
1476
1491
|
width: number;
|
|
@@ -1479,7 +1494,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1479
1494
|
} & {
|
|
1480
1495
|
setDisplayName(name: string): void;
|
|
1481
1496
|
setWidth(newWidth: number): void;
|
|
1482
|
-
setMinimized(flag: boolean): void;
|
|
1497
|
+
setMinimized(flag: boolean): void; /**
|
|
1498
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
1499
|
+
*/
|
|
1483
1500
|
} & {
|
|
1484
1501
|
volatileWidth: number | undefined;
|
|
1485
1502
|
minimumBlockWidth: number;
|
|
@@ -1493,6 +1510,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1493
1510
|
leftOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1494
1511
|
rightOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1495
1512
|
} & {
|
|
1513
|
+
readonly trackLabelsSetting: any;
|
|
1496
1514
|
readonly width: number;
|
|
1497
1515
|
readonly interRegionPaddingWidth: number;
|
|
1498
1516
|
readonly assemblyNames: string[];
|
|
@@ -1666,9 +1684,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1666
1684
|
hideHeaderOverview: boolean;
|
|
1667
1685
|
hideNoTracksActive: boolean;
|
|
1668
1686
|
trackSelectorType: string;
|
|
1669
|
-
trackLabels: string;
|
|
1670
1687
|
showCenterLine: boolean;
|
|
1671
1688
|
showCytobandsSetting: boolean;
|
|
1689
|
+
trackLabels: string;
|
|
1672
1690
|
showGridlines: boolean;
|
|
1673
1691
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
1674
1692
|
width: number;
|
|
@@ -1677,7 +1695,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1677
1695
|
} & {
|
|
1678
1696
|
setDisplayName(name: string): void;
|
|
1679
1697
|
setWidth(newWidth: number): void;
|
|
1680
|
-
setMinimized(flag: boolean): void;
|
|
1698
|
+
setMinimized(flag: boolean): void; /**
|
|
1699
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
1700
|
+
*/
|
|
1681
1701
|
} & {
|
|
1682
1702
|
volatileWidth: number | undefined;
|
|
1683
1703
|
minimumBlockWidth: number;
|
|
@@ -1691,6 +1711,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1691
1711
|
leftOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1692
1712
|
rightOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1693
1713
|
} & {
|
|
1714
|
+
readonly trackLabelsSetting: any;
|
|
1694
1715
|
readonly width: number;
|
|
1695
1716
|
readonly interRegionPaddingWidth: number;
|
|
1696
1717
|
readonly assemblyNames: string[];
|
|
@@ -1854,9 +1875,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1854
1875
|
hideHeaderOverview: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1855
1876
|
hideNoTracksActive: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1856
1877
|
trackSelectorType: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1857
|
-
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1858
1878
|
showCenterLine: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
1859
1879
|
showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
1880
|
+
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
1860
1881
|
showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
1861
1882
|
}, {
|
|
1862
1883
|
width: number;
|
|
@@ -1865,7 +1886,9 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1865
1886
|
} & {
|
|
1866
1887
|
setDisplayName(name: string): void;
|
|
1867
1888
|
setWidth(newWidth: number): void;
|
|
1868
|
-
setMinimized(flag: boolean): void;
|
|
1889
|
+
setMinimized(flag: boolean): void; /**
|
|
1890
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
1891
|
+
*/
|
|
1869
1892
|
} & {
|
|
1870
1893
|
volatileWidth: number | undefined;
|
|
1871
1894
|
minimumBlockWidth: number;
|
|
@@ -1879,6 +1902,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1879
1902
|
leftOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1880
1903
|
rightOffset: import("./LinearGenomeView").BpOffset | undefined;
|
|
1881
1904
|
} & {
|
|
1905
|
+
readonly trackLabelsSetting: any;
|
|
1882
1906
|
readonly width: number;
|
|
1883
1907
|
readonly interRegionPaddingWidth: number;
|
|
1884
1908
|
readonly assemblyNames: string[];
|
|
@@ -2021,6 +2045,19 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
2021
2045
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
2022
2046
|
}) => import("react").JSX.Element;
|
|
2023
2047
|
};
|
|
2048
|
+
/**
|
|
2049
|
+
* #config LinearGenomeViewConfigSchema
|
|
2050
|
+
*/
|
|
2051
|
+
configurationSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2052
|
+
/**
|
|
2053
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
2054
|
+
*/
|
|
2055
|
+
trackLabels: {
|
|
2056
|
+
type: string;
|
|
2057
|
+
defaultValue: string;
|
|
2058
|
+
model: import("mobx-state-tree").ISimpleType<string>;
|
|
2059
|
+
};
|
|
2060
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
2024
2061
|
install(pluginManager: PluginManager): void;
|
|
2025
2062
|
configure(pluginManager: PluginManager): void;
|
|
2026
2063
|
}
|
package/dist/index.js
CHANGED
|
@@ -39,6 +39,8 @@ const LinearBasicDisplay_1 = __importDefault(require("./LinearBasicDisplay"));
|
|
|
39
39
|
const FeatureTrack_1 = __importDefault(require("./FeatureTrack"));
|
|
40
40
|
const BasicTrack_1 = __importDefault(require("./BasicTrack"));
|
|
41
41
|
const LaunchLinearGenomeView_1 = __importDefault(require("./LaunchLinearGenomeView"));
|
|
42
|
+
const configuration_1 = require("@jbrowse/core/configuration");
|
|
43
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
42
44
|
class LinearGenomeViewPlugin extends Plugin_1.default {
|
|
43
45
|
constructor() {
|
|
44
46
|
super(...arguments);
|
|
@@ -51,6 +53,23 @@ class LinearGenomeViewPlugin extends Plugin_1.default {
|
|
|
51
53
|
ZoomControls: LinearGenomeView_1.ZoomControls,
|
|
52
54
|
LinearGenomeView: LinearGenomeView_1.LinearGenomeView,
|
|
53
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* #config LinearGenomeViewConfigSchema
|
|
58
|
+
*/
|
|
59
|
+
this.configurationSchema = (0, configuration_1.ConfigurationSchema)('LinearGenomeViewConfigSchema', {
|
|
60
|
+
/**
|
|
61
|
+
* #slot configuration.LinearGenomeViewPlugin.trackLabels
|
|
62
|
+
*/
|
|
63
|
+
trackLabels: {
|
|
64
|
+
type: 'string',
|
|
65
|
+
defaultValue: 'overlapping',
|
|
66
|
+
model: mobx_state_tree_1.types.enumeration('trackLabelOptions', [
|
|
67
|
+
'offset',
|
|
68
|
+
'overlapping',
|
|
69
|
+
'hidden',
|
|
70
|
+
]),
|
|
71
|
+
},
|
|
72
|
+
});
|
|
54
73
|
}
|
|
55
74
|
install(pluginManager) {
|
|
56
75
|
(0, FeatureTrack_1.default)(pluginManager);
|
|
@@ -45,7 +45,7 @@ const RenderedBlocks = observer(function ({ model, }) {
|
|
|
45
45
|
if (block instanceof InterRegionPaddingBlock) {
|
|
46
46
|
return (React.createElement(InterRegionPaddingBlockComponent, { key: block.key, width: block.widthPx, style: { background: 'none' }, boundary: block.variant === 'boundary' }));
|
|
47
47
|
}
|
|
48
|
-
throw new Error(`invalid block type ${
|
|
48
|
+
throw new Error(`invalid block type ${JSON.stringify(block)}`);
|
|
49
49
|
})));
|
|
50
50
|
});
|
|
51
51
|
export { RenderedBlocks };
|
|
@@ -28,7 +28,8 @@ const TooltipContents = React.forwardRef(function TooltipContents2({ message },
|
|
|
28
28
|
return (React.createElement("div", { ref: ref }, React.isValidElement(message) ? (message) : message ? (React.createElement(SanitizedHTML, { html: String(message) })) : null));
|
|
29
29
|
});
|
|
30
30
|
const Tooltip = observer(({ model, clientMouseCoord, }) => {
|
|
31
|
-
|
|
31
|
+
var _a, _b;
|
|
32
|
+
const { theme, classes } = useStyles();
|
|
32
33
|
const { featureUnderMouse } = model;
|
|
33
34
|
const [width, setWidth] = useState(0);
|
|
34
35
|
const [popperElt, setPopperElt] = useState(null);
|
|
@@ -54,7 +55,8 @@ const Tooltip = observer(({ model, clientMouseCoord, }) => {
|
|
|
54
55
|
const contents = featureUnderMouse
|
|
55
56
|
? getConf(model, 'mouseover', { feature: featureUnderMouse })
|
|
56
57
|
: undefined;
|
|
57
|
-
|
|
58
|
+
const popperTheme = (_a = theme === null || theme === void 0 ? void 0 : theme.components) === null || _a === void 0 ? void 0 : _a.MuiPopper;
|
|
59
|
+
return featureUnderMouse && contents ? (React.createElement(Portal, { container: (_b = popperTheme === null || popperTheme === void 0 ? void 0 : popperTheme.defaultProps) === null || _b === void 0 ? void 0 : _b.container },
|
|
58
60
|
React.createElement("div", { ref: setPopperElt, className: classes.tooltip,
|
|
59
61
|
// zIndex needed to go over widget drawer
|
|
60
62
|
style: { ...styles.popper, zIndex: 100000 }, ...attributes.popper },
|
|
@@ -2,12 +2,12 @@ import React, { lazy, useEffect, useRef } from 'react';
|
|
|
2
2
|
import { Button, Paper, Typography } from '@mui/material';
|
|
3
3
|
import { makeStyles } from 'tss-react/mui';
|
|
4
4
|
import { LoadingEllipses } from '@jbrowse/core/ui';
|
|
5
|
+
import { getSession } from '@jbrowse/core/util';
|
|
5
6
|
import { observer } from 'mobx-react';
|
|
6
7
|
// icons
|
|
7
8
|
import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons';
|
|
8
9
|
import TrackContainer from './TrackContainer';
|
|
9
10
|
import TracksContainer from './TracksContainer';
|
|
10
|
-
import { getSession } from '@jbrowse/core/util';
|
|
11
11
|
const ImportForm = lazy(() => import('./ImportForm'));
|
|
12
12
|
const useStyles = makeStyles()(theme => ({
|
|
13
13
|
note: {
|
|
@@ -15,14 +15,28 @@ const useStyles = makeStyles()(theme => ({
|
|
|
15
15
|
paddingTop: theme.spacing(1),
|
|
16
16
|
paddingBottom: theme.spacing(1),
|
|
17
17
|
},
|
|
18
|
+
rel: {
|
|
19
|
+
position: 'relative',
|
|
20
|
+
},
|
|
21
|
+
top: {
|
|
22
|
+
zIndex: 1000,
|
|
23
|
+
},
|
|
18
24
|
}));
|
|
25
|
+
function NoTracksActive({ model }) {
|
|
26
|
+
const { classes } = useStyles();
|
|
27
|
+
const { hideNoTracksActive } = model;
|
|
28
|
+
return (React.createElement(Paper, { className: classes.note }, !hideNoTracksActive ? (React.createElement(React.Fragment, null,
|
|
29
|
+
React.createElement(Typography, null, "No tracks active."),
|
|
30
|
+
React.createElement(Button, { variant: "contained", color: "primary", onClick: () => model.activateTrackSelector(), className: classes.top, startIcon: React.createElement(TrackSelectorIcon, null) }, "Open track selector"))) : (React.createElement("div", { style: { height: '48px' } }))));
|
|
31
|
+
}
|
|
19
32
|
const LinearGenomeView = observer(({ model }) => {
|
|
20
33
|
const { tracks, error, initialized, hasDisplayedRegions } = model;
|
|
21
|
-
const { classes } = useStyles();
|
|
22
34
|
const ref = useRef(null);
|
|
23
35
|
const session = getSession(model);
|
|
36
|
+
const { classes } = useStyles();
|
|
24
37
|
useEffect(() => {
|
|
25
|
-
// sets the focused view id based on a click within the LGV;
|
|
38
|
+
// sets the focused view id based on a click within the LGV;
|
|
39
|
+
// necessary for subviews to be focused properly
|
|
26
40
|
function handleSelectView(e) {
|
|
27
41
|
var _a, _b;
|
|
28
42
|
if (e.target instanceof Element && ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
|
|
@@ -44,11 +58,19 @@ const LinearGenomeView = observer(({ model }) => {
|
|
|
44
58
|
}
|
|
45
59
|
const MiniControlsComponent = model.MiniControlsComponent();
|
|
46
60
|
const HeaderComponent = model.HeaderComponent();
|
|
47
|
-
return (React.createElement("div", {
|
|
61
|
+
return (React.createElement("div", { className: classes.rel, ref: ref, onMouseLeave: () => session.setHovered(undefined), onMouseMove: event => {
|
|
62
|
+
const c = ref.current;
|
|
63
|
+
if (!c) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const { tracks } = model;
|
|
67
|
+
const leftPx = event.clientX - c.getBoundingClientRect().left;
|
|
68
|
+
const hoverPosition = model.pxToBp(leftPx);
|
|
69
|
+
const hoverFeature = tracks.find(t => t.displays[0].featureUnderMouse);
|
|
70
|
+
session.setHovered({ hoverPosition, hoverFeature });
|
|
71
|
+
} },
|
|
48
72
|
React.createElement(HeaderComponent, { model: model }),
|
|
49
73
|
React.createElement(MiniControlsComponent, { model: model }),
|
|
50
|
-
React.createElement(TracksContainer, { model: model }, !tracks.length ? (React.createElement(
|
|
51
|
-
React.createElement(Typography, null, "No tracks active."),
|
|
52
|
-
React.createElement(Button, { variant: "contained", color: "primary", onClick: model.activateTrackSelector, style: { zIndex: 1000 }, startIcon: React.createElement(TrackSelectorIcon, null) }, "Open track selector"))) : (React.createElement("div", { style: { height: '48px' } })))) : (tracks.map(track => (React.createElement(TrackContainer, { key: track.id, model: model, track: track })))))));
|
|
74
|
+
React.createElement(TracksContainer, { model: model }, !tracks.length ? (React.createElement(NoTracksActive, { model: model })) : (tracks.map(track => (React.createElement(TrackContainer, { key: track.id, model: model, track: track })))))));
|
|
53
75
|
});
|
|
54
76
|
export default LinearGenomeView;
|
|
@@ -18,6 +18,9 @@ const useStyles = makeStyles()({
|
|
|
18
18
|
position: 'absolute',
|
|
19
19
|
zIndex: 10,
|
|
20
20
|
},
|
|
21
|
+
rel: {
|
|
22
|
+
position: 'relative',
|
|
23
|
+
},
|
|
21
24
|
});
|
|
22
25
|
const HoverTooltip = observer(function ({ model, open, guideX, overview, }) {
|
|
23
26
|
var _a;
|
|
@@ -103,7 +106,7 @@ const OverviewRubberband = observer(function OverviewRubberband({ model, overvie
|
|
|
103
106
|
setGuideX(undefined);
|
|
104
107
|
}
|
|
105
108
|
if (startX === undefined) {
|
|
106
|
-
return (React.createElement("div", {
|
|
109
|
+
return (React.createElement("div", { className: classes.rel },
|
|
107
110
|
guideX !== undefined ? (React.createElement(HoverTooltip, { model: model, open: !mouseDragging, overview: overview, guideX: guideX })) : null,
|
|
108
111
|
React.createElement("div", { className: classes.rubberbandControl, ref: controlsRef, onMouseDown: mouseDown, onMouseOut: mouseOut, onMouseMove: mouseMove }, ControlComponent)));
|
|
109
112
|
}
|
|
@@ -124,7 +127,7 @@ const OverviewRubberband = observer(function OverviewRubberband({ model, overvie
|
|
|
124
127
|
[leftBpOffset, rightBpOffset] = [rightBpOffset, leftBpOffset];
|
|
125
128
|
}
|
|
126
129
|
}
|
|
127
|
-
return (React.createElement("div", {
|
|
130
|
+
return (React.createElement("div", { className: classes.rel },
|
|
128
131
|
leftBpOffset && rightBpOffset ? (React.createElement(RubberbandSpan, { leftBpOffset: leftBpOffset, rightBpOffset: rightBpOffset, width: Math.abs(width), left: left })) : null,
|
|
129
132
|
React.createElement("div", { "data-testid": "rubberband_controls", className: classes.rubberbandControl, ref: controlsRef, onMouseDown: mouseDown, onMouseOut: mouseOut, onMouseMove: mouseMove }, ControlComponent)));
|
|
130
133
|
});
|
|
@@ -9,10 +9,10 @@ import { SanitizedHTML } from '@jbrowse/core/ui';
|
|
|
9
9
|
import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
|
|
10
10
|
// icons
|
|
11
11
|
import MoreVertIcon from '@mui/icons-material/MoreVert';
|
|
12
|
-
import DragIcon from '@mui/icons-material/DragIndicator';
|
|
13
12
|
import CloseIcon from '@mui/icons-material/Close';
|
|
14
13
|
import MinimizeIcon from '@mui/icons-material/Minimize';
|
|
15
14
|
import AddIcon from '@mui/icons-material/Add';
|
|
15
|
+
import TrackLabelDragHandle from './TrackLabelDragHandle';
|
|
16
16
|
const useStyles = makeStyles()(theme => ({
|
|
17
17
|
root: {
|
|
18
18
|
background: alpha(theme.palette.background.paper, 0.8),
|
|
@@ -29,14 +29,6 @@ const useStyles = makeStyles()(theme => ({
|
|
|
29
29
|
fontSize: '0.8rem',
|
|
30
30
|
pointerEvents: 'none',
|
|
31
31
|
},
|
|
32
|
-
dragHandle: {
|
|
33
|
-
cursor: 'grab',
|
|
34
|
-
},
|
|
35
|
-
dragHandleIcon: {
|
|
36
|
-
display: 'inline-block',
|
|
37
|
-
verticalAlign: 'middle',
|
|
38
|
-
pointerEvents: 'none',
|
|
39
|
-
},
|
|
40
32
|
iconButton: {
|
|
41
33
|
padding: theme.spacing(1),
|
|
42
34
|
},
|
|
@@ -60,15 +52,7 @@ const TrackLabel = observer(React.forwardRef(function TrackLabel2({ track, class
|
|
|
60
52
|
...track.trackMenuItems(),
|
|
61
53
|
].sort((a, b) => ((b === null || b === void 0 ? void 0 : b.priority) || 0) - ((a === null || a === void 0 ? void 0 : a.priority) || 0));
|
|
62
54
|
return (React.createElement(Paper, { ref: ref, className: cx(className, classes.root) },
|
|
63
|
-
React.createElement(
|
|
64
|
-
const target = event.currentTarget;
|
|
65
|
-
if (target.parentNode) {
|
|
66
|
-
const parent = target.parentNode;
|
|
67
|
-
event.dataTransfer.setDragImage(parent, 20, 20);
|
|
68
|
-
view.setDraggingTrackId(track.id);
|
|
69
|
-
}
|
|
70
|
-
}, onDragEnd: () => view.setDraggingTrackId(undefined), "data-testid": `dragHandle-${view.id}-${trackId}` },
|
|
71
|
-
React.createElement(DragIcon, { className: classes.dragHandleIcon, fontSize: "small" })),
|
|
55
|
+
React.createElement(TrackLabelDragHandle, { track: track, trackId: trackId, view: view }),
|
|
72
56
|
React.createElement(IconButton, { onClick: () => view.hideTrack(trackId), className: classes.iconButton, title: "close this track" },
|
|
73
57
|
React.createElement(CloseIcon, { fontSize: "small" })),
|
|
74
58
|
React.createElement(Typography, { variant: "body1", component: "span", className: classes.trackName },
|
|
@@ -18,9 +18,9 @@ const TrackLabelContainer = observer(function ({ track, view, }) {
|
|
|
18
18
|
const { classes, cx } = useStyles();
|
|
19
19
|
const display = track.displays[0];
|
|
20
20
|
const { trackLabel, trackLabelOverlap, trackLabelOffset } = classes;
|
|
21
|
-
const labelStyle = view.
|
|
21
|
+
const labelStyle = view.trackLabelsSetting !== 'overlapping' || display.prefersOffset
|
|
22
22
|
? trackLabelOffset
|
|
23
23
|
: trackLabelOverlap;
|
|
24
|
-
return view.
|
|
24
|
+
return view.trackLabelsSetting !== 'hidden' ? (React.createElement(TrackLabel, { track: track, className: cx(trackLabel, labelStyle) })) : null;
|
|
25
25
|
});
|
|
26
26
|
export default TrackLabelContainer;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models';
|
|
3
|
+
import { LinearGenomeViewModel } from '..';
|
|
4
|
+
declare function TrackLabelDragHandle({ trackId, view, track, }: {
|
|
5
|
+
trackId: string;
|
|
6
|
+
track: BaseTrackModel;
|
|
7
|
+
view: LinearGenomeViewModel;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
export default TrackLabelDragHandle;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { makeStyles } from 'tss-react/mui';
|
|
3
|
+
// icons
|
|
4
|
+
import DragIcon from '@mui/icons-material/DragIndicator';
|
|
5
|
+
const useStyles = makeStyles()({
|
|
6
|
+
dragHandle: {
|
|
7
|
+
cursor: 'grab',
|
|
8
|
+
},
|
|
9
|
+
dragHandleIcon: {
|
|
10
|
+
display: 'inline-block',
|
|
11
|
+
verticalAlign: 'middle',
|
|
12
|
+
pointerEvents: 'none',
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
function TrackLabelDragHandle({ trackId, view, track, }) {
|
|
16
|
+
const { classes } = useStyles();
|
|
17
|
+
return (React.createElement("span", { draggable: true, className: classes.dragHandle, onDragStart: event => {
|
|
18
|
+
const target = event.currentTarget;
|
|
19
|
+
if (target.parentNode) {
|
|
20
|
+
const parent = target.parentNode;
|
|
21
|
+
event.dataTransfer.setDragImage(parent, 20, 20);
|
|
22
|
+
view.setDraggingTrackId(track.id);
|
|
23
|
+
}
|
|
24
|
+
}, onDragEnd: () => view.setDraggingTrackId(undefined), "data-testid": `dragHandle-${view.id}-${trackId}` },
|
|
25
|
+
React.createElement(DragIcon, { className: classes.dragHandleIcon, fontSize: "small" })));
|
|
26
|
+
}
|
|
27
|
+
export default TrackLabelDragHandle;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { lazy } from 'react';
|
|
2
2
|
import { ViewType } from '@jbrowse/core/pluggableElementTypes';
|
|
3
3
|
import { stateModelFactory } from './model';
|
|
4
|
-
export default (pluginManager)
|
|
4
|
+
export default function LinearGenomeViewF(pluginManager) {
|
|
5
5
|
pluginManager.addViewType(() => {
|
|
6
6
|
return new ViewType({
|
|
7
7
|
name: 'LinearGenomeView',
|
|
@@ -10,5 +10,5 @@ export default (pluginManager) => {
|
|
|
10
10
|
ReactComponent: lazy(() => import('./components/LinearGenomeView')),
|
|
11
11
|
});
|
|
12
12
|
});
|
|
13
|
-
}
|
|
13
|
+
}
|
|
14
14
|
export * from './model';
|
|
@@ -71,9 +71,9 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
71
71
|
hideHeaderOverview: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
72
72
|
hideNoTracksActive: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
73
73
|
trackSelectorType: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
74
|
-
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
75
74
|
showCenterLine: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
76
75
|
showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
76
|
+
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
77
77
|
showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
78
78
|
}, {
|
|
79
79
|
width: number;
|
|
@@ -96,6 +96,12 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
96
96
|
leftOffset: BpOffset | undefined;
|
|
97
97
|
rightOffset: BpOffset | undefined;
|
|
98
98
|
} & {
|
|
99
|
+
/**
|
|
100
|
+
* #getter
|
|
101
|
+
* this is the effective value of the track labels setting, incorporating
|
|
102
|
+
* both the config and view state. use this instead of view.trackLabels
|
|
103
|
+
*/
|
|
104
|
+
readonly trackLabelsSetting: any;
|
|
99
105
|
/**
|
|
100
106
|
* #getter
|
|
101
107
|
*/
|