Skip to content

Commit

Permalink
Explanatory comments
Browse files Browse the repository at this point in the history
  • Loading branch information
WardBrian committed Jul 26, 2024
1 parent 2bf3729 commit 8779e91
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gui/src/app/Scripting/Analysis/useAnalysisState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export type GlobalDataForAnalysis = {
numChains: number;
};

// A custom hook to share logic between the Python and R analysis windows
// This contains the output div refs, the interpreter state, and the data from
// the latest run.
const useAnalysisState = (latestRun: StanRun) => {
const consoleRef = useRef<HTMLDivElement | null>(null);
const imagesRef = useRef<HTMLDivElement | null>(null);
Expand Down
2 changes: 2 additions & 0 deletions gui/src/app/Scripting/DataGeneration/useDataGenState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { writeConsoleOutToDiv } from "@SpScripting/ScriptEditor";
import { InterpreterStatus } from "@SpScripting/InterpreterTypes";
import { ProjectContext } from "@SpCore/ProjectContextProvider";

// A custom hook to share logic between the Python and R data generation windows
// This contains the output div ref, the interpreter state, and the callback to update the data.
const useDataGenState = () => {
const [status, setStatus] = useState<InterpreterStatus>("idle");
const consoleRef = useRef<HTMLDivElement>(null);
Expand Down
2 changes: 2 additions & 0 deletions gui/src/app/Scripting/useTemplatedFillerText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { ProjectContext } from "@SpCore/ProjectContextProvider";
import { ProjectKnownFiles } from "@SpCore/ProjectDataModel";
import { useContext, useMemo } from "react";

// This is used to create the text span used in the ScriptEditor component when the file is empty.
// It features a brief description and a clickable link to generate an example template.
const useTemplatedFillerText = (
text: string,
template: string,
Expand Down

0 comments on commit 8779e91

Please sign in to comment.