Chart edits (ops)
An op is one edit to a chart, written as a small JSON object. The editor makes the same edits when you click through its panels, so what you can do there you can do with ops.
On this page
- How to send ops
- Type and layout
- setType
- setVariants
- Which columns are charted
- setMapping
- autoMap
- Steps
- addTransform
- updateTransform
- removeTransform
- moveTransform
- Text
- setTitle
- setSubtitle
- Axes
- setAxis
- Legend and labels
- setLegend
- setLabels
- Colors and look
- setCanvas
- setFont
- setPalette
- setSeriesStyle
- setMarkStyle
- applyTheme
- Data cells
- setData
- updateCell
- insertRows
- deleteRows
- insertColumn
- deleteColumn
- renameColumn
- setColumnKind
- reorderColumns
How to send ops
Send a list of ops to edit a chart, or include them as ops when you create one. They are applied in order, and all together or not at all. If one op is wrong, the answer is invalid_ops, it says which op and why, and the chart is left as it was.
An op changes only what it names. {"op":"setTitle","title":{"text":"Sales"}} sets the title's text and leaves its size, color and position alone. A field that is not part of the op is an error.
Columns, steps and roles
Ops refer to a column by its id, not its name. Ids look like c1, c2, c3, in the order the columns were read. Renaming a column does not change its id. Get the chart to see its columns and their ids.
A step is a sort, a filter or another change to what is charted that leaves the data itself alone. Steps have ids too: t1, t2 and so on, in the order they were added.
A role is the part a column plays in the chart. On a bar chart, category is the column of labels and values are the columns of numbers. Each chart type has its own roles: list the chart types to see them.
The examples
The examples on this page are written for one chart: a bar chart with three columns, c1 (Month), c2 (Sales) and c3 (Costs), and two steps, t1 (a sort) and t2 (a filter). To try them, make that chart first:
{
"type": "bar",
"data": "Month,Sales,Costs\nJan,4200,3100\nFeb,5100,3300\nMar,4800,3900\nApr,6300,4100",
"ops": [
{
"op": "addTransform",
"transform": {
"type": "sort",
"column": "c2",
"direction": "desc"
}
},
{
"op": "addTransform",
"transform": {
"type": "filter",
"column": "c2",
"op": "gt",
"value": 1000
}
}
]
}Under each op, "Fields" lists what it takes, and "From the catalog" is the compact form that AI assistants read, which you can also get from the op catalog endpoint.
The catalog also names setAdvanced, which sets raw chart options. The API does not take it.
Type and layout
setType
Change the chart type. The data, the roles and the style carry over.
{
"op": "setType",
"type": "line"
}Fields
| Field | Type |
|---|---|
typerequired | "bar" | "line" | "pie" | "scatter" | "histogram" | "boxplot" | "dotplot" | "sankey" | "radar" | "heatmap" |
From the catalog
{"op":"setType","type":"bar|line|pie|scatter|histogram|boxplot|dotplot|sankey|radar|heatmap"}: data, mapping and style carry over.setVariants
Set the options that belong to one chart type. Only the options you name change.
{
"op": "setVariants",
"variants": {
"bar": {
"orientation": "horizontal",
"stack": "stacked"
}
}
}Fields
| Field | Type |
|---|---|
variantsrequired | object |
variants.baroptional | object |
variants.bar.orientationoptional | "vertical" | "horizontal" |
variants.bar.stackoptional | "none" | "stacked" | "percent" |
variants.lineoptional | object |
variants.line.areaoptional | boolean |
variants.line.stepoptional | boolean |
variants.line.stackoptional | "none" | "stacked" | "percent" |
variants.line.smoothoptional | number, 0 to 1 |
variants.pieoptional | object |
variants.pie.donutoptional | boolean |
variants.pie.innerRadiusPctoptional | number, 10 to 90 |
variants.scatteroptional | object |
variants.scatter.bubbleoptional | boolean |
variants.scatter.trendlineoptional | boolean |
variants.scatter.showR2optional | boolean |
variants.histogramoptional | object |
variants.histogram.binModeoptional | "auto" | "count" | "width" |
variants.histogram.binsoptional | integer, 1 to 200 |
variants.histogram.binWidthoptional | number, over 0 |
variants.boxplotoptional | object |
variants.boxplot.quartileMethodoptional | "exclusive" | "inclusive" |
variants.boxplot.showOutliersoptional | boolean |
variants.dotplotoptional | object |
variants.dotplot.markeroptional | "dot" | "x" |
variants.sankeyoptional | object |
variants.sankey.orientoptional | "horizontal" | "vertical" |
variants.radaroptional | object |
variants.radar.maxoptional | number, over 0 or null |
variants.heatmapoptional | object |
variants.heatmap.scaleoptional | "sequential" | "diverging" |
From the catalog
{"op":"setVariants","variants":{"<type>":{...}}}: options per type:
bar {orientation:"vertical"|"horizontal", stack:"none"|"stacked"|"percent"}
line {area:bool, step:bool, stack:"none"|"stacked"|"percent", smooth:0..1}
pie {donut:bool, innerRadiusPct:10..90}
scatter {bubble:bool, trendline:bool, showR2:bool}
histogram {binMode:"auto"|"count"|"width", bins:1..200, binWidth:>0}
boxplot {quartileMethod:"exclusive"|"inclusive", showOutliers:bool} (exclusive = "Textbook", inclusive = "Excel")
dotplot {marker:"dot"|"x"}
sankey {orient:"horizontal"|"vertical"}
radar {max:number|null}
heatmap {scale:"sequential"|"diverging"}Which columns are charted
setMapping
Say which column plays which role. Roles you leave out stay as they are, and null clears one.
{
"op": "setMapping",
"mapping": {
"category": "c1",
"values": [
"c2",
"c3"
]
}
}Fields
| Field | Type |
|---|---|
mappingrequired | object |
mapping.categoryoptional | string or null |
mapping.valuesoptional | array of strings |
mapping.valueoptional | string or null |
mapping.xoptional | string or null |
mapping.yoptional | string or null |
mapping.sizeoptional | string or null |
mapping.groupoptional | string or null |
mapping.sourceoptional | string or null |
mapping.targetoptional | string or null |
From the catalog
{"op":"setMapping","mapping":{"category":"c1","values":["c2","c3"]}}: roles per type:
bar/line/radar: category + values[] pie: category + value scatter: x, y, size?, group?
histogram/boxplot/dotplot: value, group? sankey: source, target, value heatmap: x, y, valueautoMap
Let Chartjuice pick the roles again from the data.
{
"op": "autoMap"
}From the catalog
{"op":"autoMap"}: let Chartjuice pick sensible roles again.Steps
addTransform
Add a step: a sort, filter, top N, total, pivot or calculated column. Steps change what is charted without changing the data.
{
"op": "addTransform",
"transform": {
"type": "topN",
"column": "c2",
"n": 3,
"otherLabel": "Other"
}
}Fields
| Field | Type |
|---|---|
transformrequired | one of: filter, sort, aggregate, pivot, unpivot, topN, derive |
transform (filter).columnrequired | string |
transform (filter).oprequired | "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "contains" | "notEmpty" |
transform (filter).valueoptional | any |
transform (sort).columnrequired | string |
transform (sort).directionrequired | "asc" | "desc" |
transform (aggregate).groupByrequired | array of strings |
transform (aggregate).measuresrequired | array of objects |
transform (aggregate).measures[].columnrequired | string |
transform (aggregate).measures[].fnrequired | "sum" | "avg" | "count" | "min" | "max" | "median" |
transform (pivot).indexrequired | string |
transform (pivot).columnsrequired | string |
transform (pivot).valuesrequired | string |
transform (pivot).fnrequired | "sum" | "avg" | "count" | "min" | "max" | "median" |
transform (unpivot).idColumnsrequired | array of strings |
transform (unpivot).nameColumnrequired | string |
transform (unpivot).valueColumnrequired | string |
transform (topN).columnrequired | string |
transform (topN).nrequired | integer, at least 1 |
transform (topN).otherLabeloptional | string |
transform (derive).namerequired | string |
transform (derive).expressionrequired | string |
atoptional | integer, at least 0 |
From the catalog
{"op":"addTransform","transform":{...},"at"?:index}
{"type":"sort","column":"c2","direction":"asc"|"desc"} (desc = largest first: the left bar, or the top bar when bars are horizontal)
{"type":"filter","column":"c1","op":"eq|neq|gt|gte|lt|lte|contains|notEmpty","value"?:string|number}
{"type":"topN","column":"c2","n":5,"otherLabel"?:"Other"} (keeps the largest n and sums the rest into one more row, otherLabel: n 5 gives 6 bars or slices)
{"type":"aggregate","groupBy":["c1"],"measures":[{"column":"c2","fn":"sum|avg|count|min|max|median"}]}
{"type":"pivot","index":"c1","columns":"c2","values":"c3","fn":"sum"}
{"type":"unpivot","idColumns":["c1"],"nameColumn":"Series","valueColumn":"Value"}
{"type":"derive","name":"Profit","expression":"[Revenue] - [Costs]"} (+ - * / and parentheses; [Column Name] references)updateTransform
Replace a step, by its id.
{
"op": "updateTransform",
"id": "t1",
"transform": {
"type": "sort",
"column": "c3",
"direction": "asc"
}
}Fields
| Field | Type |
|---|---|
idrequired | string |
transformrequired | one of: filter, sort, aggregate, pivot, unpivot, topN, derive |
transform (filter).columnrequired | string |
transform (filter).oprequired | "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "contains" | "notEmpty" |
transform (filter).valueoptional | any |
transform (sort).columnrequired | string |
transform (sort).directionrequired | "asc" | "desc" |
transform (aggregate).groupByrequired | array of strings |
transform (aggregate).measuresrequired | array of objects |
transform (aggregate).measures[].columnrequired | string |
transform (aggregate).measures[].fnrequired | "sum" | "avg" | "count" | "min" | "max" | "median" |
transform (pivot).indexrequired | string |
transform (pivot).columnsrequired | string |
transform (pivot).valuesrequired | string |
transform (pivot).fnrequired | "sum" | "avg" | "count" | "min" | "max" | "median" |
transform (unpivot).idColumnsrequired | array of strings |
transform (unpivot).nameColumnrequired | string |
transform (unpivot).valueColumnrequired | string |
transform (topN).columnrequired | string |
transform (topN).nrequired | integer, at least 1 |
transform (topN).otherLabeloptional | string |
transform (derive).namerequired | string |
transform (derive).expressionrequired | string |
From the catalog
{"op":"updateTransform","id":"t1","transform":{...}}, {"op":"removeTransform","id":"t1"}, {"op":"moveTransform","id":"t1","to":0}removeTransform
Remove a step, by its id.
{
"op": "removeTransform",
"id": "t2"
}Fields
| Field | Type |
|---|---|
idrequired | string |
From the catalog
{"op":"updateTransform","id":"t1","transform":{...}}, {"op":"removeTransform","id":"t1"}, {"op":"moveTransform","id":"t1","to":0}moveTransform
Move a step to a new place in the order. Positions count from 0.
{
"op": "moveTransform",
"id": "t2",
"to": 0
}Fields
| Field | Type |
|---|---|
idrequired | string |
torequired | integer, at least 0 |
From the catalog
{"op":"updateTransform","id":"t1","transform":{...}}, {"op":"removeTransform","id":"t1"}, {"op":"moveTransform","id":"t1","to":0}Text
setTitle
Set the title: its text, whether it shows, where it sits and how it looks.
{
"op": "setTitle",
"title": {
"text": "Sales and costs",
"align": "center",
"style": {
"size": "XL",
"bold": true
}
}
}Fields
| Field | Type |
|---|---|
titlerequired | object |
title.showoptional | boolean |
title.textoptional | string |
title.alignoptional | "left" | "center" | "right" |
title.verticaloptional | "top" | "bottom" |
title.styleoptional | object |
title.style.sizeoptional | "XS" | "S" | "M" | "L" | "XL" | "XXL" or number, 6 to 200 |
title.style.coloroptional | string |
title.style.boldoptional | boolean |
title.style.italicoptional | boolean |
From the catalog
{"op":"setTitle","title":{"show"?:bool,"text"?:str,"align"?:"left|center|right","vertical"?:"top|bottom","style"?:TextStyle}}setSubtitle
Set the line under the title.
{
"op": "setSubtitle",
"subtitle": {
"show": true,
"text": "January to April"
}
}Fields
| Field | Type |
|---|---|
subtitlerequired | object |
subtitle.showoptional | boolean |
subtitle.textoptional | string |
subtitle.styleoptional | object |
subtitle.style.sizeoptional | "XS" | "S" | "M" | "L" | "XL" | "XXL" or number, 6 to 200 |
subtitle.style.coloroptional | string |
subtitle.style.boldoptional | boolean |
subtitle.style.italicoptional | boolean |
From the catalog
{"op":"setSubtitle","subtitle":{"show"?:bool,"text"?:str,"style"?:TextStyle}}Axes
setAxis
Change one axis: its title, labels and their number format, gridlines, line, ticks and range.
{
"op": "setAxis",
"axis": "y",
"patch": {
"title": {
"show": true,
"text": "US dollars"
},
"labels": {
"format": {
"prefix": "$",
"compact": true
}
}
}
}Fields
| Field | Type |
|---|---|
axisrequired | "x" | "y" |
patchrequired | object |
patch.titleoptional | object |
patch.title.showoptional | boolean |
patch.title.textoptional | string |
patch.title.styleoptional | object |
patch.title.style.sizeoptional | "XS" | "S" | "M" | "L" | "XL" | "XXL" or number, 6 to 200 |
patch.title.style.coloroptional | string |
patch.title.style.boldoptional | boolean |
patch.title.style.italicoptional | boolean |
patch.labelsoptional | object |
patch.labels.showoptional | boolean |
patch.labels.styleoptional | object |
patch.labels.style.sizeoptional | "XS" | "S" | "M" | "L" | "XL" | "XXL" or number, 6 to 200 |
patch.labels.style.coloroptional | string |
patch.labels.style.boldoptional | boolean |
patch.labels.style.italicoptional | boolean |
patch.labels.formatoptional | object |
patch.labels.format.decimalsoptional | integer, 0 to 10 or null |
patch.labels.format.prefixoptional | string |
patch.labels.format.suffixoptional | string |
patch.labels.format.thousandsoptional | boolean |
patch.labels.format.compactoptional | boolean |
patch.gridlinesoptional | object |
patch.gridlines.showoptional | boolean |
patch.gridlines.coloroptional | string |
patch.lineoptional | object |
patch.line.showoptional | boolean |
patch.ticksoptional | object |
patch.ticks.showoptional | boolean |
patch.minoptional | any |
patch.maxoptional | any |
patch.boundaryGapoptional | boolean |
From the catalog
{"op":"setAxis","axis":"x"|"y","patch":{"title"?:{"show","text","style"},"labels"?:{"show","style","format"},"gridlines"?:{"show","color"},"line"?:{"show"},"ticks"?:{"show"},"min"?:number|null,"max"?:number|null,"boundaryGap"?:bool}}Legend and labels
setLegend
Show or hide the legend, and place it.
{
"op": "setLegend",
"legend": {
"show": true,
"position": {
"x": "right",
"y": "top"
},
"orient": "vertical"
}
}Fields
| Field | Type |
|---|---|
legendrequired | object |
legend.showoptional | boolean or "auto" |
legend.positionoptional | object |
legend.position.xoptional | "left" | "center" | "right" |
legend.position.yoptional | "top" | "middle" | "bottom" |
legend.orientoptional | "horizontal" | "vertical" |
legend.paddingoptional | number, 0 to 200 |
legend.styleoptional | object |
legend.style.sizeoptional | "XS" | "S" | "M" | "L" | "XL" | "XXL" or number, 6 to 200 |
legend.style.coloroptional | string |
legend.style.boldoptional | boolean |
legend.style.italicoptional | boolean |
From the catalog
{"op":"setLegend","legend":{"show"?:true|false|"auto","position"?:{"x":"left|center|right","y":"top|middle|bottom"},"orient"?:"horizontal|vertical","padding"?:px,"style"?:TextStyle}}setLabels
Show the values on the marks, and format them.
{
"op": "setLabels",
"labels": {
"show": true,
"position": "top",
"format": {
"prefix": "$",
"thousands": true
}
}
}Fields
| Field | Type |
|---|---|
labelsrequired | object |
labels.showoptional | boolean |
labels.positionoptional | "inside" | "outside" | "top" | "center" |
labels.styleoptional | object |
labels.style.sizeoptional | "XS" | "S" | "M" | "L" | "XL" | "XXL" or number, 6 to 200 |
labels.style.coloroptional | string |
labels.style.boldoptional | boolean |
labels.style.italicoptional | boolean |
labels.formatoptional | object |
labels.format.decimalsoptional | integer, 0 to 10 or null |
labels.format.prefixoptional | string |
labels.format.suffixoptional | string |
labels.format.thousandsoptional | boolean |
labels.format.compactoptional | boolean |
labels.showPercentoptional | boolean |
From the catalog
{"op":"setLabels","labels":{"show"?:bool,"position"?:"inside|outside|top|center","showPercent"?:bool,"style"?:TextStyle,"format"?:NumberFormat}} (showPercent: pie only)Colors and look
setCanvas
Set the chart's size in pixels, its background and its padding. An empty background is transparent.
{
"op": "setCanvas",
"canvas": {
"width": 1200,
"height": 675,
"background": "#FFFFFF"
}
}Fields
| Field | Type |
|---|---|
canvasrequired | object |
canvas.widthoptional | number, 100 to 4,000 |
canvas.heightoptional | number, 100 to 4,000 |
canvas.backgroundoptional | string |
canvas.paddingoptional | object |
canvas.padding.topoptional | number, 0 to 400 |
canvas.padding.rightoptional | number, 0 to 400 |
canvas.padding.bottomoptional | number, 0 to 400 |
canvas.padding.leftoptional | number, 0 to 400 |
From the catalog
{"op":"setCanvas","canvas":{"width"?:px,"height"?:px,"background"?:"#hex" or "" for transparent,"padding"?:{"top","right","bottom","left"}}}setFont
Set the font and the default text color for the whole chart.
{
"op": "setFont",
"font": {
"family": "Bitter",
"color": "#102A43"
}
}Fields
| Field | Type |
|---|---|
fontrequired | object |
font.familyoptional | "Inter" | "Bitter" | "IBM Plex Mono" |
font.coloroptional | string |
From the catalog
{"op":"setFont","font":{"family"?:"Inter|Bitter|IBM Plex Mono","color"?:"#hex"}}setPalette
Set the colors series take, in order.
{
"op": "setPalette",
"palette": [
"#0F766E",
"#F59E0B",
"#E11D48"
]
}Fields
| Field | Type |
|---|---|
paletterequired | array of strings |
From the catalog
{"op":"setPalette","palette":["#0C008C","#5D55FA",…]}: series colors in order. Named presets (Ocean, Pastel, …): lookup_docs "palettes".setSeriesStyle
Give one series its own color or legend name. Null goes back to the palette's color or the column's name.
{
"op": "setSeriesStyle",
"column": "c3",
"color": "#E11D48",
"name": "Running costs"
}Fields
| Field | Type |
|---|---|
columnrequired | string |
coloroptional | string or null |
nameoptional | any |
From the catalog
{"op":"setSeriesStyle","column":"c2","color"?:"#hex"|null,"name"?:str|null}: one series' color or legend name.setMarkStyle
Style the marks themselves: bars, lines, points, slices and so on.
{
"op": "setMarkStyle",
"marks": {
"bar": {
"radius": 6,
"opacity": 0.9
}
}
}Fields
| Field | Type |
|---|---|
marksrequired | object |
marks.baroptional | object |
marks.bar.radiusoptional | number, 0 to 40 |
marks.bar.opacityoptional | number, 0 to 1 |
marks.lineoptional | object |
marks.line.widthoptional | number, 0 to 12 |
marks.line.symboloptional | "none" | "emptyCircle" | "circle" | "square" | "triangle" | "diamond" |
marks.line.symbolSizeoptional | number, 0 to 30 |
marks.line.symbolColoroptional | string or null |
marks.areaoptional | object |
marks.area.opacityoptional | number, 0 to 1 |
marks.area.gradientoptional | boolean |
marks.pieoptional | object |
marks.pie.radiusPctoptional | number, 10 to 100 |
marks.pie.offsetXoptional | number, -50 to 50 |
marks.pie.labelLinesoptional | boolean |
marks.scatteroptional | object |
marks.scatter.symboloptional | "none" | "emptyCircle" | "circle" | "square" | "triangle" | "diamond" |
marks.scatter.sizeoptional | number, 2 to 60 |
marks.scatter.opacityoptional | number, 0 to 1 |
marks.histogramoptional | object |
marks.histogram.gapoptional | number, 0 to 60 |
marks.boxplotoptional | object |
marks.boxplot.widthoptional | number, 10 to 200 |
marks.dotplotoptional | object |
marks.dotplot.sizeoptional | number, 4 to 40 |
marks.sankeyoptional | object |
marks.sankey.nodeWidthoptional | number, 4 to 60 |
marks.sankey.nodeGapoptional | number, 2 to 60 |
marks.sankey.linkOpacityoptional | number, 0 to 1 |
marks.radaroptional | object |
marks.radar.shapeoptional | "polygon" | "circle" |
marks.radar.fillOpacityoptional | number, 0 to 1 |
marks.heatmapoptional | object |
marks.heatmap.colorsoptional | array of strings |
marks.heatmap.showValuesoptional | boolean |
From the catalog
{"op":"setMarkStyle","marks":{"<mark>":{...}}}:
bar {radius:0..40, opacity:0..1} line {width:0..12, symbol:"none|emptyCircle|circle|square|triangle|diamond", symbolSize:0..30, symbolColor:"#hex"|null}
area {opacity:0..1, gradient:bool} pie {radiusPct:10..100, offsetX:-50..50, labelLines:bool}
scatter {symbol, size:2..60, opacity:0..1} histogram {gap:0..60} boxplot {width:10..200} dotplot {size:4..40}
sankey {nodeWidth:4..60, nodeGap:2..60, linkOpacity:0..1} radar {shape:"polygon|circle", fillOpacity:0..1}
heatmap {colors:["#low","#high"] or ["#low","#mid","#high"], showValues:bool}applyTheme
Apply a ready-made set of colors to the whole chart.
{
"op": "applyTheme",
"theme": "midnight"
}Fields
| Field | Type |
|---|---|
themerequired | "juice" | "midnight" | "minimal" |
From the catalog
{"op":"applyTheme","theme":"juice|midnight|minimal"}Data cells
setData
Replace the whole table from inside a list of ops. To send CSV or JSON rows, use the replace data endpoint, which reads types for you.
{
"op": "setData",
"data": {
"columns": [
{
"id": "c1",
"name": "City",
"kind": "text"
},
{
"id": "c2",
"name": "People",
"kind": "number"
}
],
"rows": [
[
"Oslo",
700000
],
[
"Bergen",
290000
]
]
}
}Fields
| Field | Type |
|---|---|
datarequired | object |
data.columnsrequired | array of objects |
data.columns[].idrequired | string |
data.columns[].namerequired | string |
data.columns[].kindrequired | "text" | "number" | "date" |
data.rowsrequired | array of (array of anys) |
remapoptional | boolean |
From the catalog
{"op":"setData","data":{"columns":[{"id":"c1","name":"Month","kind":"text"},…],"rows":[[…],…]}}: replaces the whole table; only when the user asks for new or example data.updateCell
Change one cell. Rows count from 0.
{
"op": "updateCell",
"row": 0,
"column": "c2",
"value": 4500
}Fields
| Field | Type |
|---|---|
rowrequired | integer, at least 0 |
columnrequired | string |
valuerequired | any |
From the catalog
{"op":"updateCell","row":0,"column":"c2","value":42} (rows are 0-based)insertRows
Add rows at a position. Each row has one value per column.
{
"op": "insertRows",
"at": 4,
"rows": [
[
"May",
7100,
4300
]
]
}Fields
| Field | Type |
|---|---|
atrequired | integer, at least 0 |
rowsrequired | array of (array of anys) |
From the catalog
{"op":"insertRows","at":3,"rows":[["Jul",5100]]}, {"op":"deleteRows","at":3,"count":1}deleteRows
Remove rows, starting at a position.
{
"op": "deleteRows",
"at": 0,
"count": 1
}Fields
| Field | Type |
|---|---|
atrequired | integer, at least 0 |
countrequired | integer, at least 1 |
From the catalog
{"op":"insertRows","at":3,"rows":[["Jul",5100]]}, {"op":"deleteRows","at":3,"count":1}insertColumn
Add a column at a position, with its values if you have them.
{
"op": "insertColumn",
"at": 3,
"name": "Target",
"kind": "number",
"values": [
4000,
5000,
5000,
6000
]
}Fields
| Field | Type |
|---|---|
atrequired | integer, at least 0 |
namerequired | string |
kindrequired | "text" | "number" | "date" |
valuesoptional | array of anys |
From the catalog
{"op":"insertColumn","at":2,"name":"Target","kind":"number|text|date","values"?:[…]}, {"op":"deleteColumn","column":"c3"}deleteColumn
Remove a column. It is taken out of the roles too.
{
"op": "deleteColumn",
"column": "c3"
}Fields
| Field | Type |
|---|---|
columnrequired | string |
From the catalog
{"op":"insertColumn","at":2,"name":"Target","kind":"number|text|date","values"?:[…]}, {"op":"deleteColumn","column":"c3"}renameColumn
Rename a column. Its id stays the same.
{
"op": "renameColumn",
"column": "c2",
"name": "Revenue"
}Fields
| Field | Type |
|---|---|
columnrequired | string |
namerequired | string |
From the catalog
{"op":"renameColumn","column":"c2","name":"Revenue"}, {"op":"setColumnKind","column":"c1","kind":"date"}, {"op":"reorderColumns","order":["c2","c1"]}setColumnKind
Say whether a column holds text, numbers or dates.
{
"op": "setColumnKind",
"column": "c1",
"kind": "text"
}Fields
| Field | Type |
|---|---|
columnrequired | string |
kindrequired | "text" | "number" | "date" |
From the catalog
{"op":"renameColumn","column":"c2","name":"Revenue"}, {"op":"setColumnKind","column":"c1","kind":"date"}, {"op":"reorderColumns","order":["c2","c1"]}reorderColumns
Put the columns in a new order. Name every column once.
{
"op": "reorderColumns",
"order": [
"c1",
"c3",
"c2"
]
}Fields
| Field | Type |
|---|---|
orderrequired | array of strings |
From the catalog
{"op":"renameColumn","column":"c2","name":"Revenue"}, {"op":"setColumnKind","column":"c1","kind":"date"}, {"op":"reorderColumns","order":["c2","c1"]}