File tree Expand file tree Collapse file tree
resources/js/vue/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616 />
1717
1818 <loading-indicator :is-loading =" !allCommands" >
19- <CommandGanttChart :commands =" formattedChartCommands " />
19+ <CommandFlameChart :commands =" formattedChartCommands " />
2020 </loading-indicator >
2121 </div >
2222
@@ -46,14 +46,14 @@ import LoadingIndicator from './shared/LoadingIndicator.vue';
4646import BuildSidebar from ' ./shared/BuildSidebar.vue' ;
4747import gql from ' graphql-tag' ;
4848import FilterBuilder from ' ./shared/FilterBuilder.vue' ;
49- import CommandGanttChart from ' ./shared/CommandGanttChart .vue' ;
49+ import CommandFlameChart from ' ./shared/CommandFlameChart .vue' ;
5050import { DateTime , Duration } from ' luxon' ;
51- import LineChart from ' ./shared/LineChart.vue' ;
51+ import LineChart from ' ./shared/Charts/ LineChart.vue' ;
5252
5353export default {
5454 components: {
5555 LineChart,
56- CommandGanttChart ,
56+ CommandFlameChart ,
5757 FilterBuilder,
5858 LoadingIndicator,
5959 BuildSummaryCard,
Original file line number Diff line number Diff line change 1616
1717 <loading-indicator :is-loading =" !build || !targets" >
1818 <div class =" tw-w-full tw-bg-base-100 tw-flex tw-flex-col tw-rounded-lg tw-border tw-border-gray-200 tw-p-4" >
19- <CommandGanttChart :commands =" formattedCommands " />
19+ <CommandFlameChart :commands =" formattedCommands " />
2020 </div >
2121 </loading-indicator >
2222
@@ -61,13 +61,13 @@ import LoadingIndicator from './shared/LoadingIndicator.vue';
6161import BuildSidebar from ' ./shared/BuildSidebar.vue' ;
6262import gql from ' graphql-tag' ;
6363import FilterBuilder from ' ./shared/FilterBuilder.vue' ;
64- import CommandGanttChart from ' ./shared/CommandGanttChart .vue' ;
64+ import CommandFlameChart from ' ./shared/CommandFlameChart .vue' ;
6565import { DateTime , Duration } from ' luxon' ;
6666import Utils from ' ./shared/Utils' ;
6767
6868export default {
6969 components: {
70- CommandGanttChart ,
70+ CommandFlameChart ,
7171 FilterBuilder,
7272 LoadingIndicator,
7373 DataTable,
Original file line number Diff line number Diff line change 1+ <template >
2+ <v-chart
3+ class =" tw-w-full"
4+ :option =" chartOptions"
5+ :style =" { height: height + 'px' }"
6+ autoresize
7+ @click =" $emit('click', $event)"
8+ />
9+ </template >
10+
11+ <script >
12+ import { use } from ' echarts/core' ;
13+ import { CanvasRenderer } from ' echarts/renderers' ;
14+ import { CustomChart } from ' echarts/charts' ;
15+ import {
16+ GridComponent ,
17+ TooltipComponent ,
18+ DataZoomComponent ,
19+ } from ' echarts/components' ;
20+ import VChart from ' vue-echarts' ;
21+ import Utils from ' ../Utils' ;
22+
23+ use ([
24+ CanvasRenderer,
25+ CustomChart,
26+ GridComponent,
27+ TooltipComponent,
28+ DataZoomComponent,
29+ ]);
30+
31+ export default {
32+ name: ' FlameChart' ,
33+ components: {
34+ VChart,
35+ },
36+ props: {
37+ data: {
38+ type: Array ,
39+ required: true ,
40+ },
41+ tracks: {
42+ type: Array ,
43+ required: true ,
44+ },
45+ overallStartTime: {
46+ type: Number ,
47+ required: true ,
48+ },
49+ overallEndTime: {
50+ type: Number ,
51+ required: true ,
52+ },
53+ height: {
54+ type: Number ,
55+ required: true ,
56+ },
57+ tooltipFormatter: {
58+ type: Function ,
59+ required: true ,
60+ },
61+ renderItem: {
62+ type: Function ,
63+ required: true ,
64+ },
65+ },
66+ emits: [' click' ],
67+ computed: {
68+ chartOptions () {
69+ return {
70+ tooltip: {
71+ confine: true ,
72+ trigger: ' item' ,
73+ extraCssText: ' max-width: 500px; white-space: normal;' ,
74+ formatter: this .tooltipFormatter ,
75+ },
76+ grid: {
77+ top: ' 0px' ,
78+ left: ' 10px' ,
79+ right: ' 10px' ,
80+ bottom: ' 50px' ,
81+ },
82+ xAxis: {
83+ max: this .overallEndTime ,
84+ type: ' time' ,
85+ axisLabel: {
86+ formatter : val => {
87+ const relativeTime = val - this .overallStartTime ;
88+ return Utils .formatDuration (relativeTime);
89+ },
90+ },
91+ },
92+ yAxis: {
93+ show: false ,
94+ type: ' category' ,
95+ data: this .tracks ,
96+ inverse: true ,
97+ },
98+ dataZoom: [
99+ {
100+ type: ' slider' ,
101+ filterMode: ' weakFilter' ,
102+ showDataShadow: false ,
103+ bottom: 5 ,
104+ height: 15 ,
105+ },
106+ {
107+ type: ' inside' ,
108+ filterMode: ' weakFilter' ,
109+ },
110+ ],
111+ series: [{
112+ type: ' custom' ,
113+ coordinateSystem: ' cartesian2d' ,
114+ data: this .data ,
115+ large: true ,
116+ progressive: 400 ,
117+ renderItem: this .renderItem ,
118+ encode: {
119+ x: [1 , 2 ],
120+ y: 0 ,
121+ },
122+ }],
123+ };
124+ },
125+ },
126+ };
127+ </script >
Original file line number Diff line number Diff line change 77</template >
88
99<script >
10+ import { use } from ' echarts/core' ;
11+ import { CanvasRenderer } from ' echarts/renderers' ;
12+ import { LineChart } from ' echarts/charts' ;
13+ import {
14+ GridComponent ,
15+ TooltipComponent ,
16+ DataZoomComponent ,
17+ } from ' echarts/components' ;
1018import VChart from ' vue-echarts' ;
11- import Utils from ' ./Utils' ;
19+ import Utils from ' ../Utils' ;
20+
21+ use ([
22+ CanvasRenderer,
23+ LineChart,
24+ GridComponent,
25+ TooltipComponent,
26+ DataZoomComponent,
27+ ]);
1228
1329export default {
1430 name: ' LineChart' ,
You can’t perform that action at this time.
0 commit comments