#900 Handling ids starting with a number and styling for other nodes as well

This commit is contained in:
Knut Sveidqvist 2019-08-16 12:38:34 +02:00
parent a35892da4f
commit 4eda2aa36d
2 changed files with 11 additions and 1 deletions

View File

@ -28,6 +28,11 @@
end
style test fill:#F99,stroke-width:2px,stroke:#F0F
</div>
<div class="mermaid">
graph TD
9e122290-->82072290_1ec3_e711_8c5a_005056ad0002
style 9e122290 fill:#F99,stroke-width:2px,stroke:#F0F
</div>
<script src="./mermaid.js"></script>
<script>
function showFullFirstSquad(elemName) {

View File

@ -88,8 +88,13 @@ export const addVertex = function (_id, text, type, style, classes) {
* @param type
* @param linktext
*/
export const addLink = function (start, end, type, linktext) {
export const addLink = function (_start, _end, type, linktext) {
let start = _start
let end = _end
if (start[0].match(/\d/)) start = 's' + start
if (end[0].match(/\d/)) end = 's' + end
logger.info('Got edge...', start, end)
const edge = { start: start, end: end, type: undefined, text: '' }
linktext = type.text