"scale" is serialized into graph.json when zooming locally, causing unnecessary file conflicts

In Obsidian 1.6.5, when you have a Graph view in a vault, the settings for the Graph are serialized into graph.json which can then be version-controlled (e.g. in Git).

Most of the values in here make sense to be serialized, since they allow the view to be consistent across multiple users, however the scale value is serialized in here too, which changes each time you scroll the zoom level of the graph with the mouse scroll wheel in Obsidian’s Graph view.

The fact that "scale" is serialized means that multiple users submitting a Graph to a shared vault will end up with conflicts every time they change the zoom level of the Graph, which is very frustrating and isn’t a value which needs to be shared.

It makes sense that graph.json contains anything truly “shared” (such as a group definitions), but since the graph.json doesn’t contain values like the view offset (e.g. from panning using the mouse), then it also follows that the zoom level should be considered as a “local” value and not serialized.

Did you follow the troubleshooting guide?

Yes - but you can’t repro this in Sandbox because it doesn’t serialize results, but it does repro in Restricted mode.

Expected result

"scale" property should not be serialized into graph.json after zooming with scroll wheel.

Actual result

Whenever the scroll wheel is used to zoom in the Graph view, the value for "scale" changes in graph.json.

Environment

SYSTEM INFO:
	Obsidian version: v1.6.5
	Installer version: v1.6.5
	Operating system: Windows 11 Pro 10.0.22631
	Login status: not logged in
	Insider build toggle: off
	Live preview: on
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 0
	Restricted mode: on

RECOMMENDATIONS:
	none

Additional information

None, you just need a Graph.

I don’t seem to have the ability to Edit this post, but I wanted to add that there are various other “user-specific” things which should not be serialized into the graph.json file, such as:

  • Whether the options panel is visible or not ("close" variable)
  • Expanded/collapsed state of headers in the options:
    • "collapse-filter", "collapse-color-groups", "collapse-display", "collapse-forces"

These are not useful to serialize since they are just transient local state for that user. If they are serialized anywhere it should be in a separate file.

Either that or the base “shared” things (such as filter colors, which are useful to have synchronised across all users) should be stored in their own file like graph_shared.json or something.

If the graph.json is never intended to be stored under version control, feel free to close this Bug Report! Otherwise I think it would be useful to be able to disambiguate “local transient user settings” from “useful shared properties” that can be version-controlled across all users.

Ok, I understand. I do not consider this a bug. In a sense, you could use the same arguments for all other values. Different user may want different filters, and different settings.
On the flip side, in single user case, perhaps the users expects the scale to be remembered too.

Please, open a feature request for this.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.