SlideShare a Scribd company logo
Quick functional UI sketches
with Lua templates and mermaid.js
Alexander Gladysh
@agladysh
FOSDEM 2017
Talk plan
1. The Case
2. Approaches to design
3. Enter the Mermaid
4. Lugram Templates
5. Conclusion
6. Questions?
2 / 32
About me
• Programmer background
• Mainly doing management work now
• In löve with Lua since 2005
3 / 32
The Case
• A huge professional enterprise application
• being converted from 20-year-old windows app
• to a modern SPA web-app.
4 / 32
The product is huge
Sufficient expertise can only be found on a team level:
• Technology experts don’t have product-level vision
• PO and PM don’t draw professionally (and lack deep insight on
the tech)
• Designer does not have the professional-level technology
expertise
5 / 32
The UI design and development process
For each ”screen” in the application:
• Concept
• Functional sketches and (sometimes) interactive studies
• Design sketches
• Layout implementation
• Business logic implementation
6 / 32
A functional sketch
What is on the screen, how does it WORK?
7 / 32
A design sketch
How does it LOOK?
8 / 32
Goals
• I need a diagram of the flow between app screens
• I need functional sketches of the screens themselves
• Basically it doesn’t matter how I make them as long as they are
easy to make and change and there are some facilities for reuse.
9 / 32
What tools to use?
• Photoshop (Krita, Gimp...)
• InkScape
• Google Documents
• Visio
• Balsamiq
• Sketch
• ...
I’m a programmer, I’m better with structured text than with images.
I work fastest with the keyboard, not having to touch the mouse.
10 / 32
Enter the Mermaid
http://bit.ly/mermaid-editor
11 / 32
Screen Flow Diagram
graph TD
list[List of Flights]
new[New Flight Form]
list-->|Create|new
12 / 32
Screen Flow Diagram (II)
graph TD
list[List of Flights]
new[New Flight Form]
list-->|"
<button>Create</button>
"|new
13 / 32
Screen Prototypes
graph TD
list["<b>List of Flights</b>
<hr>
<i>(No flights)</i><hr>
<button>Create</button>"]
new["New Flight Form"]
list-->|"
<button>Create</button>
"|new
14 / 32
Screen Prototypes (II)
graph TD
list["List of Flights"]
new["<b>New Flight</b><hr>
<input value='SU' size='2'>-
<input value='2618' size='4'><br>
<input value='MOW' size='5'> to
<input value='BRU' size='5'><br>
<input value='20:50' size='5'> to
<input value='22:30' size='5'>
<hr><button>Create</button>
<u>Cancel</u>"]
new-->|"
<button>Create</button>"|list
new-->|"<u>Cancel</u>"|list
15 / 32
Basic Documentation Structure
16 / 32
It is hard to do HTML without templates: list
<b>${title List of Flights}</b><hr>
<i>(No flights)</i><hr>
${link new <button>Create</button>}
17 / 32
It is hard to do HTML without templates: new
<b>${title New Flight}</b><hr>
<input value='SU' size='2'>-
<input value='2618' size='4'><br>
<input value='MOW' size='4'> to
<input value='BRU' size='4'><br>
<input value='20:50' size='5'> to
<input value='10:30' size='5'><hr>
${link list <button>Create</button>}
${link list <button>Cancel</button>}
18 / 32
Basic helpers
${title New Flight}
$title <text:*>
${link list <button>Create</button>}
$link <screen:word> <body:*>
19 / 32
Basic helpers: pass-through definitions
${define title {{'*', 'text'}} [[${text}]]}
${title New Flight} --> New Flight
${define link
{{'word', 'target'}, {'*', 'body'}}
[[${body}]]}
${link list <button>Create</button>}
--> <button>Create</button>
$define <symbol:word> <arguments:table> <code:*>
20 / 32
define
define = function(context, str)
local symbol, str = eat.word(str)
local args, str = eat.table(str)
local code, str = eat['*'](str)
args, code = lua_value(args), lua_value(code)
if type(code) == 'string' then code =
function(ctx) return ctx:replace(code) end
end
context._ROOT[symbol] = function(parent, str)
local ctx = { }
for i = 1, #args do
ctx[args[i][1]], str = eat[args[i][2]](str)
end
return code(parent:push(ctx))
end
end
21 / 32
helpers: definitions using Lua
${define title {{'*', 'text'}} function(context)
local text = context:replace(context.text)
context._ROOT._SCREENS[text] = text
return text
end}
${define link {{'word', 'target'}, {'*', 'body'}}
function(context)
local target = context:replace(context.text)
context._ROOT._LINKS[target] = context._MODULE
context:include(target) -- Ignoring result
return context:replace(context.body)
end}
22 / 32
include
include = function(context, template)
return context:push(
{ _MODULE = template }
):replace(
assert(io.open(filename)):read("*a")
)
end
23 / 32
Diagram styles
Depending on how you define $title and $link, you get several kinds
of diagram from the same set of templates:
• Outline diagram (titles and arrows only, ”screen flow”)
• Closeup diagram (screen content and flow from this screen to
others)
• Printable diagram (screen content only)
24 / 32
More Useful helpers
${define # {{'*', 'comment'}} [[]]}
${define --[HR]------...--------- {} [[<hr>]]}
${define expr {{'*', 'code'}} function(context)
return assert(loadstring('return '
.. context:replace(context.code)))()
end}
25 / 32
with helper
${define with {{'table', 'more_context'},
{'*', 'body'}} function(context)
return context:replace(
context:push(context.more_context),
context.body)
end}
${define form {} [[
${when editable
<input value='MOW'> to <input value='BRU'>}
${unless editable MOW to BRU}
]]}
${with {editable = true} ${form}}
26 / 32
with helper (II)
${define histogram {{'word', 'a'},
{'word', 'b'}, {'word', 'c'}} [[
${with { w = '${expr ${a} + ${b} + {c}}' }
<div style='width:${w}px' class='red'>
<div style='width:${a}px'
class='green'>${a}</div>
<div style='width:${b}px'
class='blue'>${b}</div>
</div>
}]]}
${histogram 1 2 3}
27 / 32
Some statistics
• Two days to implement core, about 250 LOC.
• After six months of non-fulltime usage, core grew to about 330
LOC, mostly additional diagnostics.
• About 60 sketches finalized (5KLOC of templates), more to
come.
28 / 32
Was it worth it?
Yes.
• I’ve got a low-cost lightweight flexible framework for design that
does not chafe in wrong places.
• Its output, while not ideal, is reasonably understandable by all
members of the team.
• Also: much fun implementing yet another template engine.
29 / 32
Why not X?
• The cost is so low, the adaptation of existing tool to my
requirements (or just learning the proper ropes) would probably
cost about the same.
• But if you know a good candidate that fits here, please do chime
in.
30 / 32
Problems
• Error diagnostics and debugging for templates. Almost
non-existent. Lots of low-hanging fruit there.
• Debugging of the HTML output render. IE6-hard, rather difficult
to improve. Keep HTML simple.
• Expressive power of the language could be improved. No need
so far.
31 / 32
Questions?
@agladysh
agladysh@gmail.com
https://github.com/tais-aero/lugram

More Related Content

Viewers also liked

Hiring UX/UI designers
Hiring UX/UI designersHiring UX/UI designers
Hiring UX/UI designers
Leadzpipe
 
Rekapitulasi 2010 06 28
Rekapitulasi 2010 06 28Rekapitulasi 2010 06 28
Rekapitulasi 2010 06 28bramanian
 
ICT-Markt wird dynamisch
ICT-Markt wird dynamischICT-Markt wird dynamisch
ICT-Markt wird dynamisch
Manuela Vrbat
 
UK RepositoryNet+: Developing New Services Over the UK Repository Network
UK RepositoryNet+: Developing New Services Over the UK Repository NetworkUK RepositoryNet+: Developing New Services Over the UK Repository Network
UK RepositoryNet+: Developing New Services Over the UK Repository Network
euroCRIS - Current Research Information Systems
 
ABA Information- and Communications Technologies in Austria
ABA Information- and Communications Technologies in AustriaABA Information- and Communications Technologies in Austria
ABA Information- and Communications Technologies in Austria
ABA - Invest in Austria
 
Who Are You? Branding Your Nonprofit
Who Are You? Branding Your NonprofitWho Are You? Branding Your Nonprofit
Who Are You? Branding Your Nonprofit
Grace Dunlap
 
Presentation 2
Presentation 2Presentation 2
Presentation 2cocolatto
 
Presentazione Istituto Pantheon
Presentazione Istituto PantheonPresentazione Istituto Pantheon
Presentazione Istituto Pantheon
Istituto Pantheon
 
Work with PFB Worldwide
Work with PFB Worldwide Work with PFB Worldwide
Work with PFB Worldwide
Leadzpipe
 
Symfony2 practice
Symfony2 practiceSymfony2 practice
Symfony2 practice
Skorney
 
Notice of race copa españa 29er ingles
Notice of race copa españa 29er   inglesNotice of race copa españa 29er   ingles
Notice of race copa españa 29er ingles29ervelacnsa
 
Children
ChildrenChildren
Childrenalex
 
Interactive module
Interactive moduleInteractive module
Interactive modulewalkupdw
 
Revista Veja - 02mar2011
Revista Veja - 02mar2011Revista Veja - 02mar2011
Revista Veja - 02mar2011Danilo Simões
 
LSS Connection 2010 Issue 2
LSS Connection 2010 Issue 2LSS Connection 2010 Issue 2
LSS Connection 2010 Issue 2
Rebeca Borrero
 
Apunte dntg estructurayclasificaciondeestilos1
Apunte dntg estructurayclasificaciondeestilos1Apunte dntg estructurayclasificaciondeestilos1
Apunte dntg estructurayclasificaciondeestilos1Gabriel Soria
 

Viewers also liked (16)

Hiring UX/UI designers
Hiring UX/UI designersHiring UX/UI designers
Hiring UX/UI designers
 
Rekapitulasi 2010 06 28
Rekapitulasi 2010 06 28Rekapitulasi 2010 06 28
Rekapitulasi 2010 06 28
 
ICT-Markt wird dynamisch
ICT-Markt wird dynamischICT-Markt wird dynamisch
ICT-Markt wird dynamisch
 
UK RepositoryNet+: Developing New Services Over the UK Repository Network
UK RepositoryNet+: Developing New Services Over the UK Repository NetworkUK RepositoryNet+: Developing New Services Over the UK Repository Network
UK RepositoryNet+: Developing New Services Over the UK Repository Network
 
ABA Information- and Communications Technologies in Austria
ABA Information- and Communications Technologies in AustriaABA Information- and Communications Technologies in Austria
ABA Information- and Communications Technologies in Austria
 
Who Are You? Branding Your Nonprofit
Who Are You? Branding Your NonprofitWho Are You? Branding Your Nonprofit
Who Are You? Branding Your Nonprofit
 
Presentation 2
Presentation 2Presentation 2
Presentation 2
 
Presentazione Istituto Pantheon
Presentazione Istituto PantheonPresentazione Istituto Pantheon
Presentazione Istituto Pantheon
 
Work with PFB Worldwide
Work with PFB Worldwide Work with PFB Worldwide
Work with PFB Worldwide
 
Symfony2 practice
Symfony2 practiceSymfony2 practice
Symfony2 practice
 
Notice of race copa españa 29er ingles
Notice of race copa españa 29er   inglesNotice of race copa españa 29er   ingles
Notice of race copa españa 29er ingles
 
Children
ChildrenChildren
Children
 
Interactive module
Interactive moduleInteractive module
Interactive module
 
Revista Veja - 02mar2011
Revista Veja - 02mar2011Revista Veja - 02mar2011
Revista Veja - 02mar2011
 
LSS Connection 2010 Issue 2
LSS Connection 2010 Issue 2LSS Connection 2010 Issue 2
LSS Connection 2010 Issue 2
 
Apunte dntg estructurayclasificaciondeestilos1
Apunte dntg estructurayclasificaciondeestilos1Apunte dntg estructurayclasificaciondeestilos1
Apunte dntg estructurayclasificaciondeestilos1
 

Similar to Quick functional UI sketches with Lua templates and mermaid.js

Durgesh
DurgeshDurgesh
Durgesh
dkbossverma
 
project report in C++ programming and SQL
project report in C++ programming and SQLproject report in C++ programming and SQL
project report in C++ programming and SQL
vikram mahendra
 
Python Project on Computer Shop
Python Project on Computer ShopPython Project on Computer Shop
Python Project on Computer Shop
vikram mahendra
 
The Future of Sharding
The Future of ShardingThe Future of Sharding
The Future of Sharding
EDB
 
How to create an Angular builder
How to create an Angular builderHow to create an Angular builder
How to create an Angular builder
Maurizio Vitale
 
inventory mangement project.pdf
inventory mangement project.pdfinventory mangement project.pdf
inventory mangement project.pdf
MeenakshiThakur86
 
Vb.net Experiment with Example
Vb.net Experiment with ExampleVb.net Experiment with Example
Vb.net Experiment with Example
Vivek Kumar Sinha
 
Railway reservation(c++ project)
Railway reservation(c++ project)Railway reservation(c++ project)
Railway reservation(c++ project)
Debashis Rath
 
Data Binding and Forms in Angular 2
Data Binding and Forms in Angular 2Data Binding and Forms in Angular 2
Data Binding and Forms in Angular 2
Manfred Steyer
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
Eliran Eliassy
 
Movie Ticket Booking Website Project Presentation
Movie Ticket Booking Website Project PresentationMovie Ticket Booking Website Project Presentation
Movie Ticket Booking Website Project Presentation
Avinandan Ganguly
 
AngularJS in large applications - AE NV
AngularJS in large applications - AE NVAngularJS in large applications - AE NV
AngularJS in large applications - AE NV
AE - architects for business and ict
 
Railway reservation(c++ project)
Railway reservation(c++ project)Railway reservation(c++ project)
Railway reservation(c++ project)
Debashis Rath
 
Time card system
Time card systemTime card system
Time card system
Smit Patel
 
Vuejs
VuejsVuejs
CS101- Introduction to Computing- Lecture 35
CS101- Introduction to Computing- Lecture 35CS101- Introduction to Computing- Lecture 35
CS101- Introduction to Computing- Lecture 35
Bilal Ahmed
 
WordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin PagesWordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin PagesBrandon Dove
 
SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++
vikram mahendra
 
Microsoft Graph: Connect to essential data every app needs
Microsoft Graph: Connect to essential data every app needsMicrosoft Graph: Connect to essential data every app needs
Microsoft Graph: Connect to essential data every app needs
Microsoft Tech Community
 
Microsoft Graph: Connect to essential data every app needs
Microsoft Graph: Connect to essential data every app needsMicrosoft Graph: Connect to essential data every app needs
Microsoft Graph: Connect to essential data every app needs
Microsoft Tech Community
 

Similar to Quick functional UI sketches with Lua templates and mermaid.js (20)

Durgesh
DurgeshDurgesh
Durgesh
 
project report in C++ programming and SQL
project report in C++ programming and SQLproject report in C++ programming and SQL
project report in C++ programming and SQL
 
Python Project on Computer Shop
Python Project on Computer ShopPython Project on Computer Shop
Python Project on Computer Shop
 
The Future of Sharding
The Future of ShardingThe Future of Sharding
The Future of Sharding
 
How to create an Angular builder
How to create an Angular builderHow to create an Angular builder
How to create an Angular builder
 
inventory mangement project.pdf
inventory mangement project.pdfinventory mangement project.pdf
inventory mangement project.pdf
 
Vb.net Experiment with Example
Vb.net Experiment with ExampleVb.net Experiment with Example
Vb.net Experiment with Example
 
Railway reservation(c++ project)
Railway reservation(c++ project)Railway reservation(c++ project)
Railway reservation(c++ project)
 
Data Binding and Forms in Angular 2
Data Binding and Forms in Angular 2Data Binding and Forms in Angular 2
Data Binding and Forms in Angular 2
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
 
Movie Ticket Booking Website Project Presentation
Movie Ticket Booking Website Project PresentationMovie Ticket Booking Website Project Presentation
Movie Ticket Booking Website Project Presentation
 
AngularJS in large applications - AE NV
AngularJS in large applications - AE NVAngularJS in large applications - AE NV
AngularJS in large applications - AE NV
 
Railway reservation(c++ project)
Railway reservation(c++ project)Railway reservation(c++ project)
Railway reservation(c++ project)
 
Time card system
Time card systemTime card system
Time card system
 
Vuejs
VuejsVuejs
Vuejs
 
CS101- Introduction to Computing- Lecture 35
CS101- Introduction to Computing- Lecture 35CS101- Introduction to Computing- Lecture 35
CS101- Introduction to Computing- Lecture 35
 
WordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin PagesWordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin Pages
 
SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++
 
Microsoft Graph: Connect to essential data every app needs
Microsoft Graph: Connect to essential data every app needsMicrosoft Graph: Connect to essential data every app needs
Microsoft Graph: Connect to essential data every app needs
 
Microsoft Graph: Connect to essential data every app needs
Microsoft Graph: Connect to essential data every app needsMicrosoft Graph: Connect to essential data every app needs
Microsoft Graph: Connect to essential data every app needs
 

Recently uploaded

Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 

Recently uploaded (20)

Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 

Quick functional UI sketches with Lua templates and mermaid.js

  • 1. Quick functional UI sketches with Lua templates and mermaid.js Alexander Gladysh @agladysh FOSDEM 2017
  • 2. Talk plan 1. The Case 2. Approaches to design 3. Enter the Mermaid 4. Lugram Templates 5. Conclusion 6. Questions? 2 / 32
  • 3. About me • Programmer background • Mainly doing management work now • In löve with Lua since 2005 3 / 32
  • 4. The Case • A huge professional enterprise application • being converted from 20-year-old windows app • to a modern SPA web-app. 4 / 32
  • 5. The product is huge Sufficient expertise can only be found on a team level: • Technology experts don’t have product-level vision • PO and PM don’t draw professionally (and lack deep insight on the tech) • Designer does not have the professional-level technology expertise 5 / 32
  • 6. The UI design and development process For each ”screen” in the application: • Concept • Functional sketches and (sometimes) interactive studies • Design sketches • Layout implementation • Business logic implementation 6 / 32
  • 7. A functional sketch What is on the screen, how does it WORK? 7 / 32
  • 8. A design sketch How does it LOOK? 8 / 32
  • 9. Goals • I need a diagram of the flow between app screens • I need functional sketches of the screens themselves • Basically it doesn’t matter how I make them as long as they are easy to make and change and there are some facilities for reuse. 9 / 32
  • 10. What tools to use? • Photoshop (Krita, Gimp...) • InkScape • Google Documents • Visio • Balsamiq • Sketch • ... I’m a programmer, I’m better with structured text than with images. I work fastest with the keyboard, not having to touch the mouse. 10 / 32
  • 12. Screen Flow Diagram graph TD list[List of Flights] new[New Flight Form] list-->|Create|new 12 / 32
  • 13. Screen Flow Diagram (II) graph TD list[List of Flights] new[New Flight Form] list-->|" <button>Create</button> "|new 13 / 32
  • 14. Screen Prototypes graph TD list["<b>List of Flights</b> <hr> <i>(No flights)</i><hr> <button>Create</button>"] new["New Flight Form"] list-->|" <button>Create</button> "|new 14 / 32
  • 15. Screen Prototypes (II) graph TD list["List of Flights"] new["<b>New Flight</b><hr> <input value='SU' size='2'>- <input value='2618' size='4'><br> <input value='MOW' size='5'> to <input value='BRU' size='5'><br> <input value='20:50' size='5'> to <input value='22:30' size='5'> <hr><button>Create</button> <u>Cancel</u>"] new-->|" <button>Create</button>"|list new-->|"<u>Cancel</u>"|list 15 / 32
  • 17. It is hard to do HTML without templates: list <b>${title List of Flights}</b><hr> <i>(No flights)</i><hr> ${link new <button>Create</button>} 17 / 32
  • 18. It is hard to do HTML without templates: new <b>${title New Flight}</b><hr> <input value='SU' size='2'>- <input value='2618' size='4'><br> <input value='MOW' size='4'> to <input value='BRU' size='4'><br> <input value='20:50' size='5'> to <input value='10:30' size='5'><hr> ${link list <button>Create</button>} ${link list <button>Cancel</button>} 18 / 32
  • 19. Basic helpers ${title New Flight} $title <text:*> ${link list <button>Create</button>} $link <screen:word> <body:*> 19 / 32
  • 20. Basic helpers: pass-through definitions ${define title {{'*', 'text'}} [[${text}]]} ${title New Flight} --> New Flight ${define link {{'word', 'target'}, {'*', 'body'}} [[${body}]]} ${link list <button>Create</button>} --> <button>Create</button> $define <symbol:word> <arguments:table> <code:*> 20 / 32
  • 21. define define = function(context, str) local symbol, str = eat.word(str) local args, str = eat.table(str) local code, str = eat['*'](str) args, code = lua_value(args), lua_value(code) if type(code) == 'string' then code = function(ctx) return ctx:replace(code) end end context._ROOT[symbol] = function(parent, str) local ctx = { } for i = 1, #args do ctx[args[i][1]], str = eat[args[i][2]](str) end return code(parent:push(ctx)) end end 21 / 32
  • 22. helpers: definitions using Lua ${define title {{'*', 'text'}} function(context) local text = context:replace(context.text) context._ROOT._SCREENS[text] = text return text end} ${define link {{'word', 'target'}, {'*', 'body'}} function(context) local target = context:replace(context.text) context._ROOT._LINKS[target] = context._MODULE context:include(target) -- Ignoring result return context:replace(context.body) end} 22 / 32
  • 23. include include = function(context, template) return context:push( { _MODULE = template } ):replace( assert(io.open(filename)):read("*a") ) end 23 / 32
  • 24. Diagram styles Depending on how you define $title and $link, you get several kinds of diagram from the same set of templates: • Outline diagram (titles and arrows only, ”screen flow”) • Closeup diagram (screen content and flow from this screen to others) • Printable diagram (screen content only) 24 / 32
  • 25. More Useful helpers ${define # {{'*', 'comment'}} [[]]} ${define --[HR]------...--------- {} [[<hr>]]} ${define expr {{'*', 'code'}} function(context) return assert(loadstring('return ' .. context:replace(context.code)))() end} 25 / 32
  • 26. with helper ${define with {{'table', 'more_context'}, {'*', 'body'}} function(context) return context:replace( context:push(context.more_context), context.body) end} ${define form {} [[ ${when editable <input value='MOW'> to <input value='BRU'>} ${unless editable MOW to BRU} ]]} ${with {editable = true} ${form}} 26 / 32
  • 27. with helper (II) ${define histogram {{'word', 'a'}, {'word', 'b'}, {'word', 'c'}} [[ ${with { w = '${expr ${a} + ${b} + {c}}' } <div style='width:${w}px' class='red'> <div style='width:${a}px' class='green'>${a}</div> <div style='width:${b}px' class='blue'>${b}</div> </div> }]]} ${histogram 1 2 3} 27 / 32
  • 28. Some statistics • Two days to implement core, about 250 LOC. • After six months of non-fulltime usage, core grew to about 330 LOC, mostly additional diagnostics. • About 60 sketches finalized (5KLOC of templates), more to come. 28 / 32
  • 29. Was it worth it? Yes. • I’ve got a low-cost lightweight flexible framework for design that does not chafe in wrong places. • Its output, while not ideal, is reasonably understandable by all members of the team. • Also: much fun implementing yet another template engine. 29 / 32
  • 30. Why not X? • The cost is so low, the adaptation of existing tool to my requirements (or just learning the proper ropes) would probably cost about the same. • But if you know a good candidate that fits here, please do chime in. 30 / 32
  • 31. Problems • Error diagnostics and debugging for templates. Almost non-existent. Lots of low-hanging fruit there. • Debugging of the HTML output render. IE6-hard, rather difficult to improve. Keep HTML simple. • Expressive power of the language could be improved. No need so far. 31 / 32