1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// SPDX-License-Identifier: Apache-2.0 OR MIT
// Copyright (c) 2025, Harbers Bik LLC
//! # Rendable Trait Module
//!
//! This module defines the [`Rendable`] trait, which provides a unified interface for types that can be rendered as SVG elements with configurable view parameters.
//!
//! Types implementing [`Rendable`] can be composed into SVG documents, have their viewports adjusted, and be rendered to SVG output. The trait supports both required and optional methods, allowing for flexible and extensible rendering logic.
//!
//! ## Features
//! - Abstracts rendering logic for SVG-compatible types
//! - Supports view parameter configuration and adjustment
//! - Enables composition of complex SVG documents from multiple renderable components
//! - Provides optional methods for fine-grained control over view box position and size
use SVG;
use crateViewParameters;
/// A trait for types that can be rendered as SVG elements with configurable view parameters.
///
/// Types implementing `Rendable` can be composed into SVG documents, have their viewports adjusted,
/// and be rendered to SVG output. This trait provides both required and optional methods for
/// interacting with the object's view parameters and rendering logic.
///
/// # Required Methods
/// - [`view_parameters`](Self::view_parameters): Returns the current view parameters for the object.
/// - [`set_view_parameters`](Self::set_view_parameters): Sets the view parameters for the object.
/// - [`render`](Self::render): Renders the object as an SVG element.
///
/// # Optional Methods
/// - [`set_x`](Self::set_x): Sets the x position of the view box.
/// - [`set_y`](Self::set_y): Sets the y position of the view box.
/// - [`width`](Self::width): Returns the width of the view box.
/// - [`height`](Self::height): Returns the height of the view box.
///
/// Implementors can override the optional methods for more efficient or specialized behavior.