Skip to content

Commit

Permalink
Merge pull request #473 from StoneCypher/ExposeShapes
Browse files Browse the repository at this point in the history
Shapes are now exposed, fixes StoneCypher/fsl#538
  • Loading branch information
StoneCypher committed May 20, 2022
2 parents 9cbc5d7 + 07cf833 commit 2b72a30
Show file tree
Hide file tree
Showing 22 changed files with 379 additions and 100 deletions.
14 changes: 7 additions & 7 deletions benchmark/results/general.chart.html
Expand Up @@ -28,7 +28,7 @@
</head>
<body>
<div class="container">
<canvas id="chart1652678790258" width="16" height="9"></canvas>
<canvas id="chart1652941020272" width="16" height="9"></canvas>
</div>
<script>
const format = (num) => {
Expand All @@ -51,18 +51,18 @@
chunked.map((chunk) => chunk.join('')).join(' ') + fractionStr
)
}
const ctx1652678790258 = document
.getElementById('chart1652678790258')
const ctx1652941020272 = document
.getElementById('chart1652941020272')
.getContext('2d')
const chart1652678790258 = new Chart(ctx1652678790258, {
const chart1652941020272 = new Chart(ctx1652941020272, {
type: 'bar',
data: {
labels: ["Blind cycle a traffic light 500 times by transition","Blind cycle a traffic light 500 times by action","Blind cycle a basic-hooked traffic light 500 times by transition","Blind cycle a named-hooked traffic light 500 times by transition","Blind cycle an any-transition traffic light 500 times by transition","Blind cycle an exit hooked traffic light 500 times by transition","Blind cycle an enter hooked traffic light 500 times by transition","Blind cycle a standard-transition hooked light by transition","Blind cycle a main-transition hooked light by transition","Blind cycle a force-transition hooked light by transition","Blind cycle a traffic light 500 times by action","Blind cycle a basic-hooked traffic light 500 times by action","Blind cycle a named-hooked traffic light 500 times by action","Blind cycle an any-action traffic light 500 times by action","Blind cycle a global-action traffic light 500 times by action","Blind cycle an exit hooked traffic light 500 times by action","Blind cycle an enter hooked traffic light 500 times by action","Blind cycle a standard transition tl 500 times by action","Blind cycle a main transition tl 500 times by action","Blind cycle a forced transition tl 500 times by action","Kitchen Sink 500 times"],
datasets: [
{
data: [2939,6873,740,2962,2773,2648,2622,3199,3102,10456,7734,799,732,4709,5223,4320,4420,36709,35570,34510,4020],
backgroundColor: ["hsl(9.612000000000005, 85%, 55%)","hsl(22.464, 85%, 55%)","hsl(2.4239999999999955, 85%, 55%)","hsl(9.683999999999992, 85%, 55%)","hsl(9.059999999999997, 85%, 55%)","hsl(8.651999999999994, 85%, 55%)","hsl(8.568000000000001, 85%, 55%)","hsl(10.451999999999993, 85%, 55%)","hsl(10.140000000000004, 85%, 55%)","hsl(34.17600000000001, 85%, 55%)","hsl(25.283999999999992, 85%, 55%)","hsl(2.6160000000000085, 85%, 55%)","hsl(2.3879999999999937, 85%, 55%)","hsl(15.395999999999997, 85%, 55%)","hsl(17.076000000000004, 85%, 55%)","hsl(14.123999999999995, 85%, 55%)","hsl(14.448000000000008, 85%, 55%)","hsl(120, 85%, 55%)","hsl(116.28000000000002, 85%, 55%)","hsl(112.81200000000001, 85%, 55%)","hsl(13.140000000000004, 85%, 55%)"],
borderColor: ["hsl(9.612000000000005, 85%, 55%)","hsl(22.464, 85%, 55%)","hsl(2.4239999999999955, 85%, 55%)","hsl(9.683999999999992, 85%, 55%)","hsl(9.059999999999997, 85%, 55%)","hsl(8.651999999999994, 85%, 55%)","hsl(8.568000000000001, 85%, 55%)","hsl(10.451999999999993, 85%, 55%)","hsl(10.140000000000004, 85%, 55%)","hsl(34.17600000000001, 85%, 55%)","hsl(25.283999999999992, 85%, 55%)","hsl(2.6160000000000085, 85%, 55%)","hsl(2.3879999999999937, 85%, 55%)","hsl(15.395999999999997, 85%, 55%)","hsl(17.076000000000004, 85%, 55%)","hsl(14.123999999999995, 85%, 55%)","hsl(14.448000000000008, 85%, 55%)","hsl(120, 85%, 55%)","hsl(116.28000000000002, 85%, 55%)","hsl(112.81200000000001, 85%, 55%)","hsl(13.140000000000004, 85%, 55%)"],
data: [5573,12841,1403,6646,6530,6053,6221,5352,6282,25679,12823,1562,1417,10646,11309,10043,9972,70441,67634,68815,9570],
backgroundColor: ["hsl(9.491999999999996, 85%, 55%)","hsl(21.876000000000005, 85%, 55%)","hsl(2.3879999999999937, 85%, 55%)","hsl(11.316000000000008, 85%, 55%)","hsl(11.123999999999995, 85%, 55%)","hsl(10.308000000000003, 85%, 55%)","hsl(10.595999999999998, 85%, 55%)","hsl(9.119999999999994, 85%, 55%)","hsl(10.704000000000002, 85%, 55%)","hsl(43.74000000000001, 85%, 55%)","hsl(21.840000000000003, 85%, 55%)","hsl(2.6639999999999984, 85%, 55%)","hsl(2.412000000000006, 85%, 55%)","hsl(18.131999999999998, 85%, 55%)","hsl(19.259999999999998, 85%, 55%)","hsl(17.11200000000001, 85%, 55%)","hsl(16.991999999999997, 85%, 55%)","hsl(120, 85%, 55%)","hsl(115.22399999999999, 85%, 55%)","hsl(117.228, 85%, 55%)","hsl(16.308000000000003, 85%, 55%)"],
borderColor: ["hsl(9.491999999999996, 85%, 55%)","hsl(21.876000000000005, 85%, 55%)","hsl(2.3879999999999937, 85%, 55%)","hsl(11.316000000000008, 85%, 55%)","hsl(11.123999999999995, 85%, 55%)","hsl(10.308000000000003, 85%, 55%)","hsl(10.595999999999998, 85%, 55%)","hsl(9.119999999999994, 85%, 55%)","hsl(10.704000000000002, 85%, 55%)","hsl(43.74000000000001, 85%, 55%)","hsl(21.840000000000003, 85%, 55%)","hsl(2.6639999999999984, 85%, 55%)","hsl(2.412000000000006, 85%, 55%)","hsl(18.131999999999998, 85%, 55%)","hsl(19.259999999999998, 85%, 55%)","hsl(17.11200000000001, 85%, 55%)","hsl(16.991999999999997, 85%, 55%)","hsl(120, 85%, 55%)","hsl(115.22399999999999, 85%, 55%)","hsl(117.228, 85%, 55%)","hsl(16.308000000000003, 85%, 55%)"],
borderWidth: 2,
},
],
Expand Down
130 changes: 65 additions & 65 deletions benchmark/results/general.json
@@ -1,141 +1,141 @@
{
"name": "General performance suite",
"date": "2022-05-16T05:26:30.258Z",
"date": "2022-05-19T06:17:00.272Z",
"version": "1.2.0",
"results": [
{
"name": "Blind cycle a traffic light 500 times by transition",
"ops": 2939,
"margin": 3.43,
"percentSlower": 91.99
"ops": 5573,
"margin": 2.91,
"percentSlower": 92.09
},
{
"name": "Blind cycle a traffic light 500 times by action",
"ops": 6873,
"margin": 3.44,
"percentSlower": 81.28
"ops": 12841,
"margin": 2.28,
"percentSlower": 81.77
},
{
"name": "Blind cycle a basic-hooked traffic light 500 times by transition",
"ops": 740,
"margin": 3.19,
"percentSlower": 97.98
"ops": 1403,
"margin": 0.56,
"percentSlower": 98.01
},
{
"name": "Blind cycle a named-hooked traffic light 500 times by transition",
"ops": 2962,
"margin": 2.65,
"percentSlower": 91.93
"ops": 6646,
"margin": 0.7,
"percentSlower": 90.57
},
{
"name": "Blind cycle an any-transition traffic light 500 times by transition",
"ops": 2773,
"margin": 3.29,
"percentSlower": 92.45
"ops": 6530,
"margin": 1.01,
"percentSlower": 90.73
},
{
"name": "Blind cycle an exit hooked traffic light 500 times by transition",
"ops": 2648,
"margin": 5.28,
"percentSlower": 92.79
"ops": 6053,
"margin": 1.13,
"percentSlower": 91.41
},
{
"name": "Blind cycle an enter hooked traffic light 500 times by transition",
"ops": 2622,
"margin": 3.33,
"percentSlower": 92.86
"ops": 6221,
"margin": 0.87,
"percentSlower": 91.17
},
{
"name": "Blind cycle a standard-transition hooked light by transition",
"ops": 3199,
"margin": 5.23,
"percentSlower": 91.29
"ops": 5352,
"margin": 5.1,
"percentSlower": 92.4
},
{
"name": "Blind cycle a main-transition hooked light by transition",
"ops": 3102,
"margin": 4.37,
"percentSlower": 91.55
"ops": 6282,
"margin": 1.23,
"percentSlower": 91.08
},
{
"name": "Blind cycle a force-transition hooked light by transition",
"ops": 10456,
"margin": 3.01,
"percentSlower": 71.52
"ops": 25679,
"margin": 1.65,
"percentSlower": 63.55
},
{
"name": "Blind cycle a traffic light 500 times by action",
"ops": 7734,
"margin": 4.01,
"percentSlower": 78.93
"ops": 12823,
"margin": 2.49,
"percentSlower": 81.8
},
{
"name": "Blind cycle a basic-hooked traffic light 500 times by action",
"ops": 799,
"margin": 2.79,
"percentSlower": 97.82
"ops": 1562,
"margin": 2.07,
"percentSlower": 97.78
},
{
"name": "Blind cycle a named-hooked traffic light 500 times by action",
"ops": 732,
"margin": 2.67,
"percentSlower": 98.01
"ops": 1417,
"margin": 1.03,
"percentSlower": 97.99
},
{
"name": "Blind cycle an any-action traffic light 500 times by action",
"ops": 4709,
"margin": 2.78,
"percentSlower": 87.17
"ops": 10646,
"margin": 1.52,
"percentSlower": 84.89
},
{
"name": "Blind cycle a global-action traffic light 500 times by action",
"ops": 5223,
"margin": 2.81,
"percentSlower": 85.77
"ops": 11309,
"margin": 1.09,
"percentSlower": 83.95
},
{
"name": "Blind cycle an exit hooked traffic light 500 times by action",
"ops": 4320,
"margin": 3.07,
"percentSlower": 88.23
"ops": 10043,
"margin": 1.26,
"percentSlower": 85.74
},
{
"name": "Blind cycle an enter hooked traffic light 500 times by action",
"ops": 4420,
"margin": 2.6,
"percentSlower": 87.96
"ops": 9972,
"margin": 1.59,
"percentSlower": 85.84
},
{
"name": "Blind cycle a standard transition tl 500 times by action",
"ops": 36709,
"margin": 3.6,
"ops": 70441,
"margin": 0.76,
"percentSlower": 0
},
{
"name": "Blind cycle a main transition tl 500 times by action",
"ops": 35570,
"margin": 3.5,
"percentSlower": 3.1
"ops": 67634,
"margin": 0.89,
"percentSlower": 3.98
},
{
"name": "Blind cycle a forced transition tl 500 times by action",
"ops": 34510,
"margin": 3.01,
"percentSlower": 5.99
"ops": 68815,
"margin": 0.78,
"percentSlower": 2.31
},
{
"name": "Kitchen Sink 500 times",
"ops": 4020,
"margin": 4.2,
"percentSlower": 89.05
"ops": 9570,
"margin": 0.63,
"percentSlower": 86.41
}
],
"fastest": {
"name": "Blind cycle a standard transition tl 500 times by action",
"index": 17
},
"slowest": {
"name": "Blind cycle a named-hooked traffic light 500 times by action",
"index": 12
"name": "Blind cycle a basic-hooked traffic light 500 times by transition",
"index": 2
}
}
3 changes: 2 additions & 1 deletion dist/es6/jssm.d.ts
Expand Up @@ -2,6 +2,7 @@ declare type StateType = string;
import { JssmGenericState, JssmGenericConfig, JssmTransition, JssmTransitionList, // JssmTransitionRule,
JssmMachineInternalState, JssmParseTree, JssmStateDeclaration, JssmArrow, JssmArrowDirection, JssmArrowKind, JssmLayout, FslDirection, FslTheme, HookDescription, HookHandler } from './jssm_types';
import { seq, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key } from './jssm_util';
import { shapes, gviz_shapes } from './jssm_constants';
import { version } from './version';
declare function arrow_direction(arrow: JssmArrow): JssmArrowDirection;
declare function arrow_left_kind(arrow: JssmArrow): JssmArrowKind;
Expand Down Expand Up @@ -130,4 +131,4 @@ declare class Machine<mDT> {
}
declare function sm<mDT>(template_strings: TemplateStringsArray, ...remainder: any[]): Machine<mDT>;
declare function from<mDT>(MachineAsString: string, ExtraConstructorFields?: Partial<JssmGenericConfig<mDT>> | undefined): Machine<mDT>;
export { version, transfer_state_properties, Machine, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind, seq, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key };
export { version, transfer_state_properties, Machine, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind, seq, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, shapes, gviz_shapes };
3 changes: 2 additions & 1 deletion dist/es6/jssm.js
@@ -1,6 +1,7 @@
// whargarbl lots of these return arrays could/should be sets
import { reduce as reduce_to_639 } from 'reduce-to-639-1';
import { seq, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key, array_box_if_string, hook_name, named_hook_name } from './jssm_util';
import { shapes, gviz_shapes } from './jssm_constants';
import { parse } from './jssm-dot';
import { version } from './version'; // replaced from package.js in build
import { JssmError } from './jssm_error';
Expand Down Expand Up @@ -1040,4 +1041,4 @@ function from(MachineAsString, ExtraConstructorFields) {
}
export { version, transfer_state_properties, Machine, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind,
// WHARGARBL TODO these should be exported to a utility library
seq, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key };
seq, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, shapes, gviz_shapes };
3 changes: 3 additions & 0 deletions dist/es6/jssm_constants.d.ts
@@ -0,0 +1,3 @@
declare const gviz_shapes: string[];
declare const shapes: string[];
export { gviz_shapes, shapes };
64 changes: 64 additions & 0 deletions dist/es6/jssm_constants.js
@@ -0,0 +1,64 @@
const gviz_shapes = [
"box3d",
"polygon",
"ellipse",
"oval",
"circle",
"point",
"egg",
"triangle",
"plaintext",
"plain",
"diamond",
"trapezium",
"parallelogram",
"house",
"pentagon",
"hexagon",
"septagon",
"octagon",
"doublecircle",
"doubleoctagon",
"tripleoctagon",
"invtriangle",
"invtrapezium",
"invhouse",
"Mdiamond",
"Msquare",
"Mcircle",
"rectangle",
"rect",
"square",
"star",
"none",
"underline",
"cylinder",
"note",
"tab",
"folder",
"box",
"component",
"promoter",
"cds",
"terminator",
"utr",
"primersite",
"restrictionsite",
"fivepoverhang",
"threepoverhang",
"noverhang",
"assembly",
"signature",
"insulator",
"ribosite",
"rnastab",
"proteasesite",
"proteinstab",
"rpromoter",
"rarrow",
"larrow",
"lpromoter",
"record"
];
const shapes = gviz_shapes;
export { gviz_shapes, shapes };
2 changes: 1 addition & 1 deletion dist/es6/version.js
@@ -1,2 +1,2 @@
const version = "5.63.0";
const version = "5.64.0";
export { version };
2 changes: 1 addition & 1 deletion dist/jssm.es5.cjs.js

Large diffs are not rendered by default.

0 comments on commit 2b72a30

Please sign in to comment.