diff --git a/package.json b/package.json index 07b9d44..2510bc1 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@tailwindcss/forms": "0.5.x", "@tailwindcss/typography": "0.5.x", "asciidoctor": "3.0.x", + "d3": "^7.9.0", "he": "1.2.x", "nostr-tools": "2.10.x" }, diff --git a/src/app.css b/src/app.css index 41e84e0..3f197fa 100644 --- a/src/app.css +++ b/src/app.css @@ -8,15 +8,6 @@ @apply bg-primary-0 dark:bg-primary-1000 text-gray-800 dark:text-gray-300; } - /* Button */ - button.btn-leather.text-white { - @apply text-primary-0; - } - - .btn-leather span svg { - @apply fill-gray-800 hover:fill-primary-400 dark:fill-gray-300 dark:hover:fill-primary-500; - } - .btn-leather.text-xs { @apply w-7 h-7; } @@ -62,7 +53,7 @@ div.note-leather:hover:not(:has(.note-leather:hover)), p.note-leather:hover:not(:has(.note-leather:hover)), section.note-leather:hover:not(:has(.note-leather:hover)) { - @apply hover:bg-primary-100 dark:hover:bg-primary-800 ; + @apply hover:bg-primary-100 dark:hover:bg-primary-800; } /* Heading */ @@ -79,11 +70,11 @@ @apply bg-primary-0 dark:bg-primary-1000 border-b-[1px] border-gray-800 dark:border-gray-500; } - div.modal-leather > div > h1, - div.modal-leather > div > h2, - div.modal-leather > div > h3, - div.modal-leather > div > h4, - div.modal-leather > div > h5, + div.modal-leather > div > h1, + div.modal-leather > div > h2, + div.modal-leather > div > h3, + div.modal-leather > div > h4, + div.modal-leather > div > h5, div.modal-leather > div > h6 { @apply text-gray-800 hover:text-gray-800 dark:text-gray-300 dark:hover:text-gray-300; } @@ -147,4 +138,22 @@ .ul-leather li a { @apply text-gray-800 hover:text-primary-400 dark:text-gray-300 dark:hover:text-primary-500; } + .network-link-leather { + @apply stroke-gray-400 fill-gray-400; + } + .network-node-leather { + @apply stroke-gray-800; + } + .network-node-content { + @apply fill-[#d6c1a8]; + } +} +@layer components { + .leather-legend { + @apply flex-shrink-0 p-4 bg-primary-0 dark:bg-primary-1000 rounded-lg shadow + border border-gray-200 dark:border-gray-800; + } + .tooltip-leather { + @apply bg-primary-0 dark:bg-primary-1000 text-gray-800 dark:text-gray-300; + } } diff --git a/src/lib/components/Article.svelte b/src/lib/components/Article.svelte index df3d165..f51a3ac 100644 --- a/src/lib/components/Article.svelte +++ b/src/lib/components/Article.svelte @@ -1,15 +1,24 @@ - {#if showTocButton && !showToc} - - Show Table of Contents - + Show Table of Contents {/if} -
+
diff --git a/src/lib/components/EventNetwork.svelte b/src/lib/components/EventNetwork.svelte new file mode 100644 index 0000000..9cb90c9 --- /dev/null +++ b/src/lib/components/EventNetwork.svelte @@ -0,0 +1,588 @@ + + +
+
+ +
+ +
+

Legend

+
    +
  • +
    + + + I +
    + Index events (kind 30040) - Each with a unique pastel color +
  • + +
  • +
    + + C +
    + Content events (kind 30041) - Publication sections +
  • + +
  • + + + + Arrows indicate reading/sequence order +
  • +
+
+
+ + diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts index 2cc6dea..e80075e 100644 --- a/src/routes/+layout.ts +++ b/src/routes/+layout.ts @@ -1,7 +1,7 @@ -import NDK from '@nostr-dev-kit/ndk'; -import type { LayoutLoad } from './$types'; -import { standardRelays } from '$lib/consts'; -import Pharos, { pharosInstance } from '$lib/parser'; +import NDK from "@nostr-dev-kit/ndk"; +import type { LayoutLoad } from "./$types"; +import { standardRelays } from "$lib/consts"; +import Pharos, { pharosInstance } from "$lib/parser"; export const ssr = false; @@ -11,7 +11,7 @@ export const load: LayoutLoad = () => { enableOutboxModel: true, explicitRelayUrls: standardRelays, }); - ndk.connect().then(() => console.debug('ndk connected')); + ndk.connect().then(() => console.debug("ndk connected")); const parser = new Pharos(ndk); pharosInstance.set(parser); diff --git a/src/routes/publication/+page.svelte b/src/routes/publication/+page.svelte index 2dc00c6..a560670 100644 --- a/src/routes/publication/+page.svelte +++ b/src/routes/publication/+page.svelte @@ -1,8 +1,8 @@ - -
-
- Visualize -

Coming soon.

-
-
\ No newline at end of file +
+

Publication Network

+ + {#if loading} +
+
+ + Loading... +
+
+ {:else if error} + + {:else} + + +
+ {/if} +
diff --git a/svelte.config.js b/svelte.config.js index cadd15c..81bd366 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,5 +1,5 @@ -import adapter from '@sveltejs/adapter-static'; -import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; +import adapter from "@sveltejs/adapter-static"; +import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"; /** @type {import('@sveltejs/kit').Config} */ const config = { @@ -10,18 +10,18 @@ const config = { kit: { // Static adapter adapter: adapter({ - pages: 'build', - assets: 'build', - fallback: 'index.html', + pages: "build", + assets: "build", + fallback: "index.html", precompress: false, strict: true, }), alias: { - $lib: 'src/lib', - $components: 'src/lib/components', - $cards: 'src/lib/cards' - } - } + $lib: "src/lib", + $components: "src/lib/components", + $cards: "src/lib/cards", + }, + }, }; export default config;