From 431d70a7fe66c6a78f6e474bf46db67b42bd7baf Mon Sep 17 00:00:00 2001 From: Andrew Michael McNutt Date: Mon, 18 Mar 2024 15:13:24 -0700 Subject: [PATCH] Tour --- package.json | 4 +- public/lint-schema.json | 54 ++++++- src/App.svelte | 15 +- src/content-modules/LeftPanel.svelte | 4 +- src/content-modules/MainColumn.svelte | 2 +- src/content-modules/TourProvider.svelte | 194 ++++++++++++++++++++++++ src/lib/lints/muth-guidelines.ts | 2 +- src/scatterplot/ColorScatterPlot.svelte | 2 +- src/stores/config-store.ts | 27 ++-- src/stores/lint-store.ts | 3 +- yarn.lock | 19 +-- 11 files changed, 284 insertions(+), 42 deletions(-) create mode 100644 src/content-modules/TourProvider.svelte diff --git a/package.json b/package.json index ff5c7896..56055398 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "test": "vitest run", "test:watch": "vitest", "test:coverage": "vitest run --coverage", - "gen-schema": "npx ts-json-schema-generator --path src/lib/lint-language/lint-type.ts --type LintProgram > public/lint-schema.json --minify && ts-node-esm scripts/pretty-schema.ts" + "gen-schema": "npx ts-json-schema-generator --path src/lib/lint-language/lint-type.ts --type LintProgram > public/lint-schema.json --minify && vite-node scripts/pretty-schema.ts" }, "devDependencies": { "@sveltejs/vite-plugin-svelte": "^3.0.0", @@ -31,7 +31,6 @@ "svelte": "^4.2.3", "svelte-check": "^3.6.0", "ts-json-schema-generator": "^1.5.0", - "ts-node": "^10.9.2", "tslib": "^2.6.2", "typescript": "^5.2.2", "vega-typings": "^1.0.1", @@ -45,6 +44,7 @@ "colorjs.io": "^0.5.0", "d3-scale": "^4.0.2", "d3-shape": "^3.2.0", + "driver.js": "^1.3.1", "fracturedjsonjs": "^3.1.0", "idb-keyval": "^6.2.1", "jsonc-parser": "^3.2.1", diff --git a/public/lint-schema.json b/public/lint-schema.json index b33868c7..5cf22382 100644 --- a/public/lint-schema.json +++ b/public/lint-schema.json @@ -54,6 +54,20 @@ "required": ["first"], "type": "object" }, + { + "additionalProperties": false, + "properties": { + "middle": { + "anyOf": [ + {"$ref": "#/definitions/LintVariable"} , + { "items": {"$ref": "#/definitions/LintValue"}, "type": "array" }, + {"$ref": "#/definitions/LintMap"} + ] + } + }, + "required": ["middle"], + "type": "object" + }, { "additionalProperties": false, "properties": { @@ -187,7 +201,11 @@ "channel": {"$ref": "#/definitions/ColorChannel"}, "space": {"$ref": "#/definitions/ColorSpace"}, "toSpace": { - "anyOf": [ {"$ref": "#/definitions/LintVariable"}, {"$ref": "#/definitions/LintColor"} ] + "anyOf": [ + {"$ref": "#/definitions/LintVariable" }, + {"$ref": "#/definitions/LintColor" }, + {"$ref": "#/definitions/LintAggregate"} + ] } }, "required": ["toSpace", "space", "channel"], @@ -196,7 +214,11 @@ {"$ref": "#/definitions/LintColorTagCheck"}, { "additionalProperties": { - "anyOf": [ {"$ref": "#/definitions/LintVariable"}, {"type": "string"} ] + "anyOf": [ + {"$ref": "#/definitions/LintVariable" }, + {"$ref": "#/definitions/LintAggregate" }, + { "type": "string"} + ] }, "type": "object" } @@ -388,7 +410,7 @@ { "additionalProperties": false, "properties": { - "filter": {"$ref": "#/definitions/alias-1448761563-3892-3953-1448761563-0-6459"}, + "filter": {"$ref": "#/definitions/alias-1448761563-3969-4030-1448761563-0-6599"}, "func" : {"$ref": "#/definitions/LintExpression"} , "varb" : {"type": "string"} }, @@ -399,7 +421,7 @@ "additionalProperties": false, "properties": { "func": {"$ref": "#/definitions/LintValue"} , - "map" : {"$ref": "#/definitions/alias-1448761563-3892-3953-1448761563-0-6459"}, + "map" : {"$ref": "#/definitions/alias-1448761563-3969-4030-1448761563-0-6599"}, "varb": {"type": "string"} }, "required": ["map", "func", "varb"], @@ -408,7 +430,7 @@ { "additionalProperties": false, "properties": { - "reverse": {"$ref": "#/definitions/alias-1448761563-3892-3953-1448761563-0-6459"} + "reverse": {"$ref": "#/definitions/alias-1448761563-3969-4030-1448761563-0-6599"} }, "required": ["reverse"], "type": "object" @@ -417,7 +439,7 @@ "additionalProperties": false, "properties": { "func": {"$ref": "#/definitions/LintValue"} , - "sort": {"$ref": "#/definitions/alias-1448761563-3892-3953-1448761563-0-6459"}, + "sort": {"$ref": "#/definitions/alias-1448761563-3969-4030-1448761563-0-6599"}, "varb": {"type": "string"} }, "required": ["sort", "func", "varb"], @@ -425,7 +447,7 @@ }, { "additionalProperties": false, - "properties": { "speed": {"$ref": "#/definitions/alias-1448761563-3892-3953-1448761563-0-6459"} }, + "properties": { "speed": {"$ref": "#/definitions/alias-1448761563-3969-4030-1448761563-0-6599"} }, "required": ["speed"], "type": "object" } @@ -497,6 +519,22 @@ "required": ["/"], "type": "object" }, + { + "additionalProperties": false, + "properties": { + "//": { + "additionalProperties": false, + "properties": { + "left" : {"$ref": "#/definitions/LintValue"}, + "right": {"$ref": "#/definitions/LintValue"} + }, + "required": ["left", "right"], + "type": "object" + } + }, + "required": ["//"], + "type": "object" + }, { "additionalProperties": false, "properties": { @@ -740,7 +778,7 @@ "description": "A LintValue is a JSON object that represents a value. It can be a string, a number, a boolean, a LintColor, a LintVariable, a LintMathOps, a LintPairOps, a LintAggregate, a LintColorFunction or a LintExpression" }, "LintVariable": {"type": "string"}, - "alias-1448761563-3892-3953-1448761563-0-6459": { + "alias-1448761563-3969-4030-1448761563-0-6599": { "anyOf": [ {"$ref": "#/definitions/LintVariable"} , { "items": {"$ref": "#/definitions/LintValue"}, "type": "array" }, diff --git a/src/App.svelte b/src/App.svelte index de44c7af..a98cd5e4 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -28,6 +28,8 @@ import SetSimulation from "./controls/SetSimulation.svelte"; import Zoom from "./controls/Zoom.svelte"; import Browse from "./content-modules/Browse.svelte"; + import TourProvider from "./content-modules/TourProvider.svelte"; + import { buttonStyle } from "./lib/styles"; const tabs = ["examples", "compare", "eval"]; // const tabs = ["examples", "compare", "eval", "browse"]; @@ -76,6 +78,14 @@
+
+ +
{#if $configStore.route !== "browse"} {#if palPresent} @@ -91,7 +101,7 @@ {/if} -
+