From 265faef4e8717eab9678a5515ca9150b7776b148 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Tue, 18 Jun 2024 04:43:32 +0000
Subject: [PATCH] fix: properly compute relative path for explorer (closes #1055, #1066)
---
quartz/components/Graph.tsx | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/quartz/components/Graph.tsx b/quartz/components/Graph.tsx
index f728c5e..f7ebcc9 100644
--- a/quartz/components/Graph.tsx
+++ b/quartz/components/Graph.tsx
@@ -1,8 +1,8 @@
-import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
+import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
// @ts-ignore
import script from "./scripts/graph.inline"
import style from "./styles/graph.scss"
-import { i18n } from "../i18n/i18next"
+import { i18n } from "../i18n"
import { classNames } from "../util/lang"
export interface D3Config {
@@ -17,6 +17,7 @@
opacityScale: number
removeTags: string[]
showTags: boolean
+ focusOnHover?: boolean
}
interface GraphOptions {
@@ -37,6 +38,7 @@
opacityScale: 1,
showTags: true,
removeTags: [],
+ focusOnHover: false,
},
globalGraph: {
drag: true,
@@ -50,16 +52,17 @@
opacityScale: 1,
showTags: true,
removeTags: [],
+ focusOnHover: true,
},
}
export default ((opts?: GraphOptions) => {
- function Graph({ displayClass, cfg }: QuartzComponentProps) {
+ const Graph: QuartzComponent = ({ displayClass, cfg }: QuartzComponentProps) => {
const localGraph = { ...defaultOptions.localGraph, ...opts?.localGraph }
const globalGraph = { ...defaultOptions.globalGraph, ...opts?.globalGraph }
return (
<div class={classNames(displayClass, "graph")}>
- <h3>{i18n(cfg.locale, "graph.graphView")}</h3>
+ <h3>{i18n(cfg.locale).components.graph.title}</h3>
<div class="graph-outer">
<div id="graph-container" data-cfg={JSON.stringify(localGraph)}></div>
<svg
--
Gitblit v1.10.0