Tokens aesthetics mapping

token_aes(
  size = token_scale(),
  color = token_scale(),
  image = token_scale(),
  opacity = token_scale(),
  shape = "circle",
  attributes = list()
)

Arguments

size

The scale used for the token size.

color

The scale used for the token color,

image

The scale used for the token image.

opacity

The scale used for the token opacity.

shape

The (fixed) SVG shape to be used to draw tokens. Can be either 'circle' (default), 'rect' or 'image'. In the latter case the image URL needs to be specified as parameter 'token_image'.

attributes

A list of additional (fixed) SVG attributes to be added to each token.

Value

An aesthetics mapping for `animate_process`.

Examples

data(example_log)

# Change default token sizes / shape
animate_process(example_log, mapping = token_aes(size = token_scale(12), shape = "rect"))
%0 1->4 3 3->1 3 4->5 2 4->6 1 5->2 3 6->5 1 1 A 3 2 End 3 Start 4 B 3 5 C 3 6 D 1 123Wed 0301 AM02 AM03 AM04 AM05 AM06 AM07 AM08 AM09 AM10 AM11 AM12 PM01 PM10/3/2018 12:01:46 AM
# \donttest{ # Change default token color animate_process(example_log, mapping = token_aes(color = token_scale("red")))
%0 1->4 3 3->1 3 4->5 2 4->6 1 5->2 3 6->5 1 1 A 3 2 End 3 Start 4 B 3 5 C 3 6 D 1 123Wed 0301 AM02 AM03 AM04 AM05 AM06 AM07 AM08 AM09 AM10 AM11 AM12 PM01 PM10/3/2018 12:01:46 AM
# Change default token opacity animate_process(example_log, mapping = token_aes(opacity = token_scale("0.2")))
%0 1->4 3 3->1 3 4->5 2 4->6 1 5->2 3 6->5 1 1 A 3 2 End 3 Start 4 B 3 5 C 3 6 D 1 123Wed 0301 AM02 AM03 AM04 AM05 AM06 AM07 AM08 AM09 AM10 AM11 AM12 PM01 PM10/3/2018 12:01:46 AM
# Change default token image (GIFs work too) animate_process(example_log, mapping = token_aes(shape = "image", size = token_scale(10), image = token_scale("https://upload.wikimedia.org/wikipedia/commons/5/5f/Pacman.gif")))
%0 1->4 3 3->1 3 4->5 2 4->6 1 5->2 3 6->5 1 1 A 3 2 End 3 Start 4 B 3 5 C 3 6 D 1 123Wed 0301 AM02 AM03 AM04 AM05 AM06 AM07 AM08 AM09 AM10 AM11 AM12 PM01 PM10/3/2018 12:01:46 AM
# A more elaborate example with a secondary data frame library(eventdataR) data(traffic_fines) # Change token color based on a numeric attribute, here the nonsensical 'time' of an event animate_process(edeaR::filter_trace_frequency(bupaR::sample_n(traffic_fines,1000),percentage=0.95), legend = "color", mode = "relative", mapping = token_aes(color = token_scale("amount", scale = "linear", range = c("yellow","red"))))
%0 2->4 960 3->6 101 3->8 321 4->6 333 4->7 627 5->3 422 6->1 434 6->6 26 7->1 205 7->5 422 8->1 321 1 End 2 Start 3 Add penalty 422 4 Create Fine 960 5 Insert Fine Notification 422 6 Payment 460 7 Send Fine 627 8 Send for Credit Collection 321 A10012A10015A10023A10025A10026A10068A10069A1007A10089A10091A101A1014A10151A10162A10163A10224A10247A10273A10291A10292A10312A10339A10344A10361A10388A10409A10425A10430A10468A10472A10492A10498A10502A10503A10549A10563A10569A10571A10588A10615A10628A10631A10636A1065A10661A10669A10683A10688A10697A10709A10718A10752A10758A10779A10788A10804A10805A10829A10869A10873A10927A10942A10943A10950A10965A10972A10988A10989A10999A11005A11015A11031A11042A11051A11060A11067A11082A11084A1110A1114A11145A11163A11177A11179A11187A11209A11244A11258A11260A11268A11302A11332A1134A11368A11371A11434A11451A11487A11490A11511A11535A11538A11563A11567A11576A11602A11608A11637A1165A11656A11706A11724A11734A11737A1175A11760A11805A1185A11864A11880A11888A11927A1197A12003A12017A12048A12069A12070A12095A12104A12110A12113A12114A12119A12136A12145A1216A12173A12178A12186A1219A12208A12234A12244A12254A12258A12274A12283A12316A12329A12332A12348A12367A12377A12394A12398A12422A12429A1246A12468A1247A12473A12486A12516A12529A12530A12556A1264A1265A12668A12674A12695A12700A12701A12703A12717A12726A12758A1276A12819A12827A12892A12898A1290A1292A12931A1295A12956A1298A13003A13011A13013A13026A13034A1310A13170A13182A13194A13209A1322A13223A13234A13236A13241A13259A13295A13309A13337A13350A13394A13399A13402A13410A13425A13427A13431A13433A13452A13474A13485A13493A13498A13538A13549A13581A13582A13598A13625A13628A13632A13690A13714A13733A13747A13756A13798A1382A13838A1384A13857A1386A13868A13876A13878A13889A13897A13899A13925A13962A13983A13994A13997A14007A14038A14041A14045A14055A1408A14100A14107A14115A14129A14138A1418A14209A14250A14254A14299A14316A14317A14322A14350A14385A14393A14455A14506A1451A14545A14551A14555A14559A14576A14608A14636A1464A14642A1465A14657A14667A14694A14730A14737A14782A1479A14791A14793A14812A14822A14828A14840A14882A14891A14941A15015A15040A15047A15051A15082A151A15100A15115A15126A15130A15143A15175A15185A15196A15219A1524A15254A15278A15310A15316A15386A15388A154A15425A15426A15435A15461A15472A15499A1553A15558A15584A1559A15598A15627A15655A1566A15679A15757A15767A15769A1577A15771A15814A15834A15835A15837A15840A15884A1592A15928A15945A15946A15955A15995A1600A16001A16007A16035A16044A16084A16095A16121A16127A16150A16167A16190A16210A16229A16246A16252A163A16328A16329A16345A16376A16377A16398A16420A16437A16448A16451A16460A16473A16503A16506A16541A16576A16588A16592A16602A16611A16615A16630A16645A16647A16649A16696A167A16752A16757A1678A16801A16818A16829A1684A16866A16898A16911A16936A16948A16950A16961A17035A17043A17051A17060A17065A17070A17089A17097A17110A17120A17141A17185A17201A17202A17220A17229A17245A17246A17249A17252A1730A17319A17328A17373A17392A17394A17424A17436A1745A17452A17501A17533A17547A17609A17624A17628A17634A17636A17657A17740A17762A17766A17772A17775A1781A17844A17882A17884A17892A17904A17911A1792A17928A17956A17997A18014A18027A18044A18056A18058A18088A18111A18122A18155A18180A18187A18194A18200A1822A18221A18249A18266A1830A18312A18315A18322A18336A1834A18350A18397A18431A18444A18467A18478A18482A18504A18506A18516A18549A18561A18562A18566A18577A18595A18604A18613A18644A18672A18702A18709A1872A18725A18754A18768A18780A18792A18793A18811A18812A18832A18853A18858A18878A18880A18893A18961A19018A19019A19022A19032A19055A19097A19108A19110A19128A19129A19179A19215A19232A19236A19283A19284A19292A19300A19315A19351A19365A19367A19387A1941A19470A19508A19541A19544A19603A19686A19693A19698A19724A1973A19730A19733A19778A19842A19857A19897A19938A19957A19970A19985A19987A19991A20012A20027A20036A20122A20178A20181A20197A20215A20230A20273A20311A20312A20324A20326A2033A20330A20352A20387A20391A20397A20440A2045A20450A20462A20474A20481A20503A20508A20512A20542A20544A20545A20565A20570A20587A20652A2073A20761A20806A20809A2087A20911A20912A20939A20942A2095A20975A20992A21001A21005A21022A21039A21139A21143A21163A21171A21179A21188A21202A21215A21216A21219A21236A21247A21260A21279A21286A21292A21304A21310A21311A21317A21360A21361A21399A21410A21431A21476A21487A21504A21552A21562A21583A21585A2159A21595A21597A21628A21645A21650A21651A21671A21676A21712A21728A21736A21752A2176A21769A21835A21862A21917A21926A2197A21974A21984A21990A21992A2200A22011A22023A22037A22053A22057A22121A22126A22136A22168A22223A22224A22226A22235A22248A22268A22271A22276A22278A22280A22287A22328A22359A22367A22368A22370A22381A224A22402A22414A22437A22439A22458A22492A22497A22506A2252A22522A22528A22539A22560A22567A22596A22605A22622A22624A22639A22657A2269A22748A22749A22752A22756A22805A22836A22841A22844A22852A22885A22889A22921A22926A22936A22938A22943A2297A22982A22998A23001A23004A23028A23035A23086A23087A23105A23116A23129A23141A23149A23165A23168A2317A23197A23274A23305A23329A23337A23342A23353A23361A23363A2338A23409A23411A23423A23424A23450A2346A23467A23468A23469A23503A2355A23558A23584A23611A23612A23630A23647A23649A23680A23693A23717A2372A23741A23742A23753A2376A23763A23778A23799A2382A23827A23942A23956A23965A2398A23990A24003A24017A24027A2404A24068A24164A24248A24264A2427A24292A24302A24340A24362A24376A24422A24430A2445A24466A24469A24480A24488A2449A24497A2450A24502A24523A24547A24556A24565A24570A24572A24585A24606A24609A24632A24640A24651A24706A24713A24737A24738A24752A2476A24782A24797A24799A2480A24820A24830A24858A24863A24868A249A24966A24991A25009A2501A25023A25026A25029A25062A25067A25114A25128A25165A25176A25184A25188A25197A252A25251A25262A25272A25301A25326A25369A25449A25451A25454A25491A25496A25501A25518A25526A25529A25556A25608A2561A25632A25637A25645A25662A2570A25761A25769A25787A25801A25808A25854A25863A2587A25871A2590A25922A2594A2596A26010A26018A26041A2605A26066A2610A26101A26114A2612A26121A26127A26136A26148A26161A2620A26207A26215A2622A26251A2628A26281A26295A26302A26353A26357A2637A26392A26400A26406A26437A26459A26467A26514A2654A26572A26587A26591A26620A26628A26630a few seconds4 months8 monthsa yeara year2 years2 years2 years3 years3 years2 days 21.034.347.560.874.0
# }