Merge two or more Vizb Datasets.
const url = 'http://127.0.0.1:8080/merge';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"tagAxis":"x","datasets":[{"name":"Sort","tag":"v1","axes":[{"key":"name"},{"key":"y"}],"settings":[{"type":"bar"}],"data":[{"name":"quicksort","yAxis":"12"}]},{"name":"Sort","tag":"v2","axes":[{"key":"name"},{"key":"y"}],"settings":[{"type":"bar"}],"data":[{"name":"quicksort","yAxis":"10"}]}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://127.0.0.1:8080/merge \ --header 'Content-Type: application/json' \ --data '{ "tagAxis": "x", "datasets": [ { "name": "Sort", "tag": "v1", "axes": [ { "key": "name" }, { "key": "y" } ], "settings": [ { "type": "bar" } ], "data": [ { "name": "quicksort", "yAxis": "12" } ] }, { "name": "Sort", "tag": "v2", "axes": [ { "key": "name" }, { "key": "y" } ], "settings": [ { "type": "bar" } ], "data": [ { "name": "quicksort", "yAxis": "10" } ] } ] }'The operation is atomic: every supplied Dataset must be valid and take part in the merge. Server file paths and directory scanning are intentionally not part of this API.
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
Data-owned theme catalog. When non-empty, themes[0] is the active theme. New writers emit themes only; legacy theme is migrated on load.
Fully expanded color theme. On Dataset and convert responses, themes[0] is the active theme when the catalog is non-empty.
object
Theme identifier used by the UI selector.
Categorical series palette.
Continuous gradient pair (exactly two colors).
Legacy single theme name or palette. Migrated into themes when themes is empty; omitted from new output after migration.
object
object
object
object
object
object
Each chart type may appear at most once.
object
object
Examples
Merge two tagged runs and inject tags on the x axis.
{ "tagAxis": "x", "datasets": [ { "name": "Sort", "tag": "v1", "axes": [ { "key": "name" }, { "key": "y" } ], "settings": [ { "type": "bar" } ], "data": [ { "name": "quicksort", "yAxis": "12" } ] }, { "name": "Sort", "tag": "v2", "axes": [ { "key": "name" }, { "key": "y" } ], "settings": [ { "type": "bar" } ], "data": [ { "name": "quicksort", "yAxis": "10" } ] } ]}Responses
Section titled “Responses”Merge succeeded. The response is always an array, including when it contains one Dataset.
object
Data-owned theme catalog. When non-empty, themes[0] is the active theme. New writers emit themes only; legacy theme is migrated on load.
Fully expanded color theme. On Dataset and convert responses, themes[0] is the active theme when the catalog is non-empty.
object
Theme identifier used by the UI selector.
Categorical series palette.
Continuous gradient pair (exactly two colors).
Legacy single theme name or palette. Migrated into themes when themes is empty; omitted from new output after migration.
object
object
object
object
object
object
Each chart type may appear at most once.
object
object
Examples
[ { "name": "Sort", "axes": [ { "key": "name" }, { "key": "x" }, { "key": "y" } ], "settings": [ { "type": "bar" } ], "data": [ { "name": "quicksort", "xAxis": "v1", "yAxis": "12" }, { "name": "quicksort", "xAxis": "v2", "yAxis": "10" } ] }]The request body is not a single valid JSON value.
object
object
JSON Pointer or header/query name.
Example
{ "errors": [ { "location": "body" } ]}The request's Accept header does not allow an operation's selected response media type.
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}The request body exceeds the 10 MiB limit.
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}The request Content-Type is not application/json.
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Valid JSON violates request schema or semantic constraints, or the supplied input cannot be processed.
object
Examples
{ "type": "https://vizb.goptics.org/problems/validation", "title": "Unprocessable content", "status": 422, "detail": "Request validation failed.", "instance": "/merge", "errors": [ { "location": "body", "path": "/tagAxis", "code": "invalid_enum", "message": "tagAxis must be one of name, x, y, or z." } ]}{ "type": "https://vizb.goptics.org/problems/processing", "title": "Input processing failed", "status": 422, "detail": "The selected columns could not be read from the CSV input.", "instance": "/"}An unexpected server-side failure occurred.
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}