Live data from Hacker News

JSON Canvas – An open file format for infinite canvas data

jsoncanvas.org

101–110 of 168 posts

Re: JSON Canvas – An open file format for infinite canvas data

#101
post #83
post #34

Earlier quoted context omitted.

Who was involved in this open spec? Or was it built by Obsidian with a hope that it works for everyone else? Which existing formats were considered before building your own, e.g. SVG/Excalidraw/draw.io/...?

Yeah, didn't see any discussion in the other thread, do you have any notes on why this isn't SVG?

SVG is great and you are the first person I have ever seen who would (and did) imply that SVG might be or would be better than JSON for this kind of thing.

SVG really stretches the “human readable” thing to its limit, and I personally would not adopt an SVG-like format for anything that isn’t SVG.

Re: JSON Canvas – An open file format for infinite canvas data

#103

Earlier quoted context omitted.

I agree with a lot of comments that it's minimal, but in my opinion that is a good thing. I'm a big fan of Obsidian, and of the things I like about it is the data source is all markdown files. Markdown is meant to be very lightweight and portable, and overcomplicating it will limit adoption and extensibility (imagine markdown vs pdf). JSON Canvas seems to follow in that spirit by being very lightweight, so a lot of i…

> Markdown and JSON are meant to be non-opague file formats that prioritizes portability and human readability over other features I don't think human readability is a critical feature of JSON at this point. If that's your priority, you can use YAML. Readable JSON is nice because for small files you can read or edit small sections of it, and it's easy to debug when manipulating it with machine code. But there are ple…

> I don't think human readability is a critical feature of JSON at this point. If that's your priority, you can use YAML.

Wow you have kinda lost the plot on a few things.

JSON was designed to be human readable and writable. YAML was designed to be a human readable format for the automated interchange of data between automated systems. Human writability was neither a goal for YAML nor its intended use. Like everyone else on the frakking planet, you’ve misunderstood what YAML was intended and designed for. YAML was never intended for human-written configuration storage, which is what everyone used it for the instant after they became aware of it.

YAML can bite you very hard if you misunderstand it. JSON is simply invalid if you misunderstand it when writing it.

If you don’t need human readability, use a binary format. Binary formats are so freaking fast compared to literally any structured text format, past, present, or future. High speed and low latency matter and binary formats make both of those easier.

If you need to inspect the binary data, write a viewer using the code you use to read it. It’s a lot simpler than people believe it to be. I find Protobuf to be more of a hassle than writing the code myself, and protobuf is very easy to use, and I’m quite a moron. Binary stuff is not hard.

Re: JSON Canvas – An open file format for infinite canvas data

#104
post #15

Whoa! Didn't expect this to bubble up to the top of HN. Some context about why we created JSON Canvas: https://obsidian.md/blog/json-canvas/ We just released it today, so this is still a very nascent project. A little over a year ago we released Obsidian Canvas. The .canvas file format has felt stable enough to give it a name and resources that other apps can freely use. See the original Show HN: https://news.ycombin…

For those having difficulty viewing the spec at the linked jsoncanvas.org site, the spec/1.0 pane on the right has the scrollbar hidden; there's more content if you scroll that pane down.

Click the spec link, it shows the same content in a full page.

Re: JSON Canvas – An open file format for infinite canvas data

#105
post #66
post #30

I've worked a few jobs now where application data was stored in text files of various kinds (homegrown as well as well-defined formats, JSON included) and it pretty quickly becomes a mess when you start talking about modifying it over time, evolving its schema, validating it in the face of end-user edits, ensuring threads don't write to it concurrently, etc. This strikes me as exactly the type of application data tha…

SQLite is awesome, but it's still an order of magnitude more complex than JSON. If it wants to be the one file format to rule them all, we're going to need high quality and heavily used implementations in most languages. Adding C sqlite to a golang project adds a significant hit to build times and cross-compilation/static linking complexity[0]. When I looked into the native Go implementations of sqlite I came away wi…

Check out https://github.com/zombiezen/go-sqlite if you're interested in trying out Sqlite in Go again. Nice interface, negligible compile time impact, fast, compiles without CGO. It's very comfortable.

I agree that going from text to sqlite is a bit of a hurdle, especially if you're not writing C :)

Re: JSON Canvas – An open file format for infinite canvas data

#106
post #34
post #15

Whoa! Didn't expect this to bubble up to the top of HN. Some context about why we created JSON Canvas: https://obsidian.md/blog/json-canvas/ We just released it today, so this is still a very nascent project. A little over a year ago we released Obsidian Canvas. The .canvas file format has felt stable enough to give it a name and resources that other apps can freely use. See the original Show HN: https://news.ycombin…

Who was involved in this open spec? Or was it built by Obsidian with a hope that it works for everyone else? Which existing formats were considered before building your own, e.g. SVG/Excalidraw/draw.io/...?

Relevant XKCD:

https://xkcd.com/927

Re: JSON Canvas – An open file format for infinite canvas data

#107
post #34

Earlier quoted context omitted.

Who was involved in this open spec? Or was it built by Obsidian with a hope that it works for everyone else? Which existing formats were considered before building your own, e.g. SVG/Excalidraw/draw.io/...?

Relevant XKCD: https://xkcd.com/927

I can't believe it took this long for someone to post this haha

Re: JSON Canvas – An open file format for infinite canvas data

#108
post #30

I've worked a few jobs now where application data was stored in text files of various kinds (homegrown as well as well-defined formats, JSON included) and it pretty quickly becomes a mess when you start talking about modifying it over time, evolving its schema, validating it in the face of end-user edits, ensuring threads don't write to it concurrently, etc. This strikes me as exactly the type of application data tha…

The SQLite docs have a great page on the use case `asa400` describes.

SQLite as an Application File Format, https://sqlite.org/appfileformat.html

Re: JSON Canvas – An open file format for infinite canvas data

#109
post #50

This is a great idea. For now though, the spec is under-specified and ambiguously terse. A few points that could be clarified: - How do coordinates work? Does +Y point up (OpenGL) or down (web)? Is the origin meaningful? What are the units - how does this interact with font sizes? High-DPI displays? - What’s the difference between a file node and a URL node linking to file://./? Are files supposed to be transcluded?…

> Is the origin meaningful?

I assume no.

> What are the units

Arbitrary. The website says pixels, but the demo lets you zoom in and out, so I think defining the unit as pixels is pretty meaningless, except as a hint to the viewer of the initial scale for the canvas. Even then I can see good reasons for a viewer program to just ignore that and use whatever initial scale allows everything to fit on screen.

> how does this interact with font sizes?

Seems like the font size can't be changed, but I'd imagine it's a specific number of units.

> High-DPI displays?

Not sure what kind of answer you're looking for here. You can just scale everything, so support for High-DPI displays would be up to the viewer program.

Re: JSON Canvas – An open file format for infinite canvas data

#110
post #69

Obsidian is one of the few closed-source applications I would consider relying on, due to their commitment to building around simple, open file formats. Sure, they could screw me over and start charging absurd amounts of money for their app, but high quality open source alternatives would pop up immediately. Meanwhile, as long as they don't screw me over, it's unlikely an open source alternative is going to be able t…

The big gap I would love to be solved is a, preferably selfhosted, browser based view into my notes. That way I could access my notes from computers you can't or won't install obsidian on.

If it was open source that would be more likely to happen

Post reply on HN