kotaindah556k downloadsGive your embedded canvas better display and interactivity.
Give your embedded canvas better display and interactivity.

[!NOTE]
Although this plugin already fulfills the need for a full preview of embedded canvas, I still strongly support including this feature as a built-in feature. Visit here to give your support.
[!WARNING]
This plugin uses monkey patch and accesses internal API to unlock features that cannot be provided using public API alone.
better-embedded-canvas under YOUR_VAULT_NAME/.obsidian/plugins.manifest.json, main.js, and style.css from the latest release into the folder.
You can embed a canvas in a note using the same way as embedding notes and other files. To do that, use internal link prefixed with an exclamation mark (!):
![[My canvas.canvas]]
To adjust the height of an embedded canvas, add a vertical bar (|) followed by the length of the height:
![[My canvas.canvas|500]]
By default, the height will be adjusted to 300. Therefore, ![[My canvas.canvas]] has the same result as ![[My canvas.canvas|300]].
For quick adjustment, you can drag the bottom side of the embedded canvas, or hold it for a moment first on touchscreen device, to adjust the height.
[!NOTE]
This drag-to-resize approach only applies to canvas embedded within note in editing view.
The title of an embedded canvas is located at the top of the embed, prefixed with canvas icon ().
By default, the title is the name of the canvas file. To change it, add a vertical bar (|) followed by the replacement title:
![[My canvas.canvas|My diagram]]
If you want to change the title while also adjusting the height, place the replacement title first then the height, separated by vertical bar (|):
![[My canvas.canvas|My diagram|500]]
You can also hide the title globally by disabling it under Settings → Better Embedded Canvas → Show canvas title.
You can embed single card in a note instead of the whole canvas. To do that, add a hash (#) at the end of the link destination, followed by the card id:
![[My canvas.canvas#00b6cc18e01988a6]]
You can adjust the title and the height by adding them after the card id.
With custom title:
![[My canvas.canvas#00b6cc18e01988a6|My card]]
You can embed a canvas or single card
With adjusted height:
![[My canvas.canvas#00b6cc18e01988a6|500]]
With both:
![[My canvas.canvas#00b6cc18e01988a6|My card|500]]
You can change how the card embed should be displayed:
Searching and typing card id manually can be very inconvinient. Therefore, Better Embedded Canvas provides autocompletion for that. To use autocompletion:
#) at the end of the link destination (as mentioned before). Autocompletion popover will be shown right after that.[!NOTE]
Autocompletion suggests text and group cards only.
[!NOTE]
Group card is suffixed with group icon (
) in autocompletion popover.

You can embed a canvas or single card in a note via hotkey and command:
Especially for mobile user, you can add them as options in the mobile toolbar.
You can drag the title of an embedded canvas, then you can drop it on a tab header to open the canvas there, into an editor to insert it as a link, or into a canvas view to embed it as a card.

You can embed a canvas in another canvas using the same way as adding a card from a note.
To embed a canvas from your vault:
You can also embed a canvas from the canvas context menu:
You can also drag a canvas from the File explorer, or an embedded canvas from a note, into another canvas.
[!WARNING]
By default, embedding interactive canvas inside another canvas is disabled due to performance issue, especially when you have a lot of cards that show embedded canvases. If you still want this feature, you can enable it under Settings → Better Embedded Canvas → Nested canvas. See this section.

You can preview a canvas by hovering the cursor over an internal link to the canvas in Editing view, File explorer, Search, and more. The behavior of the preview depends on Page preview plugin.
[!NOTE]
To preview a canvas, you first need to enable Page preview plugin.

You can interact with an embedded canvas the way interacting with a canvas view, with some limitations.
[!NOTE]
Embedded canvas is set to read-only. Therefore, you cannot add, delete, edit, or move cards and connection lines. To do that, open canvas view instead.
To select single card or cards, you can use any of the following approaches:
To scroll the content of a card, you first need to select it.
[!NOTE]
You cannot use Ctrl A (or Cmd A on macOS) to select all cards.
To pan an embedded canvas, you can use any of the following approaches:
To zoom an embedded manually, press Space or Ctrl (or Cmd on macOS) and scroll using the mouse wheel. Or, select Zoom in () and Zoom out (
) from the zoom controls in the upper-right corner.
To zoom the canvas so that every item is visible, select Zoom to fit () from the zoom controls in the upper-right corner.
To zoom the canvas so that all selected items are visible, right-click selected card or cards and then select Zoom to selection.
To change the zoom level back to the default, select Reset zoom () from the zoom controls in the upper-right corner.
When interaction is disabled, the embedded canvas will prevent user from interacting with the canvas, including selecting cards, panning, and zooming.
To toggle interaction, select pointing hand icon () in the upper-right corner. This will toggle interaction globally and save the current interaction state.
To open an embedded canvas in canvas view, select Open canvas () in the upper-right corner.

Embedded canvas includes some of Advanced Canvas' notable features (you need to enable Advanced Canvas plugin):
However, some of other features collide with Better Embedded Canvas' features:
In the case of collided features, Better Embedded Canvas takes precedence over Advanced Canvas. This is simply because those collided features, i.e. single card embed and autocompletion, includes enhancement that Advanced Canvas does not have.
Nevertheless, you can have Better Embedded Canvas and Advanced Canvas enabled simultaneously without expecting significant conflicts.
[!NOTE]
Sometimes, right after enabling or disabling any of Better Embedded Canvas and Advanced Canvas, you will get a notification to reload all notes or to restart the app. It should only happen once until you enable or disable any of those two plugins.
Multiple canvases can be embedded within one another like a tree structure, something like this:
A.canvas --> B.canvas
\
--> C.canvas --> D.canvas --> E.canvas
\ \
\ --> F.canvas --> G.canvas
\
--> A.md --> B.md --> H.canvas
\
--> I.canvas
When you have such massive structure in your canvas, you will likely have significant performance impact due to frequent changes made within the DOM.
You have two methods to solve this:
From the example above:
B.canvas and C.canvas that will be displayed as interactive canvases.D.canvas and I.canvas will also be displayed as interactive canvases.This plugin includes some of the type definitions developed by Michael Naumov, Fevol, and the others at Obsidian Typings, with some adjustments. All their works are licensed under MIT.
Thanks to: