-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from tohsaka888/0.1.41
v0.1.41
- Loading branch information
Showing
9 changed files
with
233 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React, { createContext, useState } from "react"; | ||
|
||
type FullScreenContextProps = { | ||
isFullScreen: boolean; | ||
setIsFullScreen: React.Dispatch<React.SetStateAction<boolean>>; | ||
}; | ||
|
||
export const FullScreenContext = createContext<FullScreenContextProps | null>( | ||
null | ||
); | ||
|
||
function FullScreenController({ children }: { children: React.ReactNode }) { | ||
const [isFullScreen, setIsFullScreen] = useState<boolean>(false); | ||
return ( | ||
<FullScreenContext.Provider value={{ isFullScreen, setIsFullScreen }}> | ||
{children} | ||
</FullScreenContext.Provider> | ||
); | ||
} | ||
|
||
export default FullScreenController; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import React, { useContext, useState } from "react"; | ||
import { BsFillQuestionCircleFill } from "react-icons/bs"; | ||
import { AnimatePresence, motion } from "framer-motion"; | ||
import { ConfigContext } from "../context"; | ||
|
||
function Helper() { | ||
const { config } = useContext(ConfigContext)!; | ||
const [visible, setVisible] = useState<boolean>(false); | ||
|
||
return ( | ||
<> | ||
{config.showHelper && ( | ||
<motion.div | ||
initial={{ | ||
position: "absolute", | ||
top: "16px", | ||
right: "16px", | ||
background: "transparent", | ||
cursor: "pointer", | ||
userSelect: "none", | ||
}} | ||
onClick={() => setVisible(!visible)} | ||
> | ||
<BsFillQuestionCircleFill | ||
size={config.helperConfig!.size} | ||
color={config.helperConfig!.color} | ||
/> | ||
<AnimatePresence> | ||
{visible && ( | ||
<motion.div | ||
initial={{ | ||
position: "absolute", | ||
right: "0px", | ||
padding: "8px 16px", | ||
opacity: 0, | ||
fontSize: "0px", | ||
border: "1px solid #cecece", | ||
background: "#fff", | ||
width: "max-content", | ||
overflow: "hidden", | ||
}} | ||
animate={{ | ||
borderRadius: "4px", | ||
opacity: 1, | ||
fontSize: "12px", | ||
}} | ||
exit={{ | ||
opacity: 0, | ||
position: "absolute", | ||
right: "0px", | ||
}} | ||
transition={{ | ||
duration: 0.5, | ||
}} | ||
> | ||
<motion.ul | ||
initial={{ | ||
margin: "0px 0px 0px 16px", | ||
padding: "0px", | ||
}} | ||
> | ||
<motion.li>双击节点-探索/取消探索</motion.li> | ||
<motion.li>悬停节点-高亮节点并且高亮与其有关系的边</motion.li> | ||
<motion.li>拖拽空白画布-移动画布</motion.li> | ||
<motion.li>滑动滚轮-缩放画布</motion.li> | ||
<motion.li>拖拽节点-移动节点</motion.li> | ||
<motion.li>点击边-隐藏/显示边</motion.li> | ||
<motion.li>右键空白画布-画布选项菜单</motion.li> | ||
<motion.li>复位画布-将画布移动缩放恢复</motion.li> | ||
<motion.li>全屏-当前图谱全屏显示</motion.li> | ||
<motion.li> | ||
下载当前图谱-下载当前图谱为选中格式(jpg,jpeg,png,bmp) | ||
</motion.li> | ||
<motion.li>右键节点-节点选项菜单</motion.li> | ||
<motion.li> | ||
当前实体居中-在原缩放比例下将当前节点放置画布中央 | ||
</motion.li> | ||
<motion.li> | ||
显示当前节点关系-仅显示当前节点及其子节点和当前节点和子节点的关系 | ||
</motion.li> | ||
<motion.li>显示所有节点-显示所有隐藏的节点</motion.li> | ||
</motion.ul> | ||
</motion.div> | ||
)} | ||
</AnimatePresence> | ||
</motion.div> | ||
)} | ||
</> | ||
); | ||
} | ||
|
||
export default Helper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters