@@ -15,6 +15,7 @@ const endpoints = ref<Endpoint[]>([]);
1515const handlers = ref <Handler []>([]);
1616const routes = ref <MessageProcessingRoute []>([]);
1717const endpointCentrePoints = ref <EndpointCentrePoint []>([]);
18+ const maxWidth = ref (150 );
1819const maxHeight = ref (150 );
1920const handlerLocations = ref <HandlerLocation []>([]);
2021
@@ -35,6 +36,9 @@ fetchConversation();
3536function setTimelines(centrePoints : EndpointCentrePoint []) {
3637 endpointCentrePoints .value = centrePoints ;
3738}
39+ function setMaxWidth(width : number ) {
40+ maxWidth .value = width ;
41+ }
3842function setMaxHeight(height : number ) {
3943 maxHeight .value = height ;
4044}
@@ -44,15 +48,23 @@ function setHandlerLocations(locations: HandlerLocation[]) {
4448 </script >
4549
4650<template >
47- <svg class =" sequence-diagram" width =" 100%" :height =" maxHeight + 20" >
48- <Endpoints :endpoints =" endpoints" @centre-points =" setTimelines" />
49- <Timeline :centre-points =" endpointCentrePoints" :height =" maxHeight" />
50- <Handlers :handlers =" handlers" :endpoint-centre-points =" endpointCentrePoints" @max-height =" setMaxHeight" @handlerLocations =" setHandlerLocations" />
51- <Routes :routes =" routes" :handler-locations =" handlerLocations" />
52- </svg >
51+ <div class =" outer" >
52+ <svg class =" sequence-diagram" :width =" `max(100%, ${isNaN(maxWidth) ? 0 : maxWidth}px)`" :height =" maxHeight + 20" >
53+ <Endpoints :endpoints =" endpoints" @centre-points =" setTimelines" @max-width =" setMaxWidth" />
54+ <Timeline :centre-points =" endpointCentrePoints" :height =" maxHeight" />
55+ <Handlers :handlers =" handlers" :endpoint-centre-points =" endpointCentrePoints" @max-height =" setMaxHeight" @handler-locations =" setHandlerLocations" />
56+ <Routes :routes =" routes" :handler-locations =" handlerLocations" />
57+ </svg >
58+ </div >
5359</template >
5460
5561<style scoped>
62+ .outer {
63+ max-width : 100% ;
64+ max-height : calc (100vh - 27em );
65+ overflow : auto ;
66+ }
67+
5668.sequence-diagram {
5769 --error : red ;
5870 --gray20 : #333333 ;
0 commit comments