Skip to content

Commit adb9b54

Browse files
committed
cleanup
1 parent 800a9d1 commit adb9b54

File tree

1 file changed

+1
-114
lines changed

1 file changed

+1
-114
lines changed

client/src/CostCentreStack.svelte

Lines changed: 1 addition & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import * as d3 from 'd3';
33
import { postData } from './post-data.js';
44
import { onMount } from 'svelte';
5-
import CodeMirror from "./CodeMirror.svelte";
65
import CostCentreStackHeap from './CostCentreStackHeap.svelte';
76
import SourceRangeBox from './SourceRangeBox.svelte';
87
@@ -57,60 +56,6 @@
5756
}
5857
}
5958
60-
const re1 = /.*:(?<line>\d+):(?<column>\d+)$/;
61-
const re2 = /.*:(?<line>\d+):(?<start_column>\d+)-(?<end_column>\d+)$/;
62-
const re3 = /.*:\((?<start_line>\d+),(?<start_column>\d+)\)-\((?<end_line>\d+),(?<end_column>\d+)\)$/;
63-
/*
64-
65-
isPointRealSpan
66-
path:line:column
67-
/.*:(?<line>\d+):(?<column>\d+)$/
68-
69-
isOneLineRealSpan
70-
path:line:start_column-end_column
71-
/.*:(?<line>\d+):(?<start_column>\d+)-(?<end_column>\d+)$/
72-
73-
generic
74-
path:(start_line,start_column)-(end_line,end_column)
75-
/.*:\((?<start_line>\d+),(?<start_column>\d+)\)-\((?<end_line>\d+),(?<end_column>\d+)\)$/
76-
77-
EXAMPLE:
78-
src3.match(re4).groups
79-
80-
*/
81-
function getSrcLocLine(srcLoc) {
82-
let m;
83-
if (m = srcLoc.match(re1)) {
84-
// path:line:column
85-
return +m.groups.line;
86-
} else if (m = srcLoc.match(re2)) {
87-
// path:line:start_column-end_column
88-
return +m.groups.line;
89-
} else if (m = srcLoc.match(re3)) {
90-
// path:(start_line,start_column)-(end_line,end_column)
91-
return +m.groups.start_line;
92-
}
93-
94-
return 1;
95-
}
96-
97-
function sliceToSrcLoc(sourceCode, srcLoc) {
98-
const lines = sourceCode.split('\n');
99-
let m;
100-
if (m = srcLoc.match(re1)) {
101-
// path:line:column
102-
return lines.slice(+m.groups.line -1, +m.groups.line).join('\n');
103-
} else if (m = srcLoc.match(re2)) {
104-
// path:line:start_column-end_column
105-
return lines.slice(+m.groups.line -1, +m.groups.line).join('\n');
106-
} else if (m = srcLoc.match(re3)) {
107-
// path:(start_line,start_column)-(end_line,end_column)
108-
return lines.slice(+m.groups.start_line -1, +m.groups.end_line).join('\n');
109-
}
110-
111-
return sourceCode;
112-
}
113-
11459
async function getSourceCodeForModule(moduleName) {
11560
if (moduleName in stackModuleSource) {
11661
const res = await stackModuleSource[moduleName];
@@ -120,20 +65,6 @@
12065
return '<not found>';
12166
}
12267
123-
/*
124-
const btn = () => {
125-
cm1.slice(src, 19, 29);
126-
//console.log(cm1.getEditor().getViewport());
127-
//cm1.getEditor().scrollIntoView({line:10, ch:1});
128-
//cm1.getEditor().getDoc().setCursor(44);
129-
//cm1.getEditor().getDoc().setSelection({line:19, ch:0},{line:28, ch:0});
130-
//cm1.getEditor().scrollIntoView({line:111, ch:1});
131-
//cm1.getEditor().getDoc().markText({line:51, ch:0},{line:63, ch:0}, {css: "background-color: #f00e0350"});
132-
//console.log(cm1.getEditor().getViewport());
133-
cm1.getEditor().setSize(null, 'auto');
134-
};
135-
*/
136-
13768
function handleKeypress(event) {
13869
console.log(event);
13970
@@ -184,62 +115,18 @@
184115
if (currentStack) calculateCurrentStack();
185116
}
186117
187-
function bgImage2(i, ccid) {
188-
//return 'linear-gradient(#8e508a, #8e508a)';
189-
//return 'linear-gradient(#5f5286, #5f5286)';
190-
// return 'linear-gradient(#8e508a, #5f5286)';
191-
return 'linear-gradient(to right, #8e508a, #5f5286)';
192-
return 'linear-gradient(to right, #5f5286, #8e508a)';
193-
}
194-
195118
function bgImage(i, ccid) {
196119
if (i < 4)
197120
//return 'linear-gradient(to right, #8e508a, #5f5286)';
198121
return 'linear-gradient(#8e508a, #5f5286)';
199122
// return 'linear-gradient(#8e508a, #453b61)';
200123
// return 'linear-gradient(#5f5286, #8e508a)';
201124
return 'linear-gradient(#5f5286, #453b61)'; // super
202-
125+
203126
return 'linear-gradient(#8e508a, #453b61)';
204127
return 'linear-gradient(#8e508a, #5f5286, #453b61)';
205128
}
206129
207-
function bgColor(i, ccid) {
208-
209-
// if (i === 0)
210-
return '#5f5286';
211-
return '#453b61';
212-
213-
return '#8e508a';
214-
//return 'darkgreen';
215-
216-
217-
218-
if (i % 2 === 0)
219-
return 'orange';
220-
return '#8e508a';
221-
return '#453b61';
222-
return '#5f5286';
223-
224-
/*
225-
453b61
226-
5f5286
227-
8e508a
228-
*/
229-
//return 'orange';
230-
if (i % 2 === 0)
231-
return 'dodgerblue';
232-
return 'MediumSeaGreen';
233-
234-
if (i % 2 === 0)
235-
return 'orange';
236-
return 'slateblue';
237-
238-
if (i % 2 === 0)
239-
return '#453b61';
240-
return '#8e508a';
241-
return '#5f5286';
242-
}
243130
</script>
244131

245132
<nav class="my-nav">

0 commit comments

Comments
 (0)