https://github.com/jusexton/imbue-web
Web service exposing the imbue framework functionality
https://github.com/jusexton/imbue-web
rocket-rs rust
Last synced: 8 months ago
JSON representation
Web service exposing the imbue framework functionality
- Host: GitHub
- URL: https://github.com/jusexton/imbue-web
- Owner: jusexton
- Created: 2021-11-30T07:49:42.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-03-10T10:00:17.000Z (over 2 years ago)
- Last Synced: 2025-04-13T13:09:01.543Z (about 1 year ago)
- Topics: rocket-rs, rust
- Language: Rust
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Imbue Web

Lightning quick dataset imbuing web service for making sure your data is ready for presentation!
## How it Works
1. Provide the dataset that needs to be "imbued" and fill in the missing data.
2. Provide a strategy on how the missing data should be populated.
```json
{
"strategy": "zeroed | last_known | average",
"dataset": [
{
"x": 0,
"y": 5.5
},
{
"x": 4,
"y": 12
},
{
"x": 7,
"y": 54.72
}
]
}
```
## Strategies
### Zeroed
Creates missing data points with 0 y value.
Input:
```json
{
"strategy": "zeroed",
"dataset": [
{
"x": 1,
"y": 1
},
{
"x": 5,
"y": 10
}
]
}
```
Output:
```json
{
"dataset": [
{
"x": 2.0,
"y": 0.0
},
{
"x": 3.0,
"y": 0.0
},
{
"x": 4.0,
"y": 0.0
}
]
}
```
### Last Known
Creates missing data points with the last known y value.
Input:
```json
{
"strategy": "last_known",
"dataset": [
{
"x": 1,
"y": 1
},
{
"x": 5,
"y": 10
}
]
}
```
Output:
```json
{
"dataset": [
{
"x": 2.0,
"y": 1.0
},
{
"x": 3.0,
"y": 1.0
},
{
"x": 4.0,
"y": 1.0
}
]
}
```
### Average
Creates missing data points with an average y value between the last known data point and the next known data point. If
multiple points are missing, the y values will be adjusted to smoothly approach the next known y value.
Input:
```json
{
"strategy": "average",
"dataset": [
{
"x": 1,
"y": 1
},
{
"x": 5,
"y": 10
}
]
}
```
Output:
```json
{
"dataset": [
{
"x": 2.0,
"y": 3.25
},
{
"x": 3.0,
"y": 5.5
},
{
"x": 4.0,
"y": 7.75
}
]
}
```