mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-09 19:00:48 +00:00
Panning and zooming of inference tree
This commit is contained in:
parent
321ed10eb5
commit
10cd63abb4
@ -85,6 +85,7 @@ window.MathJax = {
|
||||
const OutputJax = startup.getOutputJax();
|
||||
const html = mathjax.document(root, {InputJax, OutputJax});
|
||||
html.render();
|
||||
window.svgPanZoomFun(root.querySelector("svg"));
|
||||
if (callback != null) {
|
||||
callback(html);
|
||||
}
|
||||
@ -107,4 +108,4 @@ window.MathJax = {
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
4
frontend/src/svg-pan-zoom.min.js
vendored
Normal file
4
frontend/src/svg-pan-zoom.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -20,7 +20,7 @@ public class LambdaLexer {
|
||||
* current position in the term
|
||||
*/
|
||||
private int pos = 0;
|
||||
private Result<Deque<Token>, ParseError> result;
|
||||
private final Result<Deque<Token>, ParseError> result;
|
||||
|
||||
/**
|
||||
* Constructs a lexer that lexes the given term
|
||||
@ -66,7 +66,6 @@ public class LambdaLexer {
|
||||
} else {
|
||||
return new Result<>(new Token(TokenType.EOF, "", 0));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private Result<Token, ParseError> parseNextToken() {
|
||||
|
@ -27,6 +27,7 @@ import edu.kit.typicalc.view.content.typeinferencecontent.TypeInferenceView;
|
||||
*/
|
||||
@CssImport("./styles/view/main/main-view.css")
|
||||
@JsModule("./styles/shared-styles.js")
|
||||
@JavaScript("./src/svg-pan-zoom.min.js")
|
||||
@JavaScript("./src/tex-svg-full.js")
|
||||
public class MainViewImpl extends AppLayout implements MainView {
|
||||
private static final long serialVersionUID = -2411433187835906976L;
|
||||
|
@ -20,6 +20,9 @@ class LambdaParserTest {
|
||||
LambdaParser parser = new LambdaParser("x");
|
||||
Result<LambdaTerm, ParseError> term = parser.parse();
|
||||
assertEquals(new VarTerm("x"), term.unwrap());
|
||||
parser = new LambdaParser("β1 α1");
|
||||
term = parser.parse();
|
||||
assertEquals(new AppTerm(new VarTerm("β1"), new VarTerm("α1")), term.unwrap());
|
||||
}
|
||||
@Test
|
||||
void absTerm() {
|
||||
|
Loading…
Reference in New Issue
Block a user