https://github.com/nextbitlabs/plotter
Plotter is a web component that plots functions graphs.
https://github.com/nextbitlabs/plotter
functions graphs math plotter webcomponent
Last synced: 6 months ago
JSON representation
Plotter is a web component that plots functions graphs.
- Host: GitHub
- URL: https://github.com/nextbitlabs/plotter
- Owner: nextbitlabs
- Created: 2019-10-15T07:52:12.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-10T17:52:31.000Z (about 6 years ago)
- Last Synced: 2025-04-10T01:46:44.135Z (9 months ago)
- Topics: functions, graphs, math, plotter, webcomponent
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
Plotter
-------
## Schema
The schema is inspired by D3 and it is designed with the following goals in mind:
* The data model should describe a list of one or more of states.
* Each state describes one or more visual elements, like lines and points. Elements are useful to draw one or more mathematical functions, possibly with included (or excluded) points and labels.
* Elements are identified by ids, so that we can recognize the same element on different states and trigger transitions if needed. We may use the enter/update/exit pattern.
```
// a list of states
[
{...},
...
]
```
Each `state` has the following structure:
```
{
id: "state1", // State id, optional
description: "" // State description, optional
xInterval: [0, 1],
yInterval: [0, 1],
elements: [ // The order of elements determines the stack.
{
id: "e1" // Element id
type: "line", // Element type
data: [
{
x: 0.1,
y: 0.3
},
...
],
},
{
id: "e2"
type: "points",
data: [
{
x: 0.2,
y: 0.4,
label: "a label", // Optional
included: false // Optional, defaults to true
},
...
]
},
...
]
}
```