Releases: dataliterate/data-populator
v1.2.1: hierarchical data
v1.2.0: "join" function
FIXED
- "Populate with JSON" now remembers the folder where you last picked a JSON file
NEW
- "join" function (for enumeration)
Imagine you want to concatenate the keys name, price, date and time seperated by a ·
(interpunct/middle dot). Usually, you would create a string in a Text Layer like this:
{name} · {price} · {date} · {time}
This works great as long as you have data for each key – like:
CursusId.jpeg · $1993.33 · 3.12.2014 · 2:29 PM
But now imagine there's no data (or substitute) for price and time. Which would lead to:
CursusId.jpeg · · 3.12.2014 ·
That's why there's now a "join" function with the following syntax to be used inside a {placeholder}:
{name,price,date,time|& · }
- comma separated list of keys
|
&
followed by a delimiter, eg.·
or,
(put spaces where you need them!)
So in our above mentioned example, without data (or substitutes) for price and time, it renders like this:
CursusId.jpeg · 3.12.2014
To try it out, randomly populate the Text Layers in "join-function-demo.sketch" with "enumeration.json".
v1.1.1
v1.1.0: Create grid, handling missing data
Improvements
- Updated "demo.sketch" and Demo Presets Data
New Features
- Creating grids from selected elements (Layer Groups or Artboards) and populate them in one go (Layout Options)
- Handling missing data with optional substitutes for Text Layers (see "demo.sketch" for examples)
{placeholder}
inserts an empty string if no data are available for placeholder{placeholder?}
uses the default substitute (can be set in plugin dialog){placeholder?substitute}
uses the custom substitute you append
- Handling missing data for Images and SVGs (if no image or SVG, it will turn off the fill and turn it on again if there's data available when re-populating – see "demo.sketch" for examples)
"Layout Options" and subsitutes handling
More documentation will follow soon.
v1.0.7
v1.0.6
v1.0.5: repopulate text placeholders
- Original text string including placeholders is now saved on the layer and allows the text to be repopulated again as many times as needed - The original selection of layers is restored after populating so that it's possible to quickly 'shuffle' between data. For example, select the layers to populate, then keep running 'Populate Again' (with random setting turned on) until the data is the one you want.
v1.0.4
v1.0.3: SVG icon placeholders
To add an icon placeholder: - Create a shape group (rectangle, oval, a flattened shape, etc) and set any of its properties as desired (all properties will apply to the final icon once populated) - Name the shape group layer such as {{sample_icon}} (double curly brackets must be used to indicate an icon placeholder) - Specify the path to the SVG icon in your data, for example, "sample_icon": "assets/icons/sample_icon.svg" NOTES: - Icons must be in SVG format, preferably flattened into a single layer. If the icon is not flattened, union boolean operation will be applied to it upon import to merge it into a single layer. - Importing many SVGs into Sketch can take a while. If you need to populate many icon placeholders, make sure you wait until the icons appear (it can take more than 5 seconds with hundreds of icons)