using obsidian/jsoncanvas to design a nostr canvas spec.

one immediate thing that stands out is that I like how I can put many markdown documents next to each other for reference when editing.

its gonna be pretty cool when I can create a 2d canvas of nostr notes: longform, kind1, anything.

nostr:note1wk5v0lhsuw0ar5e4u3f4v0sawxp47umv4pjsr8x56wlpgjcx7wrqh06fdu

Reply to this note

Please Login to reply.

Discussion

seeing the edge spec in your image reminds me of a former life working on a knowledge graph. rdf comes to mind. what if you include the type of edge - the predicate. you could also attach arbitrary properties to the edges, either tags or content json blob.

👍cool stuff!

i'm mostly mirroing the json spec so that they would be isomorphic https://jsoncanvas.org/spec/1.0/

Are you looking at writing Java-Canvas files to stream into Obsidian to se and interact with there or are you consuming canvas files directly in the nostr client? What are you finding useful to render the canvas... Something like D3 or somethingore simple?

JSON Canvas... Autocorrect 🙁

I'm not using java or web tech. this is just rust + rendering directly to the gpu. the code is only a few hundred lines of code

https://github.com/damus-io/notedeck/blob/dab0e2e8d14e5de4f51bb2ed841bbfb105bbfdc1/crates/notedeck_notebook/src/ui.rs

Badass

nostr:nprofile1qqs06gywary09qmcp2249ztwfq3ue8wxhl2yyp3c39thzp55plvj0sgpzpmhxue69uhkummnw3ezumrpdejqzyrhwden5te0dehhxarj9emkjmn9qydhwumn8ghj7argv4nx7un9wd6zumn0wd68yvfwvdhk6tc7xx9t4 nostr:nprofile1qqs8qy3p9qnnhhq847d7wujl5hztcr7pg6rxhmpc63pkphztcmxp3wgpz9mhxue69uhkummnw3ezuamfdejj7qgmwaehxw309a6xsetxdaex2um59ehx7um5wgcjucm0d5hszxthwden5te0wfjkccte9ek82mtfdesjuun0vd4hxtc8vazku some synchrony with our spec here.

?

should be able to build a canvas of any note. we're building a shared UI toolkit for any app to reder any note type. would love to render the stuff y'all are doing

How do you deal with consistent (interop) formatting in the canvas?

As in, make sure the text doesn't overflow the node dimensions etc?

I think it's going to be way easier to interop on :graph: Graph events that just list the involved events (nodes) + a bunch of connections between them (that each have a type, direction, description, ....).

And the let apps display that as they wish, with some sensable defaults + recommended app handling.

For actual Figma canvas type stuff, we need #Hypermedia imo.

nostr:npub1p4kg8zxukpym3h20erfa3samj00rm2gt4q5wfuyu3tg0x3jg3gesvncxf8

nostr:nprofile1qqsqddupn4l3cl65wggcyehd009g0pwuatsfudh28f90vewx68vrylqprfmhxue69uhhyetvv9ujuem9w3skccne9e3k7mf0wccszenhwden5te0ve5kcar9wghxummnw3ezuamfdejj7mnsw43rzufkd43hywr5d3erxmp5va6hxvmnveh8wd3hxue8xdm6v9jnv6r3de3k6ae4wa4rydm9df6kgdthvduxvdm3xph8sdmyx5lkyun0v9jxxctnws7hgun4v5q3gamnwvaz7tmjv4kxz7fwv3sk6atn9e5k7nznd8h gave an incredible presentation on hypermedia during one of the #Nosfabrica calls.

is there a video somewhere?

+1

btw this fails to load for me

It thinks you're offline. Does going to the about page and refreshing the relays help?

I looked at that.

But it doesn't let me specify connections between events. At least, I don't see it.

nostr:npub1m3xdppkd0njmrqe2ma8a6ys39zvgp5k8u22mev8xsnqp4nh80srqhqa5sf do we need a graph kind, or can this use case be covered with labels or an algorithm or something?

1987 is just to have a vector attached to some event, like a label. For a full network, you need to think relationally, a directed graph would need some metadata like "from" and "to". If you know the structure a priori, you can place it as a tag right with the event/node. Otherwise you'll need an index event or something akin to your directory system, where you have specific events dictating the structure.

I think a new event kind that specifies edges between events could be valuable. Different npubs could specify different sets of edges, creating different "overlays" on the underlying event data.

This could be used to build graph databases. One might use embeddings to determine where to draw connections, and how to weight them. This unlocks semantic navigation journeys embedded in an events context. Think how you can jump from one page to the next on Wikipedia almost endlessly, now apply that flow to just about any Nostr event.

I was thinking just a literal and isomorphic translation of the json canvas spec to nostr. Embed any note type in each node

I'll need to read up on JSON Canvas; it's a new concept to me.

I was thinking about graphs and embeddings like what nostr:npub1m3xdppkd0njmrqe2ma8a6ys39zvgp5k8u22mev8xsnqp4nh80srqhqa5sf and nostr:npub1l5sga6xg72phsz5422ykujprejwud075ggrr3z2hwyrfgr7eylqstegx9z mentioned.

Adding edge events would add a lot, because we're already visualizing 30040/30041 with a star topology. An edge event pointing to a 30040 event means you're connecting to notes that have already been classified together, meaning you can collapse a bunch of nodes into a single one. You can even make the edge events point to tags, or pubkeys which actually would be a fuzzy graph structure, because you don't know how many connections you'll have. 👀

https://easy-peasy.ai/ai-image-generator/images/hand-drawn-node-link-visualization-undirected-graph-10-nodes

Well, I guess that would be 1988, nostr:npub149p5act9a5qm9p47elp8w8h3wpwn2d7s2xecw2ygnrxqp4wgsklq9g722q .

What's 1988?

Your new graph Kind. Gave it the next number, so that it's easy to remember.

Aha, so best to use replaceable. Gotcha!

Thanks :prayinghands:

Best to use non-replaceable.

Replaceable is 20k-30k

30k-40k, sorry.

Yeah, I also don't know canvas, but it looks cool. nostr:npub1xtscya34g58tk0z605fvr788k263gsu6cy9x0mhnm87echrgufzsevkk5s said he'd provide the basis for that. We'll probably understand it better, if we can see a spec or something.

Just checked JSON canvas. It's neat. But the dims and x and y positions are a pain to interop on. (if you cannot specify the formating of the nodes, that is, as with #hypermedia).

But we can totally copy the Edge concept from it.

And then you can still easily import your obsidian boards. While making it an order of magnitude easier to implement this content type.

I need a graph kind.

I need something like this: nostr:naddr1qvzqqqrcvgpzp22rfmsktmgpk2rtan7zwu00zuzax5maq5dnsu5g3xxvqr2u3pd7qythwumn8ghj7un9d3shjtnwdaehgu3wvfskuep0qyghwumn8ghj7mn0wd68ytnhd9hx2tcqp9hxjupdvaexzurgpcelcv

It enables mindmaps, basic canvas, system graphs with feedback loops, etc...

nostr:npub1xtscya34g58tk0z605fvr788k263gsu6cy9x0mhnm87echrgufzsevkk5s nostr:npub1l5sga6xg72phsz5422ykujprejwud075ggrr3z2hwyrfgr7eylqstegx9z

Oof, parameterized replaceable?

Again, I'm a noob with this.

I have no idea what to use when. I just know what general spec pattern I need.

Should both the Graph and the Edge event be Replaceable.

Only the Edge?

Replacing means you want to change them in place, but I don't really know why you would do that.

I want to be able to edit my graph.

I'm fine with just deleting and creating new connections/edges tho, so those could be just normal events.

It's cleaner, I think, but nostr:npub1fjqqy4a93z5zsjwsfxqhc2764kvykfdyttvldkkkdera8dr78vhsmmleku would know.

Maybe a 10000 series replaceable is a happy medium.

it would need to be a 30k range with d tags attached to a workspace and probably a set of custom tags to make a hierarchy of graph elements, and other things like labels and whatnot.

making it work as a realtime collab workspace would also mean clients would need to be constantly chattering events from the UI to the relay and back to other clients currently viewing the same document. probably this would just be a subscription on kind and d tag, and maybe some other tags that designate other facets such as comments, and so forth.

it probably would be faster if it used a binary encoding as well, and a QUIC/HTTP/3 base for the network transport, though i can see it being servicable with JSON/NIP-01

Yup ✅

Well, there is your answer. Do that.

The graph is very similar to a 30040 index, so I'm lost as to why it shouldn't be param. repl. too.

It's like a visual wiki article with the references being nodes on a canvas.

yup, that's exactly what it is, so its structure is similar, and would also have a tree geometry, but maybe more like a DAG than a tree to account for merging collisions of changes between users (or at least determining their total ordering).

You guys have something for canvasses? 👀

Not designed for canvases, but strucurally similar. Linked notes together for collaboration.

Is this closer to the visualisation page, or is this more like the mind map I was talking about, where you can map out publications and then mass-generate the events from the diagram, to get the 30040 scaffold with citations?

I'm not familiar with the canvas, here.

To my understanding, its a mind map. Like the in progress visualization with editing, but even more non-linear.

Ah, okay, cool.