Skip to content

Commit

Permalink
Consistently refer to mermaid source as 'diagrams', fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
christhekeele committed Oct 13, 2024
1 parent 3f6b667 commit c193820
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions assets/packs/mermaid/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import "./main.css";

mermaid.initialize({ startOnLoad: false });

export function init(ctx, {graph, caption, download}) {
export function init(ctx, {diagram, caption, download}) {
ctx.importCSS("main.css")

function render() {
mermaid.render("graph1", graph).then(({ svg, bindFunctions }) => {
mermaid.render("diagram", diagram).then(({ svg, bindFunctions }) => {
let contents = document.createElement("div");
contents.id = "contents";
ctx.root.appendChild(contents);
Expand Down
6 changes: 3 additions & 3 deletions lib/kino/shorts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ defmodule Kino.Shorts do
def text(text), do: Kino.Text.new(text)

@doc ~S'''
Renders Mermaid graphs.
Renders Mermaid diagrams.
It is a wrapper around `Kino.Mermaid.new/1`.
Expand All @@ -178,8 +178,8 @@ defmodule Kino.Shorts do
C-->D;
""")
'''
@spec mermaid(String.t()) :: Kino.Mermaid.t()
def mermaid(mermaid), do: Kino.Mermaid.new(mermaid)
@spec mermaid(String.t(), Keyword.t()) :: Kino.Mermaid.t()
def mermaid(diagram, options \\ []), do: Kino.Mermaid.new(diagram, options)

@doc """
A placeholder for static outputs that can be dynamically updated.
Expand Down
2 changes: 1 addition & 1 deletion test/kino/process_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ defmodule Kino.ProcessTest do
send(Kino.JS.DataStore, {:connect, self(), %{origin: "client:#{inspect(self())}", ref: ref}})
assert_receive {:connect_reply, data, %{ref: ^ref}}

data
data.diagram
end

defp supervision_tree_with_ets_table do
Expand Down

0 comments on commit c193820

Please sign in to comment.