MCPcopy Create free account

hub / github.com/coastalwhite/WasmSVGGraphics / functions

Functions78 in github.com/coastalwhite/WasmSVGGraphics

↓ 31 callersFunctioncircle
Creates a default circle with a certain radius
src/default.rs:6
↓ 22 callersFunctionadd_svg_parent
()
tests/web.rs:16
↓ 11 callersMethodrender_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 callersFunctionget_document
()
src/lib.rs:96
↓ 8 callersMethodget_svg_root
Will return the svg root
src/renderer.rs:82
↓ 7 callersMethodcreate_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 callersMethodget_named_container
Will retrieve the web_sys element of a named container
src/renderer.rs:185
↓ 6 callersMethodappend_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 callersFunctionas_point_2d
(point: (i32, i32))
src/default.rs:71
↓ 5 callersMethodadd_def
Adds a def to the binary tree
src/renderer.rs:122
↓ 5 callersMethodcontains_figure
Returns whether the renderer already has a definition for the shape
src/renderer.rs:112
↓ 5 callersMethodcontains_id
Returns whether the renderer already has a definition for the shape
src/renderer.rs:117
↓ 5 callersMethoddefine_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 callersMethoddoes_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 callersFunctionto_html
(svg_elem: &SVGElem)
src/lib.rs:108
↓ 4 callersMethodadd_use_to
Will add a use element to a named container
src/renderer.rs:260
↓ 4 callersMethodrender
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 callersFunctionset_circle_loc
Sets the location of SVG Circle (for non circles use [set_loc](#set_loc))
src/default.rs:67
↓ 3 callersMethodclear_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 callersMethodcreate_use
Creates a use element from a def_id and location
src/renderer.rs:135
↓ 3 callersFunctionget_document
()
tests/web.rs:10
↓ 3 callersMethodmove_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 callersMethodadd_named_use
Will add a use element to the root svg with a name
src/renderer.rs:241
↓ 2 callersMethodadd_use
Will add a use element to the root svg
src/renderer.rs:231
↓ 2 callersMethodadjust_use_to
Adjust a named use to another figure
src/renderer.rs:276
↓ 2 callersFunctioncreate_element_ns
(namespace: &str, name: &str)
src/lib.rs:102
↓ 2 callersMethodcreate_id_string
Creates a new id string from name
src/renderer.rs:149
↓ 2 callersFunctioncurve
Creates a default curve with control points 1 and 2 and an end point
src/default.rs:27
↓ 2 callersMethoddelete_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 callersMethodget_named_item
Will retrieve the web_sys element of a named container
src/renderer.rs:210
↓ 2 callersMethodhide_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 callersMethodrender_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 callersMethodadjust_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 callersMethodappend_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 callersMethodclear
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 callersMethoddelete_use
Deletes a use element
src/renderer.rs:324
↓ 1 callersMethodget_defs_root
Will return the defs element
src/renderer.rs:96
↓ 1 callersMethodget_root
Will return the parent of the svg
src/renderer.rs:73
↓ 1 callersMethodis_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 callersMethodrender_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 callersMethodshow_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 callersMethodupdate_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 callersMethodupdate_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
Methoddescription
(&self)
src/errors.rs:31
Methodfmt
(&self, f: &mut fmt::Formatter)
src/errors.rs:56
Methodget_hash
(figure: &SVGElem)
src/renderer.rs:58
Methodget_id_of_figure
(id_hash: u64)
src/renderer.rs:180
Methodget_id_of_named
Will convert a id hash into a HTML id Attribute
src/renderer.rs:176
Functionlib_simple_colored_smiley
()
tests/web.rs:74
Functionlib_simple_smiley
()
tests/web.rs:56
Functionlib_simple_test
()
tests/web.rs:39
Methodnew
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
Methodnew_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
Functionpolygon
Creates a polygon from a vector of points
src/default.rs:48
Functionrect
Creates a default rectangle with a certain width and height
src/default.rs:17
Functionrenderer_adjust_viewbox
()
tests/web.rs:522
Functionrenderer_append_to_container
()
tests/web.rs:351
Functionrenderer_append_to_container_with_id
()
tests/web.rs:373
Functionrenderer_clear
()
tests/web.rs:196
Functionrenderer_clear_named_container
()
tests/web.rs:219
Functionrenderer_create_named_container
()
tests/web.rs:456
Functionrenderer_define_render
()
tests/web.rs:177
Functionrenderer_delete_named
()
tests/web.rs:394
Functionrenderer_does_named_exist
()
tests/web.rs:418
Functionrenderer_hide_named
()
tests/web.rs:305
Functionrenderer_is_container
()
tests/web.rs:498
Functionrenderer_move_named
()
tests/web.rs:476
Functionrenderer_named_id
()
tests/web.rs:154
Functionrenderer_render
()
tests/web.rs:98
Functionrenderer_render_id
()
tests/web.rs:136
Functionrenderer_render_named
()
tests/web.rs:114
Functionrenderer_show_named
()
tests/web.rs:326
Functionrenderer_update_named
()
tests/web.rs:252
Functionrenderer_update_named_with_id
()
tests/web.rs:278
Functionset_loc
Sets the location of SVG elem (for circles use [set_circle_loc](#set_circle_loc))
src/default.rs:62
Methodset_view_box
sets the viewbox
src/renderer.rs:41
Methodsource
(&self)
src/errors.rs:50
Methodto_def
(figure: SVGElem)
src/renderer.rs:66