Crates.io | plotapi |
lib.rs | plotapi |
version | 0.1.1 |
source | src |
created_at | 2022-09-01 00:34:03.436908 |
updated_at | 2022-12-11 08:43:25.528752 |
description | Engaging visualisations, made easy. |
homepage | https://plotapi.com |
repository | http://github.com/shahinrostami/plotapi_rs |
max_upload_size | |
id | 656355 |
size | 7,271 |
Key Features • Get Access • Installation • Usage • License
Visit the website to get access to Plotapi.
Get up and running with Rust with the plotapi
crate.
use plotapi::params;
use plotapi::Visualisation;
fn main() {
let names: Vec<String> = vec!["A", "B", "C", "1", "2", "3"]
.into_iter()
.map(String::from)
.collect();
let matrix: Vec<Vec<f64>> = vec![
vec![0.0, 0.0, 0.0, 1.0, 4.0, 1.0],
vec![0.0, 0.0, 0.0, 1.0, 3.0, 2.0],
vec![0.0, 0.0, 0.0, 1.0, 2.0, 2.0],
vec![1.0, 1.0, 1.0, 0.0, 0.0, 0.0],
vec![4.0, 3.0, 2.0, 0.0, 0.0, 0.0],
vec![1.0, 2.0, 2.0, 0.0, 0.0, 0.0],
];
let colors: Vec<String> = vec![
"#7400B8", "#5E60CE", "#5684D6", "#56CFE1", "#64DFDF", "#80FFDB",
]
.into_iter()
.map(String::from)
.collect();
let param = params!({
"matrix": matrix,
"names": names,
"colors": colors
});
Visualisation {
api_key: "17ec2f26-076c-4110-a23a-9a02efe2d52a",
params: param,
endpoint: "chord",
}
.to_html();
}
MIT
plotapi.com · GitHub @shahinrostami · Twitter @shahinrostami · A Polyra innovation