Skip to content

Releases: dataliterate/data-populator

v1.2.1: hierarchical data

30 Aug 10:49
Compare
Choose a tag to compare

Now allows the use of hierarchical data/nested objects in JSON. Thank you, @CallMeSH!

Also see #6. we're currently still thinking about a way to map hierarchical data to Sketch layer hierarchy.

v1.2.0: "join" function

30 Jul 21:03
Compare
Choose a tag to compare

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|& · }

  1. comma separated list of keys
  2. |
  3. & 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

Here's an animated example:
join-enumeration

To try it out, randomly populate the Text Layers in "join-function-demo.sketch" with "enumeration.json".

v1.1.1

28 Jul 16:05
Compare
Choose a tag to compare
  • added custom icon for plugin dialog
  • updated plugin documentation (README)
  • allow comma in grid settings (rows, columns and margins)

v1.1.0: Create grid, handling missing data

17 Jul 14:26
Compare
Choose a tag to compare

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

16 Jul 21:20
Compare
Choose a tag to compare

More documentation will follow soon.

v1.0.7

16 Jul 20:49
Compare
Choose a tag to compare
fixed switching to last page after populating

v1.0.6

16 Jul 20:41
Compare
Choose a tag to compare
restore placeholders command

v1.0.5: repopulate text placeholders

16 Jul 20:39
Compare
Choose a tag to compare
- 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

16 Jul 20:38
Compare
Choose a tag to compare
place an image or SVG

v1.0.3: SVG icon placeholders

16 Jul 20:37
Compare
Choose a tag to compare
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)