Visualize with AWS (Atlassian Forge)

Visualize with AWS (Atlassian Forge) is a Utoolity Labs app for Codegeist 2020 – we are very excited about the prospects of the Atlassian Forge platform and wanted to explore it with a project that helps with our own project and business planning and documentation. Joining the new wave of declarative chart and diagram rendering grammars with the power of AWS based serverless workflow automation to make these rendering engines available to every Jira and Confluence users seemed to check all the boxes.

The first iteration supports Vega and Vega-lite, PlantUML (incl. AWS and C4 modes), Mermaid, Graphviz, BPMN, and for the fun of it we’ve thrown in Svgbob for ASCII graphics. Unfortunately we failed to finish the arguably most important XKCD style rendering engine via Charts.xkcd, something to aspire too

Diagrams can be provided and edited inline, or referenced via URL for more complex ones or dynamically updating charts and diagrams (down the road we want to separate the so far combined visualization and data source declaration) – let’s see how it works:

Registration required

You currently need to be registered to edit and view charts and diagrams via Visualization with AWS – feel free to sign-in with your Atlassian ID so that you can test the app.

Rendering engines and editor support

Refer to https://utoolity.atlassian.net/wiki/spaces/UDEMO/pages/1736212491 for details and links to examples, online playground, and Visual Studio Code extensions.

Relative vs. absolute URLs

Please be aware that many online examples reference the data via relative URLs – to make these work with this app you need to convert the URLs to absolute ones.

How it works – Confluence

In Confluence the app provides a macro via the Macro module:

You can then select from a variety of declarative chart and diagram rendering engines:

You can see in action right here with a small PlantUML example:

A PlantUML use case diagram

Visualize with AWS

Here’s the inline source:

1 2 3 4 5 6 7 8 9 top to bottom direction actor Author actor User rectangle "Visualize with AWS" { Author --> (define diagram) (define diagram) .> (diagram) : renders (diagram) --> User } @enduml

Let’s try something more fancy via the impressive Vega renderer:

A Vega volcano contours visualization

Visualize with AWS

This time I’ve provided the data and diagram as an URL via a Bitbucket Snippet for ease of use, even though it could still be defined via JSON inline in principle:

1 https://bitbucket.org/!api/2.0/snippets/utoolitylabs/MKLe9j/e03ee4996eec6566130666433ae2897f1f384ff8/files/snippet.json
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 { "$schema": "https://vega.github.io/schema/vega/v5.json", "description": "A contour plot of the Maungawhau volcano in New Zealand.", "width": 960, "autosize": "none", "signals": [ { "name": "grid", "init": "data('volcano')[0]" }, { "name": "height", "update": "round(grid.height * width / grid.width)" }, { "name": "smooth", "value": true, "bind": {"input": "radio", "options": [true, false]} } ], "data": [ { "name": "volcano", "url": "https://vega.github.io/vega/data/volcano.json" }, { "name": "contours", "source": "volcano", "transform": [ { "type": "isocontour", "scale": {"expr": "width / datum.width"}, "smooth": {"signal": "smooth"}, "thresholds": {"signal": "sequence(90, 195, 5)"} } ] } ], "scales": [ { "name": "color", "type": "linear", "domain": [90, 190], "range": {"scheme": "blueorange"} } ], "marks": [ { "type": "path", "from": {"data": "contours"}, "encode": { "enter": { "stroke": {"value": "#ccc"}, "strokeWidth": {"value": 1}, "fill": {"scale": "color", "field": "contour.value"} } }, "transform": [ { "type": "geopath", "field": "datum.contour" } ] } ] }

Now that syntax is certainly already a bit complex, which is why the sister project Vega-Lite offers a more concise one too:

A Vega-Lite bubble plot example

Visualize with AWS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 { "$schema": "https://vega.github.io/schema/vega-lite/v4.json", "data": { "url": "https://vega.github.io/vega-lite/examples/data/disasters.csv" }, "width": 600, "height": 400, "transform": [ {"filter": "datum.Entity !== 'All natural disasters'"} ], "mark": { "type": "circle", "opacity": 0.8, "stroke": "black", "strokeWidth": 1 }, "encoding": { "x": { "field": "Year", "type": "ordinal", "axis": {"labelAngle": 0} }, "y": {"field": "Entity", "type": "nominal", "axis": {"title": ""}}, "size": { "field": "Deaths", "type": "quantitative", "legend": {"title": "Annual Global Deaths", "clipHeight": 30}, "scale": {"range": [0, 5000]} }, "color": {"field": "Entity", "type": "nominal", "legend": null} } }

The app also supports the popular Mermaid renderer:

A Mermaid sequence diagram

Visualize with AWS
1 2 3 4 5 6 7 8 9 10 11 12 sequenceDiagram participant Alice participant Bob Alice->>John: Hello John, how are you? loop Healthcheck John->>John: Fight against hypochondria end Note right of John: Rational thoughts <br/>prevail! John-->>Alice: Great! John->>Bob: How about you? Bob-->>John: Jolly good!

How it works – Jira

In Jira the app provides an issue panel via the IssuePanel module – you can trigger it in the issue byline, for example the initial epic for this app https://utoolity.atlassian.net/browse/UAA-447:

An applicable example might be an architecture overview via the PlantUML with AWS mode:

The app currently only supports one diagram per issue, we are looking into the right data model to make this more flexible.

Testing

Usage - Confluence

Usage testing requires playground space

Regular usage can be readily tested within the https://utoolity.atlassian.net/wiki/spaces/UPLAY/pages/1746010343 (refer to the preceding sections for details).

Forge macro configuration persistence issue

We discovered a rather weird Forge issue that loses the macro configuration on page publish if the visualization type was modified – refer to https://ecosystem.atlassian.net/browse/FRGE-118 for details.

As a workaround, please make a small change (whitespace is sufficient) on the surrounding page content in addition to the macro edit.

Usage - Jira

Usage testing requires playground project

Regular usage can be readily tested within the Utoolity Playground Software Project (UPSP), specifically the following issue (refer to the preceding sections for details):