@jbrowse/display-ui 5.0.0-beta.2 → 5.0.0-beta.3
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/esm/PointerLayer.d.ts +12 -18
- package/esm/PointerLayer.js +14 -23
- package/package.json +2 -2
package/esm/PointerLayer.d.ts
CHANGED
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
import type { MouseState, MouseTracker } from '@jbrowse/core/ui/useMouseTracking';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
/**
|
|
4
|
-
* The part of a display that follows the pointer
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* (see `useMouseTracking`).
|
|
4
|
+
* The part of a display that follows the pointer, in a leaf of its own so a
|
|
5
|
+
* mousemove re-renders this and not the chrome, its status container and every
|
|
6
|
+
* overlay under it (see `useMouseTracking`). An observer, so a model read in
|
|
7
|
+
* `children` is tracked here too rather than freezing under a stationary
|
|
8
|
+
* cursor.
|
|
10
9
|
*
|
|
11
|
-
* `
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* a layer that has to render while nothing is hovered — the matrix display's
|
|
17
|
-
* connector lines, with no column highlighted — can.
|
|
18
|
-
*
|
|
19
|
-
* Four displays used to write this component out, with the same paragraph over
|
|
20
|
-
* each.
|
|
10
|
+
* `inRows` is whether the pointer is past `rowsTopOffset`, the bands a display
|
|
11
|
+
* stacks above its rows — a crosshair drawn over one names a row the pointer is
|
|
12
|
+
* not on, and `>=` because the rows begin AT the offset. A tooltip usually
|
|
13
|
+
* wants it ungated, which is why the child decides, and `children` is handed an
|
|
14
|
+
* absent state so a layer that draws with nothing hovered still can.
|
|
21
15
|
*/
|
|
22
|
-
export declare
|
|
16
|
+
export declare const PointerLayer: ({ mouseTracker, rowsTopOffset, children, }: {
|
|
23
17
|
mouseTracker: MouseTracker;
|
|
24
18
|
rowsTopOffset?: number;
|
|
25
19
|
children: (state: MouseState | undefined, inRows: boolean) => ReactNode;
|
|
26
|
-
})
|
|
20
|
+
}) => ReactNode;
|
package/esm/PointerLayer.js
CHANGED
|
@@ -1,30 +1,21 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
// deep subpath, never the `@jbrowse/core/ui` barrel: this package reaches no
|
|
3
2
|
// UI toolkit, and the barrel pulls MUI in
|
|
4
3
|
import { useMouseState } from '@jbrowse/core/ui/useMouseTracking';
|
|
4
|
+
import { observer } from 'mobx-react';
|
|
5
5
|
/**
|
|
6
|
-
* The part of a display that follows the pointer
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* (see `useMouseTracking`).
|
|
6
|
+
* The part of a display that follows the pointer, in a leaf of its own so a
|
|
7
|
+
* mousemove re-renders this and not the chrome, its status container and every
|
|
8
|
+
* overlay under it (see `useMouseTracking`). An observer, so a model read in
|
|
9
|
+
* `children` is tracked here too rather than freezing under a stationary
|
|
10
|
+
* cursor.
|
|
12
11
|
*
|
|
13
|
-
* `
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* a layer that has to render while nothing is hovered — the matrix display's
|
|
19
|
-
* connector lines, with no column highlighted — can.
|
|
20
|
-
*
|
|
21
|
-
* Four displays used to write this component out, with the same paragraph over
|
|
22
|
-
* each.
|
|
12
|
+
* `inRows` is whether the pointer is past `rowsTopOffset`, the bands a display
|
|
13
|
+
* stacks above its rows — a crosshair drawn over one names a row the pointer is
|
|
14
|
+
* not on, and `>=` because the rows begin AT the offset. A tooltip usually
|
|
15
|
+
* wants it ungated, which is why the child decides, and `children` is handed an
|
|
16
|
+
* absent state so a layer that draws with nothing hovered still can.
|
|
23
17
|
*/
|
|
24
|
-
export function PointerLayer({ mouseTracker, rowsTopOffset = 0, children, }) {
|
|
25
|
-
// >=: the rows begin AT the offset (their container sits at
|
|
26
|
-
// `top: rowsTopOffset`), so the boundary pixel is row 0's top edge — and with
|
|
27
|
-
// no band above, y=0 is the display's own top edge, not a dead line.
|
|
18
|
+
export const PointerLayer = observer(function PointerLayer({ mouseTracker, rowsTopOffset = 0, children, }) {
|
|
28
19
|
const state = useMouseState(mouseTracker);
|
|
29
|
-
return
|
|
30
|
-
}
|
|
20
|
+
return children(state, !!state && state.y >= rowsTopOffset);
|
|
21
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/display-ui",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The UI a display draws that is not data: the swappable chrome contract, its toolkit-free implementations, and the track overlay layer",
|
|
6
6
|
"keywords": [
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@jbrowse/mobx-state-tree": "^6.5.1",
|
|
26
26
|
"mobx-react": "^10.0.2",
|
|
27
|
-
"@jbrowse/core": "^5.0.0-beta.
|
|
27
|
+
"@jbrowse/core": "^5.0.0-beta.3"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"react": ">=19.0.0",
|