Skip to content

Commit

Permalink
Document draw-row-header.
Browse files Browse the repository at this point in the history
  • Loading branch information
brunchboy committed Mar 28, 2020
1 parent 9615383 commit 682bc36
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
27 changes: 26 additions & 1 deletion doc/modules/ROOT/pages/funcs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,32 @@ related cells. You can change those defaults using
[[draw-row-header]]
== draw-row-header

> TODO: Document
Generates the label in the left margin which identifies the starting
address of a row.

TIP: You generally don’t need to call this yourself, because it is
called automatically whenever boxes you are drawing wrap onto a
new row. But you can call it if you are drawing a single-row diagram
and still want the row header to be present.

.Arguments
[source,clojure]
----
[labels]
[labels attr-spec]
----

Defaults to a `:font-size` of 11 and `:font-family` of `"Courier New,
monospace"` but these can be overridden, and other
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute[SVG text
attributes]) can be supplied, through an
<<attrs#attribute-expressions,attribute expression>> in `attr-spec`.

In the most common case, `label` is a string and the SVG text object
is constructed as described above. If you need to draw a more complex
structure, you can pass in your own SVG text object (with potentially
nested `tspan` objects), and it will simply be positioned.


[[eval-attribute-spec]]
== eval-attribute-spec
Expand Down
5 changes: 2 additions & 3 deletions src/org/deepsymmetry/bytefield/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,8 @@
(defn draw-row-header
"Generates the label in the left margin which identifies the starting
byte of a row. Defaults to a `:font-size` of 11 and `:font-family`
of \"Courier New\" but these can be overridden as well. Other SVG
text attributes can be supplied via `attr-spec`, and they will be
passed along.
of \"Courier New, monospace\" but these can be overridden, and other
SVG text attributes can be supplied via `attr-spec`.
In the most common case, `label` is a string and the SVG text object
is constructed as described above. If you need to draw a more
Expand Down

0 comments on commit 682bc36

Please sign in to comment.