-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2909 from quantified-uncertainty/viewer-improvements
Viewer improvements
- Loading branch information
Showing
26 changed files
with
598 additions
and
398 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 0 additions & 81 deletions
81
packages/components/src/components/DynamicSquiggleViewer.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/components/src/components/SquiggleOutputViewer/Layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { FC, ReactNode } from "react"; | ||
|
||
export const Layout: FC<{ | ||
viewer: ReactNode; | ||
menu: ReactNode; | ||
indicator: ReactNode; | ||
}> = ({ viewer, menu, indicator }) => { | ||
return ( | ||
// `flex flex-col` helps to fit this in playground right panel and doesn't hurt otherwise | ||
<div className="flex flex-col overflow-y-auto"> | ||
<div className="flex justify-between items-center px-2 h-8 mb-1"> | ||
{menu} | ||
{indicator} | ||
</div> | ||
<div | ||
className="flex-1 overflow-auto px-2 pb-1" | ||
data-testid="dynamic-viewer-result" | ||
> | ||
{viewer} | ||
</div> | ||
</div> | ||
); | ||
}; |
21 changes: 21 additions & 0 deletions
21
packages/components/src/components/SquiggleOutputViewer/RenderingIndicator.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { FC } from "react"; | ||
|
||
import { SquiggleOutput } from "../../lib/hooks/useSquiggle.js"; | ||
|
||
export const RenderingIndicator: FC<{ | ||
output: SquiggleOutput; | ||
isRunning: boolean; | ||
}> = ({ output, isRunning }) => { | ||
const showTime = (executionTime: number) => | ||
executionTime > 1000 | ||
? `${(executionTime / 1000).toFixed(2)}s` | ||
: `${executionTime}ms`; | ||
|
||
return ( | ||
<div className="text-zinc-400 text-sm whitespace-nowrap"> | ||
{isRunning | ||
? "rendering..." | ||
: `render #${output.executionId} in ${showTime(output.executionTime)}`} | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.
bb89331
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
squiggle-website – ./packages/website
squiggle-language.com
squiggle-website-git-main-quantified-uncertainty.vercel.app
squiggle-website-quantified-uncertainty.vercel.app
preview.squiggle-language.com
www.squiggle-language.com
bb89331
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
quri-hub – ./packages/hub
quri-hub-git-main-quantified-uncertainty.vercel.app
squigglehub.com
quri-hub-quantified-uncertainty.vercel.app
squiggle-hub.com
squigglehub.org
www.squigglehub.com
www.squigglehub.org
www.squiggle-hub.com
squiggle-hub.org
www.squiggle-hub.org
bb89331
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
squiggle-components – ./packages/components
squiggle-components-git-main-quantified-uncertainty.vercel.app
preview-components.squiggle-language.com
squiggle-components.vercel.app
components.squiggle-language.com
squiggle-components-quantified-uncertainty.vercel.app
bb89331
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
quri-ui – ./packages/ui
quri-ui-git-main-quantified-uncertainty.vercel.app
quri-ui.vercel.app
quri-ui-quantified-uncertainty.vercel.app