Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #202 from GinaIsaia/tooltip_updates
Browse files Browse the repository at this point in the history
Tooltip updates
  • Loading branch information
Ljupcho Palashevski authored Jun 20, 2023
2 parents d027708 + a1ef6e4 commit a29adb8
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 12 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lfai/happi-graph",
"version": "4.3.0",
"version": "4.3.1",
"description": "Generic graph rendering solution.",
"license": "Apache-2.0",
"repository": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Modal, Table, ActionIcon } from '@mantine/core';
import { Modal, Table, ActionIcon, Tooltip } from '@mantine/core';
import {
BsCardChecklist
} from 'react-icons/bs';
Expand Down Expand Up @@ -68,9 +68,11 @@ class HappiGraphListOfRelationships extends React.Component<Props, State> {
const { data, opened } = this.state;

return (<>
<ActionIcon title="List of Relationships" variant="subtle" size={35}>
<Tooltip label="List of Relationships" position="right">
<ActionIcon variant="subtle" size={35}>
<BsCardChecklist size={25} onClick={() => this.setOpened(true)} />
</ActionIcon>
</Tooltip>


<Modal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Modal, Table, ActionIcon } from '@mantine/core';
import { Modal, Table, ActionIcon, Tooltip } from '@mantine/core';
import {
IoMdStats
} from 'react-icons/io';
Expand Down Expand Up @@ -72,9 +72,11 @@ class HappiGraphStatistics extends React.Component<Props, State> {
const { data, opened } = this.state;

return (<>
<ActionIcon title="Statistics" variant="subtle" size={35}>
<Tooltip label="Statistics" position="right">
<ActionIcon variant="subtle" size={35}>
<IoMdStats size={25} onClick={() => this.setOpened(true)} />
</ActionIcon>
</Tooltip>

<Modal
opened={opened}
Expand Down
18 changes: 13 additions & 5 deletions src/components/HappiGraph/happi-graph.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { elkApproach, visApproach } from "./happi-graph.algorithms";
import { addLinks, addNodes, centerGraph, customZoomIn, customZoomOut, initCenterGraph } from "./happi-graph.render";
import HappiGraphLegend from "./happi-graph-legend.component";

import { ActionIcon } from '@mantine/core';
import { ActionIcon, Tooltip } from '@mantine/core';

import {
MdZoomIn,
Expand Down Expand Up @@ -291,22 +291,30 @@ class HappiGraph extends React.Component<Props, State> {

{ !printMode && <>
<div className="happi-graph-actions">
<ActionIcon title="Zoom In" variant="subtle" size={35}>
<Tooltip label="Zoom in" position="right">
<ActionIcon variant="subtle" size={35}>
<MdZoomIn size={25} onClick={() => customZoomIn(zoom, svg) } />
</ActionIcon>
</Tooltip>

<ActionIcon title="Zoom Out" variant="subtle" size={35}>
<Tooltip label="Zoom out" position="right">
<ActionIcon variant="subtle" size={35}>
<MdZoomOut size={25} onClick={() => customZoomOut(zoom, svg) } />
</ActionIcon>
</Tooltip>

<ActionIcon title="Fit to screen" variant="subtle" size={35}>
<Tooltip label="Fit to screen" position="right">
<ActionIcon variant="subtle" size={35}>
<MdOutlineCenterFocusWeak size={25} onClick={() => centerGraph(allGroup, svg, zoom) } />
</ActionIcon>
</Tooltip>

<ActionIcon title="Fullscreen" variant="subtle" size={35}>
<Tooltip label="Fullscreen" position="right">
<ActionIcon variant="subtle" size={35}>
{ !isFullscreen && <AiOutlineFullscreen size={25} onClick={() => this.setFullscreen() } /> }
{ isFullscreen && <AiOutlineFullscreenExit size={25} onClick={() => this.setFullscreen() } /> }
</ActionIcon>
</Tooltip>

{ actions }
</div>
Expand Down

0 comments on commit a29adb8

Please sign in to comment.