Data Sources

Data Sources

Data sources supply variables and styles with values from a table. Each column provides a value, and each row defines a different set of values for a variation of the design.

Use data sources, also known as data merge, to generate artwork variations for export. Open Data Sources from Window -> Styles to manage them.

Import a table from a CSV (comma-separated values), XML, or JSON file, or create it directly in the Data Sources panel.

Link an external data file to update the document when the file’s values change. Use different rows to create variations across canvases or artboards.

For complex values, such as effects or object styles, create the data in Data Sources. Export it as a VectorStyler XML data file, then link to that file.

Data sources support any attribute that can be styled, including numbers, conditions, colors, gradients, shapes, effects, and object styles.

Using Data Sources

Link style and variable definitions to table columns, then choose different rows to create artwork variations.

Use a VectorStyler data format for complex styles such as effects and shapes, because it supports their hierarchical structure. For simple values such as numbers and colors, use CSV or a VectorStyler format.

Variable definition

A CSV file can define basic variables as follows:

[number] width1, [color] color1, [color] color2, [text] text1
12.0, #B6CC66, #FF3939, Green
20.0, #A21E50, #A21E90, Red
16.0, #451EA2, #1E7AA2, Blue

This example defines a number variable, 2 color styles, and a text variable, with 3 sets of values.

Click Import Data in Data Sources to load the CSV. The panel shows the variables and styles with values from the first data row.

Apply the color styles to objects and use width1 for a stroke width. Select another data row to update the artwork with that row’s values.

To see how different styles and variables are stored, create columns in Data Sources and export the collection as a CSV Table.

Data Sources in Repeaters

Apply successive data rows to repeated objects to vary their styles and variables.

Use these options in the Repeater panel menu:

  • Data Source - Choose a data source imported into the document. Its rows supply the repeated objects’ overrides.
  • Data Menu - Choose how rows are assigned to the repeated objects.

Canvas Data Grid

Canvas Data grid Options

Use Canvas -> Canvas Data Grid to repeat a canvas’s first artboard and layer, creating one artboard for each data row. The copies update when the data changes.

Edit the first layer and artboard to change the repeated design. Use Refresh (Command+R) to update the copies afterward.

Create a data source with multiple rows. Build the artwork on one artboard and keep it inside one layer; use sublayers to organize it.

Apply the data source’s styles and variables to the artwork from Data Sources.

Choose the data source from Canvas -> Canvas Data Grid to generate the artboards. To revise the design, edit the first artboard and press Command+R to refresh the rest.

Changing values in Data Sources updates the grid automatically. You can also replace the source with a file that uses the same column names.

Choose Canvas -> Canvas Data Grid -> Options to adjust the grid:

  • Content - Choose a symbol to repeat. If the canvas is empty, use a layer or symbol from a Reference canvas. Default repeats the current canvas’s first layer.
  • Data Source - Choose the data source that supplies overrides for the repeated layers.
  • Horizontal - Set the horizontal spacing between the artboards.
  • Vertical - Set the vertical spacing between the artboards.
  • Vertical First - Set the artboard repetition direction.
  • Locked Copies - Lock the repeated copies of the artwork, to allow editing only on the first artboard.
  • Preview - Preview the canvas grid options.

Exporting

Export artwork once for each data row to generate a set of variations.

In the Export dialog, choose a Data Source from the dropdown. This field appears when the document contains data sources.

Confirm the export to create one version per row, using that row’s styles and variables.

The Data Sources Panel

The Data Sources panel

Open Data Sources from Window - Styles. Click Import Data to load an existing data file.

A document can use several data sources. Each appears as a collection, with its own columns for named variables and styles and rows for alternative values.

Import a file to create a collection, or choose Create New Collection from the panel menu to start with an empty one. In CSV files, the first row contains column names; subsequent rows contain values.

Expand a collection to see its variables and styles, or collapse it to save space when working with several sources.

The panel provides:

  • A list of collections and their variables and styles.
  • Menu commands for importing, exporting, and managing sources.
  • Bottom-row buttons for editing styles and variables.
  • Controls beside Row for managing each collection.
  • An active-row selector that chooses which values the document uses.

The following commands are accessible from the bottom icon row of the panel:

  • Apply style - Apply the selected style to the selected objects.
  • Edit style - Open a dialog to edit the selected style.
  • Rename column - Rename the selected style and its data column.
  • Update style from selection - Update the selected style from the selected object.
  • Create style column - Add a column with a new style, using the selected objects or a default value.
  • Refresh data sources - Update the data sources from the linked file.
  • Remove variable - Remove the selected variable.

The Data Sources panel menu

Each collection has controls beside Row:

  • Choose a named row from Row to activate its styles and variables.
  • Link data file - Link or unlink the data source with an external file.
  • Lock data source - Lock or unlock the data source.
  • Duplicate row - Duplicate the current row in the data source.
  • Remove row - Remove the current row from the data source.
  • Load data file - Load the data source content from a file.
  • Link row to object - Link the current row to the selected object, using the row’s values as style overrides.
  • Previous row - Select the previous data row.
  • Next row - Select the next data row.

The following commands are accessible from the data source panel menu:

  • Style Location - Select the storage location of the edited styles. This can be Document, Canvas or the selected Object.
  • Import Collection - Import a new data source. Same as the Import Data button.
  • Export Collection - Export the collection as CSV, XML, JSON, or a VectorStyler data file. Choose a format that supports the values it contains, especially complex styles.
  • Relink Data File - Relink the data source to another data file and update its content.
  • Create New Collection - Create an empty collection.
  • Remove Collection - Remove the selected data source from the document.
  • Edit Variable - Edit the attributes of the selected style or variable.
  • Create New Style - Create a style or variable with a default value in a new column.
  • Create File Link - Create a variable linked to a graphics file. Use it as object content, or drag it onto the document to create instances of the linked file.
  • Create Color Scheme - Create a color variable derived from another color through a color scheme. The generated tones update when the source color changes.
  • Create Number Variable - Create a new number variable.
  • Create Measurement - Create a new measurement number variable.
  • Create Condition - Create a new condition variable.
  • Create From Selection - Create a new style from the selected objects.
  • Edit Style Name - Edit the selected style or variable name. Also changes the column name associated with the selected variable.
  • Duplicate Data Row - Duplicate the current data row.
  • Remove Data Row - Remove the current data row.
  • Apply to Selection - Apply the selected styles to the selected objects.
  • Assign from Selection - Update the value of the selected styles from the selected objects.
  • Detach Selected - Detach the selected variables from their instance in the document.
  • Replace Style - Replace the selected style with another style in the document.
  • Remove Selected Style - Delete the selected style.
  • Previous Data Row - Activate the previous data row.
  • Next Data Row - Activate the next data row.
  • Copy - Copy the selected styles and variables to the clipboard.
  • Cut - Copy the selected styles and variables to the clipboard, and remove them from the data source.
  • Paste - Paste variables and styles from the clipboard, creating new data source columns.
  • Update Variables - Update the data source content from the linked files.
  • Files - Import and export variables and styles.