Skip to content

Commit

Permalink
Expose colors, fixes StoneCypher/fsl#539
Browse files Browse the repository at this point in the history
  • Loading branch information
StoneCypher committed May 20, 2022
1 parent 2b72a30 commit 7424e53
Show file tree
Hide file tree
Showing 33 changed files with 252 additions and 3,611 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="chart1652941020272" width="16" height="9"></canvas>
<canvas id="chart1653014964044" width="16" height="9"></canvas>
</div>
<script>
const format = (num) => {
Expand All @@ -51,18 +51,18 @@
chunked.map((chunk) => chunk.join('')).join(' ') + fractionStr
)
}
const ctx1652941020272 = document
.getElementById('chart1652941020272')
const ctx1653014964044 = document
.getElementById('chart1653014964044')
.getContext('2d')
const chart1652941020272 = new Chart(ctx1652941020272, {
const chart1653014964044 = new Chart(ctx1653014964044, {
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: [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%)"],
data: [5447,13306,1352,6443,6166,6130,6013,6120,6153,25682,13844,1588,1381,10148,9340,7235,7944,56164,26759,18363,2459],
backgroundColor: ["hsl(11.640000000000004, 85%, 55%)","hsl(28.427999999999997, 85%, 55%)","hsl(2.891999999999996, 85%, 55%)","hsl(13.763999999999998, 85%, 55%)","hsl(13.176000000000004, 85%, 55%)","hsl(13.091999999999995, 85%, 55%)","hsl(12.851999999999991, 85%, 55%)","hsl(13.080000000000007, 85%, 55%)","hsl(13.151999999999992, 85%, 55%)","hsl(54.876, 85%, 55%)","hsl(29.580000000000005, 85%, 55%)","hsl(3.3959999999999977, 85%, 55%)","hsl(2.9519999999999924, 85%, 55%)","hsl(21.683999999999994, 85%, 55%)","hsl(19.955999999999992, 85%, 55%)","hsl(15.455999999999992, 85%, 55%)","hsl(16.968, 85%, 55%)","hsl(120, 85%, 55%)","hsl(57.168, 85%, 55%)","hsl(39.24, 85%, 55%)","hsl(5.255999999999995, 85%, 55%)"],
borderColor: ["hsl(11.640000000000004, 85%, 55%)","hsl(28.427999999999997, 85%, 55%)","hsl(2.891999999999996, 85%, 55%)","hsl(13.763999999999998, 85%, 55%)","hsl(13.176000000000004, 85%, 55%)","hsl(13.091999999999995, 85%, 55%)","hsl(12.851999999999991, 85%, 55%)","hsl(13.080000000000007, 85%, 55%)","hsl(13.151999999999992, 85%, 55%)","hsl(54.876, 85%, 55%)","hsl(29.580000000000005, 85%, 55%)","hsl(3.3959999999999977, 85%, 55%)","hsl(2.9519999999999924, 85%, 55%)","hsl(21.683999999999994, 85%, 55%)","hsl(19.955999999999992, 85%, 55%)","hsl(15.455999999999992, 85%, 55%)","hsl(16.968, 85%, 55%)","hsl(120, 85%, 55%)","hsl(57.168, 85%, 55%)","hsl(39.24, 85%, 55%)","hsl(5.255999999999995, 85%, 55%)"],
borderWidth: 2,
},
],
Expand Down
126 changes: 63 additions & 63 deletions benchmark/results/general.json
@@ -1,133 +1,133 @@
{
"name": "General performance suite",
"date": "2022-05-19T06:17:00.272Z",
"date": "2022-05-20T02:49:24.044Z",
"version": "1.2.0",
"results": [
{
"name": "Blind cycle a traffic light 500 times by transition",
"ops": 5573,
"margin": 2.91,
"percentSlower": 92.09
"ops": 5447,
"margin": 3.02,
"percentSlower": 90.3
},
{
"name": "Blind cycle a traffic light 500 times by action",
"ops": 12841,
"margin": 2.28,
"percentSlower": 81.77
"ops": 13306,
"margin": 2.18,
"percentSlower": 76.31
},
{
"name": "Blind cycle a basic-hooked traffic light 500 times by transition",
"ops": 1403,
"margin": 0.56,
"percentSlower": 98.01
"ops": 1352,
"margin": 0.71,
"percentSlower": 97.59
},
{
"name": "Blind cycle a named-hooked traffic light 500 times by transition",
"ops": 6646,
"margin": 0.7,
"percentSlower": 90.57
"ops": 6443,
"margin": 1.74,
"percentSlower": 88.53
},
{
"name": "Blind cycle an any-transition traffic light 500 times by transition",
"ops": 6530,
"margin": 1.01,
"percentSlower": 90.73
"ops": 6166,
"margin": 1.19,
"percentSlower": 89.02
},
{
"name": "Blind cycle an exit hooked traffic light 500 times by transition",
"ops": 6053,
"margin": 1.13,
"percentSlower": 91.41
"ops": 6130,
"margin": 1.05,
"percentSlower": 89.09
},
{
"name": "Blind cycle an enter hooked traffic light 500 times by transition",
"ops": 6221,
"margin": 0.87,
"percentSlower": 91.17
"ops": 6013,
"margin": 0.85,
"percentSlower": 89.29
},
{
"name": "Blind cycle a standard-transition hooked light by transition",
"ops": 5352,
"margin": 5.1,
"percentSlower": 92.4
"ops": 6120,
"margin": 1.46,
"percentSlower": 89.1
},
{
"name": "Blind cycle a main-transition hooked light by transition",
"ops": 6282,
"margin": 1.23,
"percentSlower": 91.08
"ops": 6153,
"margin": 1.85,
"percentSlower": 89.04
},
{
"name": "Blind cycle a force-transition hooked light by transition",
"ops": 25679,
"margin": 1.65,
"percentSlower": 63.55
"ops": 25682,
"margin": 0.64,
"percentSlower": 54.27
},
{
"name": "Blind cycle a traffic light 500 times by action",
"ops": 12823,
"margin": 2.49,
"percentSlower": 81.8
"ops": 13844,
"margin": 2.37,
"percentSlower": 75.35
},
{
"name": "Blind cycle a basic-hooked traffic light 500 times by action",
"ops": 1562,
"margin": 2.07,
"percentSlower": 97.78
"ops": 1588,
"margin": 1.55,
"percentSlower": 97.17
},
{
"name": "Blind cycle a named-hooked traffic light 500 times by action",
"ops": 1417,
"margin": 1.03,
"percentSlower": 97.99
"ops": 1381,
"margin": 1.55,
"percentSlower": 97.54
},
{
"name": "Blind cycle an any-action traffic light 500 times by action",
"ops": 10646,
"margin": 1.52,
"percentSlower": 84.89
"ops": 10148,
"margin": 1.36,
"percentSlower": 81.93
},
{
"name": "Blind cycle a global-action traffic light 500 times by action",
"ops": 11309,
"margin": 1.09,
"percentSlower": 83.95
"ops": 9340,
"margin": 4,
"percentSlower": 83.37
},
{
"name": "Blind cycle an exit hooked traffic light 500 times by action",
"ops": 10043,
"margin": 1.26,
"percentSlower": 85.74
"ops": 7235,
"margin": 3.46,
"percentSlower": 87.12
},
{
"name": "Blind cycle an enter hooked traffic light 500 times by action",
"ops": 9972,
"margin": 1.59,
"percentSlower": 85.84
"ops": 7944,
"margin": 3.74,
"percentSlower": 85.86
},
{
"name": "Blind cycle a standard transition tl 500 times by action",
"ops": 70441,
"margin": 0.76,
"ops": 56164,
"margin": 4.62,
"percentSlower": 0
},
{
"name": "Blind cycle a main transition tl 500 times by action",
"ops": 67634,
"margin": 0.89,
"percentSlower": 3.98
"ops": 26759,
"margin": 5.9,
"percentSlower": 52.36
},
{
"name": "Blind cycle a forced transition tl 500 times by action",
"ops": 68815,
"margin": 0.78,
"percentSlower": 2.31
"ops": 18363,
"margin": 15.8,
"percentSlower": 67.3
},
{
"name": "Kitchen Sink 500 times",
"ops": 9570,
"margin": 0.63,
"percentSlower": 86.41
"ops": 2459,
"margin": 8.3,
"percentSlower": 95.62
}
],
"fastest": {
Expand Down
4 changes: 2 additions & 2 deletions dist/es6/jssm.d.ts
Expand Up @@ -2,7 +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 { shapes, gviz_shapes, named_colors } 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 @@ -131,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, shapes, gviz_shapes };
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, named_colors };
4 changes: 2 additions & 2 deletions dist/es6/jssm.js
@@ -1,7 +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 { shapes, gviz_shapes, named_colors } 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 @@ -1041,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, shapes, gviz_shapes };
seq, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, shapes, gviz_shapes, named_colors };
3 changes: 2 additions & 1 deletion dist/es6/jssm_constants.d.ts
@@ -1,3 +1,4 @@
declare const gviz_shapes: string[];
declare const shapes: string[];
export { gviz_shapes, shapes };
declare const named_colors: string[];
export { gviz_shapes, shapes, named_colors };
31 changes: 30 additions & 1 deletion dist/es6/jssm_constants.js
Expand Up @@ -61,4 +61,33 @@ const gviz_shapes = [
"record"
];
const shapes = gviz_shapes;
export { gviz_shapes, shapes };
const named_colors = [
"AliceBlue", "AntiqueWhite", "Aqua", "Aquamarine", "Azure", "Beige",
"Bisque", "Black", "BlanchedAlmond", "Blue", "BlueViolet", "Brown",
"BurlyWood", "CadetBlue", "Chartreuse", "Chocolate", "Coral",
"CornflowerBlue", "Cornsilk", "Crimson", "Cyan", "DarkBlue", "DarkCyan",
"DarkGoldenRod", "DarkGray", "DarkGrey", "DarkGreen", "DarkKhaki",
"DarkMagenta", "DarkOliveGreen", "Darkorange", "DarkOrchid", "DarkRed",
"DarkSalmon", "DarkSeaGreen", "DarkSlateBlue", "DarkSlateGray",
"DarkSlateGrey", "DarkTurquoise", "DarkViolet", "DeepPink", "DeepSkyBlue",
"DimGray", "DimGrey", "DodgerBlue", "FireBrick", "FloralWhite", "ForestGreen",
"Fuchsia", "Gainsboro", "GhostWhite", "Gold", "GoldenRod", "Gray", "Grey",
"Green", "GreenYellow", "HoneyDew", "HotPink", "IndianRed", "Indigo", "Ivory",
"Khaki", "Lavender", "LavenderBlush", "LawnGreen", "LemonChiffon",
"LightBlue", "LightCoral", "LightCyan", "LightGoldenRodYellow", "LightGray",
"LightGrey", "LightGreen", "LightPink", "LightSalmon", "LightSeaGreen",
"LightSkyBlue", "LightSlateGray", "LightSlateGrey", "LightSteelBlue",
"LightYellow", "Lime", "LimeGreen", "Linen", "Magenta", "Maroon",
"MediumAquaMarine", "MediumBlue", "MediumOrchid", "MediumPurple",
"MediumSeaGreen", "MediumSlateBlue", "MediumSpringGreen", "MediumTurquoise",
"MediumVioletRed", "MidnightBlue", "MintCream", "MistyRose", "Moccasin",
"NavajoWhite", "Navy", "OldLace", "Olive", "OliveDrab", "Orange", "OrangeRed",
"Orchid", "PaleGoldenRod", "PaleGreen", "PaleTurquoise", "PaleVioletRed",
"PapayaWhip", "PeachPuff", "Peru", "Pink", "Plum", "PowderBlue", "Purple",
"Red", "RosyBrown", "RoyalBlue", "SaddleBrown", "Salmon", "SandyBrown",
"SeaGreen", "SeaShell", "Sienna", "Silver", "SkyBlue", "SlateBlue",
"SlateGray", "SlateGrey", "Snow", "SpringGreen", "SteelBlue", "Tan", "Teal",
"Thistle", "Tomato", "Turquoise", "Violet", "Wheat", "White", "WhiteSmoke",
"Yellow", "YellowGreen"
];
export { gviz_shapes, shapes, named_colors };
2 changes: 1 addition & 1 deletion dist/es6/version.js
@@ -1,2 +1,2 @@
const version = "5.64.0";
const version = "5.64.1";
export { version };
2 changes: 1 addition & 1 deletion dist/jssm.es5.cjs.js

Large diffs are not rendered by default.

32 changes: 31 additions & 1 deletion dist/jssm.es5.cjs.nonmin.js
Expand Up @@ -966,6 +966,35 @@ const gviz_shapes = [
"record"
];
const shapes = gviz_shapes;
const named_colors = [
"AliceBlue", "AntiqueWhite", "Aqua", "Aquamarine", "Azure", "Beige",
"Bisque", "Black", "BlanchedAlmond", "Blue", "BlueViolet", "Brown",
"BurlyWood", "CadetBlue", "Chartreuse", "Chocolate", "Coral",
"CornflowerBlue", "Cornsilk", "Crimson", "Cyan", "DarkBlue", "DarkCyan",
"DarkGoldenRod", "DarkGray", "DarkGrey", "DarkGreen", "DarkKhaki",
"DarkMagenta", "DarkOliveGreen", "Darkorange", "DarkOrchid", "DarkRed",
"DarkSalmon", "DarkSeaGreen", "DarkSlateBlue", "DarkSlateGray",
"DarkSlateGrey", "DarkTurquoise", "DarkViolet", "DeepPink", "DeepSkyBlue",
"DimGray", "DimGrey", "DodgerBlue", "FireBrick", "FloralWhite", "ForestGreen",
"Fuchsia", "Gainsboro", "GhostWhite", "Gold", "GoldenRod", "Gray", "Grey",
"Green", "GreenYellow", "HoneyDew", "HotPink", "IndianRed", "Indigo", "Ivory",
"Khaki", "Lavender", "LavenderBlush", "LawnGreen", "LemonChiffon",
"LightBlue", "LightCoral", "LightCyan", "LightGoldenRodYellow", "LightGray",
"LightGrey", "LightGreen", "LightPink", "LightSalmon", "LightSeaGreen",
"LightSkyBlue", "LightSlateGray", "LightSlateGrey", "LightSteelBlue",
"LightYellow", "Lime", "LimeGreen", "Linen", "Magenta", "Maroon",
"MediumAquaMarine", "MediumBlue", "MediumOrchid", "MediumPurple",
"MediumSeaGreen", "MediumSlateBlue", "MediumSpringGreen", "MediumTurquoise",
"MediumVioletRed", "MidnightBlue", "MintCream", "MistyRose", "Moccasin",
"NavajoWhite", "Navy", "OldLace", "Olive", "OliveDrab", "Orange", "OrangeRed",
"Orchid", "PaleGoldenRod", "PaleGreen", "PaleTurquoise", "PaleVioletRed",
"PapayaWhip", "PeachPuff", "Peru", "Pink", "Plum", "PowderBlue", "Purple",
"Red", "RosyBrown", "RoyalBlue", "SaddleBrown", "Salmon", "SandyBrown",
"SeaGreen", "SeaShell", "Sienna", "Silver", "SkyBlue", "SlateBlue",
"SlateGray", "SlateGrey", "Snow", "SpringGreen", "SteelBlue", "Tan", "Teal",
"Thistle", "Tomato", "Turquoise", "Violet", "Wheat", "White", "WhiteSmoke",
"Yellow", "YellowGreen"
];

/*
* Generated by PEG.js 0.10.0.
Expand Down Expand Up @@ -15950,7 +15979,7 @@ function peg$parse(input, options) {
}
}

const version = "5.64.0";
const version = "5.64.1";

class JssmError extends Error {
constructor(machine, message, JEEI) {
Expand Down Expand Up @@ -17024,6 +17053,7 @@ exports.from = from;
exports.gviz_shapes = gviz_shapes;
exports.histograph = histograph;
exports.make = make;
exports.named_colors = named_colors;
exports.parse = wrap_parse;
exports.seq = seq;
exports.shapes = shapes;
Expand Down
2 changes: 1 addition & 1 deletion dist/jssm.es5.iife.js

Large diffs are not rendered by default.

0 comments on commit 7424e53

Please sign in to comment.