Added fonts
This commit is contained in:
parent
594b1ff161
commit
dfb4a8f0bb
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
/dist-newstyle
|
||||
CHANGELOG.md
|
||||
test.json
|
||||
test.json
|
||||
server.py
|
||||
41
editor.css
41
editor.css
@ -1,3 +1,13 @@
|
||||
@font-face {
|
||||
font-family: Inter;
|
||||
src: url(fonts/Inter/Inter-VariableFont_slnt\,wght.ttf);
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: OpenSans;
|
||||
src: url(fonts/Open_Sans/OpenSans-VariableFont_wdth\,wght.ttf);
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0 0 0 0;
|
||||
}
|
||||
@ -19,9 +29,12 @@ body {
|
||||
|
||||
.menuitem {
|
||||
float: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.menuitem button {
|
||||
font-family: 'Inter';
|
||||
font-weight: 500;
|
||||
padding: 10 0 10 0;
|
||||
margin: 0 10 0 10;
|
||||
font-size: 1em;
|
||||
@ -31,6 +44,7 @@ body {
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
transition: all 200ms ease-out 0ms;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.menuitem:hover button {
|
||||
@ -43,12 +57,14 @@ body {
|
||||
}
|
||||
|
||||
.submenu {
|
||||
font-family: 'Inter';
|
||||
width: fit-content;
|
||||
position: fixed;
|
||||
top: 60px;
|
||||
overflow: hidden;
|
||||
padding: 20 20 20 20;
|
||||
display: none;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.selectedmenuitem .submenu {
|
||||
@ -89,12 +105,14 @@ body {
|
||||
}
|
||||
|
||||
#sideheading {
|
||||
font-family: 'OpenSans';
|
||||
text-align: center;
|
||||
font-size: 2em;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
#sidecontent {
|
||||
font-family: 'OpenSans';
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
bottom: 20px;
|
||||
@ -118,6 +136,7 @@ body {
|
||||
}
|
||||
|
||||
.contextmenu {
|
||||
font-family: 'Inter';
|
||||
display: none;
|
||||
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
|
||||
border-radius: 5px;
|
||||
@ -196,7 +215,7 @@ body {
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: rgb(75, 151, 151);
|
||||
font-weight: 500;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
@ -208,13 +227,13 @@ a:active {
|
||||
}
|
||||
|
||||
#sidebuttons button {
|
||||
font-family: 'Inter';
|
||||
padding: 5 5 5 5;
|
||||
border-radius: 5px;
|
||||
border-style: solid;
|
||||
border-color: transparent;
|
||||
background: rgba(120, 120, 120, 0.555);
|
||||
color: white;
|
||||
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.082), 0 2px 10px 0 rgba(0, 0, 0, 0.068);
|
||||
transition: all 100ms ease-in-out 0ms;
|
||||
cursor: pointer;
|
||||
}
|
||||
@ -228,6 +247,7 @@ a:active {
|
||||
}
|
||||
|
||||
#sidebuttons button:hover {
|
||||
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.082), 0 2px 10px 0 rgba(0, 0, 0, 0.068);
|
||||
transform: scale(1.02);
|
||||
/* transition: all 100ms ease-in-out 0ms; */
|
||||
background: rgba(120, 120, 120, 0.651);
|
||||
@ -240,4 +260,21 @@ a:active {
|
||||
|
||||
select {
|
||||
padding: 2 2 2 2;
|
||||
font-family: 'Inter';
|
||||
}
|
||||
|
||||
label {
|
||||
font-family: 'Inter';
|
||||
}
|
||||
|
||||
.force-graph-container .graph-tooltip {
|
||||
color: black;
|
||||
background-color: rgb(230, 230, 230);
|
||||
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
|
||||
opacity: 0.95;
|
||||
font-family: 'Inter';
|
||||
font-size: .75em;
|
||||
border-radius: 5px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
@ -1,11 +1,10 @@
|
||||
<head>
|
||||
<link rel="STYLESHEET" type="text/css" href="./editor.css">
|
||||
<meta charset="utf-8">
|
||||
|
||||
<!-- <script src="//unpkg.com/force-graph"></script> -->
|
||||
<script src="https://unpkg.com/force-graph@1.43.0/dist/force-graph.min.js"></script>
|
||||
<!-- <script src="./force-graph-master/src/force-graph.js"></script> -->
|
||||
<!--<script src="../../dist/force-graph.js"></script>-->
|
||||
<link rel="STYLESHEET" type="text/css" href="./editor.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
20
editor.js
20
editor.js
@ -244,8 +244,8 @@ const contextMenuEd = document.getElementById('ctmenued'); //Click on edge
|
||||
|
||||
const edgeColourDefault = '#999999ff';
|
||||
const edgeColourSelected = '#000000ff';
|
||||
const edgeColourHighlightDefault = 'magenta';
|
||||
const edgeColourHighlightSelected = 'red';
|
||||
const edgeColourHighlightDefault = '#6ed4d4';
|
||||
const edgeColourHighlightSelected = 'magenta';
|
||||
const edgeColourSubtleDefault = '#99999955';
|
||||
const edgeColourSubtleSelected = '#00000055';
|
||||
|
||||
@ -498,16 +498,16 @@ function getNodeColour(node) {
|
||||
var isSelected = selection === node || rightSelection === node;
|
||||
if (node.stateData && node.stateData.final !== 'False' && node.stateData.final !== '') {
|
||||
if (node.stateData.final === 'True' || node.stateData.final === 'ok') {
|
||||
return (isSelected ? '#a4eb34' : '#7fad36') + alpha;
|
||||
return (isSelected ? '#3ac713' : '#31a810') + alpha;
|
||||
} else if (node.stateData.final === 'not-ok') {
|
||||
return (isSelected ? '#f77474' : '#f25050') + alpha;
|
||||
return (isSelected ? '#ec4e7b' : '#e7215a') + alpha;
|
||||
} else {
|
||||
//console.log(node.stateData.final);
|
||||
}
|
||||
} else if (node.name === '@@INIT') {
|
||||
return (isSelected ? '#e8cd84' : '#d1ad4b') + alpha;
|
||||
return (isSelected ? '#ffbc15' : '#eeaa00') + alpha;
|
||||
} else {
|
||||
return (isSelected ? '#5fbad9' : '#4496b3') + alpha;
|
||||
return (isSelected ? '#538cd9' : '#3679d2') + alpha;
|
||||
}
|
||||
}
|
||||
|
||||
@ -627,7 +627,7 @@ const Graph = ForceGraph()
|
||||
// estimate fontSize to fit in link length
|
||||
//context.font = '1px Sans-Serif';
|
||||
const fontSize = MAX_FONT_SIZE;// Math.min(MAX_FONT_SIZE, maxTextLength / context.measureText(label).width);
|
||||
context.font = `${fontSize}px Sans-Serif`;
|
||||
context.font = `${fontSize}px Inter`;
|
||||
|
||||
var textLen = context.measureText(label).width;
|
||||
if (textLen > maxTextLength) {
|
||||
@ -665,14 +665,16 @@ const Graph = ForceGraph()
|
||||
ctx.fill();
|
||||
if (node === selection || node === rightSelection) {
|
||||
ctx.strokeStyle = 'black';
|
||||
ctx.lineWidth = 2;
|
||||
ctx.lineWidth = 1;
|
||||
ctx.setLineDash([1, 2]);
|
||||
ctx.lineCap = 'round';
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
if (! (node.stateData && node.stateData.abbreviation)) return;
|
||||
|
||||
ctx.fillStyle = 'white';
|
||||
ctx.font = '4px Sans-Serif';
|
||||
ctx.font = '4px Inter';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'middle';
|
||||
ctx.fillText(node.stateData.abbreviation, node.x, node.y);
|
||||
|
||||
BIN
fonts/Inter/Inter-VariableFont_slnt,wght.ttf
Normal file
BIN
fonts/Inter/Inter-VariableFont_slnt,wght.ttf
Normal file
Binary file not shown.
93
fonts/Inter/OFL.txt
Normal file
93
fonts/Inter/OFL.txt
Normal file
@ -0,0 +1,93 @@
|
||||
Copyright 2020 The Inter Project Authors (https://github.com/rsms/inter)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
2
fonts/Inter/authors.txt
Normal file
2
fonts/Inter/authors.txt
Normal file
@ -0,0 +1,2 @@
|
||||
Rasmus Andersson
|
||||
https://github.com/rsms/inter
|
||||
93
fonts/Open_Sans/OFL.txt
Normal file
93
fonts/Open_Sans/OFL.txt
Normal file
@ -0,0 +1,93 @@
|
||||
Copyright 2020 The Open Sans Project Authors (https://github.com/googlefonts/opensans)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
BIN
fonts/Open_Sans/OpenSans-VariableFont_wdth,wght.ttf
Normal file
BIN
fonts/Open_Sans/OpenSans-VariableFont_wdth,wght.ttf
Normal file
Binary file not shown.
2
fonts/Open_Sans/authors.txt
Normal file
2
fonts/Open_Sans/authors.txt
Normal file
@ -0,0 +1,2 @@
|
||||
Steve Matteson
|
||||
https://github.com/googlefonts/opensans
|
||||
Loading…
Reference in New Issue
Block a user