Formatting Grunt objects: The powerful world of modifiers

When we created Grunt, we tried to write the app we wish we'd had when we were working as consultants and bankers ourselves. We wanted a tool that made it really easy to create advanced visualizations, and wanted it to be dynamic, so that when your client gave you new information, or you got some new data, you could just put that into your model, and the design in your presentation would update accordingly.

To achieve those goals, there's a major philosophy that runs through the entirety of how Grunt works. Whenever you want to add formatting to anything made in Grunt, you'll use modifiers. You can think of a modifier as a simple rule that states how your object should look. Modifiers are able to change the appearance of an object in a multitude of ways – they can make slight alterations to your object or change the visual style of your object completely.

Examples of modifiers and how they change your objects

There is a large number of modifiers available that can transform and format your data. The following list is a small extract to exemplify what modifiers can do.

  • The Fill modifier is a simple modifier that is able to change the the fill color / background color of your objects. When you apply a fill modifier you will see a single setting where you are able to change the color of your objects.

  • The Fill conditional modifier (discrete) is a more advanced modifier that also changes the fill color of objects. You can use this modifier instead of the fill modifier. Rather than choosing a static color, this modifier lets you select conditions that maps to colors. E.g. you can say that all cells with a value equal to some figure should receive a specific fill color.

  • The Character style modifier enables you to change how your text looks. With this modifier, you can set the font family, font size or font color (in addition to various other text settings).

  • The Shape modifier completely transforms the visual style of your input. The modifier wraps your data inside a shape of your desire. You can select the type, color and size of the shape. This can be used to create a more visually pleasing design.

All together modifiers can change nearly all properties of your objects. There might be multiple modifiers that target the same properties, but they will likely work in different ways (thus allowing you to get your job done the way that works best for you). It is also possible to combine modifiers in creative ways to create great looking designs.

Go to the modifier overview to see the entire list of modifiers and what they can do.

Advantages of modifiers

Modifiers are simple rules that transforms the look and feel of your object. This can be compared to the traditional method of applying some formatting directly to your text and objects. So what are the main advantages of using modifiers compared to static formatting?

  • Modifiers work in a non-destructive way. The settings of a single modifier can be changed and updated whenever you would like, also long after you first applied the modifier.

  • Modifiers can do powerful transformations of your data, e.g. converting numerical data to visual gauges like Harvey balls or even convert your data to fully fledged charts.

  • Modifiers are separate from your data, which means that you can update your data without having to think of applying all the formatting over again. With modifiers, data and formatting are two separate things, with all the advantages that follow.

  • Modifiers can be targeted to specific parts of your objects, either based on structural conditions or on data contingencies. These means that you efficiently can style different parts of your objects in the same way.

  • Modifiers can be data dependent, e.g. to say that all graphical shapes containing some value should get a red background color, or that all words matching a specific search term should be displayed as bold text.

  • Modifiers can be reused. If you have applied a modifier to your objects and want to copy that style to another object, you can just copy the modifier(s) and apply them to the new object.

  • Modifiers ensures consistency. Past are the days when you needed to manually ensure that you had updated all your formatting. Now you can change the setting of a modifier and ensure that the updates are propagated everywhere you would like.

  • Modifiers gives you great overview of all the formatting that is applied to your objects. It is like a time-machine where you immediately can access all the formatting that has been done previously.

  • Modifiers can be turned on/off whenever you would like, which can be useful if you want to see the effect of the individual modifiers.

Compared to the traditional way of applying static and destructive formatting, modifiers is a much more pleasant way to work with your formatting. It brings a lot of power, and simultaneously makes it easier to format your objects.


Last updated: January 21, 2019 10:19