<|"Notebook" -> <|"Controller" -> "fa84af00-6929-4d09-896c-e8bf9c39804b", "FocusedCell" -> CoffeeLiqueur`Notebook`Cells`CellObj[ CoffeeLiqueur`Notebook`Cells`CellObj`$508], "HaveToSaveAs" -> False, "MessangerChannel" -> Messanger, "ModalsChannel" -> "981cd5b5-1278-4f43-9daa-23ff358a60d4", "Objects" -> <||>, "Path" -> "/users/kirill/Github/wljs-demos-archive/Demos/17 - Apps/Units \ Converter.wln", "Quick" -> True, "Symbols" -> <||>, "TOC" -> {CoffeeLiqueur`Extensions`TOC`Private`heading[1, "Units converter", CoffeeLiqueur`Notebook`Cells`CellObj[ CoffeeLiqueur`Notebook`Cells`CellObj`$501]], CoffeeLiqueur`Extensions`TOC`Private`heading[2, "Source code", CoffeeLiqueur`Notebook`Cells`CellObj[ CoffeeLiqueur`Notebook`Cells`CellObj`$501]]}|>, "Cells" -> {<|"Data" -> ".md\n# Units converter\nAn app for fast convertion \ different optical units.\n\n
\n\n## Source code\n\nDefine a custom input \ component", "Display" -> "codemirror", "Hash" -> "0795d772-6d7b-43bb-9f21-b59f6b02198c", "Invisible" -> False, "MetaOnly" -> False, "Props" -> <|"Hidden" -> True|>, "State" -> "Idle", "Type" -> "Input", "UID" -> Null, "Notebook" -> "8da11258-068b-4049-b6cb-960fc64698fb"|>, <|"Data" -> "# Units converter\nAn app for fast convertion different \ optical units.\n\n
\n\n## Source code\n\nDefine a custom input \ component", "Display" -> "markdown", "Hash" -> "d133c0c4-e8c6-44ba-8949-05f446744039", "Invisible" -> False, "MetaOnly" -> False, "Props" -> <||>, "State" -> "Idle", "Type" -> "Output", "UID" -> Null, "Notebook" -> "8da11258-068b-4049-b6cb-960fc64698fb"|>, <|"Data" -> ".wlx\n\nCustomInput[sym_, OptionsPattern[]] := Module[{\n \ Label = OptionValue[\"Label\"],\n Ev = OptionValue[\"Event\"],\n Pattern = \ OptionValue[\"Pattern\"],\n System`Handler\n},\n With[{Handler = \ System`Handler},\n With[{Template = \n
\n \
\n \n \n
\n },\n \ HTMLView[Template, Epilog->(Handler[sym])]\n ]]\n]\n\nOptions[CustomInput] = \ {\"Label\"->\"\", \"Event\"->\"\", \"Pattern\"->\"Default\"};", "Display" -> "codemirror", "Hash" -> "0765541e-a22c-4ad0-a4bf-053c5023d5e0", "Invisible" -> False, "MetaOnly" -> False, "Props" -> <|"InitGroup" -> True|>, "State" -> "Idle", "Type" -> "Input", "UID" -> Null, "Notebook" -> "8da11258-068b-4049-b6cb-960fc64698fb"|>, <|"Data" -> ".md\nApp logic", "Display" -> "codemirror", "Hash" -> "b7cdead0-a455-478a-92e6-988318c756e9", "Invisible" -> False, "MetaOnly" -> False, "Props" -> <|"Hidden" -> True|>, "State" -> "Idle", "Type" -> "Input", "UID" -> Null, "Notebook" -> "8da11258-068b-4049-b6cb-960fc64698fb"|>, <|"Data" -> "App logic", "Display" -> "markdown", "Hash" -> "8145b59e-607a-411d-b7a2-3558c3cbf469", "Invisible" -> False, "MetaOnly" -> False, "Props" -> <||>, "State" -> "Idle", "Type" -> "Output", "UID" -> Null, "Notebook" -> "8da11258-068b-4049-b6cb-960fc64698fb"|>, <|"Data" -> "Sliders = LeakyModule[{\n ev = CreateUUID[],\n rules,\n \ assoc,\n System`rack,\n recalc\n},\n \n\nrules = {\n \"Centimeters\" -> \ \"Centimeters\",\n \"eV\" -> \"Centimeters\" / 8065.6,\n \"meV\" -> 1000 \ \"Centimeters\" / 8065.6,\n \"Micrometers\" -> 10000 / \"Centimeters\",\n \ \"Nanometers\" -> (*SpB[*)Power[10(*|*),(*|*)7](*]SpB*) / \"Centimeters\",\n \ \"Angstrem\" -> (*SpB[*)Power[10(*|*),(*|*)8](*]SpB*) / \"Centimeters\",\n \ \"MHz\" -> (*SpB[*)Power[10(*|*),(*|*)4](*]SpB*) 2.9979 \"Centimeters\",\n \ \"GHz\" -> (*SpB[*)Power[10(*|*),(*|*)4](*]SpB*) 2.9979 \"Centimeters\" \ 0.001,\n \"THz\" -> (*SpB[*)Power[10(*|*),(*|*)4](*]SpB*) 2.9979 \ \"Centimeters\" 0.001 0.001,\n \"K\" -> 1.428 \"Centimeters\",\n\n \"ps\" \ -> 0.004136 / (\"Centimeters\" / 8065.6),\n\n \n \"T\" -> 4.26602 \ \"Centimeters\",\n \"Oe\" -> 10000 4.26602 \"Centimeters\",\n \n \ \"kJ/Mol\" -> 0.0120 \"Centimeters\",\n \"Hartree\" -> \"Centimeters\" / \ (27.2114 8065.6)\n};\n\nassoc = Association[rules];\n\nSystem`rack = \ Map[Function[v, 0.0], assoc];\n\nModule[{var},\nrecalc[units_, val_] := \ With[{cm = NSolve[val == (assoc[units] /. \"Centimeters\" -> var), \ var][[1,1,2]] // N},\n Map[Function[key,\n System`rack[key] = \ Round[(assoc[key] /. \"Centimeters\" -> cm), 0.0001]\n ], \ Keys[System`rack]];\n\n System`rack = \ System`rack;\n];\n]\n\nEventHandler[ev, {\n units_ :> (recalc[units, \ #]&)\n}];\n\nCreateFrontEndObject /@ {\n CustomInput[System`rack//Offload, \ \"Event\"->ev, \"Label\"->\"cm-1\", \ \"Pattern\"->\"Centimeters\"],\n CustomInput[System`rack//Offload, \ \"Event\"->ev, \"Label\"->\"eV\", \"Pattern\"->\"eV\"],\n \ CustomInput[System`rack//Offload, \"Event\"->ev, \"Label\"->\"meV\", \ \"Pattern\"->\"meV\"],\n HTMLView[\"
\"],\n \ CustomInput[System`rack//Offload, \"Event\"->ev, \"Label\"->\"µm\", \ \"Pattern\"->\"Micrometers\"],\n CustomInput[System`rack//Offload, \ \"Event\"->ev, \"Label\"->\"nm\", \"Pattern\"->\"Nanometers\"],\n \ CustomInput[System`rack//Offload, \"Event\"->ev, \"Label\"->\"A\", \ \"Pattern\"->\"Angstrem\"],\n HTMLView[\"
\"],\n \ CustomInput[System`rack//Offload, \"Event\"->ev, \"Label\"->\"MHz\", \ \"Pattern\"->\"MHz\"],\n CustomInput[System`rack//Offload, \"Event\"->ev, \ \"Label\"->\"GHz\", \"Pattern\"->\"GHz\"],\n \ CustomInput[System`rack//Offload, \"Event\"->ev, \"Label\"->\"THz\", \ \"Pattern\"->\"THz\"],\n HTMLView[\"
\"],\n \ CustomInput[System`rack//Offload, \"Event\"->ev, \"Label\"->\"ps\", \ \"Pattern\"->\"ps\"],\n HTMLView[\"
\"],\n \ CustomInput[System`rack//Offload, \"Event\"->ev, \"Label\"->\"Oe (1/2)\", \ \"Pattern\"->\"Oe\"],\n CustomInput[System`rack//Offload, \"Event\"->ev, \ \"Label\"->\"T (1/2)\", \"Pattern\"->\"T\"],\n HTMLView[\"
\"],\n \ CustomInput[System`rack//Offload, \"Event\"->ev, \"Label\"->\"K\", \ \"Pattern\"->\"K\"],\n CustomInput[System`rack//Offload, \"Event\"->ev, \ \"Label\"->\"kJ/Mol\", \"Pattern\"->\"kJ/Mol\"],\n \ CustomInput[System`rack//Offload, \"Event\"->ev, \"Label\"->\"Hartree\", \ \"Pattern\"->\"Hartree\"]\n}\n];", "Display" -> "codemirror", "Hash" -> "fb82a955-12eb-4bb5-97ff-cd8b4631026e", "Invisible" -> False, "MetaOnly" -> False, "Props" -> <|"InitGroup" -> True|>, "State" -> "Idle", "Type" -> "Input", "UID" -> Null, "Notebook" -> "8da11258-068b-4049-b6cb-960fc64698fb"|>, <|"Data" -> ".md\nApp layout", "Display" -> "codemirror", "Hash" -> "480649e1-4206-4bb4-99e3-2b33e98b9d42", "Invisible" -> False, "MetaOnly" -> False, "Props" -> <|"Hidden" -> True|>, "State" -> "Idle", "Type" -> "Input", "UID" -> Null, "Notebook" -> "8da11258-068b-4049-b6cb-960fc64698fb"|>, <|"Data" -> "App layout", "Display" -> "markdown", "Hash" -> "360ca049-3095-488d-addf-7b047f79ecb2", "Invisible" -> False, "MetaOnly" -> False, "Props" -> <||>, "State" -> "Idle", "Type" -> "Output", "UID" -> Null, "Notebook" -> "8da11258-068b-4049-b6cb-960fc64698fb"|>, <|"Data" -> ".wlx\n\n
\n \n
", "Display" -> "codemirror", "Hash" -> "9c6b7c82-e81e-4c89-8142-c0d7d335c9f4", "Invisible" -> False, "MetaOnly" -> False, "Props" -> <||>, "State" -> "Idle", "Type" -> "Input", "UID" -> Null, "Notebook" -> "8da11258-068b-4049-b6cb-960fc64698fb"|>}, "serializer" -> "jsfn4"|>