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

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

FieldType
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

FieldType
variantsrequiredobject
variants.baroptionalobject
variants.bar.orientationoptional"vertical" | "horizontal"
variants.bar.stackoptional"none" | "stacked" | "percent"
variants.lineoptionalobject
variants.line.areaoptionalboolean
variants.line.stepoptionalboolean
variants.line.stackoptional"none" | "stacked" | "percent"
variants.line.smoothoptionalnumber, 0 to 1
variants.pieoptionalobject
variants.pie.donutoptionalboolean
variants.pie.innerRadiusPctoptionalnumber, 10 to 90
variants.scatteroptionalobject
variants.scatter.bubbleoptionalboolean
variants.scatter.trendlineoptionalboolean
variants.scatter.showR2optionalboolean
variants.histogramoptionalobject
variants.histogram.binModeoptional"auto" | "count" | "width"
variants.histogram.binsoptionalinteger, 1 to 200
variants.histogram.binWidthoptionalnumber, over 0
variants.boxplotoptionalobject
variants.boxplot.quartileMethodoptional"exclusive" | "inclusive"
variants.boxplot.showOutliersoptionalboolean
variants.dotplotoptionalobject
variants.dotplot.markeroptional"dot" | "x"
variants.sankeyoptionalobject
variants.sankey.orientoptional"horizontal" | "vertical"
variants.radaroptionalobject
variants.radar.maxoptionalnumber, over 0 or null
variants.heatmapoptionalobject
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

FieldType
mappingrequiredobject
mapping.categoryoptionalstring or null
mapping.valuesoptionalarray of strings
mapping.valueoptionalstring or null
mapping.xoptionalstring or null
mapping.yoptionalstring or null
mapping.sizeoptionalstring or null
mapping.groupoptionalstring or null
mapping.sourceoptionalstring or null
mapping.targetoptionalstring 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, value

autoMap

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

FieldType
transformrequiredone of: filter, sort, aggregate, pivot, unpivot, topN, derive
transform (filter).columnrequiredstring
transform (filter).oprequired"eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "contains" | "notEmpty"
transform (filter).valueoptionalany
transform (sort).columnrequiredstring
transform (sort).directionrequired"asc" | "desc"
transform (aggregate).groupByrequiredarray of strings
transform (aggregate).measuresrequiredarray of objects
transform (aggregate).measures[].columnrequiredstring
transform (aggregate).measures[].fnrequired"sum" | "avg" | "count" | "min" | "max" | "median"
transform (pivot).indexrequiredstring
transform (pivot).columnsrequiredstring
transform (pivot).valuesrequiredstring
transform (pivot).fnrequired"sum" | "avg" | "count" | "min" | "max" | "median"
transform (unpivot).idColumnsrequiredarray of strings
transform (unpivot).nameColumnrequiredstring
transform (unpivot).valueColumnrequiredstring
transform (topN).columnrequiredstring
transform (topN).nrequiredinteger, at least 1
transform (topN).otherLabeloptionalstring
transform (derive).namerequiredstring
transform (derive).expressionrequiredstring
atoptionalinteger, 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

FieldType
idrequiredstring
transformrequiredone of: filter, sort, aggregate, pivot, unpivot, topN, derive
transform (filter).columnrequiredstring
transform (filter).oprequired"eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "contains" | "notEmpty"
transform (filter).valueoptionalany
transform (sort).columnrequiredstring
transform (sort).directionrequired"asc" | "desc"
transform (aggregate).groupByrequiredarray of strings
transform (aggregate).measuresrequiredarray of objects
transform (aggregate).measures[].columnrequiredstring
transform (aggregate).measures[].fnrequired"sum" | "avg" | "count" | "min" | "max" | "median"
transform (pivot).indexrequiredstring
transform (pivot).columnsrequiredstring
transform (pivot).valuesrequiredstring
transform (pivot).fnrequired"sum" | "avg" | "count" | "min" | "max" | "median"
transform (unpivot).idColumnsrequiredarray of strings
transform (unpivot).nameColumnrequiredstring
transform (unpivot).valueColumnrequiredstring
transform (topN).columnrequiredstring
transform (topN).nrequiredinteger, at least 1
transform (topN).otherLabeloptionalstring
transform (derive).namerequiredstring
transform (derive).expressionrequiredstring

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

FieldType
idrequiredstring

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

FieldType
idrequiredstring
torequiredinteger, 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

FieldType
titlerequiredobject
title.showoptionalboolean
title.textoptionalstring
title.alignoptional"left" | "center" | "right"
title.verticaloptional"top" | "bottom"
title.styleoptionalobject
title.style.sizeoptional"XS" | "S" | "M" | "L" | "XL" | "XXL" or number, 6 to 200
title.style.coloroptionalstring
title.style.boldoptionalboolean
title.style.italicoptionalboolean

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

FieldType
subtitlerequiredobject
subtitle.showoptionalboolean
subtitle.textoptionalstring
subtitle.styleoptionalobject
subtitle.style.sizeoptional"XS" | "S" | "M" | "L" | "XL" | "XXL" or number, 6 to 200
subtitle.style.coloroptionalstring
subtitle.style.boldoptionalboolean
subtitle.style.italicoptionalboolean

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

FieldType
axisrequired"x" | "y"
patchrequiredobject
patch.titleoptionalobject
patch.title.showoptionalboolean
patch.title.textoptionalstring
patch.title.styleoptionalobject
patch.title.style.sizeoptional"XS" | "S" | "M" | "L" | "XL" | "XXL" or number, 6 to 200
patch.title.style.coloroptionalstring
patch.title.style.boldoptionalboolean
patch.title.style.italicoptionalboolean
patch.labelsoptionalobject
patch.labels.showoptionalboolean
patch.labels.styleoptionalobject
patch.labels.style.sizeoptional"XS" | "S" | "M" | "L" | "XL" | "XXL" or number, 6 to 200
patch.labels.style.coloroptionalstring
patch.labels.style.boldoptionalboolean
patch.labels.style.italicoptionalboolean
patch.labels.formatoptionalobject
patch.labels.format.decimalsoptionalinteger, 0 to 10 or null
patch.labels.format.prefixoptionalstring
patch.labels.format.suffixoptionalstring
patch.labels.format.thousandsoptionalboolean
patch.labels.format.compactoptionalboolean
patch.gridlinesoptionalobject
patch.gridlines.showoptionalboolean
patch.gridlines.coloroptionalstring
patch.lineoptionalobject
patch.line.showoptionalboolean
patch.ticksoptionalobject
patch.ticks.showoptionalboolean
patch.minoptionalany
patch.maxoptionalany
patch.boundaryGapoptionalboolean

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

FieldType
legendrequiredobject
legend.showoptionalboolean or "auto"
legend.positionoptionalobject
legend.position.xoptional"left" | "center" | "right"
legend.position.yoptional"top" | "middle" | "bottom"
legend.orientoptional"horizontal" | "vertical"
legend.paddingoptionalnumber, 0 to 200
legend.styleoptionalobject
legend.style.sizeoptional"XS" | "S" | "M" | "L" | "XL" | "XXL" or number, 6 to 200
legend.style.coloroptionalstring
legend.style.boldoptionalboolean
legend.style.italicoptionalboolean

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

FieldType
labelsrequiredobject
labels.showoptionalboolean
labels.positionoptional"inside" | "outside" | "top" | "center"
labels.styleoptionalobject
labels.style.sizeoptional"XS" | "S" | "M" | "L" | "XL" | "XXL" or number, 6 to 200
labels.style.coloroptionalstring
labels.style.boldoptionalboolean
labels.style.italicoptionalboolean
labels.formatoptionalobject
labels.format.decimalsoptionalinteger, 0 to 10 or null
labels.format.prefixoptionalstring
labels.format.suffixoptionalstring
labels.format.thousandsoptionalboolean
labels.format.compactoptionalboolean
labels.showPercentoptionalboolean

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

FieldType
canvasrequiredobject
canvas.widthoptionalnumber, 100 to 4,000
canvas.heightoptionalnumber, 100 to 4,000
canvas.backgroundoptionalstring
canvas.paddingoptionalobject
canvas.padding.topoptionalnumber, 0 to 400
canvas.padding.rightoptionalnumber, 0 to 400
canvas.padding.bottomoptionalnumber, 0 to 400
canvas.padding.leftoptionalnumber, 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

FieldType
fontrequiredobject
font.familyoptional"Inter" | "Bitter" | "IBM Plex Mono"
font.coloroptionalstring

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

FieldType
paletterequiredarray 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

FieldType
columnrequiredstring
coloroptionalstring or null
nameoptionalany

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

FieldType
marksrequiredobject
marks.baroptionalobject
marks.bar.radiusoptionalnumber, 0 to 40
marks.bar.opacityoptionalnumber, 0 to 1
marks.lineoptionalobject
marks.line.widthoptionalnumber, 0 to 12
marks.line.symboloptional"none" | "emptyCircle" | "circle" | "square" | "triangle" | "diamond"
marks.line.symbolSizeoptionalnumber, 0 to 30
marks.line.symbolColoroptionalstring or null
marks.areaoptionalobject
marks.area.opacityoptionalnumber, 0 to 1
marks.area.gradientoptionalboolean
marks.pieoptionalobject
marks.pie.radiusPctoptionalnumber, 10 to 100
marks.pie.offsetXoptionalnumber, -50 to 50
marks.pie.labelLinesoptionalboolean
marks.scatteroptionalobject
marks.scatter.symboloptional"none" | "emptyCircle" | "circle" | "square" | "triangle" | "diamond"
marks.scatter.sizeoptionalnumber, 2 to 60
marks.scatter.opacityoptionalnumber, 0 to 1
marks.histogramoptionalobject
marks.histogram.gapoptionalnumber, 0 to 60
marks.boxplotoptionalobject
marks.boxplot.widthoptionalnumber, 10 to 200
marks.dotplotoptionalobject
marks.dotplot.sizeoptionalnumber, 4 to 40
marks.sankeyoptionalobject
marks.sankey.nodeWidthoptionalnumber, 4 to 60
marks.sankey.nodeGapoptionalnumber, 2 to 60
marks.sankey.linkOpacityoptionalnumber, 0 to 1
marks.radaroptionalobject
marks.radar.shapeoptional"polygon" | "circle"
marks.radar.fillOpacityoptionalnumber, 0 to 1
marks.heatmapoptionalobject
marks.heatmap.colorsoptionalarray of strings
marks.heatmap.showValuesoptionalboolean

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

FieldType
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

FieldType
datarequiredobject
data.columnsrequiredarray of objects
data.columns[].idrequiredstring
data.columns[].namerequiredstring
data.columns[].kindrequired"text" | "number" | "date"
data.rowsrequiredarray of (array of anys)
remapoptionalboolean

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

FieldType
rowrequiredinteger, at least 0
columnrequiredstring
valuerequiredany

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

FieldType
atrequiredinteger, at least 0
rowsrequiredarray 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

FieldType
atrequiredinteger, at least 0
countrequiredinteger, 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

FieldType
atrequiredinteger, at least 0
namerequiredstring
kindrequired"text" | "number" | "date"
valuesoptionalarray 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

FieldType
columnrequiredstring

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

FieldType
columnrequiredstring
namerequiredstring

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

FieldType
columnrequiredstring
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

FieldType
orderrequiredarray of strings

From the catalog

{"op":"renameColumn","column":"c2","name":"Revenue"}, {"op":"setColumnKind","column":"c1","kind":"date"}, {"op":"reorderColumns","order":["c2","c1"]}