@vitessce/tooltip 3.5.12 → 3.6.0
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/index.js +7833 -6420
- package/dist-tsc/Tooltip.js +4 -4
- package/dist-tsc/Tooltip2D.js +3 -3
- package/dist-tsc/index.d.ts +1 -1
- package/dist-tsc/index.js +1 -1
- package/dist-tsc/styles.d.ts +9 -1
- package/dist-tsc/styles.d.ts.map +1 -1
- package/dist-tsc/styles.js +2 -7
- package/package.json +7 -7
- package/src/Tooltip.js +6 -6
- package/src/Tooltip2D.js +3 -3
- package/src/index.js +1 -1
- package/src/styles.js +2 -7
package/dist-tsc/Tooltip.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { Paper,
|
|
3
|
+
import { Paper, PopperV4 } from '@vitessce/styles';
|
|
4
4
|
import { useVitessceContainer } from '@vitessce/vit-s';
|
|
5
|
-
import {
|
|
5
|
+
import { useStyles } from './styles.js';
|
|
6
6
|
export default function Tooltip(props) {
|
|
7
7
|
const { x, y, parentWidth, parentHeight, children, } = props;
|
|
8
8
|
const ref = useRef();
|
|
9
|
-
const classes =
|
|
9
|
+
const { classes } = useStyles();
|
|
10
10
|
const [placementX, setPlacementX] = useState('start');
|
|
11
11
|
const [placementY, setPlacementY] = useState('bottom');
|
|
12
12
|
const getTooltipContainer = useVitessceContainer(ref);
|
|
@@ -21,5 +21,5 @@ export default function Tooltip(props) {
|
|
|
21
21
|
ref.current.style.top = `${y + (flipY ? -20 : 5)}px`;
|
|
22
22
|
}
|
|
23
23
|
}, [x, y, parentWidth, parentHeight]);
|
|
24
|
-
return (_jsx("div", { ref: ref, className: classes.tooltipAnchor, children: ref && ref.current ? (_jsx(
|
|
24
|
+
return (_jsx("div", { ref: ref, className: classes.tooltipAnchor, children: ref && ref.current ? (_jsx(PopperV4, { open: true, anchorEl: ref.current, container: getTooltipContainer, transition: true, placement: `${placementY}-${placementX}`, children: _jsx(Paper, { elevation: 8, className: classes.tooltipContent, children: children }) })) : null }));
|
|
25
25
|
}
|
package/dist-tsc/Tooltip2D.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { makeStyles } from '@
|
|
3
|
+
import { makeStyles } from '@vitessce/styles';
|
|
4
4
|
import Tooltip from './Tooltip.js';
|
|
5
|
-
const useStyles = makeStyles(theme => ({
|
|
5
|
+
const useStyles = makeStyles()(theme => ({
|
|
6
6
|
cellEmphasisCrosshair: {
|
|
7
7
|
zIndex: 50,
|
|
8
8
|
position: 'absolute',
|
|
@@ -26,7 +26,7 @@ const useStyles = makeStyles(theme => ({
|
|
|
26
26
|
*/
|
|
27
27
|
export default function Tooltip2D(props) {
|
|
28
28
|
const { parentUuid, sourceUuid, x, y, parentWidth, parentHeight, children, } = props;
|
|
29
|
-
const classes = useStyles();
|
|
29
|
+
const { classes } = useStyles();
|
|
30
30
|
// Check if out of bounds.
|
|
31
31
|
if (x < 0 || x > parentWidth || y < 0 || y > parentHeight) {
|
|
32
32
|
return null;
|
package/dist-tsc/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as Tooltip2D } from "./Tooltip2D.js";
|
|
2
2
|
export { default as Tooltip } from "./Tooltip.js";
|
|
3
3
|
export { default as TooltipContent } from "./TooltipContent.js";
|
|
4
|
-
export {
|
|
4
|
+
export { useStyles as useTooltipStyles } from "./styles.js";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist-tsc/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as Tooltip2D } from './Tooltip2D.js';
|
|
2
2
|
export { default as Tooltip } from './Tooltip.js';
|
|
3
3
|
export { default as TooltipContent } from './TooltipContent.js';
|
|
4
|
-
export {
|
|
4
|
+
export { useStyles as useTooltipStyles } from './styles.js';
|
package/dist-tsc/styles.d.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const useStyles: (params: void, muiStyleOverridesParams?: {
|
|
2
|
+
props: Record<string, unknown>;
|
|
3
|
+
ownerState?: Record<string, unknown> | undefined;
|
|
4
|
+
} | undefined) => {
|
|
5
|
+
classes: Record<"tooltipAnchor" | "tooltipContent", string>;
|
|
6
|
+
theme: import("@mui/material").Theme;
|
|
7
|
+
css: import("tss-react").Css;
|
|
8
|
+
cx: import("tss-react").Cx;
|
|
9
|
+
};
|
|
2
10
|
//# sourceMappingURL=styles.d.ts.map
|
package/dist-tsc/styles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src/styles.js"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src/styles.js"],"names":[],"mappings":"AAEA;;cA4BuC,CAAC;;;kBAAoH,eAAsB;gBAAyB,WAAU;eAAsB,WAAU;EADjP"}
|
package/dist-tsc/styles.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { makeStyles } from '@
|
|
2
|
-
export const
|
|
1
|
+
import { makeStyles } from '@vitessce/styles';
|
|
2
|
+
export const useStyles = makeStyles()(theme => ({
|
|
3
3
|
tooltipAnchor: {
|
|
4
4
|
position: 'relative',
|
|
5
5
|
width: '0px',
|
|
@@ -11,7 +11,6 @@ export const styles = makeStyles(theme => ({
|
|
|
11
11
|
opacity: 0.9,
|
|
12
12
|
padding: '5px',
|
|
13
13
|
pointerEvents: 'none',
|
|
14
|
-
backgroundColor: theme.palette.gridLayoutBackground,
|
|
15
14
|
'& table > tbody > tr > th, & table > tbody > tr > td': {
|
|
16
15
|
border: 'none',
|
|
17
16
|
fontSize: '12px',
|
|
@@ -21,10 +20,6 @@ export const styles = makeStyles(theme => ({
|
|
|
21
20
|
padding: '0 2px !important',
|
|
22
21
|
textAlign: 'left',
|
|
23
22
|
color: theme.palette.tooltipText,
|
|
24
|
-
backgroundColor: theme.palette.gridLayoutBackground,
|
|
25
|
-
},
|
|
26
|
-
'& table > tr:nth-child(2)': {
|
|
27
|
-
backgroundColor: 'inherit !important',
|
|
28
23
|
},
|
|
29
24
|
'& table': {
|
|
30
25
|
borderCollapse: 'collapse',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitessce/tooltip",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"author": "HIDIVE Lab at HMS",
|
|
5
5
|
"homepage": "http://vitessce.io",
|
|
6
6
|
"repository": {
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
"dist-tsc"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@
|
|
20
|
-
"@vitessce/vit-s": "3.
|
|
21
|
-
"@vitessce/utils": "3.
|
|
19
|
+
"@vitessce/styles": "3.6.0",
|
|
20
|
+
"@vitessce/vit-s": "3.6.0",
|
|
21
|
+
"@vitessce/utils": "3.6.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"react": "^18.0.0",
|
|
25
|
-
"vite": "^
|
|
26
|
-
"vitest": "^
|
|
25
|
+
"vite": "^6.3.5",
|
|
26
|
+
"vitest": "^3.1.4"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
29
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"bundle": "pnpm exec vite build -c ../../scripts/vite.config.js",
|
package/src/Tooltip.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { Paper,
|
|
2
|
+
import { Paper, PopperV4 } from '@vitessce/styles';
|
|
3
3
|
import { useVitessceContainer } from '@vitessce/vit-s';
|
|
4
|
-
import {
|
|
4
|
+
import { useStyles } from './styles.js';
|
|
5
5
|
|
|
6
6
|
export default function Tooltip(props) {
|
|
7
7
|
const {
|
|
@@ -12,7 +12,7 @@ export default function Tooltip(props) {
|
|
|
12
12
|
children,
|
|
13
13
|
} = props;
|
|
14
14
|
const ref = useRef();
|
|
15
|
-
const classes =
|
|
15
|
+
const { classes } = useStyles();
|
|
16
16
|
const [placementX, setPlacementX] = useState('start');
|
|
17
17
|
const [placementY, setPlacementY] = useState('bottom');
|
|
18
18
|
|
|
@@ -36,17 +36,17 @@ export default function Tooltip(props) {
|
|
|
36
36
|
className={classes.tooltipAnchor}
|
|
37
37
|
>
|
|
38
38
|
{ref && ref.current ? (
|
|
39
|
-
<
|
|
39
|
+
<PopperV4
|
|
40
40
|
open
|
|
41
41
|
anchorEl={ref.current}
|
|
42
42
|
container={getTooltipContainer}
|
|
43
43
|
transition
|
|
44
44
|
placement={`${placementY}-${placementX}`}
|
|
45
45
|
>
|
|
46
|
-
<Paper elevation={
|
|
46
|
+
<Paper elevation={8} className={classes.tooltipContent}>
|
|
47
47
|
{children}
|
|
48
48
|
</Paper>
|
|
49
|
-
</
|
|
49
|
+
</PopperV4>
|
|
50
50
|
) : null}
|
|
51
51
|
</div>
|
|
52
52
|
);
|
package/src/Tooltip2D.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { makeStyles } from '@
|
|
2
|
+
import { makeStyles } from '@vitessce/styles';
|
|
3
3
|
import Tooltip from './Tooltip.js';
|
|
4
4
|
|
|
5
|
-
const useStyles = makeStyles(theme => ({
|
|
5
|
+
const useStyles = makeStyles()(theme => ({
|
|
6
6
|
cellEmphasisCrosshair: {
|
|
7
7
|
zIndex: 50,
|
|
8
8
|
position: 'absolute',
|
|
@@ -36,7 +36,7 @@ export default function Tooltip2D(props) {
|
|
|
36
36
|
children,
|
|
37
37
|
} = props;
|
|
38
38
|
|
|
39
|
-
const classes = useStyles();
|
|
39
|
+
const { classes } = useStyles();
|
|
40
40
|
|
|
41
41
|
// Check if out of bounds.
|
|
42
42
|
if (x < 0 || x > parentWidth || y < 0 || y > parentHeight) {
|
package/src/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as Tooltip2D } from './Tooltip2D.js';
|
|
2
2
|
export { default as Tooltip } from './Tooltip.js';
|
|
3
3
|
export { default as TooltipContent } from './TooltipContent.js';
|
|
4
|
-
export {
|
|
4
|
+
export { useStyles as useTooltipStyles } from './styles.js';
|
package/src/styles.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { makeStyles } from '@
|
|
1
|
+
import { makeStyles } from '@vitessce/styles';
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const useStyles = makeStyles()(theme => ({
|
|
4
4
|
tooltipAnchor: {
|
|
5
5
|
position: 'relative',
|
|
6
6
|
width: '0px',
|
|
@@ -12,7 +12,6 @@ export const styles = makeStyles(theme => ({
|
|
|
12
12
|
opacity: 0.9,
|
|
13
13
|
padding: '5px',
|
|
14
14
|
pointerEvents: 'none',
|
|
15
|
-
backgroundColor: theme.palette.gridLayoutBackground,
|
|
16
15
|
'& table > tbody > tr > th, & table > tbody > tr > td': {
|
|
17
16
|
border: 'none',
|
|
18
17
|
fontSize: '12px',
|
|
@@ -22,10 +21,6 @@ export const styles = makeStyles(theme => ({
|
|
|
22
21
|
padding: '0 2px !important',
|
|
23
22
|
textAlign: 'left',
|
|
24
23
|
color: theme.palette.tooltipText,
|
|
25
|
-
backgroundColor: theme.palette.gridLayoutBackground,
|
|
26
|
-
},
|
|
27
|
-
'& table > tr:nth-child(2)': {
|
|
28
|
-
backgroundColor: 'inherit !important',
|
|
29
24
|
},
|
|
30
25
|
'& table': {
|
|
31
26
|
borderCollapse: 'collapse',
|