Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/coastalwhite/WasmSVGGraphics
/ functions
Functions
78 in github.com/coastalwhite/WasmSVGGraphics
⨍
Functions
78
◇
Types & classes
3
↓ 31 callers
Function
circle
Creates a default circle with a certain radius
src/default.rs:6
↓ 22 callers
Function
add_svg_parent
()
tests/web.rs:16
↓ 11 callers
Method
render_named
Render a named figure at a location (this will automatically add a definition when needed) One can use named-figures for later adjustments, e.g. updat
src/renderer.rs:492
↓ 10 callers
Function
get_document
()
src/lib.rs:96
↓ 8 callers
Method
get_svg_root
Will return the svg root
src/renderer.rs:82
↓ 7 callers
Method
create_named_container
Creates a new named container in the parent # Arguments `name` - Name of the named container used for later reference `parent` - Name a container, wh
src/renderer.rs:1088
↓ 7 callers
Method
get_named_container
Will retrieve the web_sys element of a named container
src/renderer.rs:185
↓ 6 callers
Method
append_to_container
Appends a figure to a named container # Arguments `name` - The name of either a named container `figure` - [Figure](../figures/struct.Figure.html) ob
src/renderer.rs:917
↓ 6 callers
Function
as_point_2d
(point: (i32, i32))
src/default.rs:71
↓ 5 callers
Method
add_def
Adds a def to the binary tree
src/renderer.rs:122
↓ 5 callers
Method
contains_figure
Returns whether the renderer already has a definition for the shape
src/renderer.rs:112
↓ 5 callers
Method
contains_id
Returns whether the renderer already has a definition for the shape
src/renderer.rs:117
↓ 5 callers
Method
define_render
Define a figure and return it's hash, this hash can later be used for rendering # Arguments `figure` - [Figure](../figures/struct.Figure.html) object
src/renderer.rs:605
↓ 5 callers
Method
does_name_exist
Will return if a certain name exists and therefore cannot be used for a declaration. # Arguments 'name' - Name to check # Examples ```rust,no_run us
src/renderer.rs:1060
↓ 5 callers
Function
to_html
(svg_elem: &SVGElem)
src/lib.rs:108
↓ 4 callers
Method
add_use_to
Will add a use element to a named container
src/renderer.rs:260
↓ 4 callers
Method
render
Render figure at a location (this will automatically add a definition when needed) # Arguments `figure` - [Figure](../figures/struct.Figure.html) obj
src/renderer.rs:445
↓ 4 callers
Function
set_circle_loc
Sets the location of SVG Circle (for non circles use [set_loc](#set_loc))
src/default.rs:67
↓ 3 callers
Method
clear_named_container
Clears all figures/containers within a named container, but does not clear up definitions. # Arguments `container_name` - The name of the container t
src/renderer.rs:701
↓ 3 callers
Method
create_use
Creates a use element from a def_id and location
src/renderer.rs:135
↓ 3 callers
Function
get_document
()
tests/web.rs:10
↓ 3 callers
Method
move_named
Moves a named figure to a given location # Arguments `name` - Name of the named figure to move `loc` - Location to move the figure to # Examples ```
src/renderer.rs:1133
↓ 2 callers
Method
add_named_use
Will add a use element to the root svg with a name
src/renderer.rs:241
↓ 2 callers
Method
add_use
Will add a use element to the root svg
src/renderer.rs:231
↓ 2 callers
Method
adjust_use_to
Adjust a named use to another figure
src/renderer.rs:276
↓ 2 callers
Function
create_element_ns
(namespace: &str, name: &str)
src/lib.rs:102
↓ 2 callers
Method
create_id_string
Creates a new id string from name
src/renderer.rs:149
↓ 2 callers
Function
curve
Creates a default curve with control points 1 and 2 and an end point
src/default.rs:27
↓ 2 callers
Method
delete_named
Deletes a named item from the DOM and from internal entries. But will not delete definitions # Arguments `name` - Name of item to delete # Examples
src/renderer.rs:999
↓ 2 callers
Method
get_named_item
Will retrieve the web_sys element of a named container
src/renderer.rs:210
↓ 2 callers
Method
hide_named
Hides a named item in the DOM, this can be undone by the [show_named](#method.show_named) method. # Arguments `name` - Name of item to hide # Exampl
src/renderer.rs:845
↓ 2 callers
Method
render_id
Render figure from a previously added definition at a location (this will automatically add a definition when needed) # Arguments `figure_id` - 8 byt
src/renderer.rs:529
↓ 1 callers
Method
adjust_viewbox
Adjusts the viewbox of the svg # Arguments `x` - The top-left x-coordinate of the viewbox `y` - The top-left y-coordinate of the viewbox `width` - Th
src/renderer.rs:1211
↓ 1 callers
Method
append_to_container_with_id
Appends a figure from id to a named container # Arguments `name` - The name of either a named container `figure_id` - id of Figure definition used wh
src/renderer.rs:961
↓ 1 callers
Method
clear
Clears all elements within the SVG element and clears all internal definitions. Basically reinits the renderer. # Examples ```rust,no_run use wasm_sv
src/renderer.rs:642
↓ 1 callers
Method
delete_use
Deletes a use element
src/renderer.rs:324
↓ 1 callers
Method
get_defs_root
Will return the defs element
src/renderer.rs:96
↓ 1 callers
Method
get_root
Will return the parent of the svg
src/renderer.rs:73
↓ 1 callers
Method
is_container
Will return whether a given name is used for a named container, instead of a pure figure # Arguments `name` - Name to check # Note Will output false
src/renderer.rs:1185
↓ 1 callers
Method
render_named_id
Render named figure from a previously added definition at a location (this will automatically add a definition when needed) # Arguments `name` - Name
src/renderer.rs:570
↓ 1 callers
Method
show_named
Shows a named item in the DOM, this undoes the [hide_named](#method.hide_named) method. # Arguments `name` - Name of item to show # Examples ```rust
src/renderer.rs:880
↓ 1 callers
Method
update_named
Updates a named container or figure to either contain the passed figure or become the passed figure, respectively. # Arguments `name` - The name of e
src/renderer.rs:738
↓ 1 callers
Method
update_named_with_id
Updates a named container or figure to either contain the passed figure or become the passed figure from the id, respectively. # Arguments `name` - T
src/renderer.rs:798
Method
description
(&self)
src/errors.rs:31
Method
fmt
(&self, f: &mut fmt::Formatter)
src/errors.rs:56
Method
get_hash
(figure: &SVGElem)
src/renderer.rs:58
Method
get_id_of_figure
(id_hash: u64)
src/renderer.rs:180
Method
get_id_of_named
Will convert a id hash into a HTML id Attribute
src/renderer.rs:176
Function
lib_simple_colored_smiley
()
tests/web.rs:74
Function
lib_simple_smiley
()
tests/web.rs:56
Function
lib_simple_test
()
tests/web.rs:39
Method
new
Create new renderer object # Arguments `dom_root_id` - The HTMl Attribute ID of the parent element of to be created SVG
src/renderer.rs:358
Method
new_from_svg
Creates renderer object from svg element # Note This function will panic if the root of the `svg_elem` is not a TagName::Svg # Arguments `dom_root_i
src/renderer.rs:393
Function
polygon
Creates a polygon from a vector of points
src/default.rs:48
Function
rect
Creates a default rectangle with a certain width and height
src/default.rs:17
Function
renderer_adjust_viewbox
()
tests/web.rs:522
Function
renderer_append_to_container
()
tests/web.rs:351
Function
renderer_append_to_container_with_id
()
tests/web.rs:373
Function
renderer_clear
()
tests/web.rs:196
Function
renderer_clear_named_container
()
tests/web.rs:219
Function
renderer_create_named_container
()
tests/web.rs:456
Function
renderer_define_render
()
tests/web.rs:177
Function
renderer_delete_named
()
tests/web.rs:394
Function
renderer_does_named_exist
()
tests/web.rs:418
Function
renderer_hide_named
()
tests/web.rs:305
Function
renderer_is_container
()
tests/web.rs:498
Function
renderer_move_named
()
tests/web.rs:476
Function
renderer_named_id
()
tests/web.rs:154
Function
renderer_render
()
tests/web.rs:98
Function
renderer_render_id
()
tests/web.rs:136
Function
renderer_render_named
()
tests/web.rs:114
Function
renderer_show_named
()
tests/web.rs:326
Function
renderer_update_named
()
tests/web.rs:252
Function
renderer_update_named_with_id
()
tests/web.rs:278
Function
set_loc
Sets the location of SVG elem (for circles use [set_circle_loc](#set_circle_loc))
src/default.rs:62
Method
set_view_box
sets the viewbox
src/renderer.rs:41
Method
source
(&self)
src/errors.rs:50
Method
to_def
(figure: SVGElem)
src/renderer.rs:66