-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds flowchart example #416
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2024 TypeFox and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the Eclipse | ||
* Public License v. 2.0 are satisfied: GNU General Public License, version 2 | ||
* with the GNU Classpath Exception which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
********************************************************************************/ | ||
|
||
:root { | ||
--black: #000; | ||
--white: #fff; | ||
--stroke-normal: 2; | ||
--stroke-medium: 3; | ||
--stroke-bold: 5; | ||
--red-500: #f44336; | ||
--yellow-500: #ffeb3b; | ||
--amber-500: #ffc107; | ||
} | ||
|
||
/* graph */ | ||
.sprotty-graph { | ||
font-size: 15pt; | ||
} | ||
|
||
/* nodes */ | ||
.sprotty-node { | ||
stroke: var(--black); | ||
stroke-width: var(--stroke-normal); | ||
} | ||
|
||
.sprotty-node.terminal { | ||
fill: var(--red-500); | ||
} | ||
|
||
.sprotty-node.process { | ||
fill: var(--yellow-500); | ||
} | ||
|
||
.sprotty-node.decision { | ||
fill: var(--amber-500); | ||
} | ||
|
||
.sprotty-node.selected { | ||
stroke-width: var(--stroke-bold); | ||
} | ||
|
||
.sprotty-node.mouseover:not(.selected) { | ||
stroke-width: var(--stroke-medium); | ||
} | ||
|
||
/* labels */ | ||
.sprotty-label { | ||
stroke-width: 0; | ||
fill: var(--black); | ||
font-size: 100%; | ||
font-weight: inherit; | ||
text-anchor: middle; | ||
} | ||
|
||
.edge-label-background { | ||
fill: var(--white); | ||
stroke: none; | ||
} | ||
|
||
/* edges */ | ||
.sprotty-edge { | ||
fill: none; | ||
stroke: var(--black); | ||
stroke-width: var(--stroke-normal); | ||
} | ||
|
||
.sprotty-edge.mouseover:not(.selected) { | ||
stroke-width: var(--stroke-medium); | ||
} | ||
|
||
.sprotty-edge.selected { | ||
stroke: #844; | ||
stroke-width: var(--stroke-bold); | ||
} | ||
|
||
.sprotty-edge>.sprotty-routing-handle { | ||
fill: #884; | ||
stroke: none; | ||
z-index: 1000; | ||
} | ||
|
||
.sprotty-edge>.sprotty-routing-handle[data-kind='line'] { | ||
opacity: 0.35; | ||
} | ||
|
||
.arrowhead { | ||
fill: var(--black); | ||
stroke: var(--black); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2024 TypeFox and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the Eclipse | ||
* Public License v. 2.0 are satisfied: GNU General Public License, version 2 | ||
* with the GNU Classpath Exception which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
********************************************************************************/ | ||
|
||
|
||
.footer { | ||
margin-top: 10px; | ||
text-align: right; | ||
font-size: 10px; | ||
color: #888; | ||
|
||
display: flex; | ||
justify-content: space-between; | ||
} | ||
|
||
.shortcuts { | ||
text-align: left; | ||
} | ||
|
||
.copyright { | ||
text-align: right; | ||
} | ||
|
||
.help { | ||
margin-top: 24px; | ||
text-align: right; | ||
font-size: 16px; | ||
color: #888; | ||
} | ||
|
||
svg { | ||
margin-top: 15px; | ||
width: 100%; | ||
height: 1000px; | ||
border-style: solid; | ||
border-width: 1px; | ||
border-color: #bbb; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Sprotty Flowchart Example</title> | ||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css"> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/balloon-css/0.5.0/balloon.min.css"> | ||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> | ||
<link rel="stylesheet" href="css/page.css"> | ||
<!-- support Microsoft browsers --> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/dom4/3.0.0/dom4.js"> | ||
<script> | ||
document.addEventListener("DOMContentLoaded", function toggleShortcuts(){ | ||
var isMac = navigator.platform.toUpperCase().indexOf('MAC')>=0; | ||
var mac = document.getElementById('mac'); | ||
var other = document.getElementById('other'); | ||
if (isMac) { | ||
mac.style.display = 'block'; | ||
other.style.display = 'none'; | ||
} else { | ||
mac.style.display = 'none'; | ||
other.style.display = 'block'; | ||
} | ||
}); | ||
</script> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="row" id="sprotty-app" data-app="flowchart"> | ||
<div class="col-md-10"> | ||
<h1>Sprotty Flowchart Example</h1> | ||
</div> | ||
<div class="help col-md-2"> | ||
<a href="https://sprotty.org/docs/user_interaction/">Help</a> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<div id="sprotty" class="sprotty"></div> | ||
</div> | ||
<div class="footer"> | ||
<div id="mac" class="shortcuts"> | ||
<b>Fit to screen:</b> Cmd+Shift+F, <b>Center selected:</b> Cmd+Shift+C, <b>Export SVG:</b> Cmd+Shift+E | ||
</div> | ||
<div id="other" class="shortcuts" style="display: none;"> | ||
<b>Fit to screen:</b> Ctrl+Shift+F, <b>Center selected:</b> Ctrl+Shift+C, <b>Export SVG:</b> Ctrl+Shift+E | ||
</div> | ||
<div class="copyright"> | ||
© 2024 <a href="https://www.typefox.io/">TypeFox GmbH</a>. | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<script src="../resources/bundle.js"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we change height to 600px? It still looks good, but I don't need to scroll when running the example on a smaller display.