diff --git a/README.org b/README.org index 38c9746ad..c135bca9b 100644 --- a/README.org +++ b/README.org @@ -1,1390 +1,78 @@ -#+TITLE: Behave Polylith - -* Prerequisites - -+ OpenJDK 17 -+ [[https://github.com/babashka/babashka#installation][Babashka]] -+ [[https://clojure.org/guides/install_clojure][Clojure]] -+ Postgres (>=12) - -* Getting Started - -** Emacs/CIDER - -1. Pull down the repository (~git clone git@gitlab.com:sig-gis/behave-polylith~) -1. Pull down the submodules (~git submodule update --init --remote~) -1. Follow the Datomic Setup (see below) -1. Start the Datomic Transactor (see below) -1. Open ~development/user.cljs~ in Emacs -1. Start the CIDER nREPL ~cider-jack-in-clj&cljs~ -1. Choose ~figwheel-main~ and ~dev~ for the front-end build. -1. Open ~http://localhost:8080~ in your browser. - -* Architecture - -** Polylith -This project adopts a Polylith design, which allows both a mono-repo -experience across mulitple projects. - -*** What is a Polylith? -The [[https://polylith.gitbook.io/polylith/][Polylith]] project organization method attempts to marry the best parts of operating within a -single Monorepo (single source of truth, DRY code, less repos to manage), with -the benefits of having single repos for each project (customization). - -The Polylith design is made up of three parts: Components, Bases, and Projects. - -*** Components -This is the most basic unit for Polylith. Ideally, Components require few, if -any, dependencies. Each component always has an ~.interface~ -namespace, which includes the public functions that are meant to be exported -from the component. Components (ideally) are written in the Clojure Common (~*.cljc~) -format so as to be used in both CLJ and CLJS environments. - -*** Bases -Bases are groups of components and other dependencies that constitute a -middle-tier of the Polylith. Bases can be project-specific, but ideally are -general enough to be used across multiple projects. Bases typically -only have a ~main.clj[sc]~ file. - -*** Projects -Projects are made up of multiple bases and components. Many projects can exist -within a Polylith, which enables a great deal of customization while also -sharing components and bases across projects. - -** Components Library - -The projects take advantage of the [[https://gitlab.com/sig-gis/behave-components][Behave Components]] shared UI components -library. Check out the docs on the Behave Components page to learn more. - -** Reagent & Re-Frame - -The projects use both [[https://reagent-project.github.io/][Reagent]] and [[https://day8.github.io/re-frame][Re-Frame]] to manage application state -and application logic. Re-Frame was adopted to reduce tight coupling -between views/components and the data/actions that are used within them. - -** Datalog & Datoms - -The projects store data in Datoms and performs queries using the -Datalog syntax. The back-end access Datoms using [[https://github.com/replikativ/datahike][DataHike]], and the -front-end accesses Datoms through [[https://github.com/tonsky/datascript][DataScript]]. [[https://github.com/denistakeda/re-posh][Re-Posh]] is also used to -enable subscriptions on DataScript entities, reducing view logic. - -* Projects -** App (=projects/behave=) -*** Schema - -#+begin_src dot :results value :file projects/behave/docs/schema.png -digraph GitHub { - graph [rankdir = "LR"] - - node [shape = record] - - Tool [label="Tools - |{ :bp/uuid | string } - |{ :tool/name | string } - |{ :tool/order | number } - |{ :tool/translation-key | string } - |{ :tool/help-key | string }"] - - SubTool [label="Subtool - |{ :bp/uuid | string } - |{ :subtool/name | string } - |{ :subtool/order | number } - |{ :subtool/autocompute? | boolean } - |{ :subtool/translation-key | string } - |{ :subtool/help-key | string }"] - - SubToolVariable [label="Subtool-Variable - |{ :bp/uuid | string } - |{ :subtool-variable/io | keyword } - |{ :subtool-variable/order | number } - |{ :subtool-variable/cpp-namespace-uuid | string } - |{ :subtool-variable/cpp-mclass | string } - |{ :subtool-variable/cpp-function-uuid | string } - |{ :subtool-variable/translation-key | string } - |{ :subtool-variable/help-key | string }"] - - Variable [label="Variable - |{ :bp/uuid | string } - |{ :variable/name | string } - |{ :variable/bp6-label | string } - |{ :variable/bp6-code | string } - |{ :variable/kind | keyword} - |{ :variable/translation-key | string } - |{ :variable/native-decimals | double } - |{ :variable/english-decimals | double } - |{ :variable/metric-decimals | double } - |{ :variable/maximum | double } - |{ :variable/minimum | double } - |{ :variable/default-value | double } - |{ :variable/map-units-convertible? | double } - "] - List [label="List - |{ :bp/uuid | string } - |{ :list/name | string } - |{ :list/translation-key | string } - "] - - ListOptions [label="List-Options - |{ :bp/uuid | string } - |{ :list-option/name | string } - |{ :list-option/default | string } - |{ :list-option/value | string } - |{ :list-option/order | string } - |{ :list-option/translation-key | string } - "] - - Dimension [label="Dimension - |{ :bp/uuid | string } - |{ :dimension/name | string } - |{ :dimension/cpp-enum-uuid | string } - "] - - Unit [label="Unit - |{ :bp/uuid | string } - |{ :unit/name | string } - |{ :unit/short-code | string } - |{ :unit/system | string } - |{ :unit/cpp-enum-member-uuid | string } - "] - - DomainSet [label="Domain-Set - |{ :bp/uuid | string } - |{ :domain-set/name | string } - "] - - Domain [label="Domain - |{ :bp/uuid | string } - |{ :domain/name | string } - |{ :domain/decimals | string } - "] - - Tool -> SubTool [label=":tool/subtools" taillabel=1 headlabel=N] - SubTool -> SubToolVariable [label=":subtool/variables" taillabel=1 headlabel=N] - Variable -> SubToolVariable [label=":variable/subtool-variables" taillabel=1 headlabel=N] - Variable -> List [label=":variable/list" taillabel=1 headlabel=1] - Variable -> Domain [label=":variable/domain-uuid" taillabel=1 headlabel=1] - Variable -> Unit [label=":variable/native-unit-uuid" taillabel=1 headlabel=1] - Variable -> Unit [label=":variable/english-unit-uuid" taillabel=1 headlabel=1] - Variable -> Unit [label=":variable/metric-unit-uuid" taillabel=1 headlabel=1] - List -> ListOptions [label=":list/options" taillabel=1 headlabel=N] - Dimension -> Unit [label=":dimension/units" taillabel=1 headlabel=N] - DomainSet -> Domain [label=":domain-set/domains" taillabel=1 headlabel=N] - Domain -> Dimension [label=":domain/dimension-uuid" taillabel=1 headlabel=1] - Domain -> Unit [label=":domain/native-unit-uuid" taillabel=1 headlabel=1] - Domain -> Unit [label=":domain/english-unit-uuid" taillabel=1 headlabel=1] - Domain -> Unit [label=":domain/metric-unit-uuid" taillabel=1 headlabel=1] -} -#+end_src - -#+RESULTS: -[[file:projects/behave/docs/schema.png]] - -*** Building the Behave UberJAR - -1. Navigate to ~projects/behave~. All paths described here will use this directory as root. - -2. Add/edit the ~resources/config.edn~ for your deployment. Below is - an example file: - -#+BEGIN_SRC clojure -;; resources/config.edn -{:database {:config {:store {:backend :file - :path "~/.behave/db"}}} - :site {:title "BehavePlus 7" - :description "Wildfire Analysis toolkit."} - :server {:http-port 8007 - :mode "prod"} - :vms {:secret-token ""}} -#+END_SRC - -3. Compile ClojureScript - -#+BEGIN_SRC bash -bb build-js -#+END_SRC - -4. Build the UberJAR - -NOTE: The uberjar build process requires triangulum to be available in the deps.edn located at the -user level (i.e. /home///.clojure/deps.edn). - -#+begin_src clojure -{sig-gis/triangulum {:git/url "https://github.com/sig-gis/triangulum" - :sha ""}} -#+end_src - -#+BEGIN_SRC bash -bb uber -#+END_SRC - -4. Congratulations! You're now the owner of an UberJAR. - (i.e. ~target/behave7-2023.10.19-97f1ef9-standalone.jar~) - - -** Behave CMS (=projects/behave_cms=) - -*** Schema - -TODO - -*** Datomic Setup - -**** Download & Setup Datomic Pro -#+BEGIN_SRC bash - mkdir -p ~/.datomic - cd ~/.datomic - curl -O https://datomic-pro-downloads.s3.amazonaws.com/1.0.7075/datomic-pro-1.0.7075.zip - unzip *.zip - ln -s $PWD/datomic-pro-1.0.7075 $PWD/current - echo 'export PATH="$HOME/.datomic/current/bin:$PATH"' >> ~/.bashrc # Or ~/.zshrc -#+END_SRC - -**** Setting up PostgreSQL for Datomic - -Be sure that PostgreSQL is running on port 5432. - -#+BEGIN_SRC bash - cd /bases/datomic_store/sql/ - psql -U postgres -f 01_setup.sql # Creates the Datomic DB, User - psql -U datomic datomic -f 02_tables.sql # Sets up the KV table -#+END_SRC - -**** Running the Transactor -#+BEGIN_SRC bash - bb transactor -#+END_SRC - -**** Running the Datomic Console -#+BEGIN_SRC bash - bb console --port -#+END_SRC - -Then visit [[http://localhost:8000/browse][localhost:8000/browse]] - -**** Restoring CMS using a backup file - -#+begin_src sh -bb restore --file -#+end_src - -* Behave-Lib - -The "behave-lib" directory includes the build process for generating a WASM file using c++ code from -"behave-mirror" and "include" directories. Here's Checklist for when new c++ code needs to be -transcribed into wasm and be available via the Behave CMS. - -*** Create new WASM file -**** Updating Hatchet's idl output and copying to behave.idl - -- [ ] Run the pair of header files (i.e. surface.h and SIGSurface.h) through Hatchet (see Hatchet README). -- [ ] Replace/Edit text - - [ ] "std_string" with "[Const] DOMString" - - [ ] "string" with [Const] DOMString - - [ ] Any type ref to other classes with "[Ref] SIG" - - [ ] Add [Const] to beginning of function in behave.idl for any functions in header file ending in const. -- [ ] Copy missing functions to the SIG interface in "behave-lib/include/idl/behave.idl" -- [ ] Add new enums in "behave-lib/include/idl/behave.idl" - - [ ] For each enum in behave.idl there should be an enum entry in "src/cljs/behave/lib/enums.cljs" - -**** Updating CLJS file in Behave with Hatchet's output. - -- [ ] Add missing functions from hatchet's output cljs file to "behave/src/cljs/behave/lib/.cljs" -- [ ] Add this to the end of the file - -#+begin_src clojure -(def ^:export ns-public-fns (update-keys (ns-publics 'behave.lib.ignite) name)) -#+end_src - -**** Updating enums.cpp - -- [ ] Add mapping for new enums in "behave-lib/include/cpp/emscripten/enums.cpp" - -**** Updating behave_extern.js - -- [ ] Update behave_extern.js with functions from cljs file - -**** Create new WASM file - -- [ ] In "behave-lib" run - -#+begin_src sh -make install -#+end_src - -*** Import EDN files from hatchet into CMS - -- [ ] Both edn files have been created through hatchet (i.e. surface.edn and SIGSurface.edn) -- [ ] Run a modified version of the code block below for the module that needs updating - -#+begin_src clojure -(ns cms-import) -;; Combine edn files from hatchet -(cms-import {:behave-file "path/to/hatchet/output/surface.edn" - :sig-adapter-file "path/to/hatchet/output/SIGSurface.edn" - :out-file-name "SIGSurface.edn" - :from-key :Surface - :to-key :SIGSurface}) - -(add-export-file-to-conn "./cms-exports/SIGSurface.edn" conn) -#+end_src - -* Schema ERDs -** VMS - -This schema is used for the Behave VMS. It largely impacts the rendering UI of the Behave VMS and the Application. - -#+begin_src dot :results value :file projects/behave/docs/vms-schema.png -// Relations (NOTE when a relation attribute of type :db/type/string instead of type :db.type/ref, this means the value is a UUID that matches the :bp/uuid of the related entity.) - -digraph GitHub { - graph [rankdir = "LR"] - - node [shape = record] - - //---------------------------------------------------------------------------------------------- - // VMS Schema Starts Here - //---------------------------------------------------------------------------------------------- - - User [label="User - |{ :bp/uuid | string } - |{ :user/name | string } - |{ :user/email | string } - |{ :user/password | string } - |{ :user/reset-key | string } - |{ :user/verified? | boolean } - |{ :user/super-admin? | boolean } - |{ :user/help-key | string } - "] - - //---------------------------------------------------------------------------------------------- - - Application [label="Application - |{ :bp/uuid | string } - |{ :application/name | string } - |{ :application/version-major | number } - |{ :application/version-minor | number } - |{ :application/version-patch | number } - |{ :application/version | tuple } - |{ :application/help-key | string } - "] - Application -> Module [label=":application/modules" taillabel=1 headlabel=N] - Application -> Tool [label=":application/tools" taillabel=1 headlabel=N] - Application -> HelpPage [label=":application/help-key" taillabel=1 headlabel=1] - Application -> Translation [label=":application/translation-key" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - Module [label="Module - |{ :bp/uuid | string } - |{ :module/name | string } - |{ :module/order | number } - "] - Module -> Submodule [label=":module/submodules" taillabel=1 headlabel=N] - Module -> Diagram [label=":module/diagram" taillabel=1 headlabel=N] - Module -> HelpPage [label=":module/help-key" taillabel=1 headlabel=1] - Module -> Translation [label=":module/translation-key" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - Submodule [label="Submodule - |{ :bp/uuid | string } - |{ :submodule/name | string } - |{ :submodule/order | number } - |{ :submodule/io | keyword } - |{ :submodule/research? | boolean } - |{ :submodule/conditionals-operator | keyword } - "] - Submodule -> Group [label=":submodule/groups" taillabel=1 headlabel=N] - Submodule -> Conditional [label=":submodule/conditionals" taillabel=1 headlabel=N] - Submodule -> HelpPage [label=":submodule/help-key" taillabel=1 headlabel=1] - Submodule -> Translation [label=":submodule/translation-key" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - Group [label="Group - |{ :bp/uuid | string } - |{ :group/name | string } - |{ :group/order | long } - |{ :group/io | keyword } - |{ :group/research? | boolean } - |{ :group/repeat? | boolean } - |{ :group/max-repeat | long } - |{ :group/conditionals-operator | keyword } - "] - Group -> Group [label=":group/children" taillabel=1 headlabel=1] - Group -> Conditional [label=":group/conditionals" taillabel=1 headlabel=N] - Group -> GroupVariable [label=":group/group-variables" taillabel=1 headlabel=N] - Group -> HelpPage [label=":group/help-key" taillabel=1 headlabel=1] - Group -> Translation [label=":group/translation-key" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - GroupVariable [label="Group-Variable - |{ :bp/uuid | string } - |{ :group-variable/cpp-class | string } - |{ :group-variable/cpp-function | string } - |{ :group-variable/cpp-namespace | string } - |{ :group-variable/cpp-parameter | string } - |{ :group-variable/order | long} - |{ :group-variable/research? | boolean } - "] - GroupVariable -> CppClass [label=":group-variable/cpp-class (uuid)" taillabel=1 headlabel=1] - GroupVariable -> CppFunction [label=":group-variable/cpp-function (uuid)" taillabel=1 headlabel=1] - GroupVariable -> CppNamespace [label=":group-variable/cpp-namespace (uuid)" taillabel=1 headlabel=1] - GroupVariable -> CppParameter [label=":group-variable/cpp-parameter (uuid)" taillabel=1 headlabel=1] - GroupVariable -> HelpPage [label=":group-variable/help-key" taillabel=1 headlabel=1] - GroupVariable -> Translation [label=":group-variable/translation-key" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - CppClass [label="Cpp.Class - |{ :bp/uuid | string } - |{ :cpp.class/name | string } - "] - CppClass -> CppFunction [label=":cpp.class/function" taillabel=1 headlabel=N] - - //---------------------------------------------------------------------------------------------- - - CppFunction [label="Cpp.Function - |{ :bp/uuid | string } - |{ :cpp.function/name | string } - |{ :cpp.function/return-type | stringema} - "] - CppFunction -> CppParameter [label=":cpp.function/parameter" taillabel=1 headlabel=N] - - //---------------------------------------------------------------------------------------------- - - CppParameter [label="Cpp.Parameter - |{ :bp/uuid | string } - |{ :cpp.parameter/name | string } - |{ :cpp.parameter/order | number } - |{ :cpp.parameter/type | string } - "] - - //---------------------------------------------------------------------------------------------- - - CppNamespace [label="Cpp.Namespace - |{ :bp/uuid | string } - |{ :cpp.namespace/name | string } - "] - CppNamespace -> CppClass [label=":cpp.namespace/class" taillabel=1 headlabel=N] - CppNamespace -> CppEnum [label=":cpp.namespace/enum" taillabel=1 headlabel=N] - - //---------------------------------------------------------------------------------------------- - - CppEnum [label="Cpp.Enum - |{ :bp/uuid | string } - |{ :cpp.enum/name | string } - "] - CppEnum -> CppEnumMember [label=":cpp.enum/enum-member" taillabel=1 headlabel=N] - - //---------------------------------------------------------------------------------------------- - - CppEnumMember [label="Cpp.Enum-member - |{ :bp/uuid | string } - |{ :cpp.enum-member/name | string } - |{ :cpp.enum-member/value | number } - "] - - //---------------------------------------------------------------------------------------------- - - Tool [label="Tools - |{ :bp/uuid | string } - |{ :tool/name | string } - |{ :tool/order | number } - "] - Tool -> SubTool [label=":tool/subtools" taillabel=1 headlabel=N] - Tool -> HelpPage [label=":tool/help-key" taillabel=1 headlabel=1] - Tool -> Translation [label=":tool/translation-key" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - SubTool [label="Subtool - |{ :bp/uuid | string } - |{ :subtool/name | string } - |{ :subtool/order | number } - |{ :subtool/autocompute? | boolean } - "] - SubTool -> SubToolVariable [label=":subtool/variables" taillabel=1 headlabel=N] - SubTool -> HelpPage [label=":subtool/help-key" taillabel=1 headlabel=1] - SubTool -> Translation [label=":subtool/translation-key" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - SubToolVariable [label="Subtool-Variable - |{ :bp/uuid | string } - |{ :subtool-variable/io | keyword } - |{ :subtool-variable/order | long } - |{ :subtool-variable/cpp-namespace-uuid | string } - |{ :subtool-variable/cpp-mclass | string } - |{ :subtool-variable/cpp-function-uuid | string } - "] - SubToolVariable -> HelpPage [label=":subtool-variable/help-key" taillabel=1 headlabel=1] - SubToolVariable -> Translation [label=":subtool-variable/translation-key" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - Variable [label="Variable - |{ :bp/uuid | string } - |{ :variable/name | string } - |{ :variable/bp6-label | string } - |{ :variable/bp6-code | string } - |{ :variable/kind | keyword} - |{ :variable/native-decimals | double } - |{ :variable/english-decimals | double } - |{ :variable/metric-decimals | double } - |{ :variable/maximum | double } - |{ :variable/minimum | double } - |{ :variable/default-value | double } - |{ :variable/map-units-convertible? | boolean } - "] - Variable -> GroupVariable [label=":variable/group-variables" taillabel=1 headlabel=N] - Variable -> SubToolVariable [label=":variable/subtool-variables" taillabel=1 headlabel=N] - Variable -> List [label=":variable/list" taillabel=1 headlabel=1] - Variable -> Domain [label=":variable/domain-uuid" taillabel=1 headlabel=1] - Variable -> Unit [label=":variable/native-unit-uuid" taillabel=1 headlabel=1] - Variable -> Unit [label=":variable/english-unit-uuid" taillabel=1 headlabel=1] - Variable -> Unit [label=":variable/metric-unit-uuid" taillabel=1 headlabel=1] - Variable -> Translation [label=":variable/translation-key" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - List [label="List - |{ :bp/uuid | string } - |{ :list/name | string } - "] - List -> ListOption [label=":list/options" taillabel=1 headlabel=N] - List -> Translation [label=":list/translation-key" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - ListOption [label="List-Option - |{ :bp/uuid | string } - |{ :list-option/name | string } - |{ :list-option/default | string } - |{ :list-option/value | string } - |{ :list-option/order | long } - |{ :list-option/hide? | boolean } - "] - ListOption -> Translation [label=":list-option/translation-key" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - Dimension [label="Dimension - |{ :bp/uuid | string } - |{ :dimension/name | string } - |{ :dimension/cpp-enum-uuid | string } - "] - Dimension -> Unit [label=":dimension/units" taillabel=1 headlabel=N] - - //---------------------------------------------------------------------------------------------- - - Unit [label="Unit - |{ :bp/uuid | string } - |{ :unit/name | string } - |{ :unit/short-code | string } - |{ :unit/system | string } - |{ :unit/cpp-enum-member-uuid | string } - "] - - //---------------------------------------------------------------------------------------------- - - DomainSet [label="Domain-Set - |{ :bp/uuid | string } - |{ :domain-set/name | string } - "] - DomainSet -> Domain [label=":domain-set/domains" taillabel=1 headlabel=N] - - //---------------------------------------------------------------------------------------------- - - Domain [label="Domain - |{ :bp/uuid | string } - |{ :domain/name | string } - |{ :domain/decimals | string } - "] - Domain -> Dimension [label=":domain/dimension-uuid" taillabel=1 headlabel=1] - Domain -> Unit [label=":domain/native-unit-uuid" taillabel=1 headlabel=1] - Domain -> Unit [label=":domain/english-unit-uuid" taillabel=1 headlabel=1] - Domain -> Unit [label=":domain/metric-unit-uuid" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - Conditional [label="Conditional - |{ :bp/uuid | string } - |{ :conditional/type | keyword } - |{ :conditional/operator | keyword } - |{ :conditional/values | string } - "] - Conditional -> GroupVariable [label=":conditional/group-variable-uuid" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - Diagram [label="Diagram - |{ :bp/uuid | keyword } - |{ :diagram/type | string } - "] - Diagram -> GroupVariable [label=":diagram/group-variable" taillabel=1 headlabel=1] - Diagram -> GroupVariable [label=":diagram/input-group-variables" taillabel=1 headlabel=N] - Diagram -> GroupVariable [label=":diagram/output-group-variables" taillabel=1 headlabel=N] - - //---------------------------------------------------------------------------------------------- - - Language [label="Language - |{ :bp/uuid | keyword } - |{ :language/name | string } - |{ :language/short-code | string } - "] - Language -> Translation [label=":language/translation" taillabel=1 headlabel=1] - Language -> HelpPage [label=":language/help-page" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - Translation [label="Translation - |{ :bp/uuid | keyword } - |{ :translation/name | string } - |{ :translation/key | string } - |{ :translation/translation | string } - "] - - //---------------------------------------------------------------------------------------------- - - HelpPage [label="Help-page - |{ :bp/uuid | keyword } - |{ :help-page/key | string } - |{ :help-page/content | string } - "] - - //---------------------------------------------------------------------------------------------- - - Link [label="Link - |{ :bp/uuid | keyword } - "] - Link -> GroupVariable [label="link/source" taillabel=1 headlabel=1] - Link -> GroupVariable [label="link/destination" taillabel=1 headlabel=1] -} -#+end_src - -#+RESULTS: -[[file:projects/behave/docs/vms-schema.png]] - -** Worksheet - -This schema is used to store instances of worksheet information in the Behave application. - -#+begin_src dot :results value :file projects/behave/docs/worksheet-schema.png -// Relations (NOTE when a relation attribute of type :db/type/string instead of type :db.type/ref, this means the value is a UUID that matches the :bp/uuid of the related entity.) - -digraph GitHub { - graph [rankdir = "LR"] - - node [shape = record] - - //---------------------------------------------------------------------------------------------- - // Worksheet Schema Starts Here - //---------------------------------------------------------------------------------------------- - - Worksheet [label="Worksheet - |{ :bp/uuid | string } - |{ :worksheet/run-description | string } - |{ :worksheet/name | string } - |{ :worksheet/created | long } - |{ :worksheet/furthest-visited-step | keyword } - |{ :worksheet/modules | keywords } - "] - Worksheet -> Note [label=":worksheet/notes" taillabel=1 headlabel=N] - Worksheet -> InputGroup [label=":worksheet/input-groups" taillabel=1 headlabel=N] - Worksheet -> RepeatGroup [label=":worksheet/repeat-groups" taillabel=1 headlabel=N] - Worksheet -> Output [label=":worksheet/outputs" taillabel=1 headlabel=N] - Worksheet -> ResultTable [label=":worksheet/result-table" taillabel=1 headlabel=1] - Worksheet -> GraphSettings [label=":worksheet/graph-settings" taillabel=1 headlabel=1] - Worksheet -> TableSettings [label=":worksheet/table-settings" taillabel=1 headlabel=1] - Worksheet -> WorksheetDiagram [label=":worksheet/diagrams" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - Note [label="Note - |{ :bp/uuid | string } - |{ :note/name | string } - |{ :note/content | string } - |{ :note/submodule | string } - "] - - //---------------------------------------------------------------------------------------------- - - InputGroup [label="Input-Group - |{ :bp/uuid | string } - |{ :input-group/repeat-id | long } - |{ :input-group/inputs | long } - "] - InputGroup -> Group [label=":input-group/group-uuid" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - RepeatGroup [label="Repeat-Group - |{ :bp/uuid | string } - |{ :repeat-group/group-uuid | string } - |{ :repeat-group/repeats | long } - |{ :repeat-group/inputs | long } - "] - RepeatGroup -> Group [label=":repeat-group/group-uuid" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - Output [label="Output - |{ :bp/uuid | string } - |{ :output/enabled? | boolean } - "] - Output -> GroupVariable [label=":output/group-variable-uuid" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - ResultTable [label="Result-Table - |{ :bp/uuid | string } - "] - ResultTable -> ResultHeader [label=":result-table/headers" taillabel=1 headlabel=N] - ResultTable -> ResultRow [label=":result-table/rows" taillabel=1 headlabel=N] - - //---------------------------------------------------------------------------------------------- - - ResultHeader [label="Result-Header - |{ :bp/uuid | string } - |{ :result-header/repeat-id | long } - |{ :result-header/order | long } - |{ :result-header/units | string } - "] - ResultHeader -> GroupVariable [label=":result-header/group-variable-uuid" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - ResultRow [label="Result-Row - |{ :bp/uuid | string } - |{ :result-row/id | long } - "] - ResultRow -> ResultCell [label=":result-row/cells" taillabel=1 headlabel=N] - - //---------------------------------------------------------------------------------------------- - - ResultCell [label="Result-Cell - |{ :bp/uuid | string } - |{ :result-cell/value | string } - "] - ResultCell -> ResultHeader [label=":result-cell/header" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - TableSettings [label="Table-Settings - |{ :bp/uuid | string } - |{ :table-settings/enabled? | boolean } - "] - TableSettings -> TableFilter [label=":table-settings/filters" taillabel=1 headlabel=N] - TableSettings -> MapUnitsSettings [label=":table-settings/map-units-settings" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - TableFilter [label="Table-Filter - |{ :bp/uuid | string } - |{ :table-filter/min | long } - |{ :table-filter/max | long } - |{ :table-filter/enabled? | boolean } - "] - TableFilter -> GroupVariable [label=":table-filter/group-variable-uuid" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - MapUnitsSettings [label="Map-Units-settings - |{ :bp/uuid | string } - |{ :map-units-settings/enabled? | boolean } - |{ :map-units-settings/units | string } - |{ :map-units-settings/map-rep-fraction | long } - "] - - //---------------------------------------------------------------------------------------------- - - GraphSettings [label="Graph-Settings - |{ :bp/uuid | string } - |{ :graph-settings/enabled? | boolean } - "] - GraphSettings -> YAxisLimit [label=":graph-settings/y-axis-limits" taillabel=1 headlabel=N] - GraphSettings -> GroupVariable [label=":graph-settings/x-axis-group-variable-uuid" taillabel=1 headlabel=1] - GraphSettings -> GroupVariable [label=":graph-settings/z-axis-group-variable-uuid" taillabel=1 headlabel=1] - GraphSettings -> GroupVariable [label=":graph-settings/z2-axis-group-variable-uuid" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - YAxisLimit [label="Y-Axis-Limit - |{ :bp/uuid | string } - |{ :y-axis-limit/min | long } - |{ :y-axis-limit/max | long } - "] - YAxisLimit -> GroupVariable [label=":y-axis-limit/group-variable-uuid" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - WorksheetDiagram [label="Worksheet-diagram - |{ :bp/uuid | string } - |{ :worksheet.diagram/title | string } - |{ :worksheet.diagram/row-id | long } - "] - WorksheetDiagram -> GroupVariable [label=":worksheet.diagram/group-variable-uuid" taillabel=1 headlabel=1] - WorksheetDiagram -> Ellipse [label=":worksheet.diagram/ellises" taillabel=1 headlabel=N] - WorksheetDiagram -> Arrow [label=":worksheet.diagram/arrows" taillabel=1 headlabel=N] - WorksheetDiagram -> ScatterPlot [label=":worksheet.diagram/scatter-plots" taillabel=1 headlabel=N] - - //---------------------------------------------------------------------------------------------- - - Ellipse [label="Ellipse - |{ :bp/uuid | string } - |{ :ellipse/legend-id | string } - |{ :ellipse/semi-major-axis | double } - |{ :ellipse/semi-minor-axis | double } - |{ :ellipse/rotation | long } - |{ :ellipse/color | string } - "] - - //---------------------------------------------------------------------------------------------- - - Arrow [label="Arrow - |{ :bp/uuid | string } - |{ :arrow/legend-id | string } - |{ :arrow/length | double } - |{ :arrow/rotation | double } - |{ :arrow/color | string } - |{ :arrow/dashed? | string } - "] - - //---------------------------------------------------------------------------------------------- - - ScatterPlot [label="Scatter-Plot - |{ :bp/uuid | string } - |{ :scatter-plot/legend-id | string } - |{ :scatter-plot/color | string } - |{ :scatter-plot/x-coordinates | string } - |{ :scatter-plot/y-coordinates | string } - "] -} -#+end_src - -#+RESULTS: -[[file:projects/behave/docs/worksheet-schema.png]] - -** VMS + Worksheet - -This Documents the schema for both the behave and behave_cms project. - -#+begin_src dot :results value :file projects/behave/docs/schema.png -// Relations (NOTE when a relation attribute of type :db/type/string instead of type :db.type/ref, this means the value is a UUID that matches the :bp/uuid of the related entity.) - -digraph GitHub { - graph [rankdir = "LR"] - - node [shape = record] - - //---------------------------------------------------------------------------------------------- - // VMS Schema Starts Here - //---------------------------------------------------------------------------------------------- - - User [label="User - |{ :bp/uuid | string } - |{ :user/name | string } - |{ :user/email | string } - |{ :user/password | string } - |{ :user/reset-key | string } - |{ :user/verified? | boolean } - |{ :user/super-admin? | boolean } - |{ :user/help-key | string } - "] - - //---------------------------------------------------------------------------------------------- - - Application [label="Application - |{ :bp/uuid | string } - |{ :application/name | string } - |{ :application/version-major | number } - |{ :application/version-minor | number } - |{ :application/version-patch | number } - |{ :application/version | tuple } - |{ :application/help-key | string } - "] - Application -> Module [label=":application/modules" taillabel=1 headlabel=N] - Application -> Tool [label=":application/tools" taillabel=1 headlabel=N] - Application -> HelpPage [label=":application/help-key" taillabel=1 headlabel=1] - Application -> Translation [label=":application/translation-key" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - Module [label="Module - |{ :bp/uuid | string } - |{ :module/name | string } - |{ :module/order | number } - "] - Module -> Submodule [label=":module/submodules" taillabel=1 headlabel=N] - Module -> Diagram [label=":module/diagram" taillabel=1 headlabel=N] - Module -> HelpPage [label=":module/help-key" taillabel=1 headlabel=1] - Module -> Translation [label=":module/translation-key" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - Submodule [label="Submodule - |{ :bp/uuid | string } - |{ :submodule/name | string } - |{ :submodule/order | number } - |{ :submodule/io | keyword } - |{ :submodule/research? | boolean } - |{ :submodule/conditionals-operator | keyword } - "] - Submodule -> Group [label=":submodule/groups" taillabel=1 headlabel=N] - Submodule -> Conditional [label=":submodule/conditionals" taillabel=1 headlabel=N] - Submodule -> HelpPage [label=":submodule/help-key" taillabel=1 headlabel=1] - Submodule -> Translation [label=":submodule/translation-key" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - Group [label="Group - |{ :bp/uuid | string } - |{ :group/name | string } - |{ :group/order | long } - |{ :group/io | keyword } - |{ :group/research? | boolean } - |{ :group/repeat? | boolean } - |{ :group/max-repeat | long } - |{ :group/conditionals-operator | keyword } - "] - Group -> Group [label=":group/children" taillabel=1 headlabel=1] - Group -> Conditional [label=":group/conditionals" taillabel=1 headlabel=N] - Group -> GroupVariable [label=":group/group-variables" taillabel=1 headlabel=N] - Group -> HelpPage [label=":group/help-key" taillabel=1 headlabel=1] - Group -> Translation [label=":group/translation-key" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - GroupVariable [label="Group-Variable - |{ :bp/uuid | string } - |{ :group-variable/cpp-class | string } - |{ :group-variable/cpp-function | string } - |{ :group-variable/cpp-namespace | string } - |{ :group-variable/cpp-parameter | string } - |{ :group-variable/order | long} - |{ :group-variable/research? | boolean } - "] - GroupVariable -> CppClass [label=":group-variable/cpp-class (uuid)" taillabel=1 headlabel=1] - GroupVariable -> CppFunction [label=":group-variable/cpp-function (uuid)" taillabel=1 headlabel=1] - GroupVariable -> CppNamespace [label=":group-variable/cpp-namespace (uuid)" taillabel=1 headlabel=1] - GroupVariable -> CppParameter [label=":group-variable/cpp-parameter (uuid)" taillabel=1 headlabel=1] - GroupVariable -> HelpPage [label=":group-variable/help-key" taillabel=1 headlabel=1] - GroupVariable -> Translation [label=":group-variable/translation-key" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - CppClass [label="Cpp.Class - |{ :bp/uuid | string } - |{ :cpp.class/name | string } - "] - CppClass -> CppFunction [label=":cpp.class/function" taillabel=1 headlabel=N] - - //---------------------------------------------------------------------------------------------- - - CppFunction [label="Cpp.Function - |{ :bp/uuid | string } - |{ :cpp.function/name | string } - |{ :cpp.function/return-type | stringema} - "] - CppFunction -> CppParameter [label=":cpp.function/parameter" taillabel=1 headlabel=N] - - //---------------------------------------------------------------------------------------------- - - CppParameter [label="Cpp.Parameter - |{ :bp/uuid | string } - |{ :cpp.parameter/name | string } - |{ :cpp.parameter/order | number } - |{ :cpp.parameter/type | string } - "] - - //---------------------------------------------------------------------------------------------- - - CppNamespace [label="Cpp.Namespace - |{ :bp/uuid | string } - |{ :cpp.namespace/name | string } - "] - CppNamespace -> CppClass [label=":cpp.namespace/class" taillabel=1 headlabel=N] - CppNamespace -> CppEnum [label=":cpp.namespace/enum" taillabel=1 headlabel=N] - - //---------------------------------------------------------------------------------------------- - - CppEnum [label="Cpp.Enum - |{ :bp/uuid | string } - |{ :cpp.enum/name | string } - "] - CppEnum -> CppEnumMember [label=":cpp.enum/enum-member" taillabel=1 headlabel=N] - - //---------------------------------------------------------------------------------------------- - - CppEnumMember [label="Cpp.Enum-member - |{ :bp/uuid | string } - |{ :cpp.enum-member/name | string } - |{ :cpp.enum-member/value | number } - "] - - //---------------------------------------------------------------------------------------------- - - Tool [label="Tools - |{ :bp/uuid | string } - |{ :tool/name | string } - |{ :tool/order | number } - "] - Tool -> SubTool [label=":tool/subtools" taillabel=1 headlabel=N] - Tool -> HelpPage [label=":tool/help-key" taillabel=1 headlabel=1] - Tool -> Translation [label=":tool/translation-key" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - SubTool [label="Subtool - |{ :bp/uuid | string } - |{ :subtool/name | string } - |{ :subtool/order | number } - |{ :subtool/autocompute? | boolean } - "] - SubTool -> SubToolVariable [label=":subtool/variables" taillabel=1 headlabel=N] - SubTool -> HelpPage [label=":subtool/help-key" taillabel=1 headlabel=1] - SubTool -> Translation [label=":subtool/translation-key" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - SubToolVariable [label="Subtool-Variable - |{ :bp/uuid | string } - |{ :subtool-variable/io | keyword } - |{ :subtool-variable/order | long } - |{ :subtool-variable/cpp-namespace-uuid | string } - |{ :subtool-variable/cpp-mclass | string } - |{ :subtool-variable/cpp-function-uuid | string } - "] - SubToolVariable -> HelpPage [label=":subtool-variable/help-key" taillabel=1 headlabel=1] - SubToolVariable -> Translation [label=":subtool-variable/translation-key" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - Variable [label="Variable - |{ :bp/uuid | string } - |{ :variable/name | string } - |{ :variable/bp6-label | string } - |{ :variable/bp6-code | string } - |{ :variable/kind | keyword} - |{ :variable/native-decimals | double } - |{ :variable/english-decimals | double } - |{ :variable/metric-decimals | double } - |{ :variable/maximum | double } - |{ :variable/minimum | double } - |{ :variable/default-value | double } - |{ :variable/map-units-convertible? | boolean } - "] - Variable -> GroupVariable [label=":variable/group-variables" taillabel=1 headlabel=N] - Variable -> SubToolVariable [label=":variable/subtool-variables" taillabel=1 headlabel=N] - Variable -> List [label=":variable/list" taillabel=1 headlabel=1] - Variable -> Domain [label=":variable/domain-uuid" taillabel=1 headlabel=1] - Variable -> Unit [label=":variable/native-unit-uuid" taillabel=1 headlabel=1] - Variable -> Unit [label=":variable/english-unit-uuid" taillabel=1 headlabel=1] - Variable -> Unit [label=":variable/metric-unit-uuid" taillabel=1 headlabel=1] - Variable -> Translation [label=":variable/translation-key" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - List [label="List - |{ :bp/uuid | string } - |{ :list/name | string } - "] - List -> ListOption [label=":list/options" taillabel=1 headlabel=N] - List -> Translation [label=":list/translation-key" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - ListOption [label="List-Option - |{ :bp/uuid | string } - |{ :list-option/name | string } - |{ :list-option/default | string } - |{ :list-option/value | string } - |{ :list-option/order | long } - |{ :list-option/hide? | boolean } - "] - ListOption -> Translation [label=":list-option/translation-key" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - Dimension [label="Dimension - |{ :bp/uuid | string } - |{ :dimension/name | string } - |{ :dimension/cpp-enum-uuid | string } - "] - Dimension -> Unit [label=":dimension/units" taillabel=1 headlabel=N] - - //---------------------------------------------------------------------------------------------- - - Unit [label="Unit - |{ :bp/uuid | string } - |{ :unit/name | string } - |{ :unit/short-code | string } - |{ :unit/system | string } - |{ :unit/cpp-enum-member-uuid | string } - "] - - //---------------------------------------------------------------------------------------------- - - DomainSet [label="Domain-Set - |{ :bp/uuid | string } - |{ :domain-set/name | string } - "] - DomainSet -> Domain [label=":domain-set/domains" taillabel=1 headlabel=N] - - //---------------------------------------------------------------------------------------------- - - Domain [label="Domain - |{ :bp/uuid | string } - |{ :domain/name | string } - |{ :domain/decimals | string } - "] - Domain -> Dimension [label=":domain/dimension-uuid" taillabel=1 headlabel=1] - Domain -> Unit [label=":domain/native-unit-uuid" taillabel=1 headlabel=1] - Domain -> Unit [label=":domain/english-unit-uuid" taillabel=1 headlabel=1] - Domain -> Unit [label=":domain/metric-unit-uuid" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - Conditional [label="Conditional - |{ :bp/uuid | string } - |{ :conditional/type | keyword } - |{ :conditional/operator | keyword } - |{ :conditional/values | string } - "] - Conditional -> GroupVariable [label=":conditional/group-variable-uuid" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - Diagram [label="Diagram - |{ :bp/uuid | keyword } - |{ :diagram/type | string } - "] - Diagram -> GroupVariable [label=":diagram/group-variable" taillabel=1 headlabel=1] - Diagram -> GroupVariable [label=":diagram/input-group-variables" taillabel=1 headlabel=N] - Diagram -> GroupVariable [label=":diagram/output-group-variables" taillabel=1 headlabel=N] - - //---------------------------------------------------------------------------------------------- - - Language [label="Language - |{ :bp/uuid | keyword } - |{ :language/name | string } - |{ :language/short-code | string } - "] - Language -> Translation [label=":language/translation" taillabel=1 headlabel=1] - Language -> HelpPage [label=":language/help-page" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - Translation [label="Translation - |{ :bp/uuid | keyword } - |{ :translation/name | string } - |{ :translation/key | string } - |{ :translation/translation | string } - "] - - //---------------------------------------------------------------------------------------------- - - HelpPage [label="Help-page - |{ :bp/uuid | keyword } - |{ :help-page/key | string } - |{ :help-page/content | string } - "] - - //---------------------------------------------------------------------------------------------- - - Link [label="Link - |{ :bp/uuid | keyword } - "] - Link -> GroupVariable [label="link/source" taillabel=1 headlabel=1] - Link -> GroupVariable [label="link/destination" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - // Worksheet Schema Starts Here - //---------------------------------------------------------------------------------------------- - - Worksheet [label="Worksheet - |{ :bp/uuid | string } - |{ :worksheet/run-description | string } - |{ :worksheet/name | string } - |{ :worksheet/created | long } - |{ :worksheet/furthest-visited-step | keyword } - |{ :worksheet/modules | keywords } - "] - Worksheet -> Note [label=":worksheet/notes" taillabel=1 headlabel=N] - Worksheet -> InputGroup [label=":worksheet/input-groups" taillabel=1 headlabel=N] - Worksheet -> RepeatGroup [label=":worksheet/repeat-groups" taillabel=1 headlabel=N] - Worksheet -> Output [label=":worksheet/outputs" taillabel=1 headlabel=N] - Worksheet -> ResultTable [label=":worksheet/result-table" taillabel=1 headlabel=1] - Worksheet -> GraphSettings [label=":worksheet/graph-settings" taillabel=1 headlabel=1] - Worksheet -> TableSettings [label=":worksheet/table-settings" taillabel=1 headlabel=1] - Worksheet -> WorksheetDiagram [label=":worksheet/diagrams" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - Note [label="Note - |{ :bp/uuid | string } - |{ :note/name | string } - |{ :note/content | string } - |{ :note/submodule | string } - "] - - //---------------------------------------------------------------------------------------------- - - InputGroup [label="Input-Group - |{ :bp/uuid | string } - |{ :input-group/repeat-id | long } - |{ :input-group/inputs | long } - "] - InputGroup -> Group [label=":input-group/group-uuid" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - RepeatGroup [label="Repeat-Group - |{ :bp/uuid | string } - |{ :repeat-group/group-uuid | string } - |{ :repeat-group/repeats | long } - |{ :repeat-group/inputs | long } - "] - RepeatGroup -> Group [label=":repeat-group/group-uuid" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - Output [label="Output - |{ :bp/uuid | string } - |{ :output/enabled? | boolean } - "] - Output -> GroupVariable [label=":output/group-variable-uuid" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - ResultTable [label="Result-Table - |{ :bp/uuid | string } - "] - ResultTable -> ResultHeader [label=":result-table/headers" taillabel=1 headlabel=N] - ResultTable -> ResultRow [label=":result-table/rows" taillabel=1 headlabel=N] - - //---------------------------------------------------------------------------------------------- - - ResultHeader [label="Result-Header - |{ :bp/uuid | string } - |{ :result-header/repeat-id | long } - |{ :result-header/order | long } - |{ :result-header/units | string } - "] - ResultHeader -> GroupVariable [label=":result-header/group-variable-uuid" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - ResultRow [label="Result-Row - |{ :bp/uuid | string } - |{ :result-row/id | long } - "] - ResultRow -> ResultCell [label=":result-row/cells" taillabel=1 headlabel=N] - - //---------------------------------------------------------------------------------------------- - - ResultCell [label="Result-Cell - |{ :bp/uuid | string } - |{ :result-cell/value | string } - "] - ResultCell -> ResultHeader [label=":result-cell/header" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - TableSettings [label="Table-Settings - |{ :bp/uuid | string } - |{ :table-settings/enabled? | boolean } - "] - TableSettings -> TableFilter [label=":table-settings/filters" taillabel=1 headlabel=N] - TableSettings -> MapUnitsSettings [label=":table-settings/map-units-settings" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - TableFilter [label="Table-Filter - |{ :bp/uuid | string } - |{ :table-filter/min | long } - |{ :table-filter/max | long } - |{ :table-filter/enabled? | boolean } - "] - TableFilter -> GroupVariable [label=":table-filter/group-variable-uuid" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - MapUnitsSettings [label="Map-Units-settings - |{ :bp/uuid | string } - |{ :map-units-settings/enabled? | boolean } - |{ :map-units-settings/units | string } - |{ :map-units-settings/map-rep-fraction | long } - "] - - //---------------------------------------------------------------------------------------------- - - GraphSettings [label="Graph-Settings - |{ :bp/uuid | string } - |{ :graph-settings/enabled? | boolean } - "] - GraphSettings -> YAxisLimit [label=":graph-settings/y-axis-limits" taillabel=1 headlabel=N] - GraphSettings -> GroupVariable [label=":graph-settings/x-axis-group-variable-uuid" taillabel=1 headlabel=1] - GraphSettings -> GroupVariable [label=":graph-settings/z-axis-group-variable-uuid" taillabel=1 headlabel=1] - GraphSettings -> GroupVariable [label=":graph-settings/z2-axis-group-variable-uuid" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - YAxisLimit [label="Y-Axis-Limit - |{ :bp/uuid | string } - |{ :y-axis-limit/min | long } - |{ :y-axis-limit/max | long } - "] - YAxisLimit -> GroupVariable [label=":y-axis-limit/group-variable-uuid" taillabel=1 headlabel=1] - - //---------------------------------------------------------------------------------------------- - - WorksheetDiagram [label="Worksheet-diagram - |{ :bp/uuid | string } - |{ :worksheet.diagram/title | string } - |{ :worksheet.diagram/row-id | long } - "] - WorksheetDiagram -> GroupVariable [label=":worksheet.diagram/group-variable-uuid" taillabel=1 headlabel=1] - WorksheetDiagram -> Ellipse [label=":worksheet.diagram/ellises" taillabel=1 headlabel=N] - WorksheetDiagram -> Arrow [label=":worksheet.diagram/arrows" taillabel=1 headlabel=N] - WorksheetDiagram -> ScatterPlot [label=":worksheet.diagram/scatter-plots" taillabel=1 headlabel=N] - - //---------------------------------------------------------------------------------------------- - - Ellipse [label="Ellipse - |{ :bp/uuid | string } - |{ :ellipse/legend-id | string } - |{ :ellipse/semi-major-axis | double } - |{ :ellipse/semi-minor-axis | double } - |{ :ellipse/rotation | long } - |{ :ellipse/color | string } - "] - - //---------------------------------------------------------------------------------------------- - - Arrow [label="Arrow - |{ :bp/uuid | string } - |{ :arrow/legend-id | string } - |{ :arrow/length | double } - |{ :arrow/rotation | double } - |{ :arrow/color | string } - |{ :arrow/dashed? | string } - "] - - //---------------------------------------------------------------------------------------------- - - ScatterPlot [label="Scatter-Plot - |{ :bp/uuid | string } - |{ :scatter-plot/legend-id | string } - |{ :scatter-plot/color | string } - |{ :scatter-plot/x-coordinates | string } - |{ :scatter-plot/y-coordinates | string } - "] -} -#+end_src - -#+RESULTS: -[[file:projects/behave/docs/schema.png]] +#+TITLE: Behave7 + +[[file:./arch/images/behave-logo.svg]] + +** COMMENT Workflow Badges +[[https://github.com/firelab/behave-app/actions/workflows/test.yml/badge.svg]] + +** Supported By: +#+BEGIN_HTML +
+ US Department of Agriculture + US Forest Service + Spatial Informatics Group, Inc. +
+#+END_HTML + +** Table of Contents +- [[#latest-release][Latest Release]] +- [[#installation][Installation]] +- [[#overview][Overview]] +- [[#features][Features]] +- [[#license][License]] +- [[./arch/00_index.org][Architecture]] +- [[#contact][Contact]] + +** Latest Release +:PROPERTIES: +:CUSTOM_ID: latest-release +:END: +[[https://github.com/firelab/behave-app/releases/latest][Click here to download the latest release.]] + +** Installation +:PROPERTIES: +:CUSTOM_ID: installation +:END: +1. Download and install a Java Runtime Environment (JRE). Some options: + A. [[https://adoptium.net/temurin/releases/][Eclipse Temuring 21]] + B. [[https://docs.aws.amazon.com/corretto/latest/corretto-21-ug/downloads-list.html][Amazon Corretto 21]] +2. Download and install the [[https://www.google.com/chrome/index.html][Google Chrome Browser]] +3. Download the Behave7 .JAR view the [[https://github.com/firelab/behave-app/releases/latest][latest release.]] +4. Double click .JAR file to open the application. + +** Overview +:PROPERTIES: +:CUSTOM_ID: overview +:END: +The Behave fire modeling system is used to predict fire behavior in multiple situations. + +Behave can be used for any fire management application that involves modeling fire behavior and some fire effects. + +The system is composed of a collection of mathematical models that describe fire behavior and the fire environment. + +Behave is a point system that calculates fire behavior for an area (or point) with homogeneous fuels. The program simulates rate of fire spread, spotting distance, scorch height, tree mortality, fuel moisture, wind adjustment factor, as well as other variables. + +** Features +:PROPERTIES: +:CUSTOM_ID: features +:END: +- :fire: Uses up-to-date Fire Modeling equations, identical to those in [[https://research.fs.usda.gov/firelab/projects/flammap][FlamMap]] +- :sparkles: Fresh new User Interface. +- :books: View documentation side-by-side inside the app. +- :printer: Export directly to PDF (No need to take screenshots!) + +** License +:PROPERTIES: +:CUSTOM_ID: license +:END: + + +** Architecture +[[./arch/00_index.org][Learn more about the architecture of the Behave application here.]] + +** Contact Us +:PROPERTIES: +:CUSTOM_ID: contact +:END: +If you have feedback or would like to report a bug, please reach out +to Faith Ann Heinsch at =faith.heinsch usda.gov= or email =iia-helpdesk usda.gov=. diff --git a/arch/00_index.org b/arch/00_index.org new file mode 100644 index 000000000..70d929cd6 --- /dev/null +++ b/arch/00_index.org @@ -0,0 +1,1320 @@ +#+TITLE: 0. Architecture Overview + +Next: [[file:01_getting_started.org][1. Getting Started]] + +** Table of Contents +- [[#polylith][Polylith]] + - [[#what-is-a-polylith][What is a Polylith?]] + - [[#components][Components]] + - [[#bases][Bases]] + - [[#projects][Projects]] +- [[#clojure-script][Clojure/Script]] + - [[#components-library][Components Library]] + - [[#reagent-reframe][Reagent & Re-Frame]] + - [[#datalog-datoms][Datalog & Datoms]] +- [[#webassembly][WebAssembly]] +- [[#schema][Schema]] + - [[#schema-vms][Variable Management System (VMS)]] + - [[#schema-worksheet][Worksheet]] + - [[#schema-vms-worksheet][VMS + Worksheet]] + +** Polylith +:PROPERTIES: +:CUSTOM_ID: polylith +:END: +This project adopts a Polylith design, which allows both a mono-repo +experience across mulitple projects. + +For a quick video overview, check out: [[https://youtu.be/Xz8slbpGvnk][Polylith in a Nutshell]] +#+BEGIN_HTML + +#+END_HTML + +*** What is a Polylith? +:PROPERTIES: +:CUSTOM_ID: what-is-a-polylith +:END: +The [[https://polylith.gitbook.io/polylith/][Polylith]] project organization method attempts to marry the best parts of operating within a +single Monorepo (single source of truth, DRY code, less repos to manage), with +the benefits of having single repos for each project (customization). + +The Polylith design is made up of three parts: Components, Bases, and Projects. + +*** Components +:PROPERTIES: +:CUSTOM_ID: components +:END: +Thisis the most basic unit for Polylith. Ideally, Components require few, if +any, dependencies. Each component always has an ~.interface~ +namepace, which includes the public functions that are meant to be exported +fromthe component. Components (ideally) are written in the Clojure Common (~*.cljc~) +formt so as to be used in both CLJ and CLJS environments. + +*** Bases +:PROPERTIES: +:CUSTOM_ID: bases +:END: +Base are groups of components and other dependencies that constitute a +midde-tier of the Polylith. Bases can be project-specific, but ideally are +geneal enough to be used across multiple projects. Bases typically +onlyhave a ~main.clj[sc]~ file. + +*** Projects +:PROPERTIES: +:CUSTOM_ID: projects +:END: +Projects are made up of multiple bases and components. Many projects can exist +within a Polylith, which enables a great deal of customization while also +sharing components and bases across projects. + +** Clojure/Script +:PROPERTIES: +:CUSTOM_ID: clojure-script +:END: +[[https://clojure.org/][Clojure]] is a Lisp language invented by Rich Hickey in the late 2000's +that runs on the Java Virtual Machine. This language is quite +extensible, and stable thanks to the Clojure Team's relentless pursuit +of backwards compatibility (Clojure continues to be supported on Java 8.) + +[[https://clojurescript.org/][ClojureScript]] takes the benefits of Clojure and applies them to the +Browser. This allows our team to use one language for both Front-end +and Back-end programming, reducing cognitive overhead and allowing us +to use identical code in both domains. + +*** Components Library +:PROPERTIES: +:CUSTOM_ID: components-library +:END: + +The projects take advantage of the [[https://gitlab.com/sig-gis/behave-components][Behave Components]] shared UI components +library, written in ClojureScript. + +*** Reagent & Re-Frame +:PROPERTIES: +:CUSTOM_ID: reagent-reframe +:END: + +The projects use both [[https://reagent-project.github.io/][Reagent]] and [[https://day8.github.io/re-frame][Re-Frame]] to manage application state +and application logic. Re-Frame was adopted to reduce tight coupling +between views/components and the data/actions that are used within them. + +*** Datalog & Datoms +:PROPERTIES: +:CUSTOM_ID: datalog-datoms +:END: + +The projects store data in Datoms and performs queries using the +Datalog syntax. The back-end access Datoms using [[https://www.datomic.com/][Datomic]], and the +front-end accesses Datoms through [[https://github.com/tonsky/datascript][DataScript]]. [[https://github.com/denistakeda/re-posh][Re-Posh]] is also used to +enable subscriptions on DataScript entities, reducing view logic. + +** WebAssembly +:PROPERTIES: +:CUSTOM_ID: webassembly +:END: +Behave7's underlying science exists in the [[https://github.com/firelab/behave][Behave Library]], which is +written in C++. To enable the application to run on any device, the team uses [[https://emscripten.org/][Emscripten]] +to convert the C++ code into [[https://webassembly.org/][WebAssembly (WASM)]], an assembly code that runs +inside modern web browsers. This reduces the potential for malicious +code to run on the user's system, while also granting us compabitility +with any device that can run a modern web browser. + +For more information on how we go from C++ to WASM, check out the +[[file:02_building_wasm.org][Building WebAssembly]] guide. + +** Schema +:PROPERTIES: +:CUSTOM_ID: schema +:END: + +The following diagrams were produced using [[https://graphviz.org/][GraphViz]]. + +*** Variable Management System (VMS) +:PROPERTIES: +:CUSTOM_ID: schema-vms +:END: + +This schema is used for the Behave VMS. It largely impacts the rendering UI of the Behave VMS and the Application. + +[[./images/vms-schema.png]] + +**** COMMENT VMS Diagram +#+begin_src dot :results value :file ./images/vms-schema.png +// Relations (NOTE when a relation attribute of type :db/type/string instead of type :db.type/ref, this means the value is a UUID that matches the :bp/uuid of the related entity.) + +digraph GitHub { + graph [rankdir = "LR"] + + node [shape = record] + + //---------------------------------------------------------------------------------------------- + // VMS Schema Starts Here + //---------------------------------------------------------------------------------------------- + + User [label="User + |{ :bp/uuid | string } + |{ :user/name | string } + |{ :user/email | string } + |{ :user/password | string } + |{ :user/reset-key | string } + |{ :user/verified? | boolean } + |{ :user/super-admin? | boolean } + |{ :user/help-key | string } + "] + + //---------------------------------------------------------------------------------------------- + + Application [label="Application + |{ :bp/uuid | string } + |{ :application/name | string } + |{ :application/version-major | number } + |{ :application/version-minor | number } + |{ :application/version-patch | number } + |{ :application/version | tuple } + |{ :application/help-key | string } + "] + Application -> Module [label=":application/modules" taillabel=1 headlabel=N] + Application -> Tool [label=":application/tools" taillabel=1 headlabel=N] + Application -> HelpPage [label=":application/help-key" taillabel=1 headlabel=1] + Application -> Translation [label=":application/translation-key" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + Module [label="Module + |{ :bp/uuid | string } + |{ :module/name | string } + |{ :module/order | number } + "] + Module -> Submodule [label=":module/submodules" taillabel=1 headlabel=N] + Module -> Diagram [label=":module/diagram" taillabel=1 headlabel=N] + Module -> HelpPage [label=":module/help-key" taillabel=1 headlabel=1] + Module -> Translation [label=":module/translation-key" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + Submodule [label="Submodule + |{ :bp/uuid | string } + |{ :submodule/name | string } + |{ :submodule/order | number } + |{ :submodule/io | keyword } + |{ :submodule/research? | boolean } + |{ :submodule/conditionals-operator | keyword } + "] + Submodule -> Group [label=":submodule/groups" taillabel=1 headlabel=N] + Submodule -> Conditional [label=":submodule/conditionals" taillabel=1 headlabel=N] + Submodule -> HelpPage [label=":submodule/help-key" taillabel=1 headlabel=1] + Submodule -> Translation [label=":submodule/translation-key" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + Group [label="Group + |{ :bp/uuid | string } + |{ :group/name | string } + |{ :group/order | long } + |{ :group/io | keyword } + |{ :group/research? | boolean } + |{ :group/repeat? | boolean } + |{ :group/max-repeat | long } + |{ :group/conditionals-operator | keyword } + "] + Group -> Group [label=":group/children" taillabel=1 headlabel=1] + Group -> Conditional [label=":group/conditionals" taillabel=1 headlabel=N] + Group -> GroupVariable [label=":group/group-variables" taillabel=1 headlabel=N] + Group -> HelpPage [label=":group/help-key" taillabel=1 headlabel=1] + Group -> Translation [label=":group/translation-key" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + GroupVariable [label="Group-Variable + |{ :bp/uuid | string } + |{ :group-variable/cpp-class | string } + |{ :group-variable/cpp-function | string } + |{ :group-variable/cpp-namespace | string } + |{ :group-variable/cpp-parameter | string } + |{ :group-variable/order | long} + |{ :group-variable/research? | boolean } + "] + GroupVariable -> CppClass [label=":group-variable/cpp-class (uuid)" taillabel=1 headlabel=1] + GroupVariable -> CppFunction [label=":group-variable/cpp-function (uuid)" taillabel=1 headlabel=1] + GroupVariable -> CppNamespace [label=":group-variable/cpp-namespace (uuid)" taillabel=1 headlabel=1] + GroupVariable -> CppParameter [label=":group-variable/cpp-parameter (uuid)" taillabel=1 headlabel=1] + GroupVariable -> HelpPage [label=":group-variable/help-key" taillabel=1 headlabel=1] + GroupVariable -> Translation [label=":group-variable/translation-key" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + CppClass [label="Cpp.Class + |{ :bp/uuid | string } + |{ :cpp.class/name | string } + "] + CppClass -> CppFunction [label=":cpp.class/function" taillabel=1 headlabel=N] + + //---------------------------------------------------------------------------------------------- + + CppFunction [label="Cpp.Function + |{ :bp/uuid | string } + |{ :cpp.function/name | string } + |{ :cpp.function/return-type | stringema} + "] + CppFunction -> CppParameter [label=":cpp.function/parameter" taillabel=1 headlabel=N] + + //---------------------------------------------------------------------------------------------- + + CppParameter [label="Cpp.Parameter + |{ :bp/uuid | string } + |{ :cpp.parameter/name | string } + |{ :cpp.parameter/order | number } + |{ :cpp.parameter/type | string } + "] + + //---------------------------------------------------------------------------------------------- + + CppNamespace [label="Cpp.Namespace + |{ :bp/uuid | string } + |{ :cpp.namespace/name | string } + "] + CppNamespace -> CppClass [label=":cpp.namespace/class" taillabel=1 headlabel=N] + CppNamespace -> CppEnum [label=":cpp.namespace/enum" taillabel=1 headlabel=N] + + //---------------------------------------------------------------------------------------------- + + CppEnum [label="Cpp.Enum + |{ :bp/uuid | string } + |{ :cpp.enum/name | string } + "] + CppEnum -> CppEnumMember [label=":cpp.enum/enum-member" taillabel=1 headlabel=N] + + //---------------------------------------------------------------------------------------------- + + CppEnumMember [label="Cpp.Enum-member + |{ :bp/uuid | string } + |{ :cpp.enum-member/name | string } + |{ :cpp.enum-member/value | number } + "] + + //---------------------------------------------------------------------------------------------- + + Tool [label="Tools + |{ :bp/uuid | string } + |{ :tool/name | string } + |{ :tool/order | number } + "] + Tool -> SubTool [label=":tool/subtools" taillabel=1 headlabel=N] + Tool -> HelpPage [label=":tool/help-key" taillabel=1 headlabel=1] + Tool -> Translation [label=":tool/translation-key" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + SubTool [label="Subtool + |{ :bp/uuid | string } + |{ :subtool/name | string } + |{ :subtool/order | number } + |{ :subtool/autocompute? | boolean } + "] + SubTool -> SubToolVariable [label=":subtool/variables" taillabel=1 headlabel=N] + SubTool -> HelpPage [label=":subtool/help-key" taillabel=1 headlabel=1] + SubTool -> Translation [label=":subtool/translation-key" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + SubToolVariable [label="Subtool-Variable + |{ :bp/uuid | string } + |{ :subtool-variable/io | keyword } + |{ :subtool-variable/order | long } + |{ :subtool-variable/cpp-namespace-uuid | string } + |{ :subtool-variable/cpp-mclass | string } + |{ :subtool-variable/cpp-function-uuid | string } + "] + SubToolVariable -> HelpPage [label=":subtool-variable/help-key" taillabel=1 headlabel=1] + SubToolVariable -> Translation [label=":subtool-variable/translation-key" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + Variable [label="Variable + |{ :bp/uuid | string } + |{ :variable/name | string } + |{ :variable/bp6-label | string } + |{ :variable/bp6-code | string } + |{ :variable/kind | keyword} + |{ :variable/native-decimals | double } + |{ :variable/english-decimals | double } + |{ :variable/metric-decimals | double } + |{ :variable/maximum | double } + |{ :variable/minimum | double } + |{ :variable/default-value | double } + |{ :variable/map-units-convertible? | boolean } + "] + Variable -> GroupVariable [label=":variable/group-variables" taillabel=1 headlabel=N] + Variable -> SubToolVariable [label=":variable/subtool-variables" taillabel=1 headlabel=N] + Variable -> List [label=":variable/list" taillabel=1 headlabel=1] + Variable -> Domain [label=":variable/domain-uuid" taillabel=1 headlabel=1] + Variable -> Unit [label=":variable/native-unit-uuid" taillabel=1 headlabel=1] + Variable -> Unit [label=":variable/english-unit-uuid" taillabel=1 headlabel=1] + Variable -> Unit [label=":variable/metric-unit-uuid" taillabel=1 headlabel=1] + Variable -> Translation [label=":variable/translation-key" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + List [label="List + |{ :bp/uuid | string } + |{ :list/name | string } + "] + List -> ListOption [label=":list/options" taillabel=1 headlabel=N] + List -> Translation [label=":list/translation-key" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + ListOption [label="List-Option + |{ :bp/uuid | string } + |{ :list-option/name | string } + |{ :list-option/default | string } + |{ :list-option/value | string } + |{ :list-option/order | long } + |{ :list-option/hide? | boolean } + "] + ListOption -> Translation [label=":list-option/translation-key" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + Dimension [label="Dimension + |{ :bp/uuid | string } + |{ :dimension/name | string } + |{ :dimension/cpp-enum-uuid | string } + "] + Dimension -> Unit [label=":dimension/units" taillabel=1 headlabel=N] + + //---------------------------------------------------------------------------------------------- + + Unit [label="Unit + |{ :bp/uuid | string } + |{ :unit/name | string } + |{ :unit/short-code | string } + |{ :unit/system | string } + |{ :unit/cpp-enum-member-uuid | string } + "] + + //---------------------------------------------------------------------------------------------- + + DomainSet [label="Domain-Set + |{ :bp/uuid | string } + |{ :domain-set/name | string } + "] + DomainSet -> Domain [label=":domain-set/domains" taillabel=1 headlabel=N] + + //---------------------------------------------------------------------------------------------- + + Domain [label="Domain + |{ :bp/uuid | string } + |{ :domain/name | string } + |{ :domain/decimals | string } + "] + Domain -> Dimension [label=":domain/dimension-uuid" taillabel=1 headlabel=1] + Domain -> Unit [label=":domain/native-unit-uuid" taillabel=1 headlabel=1] + Domain -> Unit [label=":domain/english-unit-uuid" taillabel=1 headlabel=1] + Domain -> Unit [label=":domain/metric-unit-uuid" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + Conditional [label="Conditional + |{ :bp/uuid | string } + |{ :conditional/type | keyword } + |{ :conditional/operator | keyword } + |{ :conditional/values | string } + "] + Conditional -> GroupVariable [label=":conditional/group-variable-uuid" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + Diagram [label="Diagram + |{ :bp/uuid | keyword } + |{ :diagram/type | string } + "] + Diagram -> GroupVariable [label=":diagram/group-variable" taillabel=1 headlabel=1] + Diagram -> GroupVariable [label=":diagram/input-group-variables" taillabel=1 headlabel=N] + Diagram -> GroupVariable [label=":diagram/output-group-variables" taillabel=1 headlabel=N] + + //---------------------------------------------------------------------------------------------- + + Language [label="Language + |{ :bp/uuid | keyword } + |{ :language/name | string } + |{ :language/short-code | string } + "] + Language -> Translation [label=":language/translation" taillabel=1 headlabel=1] + Language -> HelpPage [label=":language/help-page" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + Translation [label="Translation + |{ :bp/uuid | keyword } + |{ :translation/name | string } + |{ :translation/key | string } + |{ :translation/translation | string } + "] + + //---------------------------------------------------------------------------------------------- + + HelpPage [label="Help-page + |{ :bp/uuid | keyword } + |{ :help-page/key | string } + |{ :help-page/content | string } + "] + + //---------------------------------------------------------------------------------------------- + + Link [label="Link + |{ :bp/uuid | keyword } + "] + Link -> GroupVariable [label="link/source" taillabel=1 headlabel=1] + Link -> GroupVariable [label="link/destination" taillabel=1 headlabel=1] +} +#+end_src + +#+RESULTS: +[[file:./images/vms-schema.png]] + +*** Worksheet +:PROPERTIES: +:CUSTOM_ID: schema-worksheet +:END: + +This schema is used to store instances of worksheet information in the Behave application. + +[[file:./images/worksheet-schema.png]] + +**** COMMENT Worksheet Diagram +#+begin_src dot :results value :file ./images/worksheet-schema.png +// Relations (NOTE when a relation attribute of type :db/type/string instead of type :db.type/ref, this means the value is a UUID that matches the :bp/uuid of the related entity.) + +digraph GitHub { + graph [rankdir = "LR"] + + node [shape = record] + + //---------------------------------------------------------------------------------------------- + // Worksheet Schema Starts Here + //---------------------------------------------------------------------------------------------- + + Worksheet [label="Worksheet + |{ :bp/uuid | string } + |{ :worksheet/run-description | string } + |{ :worksheet/name | string } + |{ :worksheet/created | long } + |{ :worksheet/furthest-visited-step | keyword } + |{ :worksheet/modules | keywords } + "] + Worksheet -> Note [label=":worksheet/notes" taillabel=1 headlabel=N] + Worksheet -> InputGroup [label=":worksheet/input-groups" taillabel=1 headlabel=N] + Worksheet -> RepeatGroup [label=":worksheet/repeat-groups" taillabel=1 headlabel=N] + Worksheet -> Output [label=":worksheet/outputs" taillabel=1 headlabel=N] + Worksheet -> ResultTable [label=":worksheet/result-table" taillabel=1 headlabel=1] + Worksheet -> GraphSettings [label=":worksheet/graph-settings" taillabel=1 headlabel=1] + Worksheet -> TableSettings [label=":worksheet/table-settings" taillabel=1 headlabel=1] + Worksheet -> WorksheetDiagram [label=":worksheet/diagrams" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + Note [label="Note + |{ :bp/uuid | string } + |{ :note/name | string } + |{ :note/content | string } + |{ :note/submodule | string } + "] + + //---------------------------------------------------------------------------------------------- + + InputGroup [label="Input-Group + |{ :bp/uuid | string } + |{ :input-group/repeat-id | long } + |{ :input-group/inputs | long } + "] + InputGroup -> Group [label=":input-group/group-uuid" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + RepeatGroup [label="Repeat-Group + |{ :bp/uuid | string } + |{ :repeat-group/group-uuid | string } + |{ :repeat-group/repeats | long } + |{ :repeat-group/inputs | long } + "] + RepeatGroup -> Group [label=":repeat-group/group-uuid" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + Output [label="Output + |{ :bp/uuid | string } + |{ :output/enabled? | boolean } + "] + Output -> GroupVariable [label=":output/group-variable-uuid" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + ResultTable [label="Result-Table + |{ :bp/uuid | string } + "] + ResultTable -> ResultHeader [label=":result-table/headers" taillabel=1 headlabel=N] + ResultTable -> ResultRow [label=":result-table/rows" taillabel=1 headlabel=N] + + //---------------------------------------------------------------------------------------------- + + ResultHeader [label="Result-Header + |{ :bp/uuid | string } + |{ :result-header/repeat-id | long } + |{ :result-header/order | long } + |{ :result-header/units | string } + "] + ResultHeader -> GroupVariable [label=":result-header/group-variable-uuid" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + ResultRow [label="Result-Row + |{ :bp/uuid | string } + |{ :result-row/id | long } + "] + ResultRow -> ResultCell [label=":result-row/cells" taillabel=1 headlabel=N] + + //---------------------------------------------------------------------------------------------- + + ResultCell [label="Result-Cell + |{ :bp/uuid | string } + |{ :result-cell/value | string } + "] + ResultCell -> ResultHeader [label=":result-cell/header" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + TableSettings [label="Table-Settings + |{ :bp/uuid | string } + |{ :table-settings/enabled? | boolean } + "] + TableSettings -> TableFilter [label=":table-settings/filters" taillabel=1 headlabel=N] + TableSettings -> MapUnitsSettings [label=":table-settings/map-units-settings" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + TableFilter [label="Table-Filter + |{ :bp/uuid | string } + |{ :table-filter/min | long } + |{ :table-filter/max | long } + |{ :table-filter/enabled? | boolean } + "] + TableFilter -> GroupVariable [label=":table-filter/group-variable-uuid" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + MapUnitsSettings [label="Map-Units-settings + |{ :bp/uuid | string } + |{ :map-units-settings/enabled? | boolean } + |{ :map-units-settings/units | string } + |{ :map-units-settings/map-rep-fraction | long } + "] + + //---------------------------------------------------------------------------------------------- + + GraphSettings [label="Graph-Settings + |{ :bp/uuid | string } + |{ :graph-settings/enabled? | boolean } + "] + GraphSettings -> YAxisLimit [label=":graph-settings/y-axis-limits" taillabel=1 headlabel=N] + GraphSettings -> GroupVariable [label=":graph-settings/x-axis-group-variable-uuid" taillabel=1 headlabel=1] + GraphSettings -> GroupVariable [label=":graph-settings/z-axis-group-variable-uuid" taillabel=1 headlabel=1] + GraphSettings -> GroupVariable [label=":graph-settings/z2-axis-group-variable-uuid" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + YAxisLimit [label="Y-Axis-Limit + |{ :bp/uuid | string } + |{ :y-axis-limit/min | long } + |{ :y-axis-limit/max | long } + "] + YAxisLimit -> GroupVariable [label=":y-axis-limit/group-variable-uuid" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + WorksheetDiagram [label="Worksheet-diagram + |{ :bp/uuid | string } + |{ :worksheet.diagram/title | string } + |{ :worksheet.diagram/row-id | long } + "] + WorksheetDiagram -> GroupVariable [label=":worksheet.diagram/group-variable-uuid" taillabel=1 headlabel=1] + WorksheetDiagram -> Ellipse [label=":worksheet.diagram/ellises" taillabel=1 headlabel=N] + WorksheetDiagram -> Arrow [label=":worksheet.diagram/arrows" taillabel=1 headlabel=N] + WorksheetDiagram -> ScatterPlot [label=":worksheet.diagram/scatter-plots" taillabel=1 headlabel=N] + + //---------------------------------------------------------------------------------------------- + + Ellipse [label="Ellipse + |{ :bp/uuid | string } + |{ :ellipse/legend-id | string } + |{ :ellipse/semi-major-axis | double } + |{ :ellipse/semi-minor-axis | double } + |{ :ellipse/rotation | long } + |{ :ellipse/color | string } + "] + + //---------------------------------------------------------------------------------------------- + + Arrow [label="Arrow + |{ :bp/uuid | string } + |{ :arrow/legend-id | string } + |{ :arrow/length | double } + |{ :arrow/rotation | double } + |{ :arrow/color | string } + |{ :arrow/dashed? | string } + "] + + //---------------------------------------------------------------------------------------------- + + ScatterPlot [label="Scatter-Plot + |{ :bp/uuid | string } + |{ :scatter-plot/legend-id | string } + |{ :scatter-plot/color | string } + |{ :scatter-plot/x-coordinates | string } + |{ :scatter-plot/y-coordinates | string } + "] +} +#+end_src + +#+RESULTS: +[[file:./images/worksheet-schema.png]] + +*** VMS + Worksheet +:PROPERTIES: +:CUSTOM_ID: schema-vms-worksheet +:END: + +This Documents the schema for both the behave and behave_cms project. + +[[file:./images/schema.png]] + +**** COMMENT Worksheet Diagram +#+begin_src dot :results value :file ./images/schema.png +// Relations (NOTE when a relation attribute of type :db/type/string instead of type :db.type/ref, this means the value is a UUID that matches the :bp/uuid of the related entity.) + +digraph GitHub { + graph [rankdir = "LR"] + + node [shape = record] + + //---------------------------------------------------------------------------------------------- + // VMS Schema Starts Here + //---------------------------------------------------------------------------------------------- + + User [label="User + |{ :bp/uuid | string } + |{ :user/name | string } + |{ :user/email | string } + |{ :user/password | string } + |{ :user/reset-key | string } + |{ :user/verified? | boolean } + |{ :user/super-admin? | boolean } + |{ :user/help-key | string } + "] + + //---------------------------------------------------------------------------------------------- + + Application [label="Application + |{ :bp/uuid | string } + |{ :application/name | string } + |{ :application/version-major | number } + |{ :application/version-minor | number } + |{ :application/version-patch | number } + |{ :application/version | tuple } + |{ :application/help-key | string } + "] + Application -> Module [label=":application/modules" taillabel=1 headlabel=N] + Application -> Tool [label=":application/tools" taillabel=1 headlabel=N] + Application -> HelpPage [label=":application/help-key" taillabel=1 headlabel=1] + Application -> Translation [label=":application/translation-key" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + Module [label="Module + |{ :bp/uuid | string } + |{ :module/name | string } + |{ :module/order | number } + "] + Module -> Submodule [label=":module/submodules" taillabel=1 headlabel=N] + Module -> Diagram [label=":module/diagram" taillabel=1 headlabel=N] + Module -> HelpPage [label=":module/help-key" taillabel=1 headlabel=1] + Module -> Translation [label=":module/translation-key" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + Submodule [label="Submodule + |{ :bp/uuid | string } + |{ :submodule/name | string } + |{ :submodule/order | number } + |{ :submodule/io | keyword } + |{ :submodule/research? | boolean } + |{ :submodule/conditionals-operator | keyword } + "] + Submodule -> Group [label=":submodule/groups" taillabel=1 headlabel=N] + Submodule -> Conditional [label=":submodule/conditionals" taillabel=1 headlabel=N] + Submodule -> HelpPage [label=":submodule/help-key" taillabel=1 headlabel=1] + Submodule -> Translation [label=":submodule/translation-key" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + Group [label="Group + |{ :bp/uuid | string } + |{ :group/name | string } + |{ :group/order | long } + |{ :group/io | keyword } + |{ :group/research? | boolean } + |{ :group/repeat? | boolean } + |{ :group/max-repeat | long } + |{ :group/conditionals-operator | keyword } + "] + Group -> Group [label=":group/children" taillabel=1 headlabel=1] + Group -> Conditional [label=":group/conditionals" taillabel=1 headlabel=N] + Group -> GroupVariable [label=":group/group-variables" taillabel=1 headlabel=N] + Group -> HelpPage [label=":group/help-key" taillabel=1 headlabel=1] + Group -> Translation [label=":group/translation-key" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + GroupVariable [label="Group-Variable + |{ :bp/uuid | string } + |{ :group-variable/cpp-class | string } + |{ :group-variable/cpp-function | string } + |{ :group-variable/cpp-namespace | string } + |{ :group-variable/cpp-parameter | string } + |{ :group-variable/order | long} + |{ :group-variable/research? | boolean } + "] + GroupVariable -> CppClass [label=":group-variable/cpp-class (uuid)" taillabel=1 headlabel=1] + GroupVariable -> CppFunction [label=":group-variable/cpp-function (uuid)" taillabel=1 headlabel=1] + GroupVariable -> CppNamespace [label=":group-variable/cpp-namespace (uuid)" taillabel=1 headlabel=1] + GroupVariable -> CppParameter [label=":group-variable/cpp-parameter (uuid)" taillabel=1 headlabel=1] + GroupVariable -> HelpPage [label=":group-variable/help-key" taillabel=1 headlabel=1] + GroupVariable -> Translation [label=":group-variable/translation-key" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + CppClass [label="Cpp.Class + |{ :bp/uuid | string } + |{ :cpp.class/name | string } + "] + CppClass -> CppFunction [label=":cpp.class/function" taillabel=1 headlabel=N] + + //---------------------------------------------------------------------------------------------- + + CppFunction [label="Cpp.Function + |{ :bp/uuid | string } + |{ :cpp.function/name | string } + |{ :cpp.function/return-type | stringema} + "] + CppFunction -> CppParameter [label=":cpp.function/parameter" taillabel=1 headlabel=N] + + //---------------------------------------------------------------------------------------------- + + CppParameter [label="Cpp.Parameter + |{ :bp/uuid | string } + |{ :cpp.parameter/name | string } + |{ :cpp.parameter/order | number } + |{ :cpp.parameter/type | string } + "] + + //---------------------------------------------------------------------------------------------- + + CppNamespace [label="Cpp.Namespace + |{ :bp/uuid | string } + |{ :cpp.namespace/name | string } + "] + CppNamespace -> CppClass [label=":cpp.namespace/class" taillabel=1 headlabel=N] + CppNamespace -> CppEnum [label=":cpp.namespace/enum" taillabel=1 headlabel=N] + + //---------------------------------------------------------------------------------------------- + + CppEnum [label="Cpp.Enum + |{ :bp/uuid | string } + |{ :cpp.enum/name | string } + "] + CppEnum -> CppEnumMember [label=":cpp.enum/enum-member" taillabel=1 headlabel=N] + + //---------------------------------------------------------------------------------------------- + + CppEnumMember [label="Cpp.Enum-member + |{ :bp/uuid | string } + |{ :cpp.enum-member/name | string } + |{ :cpp.enum-member/value | number } + "] + + //---------------------------------------------------------------------------------------------- + + Tool [label="Tools + |{ :bp/uuid | string } + |{ :tool/name | string } + |{ :tool/order | number } + "] + Tool -> SubTool [label=":tool/subtools" taillabel=1 headlabel=N] + Tool -> HelpPage [label=":tool/help-key" taillabel=1 headlabel=1] + Tool -> Translation [label=":tool/translation-key" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + SubTool [label="Subtool + |{ :bp/uuid | string } + |{ :subtool/name | string } + |{ :subtool/order | number } + |{ :subtool/autocompute? | boolean } + "] + SubTool -> SubToolVariable [label=":subtool/variables" taillabel=1 headlabel=N] + SubTool -> HelpPage [label=":subtool/help-key" taillabel=1 headlabel=1] + SubTool -> Translation [label=":subtool/translation-key" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + SubToolVariable [label="Subtool-Variable + |{ :bp/uuid | string } + |{ :subtool-variable/io | keyword } + |{ :subtool-variable/order | long } + |{ :subtool-variable/cpp-namespace-uuid | string } + |{ :subtool-variable/cpp-mclass | string } + |{ :subtool-variable/cpp-function-uuid | string } + "] + SubToolVariable -> HelpPage [label=":subtool-variable/help-key" taillabel=1 headlabel=1] + SubToolVariable -> Translation [label=":subtool-variable/translation-key" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + Variable [label="Variable + |{ :bp/uuid | string } + |{ :variable/name | string } + |{ :variable/bp6-label | string } + |{ :variable/bp6-code | string } + |{ :variable/kind | keyword} + |{ :variable/native-decimals | double } + |{ :variable/english-decimals | double } + |{ :variable/metric-decimals | double } + |{ :variable/maximum | double } + |{ :variable/minimum | double } + |{ :variable/default-value | double } + |{ :variable/map-units-convertible? | boolean } + "] + Variable -> GroupVariable [label=":variable/group-variables" taillabel=1 headlabel=N] + Variable -> SubToolVariable [label=":variable/subtool-variables" taillabel=1 headlabel=N] + Variable -> List [label=":variable/list" taillabel=1 headlabel=1] + Variable -> Domain [label=":variable/domain-uuid" taillabel=1 headlabel=1] + Variable -> Unit [label=":variable/native-unit-uuid" taillabel=1 headlabel=1] + Variable -> Unit [label=":variable/english-unit-uuid" taillabel=1 headlabel=1] + Variable -> Unit [label=":variable/metric-unit-uuid" taillabel=1 headlabel=1] + Variable -> Translation [label=":variable/translation-key" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + List [label="List + |{ :bp/uuid | string } + |{ :list/name | string } + "] + List -> ListOption [label=":list/options" taillabel=1 headlabel=N] + List -> Translation [label=":list/translation-key" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + ListOption [label="List-Option + |{ :bp/uuid | string } + |{ :list-option/name | string } + |{ :list-option/default | string } + |{ :list-option/value | string } + |{ :list-option/order | long } + |{ :list-option/hide? | boolean } + "] + ListOption -> Translation [label=":list-option/translation-key" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + Dimension [label="Dimension + |{ :bp/uuid | string } + |{ :dimension/name | string } + |{ :dimension/cpp-enum-uuid | string } + "] + Dimension -> Unit [label=":dimension/units" taillabel=1 headlabel=N] + + //---------------------------------------------------------------------------------------------- + + Unit [label="Unit + |{ :bp/uuid | string } + |{ :unit/name | string } + |{ :unit/short-code | string } + |{ :unit/system | string } + |{ :unit/cpp-enum-member-uuid | string } + "] + + //---------------------------------------------------------------------------------------------- + + DomainSet [label="Domain-Set + |{ :bp/uuid | string } + |{ :domain-set/name | string } + "] + DomainSet -> Domain [label=":domain-set/domains" taillabel=1 headlabel=N] + + //---------------------------------------------------------------------------------------------- + + Domain [label="Domain + |{ :bp/uuid | string } + |{ :domain/name | string } + |{ :domain/decimals | string } + "] + Domain -> Dimension [label=":domain/dimension-uuid" taillabel=1 headlabel=1] + Domain -> Unit [label=":domain/native-unit-uuid" taillabel=1 headlabel=1] + Domain -> Unit [label=":domain/english-unit-uuid" taillabel=1 headlabel=1] + Domain -> Unit [label=":domain/metric-unit-uuid" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + Conditional [label="Conditional + |{ :bp/uuid | string } + |{ :conditional/type | keyword } + |{ :conditional/operator | keyword } + |{ :conditional/values | string } + "] + Conditional -> GroupVariable [label=":conditional/group-variable-uuid" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + Diagram [label="Diagram + |{ :bp/uuid | keyword } + |{ :diagram/type | string } + "] + Diagram -> GroupVariable [label=":diagram/group-variable" taillabel=1 headlabel=1] + Diagram -> GroupVariable [label=":diagram/input-group-variables" taillabel=1 headlabel=N] + Diagram -> GroupVariable [label=":diagram/output-group-variables" taillabel=1 headlabel=N] + + //---------------------------------------------------------------------------------------------- + + Language [label="Language + |{ :bp/uuid | keyword } + |{ :language/name | string } + |{ :language/short-code | string } + "] + Language -> Translation [label=":language/translation" taillabel=1 headlabel=1] + Language -> HelpPage [label=":language/help-page" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + Translation [label="Translation + |{ :bp/uuid | keyword } + |{ :translation/name | string } + |{ :translation/key | string } + |{ :translation/translation | string } + "] + + //---------------------------------------------------------------------------------------------- + + HelpPage [label="Help-page + |{ :bp/uuid | keyword } + |{ :help-page/key | string } + |{ :help-page/content | string } + "] + + //---------------------------------------------------------------------------------------------- + + Link [label="Link + |{ :bp/uuid | keyword } + "] + Link -> GroupVariable [label="link/source" taillabel=1 headlabel=1] + Link -> GroupVariable [label="link/destination" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + // Worksheet Schema Starts Here + //---------------------------------------------------------------------------------------------- + + Worksheet [label="Worksheet + |{ :bp/uuid | string } + |{ :worksheet/run-description | string } + |{ :worksheet/name | string } + |{ :worksheet/created | long } + |{ :worksheet/furthest-visited-step | keyword } + |{ :worksheet/modules | keywords } + "] + Worksheet -> Note [label=":worksheet/notes" taillabel=1 headlabel=N] + Worksheet -> InputGroup [label=":worksheet/input-groups" taillabel=1 headlabel=N] + Worksheet -> RepeatGroup [label=":worksheet/repeat-groups" taillabel=1 headlabel=N] + Worksheet -> Output [label=":worksheet/outputs" taillabel=1 headlabel=N] + Worksheet -> ResultTable [label=":worksheet/result-table" taillabel=1 headlabel=1] + Worksheet -> GraphSettings [label=":worksheet/graph-settings" taillabel=1 headlabel=1] + Worksheet -> TableSettings [label=":worksheet/table-settings" taillabel=1 headlabel=1] + Worksheet -> WorksheetDiagram [label=":worksheet/diagrams" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + Note [label="Note + |{ :bp/uuid | string } + |{ :note/name | string } + |{ :note/content | string } + |{ :note/submodule | string } + "] + + //---------------------------------------------------------------------------------------------- + + InputGroup [label="Input-Group + |{ :bp/uuid | string } + |{ :input-group/repeat-id | long } + |{ :input-group/inputs | long } + "] + InputGroup -> Group [label=":input-group/group-uuid" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + RepeatGroup [label="Repeat-Group + |{ :bp/uuid | string } + |{ :repeat-group/group-uuid | string } + |{ :repeat-group/repeats | long } + |{ :repeat-group/inputs | long } + "] + RepeatGroup -> Group [label=":repeat-group/group-uuid" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + Output [label="Output + |{ :bp/uuid | string } + |{ :output/enabled? | boolean } + "] + Output -> GroupVariable [label=":output/group-variable-uuid" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + ResultTable [label="Result-Table + |{ :bp/uuid | string } + "] + ResultTable -> ResultHeader [label=":result-table/headers" taillabel=1 headlabel=N] + ResultTable -> ResultRow [label=":result-table/rows" taillabel=1 headlabel=N] + + //---------------------------------------------------------------------------------------------- + + ResultHeader [label="Result-Header + |{ :bp/uuid | string } + |{ :result-header/repeat-id | long } + |{ :result-header/order | long } + |{ :result-header/units | string } + "] + ResultHeader -> GroupVariable [label=":result-header/group-variable-uuid" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + ResultRow [label="Result-Row + |{ :bp/uuid | string } + |{ :result-row/id | long } + "] + ResultRow -> ResultCell [label=":result-row/cells" taillabel=1 headlabel=N] + + //---------------------------------------------------------------------------------------------- + + ResultCell [label="Result-Cell + |{ :bp/uuid | string } + |{ :result-cell/value | string } + "] + ResultCell -> ResultHeader [label=":result-cell/header" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + TableSettings [label="Table-Settings + |{ :bp/uuid | string } + |{ :table-settings/enabled? | boolean } + "] + TableSettings -> TableFilter [label=":table-settings/filters" taillabel=1 headlabel=N] + TableSettings -> MapUnitsSettings [label=":table-settings/map-units-settings" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + TableFilter [label="Table-Filter + |{ :bp/uuid | string } + |{ :table-filter/min | long } + |{ :table-filter/max | long } + |{ :table-filter/enabled? | boolean } + "] + TableFilter -> GroupVariable [label=":table-filter/group-variable-uuid" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + MapUnitsSettings [label="Map-Units-settings + |{ :bp/uuid | string } + |{ :map-units-settings/enabled? | boolean } + |{ :map-units-settings/units | string } + |{ :map-units-settings/map-rep-fraction | long } + "] + + //---------------------------------------------------------------------------------------------- + + GraphSettings [label="Graph-Settings + |{ :bp/uuid | string } + |{ :graph-settings/enabled? | boolean } + "] + GraphSettings -> YAxisLimit [label=":graph-settings/y-axis-limits" taillabel=1 headlabel=N] + GraphSettings -> GroupVariable [label=":graph-settings/x-axis-group-variable-uuid" taillabel=1 headlabel=1] + GraphSettings -> GroupVariable [label=":graph-settings/z-axis-group-variable-uuid" taillabel=1 headlabel=1] + GraphSettings -> GroupVariable [label=":graph-settings/z2-axis-group-variable-uuid" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + YAxisLimit [label="Y-Axis-Limit + |{ :bp/uuid | string } + |{ :y-axis-limit/min | long } + |{ :y-axis-limit/max | long } + "] + YAxisLimit -> GroupVariable [label=":y-axis-limit/group-variable-uuid" taillabel=1 headlabel=1] + + //---------------------------------------------------------------------------------------------- + + WorksheetDiagram [label="Worksheet-diagram + |{ :bp/uuid | string } + |{ :worksheet.diagram/title | string } + |{ :worksheet.diagram/row-id | long } + "] + WorksheetDiagram -> GroupVariable [label=":worksheet.diagram/group-variable-uuid" taillabel=1 headlabel=1] + WorksheetDiagram -> Ellipse [label=":worksheet.diagram/ellises" taillabel=1 headlabel=N] + WorksheetDiagram -> Arrow [label=":worksheet.diagram/arrows" taillabel=1 headlabel=N] + WorksheetDiagram -> ScatterPlot [label=":worksheet.diagram/scatter-plots" taillabel=1 headlabel=N] + + //---------------------------------------------------------------------------------------------- + + Ellipse [label="Ellipse + |{ :bp/uuid | string } + |{ :ellipse/legend-id | string } + |{ :ellipse/semi-major-axis | double } + |{ :ellipse/semi-minor-axis | double } + |{ :ellipse/rotation | long } + |{ :ellipse/color | string } + "] + + //---------------------------------------------------------------------------------------------- + + Arrow [label="Arrow + |{ :bp/uuid | string } + |{ :arrow/legend-id | string } + |{ :arrow/length | double } + |{ :arrow/rotation | double } + |{ :arrow/color | string } + |{ :arrow/dashed? | string } + "] + + //---------------------------------------------------------------------------------------------- + + ScatterPlot [label="Scatter-Plot + |{ :bp/uuid | string } + |{ :scatter-plot/legend-id | string } + |{ :scatter-plot/color | string } + |{ :scatter-plot/x-coordinates | string } + |{ :scatter-plot/y-coordinates | string } + "] +} +#+end_src + +#+RESULTS: +[[file:./images/schema.png]] + +*** Application Schema + +[[file:./images/schema.png]] + +**** COMMENT Schema Diagram +#+begin_src dot :results value :file ./images/schema.png +digraph GitHub { + graph [rankdir = "LR"] + + node [shape = record] + + Tool [label="Tools + |{ :bp/uuid | string } + |{ :tool/name | string } + |{ :tool/order | number } + |{ :tool/translation-key | string } + |{ :tool/help-key | string }"] + + SubTool [label="Subtool + |{ :bp/uuid | string } + |{ :subtool/name | string } + |{ :subtool/order | number } + |{ :subtool/autocompute? | boolean } + |{ :subtool/translation-key | string } + |{ :subtool/help-key | string }"] + + SubToolVariable [label="Subtool-Variable + |{ :bp/uuid | string } + |{ :subtool-variable/io | keyword } + |{ :subtool-variable/order | number } + |{ :subtool-variable/cpp-namespace-uuid | string } + |{ :subtool-variable/cpp-mclass | string } + |{ :subtool-variable/cpp-function-uuid | string } + |{ :subtool-variable/translation-key | string } + |{ :subtool-variable/help-key | string }"] + + Variable [label="Variable + |{ :bp/uuid | string } + |{ :variable/name | string } + |{ :variable/bp6-label | string } + |{ :variable/bp6-code | string } + |{ :variable/kind | keyword} + |{ :variable/translation-key | string } + |{ :variable/native-decimals | double } + |{ :variable/english-decimals | double } + |{ :variable/metric-decimals | double } + |{ :variable/maximum | double } + |{ :variable/minimum | double } + |{ :variable/default-value | double } + |{ :variable/map-units-convertible? | double } + "] + List [label="List + |{ :bp/uuid | string } + |{ :list/name | string } + |{ :list/translation-key | string } + "] + + ListOptions [label="List-Options + |{ :bp/uuid | string } + |{ :list-option/name | string } + |{ :list-option/default | string } + |{ :list-option/value | string } + |{ :list-option/order | string } + |{ :list-option/translation-key | string } + "] + + Dimension [label="Dimension + |{ :bp/uuid | string } + |{ :dimension/name | string } + |{ :dimension/cpp-enum-uuid | string } + "] + + Unit [label="Unit + |{ :bp/uuid | string } + |{ :unit/name | string } + |{ :unit/short-code | string } + |{ :unit/system | string } + |{ :unit/cpp-enum-member-uuid | string } + "] + + DomainSet [label="Domain-Set + |{ :bp/uuid | string } + |{ :domain-set/name | string } + "] + + Domain [label="Domain + |{ :bp/uuid | string } + |{ :domain/name | string } + |{ :domain/decimals | string } + "] + + Tool -> SubTool [label=":tool/subtools" taillabel=1 headlabel=N] + SubTool -> SubToolVariable [label=":subtool/variables" taillabel=1 headlabel=N] + Variable -> SubToolVariable [label=":variable/subtool-variables" taillabel=1 headlabel=N] + Variable -> List [label=":variable/list" taillabel=1 headlabel=1] + Variable -> Domain [label=":variable/domain-uuid" taillabel=1 headlabel=1] + Variable -> Unit [label=":variable/native-unit-uuid" taillabel=1 headlabel=1] + Variable -> Unit [label=":variable/english-unit-uuid" taillabel=1 headlabel=1] + Variable -> Unit [label=":variable/metric-unit-uuid" taillabel=1 headlabel=1] + List -> ListOptions [label=":list/options" taillabel=1 headlabel=N] + Dimension -> Unit [label=":dimension/units" taillabel=1 headlabel=N] + DomainSet -> Domain [label=":domain-set/domains" taillabel=1 headlabel=N] + Domain -> Dimension [label=":domain/dimension-uuid" taillabel=1 headlabel=1] + Domain -> Unit [label=":domain/native-unit-uuid" taillabel=1 headlabel=1] + Domain -> Unit [label=":domain/english-unit-uuid" taillabel=1 headlabel=1] + Domain -> Unit [label=":domain/metric-unit-uuid" taillabel=1 headlabel=1] +} +#+end_src + +#+RESULTS: +[[file:./images/schema.png]] + diff --git a/arch/01_getting_started.org b/arch/01_getting_started.org new file mode 100644 index 000000000..7c7d58596 --- /dev/null +++ b/arch/01_getting_started.org @@ -0,0 +1,93 @@ +#+TITLE: 1. Getting Started + +Prev: [[file:00_index.org][0. Architecture Overview]] | Next: [[file:02_building_wasm.org][2. Building WebAssembly]] + +*** Prerequisites + ++ OpenJDK 17 ++ [[https://github.com/babashka/babashka#installation][Babashka]] ++ [[https://clojure.org/guides/install_clojure][Clojure]] ++ Postgres (>=12) + +*** Emacs/CIDER Setup + +1. Pull down the repository (~git clone git@gitlab.com:sig-gis/behave-polylith~) +1. Pull down the submodules (~git submodule update --init --remote~) +1. Follow the Datomic Setup (see below) +1. Start the Datomic Transactor (see below) +1. Open ~development/user.cljs~ in Emacs +1. Start the CIDER nREPL ~cider-jack-in-clj&cljs~ +1. Choose ~figwheel-main~ and ~dev~ for the front-end build. +1. Open ~http://localhost:8080~ in your browser. + +*** Datomic Setup + +**** Download & Setup Datomic Pro +#+BEGIN_SRC bash + mkdir -p ~/.datomic + cd ~/.datomic + curl -O https://datomic-pro-downloads.s3.amazonaws.com/1.0.7075/datomic-pro-1.0.7075.zip + unzip *.zip + ln -s $PWD/datomic-pro-1.0.7075 $PWD/current + echo 'export PATH="$HOME/.datomic/current/bin:$PATH"' >> ~/.bashrc # Or ~/.zshrc +#+END_SRC + +**** Setting up PostgreSQL for Datomic + +Be sure that PostgreSQL is running on port 5432. + +#+BEGIN_SRC bash + cd /bases/datomic_store/sql/ + psql -U postgres -f 01_setup.sql # Creates the Datomic DB, User + psql -U datomic datomic -f 02_tables.sql # Sets up the KV table +#+END_SRC + +**** Running the Transactor +#+BEGIN_SRC bash + bb transactor +#+END_SRC + +**** Running the Datomic Console +#+BEGIN_SRC bash + bb console --port +#+END_SRC + +Then visit [[http://localhost:8000/browse][localhost:8000/browse]] + +**** Restoring CMS using a backup file + +#+begin_src sh +bb restore --file +#+end_src + +*** Building the Behave UberJAR + +1. Navigate to ~projects/behave~. All paths described here will use this directory as root. + +2. Add/edit the ~resources/config.edn~ for your deployment. Below is + an example file: + +#+BEGIN_SRC clojure +;; resources/config.edn +{:database {:config {:store {:backend :file + :path "~/.behave/db"}}} + :site {:title "BehavePlus 7" + :description "Wildfire Analysis toolkit."} + :server {:http-port 8007 + :mode "prod"} + :vms {:secret-token ""}} +#+END_SRC + +3. Compile ClojureScript + +#+BEGIN_SRC bash +bb build-js +#+END_SRC + +4. Build the UberJAR + +#+BEGIN_SRC bash +bb uber +#+END_SRC + +5. Congratulations! You're now the owner of an UberJAR. (i.e. ~target/behave7-YYYY.MM.DD-####.jar~) diff --git a/arch/02_building_wasm.org b/arch/02_building_wasm.org new file mode 100644 index 000000000..15fcc4a7a --- /dev/null +++ b/arch/02_building_wasm.org @@ -0,0 +1,64 @@ +#+TITLE: 3. Building WebAssembly + +Prev: [[file:01_getting_started.org][1. Getting Started]] | Next: [[file:03_vms_guide.org][3. VMS Guide]] + +** Behave-Lib + +The "behave-lib" directory includes the build process for generating a WASM file using c++ code from +"behave-mirror" and "include" directories. Here's Checklist for when new c++ code needs to be +transcribed into wasm and be available via the Behave CMS. + +*** Create new WASM file +**** Updating Hatchet's idl output and copying to behave.idl + +- [ ] Run the pair of header files (i.e. surface.h and SIGSurface.h) through Hatchet (see Hatchet README). +- [ ] Replace/Edit text + - [ ] "std_string" with "[Const] DOMString" + - [ ] "string" with [Const] DOMString + - [ ] Any type ref to other classes with "[Ref] SIG" + - [ ] Add [Const] to beginning of function in behave.idl for any functions in header file ending in const. +- [ ] Copy missing functions to the SIG interface in "behave-lib/include/idl/behave.idl" +- [ ] Add new enums in "behave-lib/include/idl/behave.idl" + - [ ] For each enum in behave.idl there should be an enum entry in "src/cljs/behave/lib/enums.cljs" + +**** Updating CLJS file in Behave with Hatchet's output. + +- [ ] Add missing functions from hatchet's output cljs file to "behave/src/cljs/behave/lib/.cljs" +- [ ] Add this to the end of the file + +#+begin_src clojure +(def ^:export ns-public-fns (update-keys (ns-publics 'behave.lib.ignite) name)) +#+end_src + +**** Updating enums.cpp + +- [ ] Add mapping for new enums in "behave-lib/include/cpp/emscripten/enums.cpp" + +**** Updating behave_extern.js + +- [ ] Update behave_extern.js with functions from cljs file + +**** Create new WASM file + +- [ ] In "behave-lib" run + +#+begin_src sh +make install +#+end_src + +**** Import EDN files from hatchet into CMS + +- [ ] Both edn files have been created through hatchet (i.e. surface.edn and SIGSurface.edn) +- [ ] Run a modified version of the code block below for the module that needs updating + +#+begin_src clojure +(ns cms-import) +;; Combine edn files from hatchet +(cms-import {:behave-file "path/to/hatchet/output/surface.edn" + :sig-adapter-file "path/to/hatchet/output/SIGSurface.edn" + :out-file-name "SIGSurface.edn" + :from-key :Surface + :to-key :SIGSurface}) + +(add-export-file-to-conn "./cms-exports/SIGSurface.edn" conn) +#+end_src diff --git a/arch/03_vms_guide.org b/arch/03_vms_guide.org new file mode 100644 index 000000000..ce315aec3 --- /dev/null +++ b/arch/03_vms_guide.org @@ -0,0 +1,311 @@ +#+TITLE: Hitchhiker's Guide to the Variable Management System (VMS) \includegraphics[]{./images/vms-guide/Screenshot 2025-04-18 123426.png}\par \includegraphics[width=1.0\textwidth]{./images/vms-guide/Screenshot 2025-04-18 124034.png}\par +#+OPTIONS: toc:t author:nil date:nil +#+LATEX_HEADER: \usepackage{float} +#+LATEX_HEADER: \usepackage[margin=1in]{geometry} +#+LATEX_HEADER: \usepackage{hyperref} +#+LATEX_HEADER: \hypersetup{ +#+LATEX_HEADER: colorlinks=true, +#+LATEX_HEADER: linkcolor=blue, +#+LATEX_HEADER: urlcolor=blue, +#+LATEX_HEADER: citecolor=blue +#+LATEX_HEADER: } +#+LATEX_HEADER:\usepackage{titlesec} +#+LATEX_HEADER:\newcommand{\sectionbreak}{\clearpage} +#+LATEX_HEADER:\newcommand{\subsectionbreak}{\clearpage} + +* Finding VMS elements in the Application + +The VMS holds the structure of our application. The data is a tree like structure that determines how the application is rendered. This section aims to help you understand how the data in the VMS translates to how it is shown in the application. + +** Modules/Submodules/Groups/Group Variables + +In the VMS Use the side bar to navigate down these paths: + +#+begin_verse +Applications \to Modules \to Submodules \to Group \to Group Variables \to Variables +#+end_verse + +Example: + +#+begin_verse +BehavePlus \to Surface \to Fire Behavior(output) \to Surface Fire \to Heading Rate of Spread \to Heading Rate of Spread +#+end_verse + +#+ATTR_LATEX: :placement [H] :width 0.75\textwidth +#+CAPTION: VMS: Home page +[[./images/vms-guide/Screenshot 2025-04-15 122636.png]] + +#+ATTR_LATEX: :placement [H] :width 0.75\textwidth +#+CAPTION: Application: Outputs page after a Surface Only worksheet has been created. +[[./images/vms-guide/Screenshot 2025-04-14 144743.png]] + +#+ATTR_LATEX: :placement [H] :width 0.75\textwidth +#+CAPTION: Application: Inputs page after a Surface Only worksheet has been created. NOTE Groups can have sub groups. +[[./images/vms-guide/Screenshot 2025-04-14 163337.png]] + +** Variables + +The Variables can be associated with multiple group variables but group variables can only be associated to a single variable. The Variable entity will hold information about Domains/Dimension/units + +*** Variable Entities + +1. Navigate to the "Variables" tab + +*** Variable Associated with a Group Variable + +1. Navigate to the Application \to Module \to Group +2. "Expand" the "Variables" accordion +3. Find the variable you are interested in and click "Edit". This will take you to the "Variables" page and populate the form with the variable's info. + +#+ATTR_LATEX: :placement [H] +#+CAPTION: VMS: Finding the variable associated with a group variable +[[./images/vms-guide/Screenshot 2025-04-14 151243.png]] + +** List and List Options + +Certain Group Variables have a list associated with it (usually inputs). In the application lists show up as either radio selections or drop down selections. + +#+ATTR_LATEX: :placement [H] :width 0.75\textwidth +#+CAPTION: Application: List options as radio selections. +[[./images/vms-guide/Screenshot 2025-04-14 150013.png]] + +#+ATTR_LATEX: :placement [H] :width 0.75\textwidth +#+CAPTION: Application: List options as multi select drop down. +[[./images/vms-guide/Screenshot 2025-04-14 150755.png]] + +In the VMS you can find the list associated to a group variable by: + +1. Navigating to the Module \to Submodule \to Group +2. Click "Expand" on the "Variables" accordion. Then click "Edit" on the Variable listed. This will Navigate you to the "Variables" page and populate the form with the variable's information. + +#+ATTR_LATEX: :placement [H] +#+CAPTION: VMS: Group page +[[./images/vms-guide/Screenshot 2025-04-14 151243.png]] + +3. Look for the "List" field and note the list selected. + +#+ATTR_LATEX: :placement [H] +#+CAPTION: VMS: Variables page +[[./images/vms-guide/Screenshot 2025-04-14 164610.png]] + +1. Navigate to the "List" tab and scroll down or (Ctrl +f) to find the list mentioned above. + +#+ATTR_LATEX: :placement [H] +#+CAPTION: VMS: List page +[[./images/vms-guide/Screenshot 2025-04-14 164814.png]] + +5. Click "Edit". This will populate the form at the bottom of the page. + +** Filter and Color Tags + +*** Filter and Color Tags Entities +Filter and Color tags in the application can be found in input group variables that allow users to select multiple inputs. + +#+ATTR_LATEX: :placement [H] +#+CAPTION: Application: Filter Tag and Color Tag example. +[[./images/vms-guide/Screenshot 2025-04-14 163724.png]] + +You can find existing tags in the VMS by: +1. Navigate to the "Tags" tab + +#+ATTR_LATEX: :placement [H] :width 0.50\textwidth +#+CAPTION: VMS: Tags page +[[./images/vms-guide/Screenshot 2025-04-15 145117.png]] + +*** Filter and Color Tags associated with a Group Variable +You can find the tag sets associated with a group variable by: + +1. Find the list associated to the group variable, see [[*List and List Options][List and List Options]] section. +2. Click "Edit" on the list +3. Once the form on the list page has been populated you can find the associated tag sets. + +#+ATTR_LATEX: :placement [H] +#+CAPTION: VMS: List page +[[./images/vms-guide/Screenshot 2025-04-15 162354.png]] + +** Variable Domains +*** Variable Domain Entities + +The Variable Domain entities is used primarily to associate a group of variables to some default units and decimal precision. Domain entities are grouped into Domain sets, primarily used for creating collapsing accordions in the application. + +#+ATTR_LATEX: :placement [H] +#+CAPTION: Application: Custom Unit Preferences table. +[[./images/vms-guide/Screenshot 2025-04-16 152012.png]] + +1. Navigate to the "Variable Domains" tab +2. Click "Edit" on the "Domain Set". This will populate the form on the right with a list of domains that belong to this set. +#+ATTR_LATEX: :placement [H] +#+CAPTION: VMS: Variable Domains. +[[./images/vms-guide/Screenshot 2025-04-16 152830.png]] + +*** Variable Domains Associated with a Group Variable + +1. Find the Variable associated with your group variable of interest. see [[*Variable Associated with a Group Variable][Variable Associated with a Group Variable]] section +2. You can find the domain associated to the variable under the "Domain" field + +#+ATTR_LATEX: :placement [H] +#+CAPTION: VMS: The Domain associated with this variable. +[[./images/vms-guide/Screenshot 2025-04-16 160738.png]] + +** Units and Precision + +Default Units and Precision live in the Domain Entities. + +1. Find the Domain associated with your group variable see [[*Variable Domains Associated with a Group Variable][Variable Domains Associated with a Group Variable]] section. +2. Navigate to the "Domains" page and lookup the domain. +3. Click "Edit" on the "Domain Set" and "Edit" on the "Domain" entity to populate the forms. +4. Default units is shown under "Native Unit" +5. Default precision is shown under "Decimals" + +#+ATTR_LATEX: :placement [H] +#+CAPTION: VMS: The Domain associated with this variable. +[[./images/vms-guide/Screenshot 2025-04-16 16125122.png]] + +** Conditionals + +Conditionals serve one of two purposes. First and most common is to determine if a submodule or group should be displayed in the application. The second purpose is to attach them to actions. When attached to actions the conditional determines if that action should be fired (i.e. setting an input group variable to a default value if a certain output group variable is selected). + +*** Submodule/Group Conditionals + +To find a conditional that controls if a submodule or group are hidden: +1. Navigate to the submodule or group entity page and expand the "Conditionals" accordion + +#+ATTR_LATEX: :placement [H] +#+CAPTION: VMS: Conditionals to only show the Spot(input) submodule if either these output variables are selected. NOTE: Clicking "Edit" on the conditional will populate the form on the right. This is useful for seeing all the parent entities of this group (i.e. The conditional above belongs to the Surface (Module) \to Spot Output (Submodule) \to Maximum Spotting Distance (group). +[[./images/vms-guide/Screenshot 2025-04-21 115338.png]] + +#+ATTR_LATEX: :placement [H] +#+CAPTION: Application: "Wind Driven Surface Fire" is selected as an output. +[[./images/vms-guide/Screenshot 2025-04-21 115625.png]] + + +#+ATTR_LATEX: :placement [H] +#+CAPTION: Application: Since "Wind-Driven Surface Fire" is selected as an output, the Spot(Input) submodule passes the conditional and is displayed. +[[./images/vms-guide/Screenshot 2025-04-21 115646.png]] + +*** Action Conditionals + +To find a conditional attached to an action: +1. Navigate to the Group Variable entity page and expand the "Actions" accordion + +#+ATTR_LATEX: :placement [H] :width 0.75\textwidth +#+CAPTION: VMS: Group Variables can have multiple actions. +[[./images/vms-guide/Screenshot 2025-04-21 122253.png]] + +#+ATTR_LATEX: :placement [H] :width 0.75\textwidth +#+CAPTION: VMS: Each action has one or more conditionals. The name of the action should describe what is necessary to trigger the action but to more closely look at the conditionals, click "Edit" on the action you are interested in. +[[./images/vms-guide/Screenshot 2025-04-21 122436.png]] + +#+ATTR_LATEX: :placement [H] :width 0.75\textwidth +#+CAPTION: Application: "Midflame Wind Speed" is selected as an output +[[./images/vms-guide/Screenshot 2025-04-21 123238.png]] + + +#+ATTR_LATEX: :placement [H] :width 0.75\textwidth +#+CAPTION: Application: Action is triggered to disable "Midflame (Eye Level)" as an option in the inputs page. +[[./images/vms-guide/Screenshot 2025-04-21 123312.png]] + +* Updating Text + +Most texts for entities displayed in the application can be updated by changing the translation field for that entity..These entities will have 2 translation fields. One field is used in the worksheet wizard (pages before computation) and the second is used for the results page. Usually the result translations are a short form of the worksheet translations. Here are some of the common entities you might want to update. The application will default to the worksheet translation if a result translation is not present. + +** Submodule/Group/Group-Variables + +1. For these entities navigate to the entity page, see [[*Modules/Submodules/Groups/Group Variables][Modules/Submodules/Groups/Group Variables]] section. +2. Update the "Translation" field. + +#+ATTR_LATEX: :placement [H] :width 0.50\textwidth +#+CAPTION: VMS: Group page after navigating BehavePlus \to Surface \to Fire Behavior(output) \to Surface Fire +[[./images/vms-guide/Screenshot 2025-04-14 145649.png]] + + + +** List Options + +#+ATTR_LATEX: :placement [H] :width 0.50\textwidth +#+CAPTION: Application: Worksheet translations appear in the wizard. +[[./images/vms-guide/Screenshot 2025-04-15 165647.png]] + +#+ATTR_LATEX: :placement [H] :width 0.50\textwidth +#+CAPTION: Application: Result translations appear in the results matrices and tables. +[[./images/vms-guide/Screenshot 2025-04-15 165841.png]] + +1. Find the list associated to the group variable, see [[*List and List Options][List and List Options]] section. +2. Click "Edit" on the list. +3. Find the list option you are interested in updating and click "Edit". +4. Update the "Translation" field and the "Name" field. +5. Navigate to the list associated with the group variable. see [[*List and List Options][List and List Options]] +6. Click "Edit" on the list option you want to update. + +#+ATTR_LATEX: :placement [H] :width 0.75\textwidth +#+CAPTION: VMS: List Page +[[./images/vms-guide/Screenshot 2025-04-15 164954.png]] + +** Tags + +1. Navigate to the tag set associated with your group variable of interest. See [[*Filter and Color Tags associated with a Group Variable][Filter and Color Tags associated with a Group Variable]] +2. Click "Edit" on the tag set. This will populate the table on the right. +3. Click "Edit" on the tag option you'd like to update. +4. Update the "Translation" field and the "Name" field. + +#+ATTR_LATEX: :placement [H] +#+CAPTION: VMS: Updating translations on tags page. +[[./images/vms-guide/Screenshot 2025-04-15 171421.png]] + +* Updating Default Unit Preferences + +** Units + +1. Find the Domain associated with the variable you are interested in. See [[*Variable Domains Associated with a Group Variable][Variable Domains Associated with a Group Variable]] section. +2. Click "Edit" on the Domain set +3. Click "Edit" on the Domain found in step 1. +4. Update the "Native Unit" field + +#+ATTR_LATEX: :placement [H] +#+CAPTION: VMS: Updating translations on tags page. +[[./images/vms-guide/Screenshot 2025-04-16 1612512.png]] + +** Precision + +1. Follow the steps from [[*Units][above]] to find the Domain entity. +1. Update the "Decimals" field + +#+ATTR_LATEX: :placement [H] +#+CAPTION: VMS: Updating translations on tags page. +[[./images/vms-guide/Screenshot 2025-04-16 161251.png]] + +* Updating Units Dropdown Selections + +In the Application's inputs page a user can change units via a drop down menu. By default a variable is linked to a "Dimension" (i.e. length) and will have all options available to select. However there are cases when this list should be limited to a subset. If this is desired do the following: + +1. Find the Domain associated with the variable you are interested in. See [[*Variable Domains Associated with a Group Variable][Variable Domains Associated with a Group Variable]] section. +2. Click "Edit" on the Domain set +3. Click "Edit" on the Domain found in step 1. +4. Under "Filtered Units" select a subset of your desired units + +#+ATTR_LATEX: :placement [H] +#+CAPTION: VMS: Domains Page Updating Units drop down to a subset of units. +[[./images/vms-guide/Screenshot 2025-04-16 163044.png]] + +* Re-Ordering + +Certain entities can be re-ordered via the VMS. To do this: + +1. Find the parent entity of the entity you are trying to reorder (i.e. Need to reorder groups? find the submodule entity page. Need to reorder a list options? Find the List entity page.). See [[*Finding VMS elements in the Application][Finding VMS elements in the Application]] +2. Once you're on that page there should be a table that have a list of entities for you to reorder. Click on the "up" and "down" buttons to reorder + +#+ATTR_LATEX: :placement [H] +#+CAPTION: Application: Reordering Direction Mode output selections. +[[./images/vms-guide/Screenshot 2025-04-18 122848.png]] + +#+ATTR_LATEX: :placement [H] +#+CAPTION: VMS: Reordering Direction Mode output selections: Navigate to BehavePlus \to Surface \to Fire Behavior(output) \to Direction Mode +[[./images/vms-guide/Screenshot 2025-04-18 121904.png]] + +#+ATTR_LATEX: :placement [H] +#+CAPTION: Application: Reordering fuel model codes. +[[./images/vms-guide/Screenshot 2025-04-18 122936.png]] + +#+ATTR_LATEX: :placement [H] +#+CAPTION: VMS: Reordering fuel model codes. Find list "SurfaceFuelModels" and click "Edit". +[[./images/vms-guide/Screenshot 2025-04-18 122529.png]] diff --git a/arch/03_vms_guide.pdf b/arch/03_vms_guide.pdf new file mode 100644 index 000000000..c6f5f47cc Binary files /dev/null and b/arch/03_vms_guide.pdf differ diff --git a/arch/images/behave-logo.svg b/arch/images/behave-logo.svg new file mode 100644 index 000000000..7b5720e55 --- /dev/null +++ b/arch/images/behave-logo.svg @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/arch/images/fs-logo.svg b/arch/images/fs-logo.svg new file mode 100644 index 000000000..1c3d32a2c --- /dev/null +++ b/arch/images/fs-logo.svg @@ -0,0 +1,2 @@ + +
usda-symbol diff --git a/arch/images/vms-guide/Screenshot 2025-04-14 144743.png b/arch/images/vms-guide/Screenshot 2025-04-14 144743.png new file mode 100755 index 000000000..30d447b94 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-14 144743.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-14 145649.png b/arch/images/vms-guide/Screenshot 2025-04-14 145649.png new file mode 100755 index 000000000..3d071cf7c Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-14 145649.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-14 150013.png b/arch/images/vms-guide/Screenshot 2025-04-14 150013.png new file mode 100755 index 000000000..5a0246649 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-14 150013.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-14 150755.png b/arch/images/vms-guide/Screenshot 2025-04-14 150755.png new file mode 100755 index 000000000..ef675f026 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-14 150755.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-14 151243.png b/arch/images/vms-guide/Screenshot 2025-04-14 151243.png new file mode 100755 index 000000000..d2f098409 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-14 151243.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-14 151404.png b/arch/images/vms-guide/Screenshot 2025-04-14 151404.png new file mode 100755 index 000000000..893987c33 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-14 151404.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-14 151651.png b/arch/images/vms-guide/Screenshot 2025-04-14 151651.png new file mode 100755 index 000000000..0f837ab44 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-14 151651.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-14 152004.png b/arch/images/vms-guide/Screenshot 2025-04-14 152004.png new file mode 100755 index 000000000..fcc660090 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-14 152004.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-14 163337.png b/arch/images/vms-guide/Screenshot 2025-04-14 163337.png new file mode 100755 index 000000000..f57559e99 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-14 163337.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-14 163724.png b/arch/images/vms-guide/Screenshot 2025-04-14 163724.png new file mode 100755 index 000000000..4048696c2 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-14 163724.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-14 164447.png b/arch/images/vms-guide/Screenshot 2025-04-14 164447.png new file mode 100755 index 000000000..ceca32cea Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-14 164447.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-14 164610.png b/arch/images/vms-guide/Screenshot 2025-04-14 164610.png new file mode 100755 index 000000000..6cae53be2 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-14 164610.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-14 164814.png b/arch/images/vms-guide/Screenshot 2025-04-14 164814.png new file mode 100755 index 000000000..1040f8770 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-14 164814.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-14 165118.png b/arch/images/vms-guide/Screenshot 2025-04-14 165118.png new file mode 100755 index 000000000..b3681dc74 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-14 165118.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-15 111557.png b/arch/images/vms-guide/Screenshot 2025-04-15 111557.png new file mode 100755 index 000000000..5d40dd153 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-15 111557.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-15 122636.png b/arch/images/vms-guide/Screenshot 2025-04-15 122636.png new file mode 100755 index 000000000..8e5250460 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-15 122636.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-15 145117.png b/arch/images/vms-guide/Screenshot 2025-04-15 145117.png new file mode 100755 index 000000000..dd96ec03a Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-15 145117.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-15 162354.png b/arch/images/vms-guide/Screenshot 2025-04-15 162354.png new file mode 100755 index 000000000..026b85712 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-15 162354.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-15 164954.png b/arch/images/vms-guide/Screenshot 2025-04-15 164954.png new file mode 100755 index 000000000..c935d1f88 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-15 164954.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-15 165647.png b/arch/images/vms-guide/Screenshot 2025-04-15 165647.png new file mode 100755 index 000000000..c4d822454 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-15 165647.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-15 165841.png b/arch/images/vms-guide/Screenshot 2025-04-15 165841.png new file mode 100755 index 000000000..bf5b58c94 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-15 165841.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-15 171421.png b/arch/images/vms-guide/Screenshot 2025-04-15 171421.png new file mode 100755 index 000000000..dafb6044d Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-15 171421.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-15 173655.png b/arch/images/vms-guide/Screenshot 2025-04-15 173655.png new file mode 100755 index 000000000..7eb8d4250 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-15 173655.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-15 173844.png b/arch/images/vms-guide/Screenshot 2025-04-15 173844.png new file mode 100755 index 000000000..79f4d5823 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-15 173844.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-15 173912.png b/arch/images/vms-guide/Screenshot 2025-04-15 173912.png new file mode 100755 index 000000000..2fb5ce9fe Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-15 173912.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-16 152012.png b/arch/images/vms-guide/Screenshot 2025-04-16 152012.png new file mode 100755 index 000000000..8fb8c4427 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-16 152012.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-16 152830.png b/arch/images/vms-guide/Screenshot 2025-04-16 152830.png new file mode 100755 index 000000000..8ec3d1066 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-16 152830.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-16 160738.png b/arch/images/vms-guide/Screenshot 2025-04-16 160738.png new file mode 100755 index 000000000..6dbe62ee1 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-16 160738.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-16 161251.png b/arch/images/vms-guide/Screenshot 2025-04-16 161251.png new file mode 100755 index 000000000..dc60944f4 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-16 161251.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-16 1612512.png b/arch/images/vms-guide/Screenshot 2025-04-16 1612512.png new file mode 100755 index 000000000..79b156d3e Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-16 1612512.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-16 16125122.png b/arch/images/vms-guide/Screenshot 2025-04-16 16125122.png new file mode 100755 index 000000000..1b51f9b0b Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-16 16125122.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-16 162312.png b/arch/images/vms-guide/Screenshot 2025-04-16 162312.png new file mode 100755 index 000000000..b00fefe3b Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-16 162312.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-16 163044.png b/arch/images/vms-guide/Screenshot 2025-04-16 163044.png new file mode 100755 index 000000000..4f570b777 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-16 163044.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-18 121904.png b/arch/images/vms-guide/Screenshot 2025-04-18 121904.png new file mode 100755 index 000000000..ef65d7633 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-18 121904.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-18 122529.png b/arch/images/vms-guide/Screenshot 2025-04-18 122529.png new file mode 100755 index 000000000..be75ab909 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-18 122529.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-18 122848.png b/arch/images/vms-guide/Screenshot 2025-04-18 122848.png new file mode 100755 index 000000000..18af0ca30 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-18 122848.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-18 122936.png b/arch/images/vms-guide/Screenshot 2025-04-18 122936.png new file mode 100755 index 000000000..b4c3ae5f9 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-18 122936.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-18 123426.png b/arch/images/vms-guide/Screenshot 2025-04-18 123426.png new file mode 100755 index 000000000..915bfe559 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-18 123426.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-18 124034.png b/arch/images/vms-guide/Screenshot 2025-04-18 124034.png new file mode 100755 index 000000000..f591963f5 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-18 124034.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-21 115338.png b/arch/images/vms-guide/Screenshot 2025-04-21 115338.png new file mode 100755 index 000000000..7bbb389f0 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-21 115338.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-21 115625.png b/arch/images/vms-guide/Screenshot 2025-04-21 115625.png new file mode 100755 index 000000000..1ec23cb5e Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-21 115625.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-21 115646.png b/arch/images/vms-guide/Screenshot 2025-04-21 115646.png new file mode 100755 index 000000000..5f6b00f85 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-21 115646.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-21 122253.png b/arch/images/vms-guide/Screenshot 2025-04-21 122253.png new file mode 100755 index 000000000..878cd65ab Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-21 122253.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-21 122436.png b/arch/images/vms-guide/Screenshot 2025-04-21 122436.png new file mode 100755 index 000000000..5b135f304 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-21 122436.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-21 123238.png b/arch/images/vms-guide/Screenshot 2025-04-21 123238.png new file mode 100755 index 000000000..e5d3cd644 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-21 123238.png differ diff --git a/arch/images/vms-guide/Screenshot 2025-04-21 123312.png b/arch/images/vms-guide/Screenshot 2025-04-21 123312.png new file mode 100755 index 000000000..5267b34d4 Binary files /dev/null and b/arch/images/vms-guide/Screenshot 2025-04-21 123312.png differ diff --git a/projects/behave/docs/vms-schema.png b/arch/images/vms-schema.png similarity index 100% rename from projects/behave/docs/vms-schema.png rename to arch/images/vms-schema.png diff --git a/arch/images/worksheet-schema.png b/arch/images/worksheet-schema.png new file mode 100644 index 000000000..59976375d Binary files /dev/null and b/arch/images/worksheet-schema.png differ diff --git a/projects/behave/docs/worksheet-schema.png b/projects/behave/docs/worksheet-schema.png deleted file mode 100644 index 1fa8bbc62..000000000 Binary files a/projects/behave/docs/worksheet-schema.png and /dev/null differ diff --git a/projects/behave/resources/public/images/logo.png b/projects/behave/resources/public/images/logo.png index e39508298..bc8dce854 100644 Binary files a/projects/behave/resources/public/images/logo.png and b/projects/behave/resources/public/images/logo.png differ diff --git a/projects/behave_cms/src/cljs/behave_cms/tags/views.cljs b/projects/behave_cms/src/cljs/behave_cms/tags/views.cljs index 84a89c493..228b39f42 100644 --- a/projects/behave_cms/src/cljs/behave_cms/tags/views.cljs +++ b/projects/behave_cms/src/cljs/behave_cms/tags/views.cljs @@ -2,6 +2,7 @@ (:require [re-frame.core :as rf] [behave-cms.components.common :refer [simple-table]] [behave-cms.components.entity-form :refer [entity-form]] + [behave-cms.components.translations :refer [all-translations]] [behave-cms.events] [behave-cms.subs] [string-utils.interface :refer [->kebab]])) @@ -16,7 +17,8 @@ (defn- tag-editor [tag-set-eid tag-eid] (let [tag-set (rf/subscribe [:entity tag-set-eid]) - tags (rf/subscribe [:pull-children :tag-set/tags tag-set-eid])] + tags (rf/subscribe [:pull-children :tag-set/tags tag-set-eid]) + tag-entity (rf/subscribe [:entity tag-eid])] [:<> [:h3 (if tag-eid "Edit Tag" "Add Tag")] [entity-form {:entity :tag @@ -31,16 +33,18 @@ :type :color :disabled? (:tag-set/color? @tag-set) :field-key :tag/color}] - :on-create (fn [data] - (let [translation (upsert-translation (:tag/translation-key data) (:tag/name data))] + :on-create (fn [data] + (let [translation (upsert-translation (:tag/translation-key data) (:tag/name data))] (rf/dispatch [:api/create-entity translation]) (merge data {:tag/order (count @tags)}))) - :on-update (fn [data] + :on-update (fn [data] (if (:tag/name data) (let [translation (upsert-translation (:tag/translation-key data) (:tag/name data))] (rf/dispatch [:api/create-entity translation]) data) - data))}]])) + data))}] + [:h4 "Worksheet Translation"] + [all-translations (:tag/translation-key @tag-entity)]])) (defn- tags-table [tag-set-eid] (when tag-set-eid